![表中首次使用縮寫詞時的縮寫形式](https://rvso.com/image/305772/%E8%A1%A8%E4%B8%AD%E9%A6%96%E6%AC%A1%E4%BD%BF%E7%94%A8%E7%B8%AE%E5%AF%AB%E8%A9%9E%E6%99%82%E7%9A%84%E7%B8%AE%E5%AF%AB%E5%BD%A2%E5%BC%8F.png)
我引用的表格包含先前文本中未提及的首字母縮寫條目。我想在表中列印縮寫詞的短格式(縮寫詞在表中多次使用),並在文本中第一次使用縮寫詞時打印長格式。這是我的 MWE:
\documentclass[a4paper,11pt,oneside,fleqn]{scrbook}
\usepackage[ngerman,english]{babel} % language listed last is default setting
\usepackage[utf8x]{inputenc}
\usepackage{mhchem}
\usepackage[acronym,toc]{glossaries}
\makeglossaries
\newacronym{LAr}{L\ce{Ar}}{Liquid Argon}
\begin{document}
some text ... \ref{SampleTable} ...
\begin{table}[!h] \centering
\begin{tabular}{|c|c|c|} \hline
& & \\ \hline \hline
\gls{LAr} & & \\ \hline
\gls{LAr} & & \\ \hline
& & \\ \hline
& & \\ \hline
& & \\ \hline
& & \\ \hline
\end{tabular}
\caption{Sample Caption}
\label{SampleTable}
\end{table}
.... some text ... \gls{LAr}
\end{document}
答案1
只需在表中使用\acrshort{}
or \acs{}
(這需要包shortcuts
的選項),它將強制使用縮寫形式。然後正文中的glossaries
後面部分認為這是第一次使用並選擇單獨顯示長形式:\gls{}
\documentclass[a4paper,11pt,oneside,fleqn]{scrbook}
\usepackage[ngerman,english]{babel} % language listed last is default setting
\usepackage[utf8x]{inputenc}
\usepackage{mhchem}
\usepackage[acronym,toc,shortcuts]{glossaries}
\makeglossaries
\newacronym{LAr}{L\ce{Ar}}{Liquid Argon}
\begin{document}
some text ... \ref{SampleTable} ...
\begin{table}[!h] \centering
\begin{tabular}{|c|c|c|} \hline
& & \\ \hline \hline
\acs{LAr} & & \\ \hline
\acrshort{LAr} & & \\ \hline
& & \\ \hline
& & \\ \hline
& & \\ \hline
& & \\ \hline
\end{tabular}
\caption{Sample Caption}
\label{SampleTable}
\end{table}
.... some text ... \gls{LAr}
\end{document}