all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Very large svg file output from latex block using =#+header: :imagemagick=
@ 2013-11-02 21:31 John Hendy
  2013-11-03  1:31 ` Vladimir Lomov
  2013-11-04  9:39 ` Andreas Leha
  0 siblings, 2 replies; 3+ messages in thread
From: John Hendy @ 2013-11-02 21:31 UTC (permalink / raw)
  To: emacs-orgmode

I'm trying to following along with the example here:
- http://orgmode.org/worg/org-contrib/babel/languages/ob-doc-LaTeX.html#sec-4-3

I don't need dual export, so I tried this instead for straight html
compatible output:

#+header: :file tree.svg
#+header: :imagemagick
#+begin_src latex
  \usetikzlibrary{trees}
  \begin{tikzpicture}
    \node [circle, draw, fill=red!20] at (0,0) {1}
    child { node [circle, draw, fill=blue!30] {2}
      child { node [circle, draw, fill=green!30] {3} }
      child { node [circle, draw, fill=yellow!30] {4} }};
  \end{tikzpicture}
#+end_src

Should this work? I get this error:

org-babel-execute:latex: Can not create svg files, please specify a
.png or .pdf file or try the :imagemagick header argument

In perusing another thread, it looks like the argument might be
=:imagemagic yes=?
- http://lists.gnu.org/archive/html/emacs-orgmode/2011-02/msg01302.html

When I do that and run the above, I get a 30.9mb file as the .svg
output. Surely I'm doing something incorrectly?

Just pulled this morning before executing:

Org-mode version 8.2.1 (release_8.2.1-163-ge7397d @
/home/jwhendy/.elisp/org.git/lisp/)


Thanks for any suggestions!
John

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

* Re: Very large svg file output from latex block using =#+header: :imagemagick=
  2013-11-02 21:31 Very large svg file output from latex block using =#+header: :imagemagick= John Hendy
@ 2013-11-03  1:31 ` Vladimir Lomov
  2013-11-04  9:39 ` Andreas Leha
  1 sibling, 0 replies; 3+ messages in thread
From: Vladimir Lomov @ 2013-11-03  1:31 UTC (permalink / raw)
  To: emacs-orgmode

Hello,
** John Hendy [2013-11-02 16:31:02 -0500]:

> I'm trying to following along with the example here:
> - http://orgmode.org/worg/org-contrib/babel/languages/ob-doc-LaTeX.html#sec-4-3

> I don't need dual export, so I tried this instead for straight html
> compatible output:

> #+header: :file tree.svg
> #+header: :imagemagick
> #+begin_src latex
>   \usetikzlibrary{trees}
>   \begin{tikzpicture}
>     \node [circle, draw, fill=red!20] at (0,0) {1}
>     child { node [circle, draw, fill=blue!30] {2}
>       child { node [circle, draw, fill=green!30] {3} }
>       child { node [circle, draw, fill=yellow!30] {4} }};
>   \end{tikzpicture}
> #+end_src

> Should this work? I get this error:

> org-babel-execute:latex: Can not create svg files, please specify a
> .png or .pdf file or try the :imagemagick header argument

> In perusing another thread, it looks like the argument might be
> =:imagemagic yes=?
> - http://lists.gnu.org/archive/html/emacs-orgmode/2011-02/msg01302.html

> When I do that and run the above, I get a 30.9mb file as the .svg
> output. Surely I'm doing something incorrectly?

I don't know details how latex fragments are translated into SVG but
there is good tool for this: dvisvgm. It is provided by TeX Live though
it works only on DVI files.

> Just pulled this morning before executing:

> Org-mode version 8.2.1 (release_8.2.1-163-ge7397d @
> /home/jwhendy/.elisp/org.git/lisp/)

> Thanks for any suggestions!
> John

---
WBR, Vladimir Lomov

-- 
Some performers on television appear to be horrible people, but when
you finally get to know them in person, they turn out to be even worse.
		-- Avery

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

* Re: Very large svg file output from latex block using =#+header: :imagemagick=
  2013-11-02 21:31 Very large svg file output from latex block using =#+header: :imagemagick= John Hendy
  2013-11-03  1:31 ` Vladimir Lomov
@ 2013-11-04  9:39 ` Andreas Leha
  1 sibling, 0 replies; 3+ messages in thread
From: Andreas Leha @ 2013-11-04  9:39 UTC (permalink / raw)
  To: emacs-orgmode

Hi John,

John Hendy <jw.hendy@gmail.com> writes:

> I'm trying to following along with the example here:
> - http://orgmode.org/worg/org-contrib/babel/languages/ob-doc-LaTeX.html#sec-4-3
>
> I don't need dual export, so I tried this instead for straight html
> compatible output:
>
> #+header: :file tree.svg
> #+header: :imagemagick
> #+begin_src latex
>   \usetikzlibrary{trees}
>   \begin{tikzpicture}
>     \node [circle, draw, fill=red!20] at (0,0) {1}
>     child { node [circle, draw, fill=blue!30] {2}
>       child { node [circle, draw, fill=green!30] {3} }
>       child { node [circle, draw, fill=yellow!30] {4} }};
>   \end{tikzpicture}
> #+end_src
>
> Should this work? I get this error:
>
> org-babel-execute:latex: Can not create svg files, please specify a
> .png or .pdf file or try the :imagemagick header argument
>
> In perusing another thread, it looks like the argument might be
> =:imagemagic yes=?
> - http://lists.gnu.org/archive/html/emacs-orgmode/2011-02/msg01302.html
>
> When I do that and run the above, I get a 30.9mb file as the .svg
> output. Surely I'm doing something incorrectly?

Well, the error message is misleading.

If you go via imagemagick, I guess, the image is rendered and converted
to pixel graphics and then converted back to svg with embedded pixel
graphics, which will inflate the output.

The way to go is to customize org-babel-latex-htlatex to "htlatex".

Then, the block without the :imagemagick header argument should produce
a decent svg.

For reference, this works for me (having org-babel-latex-htlatex set to
"htlatex")

--8<---------------cut here---------------start------------->8---
#+header: :file tree.svg
#+header: :results file raw
#+begin_src latex
  \usetikzlibrary{trees}
  \begin{tikzpicture}
    \node [circle, draw, fill=red!20] at (0,0) {1}
    child { node [circle, draw, fill=blue!30] {2}
      child { node [circle, draw, fill=green!30] {3} }
      child { node [circle, draw, fill=yellow!30] {4} }};
  \end{tikzpicture}
#+end_src

#+results:
[[file:tree.svg]]
--8<---------------cut here---------------end--------------->8---


Regards,
Andreas



>
> Just pulled this morning before executing:
>
> Org-mode version 8.2.1 (release_8.2.1-163-ge7397d @
> /home/jwhendy/.elisp/org.git/lisp/)
>
>
> Thanks for any suggestions!
> John

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

end of thread, other threads:[~2013-11-04  9:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-02 21:31 Very large svg file output from latex block using =#+header: :imagemagick= John Hendy
2013-11-03  1:31 ` Vladimir Lomov
2013-11-04  9:39 ` Andreas Leha

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.