1

I would like to have some help resolving this issue with this wide table. Its notes that were supposed to go right below it did not go once I put the table in a landscape environment. I do not understand as well why did it lose its formatting (the lines on top and below did not got through the table's full length) and how to make it fit properly.

  \documentclass[
    12pt,               
    openright,          
    oneside,        
    a4paper,            
    english,            
    french,             
    spanish,            
    brazil,             
    ]{abntex2}
    \usepackage[vmargin=3cm, hmargin=2.5cm]{geometry}
    \def\sym#1{\ifmmode^{#1}\else\(^{#1}\)\fi}
\usepackage{booktabs, tabularx, ragged2e}

\usepackage[group-separator={.},
            group-four-digits,
            output-decimal-marker={,}]{siunitx}
    \usepackage{pifont}
\usepackage{changepage}
\usepackage{scrextend}
\usepackage{pdflscape}

    \begin{document}
    \begin{addmargin}{-1cm}

    \begin{landscape}
    \pagestyle{empty}
    \begin{table}[!t]
    \sisetup{input-symbols=(),
             table-space-text-post={\sym{***}},
             output-decimal-marker={,}}



      \caption{Votos - Robustez dos resultados - mudança na definição da variável de tratamento} 
      \label{} 
    \setlength\tabcolsep{2pt}

    \begin{tabularx}{0.7\textwidth}{@{} l*{10}{S[table-format={-1.3}]} @{}}
    \\[-1.8ex]
    \hline 
    \hline 
    \\[-1.8ex] 
    \\[-1.8ex] & \multicolumn{10}{c}{Variável dependente: \% Votos ($\times$100)} \\ 
    \cmidrule{2-11} 

     & \multicolumn{2}{c}{T = 0\%} & \multicolumn{2}{c}{T = 10\%} & \multicolumn{2}{c}{T = 50\%} & \multicolumn{2}{c}{T = 100\%} & \multicolumn{2}{c}{"Contínuo"}   \\ 
     \cmidrule(lr){2-3} \cmidrule(lr){4-5} \cmidrule(l){6-7}  \cmidrule(l){8-9} \cmidrule(l){10-11}

    \\[-1.8ex] & {(1)} & {(2)} & {(3)} & {(4)} & {(5)} & {(6)} & {(7)} & {(8)} & {(9)} & {(10)}\\ 
    \hline \\[-1.8ex] 
     Ano $\times$ T & -0,067 & -0,124\sym{***} & -0,032 & -0,142\sym{***} & -0,038 & -0,191\sym{**} & 0,618\sym{**} & -0,352 &  &  \\ 
      & {(0,046)} & {(0,035)} & {(0,059)} & {(0,043)} & {(0,113)} & {(0,077)} & {(0,305)} & {(0,232)} &  &  \\ 
      & & & & & & & & & & \\ 
     Ano $\times$ T $\times$ Concorrência & 0,002 &  & 0,0005 &  & 0,00004 &  & -0,051\sym{*} &  &  &  \\ 
      & {(0,003)} &  & {(0,004)} &  & {(0,008)} &  & {(0,027)} &  &  &  \\ 
      & & & & & & & & & & \\ 
     Ano $\times$ T $\times$ (\%) T.Mun &  & 2,151\sym{***} &  & 4,006\sym{***} &  & 7,312\sym{***} &  & 18,945\sym{***} &  &  \\ 
      &  & {(0,653)} &  & {(1,081)} &  & {(2,405)} &  & {(6,941)} &  &  \\ 
      & & & & & & & & & & \\ 
      Ano $\times$ (\%) Emp. &  &  &  &  &  &  &  &  & -0,033 & -0,065 \\ 
      &  &  &  &  &  &  &  &  & {(0,130)} & {(0,073)} \\ 
      & & & & & & & & & & \\ 
     Ano $\times$ Concorrência $\times$ (\%) Emp. &  &  &  &  &  &  &  &  & -0,002 &  \\ 
      &  &  &  &  &  &  &  &  & {(0,009)} &  \\ 
      & & & & & & & & & & \\ 
     Ano $\times$  (\%) Emp \slash {} (\%) {} Emp.Mun &  &  &  &  &  &  &  &  &  & -0,000 \\ 
      &  &  &  &  &  &  &  &  &  & {(0,002)} \\ 
      & & & & & & & & & & \\ 
     Constante & -0,384\sym{***} & -0,384\sym{***} & -0,389\sym{***} & -0,389\sym{***} & -0,390\sym{***} & -0,390\sym{***} & -0,392\sym{***} & -0,392\sym{***} & -0,389\sym{***} & -0,389\sym{***} \\ 
      & {(0,011)} & {(0,011)} & {(0,010)} & {(0,010)} & {(0,010)} & {(0,010)} & (0,010) & {(0,010)} & {(0,010)} & {(0,010)} \\ 
      & & & & & & & & & & \\ 


    \hline \\[-1.8ex] 
    Média $Y$ & {3,48} & {3,48} & {3,40} & {3,40} & {3,55} & {3,55} & {3,82} & {3,82} &  &  \\

    Observações tratadas & {7.623} & {7.623} & {4.568} & {4.568} & {1.142} & {1.142} & {159} & {159} &  &  \\ 
    Observações & {39.894} & {39.894} & {39.894} & {39.894} & {39.894} & {39.894} & {39.894} & {39.894} & {39.894} & {39.894} \\ 
    R$^{2}$ & {0,052} & {0,052} & {0,052} & {0,052} & {0,052} & {0,052} & {0,052} & {0,052} & {0,051} & {0,051} \\ 
    \hline 
    \hline \\[-1.8ex] 
    \end{tabularx}

    \end{table} 
    \small

    \medskip
    Notas: $\sym{*}\ p<0{,}1$; $\sym{**}\ p<0{,}05$; $\sym{***}\ p<0{,}01$ 

    \smallskip
    Modelos incluem com todos os controles usados nas regressões originais. Para o caso de tratamento contínuo, em substituição a variável de intensidade de tratamento no muncípio, usou-se como \textit{proxy} a \% de recursos de empresas do candidato em 2012 em relação à média ao que foi observado no município no ano.

    \end{landscape}
    \end{addmargin}

EDIT:

After using the solution suggested by Mico, I want to try to adapt it using the page orientation as landscape. This is what I have tried:

        \usepackage{pdflscape}
    \documentclass[12pt,openright,oneside,a4paper,
                   english,french,spanish,brazil]{abntex2}
    \usepackage[vmargin=3cm, hmargin=2.5cm]{geometry}
    \usepackage{booktabs, tabularx, ragged2e}
    \usepackage[utf8]{inputenc} % <-- new
    \usepackage[T1]{fontenc}    % <-- new
    \usepackage{pifont}
    \usepackage{rotating,booktabs,caption} % <-- new
    \usepackage{siunitx}

    \def\sym#1{\ifmmode^{#1}\else\(^{#1}\)\fi}
\begin{landscape}
\pagestyle{empty}
\begin{table}[!t]
\small
\setlength\tabcolsep{0pt} % let LaTeX figure out amount of intercolumn whitespace
\sisetup{input-symbols=(),
         table-space-text-post={\sym{***}},
         output-decimal-marker={,},
         group-digits=false}
\captionsetup{font=small}
\caption{Votos - Robustez dos resultados - mudança na definição da variável de tratamento} \label{} 

\begin{tabular*}{\textwidth}{@{\extracolsep{\fill}} l*{10}{S[table-format={-1.3}]} }\\
\toprule
& \multicolumn{10}{c}{Variável dependente: \% Votos ($\times$100)} \\ 
\cmidrule{2-11} 
& \multicolumn{2}{c}{$T = 0\%$} 
& \multicolumn{2}{c}{$T = 10\%$} 
& \multicolumn{2}{c}{$T = 50\%$} 
& \multicolumn{2}{c}{$T = 100\%$} 
& \multicolumn{2}{c}{``Contínuo''}   \\ 
\cmidrule{2-3} \cmidrule{4-5} \cmidrule{6-7} \cmidrule{8-9} \cmidrule{10-11}
& {(1)} & {(2)} & {(3)} & {(4)} & {(5)} & {(6)} & {(7)} & {(8)} & {(9)} & {(10)}\\ 
\midrule
     $\text{Ano} \times T$ 
         & -0,067 & -0,124\sym{***} & -0,032 & -0,142\sym{***} & -0,038 & -0,191\sym{**} & 0,618\sym{**} & -0,352 &  &  \\ 
         & (0,046) & (0,035) & (0,059) & (0,043) & (0,113) & (0,077) & (0,305) & (0,232) \\ \addlinespace
     $\text{Ano} \times T \times \text{Concorrência}$
         & 0,002 &  & 0,0005 &  & 0,00004 &  & -0,051\sym{*} &  &  &  \\ 
         & (0,003) &  & (0,004) &  & (0,008) &  & (0,027) &  &  &  \\ \addlinespace 
     $\text{Ano} \times T \times \text{(\%) T.Mun}$ 
         &  & 2,151\sym{***} &  & 4,006\sym{***} &  & 7,312\sym{***} &  & 18,945\sym{***} &  &  \\ 
         &  & (0,653) &  & (1,081) &  & (2,405) &  & (6,941) &  &  \\ \addlinespace 
     $\text{Ano} \times \text{(\%) Emp.}$ 
         &  &  &  &  &  &  &  &  & -0,033 & -0,065 \\ 
         &  &  &  &  &  &  &  &  & (0,130) & (0,073) \\ \addlinespace
     $\text{Ano} \times \text{Concorrência} \times \text{(\%) Emp.}$ 
         &  &  &  &  &  &  &  &  & -0,002 &  \\ 
         &  &  &  &  &  &  &  &  & (0,009) &  \\ \addlinespace
     $\text{Ano} \times \text{(\%) Emp/(\%) Emp.Mun}$ 
         &  &  &  &  &  &  &  &  &  & -0,000 \\ 
         &  &  &  &  &  &  &  &  &  & (0,002) \\ \addlinespace
     Constante 
         & -0,384\sym{***} & -0,384\sym{***} & -0,389\sym{***} & -0,389\sym{***} & -0,390\sym{***} & -0,390\sym{***} & -0,392\sym{***} & -0,392\sym{***} & -0,389\sym{***} & -0,389\sym{***} \\ 
         & (0,011) & (0,011) & (0,010) & (0,010) & (0,010) & (0,010) & (0,010) & (0,010) & (0,010) & (0,010) \\ 
\midrule
    Média $Y$ & {3,48} & {3,48} & {3,40} & {3,40} & {3,55} & {3,55} & {3,82} & {3,82} &  &  \\
    Observações tratadas & {7.623} & {7.623} & {4.568} & {4.568} & {1.142} & {1.142} & {159} & {159} &  &  \\ 
    Observações & {39.894} & {39.894} & {39.894} & {39.894} & {39.894} & {39.894} & {39.894} & {39.894} & {39.894} & {39.894} \\ 
    R$^{2}$ & {0,052} & {0,052} & {0,052} & {0,052} & {0,052} & {0,052} & {0,052} & {0,052} & {0,051} & {0,051} \\ 
\bottomrule
\end{tabular*}

\footnotesize
\medskip
Notas: $\sym{*}\ p<0{,}1$; $\sym{**}\ p<0{,}05$; $\sym{***}\ p<0{,}01$ 

\smallskip
Modelos incluem com todos os controles usados nas regressões originais. Para o caso de tratamento contínuo, em substituição a variável de intensidade de tratamento no muncípio, usou-se como \textit{proxy} a \% de recursos de empresas do candidato em 2012 em relação à média ao que foi observado no município no ano.
\end{table}
\end{landscape} 
  • 1
    you put the notes in the wrong place, they should be inside the table as table marks a region that can be moved in the document, and if that tabular is moved the notes need to move with it. – David Carlisle Oct 6 '17 at 6:40
  • Thank you! But the other issues remain – Arthur Carvalho Brito Oct 6 '17 at 6:45
  • 1
    I hadn't noticed those. That is misuse of tabularx, tabularx can only work with an X column but you do not want line breaking in a numeric table so do not use tabularx at all just use a standard tabular and centre it with \centering – David Carlisle Oct 6 '17 at 6:47
2

Some comments and observations:

  • Since you're not using automatic line-breaking in any of the columns, there's no point in employing a tabularx environment. I suggest you employ a tabular* environment instead, with its width set to \textwidth, inside a sidewaystable environment (provided by the rotating package).

  • If you want the decimal markers of the standard errors to line up with the decimal markers of the coefficient estimates, don't encase the standard errors in curly braces. And, be sure to employ the siunitx option group-digits=false.

  • If you're willing to switch to a \small font size, there's no need to widen the table using an addmargin approach.

  • Oh, and of course, do keep the table notes inside the sidewaystable environment.

enter image description here

\documentclass[12pt,openright,oneside,a4paper,
               english,french,spanish,brazil]{abntex2}
\usepackage[vmargin=3cm, hmargin=2.5cm]{geometry}
\usepackage{booktabs, tabularx, ragged2e}
\usepackage[utf8]{inputenc} % <-- new
\usepackage[T1]{fontenc}    % <-- new
\usepackage{pifont}
\usepackage{rotating,booktabs,caption} % <-- new
\usepackage{siunitx}

\def\sym#1{\ifmmode^{#1}\else\(^{#1}\)\fi}

\begin{document}

\begin{sidewaystable}
\small
\setlength\tabcolsep{0pt} % let LaTeX figure out amount of intercolumn whitespace
\sisetup{input-symbols=(),
         table-space-text-post={\sym{***}},
         output-decimal-marker={,},
         group-digits=false}
\captionsetup{font=small}
\caption{Votos - Robustez dos resultados - mudança na definição da variável de tratamento} \label{} 

\begin{tabular*}{\textwidth}{@{\extracolsep{\fill}} l*{10}{S[table-format={-1.3}]} }\\
\toprule
& \multicolumn{10}{c}{Variável dependente: \% Votos ($\times$100)} \\ 
\cmidrule{2-11} 
& \multicolumn{2}{c}{$T = 0\%$} 
& \multicolumn{2}{c}{$T = 10\%$} 
& \multicolumn{2}{c}{$T = 50\%$} 
& \multicolumn{2}{c}{$T = 100\%$} 
& \multicolumn{2}{c}{``Contínuo''}   \\ 
\cmidrule{2-3} \cmidrule{4-5} \cmidrule{6-7} \cmidrule{8-9} \cmidrule{10-11}
& {(1)} & {(2)} & {(3)} & {(4)} & {(5)} & {(6)} & {(7)} & {(8)} & {(9)} & {(10)}\\ 
\midrule
     $\text{Ano} \times T$ 
         & -0,067 & -0,124\sym{***} & -0,032 & -0,142\sym{***} & -0,038 & -0,191\sym{**} & 0,618\sym{**} & -0,352 &  &  \\ 
         & (0,046) & (0,035) & (0,059) & (0,043) & (0,113) & (0,077) & (0,305) & (0,232) \\ \addlinespace
     $\text{Ano} \times T \times \text{Concorrência}$
         & 0,002 &  & 0,0005 &  & 0,00004 &  & -0,051\sym{*} &  &  &  \\ 
         & (0,003) &  & (0,004) &  & (0,008) &  & (0,027) &  &  &  \\ \addlinespace 
     $\text{Ano} \times T \times \text{(\%) T.Mun}$ 
         &  & 2,151\sym{***} &  & 4,006\sym{***} &  & 7,312\sym{***} &  & 18,945\sym{***} &  &  \\ 
         &  & (0,653) &  & (1,081) &  & (2,405) &  & (6,941) &  &  \\ \addlinespace 
     $\text{Ano} \times \text{(\%) Emp.}$ 
         &  &  &  &  &  &  &  &  & -0,033 & -0,065 \\ 
         &  &  &  &  &  &  &  &  & (0,130) & (0,073) \\ \addlinespace
     $\text{Ano} \times \text{Concorrência} \times \text{(\%) Emp.}$ 
         &  &  &  &  &  &  &  &  & -0,002 &  \\ 
         &  &  &  &  &  &  &  &  & (0,009) &  \\ \addlinespace
     $\text{Ano} \times \text{(\%) Emp/(\%) Emp.Mun}$ 
         &  &  &  &  &  &  &  &  &  & -0,000 \\ 
         &  &  &  &  &  &  &  &  &  & (0,002) \\ \addlinespace
     Constante 
         & -0,384\sym{***} & -0,384\sym{***} & -0,389\sym{***} & -0,389\sym{***} & -0,390\sym{***} & -0,390\sym{***} & -0,392\sym{***} & -0,392\sym{***} & -0,389\sym{***} & -0,389\sym{***} \\ 
         & (0,011) & (0,011) & (0,010) & (0,010) & (0,010) & (0,010) & (0,010) & (0,010) & (0,010) & (0,010) \\ 
\midrule
    Média $Y$ & {3,48} & {3,48} & {3,40} & {3,40} & {3,55} & {3,55} & {3,82} & {3,82} &  &  \\
    Observações tratadas & {7.623} & {7.623} & {4.568} & {4.568} & {1.142} & {1.142} & {159} & {159} &  &  \\ 
    Observações & {39.894} & {39.894} & {39.894} & {39.894} & {39.894} & {39.894} & {39.894} & {39.894} & {39.894} & {39.894} \\ 
    R$^{2}$ & {0,052} & {0,052} & {0,052} & {0,052} & {0,052} & {0,052} & {0,052} & {0,052} & {0,051} & {0,051} \\ 
\bottomrule
\end{tabular*}

\footnotesize
\medskip
Notas: $\sym{*}\ p<0{,}1$; $\sym{**}\ p<0{,}05$; $\sym{***}\ p<0{,}01$ 

\smallskip
Modelos incluem com todos os controles usados nas regressões originais. Para o caso de tratamento contínuo, em substituição a variável de intensidade de tratamento no muncípio, usou-se como \textit{proxy} a \% de recursos de empresas do candidato em 2012 em relação à média ao que foi observado no município no ano.
\end{sidewaystable} 
\end{document}
  • Thank you. But it is important to me to use landscape formatting, so that the whole page rotates for the reader. Is it viable? – Arthur Carvalho Brito Oct 6 '17 at 17:08
  • After trying it, the table itself was fitting, but its rulers were not going to the left side of it.. stopping in the middle – Arthur Carvalho Brito Oct 6 '17 at 17:28
  • @ArthurCarvalhoBrito - “After trying it” — please be more specific as to what “it” is. – Mico Oct 6 '17 at 17:41
  • Ok, I will edit the question in a minute. – Arthur Carvalho Brito Oct 6 '17 at 17:42
  • 1
    @ArthurCarvalhoBrito - Thanks for posting an addendum to your original posting. I would like to suggest the following fix: (a) add the instructions \newlength\mylen and \setlength\mylen{\textheight} to the end of the preamble, and (b) use \mylen instead of \textwidth in the first argument of the tabular* environment. – Mico Oct 6 '17 at 21:00

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.