Skip to content

[BUG] Error when weaving to PDF (md2pdf or pandoc2pdf) #474

@biologicalbattery

Description

@biologicalbattery

description

When using the weave() function, I get an file not found error if the doctype is md2pdf or pandoc2pdf. My basic report.Jmd looks like

---
title: "Example"
author: Author
date: 29 Sep 2023
weave_options:
    doctype: md2pdf
---
# Example heading
some text

and my compilation script looks like

using Weave

report = "./report.Jmd"

weave(report)

The error I get is

ERROR: IOError: could not spawn `xelatex -shell-escape -halt-on-error report.tex`: no such file or directory (ENOENT)

It appears that the weave function places all the compiled .tex into a temp folder within the current directory and then the xelatex is only called with the file name and the command is not run from the temp folder so the tex compilation fails. I know that my xelatex is working, because when I used the Julia Weave: Save to File command found within the Julia for VS Code extension, that command somehow knows what to do and the rendering completes without issue.

I should note, that all of the files report.Jmd and compile.jl are located within the same directory which is my project diretory.

Not sure if I have messed up the compilation script, and because the VS Code extension is able to complete successfully this isn't a major issue, however, I am confused as to why the raw command is not working as expected. I have also tried calling the weave function with the out_path argument set to all variations (:pwd, :doc, and custom dir) all without success. So not sure where the issue lies.

versions

using InteractiveUtils; versioninfo():

Julia Version 1.9.2
Commit e4ee485e909 (2023-07-05 09:39 UTC)
Platform Info:
  OS: macOS (arm64-apple-darwin22.4.0)
  CPU: 8 × Apple M1
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-14.0.6 (ORCJIT, apple-m1)
  Threads: 8 on 4 virtual cores
Environment:
  JULIA_NUM_THREADS = 8
  JULIA_EDITOR = code

using Pkg; Pkg.status():

  [a93c6f00] DataFrames v1.6.1
  [31c24e10] Distributions v0.25.102
  [f6369f11] ForwardDiff v0.10.36
  [2913bbd2] StatsBase v0.34.2
  [fce5fe82] Turing v0.29.1
  [44d3d7a6] Weave v0.10.12
  [37e2e46d] LinearAlgebra
  [10745b16] Statistics v1.9.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions