与 LOT 风格相同的首字母缩略词?

与 LOT 风格相同的首字母缩略词?

我使用acronym带页码的包。现在我想让首字母缩略词和页码之间的点与 ListofTables 中的点具有相同的样式:点之间的间距以及最后一个点和页码之间的间距相同。
行距也应该相同,但点具有更高的优先级。
(此外,在迷你示例中,首字母缩略词之间的对齐似乎不太好,但在我的文档中却很好。)

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[printonlyused,withpage]{acronym}
\begin{document}
\parskip 6pt% space between paragraphs
\renewcommand{\baselinestretch}{1.2}\normalsize% leading -- space between two lines
\renewcommand{\bflabel}[1]{\normalfont{\normalsize\bf{#1}}\hfill}% font adjustment
\section*{List of Abbreviations}
\begin{acronym}[MSC]
\acro{IMO}{International Maritime Organization}
\acro{MSC}{Maritime Safety Committee}
\end{acronym}
\listoftables
\begin{table}\begin{tabular}{c} \ac{MSC}\end{tabular}\caption{a}\end{table}
\begin{table}\begin{tabular}{c} \ac{IMO}\end{tabular}\caption{b}\end{table}
\end{document}

答案1

将以下代码添加到你的序言中:

\usepackage{etoolbox}
\makeatletter
\patchcmd{\AC@@acro}
  {\dotfill\pageref{acro:#1}}
  {\nobreak\leaders\hbox{$\mkern -7mu \mkern \@dotsep mu\hbox{.}\mkern \@dotsep mu \mkern 7mu$}%
   \hfill\nobreak\makebox[1.3em][r]{\pageref{acro:#1}}}
  {}
  {}
\makeatother

通过这种方式,我们修补了负责在首字母缩略词列表中写入行的命令,使其行为类似于负责在 LoT 中放置行的命令。

完成 MWE:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[printonlyused,withpage]{acronym}

\usepackage{etoolbox}
\makeatletter
\patchcmd{\AC@@acro}
  {\dotfill\pageref{acro:#1}}
  {\nobreak\leaders\hbox{$\mkern -7mu \mkern \@dotsep mu\hbox{.}\mkern \@dotsep mu \mkern 7mu$}%
   \hfill\nobreak\makebox[1.3em][r]{\pageref{acro:#1}}}
  {}
  {}
\makeatother

\begin{document}
\parskip 6pt% space between paragraphs
\renewcommand{\baselinestretch}{1.2}\normalsize% leading -- space between two lines
\renewcommand{\bflabel}[1]{\normalfont{\normalsize\bf{#1}}\hfill}% font adjustment
\section*{List of Abbreviations}
\begin{acronym}[MSC]
\acro{IMO}{International Maritime Organization}
\acro{MSC}{Maritime Safety Committee}
\end{acronym}
\listoftables
\begin{table}\begin{tabular}{c} \ac{MSC}\end{tabular}\caption{a}\end{table}
\begin{table}\begin{tabular}{c} \ac{IMO}\end{tabular}\caption{b}\end{table}
\end{document}

输出:

在此处输入图片描述

相关内容