1

I want a table to be centered except I don't want the first column to be considered in the centering procedure. That is, I want columns 2 to N to be centered perfectly, and column 1 to be hanging off in the left margin.

I also want the table heading and text at the bottom of the table to be aligned with the 2nd column onwards (so clearly I don't want the heading/caption to begin from the left margin or the 1st column).

This is the table that I'm working with:

  \documentclass[a4paper,11pt]{article}
    \usepackage{color,amsmath,amsfonts,amssymb}
    \usepackage[english]{babel}
 \usepackage{graphicx}
 \usepackage{natbib}
 \usepackage{rotating}
 \usepackage{colortbl}
 \usepackage{booktabs,dcolumn,caption}
 \usepackage{expdlist}  %expanded list environment
 \usepackage{pdflscape} %landscape single pages
 \usepackage{lscape}
 \usepackage{longtable} %multipage table
 \usepackage{setspace} %for \singlespacing
 \usepackage{pdfpages} %For slides

 \usepackage[margin=1in]{geometry}
 \usepackage{setspace}
 \setstretch{1}

 \captionsetup{labelsep=newline,singlelinecheck=false} % optional
 \newcolumntype{d}[1]{D{.}{.}{#1}} % "decimal" column type
 \renewcommand{\ast}{{}^{\textstyle *}} % for raised "asterisks"
 \newcommand{\aast}{\ensuremath{{}^{\textstyle **}}}
 \newcommand{\aaast}{\ensuremath{{}^{\textstyle *}}}
 \newcommand{\kon}{\ensuremath{{}^{\textstyle ?}}}  %DELETE

 \newcommand{\C}[1]{\multicolumn{1}{c}{#1}} % abbreviations


 \newcommand\Ya{\C{Yes}}
 \newcommand\Yb{\C{Yes\aaast}}
 \newcommand\Yc{\C{Yes\aast}}
 \newcommand\Yk{\C{Yes\kon}} %DELETE

 \setlength{\LTleft}{0pt}
 \setlength{\LTright}{0pt} %full margins

 \oddsidemargin 0.5cm %
 \evensidemargin 0.5cm %
 \textwidth 15cm %
 \topmargin  -0.2in  %
 \textheight 23.5cm %
 \headheight 15pt %


 \doublerulesep2pt



 \begin{document}
 \renewcommand{\baselinestretch}{1.1}

 \fontsize{11}{16pt} \selectfont

 \footnotesize
 %%\begin{mdframed}[backgroundcolor=Gray,hidealllines=true]
 \noindent
 \begin{longtable}{@{} ll @{\extracolsep{\fill}} *{9}{d{5}} @{}}
 \caption{TABLE HEADING....} \\
 \cmidrule[\heavyrulewidth]{2-11}
 & & \multicolumn{9}{c}{Insert formula here} \\
 \cmidrule{3-11}
 & &  \multicolumn{1}{c}{0.1}
 &  \multicolumn{1}{c}{0.1}
 &  \multicolumn{1}{c}{0.1}
 &  \multicolumn{1}{c}{0.1}
 &  \multicolumn{1}{c}{0.1}
 &  \multicolumn{1}{c}{0.1}
 &  \multicolumn{1}{c}{0.1}
 &  \multicolumn{1}{c}{0.1}
 &  \multicolumn{1}{c}{0.1} \\
 \cmidrule{2-11}
 \endfirsthead
 \multicolumn{2}{@{}l}{\emph{(continued)}} \\
 \cmidrule[\heavyrulewidth]{2-11}
 & & \multicolumn{9}{c}{$\tau$} \\
 \cmidrule{3-11}
 & &  \multicolumn{1}{c}{0.1}
 &  \multicolumn{1}{c}{0.1}
 &  \multicolumn{1}{c}{0.1}
 &  \multicolumn{1}{c}{0.1}
 &  \multicolumn{1}{c}{0.1}
 &  \multicolumn{1}{c}{0.1}
 &  \multicolumn{1}{c}{0.1}
 &  \multicolumn{1}{c}{0.1}
 &  \multicolumn{1}{c}{0.1} \\
 \cmidrule{2-11}
 \endhead
 \cmidrule[\heavyrulewidth]{2-11}
 \multicolumn{5}{r@{}}{\emph{(continued)}}
 \endfoot
 \cmidrule[\heavyrulewidth]{2-11}
 \endlastfoot
 & \textbf{Subheading} \\
 & Indic  & -0.020\aast & 0.020 & 0.020\aast & -0.020 & (0.020) & (0.020) & (0.020) & (0.020) & (0.020) \\
 $\beta(\gamma)$ & Indic      \\
 $\gamma(\gamma)$ &    \\
 $\beta(\gamma)$ & Indic      \\
 $\gamma(\gamma)$ &    \\
 & Indic\textrm{   }  \\
 \end{longtable}

 \noindent
 \vspace{-0.8cm}

 {\noindent ASDOJSADIOJDAID}

 \end{document}
2

Something like this

enter image description here

basically put the first column entries in \llap so they stick out and that column takes no width. Also don't use \noindent before/after longtable. unlike its use with tabular it just generates an empty paragraph.

\documentclass[a4paper,11pt]{article}
    \usepackage{color,amsmath,amsfonts,amssymb}
    \usepackage[english]{babel}
 \usepackage{graphicx}
 \usepackage{natbib}
 \usepackage{rotating}
 \usepackage{colortbl}
 \usepackage{booktabs,dcolumn,caption}
 \usepackage{expdlist}  %expanded list environment
 \usepackage{pdflscape} %landscape single pages
 \usepackage{lscape}
 \usepackage{longtable} %multipage table
 \usepackage{setspace} %for \singlespacing
 \usepackage{pdfpages} %For slides

 \usepackage[margin=1in]{geometry}
 \usepackage{setspace}
 \setstretch{1}

 \captionsetup{labelsep=newline,singlelinecheck=false} % optional
 \newcolumntype{d}[1]{D{.}{.}{#1}} % "decimal" column type
 \renewcommand{\ast}{{}^{\textstyle *}} % for raised "asterisks"
 \newcommand{\aast}{\ensuremath{{}^{\textstyle **}}}
 \newcommand{\aaast}{\ensuremath{{}^{\textstyle *}}}
 \newcommand{\kon}{\ensuremath{{}^{\textstyle ?}}}  %DELETE

 \newcommand{\C}[1]{\multicolumn{1}{c}{#1}} % abbreviations


 \newcommand\Ya{\C{Yes}}
 \newcommand\Yb{\C{Yes\aaast}}
 \newcommand\Yc{\C{Yes\aast}}
 \newcommand\Yk{\C{Yes\kon}} %DELETE

 \setlength{\LTleft}{0pt}
 \setlength{\LTright}{0pt} %full margins

 \oddsidemargin 0.5cm %
 \evensidemargin 0.5cm %
 \textwidth 15cm %
 \topmargin  -0.2in  %
 \textheight 23.5cm %
 \headheight 15pt %


 \doublerulesep2pt

 \def\lcol#1\relax{\llap{#1\kern\marginparsep}}

 \begin{document}
 \renewcommand{\baselinestretch}{1.1}

 \fontsize{11}{16pt} \selectfont

 \footnotesize
 %%\begin{mdframed}[backgroundcolor=Gray,hidealllines=true]

 \begin{longtable}{@{}>{\lcol}l<{\relax}@{}l@{\extracolsep{\fill}} *{9}{d{5}} @{}}
 \caption{TABLE HEADING....} \\
 \cmidrule[\heavyrulewidth]{2-11}
 & & \multicolumn{9}{c}{Insert formula here} \\
 \cmidrule{3-11}
 & &  \multicolumn{1}{c}{0.1}
 &  \multicolumn{1}{c}{0.1}
 &  \multicolumn{1}{c}{0.1}
 &  \multicolumn{1}{c}{0.1}
 &  \multicolumn{1}{c}{0.1}
 &  \multicolumn{1}{c}{0.1}
 &  \multicolumn{1}{c}{0.1}
 &  \multicolumn{1}{c}{0.1}
 &  \multicolumn{1}{c}{0.1} \\
 \cmidrule{2-11}
 \endfirsthead
 \multicolumn{2}{@{}l}{\emph{(continued)}} \\
 \cmidrule[\heavyrulewidth]{2-11}
 & & \multicolumn{9}{c}{$\tau$} \\
 \cmidrule{3-11}
 & &  \multicolumn{1}{c}{0.1}
 &  \multicolumn{1}{c}{0.1}
 &  \multicolumn{1}{c}{0.1}
 &  \multicolumn{1}{c}{0.1}
 &  \multicolumn{1}{c}{0.1}
 &  \multicolumn{1}{c}{0.1}
 &  \multicolumn{1}{c}{0.1}
 &  \multicolumn{1}{c}{0.1}
 &  \multicolumn{1}{c}{0.1} \\
 \cmidrule{2-11}
 \endhead
 \cmidrule[\heavyrulewidth]{2-11}
 \multicolumn{5}{r@{}}{\emph{(continued)}}
 \endfoot
 \cmidrule[\heavyrulewidth]{2-11}
 \endlastfoot
 & \textbf{Subheading} \\
 & Indic  & -0.020\aast & 0.020 & 0.020\aast & -0.020 & (0.020) & (0.020) & (0.020) & (0.020) & (0.020) \\
 $\beta(\gamma)$ & Indic      \\
 $\gamma(\gamma)$ &    \\
 $\beta(\gamma)$ & Indic      \\
 $\gamma(\gamma)$ &    \\
 & Indic\textrm{   }  \\
 \end{longtable}




 {\noindent ASDOJSADIOJDAID}

 \end{document}
  • Any idea on how to get the "Table 6", heading and text at the bottom to align with columns {2,...,N}? If I receive no response from you in the next few hours I'll give you the correct answer. Thanks. – user16208 Aug 11 '12 at 4:24
  • oops sorry it is out by \marginparsep I put the close brace in the wrong place. \def\lcol#1\relax{\llap{#1\kern\marginparsep}} – David Carlisle Aug 11 '12 at 9:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy