public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
* PDF output from diagram-generator.lua and tikz-qtree.sty
@ 2020-11-20 22:20 Thomas Hodgson
       [not found] ` <0a796df0-4638-4ecf-ab7b-58e8912e4b6fn-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Thomas Hodgson @ 2020-11-20 22:20 UTC (permalink / raw)
  To: pandoc-discuss


[-- Attachment #1.1: Type: text/plain, Size: 1651 bytes --]


I have been looking at using the diagram-generator lua filter to make 
figures. I am using tikz-qtree.sty. With the following in my markdown I get 
a strange output (see attached SVG).

```{.tikz additionalPackages="\usepackage{tikz-qtree} 
\usepackage{mathtools}"}
\Tree [ .A {A and B} {\(\lambda \mathrm{x} \in \mathrm{D} . \text{x is 
tall}\)} ]
```
What should be a dot is a small triangle.

Also, unlike in the attached image, in the PDF the 'A and B' and 'x is 
tall' are bunched together with no spaces between them.

I did `$ pandoc --lua-filter=diagram-generator --extract-media=images -o 
mwe.pdf mwe.md`.

The output of this minimal LaTeX file, compiled with pdflatex, is fine:

```
\documentclass{standalone}
\usepackage{tikz}
\usepackage{tikz-qtree}
\usepackage{mathtools}

\begin{document}

\Tree
[
    .A
    {A and B}
    {\(\lambda \mathrm{x} \in \mathrm{D} . \text{x is tall}\)}
]

\end{document}
```

Is this an issue with how Inkscape is converting the PDF to SVG? I get some 
warnings when I run the filter about deprecated options and a fonts folder.

One thing that occurred to me is to modify the filter so that for tex 
output a PDF is embedded, not an SVG. Does that seem like a good solution 
to pursue? Thanks!

-- 
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/0a796df0-4638-4ecf-ab7b-58e8912e4b6fn%40googlegroups.com.

[-- Attachment #1.2: Type: text/html, Size: 16095 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: PDF output from diagram-generator.lua and tikz-qtree.sty
       [not found] ` <0a796df0-4638-4ecf-ab7b-58e8912e4b6fn-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2020-11-21  0:20   ` John MacFarlane
       [not found]     ` <m2k0ufftmr.fsf-jF64zX8BO08an7k8zZ43ob9bIa4KchGshsV+eolpW18@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: John MacFarlane @ 2020-11-21  0:20 UTC (permalink / raw)
  To: Thomas Hodgson, pandoc-discuss

Thomas Hodgson <thomas.hodgson-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:


> Is this an issue with how Inkscape is converting the PDF to SVG? I get some 
> warnings when I run the filter about deprecated options and a fonts folder.

That's a good possibility.

> One thing that occurred to me is to modify the filter so that for tex 
> output a PDF is embedded, not an SVG. Does that seem like a good solution 
> to pursue? Thanks!

Yes, that would make a lot of sense.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: PDF output from diagram-generator.lua and tikz-qtree.sty
       [not found]     ` <m2k0ufftmr.fsf-jF64zX8BO08an7k8zZ43ob9bIa4KchGshsV+eolpW18@public.gmane.org>
@ 2020-11-21 12:27       ` Thomas Hodgson
       [not found]         ` <CAFtWZz=EYcXtq-WkVaF6xziZ8OZ40wcRd7Ck1hAMg6jNN8_aiw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Thomas Hodgson @ 2020-11-21 12:27 UTC (permalink / raw)
  To: pandoc-discuss

[-- Attachment #1: Type: text/plain, Size: 1198 bytes --]

Thanks!

I did that quickly for my own use. I think that I will raise an issue on
the repo to discuss it and perhaps make a PR if my solution can be made
good enough.

On Sat, 21 Nov 2020 at 01:20, John MacFarlane <jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org> wrote:

> Thomas Hodgson <thomas.hodgson-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:
>
>
> > Is this an issue with how Inkscape is converting the PDF to SVG? I get
> some
> > warnings when I run the filter about deprecated options and a fonts
> folder.
>
> That's a good possibility.
>
> > One thing that occurred to me is to modify the filter so that for tex
> > output a PDF is embedded, not an SVG. Does that seem like a good
> solution
> > to pursue? Thanks!
>
> Yes, that would make a lot of sense.
>
>

-- 
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/CAFtWZz%3DEYcXtq-WkVaF6xziZ8OZ40wcRd7Ck1hAMg6jNN8_aiw%40mail.gmail.com.

[-- Attachment #2: Type: text/html, Size: 1941 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: PDF output from diagram-generator.lua and tikz-qtree.sty
       [not found]         ` <CAFtWZz=EYcXtq-WkVaF6xziZ8OZ40wcRd7Ck1hAMg6jNN8_aiw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2020-11-24 12:25           ` Thomas Hodgson
  0 siblings, 0 replies; 4+ messages in thread
From: Thomas Hodgson @ 2020-11-24 12:25 UTC (permalink / raw)
  To: pandoc-discuss

[-- Attachment #1: Type: text/plain, Size: 2231 bytes --]

I looked at the diagram-generator code. It seems easy enough to modify it
so that latex output will embed a PDF as long as the generator for each
diagram type can produce pdf output. Tikz and Graphviz can. The other can
pass their output to Inkscape, as long as the function is modified to
accept PDF as input. I have done that on my local version. It works with
the test file in the repo, exporting to formats that use PDF, PNG, and SVG.
I have opened some issues and described my code.

I don't know anything more about the odd conversion from Tikz PDF to SVG
and PNG except that adding `--pdf-poppler` as an option to Inkscape fixes
it. https://inkscape.org/doc/inkscape-man.html says that this uses an
external library, and I don't understand it's description of the difference
it makes. So, I don't want to suggest making that change to
diagram-generator.lua without doing more work.

On Sat, 21 Nov 2020 at 13:27, Thomas Hodgson <thomas.hodgson-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:

> Thanks!
>
> I did that quickly for my own use. I think that I will raise an issue on
> the repo to discuss it and perhaps make a PR if my solution can be made
> good enough.
>
> On Sat, 21 Nov 2020 at 01:20, John MacFarlane <jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org> wrote:
>
>> Thomas Hodgson <thomas.hodgson-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:
>>
>>
>> > Is this an issue with how Inkscape is converting the PDF to SVG? I get
>> some
>> > warnings when I run the filter about deprecated options and a fonts
>> folder.
>>
>> That's a good possibility.
>>
>> > One thing that occurred to me is to modify the filter so that for tex
>> > output a PDF is embedded, not an SVG. Does that seem like a good
>> solution
>> > to pursue? Thanks!
>>
>> Yes, that would make a lot of sense.
>>
>>

-- 
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/CAFtWZz%3DB53SVD2ATbbb%3DZJAbdv0VKpxYjUoG-HMKQqwFG6MbWw%40mail.gmail.com.

[-- Attachment #2: Type: text/html, Size: 3415 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-11-24 12:25 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-20 22:20 PDF output from diagram-generator.lua and tikz-qtree.sty Thomas Hodgson
     [not found] ` <0a796df0-4638-4ecf-ab7b-58e8912e4b6fn-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2020-11-21  0:20   ` John MacFarlane
     [not found]     ` <m2k0ufftmr.fsf-jF64zX8BO08an7k8zZ43ob9bIa4KchGshsV+eolpW18@public.gmane.org>
2020-11-21 12:27       ` Thomas Hodgson
     [not found]         ` <CAFtWZz=EYcXtq-WkVaF6xziZ8OZ40wcRd7Ck1hAMg6jNN8_aiw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2020-11-24 12:25           ` Thomas Hodgson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).