同一文件的不同段落中enumerate语句出现不同效果

发布于 2021-03-25 20:10:38

如图,同一个文档下的emumerate编号递增为什么会出现不同情况。。。
P.S.因为是帮老师打教案的,只能直接发对应章节的子程序给老师,所以主程序的emumerate包不能改成enumitem。

\documentclass[10pt,twoside,openany]{book}
\usepackage{enumerate}
\begin{document}
\tableofcontents
\input{test}
\end{document}
  \emph{In Problems $9-12$, find the equation of the given central conic.}
\begin{enumerate}[9.]
  \item  Ellipse with a focus at $(-3,0)$ and a vertex at $(6,0)$
  \item  Ellipse with a focus at $(0,-5)$ and eccentricity$\frac{1}{3}$
  \item Hyperbola with a focus at $(5,0)$ and a vertex at $(4,0)$
  \item  Hyperbola with a vertex at $(90.-3)$ and eccentricity$\frac{3}{2}$
\end{enumerate}

\emph{In Problems $16-18$, find $dy/dx$ and $d^2 y/dx^2$ without eliminating the parameter.}
\begin{enumerate}[16.]
  \item $x=3r^2$, $y=4r^3$; $r\neq 0$
  \item  $x=1-\cos{t}$, $y=1+\sin{t}$; $t\neq  n\pi$
  \item $x=3\tan{t}-1$, $y=5\sec{t}+2$; $t\neq \frac{(2n+1)\pi}{2}$
\end{enumerate}

\emph{In Problems $21-24$, find the Cartesian equations of the graphs of the given polar equations.}
 \begin{enumerate}[21.]
   \item $\theta=\frac{1}{2}\pi$
   \item $r=3$
   \item $r-5\cos\theta=0$
   \item $r\sin\theta-1=0$
 \end{enumerate}

最终呈现出的效果:QQ图片20210325201020.png

查看更多

关注者
0
被浏览
1.1k
拿了橘子跑啊
拿了橘子跑啊 2021-03-26
这家伙很懒,什么也没写!

要搞清楚,enumerate(或者使用了 shortlabels 选项的 enumitem)表示标签的参数只有 1aAiI 这几个有特殊定义,其余的短标签参数都是直接替代标签,所以 [9.] 这种标签就会把所有编号都变成 9.[16.] 就会变成 \theenumi6.[21.] 就变成了 2\theenumi.,那当然是不对了(最后一个是凑巧还合适)。想用 enumerate 包解决这个问题,只好手动设置计数器 enumi,在 enumerate 环境中,一开始就指定 enumi 为需要的数值减一。如:

\documentclass[10pt,twoside,openany]{book}
\usepackage{enumerate}
\begin{document}
  \emph{In Problems \ref{prb:9}--\ref{prb:12}, find the equation of the given central conic.}
\begin{enumerate}[1.]
  \setcounter{enumi}{8}
  \item\label{prb:9}  Ellipse with a focus at $(-3,0)$ and a vertex at $(6,0)$
  \item  Ellipse with a focus at $(0,-5)$ and eccentricity$\frac{1}{3}$
  \item Hyperbola with a focus at $(5,0)$ and a vertex at $(4,0)$
  \item\label{prb:12}  Hyperbola with a vertex at $(90.-3)$ and eccentricity$\frac{3}{2}$
\end{enumerate}

\emph{In Problems \ref{prb:16}--\ref{prb:18}, find $dy/dx$ and $d^2 y/dx^2$ without eliminating the parameter.}
\begin{enumerate}[1.]
  \setcounter{enumi}{15}
  \item\label{prb:16} $x=3r^2$, $y=4r^3$; $r\neq 0$
  \item  $x=1-\cos{t}$, $y=1+\sin{t}$; $t\neq  n\pi$
  \item\label{prb:18} $x=3\tan{t}-1$, $y=5\sec{t}+2$; $t\neq \frac{(2n+1)\pi}{2}$
\end{enumerate}

\emph{In Problems \ref{prb:21}--\ref{prb:24}, find the Cartesian equations of the graphs of the given polar equations.}
 \begin{enumerate}[1.]
   \setcounter{enumi}{20}
   \item\label{prb:21} $\theta=\frac{1}{2}\pi$
   \item $r=3$
   \item $r-5\cos\theta=0$
   \item\label{prb:24} $r\sin\theta-1=0$
 \end{enumerate}
\end{document}

BTW:你在原来的文件中的引用做得不好,这种引用一旦要改动几项,工作量是巨大的。 \item 也可以使用\label 来打标签,用 \ref 来做引用。还有,建议和你的老师沟通使用 enumitem 包,加上 shortlabels 选项是兼容 enumerate 包这种短标签格式的,代码不需要改什么,而且,不需要手动去设置计数器了,一旦需要修改,在编号调整这方面几乎没有工作量。

2 个回答
如果您有什么不同意见,您是对的,我是错的。
这家伙很懒,什么也没写!

直接跟老师对线,建议他用 enumitem/tasks,没必要折腾自己

撰写答案

请登录后再发布答案,点击登录

发布
问题

分享
好友

手机
浏览

扫码手机浏览