使用 acro 包的数学缩写

使用 acro 包的数学缩写

我正在使用“acro”包来定义首字母缩略词。我显示了我在文档中使用的符号列表,下面是我的代码:

\documentclass{report}
\usepackage{acro,times}
\acsetup{first-style=short}
\DeclareAcronym{mg2+}{
    short = \ensuremath{Mg^{2+}},
    long = Magnesium ion,
    class = nomencl
}
\DeclareAcronym{GMC}{
    short = GMC,
    long = G. M. Constructions,
    class = nomencl
}
\DeclareAcronym{Au}{
    short = Au,
    long = Gold,
    class = nomencl
}
\DeclareAcronym{mL}{
    short = mL,
    long = milli litre,
    class = nomencl
}
\DeclareAcronym{cl-}{
    short = \ensuremath{Cl^{-}},
    long = Chloride ion,
    class = nomencl
}
\DeclareAcronym{br-}{
    short = \ensuremath{Br^{-}},
    long = Bromide ion,
    class = nomencl
}
\DeclareAcronym{L}{
    short = L,
    long = Litre,
    class = nomencl
}
\DeclareAcronym{m3}{
    short = \ensuremath{m^3},
    long = Meter cube,
    class = nomencl
}
\begin{document}

    I love \ac{mg2+} because it is healthy. \ac{Au} is very great metal. A stock solution of other ions like $\ac{cl-}$ (sodium chloride), $\ac{br-}$ (potassium bromide) is prepared by dissolving their respective salts in $100$ \ac{mL} water. $1$ \ac{m3} = $1000$ \ac{L}
    \printacronyms[include-classes=nomencl,name=Notations]
\end{document}

我得到了以下输出: 在此处输入图片描述

在这里我们可以看到,缩写形式中带有 的首字母缩略词\ensuremath{}在符号列表中以普通字符显示。而\ensuremath{}缩写形式中不带有 的首字母缩略词在符号列表中以粗体显示。如何防止此行为并在符号列表中以粗体显示所有缩写形式的首字母缩略词。在acronym包中的相同问题在此得到解决问题。有没有办法解决此问题acro?任何建议/反馈都将大有帮助。

答案1

感谢@cgnieder 的反馈。我使用mhchem包来编写化学公式,而不是使用数学环境。这样,问题就解决了。

下面是使用包的代码mhchem,它给出了我预期的结果:

\documentclass{report}
\usepackage{acro,times,mhchem}
\acsetup{first-style=short}
\DeclareAcronym{mg2+}{
    short = \ce{Mg^2+},
    long = Magnesium ion,
    class = nomencl
}
\DeclareAcronym{GMC}{
    short = GMC,
    long = G. M. Constructions,
    class = nomencl
}
\DeclareAcronym{Au}{
    short = Au,
    long = Gold,
    class = nomencl
}
\DeclareAcronym{mL}{
    short = mL,
    long = milli litre,
    class = nomencl
}
\DeclareAcronym{cl-}{
    short = \ce{Cl^-},
    long = Chloride ion,
    class = nomencl
}
\DeclareAcronym{br-}{
    short = \ce{Br^{-}},
    long = Bromide ion,
    class = nomencl
}
\DeclareAcronym{L}{
    short = L,
    long = Litre,
    class = nomencl
}
\DeclareAcronym{m3}{
    short = m\ensuremath{^\text{3}},
    long = Meter cube,
    class = nomencl
}
\begin{document}

    I love \ac{mg2+} because it is healthy. \ac{Au} is very great metal. A stock solution of other ions like \ac{cl-} (sodium chloride), $\ac{br-}$ (potassium bromide) is prepared by dissolving their respective salts in $100$ \ac{mL} water. $1$ \ac{m3} = $1000$ \ac{L}
    \printacronyms[include-classes=nomencl,name=Notations]
\end{document}

结果是: 在此处输入图片描述

相关内容