![使用 enumitem 更改枚举中的字体大小和类型](https://linux22.com/image/364033/%E4%BD%BF%E7%94%A8%20enumitem%20%E6%9B%B4%E6%94%B9%E6%9E%9A%E4%B8%BE%E4%B8%AD%E7%9A%84%E5%AD%97%E4%BD%93%E5%A4%A7%E5%B0%8F%E5%92%8C%E7%B1%BB%E5%9E%8B.png)
我目前正在尝试使用 enumitem 自定义枚举列表,并且取得了很大进展。我唯一没能做到的是更改标签的字体大小和字体本身。
这是我目前得到的
\documentclass[11pt, letter]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{enumitem}
\begin{document}
\small
\begin{enumerate}[leftmargin=0em, label=\arabic*, itemsep=0pt, parsep=0pt]
\item something
\item something else \newline
\end{enumerate}
\end{document}
我尝试添加一个\small
after label=
,但没有成功。有人能帮我吗?
提前感谢任何帮助! gerberli
答案1
您的代码将标签放入边距中,因为默认情况下,标签在(列表)左边缘右对齐)——我认为这不是您想要的。对于字体大小问题,您必须使用键font
。与其他两个代码进行比较:
\documentclass[11pt, letter]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[showframe]{geometry}
\usepackage{xcolor}
\usepackage{enumitem}
\begin{document}
\begin{enumerate}[leftmargin=0em, label=\arabic*, itemsep=0pt, parsep=0pt]
\item something
\item something else. Some more text. Some more text. Some more text. Some more text. Some more text. Some more text. Some more text. Some more text.
\end{enumerate}
\begin{enumerate}[wide=0em, label=\arabic*, itemsep=0pt, parsep=0pt, font=\small\bfseries\color{red}]
\item something
\item something else. Some more text. Some more text. Some more text. Some more text. Some more text. Some more text. Some more text. Some more text.
\end{enumerate}
Unless you want this:
\begin{enumerate}[wide=0em, leftmargin=*, label=\arabic*, itemsep=0pt, parsep=0pt, font=\small\bfseries\color{red}]
\item something
\item something else. Some more text. Some more text. Some more text. Some more text. Some more text. Some more text. Some more text. Some more text.
\end{enumerate}
\end{document}