Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can I use preamble.tex with R Journal template? #257

Closed
3 tasks done
agila5 opened this issue Nov 21, 2019 · 4 comments
Closed
3 tasks done

How can I use preamble.tex with R Journal template? #257

agila5 opened this issue Nov 21, 2019 · 4 comments
Labels
bug

Comments

@agila5
Copy link

@agila5 agila5 commented Nov 21, 2019


By filing an issue to this repo, I promise that

  • I have fully read the issue guide at https://yihui.name/issue/.
  • I have provided the necessary information about my issue.
    • If I'm asking a question, I have already asked it on Stack Overflow or RStudio Community, waited for at least 24 hours, and included a link to my question there.
    • If I'm filing a bug report, I have included a minimal, self-contained, and reproducible example, and have also included xfun::session_info('rticles'). I have upgraded all my packages to their latest versions (e.g., R, RStudio, and R packages), and also tried the development version: remotes::install_github('rstudio/rticles').
    • If I have posted the same issue elsewhere, I have also mentioned it in this issue.
  • I have learned the Github Markdown syntax, and formatted my issue correctly.

I understand that my issue may be closed if I don't fulfill my promises.


Hi. I have a problem with the preamble.tex file used in the Rmarkdown rticles template for R Journal Submission. This is the procedure I'm following:

  1. Create a new Rmarkdown rticles template for submission to the R Journal.
  2. Knit the document and everything seems to be fine.
  3. Add some latex code to preamble.tex (like \usepackage{subfig})
  4. Knit the document and it doesn't compile anymore.

immagine

If I just remove \usepackage{subfig} from preamble.tex then everything works fine. I think the problem is related to the fact that the \usepackage{...} code isn't put in the preamble of the .tex document but I don't know how to fix that.

If you want to test I created I git repo here with all the Rmarkdown files up to point 3 of the previous list. If I knit the Rmd document that I get an error.

I've already asked this question on SO and rstudio community.

xfun::session_info("rticles")
#> R version 3.6.1 (2019-07-05)
#> Platform: x86_64-w64-mingw32/x64 (64-bit)
#> Running under: Windows 10 x64 (build 18362)
#> 
#> Locale:
#>   LC_COLLATE=Italian_Italy.1252  LC_CTYPE=Italian_Italy.1252   
#>   LC_MONETARY=Italian_Italy.1252 LC_NUMERIC=C                  
#>   LC_TIME=Italian_Italy.1252    
#> 
#> Package version:
#>   base64enc_0.1.3 digest_0.6.22   evaluate_0.14   glue_1.3.1     
#>   graphics_3.6.1  grDevices_3.6.1 highr_0.8       htmltools_0.4.0
#>   jsonlite_1.6    knitr_1.26      magrittr_1.5    markdown_1.1   
#>   methods_3.6.1   mime_0.7        Rcpp_1.0.3      rlang_0.4.1    
#>   rmarkdown_1.17  rticles_0.12.2  stats_3.6.1     stringi_1.4.3  
#>   stringr_1.4.0   tinytex_0.17    tools_3.6.1     utils_3.6.1    
#>   xfun_0.11       yaml_2.2.0

Created on 2019-11-21 by the reprex package (v0.3.0)

@yihui
Copy link
Member

@yihui yihui commented Dec 6, 2019

Sounds like a bug to me. I'll investigate soon. Thanks!

@yihui yihui added the bug label Dec 6, 2019
rcannood added a commit to rcannood/rticles that referenced this issue Dec 6, 2019
yihui added a commit to rcannood/rticles that referenced this issue Dec 10, 2019
@yihui yihui closed this as completed in ebc84d8 Dec 10, 2019
@yihui
Copy link
Member

@yihui yihui commented Dec 10, 2019

Should be fixed now. Thanks for the report!

Note that you can also include the preamble directly in the Rmd via the preamble field, e.g.

preamble: |
% Any extra LaTeX you need in the preamble
output: rticles::rjournal_article

@agila5
Copy link
Author

@agila5 agila5 commented Dec 11, 2019

I just tested it including a \usepackage{subfig} and it works perfectly, thanks!

@github-actions
Copy link

@github-actions github-actions bot commented Nov 2, 2020

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 2, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug
Projects
None yet
Development

No branches or pull requests

2 participants