2

Whenever I insert the command \usepackage{siunitx} in my IEEEaccess template document, I get the error \begin{document} missing.

How can I define units in my article if siunitx is not recognized?

My MWE (copied from comment):

\documentclass{ieeeaccess} 
\usepackage{graphicx}
\usepackage{cite} 
\usepackage{amsmath,amssymb,amsfonts} 
\usepackage{algorithmic} 
\usepackage{textcomp} 
\usepackage{siunitx}

\usepackage{lipsum} \begin{document} \lipsum[1-2] \EOD \end{document}

And this is my log file:

Missing number, treated as zero.

<to be read again> \gdef l.7598 ...onst:Nn \c_sys_year_int { \tex_year:D }

A number should have been here; I inserted 0'. (If you can't figure out why I needed to see a number, look upweird error' in the index to The TeXbook.)

Missing = inserted for \ifnum.

<to be read again> \gdef l.7598 ...onst:Nn \c_sys_year_int { \tex_year:D }

I was expecting to see &lt;',=', or &gt;'. Didn't. You can't use\numexpr' in vertical mode.

\int_compare:nNnTF ...nt_eval:w #1#2__int_eval:w #3__int_eval_end: \exp_af... l.7598 ...onst:Nn \c_sys_year_int { \tex_year:D }

Sorry, but I'm not programmed to handle this case; I'll just pretend that you didn't ask for it. If you're in the wrong mode, you might be able to return to the right one by typing I}' orI$' or `I\par'.

LaTeX Error: Missing \begin{document}.

No \begin{document} command was found. Make sure you have included \begin{document} in your preamble, and that your main document is set correctly.

Was this hint helpful?Yes / No See the LaTeX manual or LaTeX Companion for explanation. Type H <return> for immediate help. ...

l.7598 ...onst:Nn \c_sys_year_int { \tex_year:D }

You're in trouble here. Try typing <return> to proceed. If that doesn't work, type X <return> to quit.

Joseph Wright
  • 259,911
  • 34
  • 706
  • 1,036
  • Welcome to TeX.SX! Did you really use \includepackage{siunitx} or \usepackage{siunitx}? The latter would be correct. – leandriis Nov 04 '20 at 08:07
  • Thank you! I just checked, I actually used \usepackage.... – Wallflower Nov 04 '20 at 08:13
  • I will edit the answer, so sorry for the mistake – Wallflower Nov 04 '20 at 08:13
  • 1
    Please provide some small document example (MWE), which reproduce your problem. For example, the following work as expected: `\documentclass{ieeeaccess} \usepackage{graphicx} % <--- had to be loaded \usepackage{siunitx} \usepackage{lipsum}

    \begin{document}

    \section{Introduction} \lipsum[1] \SI{1}{\kilo\metre} \EOD \end{document}`

    – Zarko Nov 04 '20 at 08:19
  • @Zarko This is a small example to try in the ieeeaccess template '\documentclass{ieeeaccess} \usepackage{cite} \usepackage{amsmath,amssymb,amsfonts} \usepackage{algorithmic} \usepackage{graphicx} \usepackage{textcomp} \usepackage{siunitx}

    \begin{document}

    \EOD

    \end{document}'

    – Wallflower Nov 04 '20 at 08:28
  • @Wallflower Please edit the original post. – ivankokan Nov 04 '20 at 08:30
  • @ivankokan what should I change? – Wallflower Nov 04 '20 at 08:36
  • 1
    Please, insert in your question a small document, which reproduce your problem. I have some very large examples used ieeeaccess and they works as expected. BTW, your code from comment works without any warnings or errors! – Zarko Nov 04 '20 at 08:42
  • @Zarko, I do not know how to do it... any help please. I am really new to this – Wallflower Nov 04 '20 at 08:52
  • 1
    Show the complete log-file of the small example above. – Ulrike Fischer Nov 04 '20 at 09:14
  • @ Ulrike Fischer Still searching how to do it, give me a moment please – Wallflower Nov 04 '20 at 09:25

1 Answers1

4

The issue is caused as ieeeaccess changes the meaning of \year. In newer releases of expl3, that is covered internally. For older set ups, you can use

\let\oldyear\year
\def\year{%
  \ifdefined\pdfprimitive
    \expandafter\pdfprimitive
  \else
    \expandafter\primitive
  \fi
  \year}
\usepackage{expl3}
\let\year\oldyear
Joseph Wright
  • 259,911
  • 34
  • 706
  • 1,036