Latex 尝试将表向左移动,但失败

Latex 尝试将表向左移动,但失败,latex,tex,Latex,Tex,我试图将我的表重新定位到页面左侧,因此我尝试\hskip-2cm或\hspace{-2cm},但这些都不能移动表,下面是我的代码: \documentclass{article} \usepackage[utf8]{inputenc} \usepackage{float} \usepackage{array} \usepackage{booktabs,caption} \usepackage[flushleft]{threeparttable} \usepackage{indentfirst}

我试图将我的表重新定位到页面左侧,因此我尝试
\hskip-2cm
\hspace{-2cm}
,但这些都不能移动表,下面是我的代码:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{float}
\usepackage{array}
\usepackage{booktabs,caption}
\usepackage[flushleft]{threeparttable}
\usepackage{indentfirst}
\setlength\extrarowheight{2pt}


\title{}
\author{}


\begin{document}


\maketitle
\section{Introduction}



\section{Data Summary}





\begin{table}[H]
\begin{threeparttable}
\small

\def\sym#1{\ifmmode^{#1}\else\(^{#1}\)\fi}
\hskip -2cm
\caption{Summary of numeric variables}

\begin{tabular}{l*{1}{ccccc}}
\hline\hline
                    &\multicolumn{5}{c}{(1)}                                         \\
                    &\multicolumn{5}{c}{}                                            \\
                    &       count&        mean&          sd&         min&         max\\
\hline
Unemployment Rate   &         170&      8.3323&      4.1395&      3.1000&     26.0919\\
log of spending per person for secondary education&         168&      9.0229&      0.4344&      7.6109&      9.9616\\
log of spending per person for teriary education&         165&      9.5241&      0.3967&      8.7797&     10.7478\\
log of exchange rate&         170&      1.0983&      2.0997&     -0.4986&      7.0522\\
log of GDP per person&         168&     10.5306&      0.3592&      9.7330&     11.5213\\
log of GDP fixed purchasing power&         165&     27.0045&      1.4905&     23.3668&     30.5051\\
log of GDP growth   &         159&      1.2268&      0.7896&     -1.7458&      3.0063\\
Long-term interest rate on government bonds&         165&      3.8447&      2.1387&      0.5511&     10.5465\\
Short-term interest rate&         170&      1.7675&      1.9971&      0.0078&     10.3317\\
\hline\hline
\end{tabular}
\begin{tablenotes}
\small
\item Source: OECD (2019), Education at a Glance Database, http://stats.oecd.org
\end{tablenotes}
\end{threeparttable}
\end{table}


\section{Methodology}

\end{document}
我的桌子是这样的:

我想让我的桌子离开至少1.5厘米。
有没有其他方法可以做到这一点?

对于没有专门设计在页边距中留出额外空间的布局来说,将表格投影到页边距中不是一种好的样式。页边空白应该属于读者,以便读者轻松地保存文档、添加注释等。如果没有足够的空间,像Fermat的最后一个定理之类的东西都是你的错:)

相反,我建议使用
表格
将表格放入可用空间:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{float}
\usepackage{array}
\usepackage{booktabs,caption}
\usepackage[flushleft]{threeparttable}
\usepackage{indentfirst}
\setlength\extrarowheight{2pt}
\usepackage{tabularx}
\usepackage{siunitx}


\title{}
\author{}


\begin{document}


\maketitle
\section{Introduction}



\section{Data Summary}





\begin{table}[H]
\begin{threeparttable}
\small

\def\sym#1{\ifmmode^{#1}\else\(^{#1}\)\fi}
\hskip -2cm
\caption{Summary of numeric variables}
\begin{tabularx}{\linewidth}{@{}XS[table-format=3.0]S[table-format=2.4]S[table-format=1.4]S[table-format=-1.4]S[table-format=2.4]@{}}
\toprule
                    &\multicolumn{5}{c}{(1)}                                        \\\addlinespace 
                    &       {count}&        {mean}&          {sd}&         {min}&         {max}\\
\midrule
Unemployment Rate   &         170&      8.3323&      4.1395&      3.1000&     26.0919\\
log of spending per person for secondary education&         168&      9.0229&      0.4344&      7.6109&      9.9616\\
log of spending per person for teriary education&         165&      9.5241&      0.3967&      8.7797&     10.7478\\
log of exchange rate&         170&      1.0983&      2.0997&     -0.4986&      7.0522\\
log of GDP per person&         168&     10.5306&      0.3592&      9.7330&     11.5213\\
log of GDP fixed purchasing power&         165&     27.0045&      1.4905&     23.3668&     30.5051\\
log of GDP growth   &         159&      1.2268&      0.7896&     -1.7458&      3.0063\\
Long-term interest rate on government bonds&         165&      3.8447&      2.1387&      0.5511&     10.5465\\
Short-term interest rate&         170&      1.7675&      1.9971&      0.0078&     10.3317\\
\bottomrule
\end{tabularx}
\begin{tablenotes}
\small
\item Source: OECD (2019), Education at a Glance Database, http://stats.oecd.org
\end{tablenotes}
\end{threeparttable}
\end{table}


\section{Methodology}

\end{document}

其他一些评论:

  • 尽量避免
    [H]
    ,这通常是浮子放置不理想的保证。我建议改为
    [htbp]

  • *{1}{ccccccc}
    可以短接到
    ccccc
    *{5}{c}

  • 您已经加载了
    booktabs
    包,因此我建议使用
    \toprule
    \midrule
    \bottomrule
    而不是
    \hline
    ,因为它们周围的间距要大得多

  • 我建议使用
    booktabs
    包中的
    \addlinespace
    宏,而不是手动在表中添加空行

  • 使用
    siunitx
    软件包中的
    S
    列,您可以按十进制标记对齐数字,并使用实际减号,而不是连字符作弊

  • 你应该检查你的价值观的有效数字。如果标准偏差介于0.3和4.1之间,则用4位小数表示数值是没有意义的


