3

I tried out this section of code from this repo

#+LATEX_HEADER_EXTRA: \usepackage{svg}

...

#+PROPERTY: header-args :eval never-export :file-ext svg

...

#+NAME: sequence12422
#+BEGIN_SRC plantuml :file-ext png
  ' this is a comment
  Alice -> Bob: Authentication Request
  Bob --> Alice: Authentication Response
  John --> Alice: another Authentication Request
  Alice --> John: another Authentication Response
#+END_SRC

#+RESULTS: sequence12422
[[file:sequence12422.png]]

#+NAME: svg-seq
   #+BEGIN_SRC plantuml
     ' this is a comment
     Alice -> Bob: Authentication Request
     Bob --> Alice: Authentication Response
     John --> Alice: another Authentication Request
     Alice --> John: another Authentication Response
   #+END_SRC

   #+RESULTS: svg-seq
   [[file:svg-seq.svg]]

the png image gets rendered but the svg does not. My org-version is 9.1.9 on macOS mojave. What is the proper way to render svg images on pdf with org export? Am I missing a package or something?

EDIT: In the exported tex file, the exists no command that includes the svg image. However, I can see the \includegraphics{...} for my png image.

0

I posted an issue on the author's github repo.

You need to:

  1. install inkscape (macOS: brew install caskformula/caskformula/inkscape --HEAD --branch-0.92)

  2. set org-latex-pdf-process with the -shell-escape switch.

     (setq org-latex-pdf-process
       (let
           ((cmd (concat "pdflatex -shell-escape -interaction nonstopmode"
                 " --synctex=1"
                 " -output-directory %o %f")))
         (list cmd
           "cd %o; if test -r %b.idx; then makeindex %b.idx; fi"
           "cd %o; bibtex %b"
           cmd
           cmd)))
  1. make sure the svg image is in the same directory as the file that includes it

Check the conversation in the repo for more details.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy