I need to enlarge this table until it touches the right and left side of the A4 page. In a nutshell I should remove the margins on the sides. It's my first time using latex and I've tried several attempts, but none of them work. I'm pretty sure I'm setting some package wrong
This is the code. What should I change?
\documentclass{article} % or some other suitable document class
\usepackage[T1]{fontenc}
\usepackage[margin=1in]{geometry} % set page parameters appropriately
\usepackage{longtable}
\usepackage{booktabs} % for well-spaced horizontal rules
\usepackage{dcolumn} % align numbers in columns on decimal markers
\newcolumntype{d}[1]{D..{#1}}
\newcommand{\mc}[1]{\multicolumn{1}{c}{#1}} % handy shortcut macro
\begin{document}
\begingroup % localize scope of next four instructions
\small % 10% linear reduction in font size
\setlength\tabcolsep{0pt} % let LaTeX figure out inter-column space
\setlength\LTleft{0pt} % see p. 7 of package's user guide
\setlength\LTright{0pt}
\begin{longtable}{@{\extracolsep{\fill}} l *{7}{d{2.5}} d{2.6} @{}}
%% headers and footers
\caption{X} \label{tab:x} \\
\toprule
& \multicolumn{8}{c}{\textit{Dependent variable:}} \\
& \multicolumn{8}{c}{$\log(\mathrm{tpens})$} \\
\cmidrule{2-9}
& \mc{(1)} & \mc{(2)} & \mc{(3)} & \mc{(4)}
& \mc{(5)} & \mc{(6)} & \mc{(7)} & \mc{(8)}\\
\midrule
\endfirsthead
\multicolumn{9}{@{}l}{Table \thetable, continued}\\
\addlinespace
\toprule
& \multicolumn{8}{c}{\textit{Dependent variable:}} \\
& \multicolumn{8}{c}{$\log(\mathrm{tpens})$} \\
\cmidrule{2-9}
& \mc{(1)} & \mc{(2)} & \mc{(3)} & \mc{(4)}
& \mc{(5)} & \mc{(6)} & \mc{(7)} & \mc{(8)}\\
\midrule
\endhead
\midrule
\multicolumn{9}{r@{}}{\footnotesize (continued on next page)}\\
\endfoot
% empty final footer
\endlastfoot
%% body of table
sex & 0.226^{***} & 0.219^{***} & 0.239^{***} & 0.244^{***} & 0.131^{***} & 0.132^{***} & 0.132^{***} & 0.142^{***} \\
& (0.020) & (0.019) & (0.017) & (0.017) & (0.016) & (0.016) & (0.016) & (0.016) \\
\addlinespace
eta & & -0.009^{***} & -0.005^{***} & -0.004^{***} & -0.002^{**} & -0.002^{**} & -0.002^{**} & -0.002^{*} \\
& & (0.001) & (0.001) & (0.001) & (0.001) & (0.001) & (0.001) & (0.001) \\
\addlinespace
studio\_lev2 & & & 0.330^{***} & 0.163^{***} & 0.129^{***} & 0.127^{***} & 0.127^{***} & 0.129^{***} \\
& & & (0.021) & (0.023) & (0.022) & (0.022) & (0.022) & (0.022) \\
\addlinespace
studio\_lev3 & & & 0.717^{***} & 0.459^{***} & 0.420^{***} & 0.417^{***} & 0.417^{***} & 0.431^{***} \\
& & & (0.035) & (0.038) & (0.036) & (0.036) & (0.036) & (0.036) \\
\addlinespace
type\_job\_Middle-class\_worker & & & & 0.219^{***} & 0.189^{***} & 0.187^{***} & 0.187^{***} & 0.191^{***} \\
& & & & (0.023) & (0.022) & (0.022) & (0.022) & (0.022) \\
\addlinespace
type\_job\_Manager & & & & 0.465^{***} & 0.418^{***} & 0.414^{***} & 0.414^{***} & 0.410^{***} \\
& & & & (0.039) & (0.037) & (0.037) & (0.037) & (0.036) \\
\addlinespace
type\_job\_Self-Employed & & & & -0.142^{***} & -0.189^{***} & -0.190^{***} & -0.189^{***} & -0.173^{***} \\
& & & & (0.022) & (0.020) & (0.020) & (0.020) & (0.020) \\
\addlinespace
acontrib & & & & & 0.020^{***} & 0.020^{***} & 0.020^{***} & 0.019^{***} \\
& & & & & (0.001) & (0.001) & (0.001) & (0.001) \\
\addlinespace
dislav & & & & & & -0.085^{***} & -0.085^{***} & -0.050^{*} \\
& & & & & & (0.027) & (0.027) & (0.027) \\
\addlinespace
occnow & & & & & & & 0.029 & 0.075 \\
& & & & & & & (0.072) & (0.073) \\
\addlinespace
ireg2 & & & & & & & & 0.147^{*} \\
& & & & & & & & (0.080) \\
\addlinespace
ireg3 & & & & & & & & -0.005 \\
& & & & & & & & (0.032) \\
\addlinespace
ireg4 & & & & & & & & -0.054 \\
& & & & & & & & (0.039) \\
\addlinespace
ireg5 & & & & & & & & -0.012 \\
& & & & & & & & (0.034) \\
\addlinespace
ireg6 & & & & & & & & 0.067 \\
& & & & & & & & (0.050) \\
\addlinespace
ireg7 & & & & & & & & -0.080^{*} \\
& & & & & & & & (0.043) \\
\addlinespace
ireg8 & & & & & & & & 0.076^{**} \\
& & & & & & & & (0.036) \\
\addlinespace
ireg9 & & & & & & & & -0.018 \\
& & & & & & & & (0.033) \\
\addlinespace
ireg10 & & & & & & & & -0.071 \\
& & & & & & & & (0.045) \\
\addlinespace
ireg11 & & & & & & & & 0.050 \\
& & & & & & & & (0.041) \\
\addlinespace
ireg12 & & & & & & & & 0.012 \\
& & & & & & & & (0.038) \\
\addlinespace
ireg13 & & & & & & & & -0.099^{*} \\
& & & & & & & & (0.060) \\
\addlinespace
ireg14 & & & & & & & & -0.217^{***} \\
& & & & & & & & (0.056) \\
\addlinespace
ireg15 & & & & & & & & -0.091^{**} \\
& & & & & & & & (0.039) \\
\addlinespace
ireg16 & & & & & & & & -0.120^{***} \\
& & & & & & & & (0.040) \\
\addlinespace
ireg17 & & & & & & & & -0.176^{***} \\
& & & & & & & & (0.054) \\
\addlinespace
ireg18 & & & & & & & & -0.019 \\
& & & & & & & & (0.046) \\
\addlinespace
ireg19 & & & & & & & & -0.126^{***} \\
& & & & & & & & (0.044) \\
\addlinespace
ireg20 & & & & & & & & -0.021 \\
& & & & & & & & (0.039) \\
\addlinespace
Constant & 6.860^{***} & 7.530^{***} & 7.133^{***} & 7.034^{***} & 6.273^{***} & 6.324^{***} & 6.266^{***} & 6.171^{***} \\
& (0.015) & (0.089) & (0.082) & (0.078) & (0.082) & (0.083) & (0.166) & (0.170) \\
\midrule
Observations & \mc{2{,}229} & \mc{2{,}229} & \mc{2{,}229} & \mc{2{,}226} & \mc{2{,}173} & \mc{2{,}173} & \mc{2{,}173} & \mc{2{,}173} \\
$R^{2}$ & 0.056 & 0.081 & 0.270 & 0.358 & 0.455 & 0.457 & 0.457 & 0.476 \\
Adjusted $R^{2}$ & 0.056 & 0.080 & 0.269 & 0.356 & 0.453 & 0.455 & 0.455 & 0.469 \\
Resid.\ Std.\ Error & 0.406 & 0.400 & 0.357 & 0.335 & 0.309 & 0.309 & 0.309 & 0.305 \\
\qquad df & \mc{2227} & \mc{2226} & \mc{2224} & \mc{2218} & \mc{2164} & \mc{2163} & \mc{2162} & \mc{2143} \\
$F$-Statistic
& \mc{133.081} & \mc{97.706} & \mc{206.134} & \mc{176.461} & \mc{225.471 } & \mc{202.428} & \mc{182.131} & \mc{67.151} \\
\qquad df & \mc{1;2227} & \mc{2;2226} & \mc{4;2224} & \mc{7;2218} & \mc{8;2164} & \mc{9;2163} & \mc{10;2162} & \mc{29;2143} \\
\bottomrule
\addlinespace
\multicolumn{9}{@{}l}{\textit{Note}: $^{*}\ p<0.1$; $^{**}\ p<0.05$; $^{***}\ p<0.01$} \\
\end{longtable}
\endgroup
\end{document}
\LTleft
and\LTright
. Have to tried to use negative values there, e.g.,-1in
, because you've set the margin to1in
? Or if this should be the whole document, just try usingmagin=0in
instead ofmargin=1in
and see thegeometry
manual for more information.\LTleft
and\LTright
but nothing seems to happen ( also with huge neegative value). If I setmagin=0in
ingeometry
, only the upper margin is removed, while the left and right ones remain...\-
for coNnecting words in the first column? Usinglongtable
you need to compile document more than two times to get final look out.