縮寫包:處理所有格(撇號 s)

縮寫包:處理所有格(撇號 s)

如何使用acronym包裝處理首字母縮寫的所有格形式?

縮寫定義:

\begin{acronym}
\acro{FBI}{Federal Bureau of Investigation}
\end{acronym}

用法:

The \ac{FBI}'s plan. The \ac{FBI}'s plan.

結果:

The Federal Bureau of Investigation (FBI)'s plan. The FBI's plan.

短形式是正確的,但長形式是錯誤的。

答案1

這是一個定義命令的方法,\acposs該命令將擴展為長的的(短的)第一次使用時和短的下次使用時:

\documentclass{article}

\usepackage{acronym}

\makeatletter
\newcommand{\acposs}[1]{%
 \expandafter\ifx\csname AC@\AC@prefix#1\endcsname\AC@used
   \acs{#1}'s%
 \else
   \aclu{#1}'s (\acs{#1})%
 \fi
}
\makeatother

\begin{document}
\begin{acronym}
\acro{FBI}{Federal Bureau of Investigation}
\end{acronym}

The \acposs{FBI} plan. The \acposs{FBI} plan.

\end{document}

FBI 聯邦調查局 聯邦調查局 (FBI) 的計劃。聯邦調查局的計劃。

如果你更喜歡長的的(短的's) 然後使用以下定義:

\newcommand{\acposs}[1]{%
 \expandafter\ifx\csname AC@#1\endcsname\AC@used
   \acs{#1}'s%
 \else
   \aclu{#1}'s (\acs{#1}'s)%
 \fi
}

相關內容