[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: ob-plantuml: Proposal to add 'jar-args' customizable variable
From: |
Andy Moreton |
Subject: |
Re: ob-plantuml: Proposal to add 'jar-args' customizable variable |
Date: |
Sun, 09 Jan 2022 17:46:52 +0000 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (windows-nt) |
On Fri 03 Dec 2021, Dejan Josifović wrote:
> Hi all,
>
> I use PlantUML integration in org-mode for years now, but only
> recently I came across some unwanted behavior.
>
> Using PlantUML from jar (org-plantuml-jar-path variable) and latest
> org-mode, I wanted to render a diagram containing some Unicode
> characters (such as '⊥' and '∀'), but the end image had some gibberish
> instead. However,
> trying this from a standalone file using plantuml-mode[1], the end image
> rendered correctly. Here is some sample code which can reproduce the issue:
>
> #+BEGIN_SRC plantuml :file ./test.png
> A -> B: ∀ characters display correctly is ⊥
> #+END_SRC
>
> Comparing ob-plantuml.el and plantuml-mode.el files I found what is the
> problem. plantuml-mode has a customizable variable for specifying
> arguments when using PlantUML from jar (plantuml-jar-args (list
> "-charset" "UTF-8" ). The charset arguments is what is needed for
> the images to render correctly (I confirmed it by implementing it locally).
>
> I was wondering why such variable doesn't exist in ob-plantuml. I have
> searched the mailing list archives, confirmed bugs and help page and
> couldn't find anything related.
I use this snippet to set the ob-plantuml.el args to match the
plantuml-mode.el settings:
(setf (alist-get :java org-babel-default-header-args:plantuml)
(mapconcat #'identity plantuml-java-args " ")
(alist-get :cmdline org-babel-default-header-args:plantuml)
(mapconcat #'identity plantuml-jar-args " "))
Hope that helps,
AndyM