public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
* TikZ/PGF as SVG-graphics
@ 2012-04-03 18:41 Mikael Öhman
  2012-04-11 19:03 ` 🙈 V
  0 siblings, 1 reply; 3+ messages in thread
From: Mikael Öhman @ 2012-04-03 18:41 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

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

I use TikZ for my figures in latex, and I would like to see it supported in 
Pandoc. 
When trying out tex4ht I came across 
\pgfsysdriver{pgfsys-tex4ht.def}
which writes SVG graphics directly from SVG-diagrams. 

This will probably include writing to an external temporary file, compiling 
and extracting the SVG image.
Dealing with text and, presumably much trickier, math, inside the figures 
could be very tricky.

In particular, the tikzpicture-environment, and the inline \tikz{...} would 
allow for a lot of neat graphics.

-- 
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To view this discussion on the web visit https://groups.google.com/d/msg/pandoc-discuss/-/QORHwxphevQJ.
To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit this group at http://groups.google.com/group/pandoc-discuss?hl=en.


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

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

* Re: TikZ/PGF as SVG-graphics
  2012-04-03 18:41 TikZ/PGF as SVG-graphics Mikael Öhman
@ 2012-04-11 19:03 ` 🙈 V
  2012-04-12 15:23   ` Mikael Öhman
  0 siblings, 1 reply; 3+ messages in thread
From: 🙈 V @ 2012-04-11 19:03 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

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

Mikael Öhman wrote:

> I use TikZ for my figures in latex, and I would like to see it supported 
in Pandoc. 

I doubt that Pandoc will directly support this. If Pandoc supported image 
creation, it would have to be renamed to Panimage ;-) However we should 
agree on a common extension syntax for embedded images. Here is how I do it:

https://github.com/nichtich/ditaa-markdown

For instance with GraphViz images:

~~~~ {.dot .Grankdir:LR} 
digraph { A -> B -> C; A -> C; }
~~~~

The same for Tikz would be:

~~~~ {.tikz}
% your TikZ code
~~~~

It would be nice I Pandoc could be configured to map this annotated code 
sections to different formats - depending on your settings the images would 
be creates as bitmap or as vector file or as raw code, if supported by a 
format. For instance LaTeX supports raw TikZ code:

\begin{tikzpicture}
% your TikZ code
\end{tikzpicture}

But you could also create a PDF file and embed this image.

Anyway, support of one particular image syntax or format (such as TikZ only 
in one direction of conversion) is not the right way to go.

Cheers
Jakob

-- 
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To view this discussion on the web visit https://groups.google.com/d/msg/pandoc-discuss/-/1u-SFM4WUQkJ.
To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to pandoc-discuss+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/pandoc-discuss?hl=en.


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

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

* Re: TikZ/PGF as SVG-graphics
  2012-04-11 19:03 ` 🙈 V
@ 2012-04-12 15:23   ` Mikael Öhman
  0 siblings, 0 replies; 3+ messages in thread
From: Mikael Öhman @ 2012-04-12 15:23 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

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

I never suggest that pandoc would do anything more than parse the 
environment, which is more or less what you are describing as well.
Also, documents contain images, otherwise we'd have to rename it to Pantext 
now wouldnt we? 

I've haven't had time to dig into Pandoc source yet, but something general 
like environments to some specific code would be nice (i assume there is 
something along those lines)
Each environment calls some specific parser, which might be built into 
Pandoc (for figures, tables) or calls graphviz or latex to construct images 
(as PNG or SVG, or just built in).
In the latter case, no code inside the environments should be parsed by 
pandoc itself.

One complication is custom latex commands used within the figures, so a way 
to send preamble data would be necessary.
Also, math inside figures, if exported as SVG. Not sure how mathjax would 
play with that, but mathml should be doable. Somehow.

On Wednesday, April 11, 2012 9:03:00 PM UTC+2, 🙈 V wrote:
>
> Mikael Öhman wrote:
>
> > I use TikZ for my figures in latex, and I would like to see it supported 
> in Pandoc. 
>
> I doubt that Pandoc will directly support this. If Pandoc supported image 
> creation, it would have to be renamed to Panimage ;-) However we should 
> agree on a common extension syntax for embedded images. Here is how I do it:
>

> https://github.com/nichtich/ditaa-markdown
>
> For instance with GraphViz images:
>
> ~~~~ {.dot .Grankdir:LR} 
> digraph { A -> B -> C; A -> C; }
> ~~~~
>
> The same for Tikz would be:
>
> ~~~~ {.tikz}
> % your TikZ code
> ~~~~
>
> It would be nice I Pandoc could be configured to map this annotated code 
> sections to different formats - depending on your settings the images would 
> be creates as bitmap or as vector file or as raw code, if supported by a 
> format. For instance LaTeX supports raw TikZ code:
>
> \begin{tikzpicture}
> % your TikZ code
> \end{tikzpicture}
>
> But you could also create a PDF file and embed this image.
>
> Anyway, support of one particular image syntax or format (such as TikZ 
> only in one direction of conversion) is not the right way to go.
>
> Cheers
> Jakob
>

-- 
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To view this discussion on the web visit https://groups.google.com/d/msg/pandoc-discuss/-/MdDG3mi9XZEJ.
To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to pandoc-discuss+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/pandoc-discuss?hl=en.


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

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

end of thread, other threads:[~2012-04-12 15:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-03 18:41 TikZ/PGF as SVG-graphics Mikael Öhman
2012-04-11 19:03 ` 🙈 V
2012-04-12 15:23   ` Mikael Öhman

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).