![具有 alwaysadjust 的 Paralist](https://linux22.com/image/279444/%E5%85%B7%E6%9C%89%20alwaysadjust%20%E7%9A%84%20Paralist.png)
我想对齐分项列表中的元素,使得没有项目标签占用页边距的一部分。我为此使用了 paralist 包。但是,项目缩进并非在所有情况下都正确:
\documentclass{article}
\usepackage{pxfonts}
\usepackage{paralist}
%\usepackage[alwaysadjust]{paralist}
\begin{document}
\noindent
\section{Complexity classes}
Please note that the following list of complexity classes is not
only important, but also contains no information about them.
\begin{itemize}
\item[\textbf{PTIME}:] A complexity class
\item[\textbf{NP}:] Yet another complexity class
\item[\textbf{PSPACE}:] Guess what...
\end{itemize}
\section{Questions}
\begin{enumerate}
\item Where are the other complexity classes?
\item Perhaps this document does not need them?
\end{enumerate}
\end{document}
问题似乎是标签宽度有一个最小值,名词解释标签较小。没有px字体包,问题就不会发生。现在可以使用“不断调整”选项添加到 paralist,但文件不再编译。使用“旧项目“paralist 选项将使列表标签延伸到页边距。
那么我该如何对齐名词解释元素是否正确?
答案1
相反,使用description
列表是可行的,而且还省去了明确将标签设为粗体的步骤:
\documentclass{article}
\usepackage{pxfonts}
\usepackage{paralist}
\begin{document}
\noindent
\section{Complexity classes}
Please note that the following list of complexity classes is not
only important, but also contains no information about them.
\begin{description}
\item[PTIME:] A complexity class
\item[NP:] Yet another complexity class
\item[PSPACE:] Guess what...
\end{description}
\section{Questions}
\begin{enumerate}
\item Where are the other complexity classes?
\item Perhaps this document does not need them?
\end{enumerate}
\end{document}
答案2
尝试itemize
用包compactdesc
中的环境替换环境paralist
。这将产生
\documentclass{article}
\usepackage{pxfonts}
\usepackage{paralist}
\begin{document}
\noindent
\section{Complexity classes}
Please note that the following list of complexity classes is not
only important, but also contains no information about them.
\begin{compactdesc}
\item[PTIME:] A complexity class
\item[\textbf{NP}:] Yet another complexity class
\item[\textbf{PSPACE}:] Guess what...
\end{compactdesc}
\section{Questions}
\begin{enumerate}
\item Where are the other complexity classes?
\item Perhaps this document does not need them?
\end{enumerate}
\end{document}