我正在尝试制作一个嵌套的描述列表,如下所示:
\usepackage{enumitem}
\begin{document}
\begin{description}
\item[Languages:]
\begin{description}
\item[High:]Python, Java, R, SQL, SAS
\item[Intermediate:]HTML5, CSS, JavaScript, C++
\item[Basic:] \LaTeX, Batch, Shell, Powershell, MongoDB
\end{description}
\end{description}
\end{document}
我想要高的,中间的, 和基本的水平对齐。我弄乱了包和参数,enumitem
例如labelindent
,,,,和其他一些参数,但无济于事。有人能帮忙吗?align
leftmargin
itemindent
谢谢!
答案1
\documentclass{article}
\usepackage{enumitem}
\begin{document}
\begin{description}
\item[Languages:]\begin{minipage}[t][][t]{12cm}
\begin{description}
\item[High:]Python, Java, R, SQL, SAS
\item[Intermediate:]HTML5, CSS, JavaScript, C++
\item[Basic:] \LaTeX, Batch, Shell, Powershell, MongoDB
\end{description}
\end{minipage}
\end{description}
\end{document}
答案2
您需要使左边距足够大:
\documentclass{article}
\usepackage{enumitem,calc}
\begin{document}
blblblb \\
blblblb
\begin{description}[leftmargin=\widthof{Languages:xxx},labelwidth=!]
\item[Languages:]
\begin{description}
\item[High:]Python, Java, R, SQL, SAS
\item[Intermediate:]HTML5, CSS, JavaScript, C++
\item[Basic:] \LaTeX, Batch, Shell, Powershell, MongoDB
\end{description}
\end{description}
\end{document}
答案3
免责声明:我没有注意到without line break
,抱歉。我读了问题,但没有读标题:P
你可以通过description
给它一个不可见的字符来欺骗它:
\documentclass{article}
\usepackage{enumitem}
\begin{document}
\begin{description}
\item[Languages:]\mbox{}
\begin{description}
\item[High:]Python, Java, R, SQL, SAS
\item[Intermediate:]HTML5, CSS, JavaScript, C++
\item[Basic:] \LaTeX, Batch, Shell, Powershell, MongoDB
\end{description}
\end{description}
\end{document}