
용어집에서는 대문자로, 본문에서는 소문자로 단어를 쓰는 것이 가능한가요? \glslink
대신 사용할 수 있지만 \gls
더 나은 해결책은 없습니까?
다음은 내가 원하는 것을 명확히 하는 예입니다.
\documentclass[a4paper]{article}
\usepackage{hyperref}
\usepackage{glossaries}
\makeglossaries
\newglossaryentry{lowercase}{name={lowercase}, description={In the glossary, this word should be capitalized}}
\newglossaryentry{uppercase}{name={Uppercase}, description={This word is capitalized}}
\begin{document}
Should both be lowercase: \gls{lowercase}, \gls{uppercase}.
Workaround: \gls{lowercase}, \glslink{uppercase}{uppercase}.
\printglossaries
\end{document}
결과는 다음과 같습니다.
Should both be lowercase: lowercase, Uppercase.
Workaround: lowercase, uppercase.
Glossary
lowercase In the glossary, this word should be capitalized. 1
Uppercase This word is capitalized. 1
답변1
간단한 해결책이 있습니다. 용어집에 나타나는 텍스트와... 텍스트에 나타나는 텍스트를 별도로 설정할 수 있습니다.
\newglossaryentry{uppercase}{
name={Uppercase},
text={uppercase},
description={Appears uppercase in the glossary and lowercase in the text}
}
답변2
동일한 문제가 발생하는 미래의 사용자를 위해:
나는 문제에 직면하여 이 질문을 발견했습니다.복제하다. @Nitram의 솔루션은 매크로로 정의된 첫 번째 단어의 경우 유용했습니다. 하지만:
- 모든 이름 항목을 복제하고 싶지 않았습니다.
- 나는 대문자로 표시되는 것과 그렇지 않은 것(첫 번째 문자로 수학 기호의 경우)을 제어하고 싶었습니다.
- 특별히 요구되는 사항이 없으면 평소의 행동을 유지하고 싶었습니다.
@nicola-talbot의 답변에서거기, 트릭을 수행하는 간단한 재정의를 찾았습니다.
\usepackage{mfirstuc}
\renewcommand{\glsnamefont}[2][]{\capitalisewords{#1}\xspace#2}
예:
사용법: 용어집에 "첫 번째 단어 대문자"를 출력하고 \gls{firstexample} 텍스트 내에서 "첫 번째 단어 대문자"를 출력합니다.
\newglossaryentry{firstexample}{
name={first}{word capitalized}
}
이는 매크로(전체 단어를 대문자로 표시)에서는 작동하지 않으므로 텍스트 필드를 사용합니다.
\newglossaryentry{boite}{
name={\Boite de valeurs},
text={\boite de valeurs}
}
먼저 수학을 사용하고 일반적으로 이름을 사용합니다. 용어집과 텍스트 내 \gls{firstexample} 출력 "$i$-th blabla" 모두에서:
\newglossaryentry{iblabla}{
name={$i$-th blabla}
}
답변3
나는 사용했다니콜라의 대답, 여기에 있는 답변 중 어느 것도 나에게 도움이 되지 않았기 때문입니다.
이 glossaries-extra
패키지를 사용하면 대소문자를 쉽게 설정할 수 있습니다 firstuc
. 미리보기 코드나 호출을 많이 변경할 필요가 없었습니다. 패키지를 변경하고 다음 코드를 추가하면 됩니다.
\setglossarystyle{long}
\setabbreviationstyle[acronym]{long-short}
\glssetcategoryattribute{acronym}{glossdesc}{firstuc}
답변4
텍스트에는 대문자와 소문자를 모두 사용할 수 있습니다. \Gls{}
문장의 시작 부분과 같이 대문자로 표시된 단어나 용어를 제공합니다. 다른 지역에서는\gls{}
소문자 형태로도 사용할 수 있습니다. 섹션 3을 참조하세요.초보자 가이드. 이것이 질문에 대한 정확한 답변인지는 확실하지 않지만 사람들이 이 질문을 찾을 수 있는 일반적인 사용법입니다.