如何将标题、作者和日期置于 Tufte 讲义的中央?

如何将标题、作者和日期置于 Tufte 讲义的中央?

我正在使用tufte-handout。我已经居中partssections使用sectsty。我怎样才能将标题、作者和日期居中?

%%%%%%%%%%%%%%%%%%%%
\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}

答案1

我从中复制了源代码tufte-common.def并进行了修改以满足居中对齐,以下是修改后的标签:

%%%%%%%%%%%%%%%%%%%%
\documentclass[]{tufte-handout}

\usepackage{sectsty}
\allsectionsfont{\centering}

\usepackage{lipsum}
%%%%%%%%%%%%%%%%%%%%
% How to center them?

\makeatletter
\renewcommand{\maketitle}{%
  \newpage
  \global\@topnum\z@% 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{\sffamily\LARGE\allcaps{\@title}\par}%
      \gdef\@@author{\sffamily\Large\allcaps{\@author}\par}%
      \gdef\@@date{\sffamily\Large\allcaps{\@date}\par}%
    }{%
      \gdef\@@title{\LARGE\itshape\centering\@title\par}%
      \gdef\@@author{\Large\itshape\centering\@author\par}%
      \gdef\@@date{\Large\itshape\centering\@date\par}%
    }%
    \@@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}

输出

在此处输入图片描述

相关内容