是否可以修改 LaTeX 中默认的标题页?示例:
\documentclass[pdftex,12pt,a4paper,english,dutch,leqno]{article}
\usepackage[utf8]{inputenc}
\usepackage{authblk}
%title and author details
\title{This is the title for my work}
\author[1]{Name1}
\author[1]{Name2}
\affil[1]{Address of author}
\renewcommand\Authands{ and }
\date{} %remove date
\begin{document}
\maketitle
\end{document}
我想改变这一点,使标题页向左(即不居中)并且字体大小与文档的其余部分相同。如何实现?
答案1
使用authblk
是一个好主意,但它仍然利用了标准\maketitle
命令,即居中。所以我们必须修补它。
\documentclass[12pt,a4paper]{article}
\usepackage{lipsum}
\usepackage{authblk,etoolbox}
\makeatletter
% patch \maketitle so that it doesn't center
\patchcmd{\@maketitle}{center}{flushleft}{}{}
\patchcmd{\@maketitle}{center}{flushleft}{}{}
% patch \maketitle so that the font size for the title is normal
\patchcmd{\@maketitle}{\LARGE}{\normalsize}{}{}
% patch the patch by authblk so that the author block is flush left
\def\maketitle{{%
\renewenvironment{tabular}[2][]
{\begin{flushleft}}
{\end{flushleft}}
\AB@maketitle}}
\makeatother
% a couple of other settings
\renewcommand\Authands{ and }
\renewcommand\Authfont{\normalfont\normalsize}
\renewcommand\Affilfont{\normalfont\normalsize}
\begin{document}
%title and author details
\title{This is the title for my work}
\author[1]{Name1}
\author[1]{Name2}
\affil[1]{Address of author}
\date{} %remove date
\maketitle
\lipsum[1]
\end{document}
如您所见,标题似乎没有得到充分突出显示,因此您可能更愿意在第三个中使用其他内容\patchcmd
,例如\normalsize\bfseries
或\large
答案2
您应该重新定义宏\maketitle
或使用环境titlepage
(参见示例http://theoval.cmp.uea.ac.uk/~nlct/latex/thesis/node18.html)
\documentclass[pdftex,12pt,a4paper,english,dutch,leqno]{article}
\usepackage[utf8]{inputenc}
\renewcommand{\maketitle}{%
\textbf{This is the title of my work}
\par \vspace{.5ex}
Name1 and Name2
\par
\textsl{Address of author}
\par
\hrulefill\par \vspace{2ex}
}
\begin{document}
\maketitle
Test
\end{document}