想要在LaTeX中获得大胆的奇数列表吗? [英] Hot to get a bold odd-numbered list in LaTeX?

查看:61
本文介绍了想要在LaTeX中获得大胆的奇数列表吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

\begin{enumerate}[label=\textbf{\arabic*.}]
   \item Numbered 1
   \addtocounter{enumi}{1}
   \item Numbered 3
   \addtocounter{enumi}{1}
   \item Numbered 5
   \addtocounter{enumi}{1}
   \item Numbered 7
   \addtocounter{enumi}{1}
   \item and so on...
\end{enumerate}

是否有更好的方法枚举给您一个仅包含奇数的列表,而不必在每个项目之间添加\ addtocounter?

Is there a better way to get enumerate to give you a list of just the odd numbers without having to add an \addtocounter between every item?

推荐答案

Reworking 来自 TeX.SX 的参考很快,我的第一个建议就是使用环境 itemize 而不是 enumerate :

Reworking this reference from TeX.SX quickly enough, my first suggestion would be the following, using the environment itemize instead of enumerate:

\documentclass{article}
\begin{document}
\begin{itemize}
  \item [\textbf{1}] Numbered 1
  \item [\textbf{3}] Numbered 3
  \item [\textbf{5}] Numbered 5
  \item [\textbf{7}] Numbered 7
  \item [\textbf{9}] and so on...
\end{itemize}
\end{document}

但是接下来的问题可能是:是否有更好的方法来获得我想要的……而不必在可选选项中添加 \ textbf 当然,是的,为了简单起见,我再次想到的是在这里尝试环境 description .如果编译下面的代码,您将看到仅"缩进的两种方式.现在,可以在本地或全局设置环境缩进,也可以重新定义,但绝对不在此范围之内.

But then the question may become: is there a better way to get whay I want ... without having to add a \textbf to the optional argument of every item? Of course yes and, to keep it easy, again my first thought was to try the environment description here. If you compile the code below, you'll see the two ways "only" differ in indentation. Now the indentation of an environment may be set locally or globally or redefined, but definitely out of this scope.

\documentclass{article}
\begin{document}
\begin{itemize}
  \item [\textbf{1}] Numbered 1
  \item [\textbf{3}] Numbered 3
  \item [\textbf{5}] Numbered 5
  \item [\textbf{7}] Numbered 7
  \item [\textbf{9}] and so on...
\end{itemize}

Some text.

\begin{description}
    \item [1] Numbered 1
    \item [3] Numbered 3
    \item [5] Numbered 5
    \item [7] Numbered 7
    \item [9] and so on...
\end{description}
\end{document}

这篇关于想要在LaTeX中获得大胆的奇数列表吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