From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Schulte Subject: Re: [babel] create tikz pictures in an floating LaTeX environment Date: Sat, 08 Oct 2011 13:49:52 -0600 Message-ID: <87sjn3p8kf.fsf@gmail.com> References: <6991.1317996835@alphaville.dokosmarshall.org> <8762k0suk3.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([140.186.70.92]:44608) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RCcuG-000142-Dx for emacs-orgmode@gnu.org; Sat, 08 Oct 2011 15:50:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RCcuE-0001F4-TW for emacs-orgmode@gnu.org; Sat, 08 Oct 2011 15:50:00 -0400 Received: from mail-gx0-f169.google.com ([209.85.161.169]:55327) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RCcuE-0001Ew-N6 for emacs-orgmode@gnu.org; Sat, 08 Oct 2011 15:49:58 -0400 Received: by ggdk5 with SMTP id k5so4293001ggd.0 for ; Sat, 08 Oct 2011 12:49:57 -0700 (PDT) In-Reply-To: (Torsten Wagner's message of "Sat, 8 Oct 2011 23:45:29 +0900") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Torsten Wagner Cc: nicholas.dokos@hp.com, Org Mode Mailing List --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Torsten Wagner writes: > Hi Eric > >>> >>> ``:results output silent'' should suppress that I think. >>> >> >> Nick's solution should work well. =C2=A0Also, (if you're exporting to La= TeX) >> 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. --=-=-= Content-Type: text/x-org Content-Disposition: inline; filename=my-great-picture.org 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 --=-=-= Content-Type: text/plain 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/ --=-=-=--