Posts

Showing posts with the label Horizontal Alignment

Center A Table That Uses Resizebox

Answer : There is no centering environment. And issuing \centering inside \resizebox doesn't make sense anyway: it should be outside, because you want to center the resized box. \documentclass[11pt,english,titlepage]{article} \usepackage{graphicx} \begin{document} \begin{table} \centering \caption{mytable} \resizebox{.5\textwidth}{!}{% <------ Don't forget this % \begin{tabular}{rrr} A & B & C \\ \hline A1 & B1 & C1 \\ A2 & B2 & C2 \\ A3 & B3 & C3 \\ \end{tabular}% <------ Don't forget this % } \end{table} \end{document} Here an alternative answer using adjustbox . It covers the functionality of \resizebox and is also able to center its content. It also removes the need of escaping the line breaks with % as seen in egregs answer, as the adjustbox environment removes the spaces added by them. It is even possible to pr...

Balancing Long Table Inside Multicol In LaTeX

Image
Answer : If you don't want longtable to add headers and footers to the table at the same time that multicol is balancing where to make the break (which would require that frank and I cooperate:-) then multicol will balance the output from longtable if you first trick longtable into thinking that it isn't in multicol at all. I added some rules, just to show that latex tabular features then work, which is harder to do with a bare \halign . \documentclass[11pt, a4paper]{article} \usepackage[margin=3cm]{geometry} \usepackage{longtable} \usepackage{multicol} \newsavebox\ltmcbox \def\shortlipsum{\par Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit, vestibulum ut, placerat ac, adipiscing vitae, felis. Curabitur dictum gravida mauris. Nam arcu libero, nonummy eget, consectetuer id, vulputate a, magna. Donec vehicula augue eu neque.\par} \newcounter{entryno} \setcounter{entryno}{1} \def\tabline{Test & \the\value{entryno} & Description\addt...