1

I am using \usepackage{acronym} in my nomenclature. However, as I have to include a lot of chemistry in my report, it seems like the preamble setup result in the TOC showing the full acronym, even though the acronym is used in the text before it is used in the headline. So it seems as if the TOC is working separate from the text, which it should not.

enter image description here

\documentclass[a4paper,11pt,fleqn,twoside,openright]{memoir}   
\usepackage[english]{babel}
\usepackage{graphicx}
\usepackage{pdfpages}
\usepackage{multirow}
\usepackage{float}
\usepackage{subcaption}
\usepackage{acronym} 
\usepackage{amsmath,amssymb,stmaryrd}
\usepackage{xfrac}
\usepackage[version=4]{mhchem}
\usepackage{eurosym}
\usepackage[round]{natbib}
\bibliographystyle{0.Litteraturliste/harvard}   
\usepackage{listings}
\usepackage[shortlabels]{enumitem}
\usepackage[colorlinks]{hyperref}
\hypersetup{colorlinks = true,
    linkcolor = black,
    citecolor = black,
    urlcolor = black}
\setsecnumdepth{subsubsection}
\settocdepth{section}
\setlrmarginsandblock{3.5cm}{2.5cm}{*}
\setulmarginsandblock{2.5cm}{3.0cm}{*}
\checkandfixthelayout                   
\setlength{\parindent}{0mm}
\setlength{\parskip}{2mm}
\linespread{1,1}
\captionstyle{\centering}
\captionwidth{\linewidth}
\usepackage{transparent}
\newif\ifchapternonum
\makechapterstyle{jenor}{                   
  \renewcommand\beforechapskip{0pt}
  \renewcommand\printchaptername{}
  \renewcommand\printchapternum{}
  \renewcommand\printchapternonum{\chapternonumtrue}                         \renewcommand\chaptitlefont{\fontfamily{pbk}\fontseries{db}\fontshape{n}\fontsize{20}{30}\selectfont\raggedright}     \renewcommand\chapnumfont{\fontfamily{pbk}\fontseries{m}\fontshape{n}\fontsize{0.7in}{0in}\selectfont\color{black}\transparent{0.6}}
  \renewcommand\printchaptertitle[1]{%
    \noindent
    \ifchapternonum
    \begin{tabularx}{\textwidth}{X}
    {\let\\\newline\chaptitlefont ##1\par} 
    \end{tabularx}
    \par\vskip-2.5mm\hrule
    \else
    \begin{tabularx}{\textwidth}{Xl}
    {\parbox[b]{\linewidth}{\chaptitlefont ##1}} & \raisebox{-15pt}{\chapnumfont \thechapter}
    \end{tabularx}
    \par\vskip2mm\hrule
    \fi
  }
}   
\chapterstyle{jenor}
\makepagestyle{Uni}
\makepsmarks{Uni}{%
    \createmark{chapter}{left}{shownumber}{}{. \ }
    \createmark{subsubsection}{right}{shownumber}{}{. \ }
    \createplainmark{toc}{both}{\contentsname}
    \createplainmark{lof}{both}{\listfigurename}
    \createplainmark{lot}{both}{\listtablename}
    \createplainmark{bib}{both}{\bibname}
    \createplainmark{index}{both}{\indexname}
    \createplainmark{glossary}{both}{\glossaryname}
}
\makeevenhead{Uni}{}{}{\leftmark}
\makeoddhead{Uni}{\rightmark}{}{}
\makeevenfoot{Uni}{\thepage}{}{}
\makeoddfoot{Uni}{}{}{\thepage}
\makeheadrule{Uni}{\textwidth}{0.5pt}
\makefootrule{Uni}{\textwidth}{0.5pt}{1mm}
\copypagestyle{Unichap}{Uni}
\makeoddhead{Unichap}{}{}{}
\makeevenhead{Unichap}{}{}{}
\makeheadrule{Unichap}{\textwidth}{0pt}
\aliaspagestyle{chapter}{Unichap}
\pagestyle{Uni}

\begin{document}
\input{1.Formalia/Titelblad}
\cleardoublepage 
\phantomsection
\pdfbookmark[0]{Indholdsfortegnelse}{indhold}
\tableofcontents*
\addtocontents{toc}{\vskip -0.8cm}
\addtocontents{lof}{\vskip -0.3cm}
\raggedbottom
\cleardoublepage 
\frontmatter
\input{1.Formalia/acro_list}
\mainmatter
\input{2.TEXT/TEXT}
\end{document}

1.Formalia/Titelblad

\phantomsection \thispagestyle{empty} \begin{center} \begin{tabular}{c} {\HUGE\textbf{A nature-based solution to remove}} \ {\HUGE\textbf{hydrogen sulphide}} \end{tabular}
\end{center} \hrulefill \begin{center} \begin{tabular}{lcl} & Master thesis & \
& Department of the Built Environment & \ & Aalborg University & \end{tabular}
\end{center} \textbf{Number of pages} & & XX \ \end{tabular} \begin{center}{\footnotesize\itshape The present report with source references and appendix is not allowed published without prior written approval from either the thesis author, supervisors or external partners. Moreover, the thesis content is not allowed to be employed for commercial purposes without written approval.} \end{center}

1.Formalia/acro_list

\chapter{Nomenclature} \begin{acronym}[MPC] \acro{H_{2}S}[\ce{H_{2}S}]{Hydrogen sulphide} \acro{HS^{-}}[\ce{HS^{-}}]{Bi-sulphide} \acro{S^{2-}}[\ce{S^{2-}}]{Sulphide ion} \acro{SO_{4}^{-2}}[\ce{SO_{4}^{-2}}]{Sulphate} \end{acronym}

2.TEXT/TEXT

\chapter{Towards a sustainable future} Sewers have been found to release greenhouse gases, and some attention has been on the release of \ac{CH_{4}} due to anaerobic processes, however, it seems likely that \ac{N_{2}O} can also be released when \ac{H_{2}S} is managed by addition of \ac{NO_{3}^{-}}. Hence a holistic approach is required where the treatment plant is not seen isolated but as integrated with the treatment plant. This also holds true when addressing why \ac{N_{2}O} emissions vary in a treatment plant, as loadings from the network vary in time, for example in terms of \ac{CH_{4}}, \ac{COD} and flow. \chapter{\ac{H_{2}S} in the sewer system} \ac{H_{2}S} is a pervasive malodorous compound that causes concrete and metal corrosion (Figure \ref{fig:INTROCorrosion}) \citep{Svovlbrintehandbogen, Shypanski2018, JesAsbjornBog, Kiilerich-Kinetics, Zdeb2008, Kiilerich-Precipitation}. A survey from 2016 showed that 39 of the 41 participating Danish water utilities had experienced \ac{H_{2}S}-related issues \citep{DANVAGRUNDFOS}. The presence of \ac{H_{2}S} can be a significant nuisance to the surroundings and cause public dissatisfaction. \cite{DANVAGRUNDFOS} estimated, that the utilities spent an average of six hours per month handling odour complaints with just over half of the utilities having it as a service goal \citep{DANVAGRUNDFOS}. Although the generation of \ac{H_{2}S} can occur in any section of the wastewater conveyance networks, the application of force mains, and the possible anaerobic conditions that follow, are considered to be the main source \citep{Shypanski2018, JesAsbjornBog}. Under anaerobic conditions, \ac{SO_{4}^{-2}} present in the wastewater is reduced to \ac{S^{2-}}, by the \ac{SR} microorganisms residing in the biofilms found on the sewer structure and the sediment, and \ac{H_{2}S} is produced. The build-up of \ac{H_{2}S} in the system is partly released to the surroundings when the wastewater depressurises at the end of the force main (Figure \ref{fig:H2S-Skitse}) \citep{Despot2021, JesAsbjornBog, Kiilerich-Kinetics}. \section{The \ac{S^{2-}} production in the anaerobic biofilm} In sewers, biofilms are an extracellular matrix, consisting of polymeric substances excreted by the microorganisms living within it, adhering to the submerged inner surface of the sewer wall and the bottom sediment \citep{OxyChem, Shiba, JesAsbjornBog, Despot2021, Victoria2021}. Biofilm can also be found on moist surface areas, such as areas that are exposed to the water phase, resulting either from capillary forces or condensation of the high humidity in the sewer air \citep{JesAsbjornBog}. The gelatinous biofilm can be compartmentalised into different zones depending on the presence and concentration of electron acceptors \citep{JesAsbjornBog, ZHANG20081, Svovlbrintehandbogen}.

Hope you can help me fix this :-)


When using \ac*{} in all the headline instead of \ac{}, the following happen: enter image description here


When adding the following changes in the preamble:

\usepackage[version=4]{mhchem}
\mhchemoptions{font=sf}

The \Ac{} and \ac{} string does not produce the expanded acronym with the acronym in brackets, when the acronym is first utilised, as shown on the picture.

enter image description here

I do not know If this is because I have a list of tables and a list of figures before the actual text, which makes the caption the first acronym appearance or if the chapter headline function as the first appearance.

Draft document with the necessary information about the document setup.

10
  • Could you edit your code to begin with your \documentclass and end with \end{document} , a Minimal Working Example (MWE) please. It makes copy and pasting easier when the code can be compiled and also we do not need to guess what commands or packages you are using. Your code cannot compile as it is, help people help you as I am sure this is easily solved
    – JamesT
    Feb 17, 2023 at 0:29
  • As I can't see how you named your second chapter or section 2.1, there is no way of telling what is happening here. Generally speaking the title of a chapter or section is placed verbatim in the toc, so are the entries for chapter 2 and section 2.1 the same as the titles you entered?
    – alchemist
    Feb 17, 2023 at 0:29
  • 2
    As a chemist I would advise you to add ion to the sulfide in the title of section 2.1. There are sulfide ions produced in the biofilm. Sulfide is not a substance on its own, but part of one.
    – alchemist
    Feb 17, 2023 at 0:32
  • I have added both \begin{document} , \documentclass , \end{document} and the a snippet of the text.
    – Minouuuu
    Feb 17, 2023 at 1:41
  • 1
    Essentially both. Unless the chemical symbol of the sulfide ion is used in a chemical reaction, it is advised to denote the individual components of a salt as ions. This is especially needed when speaking of ions from metals. The IUPAC Red book Brief Guide states rules about nomenclature, but alas not about textbook use. So the advice is from a teacher's / reader's point of view to clarify possible misunderstandings.
    – alchemist
    Feb 17, 2023 at 8:22

2 Answers 2

3

Well, at first mhchem and acronym threw some obscure errors at me using your samples. But then the mhchem manual gave the clue to solve that. So this is the resulting MWE that offers a solution to your question:

\documentclass[11pt]{report}

\usepackage[a4paper,margin=2cm]{geometry}

\usepackage[version=4]{mhchem}
    \mhchemoptions{font=sf}
    
\usepackage{acronym}

\begin{document}
    
    \tableofcontents
    
\chapter{\Acl{H2S} in the sewer system}

     \Ac{H2S} is a pervasive malodorous compound that causes concrete and metal corrosion (Figure A) . A survey from 2016 showed that 39 of the 41 participating Danish water utilities had experienced \ac{H2S}-related issues. The presence of \ac{H2S} can be a significant nuisance to the surroundings and cause public dissatisfaction.  estimated, that the utilities spent an average of six hours per month handling odour complaints with just over half of the utilities having it as a service goal .   

    Although the generation of \ac{H2S} can occur in any section of the wastewater conveyance networks, the application of force mains, and the possible anaerobic conditions that follow, are considered to be the main source. Under anaerobic conditions, \ac{SO42-} present in the wastewater is reduced to \ac{S2-}, by the \ac{SR} microorganisms residing in the biofilms found on the sewer structure and the sediment, and \ac{H2S} is produced. The build-up of \ac{H2S} in the system is partly released to the surroundings when the wastewater depressurises at the end of the force main (Figure B).

\section{The \acs{S2-} ion production in the anaerobic biofilm}
    
    In sewers, biofilms are an extracellular matrix, consisting of polymeric substances excreted by the microorganisms living within it, adhering to the submerged inner surface of the sewer wall and the bottom sediment . Biofilm can also be found on moist surface areas, such as areas that are exposed to the water phase, resulting either from capillary forces or condensation of the high humidity in the sewer air . The gelatinous biofilm can be compartmentalised into different zones depending on the presence and concentration of electron acceptors.

\section{Acronyms}
    
    \begin{acronym}[H2CO3]
        \acro{H2CO3}[\ce{H2CO3}]{carboxylic acid}
        \acro{H2S}[\ce{H2S}]{dihydrogen sulfide}
        \acro{S2-}[\ce{S^{2-}}]{sulfide ion}
        \acro{H+}[\ce{H+}]{hydrogonium ion}
        \acro{SO42-}[\ce{SO_{4}^{2-}}]{sulfate ion}
        \acro{SR}{sulfonamide resistant}
    \end{acronym}
    
\end{document}

This MWE gives the following toc as result: acronym_toc

Depending whether you want the full name of the compound in the chapter / section you use \acl{} (or \Acl{} at the start of a sentence) or \acs{} for the formula of that compound.

Note you may need to adapt the way you entered your acronyms. The use math related notations in the acronym names threw errors about missing $ among others. The acronym manual shows the proper use (and the reason why) on page 4. Replacing your acronyms with the ones I suggest can be simply done in any editor using the Search and Replace functionality.

Edit The OP provided a sample in Overleaf to work with. After altering the \ac{abbr}to either \acl{abbr} or \acs{abbr} the toc looked correctly:

toc_overleaf

Intext the use of \acf{abbr} may be required to insert the full name plus acronym in parentheses.

5
  • It does not seem to work for me. I have added the result in the question at the top. I am not really sure what I am doing wrong. But I think some of the setup is mudding each other.
    – Minouuuu
    Feb 17, 2023 at 12:29
  • 1
    You commented on the suggestion made by Clemens Niederberger. I don't use that suggestion. According to the acronym manual the commands \acs{} and \acl{} are switches to use the short hand resp. long hand notation of the \acro{}[]{} entry. So do you use short hand notations in your acronyms?
    – alchemist
    Feb 17, 2023 at 12:41
  • @Minouuuu Am I correct in understanding, that you made your project in Overleaf available for others to work on? Did you make a backup of your project in case something goes wrong?
    – alchemist
    Feb 17, 2023 at 12:45
  • 1
    @Minouuuu I have edited the Overleaf example file you provided. It now compiles correctly: the long name of hydrogen sulfide in chapter / section and the short name for the sulfide ion in that section.
    – alchemist
    Feb 17, 2023 at 14:04
  • 1
    I have looked at your changes in the document, and I understand now, what I did wrong. Thanks so much for you help!
    – Minouuuu
    Feb 17, 2023 at 19:01
0

This is the complete fix, that the @alchemist provided in the draft Overleaf document.

\documentclass[a4paper,11pt,fleqn,twoside,openright]{memoir}
\usepackage[english]{babel}
\usepackage{graphicx}
\usepackage{pdfpages}
\usepackage{multirow}
\usepackage{float} 
\usepackage{subcaption}
\usepackage{acronym} 
\usepackage[version=4]{mhchem}
   \mhchemoptions{font=sf}
\usepackage{xfrac}
\usepackage{amsmath,amssymb,stmaryrd}
\usepackage{eurosym}
\usepackage{listings}
\usepackage[shortlabels]{enumitem}
\usepackage{transparent}
\newif\ifchapternonum
\makechapterstyle{jenor}{                   
   \renewcommand\beforechapskip{0pt}
   \renewcommand\printchaptername{}
   \renewcommand\printchapternum{}
   \renewcommand\printchapternonum{\chapternonumtrue}
   \renewcommand\chaptitlefont{\fontfamily{pbk}
   \fontseries{db}\fontshape{n}
   \fontsize{20}{30}\selectfont\raggedright}
   \renewcommand\chapnumfont{\fontfamily{pbk}
   \fontseries{m}\fontshape{n}\fontsize{0.7in}{0in}\selectfont\color{black}\transparent{0.6}}
   \renewcommand\printchaptertitle[1]{
   \noindent
   \ifchapternonum
   \begin{tabularx}{\textwidth}{X}
    {\let\\\newline\chaptitlefont ##1\par} 
   \end{tabularx}
   \par\vskip-2.5mm\hrule
   \else
   \begin{tabularx}{\textwidth}{Xl}
{\parbox[b]{\linewidth}{\chaptitlefont ##1}} & \raisebox{-15pt}{\chapnumfont \thechapter}
\end{tabularx}
\par\vskip2mm\hrule
\fi
 }
 }  
 \chapterstyle{jenor}   
\makepagestyle{Uni}
\makepsmarks{Uni}{
\createmark{chapter}{left}{shownumber}{}{. \ }
\createmark{subsubsection}{right}{shownumber}{}{. \ }
\createplainmark{toc}{both}{\contentsname}
\createplainmark{lof}{both}{\listfigurename}
\createplainmark{lot}{both}{\listtablename}
\createplainmark{bib}{both}{\bibname}
\createplainmark{index}{both}{\indexname}
\createplainmark{glossary}{both}{\glossaryname}
 }
 \makeevenhead{Uni}{}{}{\leftmark}
 \makeoddhead{Uni}{\rightmark}{}{} 
 \makeevenfoot{Uni}{\thepage}{}{}
 \makeoddfoot{Uni}{}{}{\thepage}
 \makeheadrule{Uni}{\textwidth}{0.5pt} 
 \makefootrule{Uni}{\textwidth}{0.5pt}{1mm} 
 \copypagestyle{Unichap}{Uni}
 \makeoddhead{Unichap}{}{}{}
 \makeevenhead{Unichap}{}{}{}
 \makeheadrule{Unichap}{\textwidth}{0pt}
 \aliaspagestyle{chapter}{Unichap}   
 \pagestyle{Uni}

 \begin{document}
 \phantomsection
 \thispagestyle{empty}
 \begin{center}
 \begin{tabular}{c}
  {\HUGE\textbf{A nature-based solution to remove}}
  \\
  {\HUGE\textbf{hydrogen sulphide}}
\end{tabular}  
\end{center}
\hrulefill
\begin{center}
\begin{tabular}{lcl}
& Master thesis &
\\  
& Department of the Built Environment &
 \\
& Aalborg University &
\end{tabular}  
\end{center}
\begin{center}{\footnotesize\itshape The present report with source references and appendix is not allowed published without prior written approval from either the thesis author, supervisors or external partners. Moreover, the thesis content is not allowed to be employed for commercial purposes without written approval.}
\end{center}
\cleardoublepage 
\phantomsection 
\tableofcontents*
\addtocontents{toc}{\vskip -0.8cm}
\addtocontents{lof}{\vskip -0.3cm}
\raggedbottom
\cleardoublepage 
\frontmatter

\begin{acronym}[Sulfilogger]
\acro{H2S}[\ce{H_{2}S}]{hydrogen sulphide}
\acro{HS-}[\ce{HS^{-}}]{bi-sulphide ion}
\acro{S2-}[\ce{S^{2-}}]{sulphide ion}
\acro{SO42-}[\ce{SO_{4}^{2-}}]{sulphate ion}
\acro{H2SO4}[\ce{H_{2}SO_{4}}]{sulphuric acid}
\acro{H+}[\ce{H^{+}}]{hydrogen ion}
\acro{pH-meter}{pH 3110 from WTW\textsuperscript{TM}}
\acro{alpha}[\ensuremath{\alpha}]{conversion coefficient}
\acro{Sulfilogger}{SulfiLogger\textsuperscript{TM} S1/X1-1020 from SulfiLogger A/S (Aarhus, Denmark)}
\acro{Odalog}{OdaLog\textregistered L2 Gas Logger from Thermo Fisher Scientific Inc}
\acro{SR}{Sulphate-reducing}
\end{acronym}

\cleardoublepage
\listoffigures
\cleardoublepage

\mainmatter
\chapter{\Acl{H2S} in the sewer system}
\Acf{H2S} is a pervasive malodorous compound that causes concrete and metal corrosion (Figure \ref{fig:INTROCorrosion}). A survey from 2016 showed that 39 of the 41 participating Danish water utilities had experienced \ac{H2S}-related issues. The presence of \ac{H2S} can be a significant nuisance to the surroundings and cause public dissatisfaction. DANVAGRUNDFOS estimated, that the utilities spent an average of six hours per month handling odour complaints with just over half of the utilities having it as a service goal. 
\begin{figure}[H]
\centering
\includegraphics[width=0.7\textwidth]{Korodering2.JPG}
\caption{Concrete structure at Tranbjerg pumping station with a sprayed-on pH indicator, which visualises the alkalinity through the appearance of colours with blue colours representing alkaline conditions and red colours representing acidic conditions. The presence of the red colours on the concrete structure indicates the adsorption of \ac{H2S} gas onto the damp surfaces of the structure material and the subsequent oxidation of the \ac{H2S} into the acidic \ac{H2SO4}. Photo taken by Asbjørn Haaning Nielsen.}
\label{fig:INTROCorrosion}
 \end{figure}

 \section{The \acs{S2-} production in the anaerobic biofilm} 
 \acf{SR} microorganisms, primarily \textit{Desulfovibrio} and \textit{Desulfotomaculum}, will subsequently oxidise the readily biodegradable organic substrate and, during the process, reduce the commonly found \ac{SO42-} to \ac{S2-}. 

 \section{Release of \acl{H2S} into the sewer atmosphere}
 When the \ac{S2-} diffuses into the liquid phase from the biofilm, it combines with the available \ac{H+} and dissociates into total dissolved \acl{S2-}, which is the pH-dependent mixture of \ac{HS-}, \ac{H2S} and \ac{S2-}. Bla... \ac{alpha}
 \end{document}

You must log in to answer this question.

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