“未使用的全域選項”錯誤訊息

“未使用的全域選項”錯誤訊息

我正在嘗試做數學作業,我的教授為我們提供了模板的程式碼。

我過去已經完成了所有作業,將其複製並貼上到新文件中,然後開始添加我的程式碼,沒有任何問題。

但是,這次當我貼上模板程式碼後嘗試編譯時,我收到一條錯誤訊息「未使用的全域選項」。我該如何解決?

這是模板程式碼:

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Do not alter the next line
\documentclass[12pt,reqno,onesided]{article}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Fill in the appropriate information below
\newcommand{\DueDate}{10/31/19}           %change every time 

\newcommand{\Pin}{100}                    %change first time
\newcommand{\Name}{Engergizer Bunny}      %change first time
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%Do not alter this block of commands.
%If you're proficient at LaTeX, you may include additional packages,
%create macros (newcommands), etc.
%immediately below this block of commands, but make sure to
%NOT alter the header, margin, and comment settings here. 

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage{amsmath,amsthm,amssymb,amsfonts,enumitem,color,comment,graphicx,environ}
\usepackage{wasysym}   %\smiley
\usepackage[dayofweek]{datetime}
%%%%%%%%%%%%%%%%%%%%%
\setlength{\textwidth}{500pt}
\setlength{\hoffset}{-68.4pt}
\setlength{\textheight}{650pt}  %700
\setlength{\voffset}{5pt}
\setlength{\topmargin}{-57.6pt} 
\setlength{\footskip}{32pt} 
%\setlength{\parindent}{0pt}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage{fancyhdr,lastpage}
\pagestyle{fancyplain}
\lhead{Math 300}
\chead{}
\rhead{Pin: \Pin\\ \Name\\ {\tiny Due Date:} \DueDate} 
\lfoot{\footnotesize Last Modified: \today~at \currenttime} 
\cfoot{}
\rfoot{\footnotesize Page \thepage\  of \pageref{LastPage}}
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%5
\renewcommand{\headrulewidth}{0.4pt}
\renewcommand{\footrulewidth}{0.4pt}
\setlength{\headheight}{23pt}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newenvironment{exercise}[1]
           {\baselineskip 14 pt\vskip 10 pt\noindent\textbf{Exercise~#1.}}
           {\vsp{0}\hsp{100}\makebox[200pt]{\dotfill}\vsp{5}}
\newenvironment{lemma}[1]
           {\baselineskip 14 pt\vskip 10 pt\noindent\textbf{Lemma~#1.}}
           {\vsp{0}\hsp{100}\makebox[200pt]{\dotfill}\vsp{5}}
\newcommand{\soln}{\noindent\textsc{Solution}.  }          
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newcommand{\N}{\mathbb N}      % how to make the Natural Numbers symbol. 
\newcommand{\R}{\mathbb R}
\newcommand{\Q}{\mathbb Q}
\newcommand{\Z}{\mathbb Z}  
\newcommand{\lp}{\left(}        % left parentheses
\newcommand{\rp}{\right)}       % right parentheses
\newcommand{\lc}{\left\{}       % left curly  
\newcommand{\rc}{\right\}}      % right curly 
\newcommand{\lb}{\left[}        % left bracket 
\newcommand{\rb}{\right]}       % right bracke
\newcommand{\lav}{\left\vert}   % left absolute value 
\newcommand{\rav}{\right\vert}  % right absolute value
\newcommand{\lv}{\left\langle\,}   % left vector sign  <
\newcommand{\rv}{\,\right\rangle}  % right vector sign >
\newcommand{\hsp}[1]{\hskip #1 pt}  
\newcommand{\vsp}[1]{\vskip #1 pt}
\newcommand{\tn}[1]{\textnormal{{#1}}}
\newcommand{\mycomment}[1]{\textrm{\scriptsize $\left\langle\right.$\textrm{#1}$\left.\right\rangle$}} % comment to yourself
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%  You can start adding your own newcommand (i.e., alias/macros)



%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Do not alter this block.
\begin{document}
\baselineskip 22 pt % 22 pt is double spaced. 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Start your homework here










%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Do not alter anything below this line.
\vfill\eject
\end{document}

答案1

你得到的不是錯誤訊息.相反,它只是以下內容警告訊息:

LaTeX Warning: Unused global option(s):
    [onesided].

你有兩個選擇(雙關語):

  • 忽略無害的警告。

  • 刪除未使用的全域選項,即更改指令

    \documentclass[12pt,reqno,onesided]{article}
    

    \documentclass[12pt,reqno]{article}
    

最後的評論:您的講師模板的程式碼效率非常低,並且包含毫無意義的指令,例如\vfill\eject之前的\end{document}.如果您遇到各種看起來隨機的警告訊息,我不會感到驚訝。

答案2

為@Mico 新增第三個解決方案—您可以替換拼字錯誤。實際上,正確的課程選擇是onesideonesided不像你的教授所說的)。oneside恰好是articlereport類別的預設值。由於可以安全地省略預設選項,因此我的建議也可以安全地減少並追溯到 Micos 的第二個解決方案。

但是,由於我們現在浪費大量資源,包括紙張,我建議您忽略教授的命令,將文件的第一行更改為

\documentclass[12pt,twoside]{article}

編輯:試圖使佈局的要點更加清晰

這會將文件的佈局變更為雙面,即準備文件以在一張紙上列印兩個邏輯頁面,從而為您(和我們的環境)節省約 50% 的紙張使用量。顯然,您的印表機也必須支援雙面列印。

相關內容