I am using Easy Thesis template from Sharelatex. This template uses Thesis.cls which contains code for ABBREVIATIONS. The code is shown below:
%VJ START (ABBREVIATIONS)
\newcommand\listabbrename{List Of Abbreviations} % title "List Of Abbreviations" printed in "LIST OF ABBREVIATIONS"
\usepackage{longtable}
\newcommand\listofabbre [2]{
\btypeout{\listabbrename}
%VJ \addtotoc{\listabbrename}
\chapter*{\listabbrename
\@mkboth{
\MakeUppercase\listabbrename}{\MakeUppercase\listabbrename} }
\begin{longtable}[l]{#1}#2\end{longtable}\par
\cleardoublepage
}
%VJ END (ABBREVIATIONS)
I get some idea from a post by Ivan at (Modifying existing code to sort a list of abbreviations) using glossaries package to get the abbreviations to sort in order. I feel his way is much easier. So I tried to modified the existing code in Thesis.cls incorporating Ivan's code. I tried to generate compilable code for testing purpose and the code is below:
\documentclass[a4paper, 12pt]{../Thesis}
\usepackage[latin1]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx}
%start section in Thesis.cls%
\usepackage{longtable}
\usepackage[acronym,nonumberlist,shortcuts]{glossaries}
\glossarystyle{long}
\renewcommand*{\acronymname}{List of Abbreviations} % rename title
\renewcommand*{\glspostdescription}{} % remove dot at the end of description
\makeglossaries
%\newcommand\setacronymdb[1]{\loadglsentries{#1}} % the name of the acronym database
\newcommand\listofnomenclature[2]{
\btypeout{\acronymname}
%%VJ \addtotoc{\listsymbolname}
\chapter*{\acronymname
\@mkboth{
\MakeUppercase\acronymname}{\MakeUppercase\acronymname} }
\begin{longtable}[l]{#1}#2\end{longtable}\par
\printglossaries
\par
\cleardoublepage
}
%end section in Thesis.cls%
%\setacronymdb{Abbrev}
\begin{document}
%\listofnomenclature
\input{../Frontpages/Abbrev.tex}
\section{Introduction}
This is how I refer to the samples of acronym in the database named Abbrev: \acs{CO2}.
\end{document}
The Abbrev.tex file contains:
%\clearpage
\addtotoc{LIST OF ABBREVIATIONS-test}
\pagestyle{fancy} % The page style headers have been "empty" all this time,
% now use the "fancy" headers as defined before
\setstretch{1.3} % Set the line spacing to 1.5,
% this makes the following tables easier to read
%\lhead{\emph{Abbreviations}} % Set the left side page header to "Abbreviations"
%\listofabbrenamesvj{l l}
\listofnomenclature{l r}
{
\addtocontents{toc}{\vspace{0.5em}} % Add a gap in the Contents,
\newacronym{CO2}{CO$_{2}$}{Carbon diOxide}
\newacronym{GSM}{GSM}{Global System for Mobile Communications}
}
This time I can compile this code using my "Thesis.cls" but the output format of TOC and title is not as I wanted.
I hope to get some help here.
Many thanks in advance.
Best Answer
As i already pointed out in the comments,
Thesis.cls
is a very very bad template. Unfortunately, it is not the only one provided by the website.Just as Ivan mentioned in the other question, you need to use a package that automates sorting and everything related.
glossaries
can do the job wonderfully.Thesis
declares an environment you have to sort and fill yourself.glossaries
gives you some useful commands to use in your text as well. One thing you have to remeber is running the helper scriptmakeglossaries
as described in the documentation.Please note that i used package
chemformula
to typeset chemical structures. It has a very nice and clean interface and is easy to use. Another package to print acronyms is packageacro
. It has an interface just as easy to as as that ofchemformula
, which isn't much of a surprise as the author is the same guy. Advantage: You don't need an extra helper program.The default appearance differs from that of glossaries. You can change the appearance using options or define some helper commands.
To sum it up: When starting up a project, you need to decide for either
glossaries
oracro
(there are a few more, but really, does are the two yo can safely work with).acro
handles acronyms,glossaries
can do a whole bunch of other things as well. If you are consistently using the interface commands within your text, you will get a nice, clean and failsafe result.If however, your document is finished and you decide to add some terms in a list to form a list of Acronyms you should use a simple LaTeX environment. Use a list or a table. If you have 20 entries you can sort them by hand; 50 sort them by hand. If there are a lot of entries, consider using the solution provided in Modifying existing code to sort a list of abbreviations by cgnieder, who (surprise) is the author of
chemformula
(and other great chemistry related package) andacro
.