acro 與 acronym - 大寫和重新引入首字母縮寫詞

acro 與 acronym - 大寫和重新引入首字母縮寫詞

我瀏覽網路很長一段時間,但還沒有找到解決以下與縮寫詞使用有關的問題的方法。

  1. 我想使用acro包提供的首字母縮略詞的大寫,例如\Ac{bla}

  2. 我希望在每個部分或章節中“重新引入”首字母縮略詞,如acronym包中提供的那樣。

是否有可能獲得這種「組合」功能,例如透過調整acroacronym套件?

非常感謝您提前的幫忙!

乾杯,來自一個絕望的大學夥計。

答案1

您可以使用etoolbox'將'\preto添加到or的每次調用中:acro\acresetall\chapter\section

\documentclass{scrartcl}
\usepackage{acro}
\DeclareAcronym{foo}{
  short = foo ,
  long  = the description of foo
}

\usepackage{etoolbox}
\preto\section{\acresetall}

\begin{document}

\section{One}
\Ac{foo}, now short: \ac{foo}.

\section{two}
\Ac{foo}, now short: \ac{foo}.

\end{document}

在此輸入影像描述

答案2

您可以透過該包獲得所需的結果glossaries。 1)\Ac{}在包中 2) 透過重新定義節命令來獲得,\glsresetall如果使用了縮寫詞,則包含重置。

\documentclass{article}
\usepackage[acronym,shortcuts]{glossaries}
\makeglossaries
\newacronym{tedc}{TEDC}{tunable electrical dispersion compensation}
\let\oldsection\thesection
\renewcommand{\thesection}{\oldsection\glsresetall}
\begin{document}
\section{intro}
\Ac{tedc}

\ac{tedc}

\ac{tedc}
\section{new topic}
\ac{tedc}

\ac{tedc}
\end{document}

相關內容