0

I need to make a List of Abbreviations and Acronyms for my thesis.

I am a beginner with LateX and I have tried numerous times to insert the glossary professionally but it just does not work. This is why I tried this simpler idea: Simple list of abbreviations manually

However, 1) how can I remove the dots 2) and also how can I italicize the bold abbreviations (and remove the bold function)?

\usepackage{calc}
\usepackage{lipsum}
\makeatletter
\newcommand{\tocfill}{\cleaders\hbox{$\m@th \mkern\@dotsep mu . \mkern\@dotsep mu$}\hfill}
\makeatother
\newcommand{\abbrlabel}[1]{\makebox[3cm][l]{\textbf{#1}\ \tocfill}}
\newenvironment{abbreviations}{\begin{list}{}{\renewcommand{\makelabel}{\abbrlabel}%
        \setlength{\labelwidth}{3cm}\setlength{\leftmargin}{\labelwidth+\labelsep}%
                                              \setlength{\itemsep}{0pt}}}{\end{list}}
\begin{document}
\noindent\lipsum[1]
\begin{abbreviations}
\item[US] United States
\item[EU] European Union
\item[Gvmt] Government. \lipsum[2]
\end{abbreviations} 
\lipsum[3]
\end{document}
1
  • To be honest, the last answer on the website you linked is what you might want to try. Just remove \dotfill and @{$\dots\dots$} from the code. However, if you want your abbreviations in italics, you probably need to add \usepackage{array} and define columns as follows: \begin{tabular}{>{\itshape}l l}.
    – Celdor
    Jan 18, 2022 at 8:59

2 Answers 2

1

this is not what I would have recommended because using packages likes glossary-extra is usualy less works. However the following code make what you want :

\documentclass{article}
\usepackage{calc}
\usepackage{lipsum}
\makeatletter
\newcommand{\tocfill}{\cleaders\hbox{$\m@th \mkern\@dotsep mu   \mkern\@dotsep mu$}\hfill}
\makeatother
\newcommand{\abbrlabel}[1]{\makebox[2cm][l]{\textit{#1}\ \tocfill}}
\newenvironment{abbreviations}{\begin{list}{}{\renewcommand{\makelabel}{\abbrlabel}%
        \setlength{\labelwidth}{1cm}\setlength{\leftmargin}{\labelwidth+\labelsep}%
                                              \setlength{\itemsep}{0pt}}}{\end{list}}
\begin{document}
\noindent\lipsum[1]
\begin{abbreviations}
\item[US] United States
\item[EU] European Union
\item[Gvmt] Government. \lipsum[2]
\end{abbreviations} 
\lipsum[3]
\end{document}

Some explaination : the code you provide uses two custom commands (tocfill and abbrlabel) which are responsible for the "dots" and the "bold abbreviation label". I replaced the dot with a space in the first command and \textbf (bold font) by \textit (italic) to change the bold label to an italic one in the second command. Then because it felt weird to have the explaining text so far away I tweaked the size of the label box from 3cm to 2 and because I though it was a cool feature that you might want I changed the environnement labelwith to 1cm to show you how to use it.

0

It's not really the answer you were looking for, but I really recommend (with the experience of writing a thesis myself) to use the glossary package and its extensive options (or the glossary-extra package for even more).

However, to show the glossary in your document you must run the makeglossaries application in your TeX editor (e.g. TeXstudio->Tools->Command->Makeglossaries), which should not be confused with the \makeglossary respectively \makeglossaries command.

    \documentclass{article}
    \usepackage{glossaries}
    
    \newacronym{us}{US}{United States}
    \newacronym{eu}{EU}{European Union}
    \newacronym{gvmt}{Gvmt}{Government}
    
    \makeglossary
    \begin{document}
    Actually use one or two acronyms in a first use of \gls{us} and afirst use of \gls{eu}.
    
    Print the glossary, but only for used acronyms (so: \gls{us} and \gls{eu}).
    \printglossary
    \end{document}

You must log in to answer this question.

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