我在文档部分有以下代码,但似乎无法让 \and 使用它 - 我认为这是由于使用此类的特定原因?
\begin{document}
% ------------------------------------------------------------------------------
% Maketitle
% ------------------------------------------------------------------------------
%\maketitle
\thispagestyle{empty} % Remove page numbering on this page
\printtitle % Print the title data as defined above
\vfill
\printauthor % Print the author data as defined above
% ------------------------------------------------------------------------------
% Begin document
% ------------------------------------------------------------------------------
% ------------------------------------------------------------------------------
% End document
% ------------------------------------------------------------------------------
\end{document}
我尝试过使用\maketitle
,但这只是弄乱了我的文档的外观,所以我想知道是否还有其他方法可以做到这一点?
完整文档:
% ------------------------------------------------------------------------------
% LaTeX Template: Titlepage
% This is a title page template which be used for both articles and reports.
%
% Copyright: http://www.howtotex.com/
% Date: April 2011
% ------------------------------------------------------------------------------
% -------------------------------------------------------------------------------
% Preamble
% -------------------------------------------------------------------------------
\documentclass[paper=a4, fontsize=11pt,twoside]{scrartcl} % KOMA article
\usepackage[a4paper,pdftex]{geometry} % A4paper margins
\setlength{\oddsidemargin}{5mm} % Remove 'twosided' indentation
\setlength{\evensidemargin}{5mm}
\usepackage[english]{babel}
\usepackage[protrusion=true,expansion=true]{microtype}
\usepackage{amsmath,amsfonts,amsthm,amssymb}
\usepackage{graphicx}
% ------------------------------------------------------------------------------
% Definitions (do not change this)
% ------------------------------------------------------------------------------
\newcommand{\HRule}[1]{\rule{\linewidth}{#1}} % Horizontal rule
\makeatletter % Title
\def\printtitle{%
{\centering \@title\par}}
\makeatother
\makeatletter % Author
\def\printauthor{%
{\centering \large \@author}}
\makeatother
% ------------------------------------------------------------------------------
% Metadata (Change this)
% ------------------------------------------------------------------------------
\title{ \normalsize \textsc{Biomechatronics} % Subtitle of the document
\\[2.0cm] % 2cm spacing
\HRule{0.5pt} \\ % Upper rule
\LARGE \textbf{\uppercase{Exercise vs. Effort}} % Title
\HRule{2pt} \\ [0.5cm] % Lower rule + 0.5cm spacing
\normalsize \today % Todays date
}
\author{
Author 1\\
\and
Author 2\\
}
\begin{document}
% ------------------------------------------------------------------------------
% Maketitle
% ------------------------------------------------------------------------------
\thispagestyle{empty} % Remove page numbering on this page
\printtitle % Print the title data as defined above
\vfill
\printauthor % Print the author data as defined above
% ------------------------------------------------------------------------------
% Begin document
% ------------------------------------------------------------------------------
% ------------------------------------------------------------------------------
% End document
% ------------------------------------------------------------------------------
\end{document}
答案1
您使用非标准方式显示标题和作者信息。标准scrartcl
将作者存储在环境\@author
中并将其打印出来table
。的标准定义\and
旨在提供适当的命令。使用\printauthor
宏时,您应该为您的设置提供相应的定义\and
。最合适的似乎是提供一些垂直空间,例如通过
\renewcommand{\and}{\vspace{1cm}}
% ------------------------------------------------------------------------------
% LaTeX Template: Titlepage
% This is a title page template which be used for both articles and reports.
%
% Copyright: http://www.howtotex.com/
% Date: April 2011
% ------------------------------------------------------------------------------
% -------------------------------------------------------------------------------
% Preamble
% -------------------------------------------------------------------------------
\documentclass[paper=a4, fontsize=11pt,twoside]{scrartcl} % KOMA article
\usepackage[a4paper,pdftex]{geometry} % A4paper margins
\setlength{\oddsidemargin}{5mm} % Remove 'twosided' indentation
\setlength{\evensidemargin}{5mm}
\usepackage[english]{babel}
\usepackage[protrusion=true,expansion=true]{microtype}
\usepackage{amsmath,amsfonts,amsthm,amssymb}
\usepackage{graphicx}
% ------------------------------------------------------------------------------
% Definitions (do not change this)
% ------------------------------------------------------------------------------
\newcommand{\HRule}[1]{\rule{\linewidth}{#1}} % Horizontal rule
\makeatletter % Title
\def\printtitle{%
{\centering \@title\par}}
\makeatother
\makeatletter % Author
\renewcommand{\and}{\vspace{1cm}}
\def\printauthor{%
{\centering \large \@author}}
\makeatother
% ------------------------------------------------------------------------------
% Metadata (Change this)
% ------------------------------------------------------------------------------
\title{ \normalsize \textsc{Biomechatronics} % Subtitle of the document
\\[2.0cm] % 2cm spacing
\HRule{0.5pt} \\ % Upper rule
\LARGE \textbf{\uppercase{Exercise vs. Effort}} % Title
\HRule{2pt} \\ [0.5cm] % Lower rule + 0.5cm spacing
\normalsize \today % Todays date
}
\author{
Author 1\\
\and
Author 2\\
}
\begin{document}
% ------------------------------------------------------------------------------
% Maketitle
% ------------------------------------------------------------------------------
\thispagestyle{empty} % Remove page numbering on this page
\printtitle % Print the title data as defined above
\vfill
\printauthor % Print the author data as defined above
% ------------------------------------------------------------------------------
% Begin document
% ------------------------------------------------------------------------------
% ------------------------------------------------------------------------------
% End document
% ------------------------------------------------------------------------------
\end{document}