答案1
Regarding your second block of code. It is a revision of the `myheadings` page style.
但是我认为也许最好把它叫做别的名字course
?
This code sets up the text for odd and even page footers
\def\oddfoottext{\begin{footnotesize}\coursenumber, \semester, \title \hfill\qquad\thepage\end{footnotesize}}
\def\evenfoottext{\begin{footnotesize}\thepage \hfill\qquad\coursenumber, \semester, \title\end{footnotesize}}
Now defining the pagestyle.
\newcommand{ps@course}
%\def\ps@myheadings{\let\@mkboth\@gobbletwo % use nothing from sectional divisions
\def\@oddfoot{\oddfoottext}% footer text on odd pages
\def\@evenfoot{\evenfoottext}% footer text on even pages
\def\@evenhead{}\def\@oddhead{}}% empty odd and even headers
%\pagestyle{myheadings} % use the `myheadings` page style
\pagestyle{course} % use the `course` page style
您引用的代码来自一个包。如果您想在文档中使用它,请将其括在\makeatletter... \makeatother
代码本质上就是 LaTeX 内核中页面样式的定义方式。