2

I expect the following code to auto generate a glossary beside the acronym list. However only the acronym list is generated although it contains references to the glossary.

\documentclass{report}

\usepackage[
    toc,                % Shows glossary in the table of content
    xindy,              % Used superior indexing tool
    acronym,
    nopostdot,
    nostyles,
    ]{glossaries}

\makeglossaries         % used to generate the glossary

\newglossaryentry{fab region}{
   type        = \acronymtype,
   name        = {fab region},
   description = {fragment antigen-binding region},
   first       = {fragment antigen-binding region (fab region)},
   see         = {[Glossary:]{gls:fab region}}
}

\newglossaryentry{gls:fab region}{
    name= Fab region,
    description={The fragment antigen-binding region binds antigens. It is composed of the antibody's light chains and parts of the heavy chains}
}

\begin{document}

This is a test \gls{fab region}.

\printglossary[type=\acronymtype] % prints just the list of acronyms 
\printglossary

\end{document}

I compile the document as following:

pdflatex
makeglossaries
pdflatex
pdflatex

How do I achieve that the reference from the acronym list adds the referenced entry to the glossary list?

0

1 Answer 1

1

You have only referenced (indexed) fab region in the document. If you want gls:fab region to also appear in the list then you need to index that as well. For example:

\documentclass{report}

\usepackage[
    toc,                % Shows glossary in the table of content
    xindy,              % Used superior indexing tool
    acronym,
    nopostdot,
    %nostyles
    ]{glossaries}

\makeglossaries         % used to generate the glossary

\newglossaryentry{fab region}{
   type        = \acronymtype,
   name        = {fab region},
   description = {fragment antigen-binding region},
   first       = {fragment antigen-binding region (fab region)},
   see         = [Glossary:]{gls:fab region}
}

\newglossaryentry{gls:fab region}{
    name= Fab region,
    description={The fragment antigen-binding region binds antigens. It is composed of the antibody's light chains and parts of the heavy chains}
}

\begin{document}

This is a test \gls{fab region}\glsadd{gls:fab region}.

\printglossary[type=\acronymtype] % prints just the list of acronyms 
\printglossary

\end{document}

I've commented out the nostyles option because there must be at least one style defined and you haven't provided an alternative. With nostyles present, the log file should contain some warnings about it.

Acronyms fab region fragment antigen-binding region 1, Glossary: Fab region

Glossary Fab region The fragment antigen-binding region binds antigens. It is composed of the antibody’s light chains and parts of the heavy chains 1

This does seem unnecessary duplication. It would be simpler to just do:

\documentclass{report}

\usepackage[
    toc,                % Shows glossary in the table of content
    xindy,              % Used superior indexing tool
    nopostdot,
    %nostyles
    ]{glossaries}

\makeglossaries         % used to generate the glossary

\setacronymstyle{long-short-desc}

\newacronym[
  description={The fragment antigen-binding region binds antigens. It is composed of the antibody's light chains and parts of the heavy chains}
]{fab region}{fab region}{fragment antigen-binding region}

\begin{document}

This is a test \gls{fab region}.

\printglossary[style=altlist]

\end{document}

Page 1:

This is a test fragment antigen-binding region (fab region).

Page 2:

Glossary fragment antigen-binding region (fab region) The fragment antigen-binding region binds antigens. It is composed of the antibody’s light chains and parts of the heavy chains 1

If you absolutely need a dual-entry system that automatically indexes the related term, you might want to consider using the extension package glossaries-extra with bib2gls (instead of xindy).

For example:

\documentclass{report}

\begin{filecontents*}{entries.bib}
% Encoding: UTF-8

@dualabbreviationentry{fab-region,
  short = {fab region},
  long = {fragment antigen-binding region},
  description={The fragment antigen-binding region binds antigens. It is composed of the antibody's light chains and parts of the heavy chains}
}
\end{filecontents*}

\usepackage[
    record,% use bib2gls
    abbreviations % create 'abbreviations' list
    ]{glossaries-extra}


\setabbreviationstyle{long-short}

\GlsXtrLoadResources[
 src=entries % data in the file entries.bib
]

\begin{document}

This is a test \gls{fab-region}.

\printunsrtglossary[type=abbreviations,title=Acronyms]
\printunsrtglossary

\end{document}

If the file is called myDoc.tex then the document build is:

pdflatex myDoc
bib2gls myDoc
pdflatex myDoc

or if you want the glossary separated into letter groups:

pdflatex myDoc
bib2gls -g myDoc
pdflatex myDoc

Page 1 as before. Page 2:

Acronyms fab region fragment antigen-binding region 1

Page 3:

Glossary fragment antigen-binding region The fragment antigen-binding region binds antigens. It is composed of the antibody’s light chains and parts of the heavy chains

If you want the cross-reference:

\documentclass{report}

\begin{filecontents*}{entries.bib}
% Encoding: UTF-8

@dualabbreviationentry{fab-region,
  short = {fab region},
  long = {fragment antigen-binding region},
  description={The fragment antigen-binding region binds antigens. It is composed of the antibody's light chains and parts of the heavy chains}
}
\end{filecontents*}

\usepackage[
    record,% use bib2gls
    abbreviations % create 'abbreviations' list
    ]{glossaries-extra}


\setabbreviationstyle{long-short}

\GlsXtrLoadResources[
 src=entries, % data in the file entries.bib
 dual-field % create a field called 'dual' for cross-referencing
]

\renewcommand{\glsxtrpostdescabbreviation}{%
  \ifglshasfield{dual}{\glscurrententrylabel}
  {%
  .\space
  \emph{Glossary:} \glshyperlink{\glsxtrusefield{\glscurrententrylabel}{dual}}.%
  }%
 {}%
}

\begin{document}

This is a test \gls{fab-region}.

\printunsrtglossary[type=abbreviations,title=Acronyms]
\printunsrtglossary

\end{document}

Page 2 now looks like:

Acronyms fab region fragment antigen-binding region. Glossary: fab region. 1

This puts the reference before the location list rather than after it (as in the first example).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .