From mboxrd@z Thu Jan 1 00:00:00 1970 From: Juan Amiguet Subject: Re: Export attributes for babel blocks Date: Mon, 2 Oct 2017 14:23:08 +0200 Message-ID: References: <87bmlpvoab.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="001a114037d62c596b055a8f7145" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:37064) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dyzky-0004TM-5v for emacs-orgmode@gnu.org; Mon, 02 Oct 2017 08:23:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dyzkw-0004OX-UG for emacs-orgmode@gnu.org; Mon, 02 Oct 2017 08:23:32 -0400 Received: from mail-lf0-x22f.google.com ([2a00:1450:4010:c07::22f]:44745) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dyzkw-0004NS-HC for emacs-orgmode@gnu.org; Mon, 02 Oct 2017 08:23:30 -0400 Received: by mail-lf0-x22f.google.com with SMTP id l196so5832055lfl.1 for ; Mon, 02 Oct 2017 05:23:30 -0700 (PDT) In-Reply-To: <87bmlpvoab.fsf@gmail.com> 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" To: Juan Amiguet , emacs-orgmode@gnu.org --001a114037d62c596b055a8f7145 Content-Type: text/plain; charset="UTF-8" Eric, Thanks a lot for your answer it works with the following updates --8<---------------cut here---------------start------------->8--- #+begin_src dot :file test.png digraph test { A -> B } #+end_src #+attr_latex: :width .5\linewidth #+RESULTS: [[file:test.png]] --8<---------------cut here---------------end--------------->8--- Kind regards. -- Juan Amiguet Vercher Practising theorist All-round geek Polyglot polymath +41(0)774867913 On Mon, Oct 2, 2017 at 12:26 PM, Eric S Fraga wrote: > 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 > --001a114037d62c596b055a8f7145 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Eric,

Thanks a lot for your answer = it works with the following updates

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


#+attr_latex: :width .5\linewidth
#+RESULTS:
[[file:tes= t.png]]
--8<---------------cut here---------------end--------<= wbr>------->8---

Kind regards.

--
Juan Amiguet = Vercher
Practising theorist
All-round geek
Polyglot polymath
+41(0)774867913

On Mon, Oct 2, 2017 at 12:26 PM, Eric S Frag= a <esflists@gmail.com> wrote:
On Monday,=C2=A0 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 poin= t 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 attri= bute
> 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=3D.5/linewidth
> [[file:./test.png]]
>
> Is there a way of passing the export attributes to babel blocks in a w= ay in
> which from direct rendering of the document things work and I can adju= st?
> 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.=C2=A0 I.e.:

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

#+attr_latex: width=3D.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

--001a114037d62c596b055a8f7145--