答案1
我不知道你把标题、作者和日期存储在哪里,因此我为此创建了新的宏,它还允许使用标题和作者姓名的简短版本。但当然,你可以根据自己的喜好进行调整。表格环境的使用基于以下问题的答案中的建议这个问题。
\documentclass{article}
\usepackage[landscape, a4paper, twocolumn, margin=3cm, columnsep=2cm,
headheight=1.5cm, top=3.5cm, headsep=.5cm]{geometry}
\usepackage{array, booktabs, afterpage}
\newcommand{\mytitle}[2][]{%
\newcommand{\myshorttitle}{#1}%
\newcommand{\mylongtitle}{#2}%
}
\newcommand{\myauthor}[2][]{%
\newcommand{\myshortauthor}{#1}%
\newcommand{\mylongauthor}{#2}%
}
\newcommand{\mynumberdate}[2]{%
\newcommand{\mynumber}{#1}%
\newcommand{\mydate}{#2}%
}
\usepackage{fancyhdr}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}
\fancyfoot[C]{\thepage}
\fancyhead[L]{%
\begin{tabular}{ @{} p{.333\textwidth}
@{} >{\centering}p{.333\textwidth}
@{} >{\raggedleft\arraybackslash}p{.333\textwidth} @{} }
\myshortauthor & \myshorttitle & \mydate \\ \midrule
\end{tabular}%
}
\fancypagestyle{fancyfirstpage}{%
\fancyhf{}
\fancyfoot[C]{\thepage}
\fancyhead[L]{%
\begin{tabular}{ @{} p{.5\textwidth}
@{} >{\raggedleft\arraybackslash}p{.5\textwidth} @{} }
\textbf{\mylongtitle} & \\ \midrule
\mylongauthor & \mynumber \\ & \mydate
\end{tabular}%
}
}
\pagestyle{fancy}
\usepackage{lipsum}
\begin{document}
\thispagestyle{fancyfirstpage}
\mytitle[Meaning of Life]{An Introduction to the Meaning of Life}
\myauthor[Smith]{Mary Smith}
\mynumberdate{PHIL1001}{1 January 2021}
\lipsum[1-10]
\end{document}