latex列表
枚举、列举和描述
\begin{list_type}
\item The first item
\item The second item
\item The third etc \ldots
\end{list_type}
默认的 list_type 有 enumerate、 itemize 和 description,区别主要是列项标签的不同。enumerate 是有序的列表;itemize 用圆点;description 需要 \item[label] 指定标签。各种列表环境可以互相嵌套,此时,enuemrate 的标签会自动变化以体现分级层次。
如果不想让列项第一行和标签同行,加一个 \hfill。
\begin{description}
\item[First] \hfill \\
The first item
\item[Second] \hfill \\
The second item
\item[Third] \hfill \\
The third etc \ldots
\end{description}
紧凑的列表
以上的列表环境空白较大,如果需要更紧凑的列表方式,可以选用 mdwlist 宏包提供的 itemize*、enumerate* 和 description* 环境,用法和无星号的版本一致。
定制列表环境
距离
在列表的内部,很容易改变一些距离
\begin{itemize}
\setlength{\itemsep}{1pt}
\setlength{\parskip}{0pt}
\setlength{\parsep}{0pt}
\item first item
\item second item
\end{itemize}
更详细的参数需要看下面 list 环境。
标签和计数器
枚举的列表计数可以通过其计数器来改变。enumerate 提供了四个计数器 enumi,enumii,enumiii, enumiv 对应不同层次的枚举。
\begin{enumerate}
\setcounter{enumi}{4}
\item fifth element
\end{enumerate}
会产生
5. fifth element
LaTeX 可以用其他格式打印这些计数器的值,
命令 例子
\arabic 1, 2, 3 ...
\alph a, b, c ...
\Alph A, B, C ...
\roman i, ii, iii ...
\Roman I, II, III ...
\fnsymbol 星号,单剑号,双剑号等
% 重定义第一级计数显示
\renewcommand{\theenumi}{\Roman{enumi}}
\renewcommand{\labelenumi}{\theenumi}
% 重定义第二级计数显示
\renewcommand{\theenumii}{\Alph{enumii}}
\renewcommand{\labelenumii}{(\theenumii)}
这样看起来有些麻烦。有时候直接写
\renewcommand{\labelenumi}{\Roman{enumi}}
但是这样有一个缺点:如果在列表内部引用这些计数器,就会按原来的格式打印。
对列举 itemize 而言,无须计数。标签的形式可以通过 \item[label] 来改变。或者通过各级 \labelitemi,\labelitemii,\labelitemiii,\labelitemiv。所以
\item[$\star$]
等价于
\renewcommand{\labelitemi}{$\star$}
enumerate 宏包
enumerate 宏包为 enumerate 提供了更灵活的标签。可以使用 A,a,I,i,1 作为可选项产生 \Alph,\alph,\Roman,\roman,\arabic 的效果。
usepackage{enumerate}
......
\begin{enumerate}[(i)]
\item The first item
\item The second item
\item The third etc \ldots
\end{enumerate}
行内列表
paralist 宏包提供了 inparaenum 环境,产生不分段的列表。同样支持跟上面 enumerate 宏包类似的格式化标签。
\usepackage{paralist}
......
\textbf{\itshape Inline lists}, which are sequential in nature, just like enumerated lists, but are
\begin{inparaenum}[\itshape a\upshape)]
\item formatted within their paragraph;
\item usually labelled with letters; and
\item usually have the final item prefixed with `and' or `or',
\end{inparaenum} like this example.
list 环境
最有可定制性的当属 list 环境。以上的 enumerate, itemize,description 其本质上都是封装好的 list 环境。
\begin{list}{label}{spacing}
\item First item
\item Second item
\end{list}
其中, label 的内容将会作为标签,放在一个单独的盒子里,出现在每一 item 之前。也可以通过 \item[label] 来实现。
spacing 设定一些距离。通常为空,因为默认距离已经足够好了。
* \topsep 列表顶部与之前内容的额外空白,不含 \baselineskip
* \partopsep 如果列表之前是一个空行,列表顶部的额外空白
* \itemsep 列表各项之间额外的垂直空白
* \parsep 一个 item 中,如果分段,段落间额外空白
* \leftmargin 列表与左边距之间的水平距离,值为非负
* \rightmargin 列表与右边距之间的水平距离,值为非负
* \itemindent 每一 item 第一行的缩进
* \listparindent 每一 item 第一行之后各行的缩进
* \labelsep 标签盒子与每一 item 第一行文本之间距离
* \labelwidth 标签盒子的宽度;如果标签过长,这一宽度会自动变大,直到列表的第一行文本为止
* \makelabel{label} 生成 \item[label] 命令所要求的标签
* \usecounter{ctr} 使用列表项目计数器 ctr,初始值为 0
一个例子
% 定义计数器
\newcounter{Lcount}
% 标签计数显示为罗马数字
\begin{list}{Item-\Roman{Lcount}}
% 使用计数器
{\usecounter{Lcount}
% 左右对称
\setlength{\rightmargin}{\leftmargin}}
% 开始
\item This is the first item
\item And this is the second item
\end{list}
效果将是
Item-I This is the first item
Item-II And this is the second item
枚举、列举和描述
\begin{list_type} \item The first item \item The second item \item The third etc \ldots \end{list_type}
默认的 list_type 有 enumerate、 itemize 和 description,区别主要是列项标签的不同。enumerate 是有序的列表;itemize 用圆点;description 需要 \item[label] 指定标签。各种列表环境可以互相嵌套,此时,enuemrate 的标签会自动变化以体现分级层次。
如果不想让列项第一行和标签同行,加一个 \hfill。
\begin{description} \item[First] \hfill \\ The first item \item[Second] \hfill \\ The second item \item[Third] \hfill \\ The third etc \ldots \end{description}
紧凑的列表
以上的列表环境空白较大,如果需要更紧凑的列表方式,可以选用 mdwlist 宏包提供的 itemize*、enumerate* 和 description* 环境,用法和无星号的版本一致。
定制列表环境
距离
在列表的内部,很容易改变一些距离
\begin{itemize} \setlength{\itemsep}{1pt} \setlength{\parskip}{0pt} \setlength{\parsep}{0pt} \item first item \item second item \end{itemize}
更详细的参数需要看下面 list 环境。
标签和计数器
枚举的列表计数可以通过其计数器来改变。enumerate 提供了四个计数器 enumi,enumii,enumiii, enumiv 对应不同层次的枚举。
\begin{enumerate} \setcounter{enumi}{4} \item fifth element \end{enumerate}
会产生
5. fifth element
LaTeX 可以用其他格式打印这些计数器的值,
| 命令 | 例子 |
|---|---|
| \arabic | 1, 2, 3 ... |
| \alph | a, b, c ... |
| \Alph | A, B, C ... |
| \roman | i, ii, iii ... |
| \Roman | I, II, III ... |
| \fnsymbol | 星号,单剑号,双剑号等 |
% 重定义第一级计数显示 \renewcommand{\theenumi}{\Roman{enumi}} \renewcommand{\labelenumi}{\theenumi} % 重定义第二级计数显示 \renewcommand{\theenumii}{\Alph{enumii}} \renewcommand{\labelenumii}{(\theenumii)}
这样看起来有些麻烦。有时候直接写
\renewcommand{\labelenumi}{\Roman{enumi}}
但是这样有一个缺点:如果在列表内部引用这些计数器,就会按原来的格式打印。
对列举 itemize 而言,无须计数。标签的形式可以通过 \item[label] 来改变。或者通过各级 \labelitemi,\labelitemii,\labelitemiii,\labelitemiv。所以
\item[$\star$]
等价于
\renewcommand{\labelitemi}{$\star$}
enumerate 宏包
enumerate 宏包为 enumerate 提供了更灵活的标签。可以使用 A,a,I,i,1 作为可选项产生 \Alph,\alph,\Roman,\roman,\arabic 的效果。
usepackage{enumerate} ...... \begin{enumerate}[(i)] \item The first item \item The second item \item The third etc \ldots \end{enumerate}
行内列表
paralist 宏包提供了 inparaenum 环境,产生不分段的列表。同样支持跟上面 enumerate 宏包类似的格式化标签。
\usepackage{paralist} ...... \textbf{\itshape Inline lists}, which are sequential in nature, just like enumerated lists, but are \begin{inparaenum}[\itshape a\upshape)] \item formatted within their paragraph; \item usually labelled with letters; and \item usually have the final item prefixed with `and' or `or', \end{inparaenum} like this example.
list 环境
最有可定制性的当属 list 环境。以上的 enumerate, itemize,description 其本质上都是封装好的 list 环境。
\begin{list}{label}{spacing} \item First item \item Second item \end{list}
其中, label 的内容将会作为标签,放在一个单独的盒子里,出现在每一 item 之前。也可以通过 \item[label] 来实现。
spacing 设定一些距离。通常为空,因为默认距离已经足够好了。
- \topsep 列表顶部与之前内容的额外空白,不含 \baselineskip
- \partopsep 如果列表之前是一个空行,列表顶部的额外空白
- \itemsep 列表各项之间额外的垂直空白
- \parsep 一个 item 中,如果分段,段落间额外空白
- \leftmargin 列表与左边距之间的水平距离,值为非负
- \rightmargin 列表与右边距之间的水平距离,值为非负
- \itemindent 每一 item 第一行的缩进
- \listparindent 每一 item 第一行之后各行的缩进
- \labelsep 标签盒子与每一 item 第一行文本之间距离
- \labelwidth 标签盒子的宽度;如果标签过长,这一宽度会自动变大,直到列表的第一行文本为止
- \makelabel{label} 生成 \item[label] 命令所要求的标签
- \usecounter{ctr} 使用列表项目计数器 ctr,初始值为 0
一个例子
% 定义计数器 \newcounter{Lcount} % 标签计数显示为罗马数字 \begin{list}{Item-\Roman{Lcount}} % 使用计数器 {\usecounter{Lcount} % 左右对称 \setlength{\rightmargin}{\leftmargin}} % 开始 \item This is the first item \item And this is the second item \end{list}
效果将是
Item-I This is the first item Item-II And this is the second item
latex列表的更多相关文章
- latex-列表环境
介绍 latex 主要有三种列表环境,进行罗列的实现, 无序列表 -- itemize 有序列表 -- enumerate 描述列表 -- description 本文进行了一一介绍和演示, 同时添加 ...
- Latex插入项目列表符号
1. 关于 {itemize}里序号的形式 (这个在书里有介绍): latex默认生成的简单列表, 默认为一个小圆点,..... 而我们在写文章时可能想要一些不一样的列表符号, 比如 -, * 之类的 ...
- Linux 中优秀的文本化编辑思想大碰撞(Markdown、LaTeX、MathJax)
这样一个标题可能不太准确,因为确实无法准确地解释什么叫"文本化编辑思想".其实我这篇随笔主要是想探讨 Markdown.LaTeX.MathJax,有兴趣的朋友可以继续往下看,同时 ...
- 再来说说 LaTeX
在我的上一篇随笔中,我提到了 Markdown.LaTeX 和 MathJax.这几个东西对目前的网络技术文章的写作.展示都有深远的影响.在上一篇中,我还给出了一份 LaTeX 语法的学习资料.在这一 ...
- TeXstudio 编写Latex论文的若干问题
TeXstudio 编写Latex论文的若干问题解决方案总结 问题1: 如何安装TeXstudio 以及 Texstudio当中的中文字体使用问题. 一.如何安装TeXstudio 很 ...
- SCI英文论文写作- Latex 进阶
SCI英文论文写作- Latex 进阶 1.设置行间距的方法: %\setlength{\baselineskip}{15pt} \renewcommand{\baselinestretch}{1 ...
- LaTeX简单使用方法
Content LaTeX的用途 LaTeX文件布局 LaTeX的文档格式 公式环境 图的排版 表格的排版 有序列表和无序列表 引用 伪代码 参考文献 LaTeX的用途 LaTeX是一种基于TeX的排 ...
- 【积累篇:他山之石,把玉攻】Mime 类型列表
按照内容类型排列的 Mime 类型列表 类型/子类型 扩展名 application/envoy evy application/fractals fif application/futurespla ...
- Whatbeg's blog 文章列表
whatbeg.com 文章列表 ----------------------------------------------------------------------------------- ...
随机推荐
- 安卓开发之RecyclerView
RecyclerView是一个非常好用的控件,它的效果和ListView很相似,甚至可以说RecyclerView的出现是来取代ListView的 RecyclerView比ListView更加灵活, ...
- ios百度地图不能定位问题
在IOS8中定位功能新增了两个方法: - (void)requestWhenInUseAuthorization __OSX_AVAILABLE_STARTING(__MAC_NA, __IPHONE ...
- [string]Regular Expression Matching
Implement regular expression matching with support for '.' and '*'. '.' Matches any single character ...
- mysql学习(十)多表查询
多表查询时,要给表名起别名,给字段名其别名(当两个表含有重复字段时) select p.name, c.name, pid from products p, cats c;//得到的结果为笛卡尔乘积 ...
- JQuery实现 checkbox 全选、反选,子checkbox有没选去掉全选
1. 全选的checkbox选中时,子checkbox全部选中.反之,全部不选 2.子checkbox中,只要有没有被选中的,取消全选checkbox的选中 3.子checkbox的数量和子check ...
- javascript 数据结构和算法读书笔记 > 第三章 列表
1. 结构分析 列表首先要有以下几个属性: listSize 长度 pos 当前位置 dataStore 数据 我们要通过以下方法对上面三个属性进行操作: length() 获取长度 | getPos ...
- UDP的崛起
随着网络技术飞速发展,网速已不再是传输的瓶颈,UDP协议以其简单.传输快的优势,在越来越多场景下取代了TCP,如网页浏览.流媒体.实时游戏.物联网. 1,网速的提升给UDP稳定性提供可靠网络保障 CD ...
- SNMP_802.1
http://www.cisco.com/en/US/tech/tk648/tk362/technologies_tech_note09186a00801c9199.shtml http://www. ...
- 联想企业网盘:SaaS服务集群化持续交付实践
1 前言 当代信息技术飞速发展,软件和系统的代码规模都变得越来越大,而且组件众多,依赖繁复,每次新版本的发布都仿佛是乘坐一次无座的绿皮车长途夜行,疲惫不堪.软件交付是一个复杂的工程,涉及到软 ...
- Delphi实现全局鼠标钩子
其中涉及到的一些API,网上均能查到详细的解释,这里不再熬述.源码下载 因为是全局钩子,所以要用dll注入.用到的鼠标消息结构如下: PMouseHookStruct = ^TMouseHookStr ...