首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Stargazer注释换行?

Stargazer注释换行?
EN

Stack Overflow用户
提问于 2014-02-12 14:24:49
回答 2查看 6.2K关注 0票数 11

有没有办法让stargazer中的notes换行,而不是跑出页面?

代码语言:javascript
复制
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?")

这会产生:

代码语言:javascript
复制
\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} 

我在手册里找不到任何可以调整这个的东西。

EN

回答 2

Stack Overflow用户

发布于 2014-02-18 05:16:13

notes参数接受字符串的向量,并将每个字符串放在新行上。在您的示例中,应执行以下操作:

代码语言:javascript
复制
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?"))
票数 12
EN

Stack Overflow用户

发布于 2019-12-02 07:58:21

我个人推荐一个更具Latex-y风格的解决方案。基本上,在tex文件中创建表格环境,添加标题等。然后,在表格环境中的小型页面环境中粘贴或\输入stargazer输出( float = FALSE),然后输入备注。

例如:

代码语言:javascript
复制
\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

发布一个完全可重现的例子也很有帮助。我知道这很古老,但这篇文章仍然出现在谷歌搜索中。

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/21720264

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档