我是 Latex 新手。我尝试过多次将我的表格调整为 [1]][1] 在横向页面上居中,但我的尝试没有成功。非常感谢您的帮助!
- 另外,如果你能说明一下这个命令行的用途
def\sym#1{\ifmmode^{#1}\else\(^{#1}\)\fi}
- 当我搜索类似问题时,我读到了关于这个 resizebox 或
\usepackage[strict]{changepage}
? 它们可以在这里使用吗?我不确定后者。 - 如何证明表格注释的合理性或改善其外观?PS:此表大约有两页长。这是一个最小的工作示例:
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{placeins}
\usepackage{float}
\usepackage{amsmath }
\usepackage{hyperref}
\usepackage{graphicx}
\graphicspath{ {images/} }
\usepackage{lscape}
\usepackage{pdflscape}
\usepackage{fancyhdr}
\usepackage[paper=portrait,pagesize]{typearea}
\usepackage{natbib}
\bibliographystyle{agsm}
\usepackage{longtable}
\newcommand{\etal}{\textit{et al.}}
\usepackage{amssymb}
\usepackage{array}
\setlength\extrarowheight{2pt}
\usepackage{booktabs}% http://ctan.org/pkg/booktabs
\usepackage{calc}% http://ctan.org/pkg/calc
\usepackage{amsfonts}
\begin{document}
\maketitle
\centering
{
\def\sym#1{\ifmmode^{#1}\else\(^{#1}\)\fi}
\begin{landscape}
\pagestyle{empty}
\centering\caption{Table 1).}
\centering\begin{longtable}{l*{6}{1}}
\toprule
\hline
&\multicolumn{1}{c}{(1)}&\multicolumn{1}{c}{(2)}&\multicolumn{1}{c}{(3)}&\multicolumn{1}{c}{(3)}&\multicolumn{1}{c}{(4)}\\
&\multicolumn{1}{c}{\textbf{Pooled probit}}&\multicolumn{1}{c}{\textbf{RE-probit}}&\multicolumn{1}{c}{\textbf{IV probit‘unweighted‘}}&\multicolumn{1}{c}{\textbf{IV probit}}&\multicolumn{1}{c}{\textbf{4 (2SLS)}}\\
\midrule
\hline
Simulated monthly benefit & -0.0166*** & -0.0177*** & -0.0154* & -0.0318 & -0.00794\\
p (v1, v2) & & & -.053^3 & -.049^1 \\
Wald test of exogeneity & & & 3.16^4 & 0.71^2 & \\
\hline\hline
\multicolumn{5}{p{\linewidth}}{{Pooled regression results (2018-2017) using SOEP v.36 based on the GETTSIM. T statistics in parentheses. All models show the MEs for the household heads at sample means and are weighted except Model 3'. Weighted values apply the SOEP cross-sectional sample weights. Model 1 uses robust standard errors. Producing the 2sls model, a partial out option is used. R2 for the 2SLS Model (0.243) and observations number is fixed for all models (N= 5400). Note that R2 is after partialling-out seven regressors, and the marginal effects dy/dx for factor levels is the discrete change from the base level. ρ (v1, v2) refers to the correlation between the error terms of the first and second stage equations. $^{1} std.err. =.058 $^{.2} \(Prob<chi2\) = 0.3998. $^{3}std.err. = .0296. $^{4} \(Prob<chi2\)= 0.0756.* \(p<0.05\), ** \(p<0.01\), *** \(p<0.001\)} \\
\end{longtable}
\end{landscape}
}
\end{center}
\end{document}
输出如下: [![在此处输入图片描述][2]][2]
谢谢![1]:https://i.stack.imgur.com/GPe16.png [2]:https://i.stack.imgur.com/EBcDG.png
答案1
删除\begin{center}
、\end{center}
和所有三个 [3!] 实例\centering
并应用相当多的代码修复后,我得到了以下结果。这就是您想要实现的吗?
顺便说一句,我不明白为什么您要使用longtable
而不是标准table
/tabular
组合。
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc} % <-- new
\usepackage{placeins}
\usepackage{float}
\usepackage{amsmath}
\DeclareMathOperator{\Prob}{Prob}
\usepackage{graphicx}
\graphicspath{ {images/} }
%%%\usepackage{lscape} % don't load both lscape and pdflscape
\usepackage{pdflscape}
\usepackage{fancyhdr}
\usepackage[paper=portrait,pagesize]{typearea}
\usepackage{natbib}
\bibliographystyle{agsm}
\newcommand{\etal}{\textit{et~al.}}
\usepackage{longtable}
\usepackage{amssymb}
\usepackage{array}
%%\setlength\extrarowheight{2pt}
\usepackage{booktabs}% http://ctan.org/pkg/booktabs
\usepackage{calc} % http://ctan.org/pkg/calc
%%\usepackage{amsfonts} % 'amsfonts' is loaded automatically by 'amssymb'
\newcommand\mc[1]{\multicolumn{1}{c}{#1}} % handy shortcut macro
\def\sym#1{\ifmmode^{#1}\else\(^{#1}\)\fi}
\usepackage{hyperref} % it's a good idea to load this package _last_
\begin{document}
\begin{landscape}
\pagestyle{empty}
% automatic math mode for columns 2 thru 6:
\begin{longtable}{@{} l *{5}{>{$}c<{$}} @{}}
\caption{Pooled regressions} \\
\toprule
&\mc{(1)} & \mc{(2)} & \mc{(3)} & \mc{($3'$)} & \mc{(4)} \\
&\mc{\textbf{Pooled probit}}
&\mc{\textbf{RE-probit}}
&\mc{\textbf{IV probit `unweighted'}}
&\mc{\textbf{IV probit}}
&\mc{\textbf{4 (2SLS)}}\\
\midrule
Simulated monthly benefit & -0.0166\sym{***} & -0.0177\sym{***} & -0.0154\sym{*} & -0.0318 & -0.00794\\
$\rho (v1, v2)$ & & & -.053\sym{3} & -.049\sym{1} \\
Wald test of exogeneity & & & 3.16\sym{4} & 0.71\sym{2} & \\
\midrule[\heavyrulewidth]
\multicolumn{6}{@{} p{\linewidth} @{}}{\small%
Pooled regression results (2018--2017) using SOEP v.36 based on the GETTSIM. $t$-statistics in parentheses. All models show the MEs for the household heads at sample means and are weighted except Model $3'$. Weighted values apply the SOEP cross-sectional sample weights. Model 1 uses robust standard errors. Producing the 2SLS model, a partial out option is used. R\textsuperscript{2} for the 2SLS Model (0.243) and observations number is fixed for all models ($N= 5400$). Note that R\textsuperscript{2} is after partialling-out seven regressors, and the marginal effects $dy/dx$ for factor levels is the discrete change from the base level.
\smallskip
$\rho (v1, v2)$ refers to the correlation between the error terms of the first and second stage equations.
\smallskip
\sym{1} std.err.\ = 0.058,
\sym{2} \(\Prob<\chi^2 = 0.3998\),
\sym{3} std.err.\ = 0.0296,
\sym{4} \(\Prob<\chi^2= 0.0756\).
\smallskip
\sym{*} \(p<0.05\), \sym{**} \(p<0.01\), \sym{***} \(p<0.001\).
} % end of '\multicolumn{6}{..}{...}` directive
\end{longtable}
\end{landscape}
\end{document}