如何在定义项目符号类型时使用 \centerdot?

如何在定义项目符号类型时使用 \centerdot?

问题:

我得到了未定义的控制序列尝试定义第二级项目的项目符号类型时出错。我正在使用:

\renewcommand{\labelitemii}{$\centerdot$}

笔记:

  • 我读过一些页面(例如Latex 符号)\centerdots是一个有效符号。

  • 我的文档没有那行也能编译成功。如果我使用其他类型,比如\Rightarrow或,它也能正常工作\cdot。例如

    \renewcommand{\labelitemii}{$\cdot$}
    
  • 错误信息是:

    ! Undefined control sequence.
    <recently read> \centerdot
    l.114 \item C
    ontienen los operandos vectoriales en máquinas de registros
    The control sequence at the end of the top line
    of your error message was never \def'ed. If you have
    misspelled it (e.g., `\hobx'), type `I' and the correct
    spelling (e.g., `I\hbox'). Otherwise just continue,
    and I'll forget about whatever was undefined.
    
  • 第一个错误指向的行是:

    \begin{itemize} % first level
       \item \textbf{Registros Vectoriales}
       \begin{itemize} % second level
           \item Contienen los operandos vectoriales en máquinas de registros % ERROR
       ...
    

答案1

我会避免加载mathabx只是为了得到一个方形子弹:

\documentclass{article}
\usepackage{enumitem}

\DeclareRobustCommand{\sqbullet}{%
  \raisebox{.3ex}{\rule{.3em}{.3em}}%
}

\setlist[itemize,2]{label=\sqbullet} % similar to \renewcommand{\labelitemii}{\sqbullet}

\begin{document}

\begin{itemize} % first level
   \item \textbf{Registros Vectoriales}
   \begin{itemize} % second level
       \item Contienen los operandos vectoriales
   \end{itemize}
\end{itemize}

\end{document}

在此处输入图片描述

答案2

您需要执行\usepackage{amssymb}\usepackage{mathabx}才能使用\centerdot。请注意,后者将重新定义许多其他数学符号。

相关内容