0

Although this is a SWP question, it is very LaTeX related, since it deals with a lot of TeX fields.

I have a table in Scientific Workplace (v 5.5), originally created in Stata and exported using the tabout command. As I usually do to prevent issues such as leaving the table in a whole sheet, or misplacing it in the document, inter alia, I inserted a 'Table - (4x3, floating)' fragment, then removed the 4x3 table part, inserted a tex field in between the marker and the end, and pasted the LaTeX tabular code generated by tabout.

My issue is that I am left with the right-most column being misaligned. By this I mean that it is "separated" from the others (a bit away but still as part of the table). What can I do to avoid this? It is very annoying. I have tried with centering and other things but could not find a solution. This is the code that I insert in the TeX field:

{
\def\sym#1{\ifmmode^{#1}\else\(^{#1}\)\fi}
\begin{tabular}{l*{4}{c}}
\hline\hline
        &              Placement    &         Placement         &        Placement            &        Placement            \\
        &\multicolumn{1}{c}{      \small{Model E}}&\multicolumn{1}{c}{\small{Model F}}&\multicolumn{1}{c}{\small{Model G}}&\multicolumn{1}{c}{\small{Model H }}\\
\hline

Treatment 1     &   -11.61\sym{**} &                  &   -2.811         &         0         \\
                &  (0.048)         &                  &  (0.977)         &        ($\cdot$)          \\
[1em]

Sample Score    &                  &    4.332\sym{***}&    3.813\sym{*}  &        4.332\sym{***}          \\
                &                  &  (0.107)         &  (0.061)         &        (0.007)            \\ 
                [1em]
Treat.1 \textit{X} Sample Score&    4.555\sym{***}&    2.064\sym{**} &    3.245         &         2.064\sym{**}          \\
                &  (0.192)         &  (0.046)         &  (0.823)         &        (0.046)          \\
[1em]
Male            &    3.021\sym{**} &    4.526\sym{*}  &    4.524\sym{*}  &          4.526\sym{*}         \\
                &  (0.032)         &  (0.354)         &  (0.054)         &         (0.054)         \\


Constant        &    54.57\sym{***}&    16.17\sym{***}&    17.40\sym{***}&   46.17\sym{***}        \\
                &  (0.000)         &  (0.000)         &  (0.000)         &      (0.000)        \\
\hline

\hline
N               &      282         &      282         &      282         &      282         \\
$R^2$              &   0.0648         &   0.0761         &   0.0767         &   0.0761         \\
\hline\hline
\multicolumn{5}{l}{\footnotesize NOTES: The dependent variable is placement (the reported belief that own performance in the quiz is }\\
\multicolumn{5}{l}{\footnotesize above the median). Models E-G are OLS regressions. Model H is a semi-structural estimation }\\
\multicolumn{5}{l}{\footnotesize imposing the model's  restriction that $Treatment 1 >0$.  }\\
\multicolumn{5}{l}{\footnotesize \textit{P}-values in parentheses. \sym{*} \(p<0.10\), \sym{**} \(p<0.05\), \sym{***} \(p<0.01\).}\\
\end{tabular}
}

I have also tried removing the notes from the tabular, inserting a \begin{center} after the caption and an \end{center} before the end of the table, and inserting the notes as a \footnotesize paragraph after the TeX field containing the table. This way I correct the column but get that the width of the notes is larger than that of the table, and that is very annoying too.

Any ideas on how to fix the misaligned column or how to make the notes paragraph the same size as the table?

Thanks.

  • What's the difference to your previous question? To summarize the answers given there that are also applicable to this table: The reasonfor the too wide last column is your usag of l type columns for the table notes. Try either p type columns with an appropriate width or the threeparttable or threeparttablex packages. – leandriis Jul 31 at 17:43
  • Thank you. The difference is that I have now specifically argued that this is for SWP. Using the packages you mention would be chaotic for me (implementation-wide) and the p columns are not working: the text is still too wide. I have used linewidth and textwidth but none works. Is there any other option I am unaware of? – Juan Pedro Jul 31 at 18:14
  • More specifically, I would like to know how to get a paragraph have the same width as the table. This way I can put it right below in footnote size and be done. Thanks. – Juan Pedro Jul 31 at 18:31
  • You could also use something like p{10cm} or p{0.8\textwidth} if your table is narrower than the text width. – leandriis Jul 31 at 19:37
  • Yes, thank you. I tried that but the text starts a little earlier than the table and then finishes a little earlier, too. It is as if I had nailed the right width but the table and paragraph are vertically misaligned. And they are both inside the same \begin{center} and \end{center}. I have no clue why does that happen. – Juan Pedro Jul 31 at 20:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.