Once I use the siunitx package, this error message prompts:

! File ended while scanning use of \__siunitx_table_rewrite_create_aux:w.
  <inserted text>
  <*> paper.tex
  I suspect you have forgotten a `}', causing me
  to read past where you wanted me to stop.
  I'll try to recover; but if the error is serious,
  you'd better type `E' or `X' now and fix your file.
  ! Emergency stop.
  <*> paper.tex
  *** (job aborted, no legal \end found)
  Here is how much of TeX's memory you used:
  21553 strings out of 494045
  422667 string characters out of 3148364
  448797 words of memory out of 3000000
  24480 multiletter control sequences out of 15000+200000
  91950 words of font info for 94 fonts, out of 3000000 for 9000
  715 hyphenation exceptions out of 8191
  56i,1n,55p,726b,104s stack positions out of 5000i,500n,10000p,200000b,50000s
  ! ==> Fatal error occurred, no output PDF file produced!

Here is my MWE.


\usepackage{natbib} % for the bibliography
\usepackage[cmex10]{amsmath} % http://www.ctan.org/tex-archive/macros/latex/required/amslatex/math/
\usepackage{array} % http://www.ctan.org/tex-archive/macros/latex/required/tools/
\usepackage{mdwtab} % http://www.ctan.org/tex-archive/macros/latex/contrib/mdwtools/
\usepackage{eqparbox} % http://www.ctan.org/tex-archive/macros/latex/contrib/eqparbox/
\usepackage[caption=false]{subfig} % http://www.ctan.org/tex-archive/obsolete/macros/latex/contrib/subfigure/
\usepackage{fixltx2e} % http://www.ctan.org/tex-archive/macros/latex/base/
\usepackage{stfloats} % http://www.ctan.org/tex-archive/macros/latex/contrib/sttools/
\usepackage{url} % http://www.ctan.org/tex-archive/macros/latex/contrib/misc/
% for TikZ drawing
\usetikzlibrary{backgrounds, calc, positioning, fit}
% for figure inclusion
% for pseudocode
\usepackage{algorithm} % http://ctan.org/pkg/algorithms
\usepackage{algpseudocode} % http://ctan.org/pkg/algorithmicx
\algnewcommand\algorithmicinput{\textbf{INPUT: }}
\algnewcommand\algorithmicoutput{\textbf{OUTPUT: }}



    Name3\IEEEauthorrefmark{3} and
\IEEEauthorblockA{\IEEEauthorrefmark{1}institute1\\ Email1}
\IEEEauthorblockA{\IEEEauthorrefmark{2}institute2\\ Email2}

holding assumption
HD algorithm
\footnote{National Geophysical Data Center http://www.ngdc.noaa.gov/geomag-web}

  • 6
    If the MWE works, the please post something that does not. Otherwise we cannot help – daleif Nov 19 '13 at 11:27
  • 6
    @perfectionm1ng There must be some key difference between the demo and the real file: work through removing part of your real file at a time until you locate what it is. – Joseph Wright Nov 19 '13 at 11:29
  • 4
    That is actually not how to use siunitx. You should instead \SI{42.122}{\micro\tesla}. This adds a little space between the number among other improvements. – frankundfrei Nov 19 '13 at 12:24
  • 2
    @perfectionm1ng There is a lot you can remove and still get the same error. This is minimal: \documentclass{article} \usepackage{array} \usepackage{mdwtab} \usepackage{siunitx} \begin{document} \SI{42.122}{\micro\tesla} \end{document} – Torbjørn T. Nov 19 '13 at 16:12
  • 1
    @SvendTveskæg Yes and no. After removing array you still get an error, but it is a different error than the one mentioned in the question. That's why I left it in. – Torbjørn T. Nov 19 '13 at 18:43

The issue here is the mdwtab package, which completely alters the tabular code from array. Within siunitx, the code attempts to be cross-compatible by not making too many assumptions, but array is very widely used and so is treated as a baseline.

To fix the issue, there are a couple of changes needed. First, you have to account for this altered table mechanism. Secondly, you need to also allow for an additional token that gets placed in the tabular cells by mdwtab. A patch looks something like


\cs_set_protected:Npn \__siunitx_table_rewrite_create:N #1
    \newcolumntype {#1} [1] []
        > { \__siunitx_table_collect_begin:Nn #1 {##1} }
        < { \__siunitx_table_print: }

\cs_set_protected:Npn \__siunitx_table_collect_not_braced:N #1
    \token_if_eq_meaning:NNF #1 \tex_ignorespaces:D
        \token_if_eq_meaning:NNF #1 \tex_unskip:D
            \token_if_eq_meaning:NNF #1 \tab@setcr
              { \__siunitx_table_collect_not_braced_aux_i:N #1 }


\begin{tabular}{S[table-format = 2.2]}
  1.23 \\


I'll look to incorporate this into the next siunitx release: there may be a few more wrinkles to iron out, but that should cover the basics.

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.