1

I keep getting line breaks in the middle of the chemical formula NH415NO3. If NH415NO3 comes at the end of a line, sometimes NH4 and 15NO3 are split onto different lines, and the 15 is place before the 4.

Here's my full premble and some text:

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

\end{document}

0

With an up to date version of chemformula (currently 2016/08/21 v4.15c) the problem doesn't show:

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

enter image description here

It has been a problem in earlier versions of chemformula, though.

[…] NH4 and 15NO3 are split onto different lines, and the 15 is place before the 4.

This makes me wonder if you have wrong input, e.g. a space before the 4:

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

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

\end{document}

enter image description here


BTW: your example doesn't show the problem either:

enter image description here

  • NB I'm using overleaf. They're currently using an older chemformula. They helpfully explained to me how to update it. – Eric Ireland Oct 5 '16 at 22:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.