我想在 RO 和 LE 位置获取页眉;仅在 LE 获取页脚,但在我的代码中它不起作用。
梅威瑟:
\documentclass[12pt,a4paper]{article}
\usepackage{amssymb,amsmath}
\usepackage{enumerate}
\usepackage{multicol}
\usepackage{fancybox}% ovalshape boxed text
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
\chead{(\thepage)}
\fancyhead[RO,LE]{\itshape \ovalbox{M(2nd Sem)- Mathematics-H-CC-3/CBCS}}
\fancyfoot[RO]{Please Turn Over}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}
\newlength{\finalwidth}
\newlength{\tempwidthA}
\newlength{\tempwidthB}
\makeatletter
\AtEndDocument{\write\@auxout{\global\finalwidth=\the\tempwidthB}}
\makeatother
\newcommand{\marksA}[1]{% the Bourbaki trick
\settowidth{\tempwidthA}{\quad#1}%
\ifdim\tempwidthA>\tempwidthB \global\tempwidthB=\tempwidthA\fi
\unskip
{\nobreak\hfill\penalty50\hskip1em\null\nobreak
\hfill \makebox[0pt][l]{\makebox[\finalwidth][r]{\normalfont\quad#1}}%
\parfillskip=0pt \finalhyphendemerits=0 \par}%
}
\begin{document}
\thispagestyle{empty}
% \pagenumbering{roman}
\begin{flushright}
\itshape \ovalbox{M(2nd Sem)- Mathematics-H-CC-3/CBCS}
\end{flushright}
\bigskip
\begin{center}
\textbf{\Large 2019}\\[2ex]
\textbf{MATHEMATICS -- HONOURS}\\
\textbf{Paper:CC-3}\\
\textbf{(Module-I)}\\
\textbf{Full Marks: 65}\\[2ex]
{\itshape The figures in the margin indicate full marks.}\\
{\itshape Candidates are requested to give their answer in their
own words as far as practicable}\\
$\mathbb{R,Q,N}$ denotes respectively the set of all real numbers, the set of all rational numbers and the set of all natural numbers
\end{center}
% FRONT Matter
\pagenumbering{arabic}
\begin{enumerate}
\item Answer the following multiple choice questions. Choose the option with justification.\marksA{$2\times 10$}
\begin{enumerate}
\item The supreme of the complement $A$ in $\mathbb{R}$, where $A=\{x\in \mathbb{R}: x^2-3x-2\geq 0\},$
\begin{multicols}{2}
\begin{enumerate}[(i)]
\item $\{x^2:x\in [0,1]\}$
\item $\{ 5+\sqrt{7}t:t\in \mathbb{Q} \}$
\item $(0,1])\cap (\mathbb{R}\setminus \mathbb{Q})$
\item $\{\frac{1}{x}:x\in(0,\infty) \}$
\end{enumerate}
\end{multicols}
\item sub item
\begin{enumerate}[(i)]
\item sub of sub item
\item sub of sub item
\end{enumerate}
\item item
\end{enumerate}
\end{enumerate}
\newpage
Sample
\newpage
Sample
\newpage
Sample
\newpage
Sample
\end{document}