# Using ERT in LyX [duplicate]

Using LyX to create a Beamer presentation I used the TeX button to insert some ERT:

\begin{table}\caption{Regression table\label{tab1}}
\begin{center}
\begin{tabular}{l r l r l r l}
\hline
& \multicolumn{2}{c}{Model 1}&\multicolumn{2}{c}{Model 2}&\multicolumn{2}{c}{Model 3}\\
\hline
\hline
Variable 1 & 12.758 & * &  13.822 & *** & 2.123 & *\\
\hline
\textit{*p < 0.05, ** p < 0.01, *** p < 0.001}
\end{tabular}
\end{center}
\end{table}


I am using the beamer conference template. It reads the code fine but on the slide the table is 50 times too big. Is there a way to adjust the table size to put it in correct proportion?

-

## marked as duplicate by Kurt, Werner, Thorsten, zeroth, mafpMar 18 '13 at 19:55

This question was marked as an exact duplicate of an existing question.

I hope you are referring to this ERT for people like me who have no experience with Lyx – texenthusiast Mar 18 '13 at 6:06
@texenthusiast Yep, that is right. – Chris J Mar 18 '13 at 6:12

use

\begin{table}
\caption{Regression table\label{tab1}}
\centering
\resizebox{\linewidth}{!}{%
\begin{tabular}{l r l r l r l}\hline
& \multicolumn{2}{c}{Model 1}&\multicolumn{2}{c}{Model 2}&\multicolumn{2}{c}{Model 3}\\\hline\hline
Variable 1 & 12.758 & * &  13.822 & *** & 2.123 & *\\\hline
\textit{*p < 0.05, ** p < 0.01, *** p < 0.001}
\end{tabular}}
\end{table}


which needs package graphicx

-
Thanks for the reply. I am getting the error "(job aborted, no legal \end found)". I have included the graphicx package in the preamble and I also have, booktabs array [justification=centering]{caption}. No error if I compile without your code. – Chris J Mar 18 '13 at 18:20
send me your lyx file: herbert at dante.de – Herbert Mar 18 '13 at 19:49