1

i'm constantly getting "! Package datatool Error: Can't break out of anything. " when using data tool and siunitx, if i change the S column definers to normal centered columns (thus not using siunitx) the document compiles correctly.

\documentclass{article}

\usepackage{siunitx} % Provides the \SI{}{} and \si{} command for typesetting SI units
\usepackage{booktabs}
\usepackage{datatool}

\sisetup{round-mode=places,
         table-number-alignment = center-decimal-marker
        }


\begin{document}

\DTLloaddb{xrfWeight}{masse_xrf.csv}

\begin{table}[h]
    \begin{center}
        \begin{tabular}{r|S[table-format = 1.4]S[table-format = 1.4]S[table-format = 1.4]S[table-format = 1.4]S[table-format = 1.4]}
            \textbf{Mesure} & \textbf{Piece 1} & \textbf{Piece 2} & \textbf{Piece 3} & \textbf{Piece 4} & \textbf{Piece 5}%

            \DTLforeach*{xrfWeight}{\mesure=mesure, \prempiece=prempiece, \deuxpiece=deuxpiece, \troipiece=troipiece, \quatpiece=quatpiece, \cinqpiece=cinqpiece}{%
                \DTLiffirstrow{\\\cmidrule{1-6}}{\\}%
                \mesure & \prempiece & \deuxpiece & \troipiece & \quatpiece & \cinqpiece
            }

        \end{tabular}
        \caption{Poids [g]}
    \end{center}
\end{table}

\end{document}

I tried to simplify the table down to only one column with no header (DTL cycle only, with only the \mesure macro) but with no changes...

\begin{tabular}{S[table-format = 1.4]|}
        \textbf{Mesure}%

        \DTLforeach*{xrfWeight}{\mesure=mesure, \prempiece=prempiece, \deuxpiece=deuxpiece, \troipiece=troipiece, \quatpiece=quatpiece, \cinqpiece=cinqpiece}{%
            \\%
            \mesure
        }

    \end{tabular}

Do you have any clue of what i'm doing wrong?

EDIT -- Added CSV data:

mesure,prempiece,deuxpiece,troipiece,quatpiece,cinqpiece
1,2.9955,3.0057,3.0106,2.9693,2.9979
2,2.9951,3.0058,3.0109,2.9699,2.9978
3,2.995,3.0061,3.0108,2.9695,2.9976
4,2.995,3.0061,3.0108,2.9696,2.9977
5,2.9953,3.0057,3.0108,2.9697,2.9978
  • we of course also need the data for the csv file – daleif Oct 9 '15 at 12:49
  • ahaha sorry, added – Frankie94 Oct 9 '15 at 12:54
3

Found out the problem, i needed to put

@{}l  (or whatever column definer)

after the S columns, as well as

&

after the last row element

Working:

\begin{table}[h]
    \begin{center}
        \begin{tabular}{r|S[table-format = 1.4]S[table-format = 1.4]S[table-format = 1.4]S[table-format = 1.4]S[table-format = 1.4]@{}l}
            \textbf{Mesure} & \textbf{Piece 1} & \textbf{Piece 2} & \textbf{Piece 3} & \textbf{Piece 4} & \textbf{Piece 5}%

            \DTLforeach*{xrfWeight}{\mesure=mesure, \prempiece=prempiece, \deuxpiece=deuxpiece, \troipiece=troipiece, \quatpiece=quatpiece, \cinqpiece=cinqpiece}{%
                \DTLiffirstrow{\\\cmidrule{1-6}}{\\}%
                \mesure & \prempiece & \deuxpiece & \troipiece & \quatpiece & \cinqpiece &
            }

        \end{tabular}
        \caption{Poids [g]}
    \end{center}
\end{table}

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.