使用 chemformula 在化学式中换行

使用 chemformula 在化学式中换行

我在化学式 NH 4 15 NO 3的中间不断出现换行符。如果 NH 4 15 NO 3位于行末,有时 NH 415 NO 3会分成不同的行,并且 15 会位于 4 之前。

以下是我的完整序言和一些正文:

\documentclass[british,a4paper,10pt]{article}

\usepackage{xpatch} 
\usepackage[british]{babel}

\usepackage[T1]{fontenc} 
\usepackage[utf8]{inputenc} 

\usepackage[iso,british]{isodate} %ISO formatted dates e.g. 2016-09-30
\usepackage[tracking=true,spacing=true,factor=1150,stretch=25,shrink=25]{microtype}
    \microtypecontext{spacing=nonfrench} 

\AtBeginEnvironment{verbatim}{\microtypesetup{activate=false}} 

\usepackage{graphicx}
\usepackage{siunitx} 
    \sisetup{qualifier-mode = brackets}

\usepackage{mathptmx}

\usepackage{amsmath}
\usepackage{xspace}

\usepackage{chemmacros}

\usepackage[autostyle]{csquotes} 

\usepackage[hyperref=false,
   backend=biber,
    style=apa,
    url=false,
    natbib=true,
    doi=false,
    eprint=false,
    isbn=false
]{biblatex}
\DeclareLanguageMapping{british}{british-apa} 
\AtEveryBibitem{\clearlist{abstract}} 
\addbibresource{Zotero.bib} 
\DeclareSourcemap{          
  \maps[datatype=bibtex]{   % see http://tex.stackexchange.com/questions/150710/ignore-a-bibliography-field-e-g-urldate-for-eliminating-of-biblatex-biber-w
    \map[overwrite=true]{   %
      \step[fieldset=urldate, null]
    }
  }
}


\usepackage[
    draft, % change to final to remove pdfcomments
    author={Eric Ireland},
    open=false,
    color={1.0 1.0 0.0}
]{pdfcomment} % For comments in pdf.




\title{Methods used in \textsuperscript{15}N tracer experiments for measuring DNRA in soils}

\author{Eric Ireland}
%\date{\today}

\begin{document}
\isodate


\newcommand{\fan}{{\ch{^{15}NH4NO3}}\xspace} % \fan = 15NH4NO3 in mbox
\newcommand{\afn}{{\ch{NH4^{15}NO3}}\xspace} % \afn = NH415NO3 in mbox
\newcommand{\an}{{\ch{NH4NO3}}\xspace} % \an = NH4No3 in mbox
\newcommand{\fnto}{{\ch{^{15}N2O}}\xspace} % \fnto = 15N2O in mbox

\maketitle

\begin{abstract}
%abstract goes here
\end{abstract}

For the \ch{^{15}N} field experiment, \SI{100}{\g} oven dried equivalent of fresh, homogenised, sieved soil (\SI{2}{\mm})  was placed in cylindrical vials with sealed bottoms. The bulk density was kept the same as the surround soil at each site. Soils were pre-incubated for \SI{24}{\hour} at the ambient temperature at the site, before \ch{^{15}N} tracer was added. Treatments were \fan or \afn with \ch{^{15}N} at \SI{99.2}{atom\percent} excess. They were added at a rate of \SI{2}{\ug\of{\ch{NO3^{-}-N}}\per\g\of{soil}} or \SI{2}{\ug\of{\ch{NH4^{+}-N}}\per\g\of{soil}} using the 5-needle injection technique, also used by \citet{wang_soil_2016}. Soils were incubated in the field for \SI{139}{\hour}. Soil water varied from \SIrange{50}{55}{\percent} WHC during the incubation. Triplicate samples were collected randomly from each treatment at \SIlist{0.5;40;88;139}{\hour} after \ch{^{15}N} labelling to determine the concentrations and isotopic compositions of \ch{NH4+} and \ch{NO3-}.

For the \ch{^{15}N} laboratory incubations, either \fan or \afn with \ch{^{15}N} at \SI{20}{atom\percent} excess was added. Each treatment had three replicates. \SI{30}{\g} of fresh, sieved soil was incubated in \SI{250}{\ml} conical flasks, and \SI{2}{\ml} of \fan or \afn solution was added to each flask at a rate of \SI{7.14}{\micro\mole\of{\ch{^{15}N}}\per\gram\of{soil}}, i.e. \SI{50}{\ug\of{\ch{NH4^{+}-N}}\per\g\of{soil}} and \SI{50}{\ug\of{\ch{NO3^{-}-N}}\per\g\of{soil}}. Soils were adjusted to \SI{60}{\percent} WHC (does not say whether water was added subsequently to keep them at \SI{60}{\percent} as they dried out). Conical flasks were sealed with rubber stoppers and aired every \SI{48}{\hour} for \SI{1}{\hour}. They were incubated at \SI{25}{\celsius}. Soils were extracted at \SIlist{0.5;24;72;144}{\hour} after \ch{^{15}N} labelling to determine the concentrations and isotopic compositions of \ch{NH4+} and \ch{NO3-}.

\结束{文档}

答案1

使用最新版本chemformula(目前为 2016/08/21 v4.15c)时,问题不再出现:

\documentclass{article}
\usepackage{chemformula}
\begin{document}

xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx
\ch{NH4^{15}NO3}

xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx x
\ch{NH4^{15}NO3}

xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xx
\ch{NH4^{15}NO3}

xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx
\ch{NH4^{15}NO3}

\end{document}

在此处输入图片描述

然而,这在早期版本中一直是一个问题chemformula

[…] NH4 和 15NO3 被分成不同的线,并且 15 位于 4 之前。

4这让我怀疑您是否输入了错误,例如:之前有一个空格

\documentclass{article}
\usepackage{chemformula}
\begin{document}

\ch{NH4^{15}NO3}
\ch{NH 4^{15}NO3}

\end{document}

在此处输入图片描述


顺便说一句:你的例子也没有显示问题:

在此处输入图片描述

相关内容