emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] Export attributes for babel blocks


From: Eric S Fraga
Subject: Re: [O] Export attributes for babel blocks
Date: Mon, 02 Oct 2017 11:26:20 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

On Monday,  2 Oct 2017 at 08:46, Juan Amiguet wrote:
> Dear all,
>
> I have been having this issue for quite a while perhaps I am using the
> feature wrong and someone can enlighten me or perhaps someone can point me
> at the bit of code I can patch it myself.
> Here is the issue:
>
> I have a babel block such as
>
> #+begin_src dot :file test.png
> digraph test {
> A -> B
> }
> #+end_src
>
>
> This will create after execution a
>
> #+RESULT:
> [[file:./test.png]]
>
> Now if I would like have something like :width .5/.linewith as a attribute
> to the image the only I have found is to do the following
>
> #+begin_src dot :file test.png :exports none
> digraph test {
> A -> B
> }
> #+end_src
>
> #+attr_latex: width=.5/linewidth
> [[file:./test.png]]
>
> Is there a way of passing the export attributes to babel blocks in a way in
> which from direct rendering of the document things work and I can adjust?
> If now which part of the org mode codebase controls all of this?

Simply add the attr_latex line to just before the #+result line and any
re-evaluation of the src block will work just fine.  I.e.:

--8<---------------cut here---------------start------------->8---
#+begin_src dot :file test.png
digraph test {
A -> B
}
#+end_src

#+attr_latex: width=.5/linewidth
#+RESULT:
[[file:./test.png]]
--8<---------------cut here---------------end--------------->8---

-- 
: Eric S Fraga via Emacs 27.0.50, Org release_9.1.1-78-gfbf47c

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]