使用 acro 包对齐缩写和术语

使用 acro 包对齐缩写和术语

啊霍伊,

我对阿克罗包。我希望我的缩写和命名法能够保持一致。

假设我有这样的代码:

\documentclass{article}
\usepackage{acro}

\acsetup{first-style=short}

\DeclareAcronym{ihp}{
short = IHP,
long = Inner Helmholtz Plane,
class = abbrev
}

\DeclareAcronym{ohp}{
short = OHP,
long = Outer Helmholtz Plane,
class = abbrev
}

\begin{document}

The layer of water dipoles and ions with hydrogen envelope, which forms
in this way at the boundary surface, is called the Helmholtz layer and
extend into an inner Helmholtz plane (\ac{ihp}) and an outer Helmholtz
plane (\ac{ohp}).

\printacronyms[include-classes=abbrev,name=Abbreviations]

\end{document}

在此处输入图片描述

但是缩写词的长名称应该对齐。有没有什么方法可以对齐它们?

答案1

您可以将使用的环境从\printacronymsdescription默认)更改为longtablelongtable包。\ac-setup选项list-style控制这一点,将其放置在longtable您可以简单使用的环境中list-style=longtable(或者有许多其他选项)。

甚至\DeclareAcroListStyle允许开发你自己的风格,将列​​表放入其中以进行进一步的定制,如acro手动的。

带有list-style=longtable(在首字母缩略词中添加额外的 O 以强调对齐)

\documentclass{article}
\usepackage{longtable}
\usepackage{acro}

\acsetup{first-style=short,list-style=longtable}

\DeclareAcronym{ihp}{
short = IHP,
long = Inner Helmholtz Plane,
class = abbrev
}

\DeclareAcronym{ohp}{
short = OOHP,
long = Outer Helmholtz Plane,
class = abbrev
}

\begin{document}

The layer of water dipoles and ions with hydrogen envelope, which forms
in this way at the boundary surface, is called the Helmholtz layer and
extend into an inner Helmholtz plane (\ac{ihp}) and an outer Helmholtz
plane (\ac{ohp}).

\printacronyms[include-classes=abbrev,name=Abbreviations]

\end{document}

在此处输入图片描述

答案2

这里还有其他选项,您可以使用它们来微调间距和位置。

% Abbreviations setup
\usepackage{acro}
\usepackage{longtable}

\setlength\LTleft{18pt}  % Adjust the left margin
\setlength\LTpre{-6pt}   % Adjust the space above the table

\acsetup{
  list/template = longtable,
  list/heading = none,
  templates/colspec = {l@{\hspace{2cm}}l} % Adjust the space as needed
}

\DeclareAcronym{ihp}{
short = IHP,
long = Inner Helmholtz Plane,
class = abbrev
}

\DeclareAcronym{ohp}{
short = OOHP,
long = Outer Helmholtz Plane,
class = abbrev
}


\begin{document}

The layer of water dipoles and ions with hydrogen envelope, which forms
in this way at the boundary surface, is called the Helmholtz layer and
extend into an inner Helmholtz plane (\ac{ihp}) and an outer Helmholtz
plane (\ac{ohp}).

\chapter*{\centerline{List of Abbreviations and Terms}}\label{ch:terms}
\printacronyms[include-classes=abbrev,name=none]

\end{document}

相关内容