如何使用 TeX 实现以下效果?
Czech Spoken in Czech Republic
Ukrainian Spoken in Ukraine
Azerbaijani Spoken in Azerbaijan
English Spoken in many many many many many many many many many many many many
many many many many many many countries
Italian Spoken in Italia
答案1
\documentclass[12pt, a4paper, ]{report}
\usepackage[]{geometry}
\usepackage{enumitem, calc}
\usepackage{lipsum}
\begin{document}
\newlength{\mylength}
\settowidth{\mylength}{Azerbaijani}
%\the\mylength
\begin{description}[labelindent=0pt,labelwidth=\mylength+10pt,labelsep*=1em,leftmargin=!]
\item[Czech] Spoken in Czech Republic
\item[Ukrainian] Spoken in Ukraine
\item[Azerbaijani] Spoken in Azerbaijan
\item[English] Spoken in many many many many many many many many many many many many
many many many many many many countries
\item[Italian] Spoken in Italia
\end{description}
\end{document}
如果不需要标签中的粗体字体,请进行编辑
添加以下行
\setlist[description]{font=\normalfont}
平均能量损失
\documentclass[12pt, a4paper, ]{report}
\usepackage[]{geometry}
\usepackage{enumitem, calc}
\usepackage{lipsum}
\begin{document}
\newlength{\mylength}
\settowidth{\mylength}{Azerbaijani}
\setlist[description]{font=\normalfont}
\begin{description}[labelindent=0pt,labelwidth=\mylength+10pt,labelsep*=1em,leftmargin=!]
\item[Czech] Spoken in Czech Republic
\item[Ukrainian] Spoken in Ukraine
\item[Azerbaijani] Spoken in Azerbaijan
\item[English] Spoken in many many many many many many many many many many many many
many many many many many many countries
\item[Italian] Spoken in Italia
\end{description}
\end{document}
结果 -
如果你的单词标签比Azerbaijani
标签中的单词长,只需替换行中最长的单词即可
\settowidth{\mylength}{Azerbaijani}
新的标签宽度将自动计算