化学缩写无法正确整合到标题/目录中

化学缩写无法正确整合到标题/目录中

我在命名法中使用 \usepackage{acronym}。但是,由于我必须在报告中包含大量化学内容,因此似乎序言设置导致目录中显示完整的首字母缩略词,即使该首字母缩略词在标题中使用之前已在文本中使用。因此,似乎目录与文本分开工作,但事实并非如此。

在此处输入图片描述

\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. 表格/标题

\phantomsection \thispagestyle{empty} \begin{center} \begin{tabular}{c} {\HUGE\textbf{基于自然的解决方案,以消除}} \ {\HUGE\textbf{硫化氢}} \end{tabular}
\end{center} \hrulefill \begin{center} \begin{tabular}{lcl} & 硕士论文 & \
& 建筑环境系 & \ & 奥尔堡大学 & \end{tabular}
\end{center} \textbf{页数} & & XX \ \end{tabular} \begin{center}{\footnotesize\itshape 未经论文作者、导师或外部合作伙伴事先书面批准,不得发布本报告(包括来源参考和附录)。此外,未经书面批准,不得将论文内容用于商业目的。} \end{center}

1.Formalia/acro_list

\chapter{术语} \begin{acronym}[MPC] \acro{H_{2}S}[\ce{H_{2}S}]{硫化氢} \acro{HS^{-}}[\ce{HS^{-}}]{二硫化物} \acro{S^{2-}}[\ce{S^{2-}}]{硫化物离子} \acro{SO_{4}^{-2}}[\ce{SO_{4}^{-2}}]{硫酸盐} \end{acronym}

2.文字/文字

\chapter{迈向可持续的未来} 我们发现下水道会释放温室气体,厌氧过程释放的 \ac{CH_{4}} 引起了一些关注,但是,当通过添加 \ac{NO_{3}^{-}} 来管理 \ac{H_{2}S} 时,似乎也可能释放 \ac{N_{2}O}。因此,需要采取整体方法,不要将处理厂视为孤立的,而是将其与处理厂整合在一起。在解决为什么 \ac{N_{2}O} 排放量在处理厂内会发生变化时,这一点也适用,因为来自网络的负荷会随时间变化,例如 \ac{CH_{4}}、\ac{COD} 和流量。 \chapter{\ac{下水道系统中的 H_{2}S} \ac{H_{2}S} 是一种普遍存在的恶臭化合物,会导致混凝土和金属腐蚀(图 \ref{fig:INTROCorrosion})\citep{Svovlbrintehandbogen、Shypanski2018、JesAsbjornBog、Kiilerich-Kinetics、Zdeb2008、Kiilerich-Precipitation}。2016 年的一项调查显示,41 家参与的丹麦水务公司中有 39 家遇到过 \ac{H_{2}S} 相关问题 \citep{DANVAGRUNDFOS}。\ac{H_{2}S} 的存在会对周围环境造成严重滋扰,并引起公众不满。 \cite{DANVAGRUNDFOS} 估计,公用事业公司平均每月花费 6 个小时处理气味投诉,其中超过一半的公用事业公司将其作为服务目标 \citep{DANVAGRUNDFOS}。虽然 \ac{H_{2}S} 的产生可能发生在废水输送网络的任何部分,但压力管道的使用以及随后可能出现的厌氧条件被认为是主要来源 \citep{Shypanski2018, JesAsbjornBog}。在厌氧条件下,存在于废水中的 \ac{SO_{4}^{-2}} 被存在于下水道结构和沉积物上的生物膜中的 \ac{SR} 微生物还原为 \ac{S^{2-}},并产生 \ac{H_{2}S}。当压力管道末端的废水减压时,系统中累积的 \ac{H_{2}S} 会部分释放到周围环境中(图 \ref{fig:H2S-Skitse})\citep{Despot2021, JesAsbjornBog, Kiilerich-Kinetics}。 \section{厌氧生物膜中的 \ac{S^{2-}} 生成} 在下水道中,生物膜是一种细胞外基质,由其中的微生物排泄的聚合物质组成,粘附在下水道壁的浸没内表面和底部沉积物上 \citep{OxyChem, Shiba, JesAsbjornBog, Despot2021, Victoria2021}。生物膜也可在潮湿的表面区域发现,例如暴露于水相的区域,这是由于毛细力或下水道空气中高湿度的凝结而形成的 \citep{JesAsbjornBog}。凝胶状生物膜可根据电子受体的存在和浓度划分为不同的区域 \citep{JesAsbjornBog, ZHANG20081, Svovlbrintehandbogen}。

希望你能帮助我解决这个问题:-)


当在整个标题中使用 \ac*{} 而不是 \ac{} 时,会发生以下情况: 在此处输入图片描述


在序言中添加下列修改时:

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

\Ac{} 和 \ac{} 字符串在首次使用首字母缩略词时,不会产生带有括号中首字母缩略词的扩展首字母缩略词,如图所示。

在此处输入图片描述

我不知道这是否是因为我在实际文本之前有一个表格列表和一个图表列表,这使得标题成为第一个缩写词出现,或者章节标题是否起到了首次出现的作用。

起草包含有关文档设置必要信息的文档。

答案1

好吧,一开始mhchem使用acronym您的示例时,我遇到了一些难以理解的错误。但后来手册mhchem给出了解决这个问题的线索。因此,这是最终的 MWE,它为您的问题提供了解决方案:

\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}

该 MWE 给出以下toc结果: 缩写词

根据您是否想要章节/部分中化合物的全名,您可以使用 \acl{}(或在句子开头使用 \Acl{})或 \acs{} 来获取该化合物的公式。

笔记您可能需要调整输入首字母缩略词的方式。math首字母缩略词名称中的使用相关符号会引发有关缺失$等错误。acronym手册在第 4 页展示了正确的用法(以及原因)。使用我建议的缩写词替换您的首字母缩略词可以在任何编辑器中使用该Search and Replace功能轻松完成。

编辑OP 在 Overleaf 中提供了一个示例供使用。将 改为\ac{abbr}\acl{abbr}后,\acs{abbr}结果toc显示正确:

toc_overleaf

文中使用时\acf{abbr}可能需要在括号中插入全名和缩写。

答案2

这是@alchemist 在 Overleaf 文档草稿中提供的完整修复。

\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}

相关内容