11

有没有办法让notes观星者换行而不是跑出页面?

stargazer(fit.1, notes="A very very long note that I would like to put below the table, but currently runs off the side of the page when I compile my document. How do I get this to wrap into paragraph form?")

产生:

\hline \\[-1.8ex] 
\textit{Notes:} & \multicolumn{2}{l}{$^{*}$P $<$ .05} \\ 
 & \multicolumn{2}{l}{$^{**}$P $<$ .01} \\ 
 & \multicolumn{2}{l}{$^{***}$P $<$ .001} \\ 
 & \multicolumn{2}{l}{A very very long note that I would like to put below the table, but currently runs off the side of the page when I compile my document. How do I get this to wrap into paragraph form?} \\ 
\normalsize 
\end{tabular} 
\end{table} 

我在手册中找不到任何东西来调整它。

4

2 回答 2

12

notes参数接受一个字符串向量,并将每个字符串放在一个新行上。在您的示例中,以下内容应该有效:

stargazer(linear.1, notes=c("A very very long note that I would like to put below the table,",
                     "but currently runs off the side of the page",
                     "when I compile my document.",
                     "How do I get this to wrap into paragraph form?"))
于 2014-02-17T21:16:13.317 回答
2

我个人推荐更多的 Latex-y 解决方案。基本上,在您的 tex 文件中创建表格环境,添加标题等。然后,在表格环境中的 minipage 环境中粘贴或输入您的 stargazer 输出(使用 float = FALSE),然后是您的注释。

前任:

\documentclass{article}
\begin{document}

\begin{table}
    \caption{Your Caption}
    \begin{minipage}{0.85\textwidth} 
        \begin{tabular}{|l|l|l|}
            \hline
            999 & 888 & 777 \\
            \hline
        \end{tabular} 
    \\
    \\
{ \footnotesize  Note: A very very long note that I would like to put below the table, but currently runs off the side of the page when I compile my document. How do I get this to wrap into paragraph form? \par} 
    \end{minipage}
\end{table}    

\end{document}

产生:https ://i.stack.imgur.com/eCYy9.png

发布一个完全可重现的示例也很有帮助。我知道这已经很老了,但该帖子仍然出现在 Google 搜索中。

于 2019-12-01T23:58:20.583 回答