Closed ccamara closed 2 years ago
I think this happens because some LaTeX packages are missing in the template, but required if you use Pandoc's grid table syntax. The Visual will use Grid tables in some cases.
This should work by adding this in your YAML header
output:
rticles::elsevier_article:
extra_dependencies:
- array
- calc
Can you try ?
For the context, this is required because Pandoc will convert the grid table Markdown to a LaTeX syntax using those packages' functions.
We may need to add them into all our template to make them work with grid_tables
. However, some editor does not allow to add other packages than those expected so it is not easy for us to know when to add them automatically or not.
Thank you very much, @cderv !
Simply adding those extra dependencies in the yaml worked! (Sorry, I'm not familiar at all with Latex -that's why I'm using this package)
I'll reopen because I think it would be better to add them into the template.
Great! Thank you again and sorry for the inconvenience.
@ccamara This should be fine now with dev version of rticles
remotes::install_github("rstudio/rticles")
Thanks!
Thank you very much @cderv!
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.
Documents with tables and long texts created with Rstudio's visual editor cause the following error when running knitr and using elsevier template:
The offending table, created with visual editor has this format:
See
xfun::session_info('rticles')
output:And the entire document:
Markdown Table
This table is also rendered:
: Table using Visual mardkwon editor
This table, on the contrary, is not. Please note the different formatting:
+----------+--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------+ | Column 1 | Column 2 | Column 3 | +==========+====================================================================+========================================================================================================+ | Cell 1.1 | This is a very, very, long text that does not fit in a single line | And this is also a very very (even longer, maybe) text that makes it difficult to fit in a single line | +----------+--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------+ | Cell 1.2 | | | +----------+--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------+ | Cell 1.3 | | | +----------+--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------+
: The offending tables