TeX - LaTeX Asked on January 11, 2021
I am using tufte-handout
. I have centered parts
and sections
using sectsty
. How can I center the title, the author, and the date?
%%%%%%%%%%%%%%%%%%%%
documentclass[]{tufte-handout}
usepackage{sectsty}
allsectionsfont{centering}
usepackage{lipsum}
%%%%%%%%%%%%%%%%%%%%
% How to center them?
title{Homework}
author{hengxin}
date{today}
%%%%%%%%%%%%%%%%%%%%
begin{document}
maketitle
%%%%%%%%%%%%%%%%%%%%
begin{abstract}
Abstract here~footnote{footnote}.
lipsum[10]
end{abstract}
%%%%%%%%%%%%%%%%%%%%
begin{center}
fbox{begin{tabular}{@{}c@{}}
Note 1: 123456789
Note 2: 123456789
end{tabular}}
end{center}
%%%%%%%%%%%%%%%%%%%%
part{Part I}
lipsum[2]~footnote{problems}
$a + b = c$
section{Section 1}
%%%%%%%%%%%%%%%%%%%%
end{document}
I've copied the source code from the tufte-common.def
and modified to meet the centered alignment, here are the modified tags:
%%%%%%%%%%%%%%%%%%%%
documentclass[]{tufte-handout}
usepackage{sectsty}
allsectionsfont{centering}
usepackage{lipsum}
%%%%%%%%%%%%%%%%%%%%
% How to center them?
makeatletter
renewcommand{maketitle}{%
newpage
global@topnumz@% prevent floats from being placed at the top of the page
begingroup
setlength{parindent}{0pt}%
setlength{parskip}{4pt}%
let@@title@empty
let@@author@empty
let@@date@empty
ifthenelse{boolean{@tufte@sfsidenotes}}{%
gdef@@title{sffamilyLARGEallcaps{@title}par}%
gdef@@author{sffamilyLargeallcaps{@author}par}%
gdef@@date{sffamilyLargeallcaps{@date}par}%
}{%
gdef@@title{LARGEitshapecentering@titlepar}%
gdef@@author{Largeitshapecentering@authorpar}%
gdef@@date{Largeitshapecentering@datepar}%
}%
@@title
@@author
@@date
endgroup
thispagestyle{plain}% suppress the running head
tuftebreak% add some space before the text begins
@afterindentfalse@afterheading% suppress indentation of the next paragraph
}
makeatother
title{Homework}
author{hengxin}
date{today}
%%%%%%%%%%%%%%%%%%%%
begin{document}
maketitle
%%%%%%%%%%%%%%%%%%%%
begin{abstract}
Abstract here~footnote{footnote}.
lipsum[10]
end{abstract}
%%%%%%%%%%%%%%%%%%%%
begin{center}
fbox{begin{tabular}{@{}c@{}}
Note 1: 123456789
Note 2: 123456789
end{tabular}}
end{center}
%%%%%%%%%%%%%%%%%%%%
part{Part I}
lipsum[2]~footnote{problems}
$a + b = c$
section{Section 1}
%%%%%%%%%%%%%%%%%%%%
end{document}
Output
Answered by MadyYuvi on January 11, 2021
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP