Closed lsignac closed 1 year ago
Thanks for the report. What's the exact pandoc command that you are using, and how did you install plantuml?
It looks like your installation is missing some plugins, so we'll have to make the filter more configurable in that regard.
(Two shots message... separated by hline... the poblem is not related to diagram.lua but to plantuml as you guessed).
Test file : sample_plantuml.md
Pandoc comment used :
pandoc -t latex --lua-filter diagram_8168143.lua --pdf-engine=xelatex sample_plantuml.md -o sample_plantuml.pdf
==> Produces the error above
or
pandoc -t latex --lua-filter diagram_97c6362.lua --pdf-engine=xelatex sample_plantuml.md -o sample_plantuml.pdf
==> Perfect result
The two filters correspond to the two commits mentioned above (I just downloaded the diagram.lua file and renamed it , is it OK ?)
plantuml
has been installed by my package manager (Arch Linux) :
community/plantuml 1.2023.4-1 (10.1 MiB 10.9 MiB) (Installed)
Component that allows to quickly write uml diagrams
The only difference between the two commits seed to be the format....
I tried a simpler test with just plantuml, and this test file :
@startuml
Alice -> Bob: test
@enduml
This command succeeds : cat plantuml_diagram.txt | plantuml -tsvg -pipe -charset UTF8 > out.svg
But this one fails ( same error as above) : cat plantuml_diagram.txt | plantuml -tpdf -pipe -charset UTF8 > out.pdf
So I guess this is a plantuml problem, or more precisely a "plantuml on my personal computer problem".
Don't know if it's possible to force formats (final format, intermediary format) to tell diagram.lua that the tool (plantuml) should produce a svg file, and this svg file should be translated to a pdf file before if is included by pandoc. Something like this :
```{.plantuml caption="This is an image, created by **PlantUML**." width=50% engine_format="svg" output_format="pdf"}
@startuml
Alice -> Bob: Authentication Request Bob --> Alice: Authentication Response
Alice -> Bob: Another authentication Request Alice <-- Bob: another Response
@enduml
```
I dont need this feature (I dont need plantuml...) but this kind of thing would (perhaps) solve my plantuml problem, and the mermaid problem we had to face so may be it could be a good design choice to struggle in the jungle of diagramming tools :)
It's now possible to disable/enable certain image types for each engine. Please try this:
---
diagram:
engine:
plantuml:
mime-types:
application/pdf: false
image/png: false
---
This commit 97c6362115238051209de4d7f9bff81167c08b9e works like a charm for my use case (generation of PDF) : TikZ, mermaid, plantUML, asymptote.
But with the last commit : 81681438eb3d97d37dc69ecf5e901586a6f9cb7f plantUML does not work anymore :
The sample file used contains :