Closed xhie closed 6 years ago
FWIW, I got this working by modifying the kable call to include:
kable(..., format = "latex" )
without adding a preamble: >
or tables: true
statement into the yaml headers.
I'd still like to use booktabs = TRUE
, which does not work yet and may require an alternative header statement in the yaml. preamble: > \usepackage{booktabs}
does not seem to work.
Actually: Using
output:
rticles::acm_article:
citation_package: natbib
keep_tex: true
number_sections: true
Then examining the .tex file, it appears rticles (at least acm) does not respect citation_package
, preamble:
, header-includes:
or
includes:
in_header: mystyles.sty
Hi, I'm getting the same error message. I'm trying to draw a table with text. The following table is fine in an rmd file with output: pdf_document
at the top, but gives the error in when I specify output: rticles::rjournal_article
.
feature | header 1 | header 2
---------- | ----------- | ---------
w | h | y
| |
@ehrlinger , it sounds like you found a solution, but I don't quite understand it. I'm not familiar with many advanced features of RMarkdown. Can you explain this at a more basic level? Or can anyone else suggest a solution?
I managed to get the table into my document by writing it in LaTeX code since that's what the output of kable(..., format = "latex" )
would look like and you said that would work. So at least there's a workaround :)
Using in_header
under includes
should be a universal solution to the problem of failing to include a LaTeX package, e.g.,
output:
rticles::acm_article:
includes:
in_header: preamble.tex
In preamble.tex
, you can load any LaTeX packaegs (e.g., \usepackage{longtable}
).
Note that I said this was a universal solution, so it is not limited to rticles::acm_article
, and should apply to any LaTeX-based output formats. See Section 3.3.7.3: https://bookdown.org/yihui/rmarkdown/pdf-document.html
Any idea on fill color for cell in longtable environment? I
This old thread has been automatically locked. If you think you have found something related to this, please open a new issue by following the issue guide (https://yihui.org/issue/), and link to this old issue if necessary.
I'm using the ACS template and it can compile a simple markdown table. This is the error from rmarkdown :
And the latex table is:
Thanks