# To print Glossary of Chemical symbols correctly

Code

\documentclass{article}

\makeglossaries % Generate the glossary
\usepackage{mhchem}

\begin{document}

\newglossaryentry{co2}{name=CO2, description={Carbon Dioxide}}

Calculation of the corresponding \gls{co2} emissions to cover the surplus in electricity demand.

\printglossary[type=acronym,title={List of Abbreviations}]
% \printglossaries

\end{document}


where you see another problem is that the symbol is not printed correctly with subscript.

I would like to get a section "Abbreviations of Glossaries", example output with many items

How can you print the glossary correctly with the section?

How can print the glossary reference correctly of a chemical symbol?

As in mhchem answer, use \ce{CO2} to get the right formatting.

If you want to get your "List of Abbreviations" printed, load the glossaries package with the option acronym

\usepackage[acronym]{glossaries} % Load the package


and define your entries as acronyms before \begin{document}, e.g.

\newacronym{co2}{\ce{CO2}}{Carbon Dioxide}


MWE:

\documentclass{article}
\makeglossaries % Prepare the glossary
\usepackage[version=3]{mhchem}

\newacronym{co2}{\ce{CO2}}{Carbon Dioxide}

\begin{document}

Calculation of the corresponding \gls{co2} emissions to cover
the surplus in electricity demand.

\printglossary[type=acronym,title={List of Abbreviations}]
%\printglossaries

\end{document}


Output:

• Not to have a page number like in the example of the body, you can use \usepackage[acronym,nonumberlist]{glossaries} where the option nonumberlist. – Léo Léopold Hertz 준영 Apr 18 '15 at 8:16
• @Masi of course. – karlkoeller Apr 18 '15 at 8:16

This is a first step towards your answer. To get the chemical symbols, use this

\documentclass{article}
%\makeglossaries % Prepare the glossary
\usepackage[version=3]{mhchem}
\begin{document}

\newglossaryentry{co2}{name={\ce{CO2}}, description={Carbon Dioxide}}

Calculation of the corresponding \gls{co2} emissions to cover
the surplus in electricity demand.

%\printglossary[type=acronym,title={List of Abbreviations}]
% \printglossaries

\end{document}


During testing, I had to delete the .glsdefs file every time I changed the gloassary entry.

What you need now, is to run a sorting program over the .gls file. You have to tell it, that the sort key for \ce{CO2} should be CO2. Someone else might help you with this.

• I found this command \glsresetall which you can add to the end of the file after printing the glossary. Then, you do not need to delete .glsdefs file. – Léo Léopold Hertz 준영 Apr 18 '15 at 8:13