發新話題
打印

[LaTeX] 版面設定→頁首、頁尾(fancyhdr 套件)

想請教一下,我是用exam 環境下製作考卷

我使用fancyhdr製作頁首頁尾,會出現問題...

會出現
「Command \lhead already defined. Or name \end... illegal, see p.192 of the manual.
    See the LaTeX manual of LaTeX Companion for explanation. Type H <return> for immediate help.
    l.266 ... \lhead}{\@ifnextchar}{\@xlhead}{\@ylhead}」

這是我的設定碼

\documentclass[12pt,b4paper]{exam}

\usepackage{fontspec} % 允許設定字體
\usepackage{amsmath,amsthm,amssymb}
\usepackage{xeCJK} % 分開設置中英文字型
\setCJKmainfont{Kaiti TC} % 設定中文字型
%\setmainfont{Georgia} % 設定英文字型
%\setromanfont{Georgia} % 字型
%\setmonofont{Courier New}
\usepackage{Rvector}
\usepackage{stmaryrd}
\usepackage[left=1cm, right=1cm, bottom=1.9cm]{geometry}
\renewcommand\choicelabel{(\thechoice)} %將選擇題選項改成(A)....
\XeTeXlinebreaklocale "zh" % 針對中文自動換行
\XeTeXlinebreakskip = 0pt plus 1pt % 字與字之間加入0pt至1pt的間距,確保左右對整齊
%\parindent 0em % 段落縮進
%\setlength{\parskip}{20pt} % 段落之間的距離

\extrawidth{+0.6in}
\pointsinmargin
\marginpointname{\%}


\usepackage{fancyhdr}
%\usepackage{lastpage}
\pagestyle{fancyplain}
\lhead{\fancyplain{}{FoolEgg.com}} % 左頁首
\chead{} % 中頁首
\rhead{\fancyplain{}{在OSX平台上的XeLaTeX中文測試}} % 右頁首
\lfoot{} % 左頁尾
\cfoot{\fancyplain{}{\thepage\ of \pageref{LastPage}}} % 中頁尾
\rfoot{} % 右頁尾
\begin{document}
...
\end{document}


反而使用
\pagestyle{headandfoot}
\firstpageheader{\large\bf 1.答案卡\\\LARGE{104學年度第1學期第2次期中考高三數學科題目卷}\\班級:$\qquad\qquad$姓名:$\qquad\qquad\qquad$座號:$\quad$}{}{}

這樣子就沒有問題@@

TOP

發新話題