观星者注意线条包裹?

时间:2014-02-12 06:24:49

标签: r latex stargazer

有没有办法让stargazer中的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} 

我在手册中找不到任何调整此内容的内容。

2 个答案:

答案 0 :(得分:9)

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?"))

答案 1 :(得分:1)

我个人建议使用更乳胶的解决方案。基本上,在tex文件中创建表环境,添加标题等。然后,在表环境中的小型页面环境中粘贴或\输入您的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搜索中。

相关问题