emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Regarding Babel execution
@ 2013-01-15 18:58 Gunnar Wolf
  2013-01-15 19:54 ` Gunnar Wolf
  2013-01-15 20:15 ` Thomas S. Dye
  0 siblings, 2 replies; 3+ messages in thread
From: Gunnar Wolf @ 2013-01-15 18:58 UTC (permalink / raw)
  To: emacs-orgmode

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="350"
    #+attr_latex: width=0.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
«#+begin_src dot» block, it does not get picked up by Babel (and ends
up in the generated document as a syntax-highlighted block — 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 «figure» environment.

Thanks,

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

* Re: Regarding Babel execution
  2013-01-15 18:58 Regarding Babel execution Gunnar Wolf
@ 2013-01-15 19:54 ` Gunnar Wolf
  2013-01-15 20:15 ` Thomas S. Dye
  1 sibling, 0 replies; 3+ messages in thread
From: Gunnar Wolf @ 2013-01-15 19:54 UTC (permalink / raw)
  To: emacs-orgmode

Gunnar Wolf dijo [Tue, Jan 15, 2013 at 12:58:30PM -0600]:
> 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 «figure» environment.

Ok, I'm making it clearer and clearer I am a novice: Adding a
#+caption: makes the LaTeX-generated output carry the captions. How
can I make them appear as well in the HTML export?

Thanks,

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

* Re: Regarding Babel execution
  2013-01-15 18:58 Regarding Babel execution Gunnar Wolf
  2013-01-15 19:54 ` Gunnar Wolf
@ 2013-01-15 20:15 ` Thomas S. Dye
  1 sibling, 0 replies; 3+ messages in thread
From: Thomas S. Dye @ 2013-01-15 20:15 UTC (permalink / raw)
  To: Gunnar Wolf; +Cc: emacs-orgmode

Aloha Gunnar Wolf,

Gunnar Wolf <gwolf@gwolf.org> 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="350"
>     #+attr_latex: width=0.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
> «#+begin_src dot» block, it does not get picked up by Babel (and ends
> up in the generated document as a syntax-highlighted block — 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 «figure» 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="0.01"];
          d [label = "Dated event", shape ="box"];
          t [label = "Target event"];
          d -- t [label = "Association", dir = "both", len = 2];
          {rank=same; d t;}
          }
#+END_SRC

#+CAPTION[The fundamental relationship of a chronological model]: *The fundamental relationship of a chronological model based on radiometric dating.*
#+ATTR_LaTeX: :options "width=232pt" :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

-- 
Thomas S. Dye
http://www.tsdye.com

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

end of thread, other threads:[~2013-01-15 20:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-15 18:58 Regarding Babel execution Gunnar Wolf
2013-01-15 19:54 ` Gunnar Wolf
2013-01-15 20:15 ` Thomas S. Dye

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).