8

For reasons I don't understand, the Springer Nature LaTeX authoring template (available via Overleaf and on Springer Nature's site) causes extra space to be inserted after semicolons in math mode.

For example, the following MWE yields:

\documentclass[sn-mathphys,pdflatex]{sn-jnl}

\begin{document}
\begin{equation}
    (x,y)\quad (x;y)
\end{equation}
\end{document}

Springer Nature template semicolon spacing

Whereas replacing the first line with \documentclass{article} yields the expected spacing:

Normal spacing

Is it possible to override this behavior in my document without altering the sn-jnl.cls file directly? In particular, is it possible to do this in a more elegant way than e.g. replacing every instance of ; in my document with {;} or /!/!; ?

Edit: As @egreg points out in his answer, the spacing after the semicolon can be avoided by disabling the loading of the program package. However, this approach somehow causes errors (that are not present when the program package is allowed to load) when using the proof environment: Proof Errors

Second Edit: From the comment of @egreg below, a satisfactory solution is given by placing the following before \begin{document}:

\makeatletter
\disable@package@load{program}{} %prevent program package from loading
\makeatother

\documentclass[sn-mathphys,pdflatex]{sn-jnl} 

\AtBeginDocument{\renewcommand\qedsymbol{\ensuremath{\opensquare}}} %fix class bug with proof environment 

1 Answer 1

9

The sn-jnl class loads, for no apparent reason, the package program that does silly settings and is the cause of a lot of problems with the class.

In particular, the package defines the semicolon as math active to produce, in math mode, the standard semicolon as punctuation followed by a thick space.

You can disable loading the package program.

\makeatletter
\disable@package@load{program}{}
\makeatother

\documentclass[sn-mathphys,pdflatex]{sn-jnl}

\begin{document}

\begin{equation}
    (x,y)\quad (x;y)
\end{equation}

\end{document}

Complain with Springer that they should, at least, provide an option for not loading program.

enter image description here

2
  • This approach nicely addresses the spacing issue for semicolons in math-mode. Unfortunately, it also causes errors when using the proof environment (see the edit to my question)
    – user143410
    Commented Nov 5, 2022 at 20:04
  • 1
    @user143410 That's a bug in the class. Add to your preamble \AtBeginDocument{\renewcommand\qedsymbol{\ensuremath{\opensquare}}}
    – egreg
    Commented Nov 5, 2022 at 21:31

You must log in to answer this question.

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