JunoLab / Weave.jl

Scientific reports/literate programming for Julia
http://weavejl.mpastell.com
MIT License
823 stars 94 forks source link

[BUG] Weave md2pdf doesn't handle \degree unicode used in Unitful.jl code. #392

Open rafaqz opened 4 years ago

rafaqz commented 4 years ago

description

! Undefined control sequence.
<argument> \degree 

l.141 ...oB{:}@*) (*@\HLJLn{\ensuremath{\degree}C}
                                                  @*)(*@\HLJLp{,}@*) (*@\HLJ...
No pages of output.
Transcript written on example.log.
┌ Warning: Error converting document to pdf. Try running latex manually
└ @ Weave ~/.julia/packages/Weave/7zyqS/src/writer/latex.jl:12
ERROR: LoadError: failed process: Process(`xelatex -shell-escape -halt-on-error example.tex`, ProcessExited(1)) [1]

versions

using InteractiveUtils; versioninfo():


Julia Version 1.5.0
Commit 96786e22cc (2020-08-01 23:44 UTC)
Platform Info:
OS: Linux (x86_64-pc-linux-gnu)
CPU: Intel(R) Core(TM) i7-8700K CPU @ 3.70GHz
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-9.0.1 (ORCJIT, skylake)

> `using Pkg; Pkg.status()`:
<!-- please paste the the output of `using Pkg; Pkg.status()` in the backticks below -->
```julia
  [44d3d7a6] Weave v0.10.3

minimum reproducible steps

using Unitful: °C

In a jmd file at path path, then run:

weave(path, doctype="md2pdf")
itafraze commented 2 years ago

You can solve such problems by manually adding dependencies in the YAML header. An example is:

---
title:    .jmd YAML header injecting TeX dependency
tex_deps: \usepackage{gensymb}
          \usepackage[nameinlink]{cleveref}
weave_options:
   doctype:    md2pdf
---

In your case gensymb is the one you need.

nathanrboyer commented 1 year ago

Unfortunately, this solution doesn't work for me because of #418.