You can either fix the column width by specifying a paragraph style p{<len>}
, or you can use a different tabular environment that stretches according to the contents up to the maximum width of the text block. The latter is provided by the tabularx
package which defines the environment tabularx
with an additional width-of-table argument, as well as the stretchable X
column specifier.
An example of the first suggestion:
\documentclass[12pt]{report}
\usepackage[a4paper,left=15mm,right=15mm, top=1cm, bottom=2cm]{geometry}% http://ctan.org/pkg/geometry
\begin{document}
\noindent\begin{tabular}{|l|c|p{0.7\linewidth}|}
\hline
a & b & Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.\\
\hline
\end{tabular}
\end{document}
An example of the second suggestion:
\documentclass[12pt]{report}
\usepackage[a4paper,left=15mm,right=15mm, top=1cm, bottom=2cm]{geometry}% http://ctan.org/pkg/geometry
\usepackage{tabularx}% http://ctan.org/pkg/tabularx
\begin{document}
\noindent\begin{tabularx}{\linewidth}{|l|c|X|}
\hline
a & b & Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.\\
\hline
\end{tabularx}
\end{document}
The tabularx
approach is an easy way out since you don't have to worry about specifying a column width that exactly matches the remaining column space on the page. However, it is possible to calculate the appropriate value of <len>
when using the p{<len>}
column specifier.
I think a source of the problem is that whereas you define the table to have 19 columns in total, you actually only have 13 columns (1 header column and 12 data columns). Fixing this issue -- mainly by getting rid of unnecessary &
alignment characters -- lets the table fit into the available space just fine, without having to switch to a smaller font.
By the way, if one uses the rule-drawing commands of the booktabs
package, one should not use vertical bars as well, in part because the vertical lines will not join up correctly with the horizontal rules.
(I rotated the image below 90 degrees only to make it easier to display in this space.)
\documentclass[a4paper]{article}
\usepackage{lscape,booktabs,longtable}
\begin{document}
\begin{landscape}
\setlength\LTcapwidth{\textwidth} % default: 4in (rather less than \textwidth...)
\setlength\LTleft{0pt} % default: \parindent
\setlength\LTright{0pt} % default: \fill
\begin{longtable}{@{}l@{\extracolsep{\fill}}*{12}{c}@{}}
\caption{Multinomial logistic regression results for daily data of the major Eurozone, US, and UK market indices, January 1, 2005, to 20 July, 2012.} \label{grid_mlmmh} \\
\toprule
& \multicolumn{6}{c}{Bottom tails} & \multicolumn{6}{c}{Top tails} \\
\cmidrule(r){2-7} \cmidrule(l){8-13}
% 2 orizonties grammes aristera kai deksia
& \multicolumn{2}{c}{(1)} & \multicolumn{2}{c}{(2)} & \multicolumn{2}{c}{(3)}
& \multicolumn{2}{c}{(4)} & \multicolumn{2}{c}{(5)} & \multicolumn{2}{c}{(6)} \\
\cmidrule(r){2-3} \cmidrule(lr){4-5} \cmidrule(lr){6-7}
\cmidrule(lr){8-9} \cmidrule(lr){10-11} \cmidrule(l){12-13}
% 2 orizonties grammes aristera kai deksia \\
& Coeff & $\Delta$Prob & Coeff & $\Delta$Prob & Coeff & $\Delta$Prob
& Coeff & $\Delta$Prob & Coeff & $\Delta$Prob & Coeff & $\Delta$Prob \\
\midrule
\endfirsthead
\multicolumn{7}{@{}l}%
{{\bfseries \tablename\ \thetable{} --- continued from previous page}} \\
\midrule[\heavyrulewidth]
& \multicolumn{6}{c}{Bottom tails} & \multicolumn{6}{c}{Top tails} \\
\cmidrule(r){2-7} \cmidrule(l){8-13}
% 2 orizonties grammes aristera kai deksia
& \multicolumn{2}{c}{(1)} & \multicolumn{2}{c}{(2)} & \multicolumn{2}{c}{(3)}
& \multicolumn{2}{c}{(4)} & \multicolumn{2}{c}{(5)} & \multicolumn{2}{c}{(6)} \\
\cmidrule(r){2-3} \cmidrule(lr){4-5} \cmidrule(lr){6-7}
\cmidrule(lr){8-9} \cmidrule(lr){10-11} \cmidrule(l){12-13}
% 2 orizonties grammes aristera kai deksia \\
& Coeff & $\Delta$Prob & Coeff & $\Delta$Prob & Coeff & $\Delta$Prob
& Coeff & $\Delta$Prob & Coeff & $\Delta$Prob & Coeff & $\Delta$Prob \\
\midrule
\endhead
\midrule[\heavyrulewidth]
\multicolumn{13}{r}{Continued on next page} \\
\endfoot
\bottomrule
\endlastfoot
PIIGS \\
$\beta_{01}$ (const.)
& 100 & 0.8 & 0.021 & 0.018 & 0.043 & 0.146 & 0.074 & 0.427 & 0.019 & 0.427 & 0.019 & 0.427 \\
Log-likel. \\
Pseudo-$R^{2}$ \\[2ex]
Non-PIIGS \\
$\beta_{01}$ (const.)
& 100 & 0.8 & 0.021 & 0.018 & 0.043 & 0.146 & 0.074 & 0.427 & 0.019 & 0.427 & 0.019 & 0.427 \\
Log-likel.\\
Pseudo-$R^{2}$ \\
\end{longtable}
\end{landscape}
\end{document}
Best Answer
doxygen
, so my understanding of your table code is very limitedlongtable
,xltabular
and for example newesttabularray
(which is used in MWE below)doxygen
I'm a bit suspicious (that will work as desired), since, as I see from your MWE, it use buggy, not maintainedtabu
package, which is not compatible with recent LaTeX versions anymore.\+
and-\/
in your table. Therefore in my MWE I left them out.From comparison you and mine MWE you can observe.
(red lines indicate page layout)
In the case, that text in the first column should be italic shape, you only need to change
colspec
declaration to:Than table will looks as follows: