
我正在努力做数学作业,我的教授为我们提供了模板的代码。
我过去完成每项作业都是将其复制并粘贴到新文档中,然后开始添加我的代码,没有任何问题。
但是,这次当我粘贴模板代码后尝试编译时,我收到一条错误消息,提示“未使用的全局选项”。我该如何修复此问题?
以下是模板代码:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%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 添加第三个解决方案——您可以替换拼写错误。实际上,正确的类选项应该是oneside
(不是onesided
您的教授所说的)。oneside
恰好是article
和report
类的默认选项。由于可以安全地省略默认选项,因此我的建议也可以安全地减少并追溯到 Micos 的第二个解决方案。
但是,由于我们如今浪费了大量的资源,包括纸张,我建议你忽略教授的命令,将文档的第一行改为
\documentclass[12pt,twoside]{article}
编辑:试图使布局的要点更加清晰
这会将文档的布局更改为双面,即准备在一张纸上打印两个逻辑页面的文档,为您(和我们的环境)节省大约 50% 的纸张使用量。显然,您的打印机也必须支持双面打印。