-
-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot use plantuml with latex error #34
Comments
Thanks for the report. So far I wasn't able to reproduce this. The following runs without error. pandoc -L diagram.lua test.md -o out.pdf where ---
title: Look at this nice and meaningless title
diagram:
engine:
plantuml:
mime-types:
application/pdf: false
image/png: true
---
``` plantuml
@startuml
class Nombre{
Atributos
__
Operaciones
--
Responsabilidades
}
@enduml
``` Please provide more details, ideally with a reproducible example. |
Sorry, it should be |
Ah, I see. LaTeX doesn't work with SVG AFAIK, and these images first have to be converted to a different format first. So the filter is working as intended. What's the reason that you'd prefer SVG for this? |
Because I don't have plantuml support for PDF, it's really annoying to setup, and PNG most of the time renders in low resolution, and I suppose LaTeX scales it a little bit, so the result it's pretty bad |
That makes sense. Let me check the code to see if there's an easy solution to this. Do you have Inkscape or librsvg installed? We'll still need to convert the SVG to something that LaTeX can handle. |
I have librsvg installed |
I'm working on a better solution, but for the time being, you can use a little hack: It's a filter that wraps the diagram filter, pretending that the conversion is targeting HTML. local diagram_filter = 'diagram.lua'
function Pandoc (doc)
-- Copy the global environment, but set a different target FORMAT
local env = {}
for key, value in pairs(_G) do
env[key] = value
end
env.FORMAT = 'html'
-- Call the diagram filter, pretending that we're converting to HTML
return pandoc.utils.run_lua_filter(doc, diagram_filter, env)
end Use it instead of the plain I'm not sure yet what the proper fix could look like. The most reasonable thing would probably be to make format options configurable, e.g. diagram:
format:
latex:
mime-types: ['image/png', 'image/svg+xml'] |
Hello! I'm going to try this as soon as possible, thank you for the fast response, you've been very helpful. |
Well, I've tried the workaround quite a bit later hahaha. But I get the following message: |
pandoc -L $PATH_OF_DIAGRAM -o summary.pdf summary.md
Cannot use plantuml with latex
The text was updated successfully, but these errors were encountered: