我希望表格居中,但我不想在居中过程中考虑第一列。也就是说,我希望第 2 列到第 N 列完全居中,第 1 列悬在左边距。
我还希望表格标题和表格底部的文本与第二列及以后的列对齐(所以显然我不希望标题/标题从左边距或第一列开始)。
这是我正在使用的表格:
\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}
答案1
像这样
基本上将第一列条目放入\llap
,使它们突出,并且该列不占用宽度。另外不要使用\noindent
before/after longtable
。与使用 with 不同,tabular
它只会生成一个空段落。
\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}