パッケージを使用して略語のリストを作成するときに、偽の小文字大文字を使用したいと思いますglossaries
。別のフォントを使用していますが、この例では再現性を保つために を使用しましたLinux Libertine O
。わかりやすくするために、この例ではスケーリング係数も誇張しています。何らかの理由で、\smallCaps
コマンドが正常に機能することがあるようですが、この場合は元に戻りません。何が間違っているのでしょうか?
\documentclass{memoir}
\usepackage{glossaries}
\usepackage{fontspec}
\newcommand{\smallCaps}[1]{%
{\fontspec[Scale=0.5]{Linux Libertine O} #1}%
}
\setacronymstyle{long-short}
\begin{document}
%ABBREVIATIONS
\newacronym{ADR}{\smallCaps{ADR}}{adverse drug reaction}
\setmainfont{Linux Libertine O}
Works \smallCaps{FOO} does not work: \gls{ADR}). A more specific definition
for the term \gls{ADR} is
\end{document}
答え1
\fontspec
ドキュメント内では絶対に使用しないでください。これは、ユーザー レベルのコマンド\setmainfont
などで使用される汎用コマンドです\newfontfamily
。また、\setmainfont
プリアンブルでのみ使用する必要があります。
\setmainfont
メイン フォントとは独立してフォントが選択される方法を示すために、宣言を削除しました。重要なのはshort
、 のキーを使用することです\newacronym
。
\documentclass{memoir}
\usepackage{glossaries}
\usepackage{fontspec}
\newcommand{\smallCaps}[1]{%
{\fontspec[Scale=0.5]{Linux Libertine O} #1}%
}
\setacronymstyle{long-short}
\begin{document}
%ABBREVIATIONS
\newacronym{ADR}{\smallCaps{ADR}}{adverse drug reaction}
\setmainfont{Linux Libertine O}
Works \smallCaps{FOO} does not work: \gls{ADR}). A more specific definition
for the term \gls{ADR} is
\end{document}
一方、より良い戦略は(小文字大文字を生成する他の方法がないと仮定して)、フォント定義にそれを追加することです。
\documentclass{memoir}
\usepackage{fontspec}
\usepackage{glossaries}
\makeglossaries
\setmainfont{Latin Modern Roman}[
SmallCapsFont={Linux Libertine O},
SmallCapsFeatures={Scale=0.5},
]
\setacronymstyle{long-short}
\begin{document}
%ABBREVIATIONS
\newacronym[
short=\textsc{ADR}
]{ADR}{ADR}{adverse drug reaction}
Works \textsc{FOO} does not work: \gls{ADR}). A more specific definition
for the term \gls{ADR} is
\printglossaries
\end{document}
最後に、本当に小型株を持っていない場合の最善の戦略は、小型株を完全に避けることです。