[Tex/LaTex] LyX TeX Table too big


I am including a TeX file into a LyX document using Insert -> Child Document. The Table looks fine on the LyX screen but when I preview the PDF it is 10 times too big. Not sure how to fiddle with the magnification to make it look right. Or is using the child document route wrong?

Here is the MWE:

\caption{Regression table}\label{tab1}

\begin{tabular}{@{}l cccccc @{}}
& \multicolumn{2}{c}{Model 1}
& \multicolumn{2}{c}{Model 2}
& \multicolumn{2}{c@{}}{Model 3}\\
\cmidrule(lr){2-3} \cmidrule(lr){4-5} \cmidrule(l){6-7}
& Coef. & SE & Coef. & SE & Coef. & SE\\
Variable 1 & 12.758 & * &  13.822 & *** & 2.123 & *\\
\multicolumn{7}{@{}l}{* $p < 0.05$, ** $p < 0.01$, *** $p < 0.001$.}\\

When I add this as an input to my LyX Beamer presentation the slide magnifies the table 5-10 times making it unreadable.

Best Answer

Your problem might be hidden in some settings that are not shown at the moment... Hence, the complete generated LaTeX code would be helpful. At least I found some information that was not mentioned before:

  • that you are probably using the package booktabs because of \toprule etc. Hence, you seem to have created the table by inserting TeX code/ERT into your child document.

  • what exact document class your main document and your child document have -- I assume "presentation (beamer)" for both.

Here I give a MWE that works for me as expected. The output is

output of LyX file

The LyX file looks like

lyx file

and here is the generated LaTeX code (very few lines are removed).

%% LyX created this file.  For more info, see http://www.lyx.org/.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Textclass specific LaTeX commands.
% this default might be overridden by plain title style
\def\lyxframeend{} % In case there is a superfluous frame end

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.

\lyxframeend{}\lyxframe{test slide}

\caption{Caption of table}
\label{tab1}\centering\begin{tabular}{@{}l cccccc @{}} 
&\multicolumn{2}{c}{M1} &\multicolumn{2}{c@{}}{M2} &\multicolumn{2}{c@{}}{M3}\\
\cmidrule(lr){2-3} \cmidrule(lr){4-5} \cmidrule(l){6-7} &C &SE &C &SE &C &SE\\
Variable 1 & 12.345 & * &  23.456 & *** & 34.567 & *\\
\multicolumn{7}{@{}l}{* $p < 0.05$, ** $p < 0.01$, *** $p < 0.001$.}\\

Related Question