Fontspec을 사용한 용어집 및 가짜 작은 대문자

Fontspec을 사용한 용어집 및 가짜 작은 대문자

패키지를 사용하여 약어 목록을 작성할 때 가짜 작은 대문자를 사용하고 싶습니다 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}

마지막으로, 실제 작은 대문자가 없는 경우 가장 좋은 전략은 해당 대문자를 모두 피하는 것입니다.

관련 정보