1

could somebody point out what to change in rmstyle.cls file to get siunitx working?

Here is the MWE:

\documentclass{rmstyle}[12pt]
% \documentclass{article}[12pt]
\usepackage{siunitx}

\setcounter{page}{1}
\volume{XX}
\issue{Y}
\year{20ZZ}
\doilabel{12345}
\title{
MWE siunitx problem
}

\author{First Author\footnote{Corresponding author. \texttt{first.author@xx.yy}}, Second Author and Third Author
}


\begin{document}
\SI{3}{mm}
\end{document}
  • Can you tell us what is going wrong for you? For me, everything seems to be fine. – Joseph Wright Mar 26 at 8:36
  • Thanks for testing. I am using Overleaf, where it doesn't work: overleaf.com/1462967519gxqkdvypmnwm – Tero Frondelius Mar 26 at 8:41
  • 1
    The class redefines the TeX primitive \year, which siunitx (or rather expl3) needs, but the class also needs its definition of \year, so we need to juggle with \year a bit. Add \newcommand*{\texyear}{}\newcommand*{\classyear}{}\let\texyear\year before you load the class. Directly after you load the class call \let\classyear\year\let\year\texyear before you load siunitx. After you have loaded siunitx call \let\year\classyear. – moewe Mar 26 at 9:22
  • 1
    Aha! Much easier: Just load \RequirePackage{expl3} before the documentclass. No need to juggle with \year at all. See tex.stackexchange.com/q/418954/35864 – moewe Mar 26 at 9:27
  • Thanks a lot. Do you want to make it as an answer? I am new to this forum. – Tero Frondelius Mar 26 at 10:44
5

Just like ieeeaccess the class rmstyle redefines the primitive \year. The original definition of \year is needed by expl3 (which is loaded by siunitx) to work properly.

You can circumvent the issue by loading expl3 even before the document class as suggested by Ulrike Fischer in her answer to How to compile IEEE Access templates with XeLaTeX with fontspec?

\RequirePackage{expl3}
\documentclass[12pt]{rmstyle}

note that documentlcass options like 12pt should be given in square brackets before the class name not afterwards.

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.