Monday, February 16, 2009

Think a little before opening your mouth

"The surest way to prevent war is not to fear it" John Randolph.

Tuesday, February 10, 2009

Adjusting latex tables to the page size

Hi,

How many times did you find out that your latex table didn't fit the page size? How should you have solved that? It's as easy as using the resizebox command:

\usepackage{booktabs} %for \midrule \toprule \bottomrule
...

\begin{table}[t]
\caption{My table's caption.}
\label{tab:mytable}
\begin{center}
\resizebox{0.70\textwidth}{!}{
\begin{tabular*}{0.70\textwidth}{@{\extracolsep{\fill}} l p{.5\textwidth}}
\toprule
\textbf{Term} & \textbf{Description} \\
\midrule
$Sth$ & A $Sth$'s description \\
\bottomrule
\end{tabular*}
} %end of resizebox
\end{center}
\end{table}

And that's all! The rest of the table is given as a mere example.

Hoping it would help somebody!

Labels: