Discussion:
[Orgmode] how to draw picture in org-mode ? Does it support tikz/pgf ?
waterloo
2009-08-14 07:22:53 UTC
Permalink
how to draw picture in org-mode ? Does it support tikz/pgf ?

Thanks
Graham Smith
2009-08-14 08:03:12 UTC
Permalink
Something I, as a comparative beginner can answer :-)
Post by waterloo
how to draw picture in org-mode ? Does it support tikz/pgf ?
Yes, I found it worked fine for me. I had a silly problem with page
margins (searchng the forum for tikz/pgf will find my recent posts),
that was my fault but other than that the flow charts and mindmaps I
have done work well.

Graham
Nick Dokos
2009-08-14 10:53:19 UTC
Permalink
Post by Graham Smith
Something I, as a comparative beginner can answer :-)
Post by waterloo
how to draw picture in org-mode ? Does it support tikz/pgf ?
Yes, I found it worked fine for me. I had a silly problem with page
margins (searchng the forum for tikz/pgf will find my recent posts),
that was my fault but other than that the flow charts and mindmaps I
have done work well.
Let me add a qualifier: if you try to preview the image, then it does
not seem to work, but that seems to be a characteristic of tikz/pgf,
rather than org-mode.

Here's the experiment, should somebody care to try it:

o Start with a simple picture - the one waterloo posted earlier in
the month will do:

,----
| #+LaTeX_HEADER: \usepackage{tikz}
|
| * Draw
|
| \begin{tikzpicture}
| \draw (0,0) -- (10,0);
| \end{tikzpicture}
`----

o Export it to LaTeX with C-c C-e l.

o Process the latex file with pdflatex and view with xpdf - everything
is fine.

o Process the latex file with latex, producing a dvi file. View the dvi
file with xdvi: the picture is missing (and I get a Ghostscript error.)

o Process the dvi file to PS with dvips and view the resulting PS file:
the picture is there.

Since (I'm guessing) preview processes the dvi file with dvipng and
since the dvi file seems to have some kind of problem, preview does not
work.

HTH,
Nick
waterloo
2009-08-14 11:30:22 UTC
Permalink
Yes, dvi file can not display tikz picture correctly .

Why do you use divpng? Auctex can preview tikz , it does not use dvipng.

Thanks
Post by Nick Dokos
Post by Graham Smith
Something I, as a comparative beginner can answer :-)
Post by waterloo
how to draw picture in org-mode ? Does it support tikz/pgf ?
Yes, I found it worked fine for me. I had a silly problem with page
margins (searchng the forum for tikz/pgf will find my recent posts),
that was my fault but other than that the flow charts and mindmaps I
have done work well.
Let me add a qualifier: if you try to preview the image, then it does
not seem to work, but that seems to be a characteristic of tikz/pgf,
rather than org-mode.
o Start with a simple picture - the one waterloo posted earlier in
,----
| #+LaTeX_HEADER: \usepackage{tikz}
|
| * Draw
|
| \begin{tikzpicture}
| \draw (0,0) -- (10,0);
| \end{tikzpicture}
`----
o Export it to LaTeX with C-c C-e l.
o Process the latex file with pdflatex and view with xpdf - everything
is fine.
o Process the latex file with latex, producing a dvi file. View the dvi
file with xdvi: the picture is missing (and I get a Ghostscript error.)
the picture is there.
Since (I'm guessing) preview processes the dvi file with dvipng and
since the dvi file seems to have some kind of problem, preview does not
work.
HTH,
Nick
waterloo
2009-08-14 11:50:10 UTC
Permalink
Yes , I mean preview-latex
Post by waterloo
Yes, dvi file can not display tikz picture correctly .
Why do you use divpng? Auctex can preview tikz , it does not use dvipng.
You mean preview-latex? Not for me: it just leaves the tikzpicture
environment
alone.
Nick
waterloo
2009-08-15 11:37:55 UTC
Permalink
How to draw picture for exporting to html ?

Thanks
Post by waterloo
Yes , I mean preview-latex
Post by waterloo
Yes, dvi file can not display tikz picture correctly .
Why do you use divpng? Auctex can preview tikz , it does not use dvipng.
You mean preview-latex? Not for me: it just leaves the tikzpicture
environment
alone.
Nick
Bernt Hansen
2009-08-15 14:26:03 UTC
Permalink
Post by waterloo
How to draw picture for exporting to html ?
I use ditaa and graphviz. There are examples at
http://doc.norang.ca/org-mode.html#Publishing

Links to the source for the page is available in the Overview section.

-Bernt
waterloo
2009-08-16 02:23:14 UTC
Permalink
can I use #£«begin_tikz and export tikz to html ?

Thanks
Post by Bernt Hansen
Post by waterloo
How to draw picture for exporting to html ?
I use ditaa and graphviz. There are examples at
http://doc.norang.ca/org-mode.html#Publishing
Links to the source for the page is available in the Overview section.
-Bernt
Bernt Hansen
2009-08-16 02:42:48 UTC
Permalink
can I use #+begin_tikz and export tikz to html ?
If you (or someone who wants tikz output to work) writes an exporter
that knows what to do with the tikz block I'm sure that can work.

Right now there is no such exporter available AFAIK.

-Bernt
waterloo
2009-08-16 02:46:22 UTC
Permalink
tikz is more power than ditaa and graphviz
.<http://doc.norang.ca/org-mode.html#sec-13.2>
I tikz's exporter will be supported in future version.

Thanks
Post by Bernt Hansen
Post by waterloo
can I use #£«begin_tikz and export tikz to html ?
If you (or someone who wants tikz output to work) writes an exporter
that knows what to do with the tikz block I'm sure that can work.
Right now there is no such exporter available AFAIK.
-Bernt
Eric Schulte
2009-08-16 15:58:57 UTC
Permalink
Hi,

Adding support for a new block type is fairly easy for any tool that can
be called from the command line. If you would like to try this please
read the documentation of org-exp-blocks on worg [1] and follow the
example of the asymptote block type [2].

Best -- Eric

Footnotes:
[1] http://orgmode.org/worg/org-contrib/org-exp-blocks.php

[2] http://orgmode.org/worg/org-contrib/org-exp-blocks.php#sec-4.1
Eric Schulte
2009-08-16 16:04:17 UTC
Permalink
Sorry,

Please disregard this email, I didn't realize tikz/pgf was a package of
TeX macros and not an external tool. -- Eric
Post by Eric Schulte
Hi,
Adding support for a new block type is fairly easy for any tool that can
be called from the command line. If you would like to try this please
read the documentation of org-exp-blocks on worg [1] and follow the
example of the asymptote block type [2].
Best -- Eric
[1] http://orgmode.org/worg/org-contrib/org-exp-blocks.php
[2] http://orgmode.org/worg/org-contrib/org-exp-blocks.php#sec-4.1
waterloo
2009-08-16 18:40:05 UTC
Permalink
Thanks very much. asymptote's function is very much like tikz . I can use
asymptote.
Besides asymptote, I can use metapost.
Post by Eric Schulte
Sorry,
Please disregard this email, I didn't realize tikz/pgf was a package of
TeX macros and not an external tool. -- Eric
Post by Eric Schulte
Hi,
Adding support for a new block type is fairly easy for any tool that can
be called from the command line. If you would like to try this please
read the documentation of org-exp-blocks on worg [1] and follow the
example of the asymptote block type [2].
Best -- Eric
[1] http://orgmode.org/worg/org-contrib/org-exp-blocks.php
[2] http://orgmode.org/worg/org-contrib/org-exp-blocks.php#sec-4.1
Carsten Dominik
2009-08-16 07:40:38 UTC
Permalink
Post by Nick Dokos
Post by Graham Smith
Something I, as a comparative beginner can answer :-)
Post by waterloo
how to draw picture in org-mode ? Does it support tikz/pgf ?
Yes, I found it worked fine for me. I had a silly problem with page
margins (searchng the forum for tikz/pgf will find my recent posts),
that was my fault but other than that the flow charts and mindmaps I
have done work well.
Let me add a qualifier: if you try to preview the image, then it does
not seem to work, but that seems to be a characteristic of tikz/pgf,
rather than org-mode.
o Start with a simple picture - the one waterloo posted earlier in
,----
| #+LaTeX_HEADER: \usepackage{tikz}
|
| * Draw
|
| \begin{tikzpicture}
| \draw (0,0) -- (10,0);
| \end{tikzpicture}
`----
I think this should work, but I believe the latex
files that is used to create the image does not have te right
usepackage statement.

Right now I am on a machine without dvipng, so I cannot try this:

1. pull from git
2. Instead of #+LaTeX_HEADER: \usepackage{tikz}, use

(setq org-export-latex-packages-alist '(("" "tikz))

because this customization will now also be seen by
the preview process.

I hope that then the preview will also work.

- Carsten
Post by Nick Dokos
o Export it to LaTeX with C-c C-e l.
o Process the latex file with pdflatex and view with xpdf - everything
is fine.
o Process the latex file with latex, producing a dvi file. View the dvi
file with xdvi: the picture is missing (and I get a Ghostscript error.)
the picture is there.
Since (I'm guessing) preview processes the dvi file with dvipng and
since the dvi file seems to have some kind of problem, preview does not
work.
HTH,
Nick
_______________________________________________
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Loading...