最初の使用をトリガーせずに特定の用語集フィールドにアクセスする

最初の使用をトリガーせずに特定の用語集フィールドにアクセスする

用語集エントリの作成中に手動で構成されたフィールドのいずれかに、マクロまたは新しいコマンドで手動/意図的にアクセスできるかどうかを知りたいです。次のような形式が考えられます。

\newcommand{\expectedFirst}[1]{???}

ここで???は、glsラベル#1を使用して、short、name、label、long、description、firstpluralなどの定義済みフィールドを取得する定義です。取得したいフィールドごとに新しいコマンドを作成するか、

\newcommand{\expectedField}[2]{???}

ここで、#1 はラベル文字列、#2 は抽出またはアクセス可能にするフィールドを表します。

.dtx 用語集ファイルをざっと調べてみましたが、外部で複製できるような変数作成のようなマクロ定義は見つかりませんでした。興味深く、潜在的に有用と思われるのは、用語がすでに呼び出されたかどうかを追跡する追跡ブール値の存在です。このブール値は、カスタム マクロで比較したいもう 1 つの変数です。

MWE:

\documentclass{article}
\usepackage[utf8]{inputenc}

\setlength\parindent{0pt}


%=========================================================================================================================================
% PACKAGES REQUIRED FOR GLOSSARIES
%=========================================================================================================================================

% Glossaries must be loaded before amsmath as per details in the following forum answer
% http://tex.stackexchange.com/questions/85696/what-causes-this-strange-interaction-between--and-amsmath
\usepackage[nogroupskip,toc,acronym]{glossaries} % must come after href   
\usepackage{scrwfile}%http://www.dickimaw-books.com/cgi-bin/faq.cgi?action=view&categorylabel=glossaries#glsnewwriteexceeded

\makeglossaries

\newglossaryentry{ICPMS}{ type={acronym}, sort={inductively coupled plasma mass spectrometry},  name={ICPMS}, short={ICPMS}, long={inductively coupled plasma mass spectrometry}, first={inductively coupled plasma mass spectrometry (ICPMS)}, description={inductively coupled plasma mass spectrometry} }

\begin{document}

    \begin{itemize}
        \item \gls{ICPMS}
        \item \gls{ICPMS}
            %\item \expectedFirst{ICPMS}
    \end{itemize}


\end{document} 

答え1

ドキュメントをより注意深く調べ、元の質問のコメントから得たインスピレーションから、パッケージでは、およびglossariesに似た形式のコマンドを使用して一部のフィールドにアクセスできることが分かりました。最も重要なのは、これらのコマンドを使用しても、適切な初回使用評価を妨げるカウンターが人為的にトリガーされないことです。\glsentryshort{}\glsentrylong{}

MWE:

\documentclass{article}
\usepackage[utf8]{inputenc}

\setlength\parindent{0pt}

%=========================================================================================================================================
% PACKAGES REQUIRED FOR GLOSSARIES
%=========================================================================================================================================

% Glossaries must be loaded before amsmath as per details in the following forum answer
% http://tex.stackexchange.com/questions/85696/what-causes-this-strange-interaction-between--and-amsmath
\usepackage[nogroupskip,toc,acronym]{glossaries} % must come after href   
\usepackage{scrwfile}%http://www.dickimaw-books.com/cgi-bin/faq.cgi?action=view&categorylabel=glossaries#glsnewwriteexceeded

\makeglossaries

\newglossaryentry{ICPMS}{ type={acronym}, sort={inductively coupled plasma mass spectrometry},  name={ICPMS}, short={ICPMS}, long={inductively coupled plasma mass spectrometry}, first={inductively coupled plasma mass spectrometry (ICPMS)}, description={inductively coupled plasma mass spectrometry} }

\begin{document}

    \begin{itemize}
        \item \glsentrylong{ICPMS}
        \item \glsentryshort{ICPMS}
        \item \glsentryfull{ICPMS}
        \item \gls{ICPMS}
        \item \gls{ICPMS}
    \end{itemize}


\end{document} 

関連情報