emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] [PATCH] ob-R.el, ox-latex.el: support for tikz graphics


From: Achim Gratz
Subject: Re: [O] [PATCH] ob-R.el, ox-latex.el: support for tikz graphics
Date: Tue, 26 Feb 2013 10:50:17 +0000 (UTC)
User-agent: Loom/3.14 (http://gmane.org/)

Nicolas Goaziou <n.goaziou <at> gmail.com> writes:
> Aaron Ecay <aaronecay <at> gmail.com> writes:
> > Tikz graphics should be exported to LaTeX by \include, not as a link.
> > This commit changes the file extension used for tikz graphics from .tex
> > to .tikz.
> 
> I'm wondering if it's really meant to be inserted as an inline image.
> Does it support wrapfigure environment or width optional attribute?

A .tikz file usually contains a tikzpicture environment that wraps around the
actual tikz code.  It produces a box just like includegraphics does, only that
it is normal LaTeX code, and so you need \include to read it.

> If it doesn't, it may be better to implement a dedicated (or a more
> general "input" function) formatting function that would be called from
> `org-latex-link'.

I don't understand.  What I currently need to do for TikZ is this:

#+LaTeX: \begin{figure}[t]\centering
#+LaTeX:   \input{oldModel.tikz}
#+LaTeX:   \caption{Relative modelling error}
#+LaTeX: \label{fig:oldModel}
#+LaTeX: \end{figure}

With the patch that becomes much easier (especially if you want to bounce it to
HTML eventually, even though the HTML exporter would need to grok that the tikz
picture should first be converted to SVG or PNG or some other image format):

#+CAPTION:  Relative modelling error
#+LABEL: fig:oldModel
#+ATTR_LaTeX: :placement [t]
[[file:oldModel.tikz]]

Now, what I'd really like to do is to combine this with the production of the
tikz file by Gnuplot like so:

#+HEADERS:  :term "tikz size 15cm,5cm" :exports none :results yes
#+BEGIN_SRC gnuplot :file oldModel.tikz :cache yes...

#+RESULTS[4d90e02adddfd56f8fbf6bc99963b9bffe1f201e]:
#+CAPTION:  Relative modelling error for DP 0.7 model
#+LABEL: fig:oldModel
#+ATTR_LaTeX: :placement [t]
[[file:oldModel.tikz]]

That works, but I'll always have to remove some extra gunk between the new
result generated and the old one.


Regards,
Achim.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]