¿Ajuste de línea de notas de Stargazer?

¿Hay alguna manera de conseguir notes in stargazer to wrap lines instead of running off the page?

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

Que produce:

\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} 

I couldn't find anything in the manual for adjusting this.

preguntado el 12 de febrero de 14 a las 06:02

A quick fix is to use a parbox que se vería así: notes="\\parbox[t]{10cm}{Very long note goes here.}" but may require manual changes if you adjust the models. -

2 Respuestas

La notes argument accepts a vector of character strings, and will put each on a new line. In your example, the following should work:

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

Respondido 17 Feb 14, 21:02

It would be great if a future version of stargazer would put every such element of the vector into its own parbox as per Bryan's comment above. Breaking lines manually seems inelegant at the very least. - RoyalTS

Thanks, will consider. - user1953965

@user1953965 I would also prefer a function to wrap lines automatically, breaking lines does not really produce a beautiful table - bretauv

I personally recommend a more Latex-y solution. Basically, create the table environment in your tex file, add caption etc. Then, paste or \input your stargazer output (with float = FALSE) in a minipage environment within the table environment, followed by your notes.

por ejemplo:

\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}

produce: https://i.stack.imgur.com/eCYy9.png

It's helpful to post a fully reproducible example as well. I know this is very old but the post still shows up in Google searches.

Respondido el 03 de junio de 20 a las 22:06

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.