项目符号样式的文本对齐错误

项目符号样式的文本对齐错误

这是来自我之前的 OP。我想将我的文章格式化如下图所示:

在此处输入图片描述

我创建我的文档这种格式并将上述文字放在第二章。哈里什·库马尔给了我以下代码:

\documentclass{article}
\usepackage{enumitem,amssymb,graphicx}
\newcommand{\mysquare}{\scalebox{0.5}{\raisebox{0.65ex}{$\blacksquare$}}}
\SetLabelAlign{myleft}{\strut\smash{\mbox{}\hspace{\parindent}\parbox[t]\labelwidth{\mysquare \, \raggedright#1\hfill :}}}
\begin{document}
  Before scientists can develop medicines or engineers can advance technology, they throw numbers onto whiteboards using concepts laid out by mathematicians sometimes centuries earlier. Generations of school children will disagree, but no other field of study has played a bigger role in changing the course of history as mathematics. We've identified the 20 mathematicians responsible for the modern world.
%
\begin{itemize}[align=myleft,labelwidth=3.5cm,leftmargin=\dimexpr3.5cm+\parindent+\labelsep\relax]
  \item[Issac Newton]  While not exactly obscure, this list would be incomplete without a mention of Sir Issac Newton, the English luminary of the Scientific Revolution. Newton developed early physics, a scientific method, the theory of universal gravitation, and calculus...
  \item[Gottfried Leibniz] Invented infinitesimal calculus independent of Englishman Sir Issac Newton. His
      notation is still widely used today...
   \item[Leonhard Euler]  A Swiss mathematician who spent most of his life in Russia, Leonhard Euler is considered the preeminent mathematician of his generation...
\end{itemize}

\end{document}

当我在 TeX 编辑器(TeXMaker 4.1.1)中运行时,出现以下错误:

在此处输入图片描述

我以为是我的 TeX 编辑器出了问题,于是在我朋友的 TeX 编辑器 TeXMaker 1.9.9a (SVN 1057) 中尝试了同样的代码,仍然出现同样的错误,但 pdf 文件仍然可以渲染。输出如下:

在此处输入图片描述

我的问题是如何修复错误或如何获得像第一张图片那样的格式而不出现任何错误?


更新 :

在聊天室讨论这个问题后,我终于找到了问题所在,我发现我的 MikTeX 已经过时了。我已经更新到最新版本,现在代码在我的 TeX 编辑器中完美运行。感谢您的评论和回答。我非常感激。很抱歉给您带来不便。

答案1

要知道enumitem你的发行版中安装了哪个版本,请尝试使用此代码

\documentclass{article}
\usepackage{enumitem}
\edef\ver{\csname [email protected]\endcsname}
\begin{document}

enumitem version

\ver

\end{document}

最新版本enumitem是 3.5.2,如果不是,请尝试更新它

相关内容