From: Eric Schulte <schulte.eric@gmail.com>
To: Torsten Wagner <torsten.wagner@gmail.com>
Cc: nicholas.dokos@hp.com, Org Mode Mailing List <emacs-orgmode@gnu.org>
Subject: Re: [babel] create tikz pictures in an floating LaTeX environment
Date: Sat, 08 Oct 2011 13:49:52 -0600 [thread overview]
Message-ID: <87sjn3p8kf.fsf@gmail.com> (raw)
In-Reply-To: <CAPaq-gOPRNdt9DqxEO7WGBYC0eKJOggvXqXhMOUdLiFwLLQfkQ@mail.gmail.com> (Torsten Wagner's message of "Sat, 8 Oct 2011 23:45:29 +0900")
[-- Attachment #1: Type: text/plain, Size: 1022 bytes --]
Torsten Wagner <torsten.wagner@gmail.com> writes:
> Hi Eric
>
>>>
>>> ``:results output silent'' should suppress that I think.
>>>
>>
>> Nick's solution should work well. Also, (if you're exporting to LaTeX)
>> couldn't you just combine the tikz picture and the wrapping figure
>> environment into a single begin_latex block?
>>
>
> Yep Nick solution is working fine. I just wonder what is the order of
> execution during export. E.g. if I generate the link to a file as
> output and place it directly under the lines to add a picture in
> org-mode, I thought the code block would be execute first and the
> result would replace the function call. The exporter will find a link
> to a picture and export it as usual. This was the reason I thought the
> following code should work.
>
Your code example can be reworked as follows and it should export as
expected. With a named code block the result may be positioned anywhere
in an Org-mode file regardless of the position of the code block.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: my-great-picture.org --]
[-- Type: text/x-org, Size: 832 bytes --]
The caption, label and attr_latex lines will be applied to the named result.
#+CAPTION: my great picture
#+LABEL: fig:my_picture
#+ATTR_LaTeX:
#+results: mypicture
[[file:fig/mypicture.pdf]]
This code block may be anywhere in the Org-mode file the result will
always be placed at the named results line above.
#+srcname: mypicture
#+begin_src latex :file fig/mypicture.pdf :packages '(("" "tikz")) :border 1em :fit :results raw
\begin{tikzpicture}[line width=1pt,text centered, inner sep = 2]
\draw[fill=red!50] (0,0) rectangle ++(5,1);
\draw[fill=yellow!50] (1,1) rectangle ++(1,0.25);
\draw[fill=yellow!50] (3,1) rectangle ++(1,0.25);
\draw[fill=green!50] (0.75,1) rectangle ++(1.5,-0.4);
\draw[fill=green!50] (2.75,1) rectangle ++(1.5,-0.4);
\end{scope}
\end{tikzpicture}
#+end_src
[-- Attachment #3: Type: text/plain, Size: 1092 bytes --]
Best -- Eric
>
> As for putting all figure environment and tikz into one latex-code block.
> First of all I thought that :file fig/mypicture.pdf will generate and
> process an individual LaTeX file. Thus, I could not use any commands
> for the main manuscript right? Sure I could skip the :file command
> however, I would prefer to generate each picture as an individual pdf
> file. This gives me much more flexibility. I can easily convert them
> into any other format and share them individually with co-workers.
> Furthermore, many journals are very strict (and minimal) with there
> supported LaTeX environment. The tikz package is often not installed
> on there machines and the upload process would fail. In addition some
> journals require to upload each figure individually. Thus, I am used
> already to generate individual pdf-files for each figure and include
> them into the manuscript by a simple \includegraphic line.
>
> Thanks for the help
>
> Torsten
>
> CC. I notice something else regarding to babel. Please see my next post
--
Eric Schulte
http://cs.unm.edu/~eschulte/
next prev parent reply other threads:[~2011-10-08 19:50 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-07 14:02 [babel] create tikz pictures in an floating LaTeX environment Torsten Wagner
2011-10-07 14:13 ` Nick Dokos
2011-10-07 15:14 ` Eric Schulte
2011-10-07 21:26 ` Darlan Cavalcante Moreira
2011-10-07 21:44 ` Tom Prince
2011-10-08 6:32 ` Achim Gratz
2011-10-08 14:45 ` Torsten Wagner
2011-10-08 19:49 ` Eric Schulte [this message]
2011-10-09 7:30 ` Christian Moe
2011-10-08 14:29 ` Torsten Wagner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87sjn3p8kf.fsf@gmail.com \
--to=schulte.eric@gmail.com \
--cc=emacs-orgmode@gnu.org \
--cc=nicholas.dokos@hp.com \
--cc=torsten.wagner@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).