Skip to content

Instantly share code, notes, and snippets.

@juandesant
Created February 26, 2024 18:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save juandesant/0101a49fae94069e970484aa8609c0e3 to your computer and use it in GitHub Desktop.
Save juandesant/0101a49fae94069e970484aa8609c0e3 to your computer and use it in GitHub Desktop.
Create glossary and index entries in LaTeX
\documentclass{article}
\usepackage{hyperref}
\usepackage{makeidx}
\usepackage{glossaries}
\makeindex
\makeglossaries
% Define your acronym
\newacronym{ALMA}{ALMA}{Atacama Large Millimeter/submillimeter Array}
\newacronym{ASDM}{ASDM}{ALMA Science Data Model}
% Define your custom index entry
\newcommand{\indexentry}[2]{\index{#1|see{#2}}\index{#2}}
\begin{document}
% Use the acronym in the document
The \gls{ALMA} is an impressive telescope. It stores data in the \gls{ASDM} format.
% Generate index entry
\indexentry{ALMA Science Data Model}{ASDM}
\indexentry{Atacama Large Millimeter/Submillimeter Array}{ALMA}
% Print the glossary
\printglossaries
% Print the index
\printindex
\end{document}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment