1

I want to export the .pdf created using .Rmd. It works if I remove the rmarkdown::render chunk at the header, but

---
title: "LHD_generation"
author: "hcghkgvjv"
date: "`r format(Sys.time(), '%d %B, %Y')`"
output:
    pdf_document:
        toc: yes
        toc_depth: 3
    html_notebook:
        toc: yes
        toc_depth: 3
        toc_float: yes
    html_document:
        theme: simplex
        highlight: kate
        fig_caption: yes
        fig_height: 4
        fig_width: 6
        toc: yes
        toc_float: yes
        toc_depth: 3
    # word_document:
    #     toc: yes
    #     toc_depth: 3
knit: (function(inputFile, encoding) {
    rmarkdown::render(inputFile, encoding = encoding, 
        output_file = paste0(dirname(inputFile), "/../Results", 
        '/LHD_generation.pdf'), output_format = "pdf_document")})
---

throws the following error when I include it. I also get LHD_generation.tex in the Results folder but then the process throws error & halts.

output file: LHD_generation.knit.md

/Applications/RStudio.app/Contents/MacOS/quarto/bin/tools/pandoc +RTS -K512m -RTS LHD_generation.knit.md --to latex --from markdown+autolink_bare_uris+tex_math_single_backslash --output pandocd714116efe8f.tex --lua-filter /Users/massisenergy/Library/R/x86_64/4.2/library/rmarkdown/rmarkdown/lua/pagebreak.lua --lua-filter /Users/massisenergy/Library/R/x86_64/4.2/library/rmarkdown/rmarkdown/lua/latex-div.lua --embed-resources --standalone --table-of-contents --toc-depth 3 --highlight-style tango --pdf-engine pdflatex --variable graphics --variable 'geometry:margin=1in' 
Error: LaTeX failed to compile /Users/massisenergy/Library/Mobile Documents/com~apple~CloudDocs/Sync/inSilicoE3DBP_model_MRE/Analysis/../Results/LHD_generation.tex. See https://yihui.org/tinytex/r/#debugging for debugging tips.
Execution halted

Any ideas on how to make it work?

I came through the following links, but no avail.

massisenergy
  • 1,764
  • 3
  • 14
  • 25

0 Answers0