对于没有专门设计在页边空白处留出额外空间的布局,将表格投影到页边空白处不是一种好的样式。页边空白应该属于读者,以便读者轻松地保存文档、添加注释等。如果没有足够的空间,像Fermat的最后一个定理之类的东西都是你的错:)

相反,我建议使用
表格
将表格放入可用空间:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{float}
\usepackage{array}
\usepackage{booktabs,caption}
\usepackage[flushleft]{threeparttable}
\usepackage{indentfirst}
\setlength\extrarowheight{2pt}
\usepackage{tabularx}
\usepackage{siunitx}


\title{}
\author{}


\begin{document}


\maketitle
\section{Introduction}



\section{Data Summary}





\begin{table}[H]
\begin{threeparttable}
\small

\def\sym#1{\ifmmode^{#1}\else\(^{#1}\)\fi}
\hskip -2cm
\caption{Summary of numeric variables}
\begin{tabularx}{\linewidth}{@{}XS[table-format=3.0]S[table-format=2.4]S[table-format=1.4]S[table-format=-1.4]S[table-format=2.4]@{}}
\toprule
                    &\multicolumn{5}{c}{(1)}                                        \\\addlinespace 
                    &       {count}&        {mean}&          {sd}&         {min}&         {max}\\
\midrule
Unemployment Rate   &         170&      8.3323&      4.1395&      3.1000&     26.0919\\
log of spending per person for secondary education&         168&      9.0229&      0.4344&      7.6109&      9.9616\\
log of spending per person for teriary education&         165&      9.5241&      0.3967&      8.7797&     10.7478\\
log of exchange rate&         170&      1.0983&      2.0997&     -0.4986&      7.0522\\
log of GDP per person&         168&     10.5306&      0.3592&      9.7330&     11.5213\\
log of GDP fixed purchasing power&         165&     27.0045&      1.4905&     23.3668&     30.5051\\
log of GDP growth   &         159&      1.2268&      0.7896&     -1.7458&      3.0063\\
Long-term interest rate on government bonds&         165&      3.8447&      2.1387&      0.5511&     10.5465\\
Short-term interest rate&         170&      1.7675&      1.9971&      0.0078&     10.3317\\
\bottomrule
\end{tabularx}
\begin{tablenotes}
\small
\item Source: OECD (2019), Education at a Glance Database, http://stats.oecd.org
\end{tablenotes}
\end{threeparttable}
\end{table}


\section{Methodology}

\end{document}

其他一些评论:

  • 尽量避免
    [H]
    ,这通常是浮子放置不理想的保证。我建议改为
    [htbp]

  • *{1}{ccccccc}
    可以短接到
    ccccc
    *{5}{c}

  • 您已经加载了
    booktabs
    包,因此我建议使用
    \toprule
    \midrule
    \bottomrule
    而不是
    \hline
    ,因为它们周围的间距要大得多

  • 我建议使用
    booktabs
    包中的
    \addlinespace
    宏,而不是手动在表中添加空行

  • 使用
    siunitx
    软件包中的
    S
    列,您可以按十进制标记对齐数字,并使用实际减号,而不是连字符作弊

  • 你应该检查你的价值观的有效数字。如果标准偏差介于0.3和4.1之间,则用4位小数表示数值是没有意义的


“将表格投影到页边空白处不是一种好的风格”-为什么?在排版精美的材料中,至少偶尔可以看到将宽桌子和图形投影到外缘的情况,这是非常有效的。当然,你的桌子看起来也不错。@KonradRudolph好的,我的说法可能有点太笼统了。如果文本相对较窄,页边空白已经考虑了表格/图表的额外空间,那么它看起来会很不错(我想到的是经典论文类),但对于文章类的正常页面布局来说就不是了。在这里,我认为页边空白是读者容易掌握的文件,也可能是注释。[HTBP ]和[H]之间有什么不同。我尝试了不同的位置,发现[h]的意思不同too@W.Yan
[htbp]
意味着latex将尝试在此处插入表格,即在文本中表格所在的位置,如果该位置没有足够的空间(例如,因为您位于页面末尾),它将把表格移动到下一页的顶部,如果真的没有更好的解决方案,则在页面底部或单独的页面。H是浮动包中的一个特殊选项,比H更严格。如果没有足够的空间在这里插入您的桌子,它将添加尽可能多的不必要的空白,以便将桌子挤进去。这可能非常难看。“将表格投影到页边空白处不是一种好的样式”-为什么?在排版精美的材料中,至少偶尔可以看到将宽桌子和图形投影到外缘的情况,这是非常有效的。当然,你的桌子看起来也不错。@KonradRudolph好的,我的说法可能有点太笼统了。如果文本相对较窄,页边空白已经考虑了表格/图表的额外空间,那么它看起来会很不错(我想到的是经典论文类),但对于文章类的正常页面布局来说就不是了。在这里,我认为页边空白是读者容易掌握的文件,也可能是注释。[HTBP ]和[H]之间有什么不同。我尝试了不同的位置,发现[h]的意思不同too@W.Yan
[htbp]
意味着latex将尝试在此处插入表格,即在文本中表格所在的位置,如果该位置没有足够的空间(例如,因为您位于页面末尾),它将把表格移动到下一页的顶部,如果真的没有更好的解决方案,则在页面底部或单独的页面。H是浮动包中的一个特殊选项,比H更严格。如果没有