LaTEX – Working with Acronyms

Many packages exist to deal with Acronyms in LaTEX (e.g. acronym, acro, glossaries…). I chose the first on (acronyms) because i found it to the simplest and with “enough” functionalities

Minimal Working Example (MWE):

\documentclass[]{article}
\usepackage[printonlyused]{acronym}
% Possible package options:
%	- footnote :
%		The option footnote makes the full name appear as a footnote.
%	- nohyperlinks
%		If hyperref is loaded, all acronyms will link to their glossary entry. With the option nohyperlinks these links can be suppressed.
%	- printonlyused
%		Only list used acronyms
%	- withpage
%		In printonlyused-mode show the page number where each acronym was first used.
%	- smaller
%		Make the acronym appear smaller.
%	- dua
%		The option 'dua' stands for “don’t use acronyms”. It leads to a redefinition of \ac and \acp, making the full name appear all the time and 	suppressing all acronyms but the explicitly requested by \acf or \acfp.
%	- nolist
%		The option nolist stands for “don’t write the list of acronyms”.

%% to modify default formating, you can redefine the formatting for the \acf \acs and ac commands
\renewcommand*\acffont{\textit}
\renewcommand*\acsfont{\textbf}
\renewcommand*\acfsfont{\underline}

%% Possibly, you can define acronyms and exclude them from the acronym list
\newacro{gpio}  [GPIO]  {General-purpose input/output}

\begin{document}
\section*{List of Acronyms}
\begin{acronym}[ICANN]
	\acro  {iot}   [IoT]   {Internet-of-Things} 
	\acro  {icann} [ICANN] {Internet Corporation for Assigned names and Numbers}
	\acro  {iso}   [ISO]   {International Organization for Standardization} 
	\acro  {ietf}  [IETF]  {Internet Engineering Task Force} 	% will not be listed, as it is not used
%% Define a custom plural form of an acronym	
	\acrodefplural{iot}[IoTs]{Internets-of-Things} 
%% Preferably, put all acronym definitions in one file and load it
%	\input{acros.tex}
\end{acronym}
\section{Different cases}
	\begin{tabular}{lll}                
		\verb|\ac{iot}|        & first use                   & \ac{iot}      \\
		\verb|\ac{iot}|        & second use                  & \ac{iot}      \\
		\verb|\acl{iot}|       & force the long version      & \acl{iot}     \\
		\verb|\acs{iot}|       & force the short version     & \acs{iot}     \\
		\verb|\acf{iot}|       & force the full version      & \acf{iot}     \\
		\verb|\aclp{iot}|      & force the plural version    & \aclp{iot}    \\ %\acp, \acsp, \acfp
		\verb|\acfi{iot}|      & force the italic version    & \acfi{iot}    \\
		\verb|\ac*{iso}|       & first use, don't mark used  & \ac*{iso}     \\ % same with all other commands
		\verb|\ac{iso}|        & second use                  & \ac{iso}      \\
		\verb|\aclp{iso}|      & force the plural version    & \aclp{iso}    \\ 
		\verb|\acused{ICANN}|  & mark as used, no printing   & \acused{icann}\\
		\verb|\ac{ICANN}|      & second use, as if it is 1st & \ac{icann}	 \\
		\verb|\ac{gpio}|       & acronym used, but not listed& \ac{gpio}     \\   
		\verb|\ac{gpio}|       & second use                  & \ac{gpio}     
	\end{tabular} 
\end{document}

Resulted Output:

References:

How can i use the LaTeX acronym package, and optionally create an acronym list in the document?
An Acronym Environment for LATEX 2

(Visited 18,401 times, 4 visits today)