1

This questions is related with another one - Spooky behaviour of siunitx in a table -, and it pertains to the need of rotating a table due to the data not fitting the paper width.

I've came across some interesting answers:

and I tried to implement some ideas on the code suggested in my previous thread (thanks egreg, marmot and TeXnician!)

Unfortunately, my code isn't working, and the only error displayed is:

Not in outer par mode. \caption

The code is displayed below! Any feedback would be warmly welcome!

    \documentclass[a4paper,12pt,numbered,print,index]{book}

    % ****************************************************
    % ****************  Packages in use  *****************
    % ****************************************************

    \usepackage[utf8]{inputenc}
    \usepackage{siunitx} % use this package module for SI units
    \usepackage{multicol}
    \usepackage{enumitem}
    \usepackage{pdflscape}
    \usepackage{lipsum}

    % **** Some useful shortcuts/macros ***

    \newcommand{\tn}[1]{\textsuperscript{#1}}
    \newcommand{\TN}[1]{\makebox[0pt][l]{\tn{#1}}}

    %**** Let the fun begin! ****

    \begin{document}
    \begin{multicols}{2}

    \lipsum

    \afterpage{%
    \clearpage% Flush earlier floats (otherwise order might not be correct)
    \thispagestyle{empty}% empty page style (?)

    \begin{table*}% table* allows a table to spawn the entire width of the page.

    \caption{Spectroscopic Parameters and Relative Energies Calculated at the 
        MP2/6-311++G(d,p) Level of Theory for the Lowest-Energy Conformers of Synephrine}
    \label{C3-table:2} % should go after \caption
    \centering
    \setlength{\tabcolsep}{0pt}
    \sisetup{table-align-text-post=false}

    \begin{tabular*}{\textwidth}{ @{\extracolsep{\fill}} l *{6}{S[table-format=4.5(2)]} @{} }
        \toprule
        & {Rotamer $I$} & {Rotamer $II$} & {Rotamer $III$} & {Rotamer $IV$} & {Rotamer $V$} & {Rotamer $VI$} \\
        \midrule
        $A$\tn{a}       & 2619.31951(91)\TN{b}& 2621.43704(81) & 2431.79192(93) & 2429.8036(26)  &1751.6139(17)  &1749.29934(76)\\
        $B$             &  417.815936(90)     &  416.712685(80)&  401.522388(86)&  399.97472(24) & 491.43186(17) & 491.01374(10)\\
        $C$             &  386.003079(87)     &  387.043532(75)&  383.211109(81)&  385.16449(25) & 464.06642(12) & 465.271378(96)\\
        $\chi_{aa}$     & 2.524(18)           & 2.587(16)      & 2.537(19)      & 2.580(72)      & 1.573(47)     & 1.596(12)\\
        $\chi_{bb}$     &-3.054(13)           &-2.778(12)      &-4.767(15)      &-4.764(62)      &-1.187(31)     &-0.9142(93)\\
        $\chi_{cc}$     & 0.530(13)           & 0.250(12)      & 2.231(14)      & 2.184(62)      &-0.387(31)     &-0.6818(93)\\
        $\mu_{a}$\tn{c} & {Y}                 &{Y}             &{Y}             &{Y}             &{N}            &{N}\\
        $\mu_{b}$\tn{c} & {Y}                 &{Y}             &{Y}             &{Y}             &{N}            &{N}\\
        $\mu_{c}$\tn{c} & {Y}                 &{Y}             &{Y}             &{N}             &{N}            &{Y}\\
        $N$\tn{e}       & \num{31}            &\num{32}        &\num{18}        &\num{20}        &\num{14}       &\num{20}\\
        $\sigma$\tn{e}  & \num{2.1}           &\num{1.8}       &\num{2.3}       &\num{3.1}       &\num{1.7}      &\num{2.1}\\
        \bottomrule
    \end{tabular*}

    \raggedright\footnotesize

    \begin{enumerate}[label=\tn{\alph*},leftmargin=*]
        \item $A$, $B$, and $C$ are the rotational constants (in \si{MHz});
        $\chi_{aa}$, $\chi_{bb}$, and $\chi_{cc}$ are elements of the $^{14}$N 
        nuclear quadrupole coupling tensor (in \si{MHz}).

        \item Standard errors indicated in parentheses in units of the last digit. 

        \item Y (yes) and N (no) indicate whether $a$-, $b$-, and $c$-type transitions
        were observed for each structure.

        \item Number of fitted transitions.

        \item Root mean square of the fit (in \si{kHz}).
    \end{enumerate}
\end{table*}
\end{landscape}
\clearpage% Flush page
}

\end{multicols} % ends the multicol environment

\end{document}
7
  • 2
    your mwe is not complete and erroneous (name of documentclass, missing used new commands, etc) . please correct this!
    – Zarko
    Commented Jan 16, 2018 at 18:34
  • ... and there is also no \end{document}....
    – user121799
    Commented Jan 16, 2018 at 18:57
  • Oooops! I think I managed to correct it all!
    – Strelok
    Commented Jan 16, 2018 at 19:08
  • I don't think so. Two obvious things: there is no documentclass books (but book exists) and \begin{multicols} does not end the multicol environment. And I'm not sure if anyone has ./Classes/PhDThesisPSnPDF.
    – user121799
    Commented Jan 16, 2018 at 19:11
  • Ok, corrected it!
    – Strelok
    Commented Jan 16, 2018 at 19:17

3 Answers 3

2

try the following:

\documentclass[a4paper,12pt,numbered,print,index]{book}
% ****************************************************
% ****************  Packages in use  *****************
% ****************************************************
%    \usepackage[utf8]{inputenc}
\usepackage{chemformula}
\usepackage{siunitx} % use this package module for SI units
\usepackage[flushleft]{threeparttable}
\renewcommand{\tnote}[1]{\textsuperscript{\textbf{#1}}}% if you wish in boldface
\usepackage{booktabs} % For professional looking tables
\usepackage{multirow}
\usepackage{multicol}
\usepackage{enumitem}
\usepackage{afterpage}
\usepackage{rotating}% added
\usepackage{lipsum}
% ******************* End ***************************

\begin{document}
\begin{multicols}{2}
\lipsum[1-3]
\begin{sidewaystable*}[p]
\begin{threeparttable}
\caption{Spectroscopic Parameters and Relative Energies Calculated at the
    MP2/6-311++G(d,p) Level of Theory for the Lowest-Energy Conformers of Synephrine}
\label{C3-table:2} % should go after \caption
\setlength{\tabcolsep}{0pt}
\sisetup{table-align-text-post=false}
\begin{tabular*}{\textwidth}{ @{\extracolsep{\fill}} l *{6}{S[table-format=-4.5(2)]} @{} }
    \toprule
    & {Rotamer $I$} & {Rotamer $II$} & {Rotamer $III$} & {Rotamer $IV$} & {Rotamer $V$} & {Rotamer $VI$} \\
    \midrule
    $A$\tnote{a}       & 2619.31951(91)\tnote{b}& 2621.43704(81) & 2431.79192(93) & 2429.8036(26)  &1751.6139(17)  &1749.29934(76)\\
    $B$             &  417.815936(90)     &  416.712685(80)&  401.522388(86)&  399.97472(24) & 491.43186(17) & 491.01374(10)\\
    $C$             &  386.003079(87)     &  387.043532(75)&  383.211109(81)&  385.16449(25) & 464.06642(12) & 465.271378(96)\\
    $\chi_{aa}$     & 2.524(18)           & 2.587(16)      & 2.537(19)      & 2.580(72)      & 1.573(47)     & 1.596(12)\\
    $\chi_{bb}$     & 3.054(13)           & -2.778(12)      &−4.767(15)      &−4.764(62)      &−1.187(31)     &−0.9142(93)\\
    $\chi_{cc}$     & 0.530(13)           & 0.250(12)      & 2.231(14)      & 2.184(62)      &−0.387(31)     &−0.6818(93)\\
    $\mu_{a}$\tnote{c} & {Y}                 &{Y}             &{Y}             &{Y}             &{N}            &{N}\\
    $\mu_{b}$\tnote{c} & {Y}                 &{Y}             &{Y}             &{Y}             &{N}            &{N}\\
    $\mu_{c}$\tnote{c} & {Y}                 &{Y}             &{Y}             &{N}             &{N}            &{Y}\\
    $N$\tnote{e}       & \num{31}            &\num{32}        &\num{18}        &\num{20}        &\num{14}       &\num{20}\\
    $\sigma$\tnote{e}  & \num{2.1}           &\num{1.8}       &\num{2.3}       &\num{3.1}       &\num{1.7}      &\num{2.1}\\
    \bottomrule
\end{tabular*}
\begin{tablenotes}\footnotesize\smallskip\raggedright
\item[a] $A$, $B$, and $C$ are the rotational constants (in \si{MHz});
    $\chi_{aa}$, $\chi_{bb}$, and $\chi_{cc}$ are elements of the $^{14}$N
    nuclear quadrupole coupling tensor (in \si{MHz}).
\item[b] Standard errors indicated in parentheses in units of the last digit.
\item[c] Y (yes) and N (no) indicate whether $a$-, $b$-, and $c$-type transitions
    were observed for each structure.
\item[d] Number of fitted transitions.
\item[e] Root mean square of the fit (in \si{kHz}).
\end{tablenotes}
\end{threeparttable}
\end{sidewaystable*}
\lipsum[6-11]
\end{multicols}
\end{document}
2

Here is a code that runs through and produces something that looks sort of OK.

    \documentclass[a4paper,12pt,numbered,print,index]{book}

    % ****************************************************
    % ****************  Packages in use  *****************
    % ****************************************************

    \usepackage[utf8]{inputenc}
    \usepackage{siunitx} % use this package module for SI units
    \usepackage{multicol}
    \usepackage{enumitem}
    \usepackage{pdflscape}
    \usepackage{afterpage} %<- added
    \usepackage{booktabs} %<- added
    \usepackage{rotating} %<- added
    \usepackage{lipsum}

    % **** Some useful shortcuts/macros ***

    \newcommand{\tn}[1]{\textsuperscript{#1}}
    \newcommand{\TN}[1]{\makebox[0pt][l]{\tn{#1}}}

    %**** Let the fun begin! ****

    \begin{document}
    \begin{multicols}{2}

    \lipsum

    \afterpage{%
    \clearpage% Flush earlier floats (otherwise order might not be correct)
    \thispagestyle{empty}% empty page style (?)
    \begin{sidewaystable} %<- added


    \caption{Spectroscopic Parameters and Relative Energies Calculated at the 
        MP2/6-311++G(d,p) Level of Theory for the Lowest-Energy Conformers of Synephrine}
    \label{C3-table:2} % should go after \caption
    \centering
    \setlength{\tabcolsep}{0pt}
    \sisetup{table-align-text-post=false}

    \begin{tabular*}{\textwidth}{ @{\extracolsep{\fill}} l *{6}{S[table-format=4.5(2)]} @{} }
        \toprule
        & {Rotamer $I$} & {Rotamer $II$} & {Rotamer $III$} & {Rotamer $IV$} & {Rotamer $V$} & {Rotamer $VI$} \\
        \midrule
        $A$\tn{a}       & 2619.31951(91)\TN{b}& 2621.43704(81) & 2431.79192(93) & 2429.8036(26)  &1751.6139(17)  &1749.29934(76)\\
        $B$             &  417.815936(90)     &  416.712685(80)&  401.522388(86)&  399.97472(24) & 491.43186(17) & 491.01374(10)\\
        $C$             &  386.003079(87)     &  387.043532(75)&  383.211109(81)&  385.16449(25) & 464.06642(12) & 465.271378(96)\\
        $\chi_{aa}$     & 2.524(18)           & 2.587(16)      & 2.537(19)      & 2.580(72)      & 1.573(47)     & 1.596(12)\\
        $\chi_{bb}$     &-3.054(13)           &-2.778(12)      &-4.767(15)      &-4.764(62)      &-1.187(31)     &-0.9142(93)\\
        $\chi_{cc}$     & 0.530(13)           & 0.250(12)      & 2.231(14)      & 2.184(62)      &-0.387(31)     &-0.6818(93)\\
        $\mu_{a}$\tn{c} & {Y}                 &{Y}             &{Y}             &{Y}             &{N}            &{N}\\
        $\mu_{b}$\tn{c} & {Y}                 &{Y}             &{Y}             &{Y}             &{N}            &{N}\\
        $\mu_{c}$\tn{c} & {Y}                 &{Y}             &{Y}             &{N}             &{N}            &{Y}\\
        $N$\tn{e}       & \num{31}            &\num{32}        &\num{18}        &\num{20}        &\num{14}       &\num{20}\\
        $\sigma$\tn{e}  & \num{2.1}           &\num{1.8}       &\num{2.3}       &\num{3.1}       &\num{1.7}      &\num{2.1}\\
        \bottomrule
    \end{tabular*}

    \raggedright\footnotesize

    \begin{enumerate}[label=\tn{\alph*},leftmargin=*]
        \item $A$, $B$, and $C$ are the rotational constants (in \si{MHz});
        $\chi_{aa}$, $\chi_{bb}$, and $\chi_{cc}$ are elements of the $^{14}$N 
        nuclear quadrupole coupling tensor (in \si{MHz}).

        \item Standard errors indicated in parentheses in units of the last digit. 

        \item Y (yes) and N (no) indicate whether $a$-, $b$-, and $c$-type transitions
        were observed for each structure.

        \item Number of fitted transitions.

        \item Root mean square of the fit (in \si{kHz}).
    \end{enumerate}
\end{sidewaystable}
\clearpage% Flush page
}

\end{multicols} % ends the multicol environment

\end{document}
2

I had to fix a few problems:

  • the minus signs (-) were written with some different Unicode character () that does not compile
  • had to add the afterpage and booktabs package.
  • missing begin{landscape}
  • had to use \linewidth instead of \textwidth for the width of the tabular* (it looks like \textwidth is still the width of portrait-mode text, even after switching to landscape mode. \linewidth does update correctly.
  • and remove the \centering command before the tabular environment.

lstable

\documentclass[a4paper,12pt,numbered,print,index]{book}

% ****************************************************
% ****************  Packages in use  *****************
% ****************************************************

\usepackage[utf8]{inputenc}
\usepackage{siunitx} % use this package module for SI units
\usepackage{multicol}
\usepackage{enumitem}
\usepackage{pdflscape}
\usepackage{lipsum}
\usepackage{booktabs}
\usepackage{afterpage}

% **** Some useful shortcuts/macros ***

\newcommand{\tn}[1]{\textsuperscript{#1}}
\newcommand{\TN}[1]{\makebox[0pt][l]{\tn{#1}}}

%**** Let the fun begin! ****

\begin{document}
    \begin{multicols}{2}

        \lipsum

        \afterpage{%
            \clearpage% Flush earlier floats (otherwise order might not be correct)
            \thispagestyle{empty}% empty page style (?)
            \begin{landscape}

            \begin{table*}% table* allows a table to spawn the entire width of the page.

                \caption{Spectroscopic Parameters and Relative Energies Calculated at the 
                    MP2/6-311++G(d,p) Level of Theory for the Lowest-Energy Conformers of Synephrine}
                \label{C3-table:2} % should go after \caption
%               \centering
%               \setlength{\tabcolsep}{0pt}
                \sisetup{table-align-text-post=false}

                \begin{tabular*}{\linewidth}{ @{\extracolsep{\fill}} l *{6}{S[table-format=4.5(2)]}  }
                    \hline
                    & {Rotamer $I$} & {Rotamer $II$} & {Rotamer $III$} & {Rotamer $IV$} & {Rotamer $V$} & {Rotamer $VI$} \\
                    \midrule
                    $A$\tn{a}       & 2619.31951(91)\TN{b}& 2621.43704(81) & 2431.79192(93) & 2429.8036(26)  &1751.6139(17)  &1749.29934(76)\\
                    $B$             &  417.815936(90)     &  416.712685(80)&  401.522388(86)&  399.97472(24) & 491.43186(17) & 491.01374(10)\\
                    $C$             &  386.003079(87)     &  387.043532(75)&  383.211109(81)&  385.16449(25) & 464.06642(12) & 465.271378(96)\\
                    $\chi_{aa}$     & 2.524(18)           & 2.587(16)      & 2.537(19)      & 2.580(72)      & 1.573(47)     & 1.596(12)\\
                    $\chi_{bb}$     &-3.054(13)           &-2.778(12)      &-4.767(15)      &-4.764(62)      &-1.187(31)     &-0.9142(93)\\
                    $\chi_{cc}$     & 0.530(13)           & 0.250(12)      & 2.231(14)      & 2.184(62)      &-0.387(31)     &-0.6818(93)\\
                    $\mu_{a}$\tn{c} & {Y}                 &{Y}             &{Y}             &{Y}             &{N}            &{N}\\
                    $\mu_{b}$\tn{c} & {Y}                 &{Y}             &{Y}             &{Y}             &{N}            &{N}\\
                    $\mu_{c}$\tn{c} & {Y}                 &{Y}             &{Y}             &{N}             &{N}            &{Y}\\
                    $N$\tn{e}       & \num{31}            &\num{32}        &\num{18}        &\num{20}        &\num{14}       &\num{20}\\
                    $\sigma$\tn{e}  & \num{2.1}           &\num{1.8}       &\num{2.3}       &\num{3.1}       &\num{1.7}      &\num{2.1}\\
                    \bottomrule
                \end{tabular*}

                \raggedright\footnotesize

                \begin{enumerate}[label=\tn{\alph*},leftmargin=*]
                    \item $A$, $B$, and $C$ are the rotational constants (in \si{MHz});
                    $\chi_{aa}$, $\chi_{bb}$, and $\chi_{cc}$ are elements of the $^{14}$N 
                    nuclear quadrupole coupling tensor (in \si{MHz}).

                    \item Standard errors indicated in parentheses in units of the last digit. 

                    \item Y (yes) and N (no) indicate whether $a$-, $b$-, and $c$-type transitions
                    were observed for each structure.

                    \item Number of fitted transitions.

                    \item Root mean square of the fit (in \si{kHz}).
                \end{enumerate}
            \end{table*}
        \end{landscape}
        \clearpage% Flush page
    }

\end{multicols} % ends the multicol environment

\end{document}

You must log in to answer this question.

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