"Error: \ caption outside float" in R Markdown

1

When I try to compile my Markdown R code, I get the following error:

  

! Package caption Error: \ caption outside float.

     

See the package documentation for explanation. Type H     for immediate help.
  ...
  l.336 \ caption

     

pandoc.exe: Error producing PDF Error: pandoc document conversion   failed with error 43 Additionally: Warning message: executing the command   '"C: / Users / araujoic / AppData / Local / Pandoc / pandoc" + RTS -K512m -RTS   rmarkdown.utf8.md --to latex --from   markdown + autolink_bare_uris + ascii_identifiers + tex_math_single_backslash   --output rmarkdown.pdf --template "C: \ Users \ araujoic \ Documents \ R \ win-library \ 3.4 \ rmarkdown \ rmd \ latex \ default-1.17.0.2.tex"   --highlight-style tango --latex-engine pdflatex --variable graphics = yes --include-in-header   "C: \ Users \ araujoic \ AppData \ Local \ Temp \ RtmpQXmi4e \ file21b83d93844" '   had status 43 Execution stopped

How can I resolve it?

    
asked by anonymous 19.09.2017 / 22:01

1 answer

2

You need to use a \caption{} within an environment of tables (\being{table} ... \end{table} or figures \begin{figure} ... \end{figure} .

Otherwise, you will have trouble compiling.

    
25.10.2018 / 17:30