\gls 似乎在回忆录中不起作用,因为我的所有词汇表术语都是大写的

\gls 似乎在回忆录中不起作用,因为我的所有词汇表术语都是大写的

我想在句子中包含小写术语,但\gls似乎在 memoir 类中不起作用。我在其他地方发现 memoir 没有 gls 命令,但如果您使用,还有其他选择吗\usepackage{glossaries}

正文

\documentclass[12pt, a4paper, twoside, oldfontcommands]{memoir}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[UKenglish]{babel}
\usepackage[style = british]{csquotes}
\usepackage[showframe]{geometry}
\usepackage{graphicx}                                                   %
\graphicspath{ {Documents/PhD/Thesis/figures/} }
\setsecnumdepth{subsection}
\settocdepth{subsection}

\usepackage{epigraph}

\usepackage{hyperref}
\usepackage[toc,acronym]{glossaries}
\makeglossaries
\setlength\epigraphwidth{1\textwidth}
\setlength\epigraphrule{0pt} % no line between
\setlength\beforeepigraphskip{1\baselineskip} % space before and after epigraph
\setlength\afterepigraphskip{2\baselineskip}
\renewcommand*{\textflush}{flushright}
\renewcommand*{\epigraphsize}{\normalsize\itshape}


\addto\captionsUKenglish{\renewcommand{\contentsname}{Table of Contents}}
\usepackage{titlesec}
\titleformat{\chapter}{}{}{0em}{\bf\LARGE}

\usepackage[style=authoryear, backend=biber]{biblatex}
\addbibresource{Bibliography.bib}

\renewcommand*{\nameyeardelim}{\addcomma\space}
\AtEveryBibitem{
    \clearfield{month}
    \clearfield{day}
    \clearfield{urlyear}
    \clearfield{urlmonth}
}
\DefineBibliographyStrings{english}{%
  bibliography = {References}
}


\begin{document}
\frontmatter
\input{front_matter}

\mainmatter
\input{Chapters/chapter01}
\input{Chapters/chapter02}
\input{Chapters/chapter03}
\input{Chapters/chapter04}
\input{Chapters/chapter05}

这是我在 acronym.txt 中使用的内容

\newglossaryentry{communication}
{       name=Communication,
        description={A simultaneous selection of information, utterance, and understanding}
}

\newglossaryentry{system}
{
        name=System,
        description={A whole that is comprised of parts, but not necessarily reducible to them}
}

\newglossaryentry{dissemination_media}
{
        name=Dissemination Media,
        description={Media that extends communication in space and time}
}






\newacronym{sst}{SST}{Social Systems Theory}

\newacronym{dss}{DSS}{Digital Social System}





\printglossary[type=\acronymtype]

\printglossary`

\printbibliography
\input{appendix}
\end{document}`

答案1

这是由于没有使用 的所有字段造成的\newglossaryentry,如果您只使用name=大写字母,那么它将始终出现,使用text=小写字母命名的条目,这样\gls和就\Gls可以正常工作。我将您的代码压缩成这个,它比您发布的代码更简洁:

\documentclass[twoside]{memoir}

\usepackage[style=authoryear, backend=biber]{biblatex}
\usepackage[hidelinks]{hyperref}
\usepackage[toc,acronym]{glossaries}

\newglossaryentry{communication}
{       name={Communication},
        text={communication},
        description={A simultaneous selection of information, utterance, and understanding}
}

\newacronym{sst}{SST}{Social Systems Theory}

\makeglossaries

\begin{document}
This is the acronym \gls{sst}.

This is lowercase \gls{communication}.

This is uppercase \Gls{communication}.
\end{document}

它看起来是这样的:

在此处输入图片描述

另外,我总是\makeglossaries把词汇表条目定义好之后,biblatex应该在之前加载(实际上大多数包都应该如此,hyperref除了等等),将来,请检查如何制作glossariescleverref最小工作示例这样更容易提供帮助。我知道你是新手,所以这次不用担心,但例如,你的代码将无法编译,因为我们无权访问你的\input{chapters\chapter01}文件等。

我附上了一个根据文档和其他网站制作的模板(包括迪基莫图书),其中包含所有词汇表选项,也许它会对您有所帮助:

%----- Using glossary entries in text

%\gls[options including hyperbf to bold the entry]{in-text \gls name}[text to inset afterwards within the hyperlink]
%\glspl{same as above but plural}
%\Gls{same as above but capital singular}
%\Glspl{same as above capital plural}

%----- \newglossary template

% \newglossary[extension for log]{name of glossary}{input extension}{output extension}{title of glossary for printglossary}

%----- Glossary entry template with all fields

%\newglossaryentry{in-text \gls name}
%   {%
%   name={name that appears in glossary},
%   description={description that appears in glossary},
%   text={in-text where singular form required, if not defined uses name}
%   first={first time used with singular form, if not defined uses text},
%   plural={plural form, if not defined adds s to text value},
%   firstplural={first time plural used},
%   symbols={adds a symbol if needed},
%   sort={how to sort entry},
%   type={glossary name that this entry belongs to},
%   }

%----- Print glossary template

%\printglossary[type={first {} of \newglossary},
%         style={style name from \newglossarystyle},
%         title={Override title with new one here},
%         toctitle={TOC title},
%         numberedsection,      % Puts glossary in numbered section
%         nonumberlist,     % Suppress location lists for glossary
%         ] 

我通常将定义为textfirst尽管firstplural任何最适合您需求的都可以。希望您的论文进展顺利。

相关内容