我不明白为什么如果我将以下代码生成的表格缩小(使用 \tiny),表格会变小并保持居中,
\begin{table}
\tiny
\begin{threeparttable}
\caption{Participant Characteristics}
\label{tab:key}
\begin{tabularx}{\linewidth}{@{}>{\raggedright\arraybackslash\hangindent=6pt}X r@{\;}l r@{\;}l S[table-format=1.3]@{}}
\toprule
\thead[bl]{Variables}
& \multicolumn{2}{c}{\thead[b]{More \\experienced \\ investors}}
& \multicolumn{2}{c}{\thead[b]{Less \\experienced \\ investors}}
& {\thead[b]{P-Value\tnote{*}}}\\
\midrule
Percentage who had
previously invested in
the stock market
& \multicolumn{2}{c}{78.50\%} & \multicolumn{2}{c}{36.78\%} & .001 \\
Years of business work
experience
& 6.35 & (6.00) & 1.28 & (2.14) & .001 \\
Age
& 30.46 & (5.83) & 20.11 & (2.67) & .001 \\
Number of courses taken
that discussed investing
in mutual funds or the
stock market
& 1.58 & (1.70) & .95 & (1.16) & .001 \\
Familiarity with mutual
funds (1 = not at all
familiar, 7 = very
familiar)
& 4.59 & (1.61) & 3.63 & (4.96) & .011 \\
Importance in investing in
mutual funds or the
stock market (1 = not
at all important, 7 =
very important)
& 5.61 & (1.39) & 5.24 & (1.31) & .016 \\
Peers' views of investing
in mutual funds or the
stock market (1 = not
at all desirable, 7 =
very desirable) & 5.14 & (1.26) & 4.64 & (1.71) & .009 \\
\bottomrule
\end{tabularx}
\begin{tablenotes}[flushleft]
\small
\item[*] All tests are t-tests (one-tailed) except for the percentage investing, which is a chi-square test.
\end{tablenotes}
\end{threeparttable}
\end{table}
而如果我使用以下代码生成的表格来执行此操作
\begin{table}
\tiny
\begin{tabular}{ l l l l l l }
\toprule
\multirow{3}*{Model} & \multicolumn{2}{l}{Unstandardized} & Standardized & & \\
& \multicolumn{2}{l}{Coefficients} & \multicolumn{1}{l}{Coefficients} & t & sig\\
\cmidrule(lr){2-4}
& B & Std. Error & Beta & & \\
\midrule
(Constant) & 30,757 & 6,188 & & 4,971 & ,000\\
Interest Rate & ,392 & ,129 & ,519 & 3,031 & ,004\\
Exchange Rate & 3,331 & ,618 & ,663 & ,663 & ,000\\
\bottomrule
\end{tabular}
\begin{tablenotes}[flushleft]\small
\item[*] \textit{a. Dependent Variable: Investation}
\end{tablenotes}
\end{table}
表格变小了,但向左移动。我希望它保持居中。
此外,我想在第二个表格的顶部放置一个标题(第一个表格使用 \caption 完成),但是在第二个表格中使用 \caption 得到的标题太靠近表格本身。
第一个表的代码由 leandriis 编写(重现一个表格(使用表格?))。
欢迎任何建议。
平均能量损失
\documentclass{book}
\usepackage{graphicx}
\graphicspath{ {./images/} }
\usepackage{multirow}
\usepackage{booktabs} % horizontal lines, such as \toprule, \midrule and \bottomrule
\usepackage{tabularx} % tabularx environment
\usepackage{siunitx} % S type columns to improve alignment of numbers
\usepackage{threeparttable} % tablenotes environment and \tnote commend
\usepackage{makecell} % \thead command for column headers with manual line breaks
\usepackage[T1]{fontenc}
\usepackage[latin1]{inputenc}
\usepackage[english]{babel}
\begin{document}
\begin{center}
\begin{table}
\tiny
\begin{threeparttable}
\caption{Participant Characteristics}
\label{tab:key}
\begin{tabularx}{\linewidth}{@{}>{\raggedright\arraybackslash\hangindent=6pt}X r@{\;}l r@{\;}l S[table-format=1.3]@{}}
\toprule
\thead[bl]{Variables}
& \multicolumn{2}{c}{\thead[b]{More \\experienced \\ investors}}
& \multicolumn{2}{c}{\thead[b]{Less \\experienced \\ investors}}
& {\thead[b]{P-Value\tnote{*}}}\\
\midrule
Percentage who had
previously invested in
the stock market
& \multicolumn{2}{c}{78.50\%} & \multicolumn{2}{c}{36.78\%} & .001 \\
Years of business work
experience
& 6.35 & (6.00) & 1.28 & (2.14) & .001 \\
Age
& 30.46 & (5.83) & 20.11 & (2.67) & .001 \\
Number of courses taken
that discussed investing
in mutual funds or the
stock market
& 1.58 & (1.70) & .95 & (1.16) & .001 \\
Familiarity with mutual
funds (1 = not at all
familiar, 7 = very
familiar)
& 4.59 & (1.61) & 3.63 & (4.96) & .011 \\
Importance in investing in
mutual funds or the
stock market (1 = not
at all important, 7 =
very important)
& 5.61 & (1.39) & 5.24 & (1.31) & .016 \\
Peers' views of investing
in mutual funds or the
stock market (1 = not
at all desirable, 7 =
very desirable) & 5.14 & (1.26) & 4.64 & (1.71) & .009 \\
\bottomrule
\end{tabularx}
\begin{tablenotes}[flushleft]
\small
\item[*] All tests are t-tests (one-tailed) except for the percentage investing, which is a chi-square test.
\end{tablenotes}
\end{threeparttable}
\end{table}
%\begin{tabular}{lccc}
%
%\toprule
%\multirow{2}*{Elemento} & \multicolumn{3}{c}{Strati} \\
%\cmidrule(lr){2-4}
%& K & L & M \\
%\midrule
%idrogeno & $1$ & & \\
%litio & $2$ & $1$ & \\
%sodio & $2$ & $8$ & $1$ \\
%\bottomrule
%\end{tabular}
%\begin{tabular}{lcccll}
%
%\toprule
%
% \multirow{3}*{Model} & \multicolumn{3}{c}{Unstandardized Coefficients} & t & sign\\
%
% \cmidrule(lr){2-4}
% & B & Std. Error & Beta \\
%
% \midrule
% (Constant) & 30,757 & 6,188 & & 4,971 & ,000\\
% Interest Rate & ,392 & ,129 & ,519 & 3,031 & ,004\\
% Exchange Rate & 3,331 & ,618 & ,663 & ,663 & ,000\\
%
%\bottomrule
%\end{tabular}
\begin{table}
\tiny
%\caption{t test results.}
\begin{tabular}{ l l l l l l }
\toprule
\multirow{3}*{Model} & \multicolumn{2}{l}{Unstandardized} & Standardized & & \\
& \multicolumn{2}{l}{Coefficients} & \multicolumn{1}{l}{Coefficients} & t & sig\\
\cmidrule(lr){2-4}
& B & Std. Error & Beta & & \\
\midrule
(Constant) & 30,757 & 6,188 & & 4,971 & ,000\\
Interest Rate & ,392 & ,129 & ,519 & 3,031 & ,004\\
Exchange Rate & 3,331 & ,618 & ,663 & ,663 & ,000\\
\bottomrule
\end{tabular}
\begin{tablenotes}[flushleft]\small
\item[*] \textit{a. Dependent Variable: Investation}
\end{tablenotes}
\end{table}
\end{center}
%\begin{center}
%
%\begin{table}
%\tiny
%\begin{tabular}{lccccc}
%\toprule
%Panel A: Percentage of Participants Willing to Invest in Mutual Funds\\
% & Small Set Condition2 & Large Set Condition2 & Difference & Chi-Square & P-Value \\
%\midrule
%forza & $F$ & newton \\
%energia & $E$ & joule \\
%tensione & $V$ & volt \\
%\bottomrule
%\end{tabular}
%
%\end{table}
%
%\end{center}
\end{document}