5

In LaTeX, a short captions (that will appear in the List of Figures) can be made with the following code:

  \caption[Short caption.]{Long caption.}

With stargazer in R I tried this:

stargazer(mtcars, summary = FALSE, title="[Short caption]Long caption")

Which produces this output for the captions:

  \caption{[Short caption]Long caption} 

How can I make a short caption with stargazer?

luciano
  • 13,158
  • 36
  • 90
  • 130
  • There's no update to this? I tried to file an issue to the package's author, but the package doesn't seem to be on github... – Heisenberg Jun 24 '15 at 07:38
  • 2
    @Heisenberg see here for workaround: http://stackoverflow.com/questions/31087731/capture-r-output-and-replace-with-latex-code – luciano Jun 28 '15 at 07:44

1 Answers1

0

Using stargazer you can to disable it's float option. Nesting the stargazer chunk in a manually provided table environment then lets you customize any captions or labels manually, i.e.

\begin{table}
\caption[Short caption]{The main caption of the table.}
\label{tab:mtcars}
\centering

<<results="asis",echo=F>>=
stargazer(mtcars[1:5, 1:3], summary = FALSE,float=F)
@

\end{table}
AndB
  • 181
  • 4