list Latex:如何创建看起来像 1.1、1.1.1、1.1.2、1.2 的嵌套列表

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/2007627/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-11 01:26:20  来源:igfitidea点击:

Latex: How can I create nested lists which look this 1.1, 1.1.1, 1.1.2, 1.2

listlatex

提问by samson

How can I create lists which look this:

如何创建看起来像这样的列表:

1. Topic
1.1 First Subtopic
1.2 Second Subtopic

I tried using the enumeration list

我尝试使用枚举列表

\begin{enumerate}
\item Topic
\begin{enumerate}
\item First Subtopic
\item Second Subtopic
\end{enumerate}
\end{enumerate}

But the output looks like:

但输出看起来像:

1. Topic
  (a) First Subtopic
  (b) Second Subtopic

So how can I get the list? Is there another list evironment or maybe an extra package?

那么我怎样才能得到这个列表呢?是否有其他列表环境或额外的包?

回答by Alok Singhal

You can use enumitempackage:

您可以使用enumitem包:

\documentclass{article}
\usepackage{enumitem}
\begin{document}

\begin{enumerate}
  \item Topic
  \begin{enumerate}[label*=\arabic*.]
    \item First Subtopic
    \item Second Subtopic
    \begin{enumerate}[label*=\arabic*.]
      \item First Sub-Subtopic
      \item Second Sub-Subtopic
    \end{enumerate}
  \end{enumerate}
\end{enumerate}

\end{document}

See the catalog entry for enumitemfor more.

有关更多信息,请参阅enumitem目录条目

回答by miku

See: http://www.giss.nasa.gov/tools/latex/ltx-222.html

见:http: //www.giss.nasa.gov/tools/latex/ltx-222.html

The numbering style for the enumeration is determined by the commands, \labelenumi, \labelenumii, etc., for the nested levels. These may be redefined with the \renewcommand command.

For example, to use upper case letters for the first level and lower case letters for the second level of enumeration:

枚举的编号样式由嵌套级别的命令 \labelenumi、\labelenumii 等确定。这些可以用 \renewcommand 命令重新定义。

例如,要对枚举的第一级使用大写字母,对第二级枚举使用小写字母:

\renewcommand{\labelenumi}{\Alph{enumi}}
\renewcommand{\labelenumii}{\alph{enumii}}

And here: http://www.mackichan.com/index.html?techtalk/484.htm~mainFrame

在这里:http: //www.mackichan.com/index.html?techtalk/ 484.htm~mainFrame

... The concrete commands would be

...具体的命令是

\renewcommand{\labelenumi}{\arabic{enumi}.} 
\renewcommand{\labelenumii}{\arabic{enumi}.\arabic{enumii}}

Or, if you think your content qualifies as sections, use something like:

或者,如果您认为您的内容符合部分的条件,请使用以下内容:

\section{Name}
...
\subsection{Subtopic}
...
\subsubsection{Yet another nesting}
...

回答by Prakhar Agarwal

No need to use any additional package

无需使用任何额外的包

\begin{enumerate}
   \item[1.] Topic
   \begin{enumerate}
       \item[1.1] First Subtopic
       \item[1.2] Second Subtopic
    \end{enumerate}
\end{enumerate}