Created
February 26, 2024 18:04
-
-
Save juandesant/0101a49fae94069e970484aa8609c0e3 to your computer and use it in GitHub Desktop.
Create glossary and index entries in LaTeX
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\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