如何使用词汇表包制作缩写、首字母缩略词、符号、词汇表和索引列表?

如何使用词汇表包制作缩写、首字母缩略词、符号、词汇表和索引列表?

我想按以下顺序使用词汇表包制作缩写列表、首字母缩略词列表、符号列表、词汇表和索引:

\documentclass[a4paper]{memoir}
\usepackage{fouriernc}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[margin=2cm]{geometry}
\usepackage{indentfirst}
\usepackage{dsfont}
\usepackage[linkcolor=true]{hyperref}
\usepackage[symbols,acronym,abbreviations]{glossaries-extra}
\setabbreviationstyle[acronym]{long-short}
%Abreviations
\newabbreviation{p}{p.}{page}
\newabbreviation{s}{s.}{sheet}
\newabbreviation{jan}{jan.}{January}
\newabbreviation{etal}{et al.}{et al}
\newabbreviation{v}{v.}{volume}
%Acronyms
\newacronym{MPE}{MPE}{Modelo Padrão Estendido}
\newacronym{UFMA}{UFMA}{Universidade Federal do Maranhão}
\newacronym{BPS}{BPS}{Bogomol'ny-Prassad-Somefeld}
\newacronym{MCS}{MSC}{Maxwell-Chern-Simons}
%Symbols
\glsxtrnewsymbol[description={the set that does not contain any element}]{emptyset}{\ensuremath{\emptyset}}
\glsxtrnewsymbol[description={set of natural numbers}]{N}{\ensuremath{\mathds{N}}}    
\glsxtrnewsymbol[description={set of integer numbers}]{Z}{\ensuremath{\mathds{Z}}}
%Glossary
\newglossaryentry{ex}{name={example},description={an example}}
\newglossaryentry{cow}{name={cow},plural={cows},description={an adult female of any bovine animal.}} 
\newglossaryentry{par}{name={paragraph},description={distinct section of a piece of writing}}
%index
\index{BPS}
\index{MCS}
\index{Natural numbers}
\index{cow}
\makeglossaries
\makeindex
\begin{document}
\frontmatter%
%
\printglossary[type=acronym,title=List of Acronyms]
\printglossary[type=abbreviations,title=List of Abreviation]
\printglossary[type=symbols,title=List of Symbols]%
%
\tableofcontents%
%
\mainmatter%
%
\chapter{Acronyms}
 First use: \gls{MPE}. Second use: \gls{MPE}.

 First use: \gls{UFMA}. Second use: \gls{UFMA}.

 First use: \gls{BPS}. Second use: \gls{BPS}.

 First use: \gls{MCS}. Second use: \gls{MCS}.

 \gls{ex}, \gls{cow} and \gls{par}.

\index{BPS}, \index{MCS}, \index{N} and \index{cow}
\chapter{Abreviations}
First use: \gls{p}. Second use: \gls{p}.

First use: \gls{s}. Second use: \gls{s}.

First use: \gls{jan}. Second use: \gls{jan}.

First use: \gls{etal}. Second use: \gls{etal}.

First use: \gls{v}. Second use: \gls{v}.

\gls{ex}, \gls{cow} and \gls{par}
\chapter{Symbols}
\gls{emptyset}

\gls{N}

\gls{Z}

\gls{ex}, \gls{cow} and \gls{par}

\backmatter
\printglossary[type=main,title=Glossary]
\printindex
\end{document}

答案1

经过一些小改动,最终汇编成 13 页(因此未包含在此处),我将向提供更好答案的其他人致敬,解释所需的任何其他更改(如果有更好的答案,我会删除我的答案)。我的目的只是找到阻止大量运行的基本错误,这些错误非常简单,只是两个重音字符。

在 TeXworks 中编译

pdfLaTeX 文件名
makeglossaries 文件名
pdfLaTeX 文件名

以下是内容,如果不符合预期,请修改您的问题。

在此处输入图片描述

\documentclass[a4paper]{memoir}
\usepackage{fouriernc}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[margin=2cm]{geometry}
\usepackage{indentfirst}
\usepackage{dsfont}
\usepackage[linkcolor=true]{hyperref}

\usepackage[symbols,acronyms,abbreviations,automake]{glossaries-extra}
% CHANGED **acronym to acronyms** & added automake to assist but would probably compile without  

\setabbreviationstyle[acronym]{long-short}
%Abreviations
\newabbreviation{p}{p.}{page}
\newabbreviation{s}{s.}{sheet}
\newabbreviation{jan}{jan.}{January}
\newabbreviation{etal}{et al.}{et al}
\newabbreviation{v}{v.}{volume}

%Acronyms
\newacronym{MPE}{MPE}{Modelo Padr\~{a}o Estendido} % changed the accent to \~{a}
\newacronym{UFMA}{UFMA}{Universidade Federal do Maranh\~{a}o}  % changed the accent to \~{a}

\newacronym{BPS}{BPS}{Bogomol'ny-Prassad-Somefeld}
\newacronym{MCS}{MSC}{Maxwell-Chern-Simons}
%Symbols
\glsxtrnewsymbol[description={the set that does not contain any element}]{emptyset}{\ensuremath{\emptyset}}
\glsxtrnewsymbol[description={set of natural numbers}]{N}{\ensuremath{\mathds{N}}}    
\glsxtrnewsymbol[description={set of integer numbers}]{Z}{\ensuremath{\mathds{Z}}}
%Glossary
\newglossaryentry{ex}{name={example},description={an example}}
\newglossaryentry{cow}{name={cow},plural={cows},description={an adult female of any bovine animal.}} 
\newglossaryentry{par}{name={paragraph},description={distinct section of a piece of writing}}
%index
\index{BPS}
\index{MCS}
\index{Natural numbers}
\index{cow}
\makeglossaries
\makeindex
\begin{document}
\frontmatter%
%
\printglossary[type=acronym,title=List of Acronyms]
%
\printglossary[type=abbreviations,title=List of Abreviation] % <-- should this be Abbreviations (double bb & Plural)
%
\printglossary[type=symbols,title=List of Symbols]%
%
\tableofcontents%
%
\mainmatter%
%
\chapter{Acronyms}
 First use: \gls{MPE}. Second use: \gls{MPE}.

 First use: \gls{UFMA}. Second use: \gls{UFMA}.

 First use: \gls{BPS}. Second use: \gls{BPS}.

 First use: \gls{MCS}. Second use: \gls{MCS}.

 \gls{ex}, \gls{cow} and \gls{par}.

\index{BPS}, \index{MCS}, \index{N} and \index{cow}
\chapter{Abreviations}
First use: \gls{p}. Second use: \gls{p}.

First use: \gls{s}. Second use: \gls{s}.

First use: \gls{jan}. Second use: \gls{jan}.

First use: \gls{etal}. Second use: \gls{etal}.

First use: \gls{v}. Second use: \gls{v}.

\gls{ex}, \gls{cow} and \gls{par}
\chapter{Symbols}
\gls{emptyset}

\gls{N}

\gls{Z}

\gls{ex}, \gls{cow} and \gls{par}

\backmatter
\printglossary[type=main,title=Glossary]
\printindex
\end{document}

相关内容