emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [babel] Including TikZ diagrams as figures in export
@ 2011-02-20 23:03 Jeffrey Horn
  2011-02-21  1:56 ` Erik Iverson
  0 siblings, 1 reply; 7+ messages in thread
From: Jeffrey Horn @ 2011-02-20 23:03 UTC (permalink / raw)
  To: Org-mode ml

Hey orgsters,

I'm having a hard time fitting TikZ into my workflow. I spent a little time learning TikZ recently and have all the diagrams working in a tex file.

Now, I'd like to integrate them into an org document. I'd like:
1) To use babel to handle the TikZ source
2) To wrap the resulting drawing in a figure environment for automatic numbering and centering
3) To be able to refer to the figure elsewhere in the document
4) (optional) To be able to seamlessly export to both LaTeX and HTML

I don't really care about 4 right now, but the others are frustrating me a bit. I expected this would do what I wanted:

#+caption: This is a figure.
#+label: fig:ref
#+begin_src latex
<<TikZ source goes here>>
#+end_src 

No dice. I get all sorts of unresolved references, no figures, no centering. I'm guess the exporter doesn't know how to integrate TikZ graphics with the #+caption and #+label options. I could create a separate file for holding my diagrams and use babel to spit them out as files, or just use LaTeX and forget about org, but I'd rather not.

So I googled around, thought I had an answer, then tried this:

#+source: a-name
#+begin_src latex
<<TikZ source goes here>>
#+end_src 

#+caption: This is a figure.
#+label: fig:ref
#+begin_src emacs-lisp :var path=a-name :results latex 
(format "input{%s}" path) #+end_src 




I'm not getting what I expect. What do I need to do differently?

And somewhat unrelated, is ":results" now deprecated in favor of ":exports"? What about ":file"? I'm sufficiently new to babel that these all seem like they could be taken care of with a single header argument with many options...

Thanks for the help!

-- 
Jeffrey Horn
http://www.failuretorefrain.com/jeff/

Sent with Sparrow

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

end of thread, other threads:[~2011-02-21 19:30 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-02-20 23:03 [babel] Including TikZ diagrams as figures in export Jeffrey Horn
2011-02-21  1:56 ` Erik Iverson
2011-02-21 15:11   ` Jeff Horn
2011-02-21 16:57     ` Eric Schulte
2011-02-21 19:27       ` Jeff Horn
2011-02-21 16:44   ` Andreas Leha
2011-02-21 19:29     ` Jeff Horn

Code repositories for project(s) associated with this public inbox

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

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 read-only IMAP folder(s) and NNTP newsgroup(s).