# Generate glossary based on acronym reference

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?

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.

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:

Page 2:

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}

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:

Page 3:

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}

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

\renewcommand{\glsxtrpostdescabbreviation}{%
\ifglshasfield{dual}{\glscurrententrylabel}
{%
.\space
}%
{}%
}

\begin{document}

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

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

\end{document}


Page 2 now looks like:

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