CDSoft / pp

PP - Generic preprocessor (with pandoc in mind) - macros, literate programming, diagrams, scripts...

Home Page:http://cdelord.fr/pp

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to use asymptote with other formats than png

robinrosenstock opened this issue · comments

I want to use svg generated from pp and asymptote.
But pp always append png to the filename.
How to use asymptote with other formats than png?

Currently pp generates only PNG images. There were two options for Asymptote: PDF or other formats. The advantage of PDF is that it accepts transparency. So internally pp makes asymptote generate PDF files converted to PNG to be accepted by pandoc.
I can try to change the output format. e.g. if the format is given in the image name it will be used to generate the image (when possible).

I can try to change the output format. e.g. if the format is given in the image name it will be used to generate the image (when possible).

yeah specify format in the image name, I think also this would be best way.

I have a patch to use PNG and SVG formats. I'm wondering if SVG shouldn't become the default format for diagrams when available (files are smaller). Asymptote diagrams with transparency should be given the PNG extension explicitly.

I'm wondering if SVG shouldn't become the default format for diagrams when available (files are smaller)

I have no problem with that...

done in v. 2.3

Note that most (all?) LaTeX engines barf at SVG. They want PDF.

@bpj you are correct, but when using pandoc, it automatically converts svg files to pdf, I think it is doing it with librsvg, see here.

There are not so many open vector formats and svg is propably the way to go in the web. So the svg format is the lowest common denominator for output formats I use most often: html and pdf.

I have added PDF in diagram formats (pp 2.3.1). But it may not work with PlantUML. If you want PDF, you have to explicitly add the .pdf extension to image names.

I have added PDF in diagram formats

Can you elaborate? Do you mean its the standard now?

No, PDF is just one possible output format. The default format is still SVG.

Well I think that the default format should take the output format into account. To make a PDF document, pandoc uses LaTeX. In this case the default image format should be PDF or PNG.