0

I have to add an acronym list in my document and for that I am using:

\usepackage[acronym,style=long3col]{glossaries}
\makeglossaries

and

\newacronym{LOWERCASE LABEL}{UPPERCASE LABEL}{THE FULL TERM}\par
\printglossary[type=\acronymtype,title=Acronyms]

However I am getting an error:

\newacronym{LOWERCASE LABEL}{UPPERCASE LABEL}{THE FULL TERM}\par
\printglossary[type=\acronymtype,title=Acronyms]

Please can someone tell me what's wrong with my code. Please find the code below:

\documentclass[12pt,MSc,wordcount,oneside,anon, left= 40mm, right = 20mm, top = 20mm, bottom = 20mm]{muthesis}
\usepackage{hyperref}
\usepackage{fancyhdr}
\usepackage{color}
\usepackage{eucal}
\usepackage{graphicx}
\usepackage{etoolbox}
\usepackage{float}
\usepackage{longtable}
\usepackage{tabularx}
\usepackage{multicol}
\usepackage[justification=centering]{caption}

\usepackage[acronym,style=long3col]{glossaries} \makeglossaries

\usepackage{textcomp} \usepackage{enumerate} \usepackage{amsmath} \usepackage{amssymb} \usepackage{pifont} \newcommand{\cmark}{\ding{51}}% \newcommand{\xmark}{\ding{55}} \usepackage{cleveref} \graphicspath{ {pics/} } \setlength{\parindent}{4em} \setlength{\parskip}{1em} \renewcommand{\baselinestretch}{1.5} \setcounter{secnumdepth}{4}

\begin{document} { \newacronym{LOWERCASE LABEL}{UPPERCASE LABEL}{THE FULL TERM}\par \printglossary[type=\acronymtype,title=Acronyms]

\begin{titlepage} \begin{center} \vspace*{1cm} }

\bibliographystyle{ieeetr} %ieeetran} \bibliography{references}

%\end{flushleft} \end{document}

Ingmar
  • 6,690
  • 5
  • 26
  • 47
Twisha
  • 1
  • 1
    Welcome to tex.sx. You can highlight your code in-line by preceding and following it by a backtick. To keep a separate code block formatted properly, highlight the block with your mouse, then click on the {} icon above the question box. – barbara beeton Jul 18 '22 at 16:03
  • Do you get the same error with \documentclass{article} \usepackage{glossaries} \begin{document} z \end{document}? – Dai Bowen Jan 08 '24 at 18:33

1 Answers1

0

Here are some comments on your code:

  1. hyperref should be loaded last with a few exceptions.

  2. \newacronym should be used in the preamble of your document, after \makeglossaries. If you are going to define many entries it should be preferable to write them in a separate .tex file and include the file with \input{...} or better \loadglsentries{...} (again, after \makeglossaries)

  3. You have a \begin{titlepage} without its corresponding \end{titlepage}.

  4. There is a group starting after \begin{document} and ending after \vspace*{1cm} that does nothing but trouble.

  5. Finally you have to use an acronym in order to print something. Remember that the compilation chain should be something like:

    pdflatex mydoc.tex

    makeglossaries mydoc

    pdflatex mydoc.tex

(pdflatex could be changed for your favorite TeX flavor)

An example on how to add acronyms to your document is the following

\documentclass[12pt,MSc,wordcount,oneside,anon, left= 40mm, right = 20mm, top = 20mm, bottom = 20mm]{muthesis}

\usepackage{textcomp} \usepackage{enumerate} \usepackage{amsmath} \usepackage{amssymb} \usepackage{pifont} \usepackage{fancyhdr} \usepackage{color} \usepackage{eucal} \usepackage{graphicx} \usepackage{etoolbox} \usepackage{float} \usepackage{longtable} \usepackage{tabularx} \usepackage{multicol} \usepackage[justification=centering]{caption} \usepackage{hyperref}

\usepackage[acronym,style=long3col]{glossaries} \makeglossaries \newacronym{svm}{SVM}{Support Vector Machine}

\newcommand{\cmark}{\ding{51}}% \newcommand{\xmark}{\ding{55}} \usepackage{cleveref} \graphicspath{ {pics/} } \setlength{\parindent}{4em} \setlength{\parskip}{1em} \renewcommand{\baselinestretch}{1.5} \setcounter{secnumdepth}{4}

\begin{document} \printglossary[type=\acronymtype,title=Acronyms]

\chapter{test} Hello world!

First use of acronym \gls{svm}. Second use \gls{svm} \end{document}

Luis Turcio
  • 2,757
  • Thank you for your response. However I am still getting the same error.

    Package hyperref Message: Driver (autodetected): hpdftex.

    ("C:\Program Files\MiKTeX 2.9\tex\latex\hyperref\hpdftex.def" ("C:\Program Files\MiKTeX 2.9\tex\latex\oberdiek\rerunfilecheck.sty")) ("C:\Program Files\MiKTeX 2.9\tex\latex\glossaries\base\glossaries.sty" ! Undefined control sequence. \DeclareRelease

    l.42 \DeclareRelease {v4.46}{2020-03-19}{glossaries-2020-03-19.sty} ?

    – Twisha Jul 25 '22 at 21:38
  • I'm not sure what is going on with your installation. In my local installation, the code runs as expected, I also tried in TeXlive (adding automake option to glossaries) and overleaf and, again, runs as expected. Since I'm not very skillful, I suggest asking a new question containing the details in your comment and I hope you can find a solution to your problem – Luis Turcio Jul 25 '22 at 22:19
  • Thanks Luis for your reply. I am still not able to figure out the problem. Is there anyone else who can help me please. – Twisha Jul 29 '22 at 11:37