wildgoat的个人空间 https://blog.eetop.cn/wildgoat [收藏] [复制] [分享] [RSS]

空间首页 动态 记录 日志 相册 主题 分享 留言板 个人资料

日志

[ZZ] [Latex] Changing the enumeration counter

已有 1142 次阅读| 2013-1-6 14:18 |个人分类:Latex相关


Examples of enumerations

This section hardly needs any explanation. Sometimes it is not enough  with just the ordinary arabic enumeration counter. With the enumeratepackage, it is possible to change the arabic numbers into letters or  roman numbers (lower or upper case), and the dot into other symbols,  like a dash or parenthesis, or even some other text. The enumerate package documentationcontains some other examples.

Another thing you sometimes want to do is to change the number of the  counter. In my example I have inserted a comment regarding all  subsequent items, which means I do not want that comment indented. My  solution to this is to end the enumeration, write the comments and then  start a new enumeration. Before the first enumeration ended I saved the  counter, and before the first \itemin the second enumeration I restored it. (The variable enumii_savedhas just a dummy name, it could be called something else.) If I had  wanted to change the counter of the top level enumeration, I had  obviously changed enumiinstead. As you can see, I can set  the number directly as well. Arabic numbers are always used for LaTeX  counters, even if they are represented otherwise in the document. The 7is the number I want LaTeX to think was the last one written. For small  documents, this will probably be the easiest solution to the  continuation problem as well, but for large documents there is always  the risk that you forget that you added a new item, and you end up with  two items number 19, for example.

\documentclass{article}
\usepackage{enumerate}
\begin{document}
  \begin{enumerate}
    \item This is an example of \ldots
    \item \ldots the usual enumeration.
    \begin{enumerate}[a)]
      \item And this is a \ldots
      \item \ldots couple of \ldots
    \end{enumerate}
    \item
    \begin{enumerate}[-- i --]
      \item \ldots examples of \ldots
      \item \ldots custom-tailored \ldots
      \item \ldots enumerations.
      \newcounter{enumii_saved}
      \setcounter{enumii_saved}{\value{enumii}}
    \end{enumerate}
    Some general comments
    \begin{enumerate}[-- i --]
      \setcounter{enumii}{\value{enumii_saved}}
      \item My next point.
      \setcounter{enumii}{7}
      \item My eighth point.
    \end{enumerate}
  \end{enumerate}
\end{document}



点赞

评论 (0 个评论)

facelist

您需要登录后才可以评论 登录 | 注册

  • 关注TA
  • 加好友
  • 联系TA
  • 0

    周排名
  • 0

    月排名
  • 0

    总排名
  • 0

    关注
  • 121

    粉丝
  • 41

    好友
  • 269

    获赞
  • 117

    评论
  • 22096

    访问数
关闭

站长推荐 上一条 /1 下一条

小黑屋| 关于我们| 联系我们| 在线咨询| 隐私声明| EETOP 创芯网
( 京ICP备:10050787号 京公网安备:11010502037710 )

GMT+8, 2024-3-29 23:02 , Processed in 0.013349 second(s), 7 queries , Gzip On, Redis On.

eetop公众号 创芯大讲堂 创芯人才网
返回顶部