LaTeX使用enumitem包切换enumerate标签样式

文章介绍了如何在LaTeX中使用enumerate环境创建列表,并通过enumitem包来定制不同的标签样式,包括数字加括号、粗体数字、小写字母、大写字母和罗马数字等。此外,提到了LaTeX的在线编译环境Overleaf。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

一、直接使用enumerate

        源码:

\documentclass{article}
\begin{document}
\section{LaTeX Style Sample}
There is nothing to show, thank you for reading.
\begin{enumerate}
    \item Apple is a kind of fruit.
    \item Cat is a kind of animal.
    \item Butterfly is a kind of insect.
\end{enumerate}
\end{document}

        效果:可看到,默认的是以数字序号作为标签样式,即1. 、2.、3.等

 

二、配合enumitem包使用enumerate

        配合enumitem包需要在LaTeX之中导入该包,具体就是在源码之中加入下面一行代码(\begin{document}之前):

\usepackage{enumitem}

        样式1:数字序号+括号 (关键代码在第6行,后面也是)

\documentclass{article}
\usepackage{enumitem}
\begin{document}
\section{LaTeX Style Sample}
There is nothing to show, thank you for reading.
\begin{enumerate}[label=(\arabic*)]
    \item Apple is a kind of fruit.
    \item Cat is a kind of animal.
    \item Butterfly is a kind of insect.
\end{enumerate}
\end{document}

        样式1效果

        样式2:粗体数字序号

\documentclass{article}
\usepackage{enumitem}
\begin{document}
\section{LaTeX Style Sample}
There is nothing to show, thank you for reading.
\begin{enumerate}[label=$\mathbf{\arabic*}.$]
    \item Apple is a kind of fruit.
    \item Cat is a kind of animal.
    \item Butterfly is a kind of insect.
\end{enumerate}
\end{document}

        样式2效果

        样式3:粗体数字序号+括号

\documentclass{article}
\usepackage{enumitem}
\begin{document}
\section{LaTeX Style Sample}
There is nothing to show, thank you for reading.
\begin{enumerate}[label=$(\mathbf{\arabic*})$]
    \item Apple is a kind of fruit.
    \item Cat is a kind of animal.
    \item Butterfly is a kind of insect.
\end{enumerate}
\end{document}

        样式3效果

        样式4:小写字母

\documentclass{article}
\usepackage{enumitem}
\begin{document}
\section{LaTeX Style Sample}
There is nothing to show, thank you for reading.
\begin{enumerate}[label=\alph*.]
    \item Apple is a kind of fruit.
    \item Cat is a kind of animal.
    \item Butterfly is a kind of insect.
\end{enumerate}
\end{document}

        样式4效果

        样式5:大写字母

\documentclass{article}
\usepackage{enumitem}
\begin{document}
\section{LaTeX Style Sample}
There is nothing to show, thank you for reading.
\begin{enumerate}[label=\Alph*.]
    \item Apple is a kind of fruit.
    \item Cat is a kind of animal.
    \item Butterfly is a kind of insect.
\end{enumerate}
\end{document}

        样式5效果

        样式6:罗马字母(注意,这个也可以大写)

\documentclass{article}
\usepackage{enumitem}
\begin{document}
\section{LaTeX Style Sample}
There is nothing to show, thank you for reading.
\begin{enumerate}[label=\roman*.]
    \item Apple is a kind of fruit.
    \item Cat is a kind of animal.
    \item Butterfly is a kind of insect.
\end{enumerate}
\end{document}

        样式6效果

        其他样式:根据上述的示例,相信聪明的你可以快速猜到如何得到其他你所需要的标签样式,觉得有用请点个赞,感谢。有缘在此相见,祝各位科研顺利。

三、LaTeX编译环境

        1. 编辑+编译环境:Overleaf

        2. 包的引用:已在上述源码给出

        3. 文件之间的引用:无,项目中仅有一个main.tex文件

四、参考

        1. LaTeX使用enumitem包

### 如何在LaTeX中设置文献引用的方括号样式 要在LaTeX文档中实现文献引用的方括号样式,可以通过调整`enumerate`环境或者自定义命令来完成。以下是具体方法: #### 使用 `enumerate` 环境设置方括号编号 通过引入 `enumitem` 宏并配置 `enumerate` 环境,可以轻松实现带方括号样式的编号效果[^4]。 ```latex \usepackage{enumitem} \begin{enumerate}[{[1]}] \item 这是一个条目 x。 \item 这是一个条目 y。 \item 这是一个条目 z。 \end{enumerate} ``` 上述代码中的 `[{\[1\]}]` 是关键部分,它指定了列表项前缀为带有方括号的数字序号。 --- #### 修改参考文献引用样式为方括号形式 如果目标是让 `\cite{}` 命令生成的内容呈现为方括号裹的形式,则需进一步定制 LaTeX 的引文风格[^3]。通常情况下,默认行为已经满足这一需求;但如果默认未生效,可尝试以下方式解决: ##### 方法一:直接加载合适的 `.bst` 文件 `.bst` 文件决定了参考文献的具体格式化规则。例如,使用 IEEE 或 GBT 风格时,可以直接指定对应的 `.bst` 文件名,并确保其路径正确无误[^2]。 ```latex \bibliographystyle{IEEEtran} % 替换为你需要的标准样式文件名称 \bibliography{references} % references.bib 是存储所有参考条目的外部 BibTeX 数据库文件 ``` ##### 方法二:手动覆盖原有标签渲染逻辑 当希望全局统一更改引文外观而无需切换整个 .bst 文件时,可通过重新定义内部宏达成此目的: ```latex \makeatletter \renewcommand{\@biblabel}[1]{[#1]} \makeatother ``` 这段脚本的作用在于覆写原生 \@biblabel 函数的行为模式,从而强制使每一条参考书目旁边附加上的索引值被置于一对尖角括弧之中展示出来。 --- ### 总结 综上所述,无论是针对简单枚举项目还是复杂科研论文写作场景下的正式引用管理,都可以借助适当工具与技巧灵活控制最终输出形态——既能够单独处理局部区域内的特殊表现要求,也允许大规模批量应用一致性的美化方案。
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

飞机火车巴雷特

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值