From mboxrd@z Thu Jan 1 00:00:00 1970 From: tsd@tsdye.com (Thomas S. Dye) Subject: Re: Regarding Babel execution Date: Tue, 15 Jan 2013 10:15:40 -1000 Message-ID: References: <20130115185830.GB16515@gwolf.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([208.118.235.92]:51911) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TvCvZ-0008J2-SR for emacs-orgmode@gnu.org; Tue, 15 Jan 2013 15:16:11 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TvCvX-00039q-Eb for emacs-orgmode@gnu.org; Tue, 15 Jan 2013 15:16:09 -0500 Received: from oproxy7-pub.bluehost.com ([67.222.55.9]:44833) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1TvCvX-00038Y-60 for emacs-orgmode@gnu.org; Tue, 15 Jan 2013 15:16:07 -0500 In-Reply-To: <20130115185830.GB16515@gwolf.org> (Gunnar Wolf's message of "Tue, 15 Jan 2013 12:58:30 -0600") 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: Gunnar Wolf Cc: emacs-orgmode@gnu.org Aloha Gunnar Wolf, Gunnar Wolf writes: > Hi, > > I recently switched from having several Graphviz files to inlining > them via Babel in my source Org file. However, I noticed something > that might either be strange, or might just mean I don't yet > understand some stuff (as a relative newbie): I usually follow this > pattern to include my graphics: > > #+begin_center > #+attr_html: height=3D"350" > #+attr_latex: width=3D0.5\textwidth > [[./img/foo.png]] > > This is the caption for foo.png > #+end_center > > But if I try to replace this [[./img/foo.png]] with a > =C2=AB#+begin_src dot=C2=BB block, it does not get picked up by Babel (an= d ends > up in the generated document as a syntax-highlighted block =E2=80=94 So, > clearly, org-mode understands it's a source block, but Babel ignores > it). > > I currently commented out the #+begin_center and #+end_center > statements, but I'd really like to have them back. Or, at least, to > find a more proper way to mark the images (and captions!) as material > that should be distinguished from the flowing text. Something along > the lines of the LaTeX =C2=ABfigure=C2=BB environment. If you use #+caption:, then the image will be wrapped in a figure environment when it is exported to latex. See the Org manual at 12.6.5 "Images in LaTeX export." Here is an example using the a dot source code block and the "new exporter" which currently resides in contrib/. #+name: fundamental-model #+header: :exports results #+header: :file fundamental-model.pdf #+BEGIN_SRC dot graph G { graph [margin=3D"0.01"]; d [label =3D "Dated event", shape =3D"box"]; t [label =3D "Target event"]; d -- t [label =3D "Association", dir =3D "both", len =3D 2]; {rank=3Dsame; d t;} } #+END_SRC #+CAPTION[The fundamental relationship of a chronological model]: *The fund= amental relationship of a chronological model based on radiometric dating.* #+ATTR_LaTeX: :options "width=3D232pt" :placement "[ht!]" :comment-include t #+NAME: fig:fundamental #+RESULTS: fundamental-model [[file:fundamental-model.pdf]] If you use the "old exporter" (which I believe you are using), then you will need to use LaTeX attributes different than those I've shown, but you have these working already, so should be in good shape. Also, the #+caption: syntax is a bit different between the two exporters. For the old exporter, see the Org manual or http://orgmode.org/worg/org-tutorials/org-latex-export.html#sec-10-4. hth, Tom --=20 Thomas S. Dye http://www.tsdye.com