emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* controling width of graphviz source block result
@ 2014-02-21 16:55 regcl
  2014-02-21 17:25 ` Nicolas Goaziou
  0 siblings, 1 reply; 8+ messages in thread
From: regcl @ 2014-02-21 16:55 UTC (permalink / raw)
  To: emacs-orgmode


When I try to control the width of the image produced by 
included graphviz (DOT) code like so ...

#+ATTR_HTML: :width 300
#+INCLUDE: gnus.dot SRC dot :file gnus.png :exports results

... width is not controlled. 

This works ...

#+INCLUDE: "gnus.dot" SRC dot :file gnus.png :exports none
#+ATTR_HTML: :width 300
file:gnus.png

So it makes me wonder... Is this a bug or operator error?

Thanks,
regcl

GNU Emacs 24.3.1 (x86_64-unknown-linux-gnu, X toolkit, Xaw scroll bars)
of 2014-02-20 on e3

Org-mode version 8.2.5c (release_8.2.5c @
/home/regcl/.emacs.d/lisp/org-mode/lisp/)

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

* Re: controling width of graphviz source block result
  2014-02-21 16:55 controling width of graphviz source block result regcl
@ 2014-02-21 17:25 ` Nicolas Goaziou
  2014-02-21 20:11   ` regcl
  0 siblings, 1 reply; 8+ messages in thread
From: Nicolas Goaziou @ 2014-02-21 17:25 UTC (permalink / raw)
  To: regcl; +Cc: emacs-orgmode

Hello,

regcl <regcl@channing.harvard.edu> writes:

> When I try to control the width of the image produced by 
> included graphviz (DOT) code like so ...
>
> #+ATTR_HTML: :width 300
> #+INCLUDE: gnus.dot SRC dot :file gnus.png :exports results
>
> ... width is not controlled.

Here the HTML attribute applies to the INCLUDE keyword below.

> #+INCLUDE: "gnus.dot" SRC dot :file gnus.png :exports none
> #+ATTR_HTML: :width 300
> file:gnus.png

Here, the HTML attribute applies to the link below.

Therefore, the behaviour is to be expected.


Regards,

-- 
Nicolas Goaziou

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

* Re: controling width of graphviz source block result
  2014-02-21 17:25 ` Nicolas Goaziou
@ 2014-02-21 20:11   ` regcl
  2014-02-22  8:45     ` Nicolas Goaziou
  0 siblings, 1 reply; 8+ messages in thread
From: regcl @ 2014-02-21 20:11 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: emacs-orgmode

Nicolas Goaziou <n.goaziou@gmail.com> writes:

> Hello,
>
> regcl <regcl@channing.harvard.edu> writes:
>
>> When I try to control the width of the image produced by 
>> included graphviz (DOT) code like so ...
>>
>> #+ATTR_HTML: :width 300
>> #+INCLUDE: gnus.dot SRC dot :file gnus.png :exports results
>>
>> ... width is not controlled.
>
> Here the HTML attribute applies to the INCLUDE keyword below.
>
>> #+INCLUDE: "gnus.dot" SRC dot :file gnus.png :exports none
>> #+ATTR_HTML: :width 300
>> file:gnus.png
>
> Here, the HTML attribute applies to the link below.
>
> Therefore, the behaviour is to be expected.
>
>
> Regards,

So I am understanding from your answer that attribues only "modify" the
next immediate "thing" in the .org document, and do not persist, so to
speak.

But I have discovered that it works to stack them up like this ...

#+ATTR_HTML: :width 1000
#+ATTR_ODT: :width 15 :height 15
[[file:gnus.png]]

... so I am a little confused. 

Could you please clarify?

Thanks,
regcl

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

* Re: controling width of graphviz source block result
  2014-02-21 20:11   ` regcl
@ 2014-02-22  8:45     ` Nicolas Goaziou
  2014-02-23  3:01       ` regcl
  2014-06-12 22:29       ` regcl
  0 siblings, 2 replies; 8+ messages in thread
From: Nicolas Goaziou @ 2014-02-22  8:45 UTC (permalink / raw)
  To: regcl; +Cc: emacs-orgmode

Hello,

regcl <regcl@channing.harvard.edu> writes:

> So I am understanding from your answer that attribues only "modify" the
> next immediate "thing" in the .org document, and do not persist, so to
> speak.

"things" are called "elements" in Org lingo and "attributes" are called
"affiliated keywords". So, yes, affiliated keywords apply to the element
right after them.

> But I have discovered that it works to stack them up like this ...
>
> #+ATTR_HTML: :width 1000
> #+ATTR_ODT: :width 15 :height 15
> [[file:gnus.png]]
>
> ... so I am a little confused. 
>
> Could you please clarify?

Both keywords are affiliated keywords. There is only one element in this
example (a paragraph containing a single link). Affiliated keywords
apply to the next element, not the next affiliated keyword.

For more information, see:

  http://orgmode.org/worg/dev/org-syntax.html

or the comments at the beginning of "org-element.el".


Regards,

-- 
Nicolas Goaziou

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

* Re: controling width of graphviz source block result
  2014-02-22  8:45     ` Nicolas Goaziou
@ 2014-02-23  3:01       ` regcl
  2014-06-12 22:29       ` regcl
  1 sibling, 0 replies; 8+ messages in thread
From: regcl @ 2014-02-23  3:01 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: emacs-orgmode

Nicolas Goaziou <n.goaziou@gmail.com> writes:

> Hello,
>
> regcl <regcl@channing.harvard.edu> writes:
>
>> So I am understanding from your answer that attribues only "modify" the
>> next immediate "thing" in the .org document, and do not persist, so to
>> speak.
>
> "things" are called "elements" in Org lingo and "attributes" are called
> "affiliated keywords". So, yes, affiliated keywords apply to the element
> right after them.
>
>> But I have discovered that it works to stack them up like this ...
>>
>> #+ATTR_HTML: :width 1000
>> #+ATTR_ODT: :width 15 :height 15
>> [[file:gnus.png]]
>>
>> ... so I am a little confused. 
>>
>> Could you please clarify?
>
> Both keywords are affiliated keywords. There is only one element in this
> example (a paragraph containing a single link). Affiliated keywords
> apply to the next element, not the next affiliated keyword.
>
> For more information, see:
>
>   http://orgmode.org/worg/dev/org-syntax.html
>
> or the comments at the beginning of "org-element.el".
>
>
> Regards,

Thank you, this is helpful. May require a little study ;)

best,
regcl

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

* Re: controling width of graphviz source block result
  2014-02-22  8:45     ` Nicolas Goaziou
  2014-02-23  3:01       ` regcl
@ 2014-06-12 22:29       ` regcl
  2014-06-14 11:54         ` Nicolas Goaziou
  2014-06-17 12:25         ` Sebastien Vauban
  1 sibling, 2 replies; 8+ messages in thread
From: regcl @ 2014-06-12 22:29 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: emacs-orgmode

Hi Nicolas, 

Thank you for your earlier comments.  In order to adjust the scaling of
a graphic generated by a R source block I am doing this ...

** adjusting scaling of a figure generated from source
#+begin_src R :results graphics silent :file foo2.pdf :exports results 
  plot(c(1:10), c(10:1))
  #+end_src
#+attr_latex: :width .35\textwidth
file:foo2.pdf 

While this does work, it is a wee bit unsatisfying to type "foo2.pdf""
twice.

Is there a better way to apply the latex keyword to the results?

Many thanks,
regcl

Nicolas Goaziou <n.goaziou@gmail.com> writes:

> Hello,
>
> regcl <regcl@channing.harvard.edu> writes:
>
>> So I am understanding from your answer that attribues only "modify" the
>> next immediate "thing" in the .org document, and do not persist, so to
>> speak.
>
> "things" are called "elements" in Org lingo and "attributes" are called
> "affiliated keywords". So, yes, affiliated keywords apply to the element
> right after them.
>
>> But I have discovered that it works to stack them up like this ...
>>
>> #+ATTR_HTML: :width 1000
>> #+ATTR_ODT: :width 15 :height 15
>> [[file:gnus.png]]
>>
>> ... so I am a little confused. 
>>
>> Could you please clarify?
>
> Both keywords are affiliated keywords. There is only one element in this
> example (a paragraph containing a single link). Affiliated keywords
> apply to the next element, not the next affiliated keyword.
>
> For more information, see:
>
>   http://orgmode.org/worg/dev/org-syntax.html
>
> or the comments at the beginning of "org-element.el".
>
>
> Regards,

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

* Re: controling width of graphviz source block result
  2014-06-12 22:29       ` regcl
@ 2014-06-14 11:54         ` Nicolas Goaziou
  2014-06-17 12:25         ` Sebastien Vauban
  1 sibling, 0 replies; 8+ messages in thread
From: Nicolas Goaziou @ 2014-06-14 11:54 UTC (permalink / raw)
  To: regcl; +Cc: emacs-orgmode

Hello,

regcl <regcl@channing.harvard.edu> writes:

> Thank you for your earlier comments.  In order to adjust the scaling of
> a graphic generated by a R source block I am doing this ...
>
> ** adjusting scaling of a figure generated from source
> #+begin_src R :results graphics silent :file foo2.pdf :exports results 
>   plot(c(1:10), c(10:1))
>   #+end_src
> #+attr_latex: :width .35\textwidth
> file:foo2.pdf 
>
> While this does work, it is a wee bit unsatisfying to type "foo2.pdf""
> twice.
>
> Is there a better way to apply the latex keyword to the results?

I don't know what the current state of the art is, but I usually add
a name to the block, generate the result link, and add attributes above.


Regards,

-- 
Nicolas Goaziou

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

* Re: controling width of graphviz source block result
  2014-06-12 22:29       ` regcl
  2014-06-14 11:54         ` Nicolas Goaziou
@ 2014-06-17 12:25         ` Sebastien Vauban
  1 sibling, 0 replies; 8+ messages in thread
From: Sebastien Vauban @ 2014-06-17 12:25 UTC (permalink / raw)
  To: emacs-orgmode-mXXj517/zsQ

regcl wrote:
> Thank you for your earlier comments.  In order to adjust the scaling of
> a graphic generated by a R source block I am doing this ...
>
> ** adjusting scaling of a figure generated from source
>
> #+begin_src R :results graphics silent :file foo2.pdf :exports results 
>   plot(c(1:10), c(10:1))
>   #+end_src
>
> #+attr_latex: :width .35\textwidth
> file:foo2.pdf 
>
> While this does work, it is a wee bit unsatisfying to type "foo2.pdf""
> twice.
>
> Is there a better way to apply the latex keyword to the results?

What I do is that I simply execute it a first time, so that the link is
created (that is, the name is copied) by Org.

Best regards,
  Seb

-- 
Sebastien Vauban

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

end of thread, other threads:[~2014-06-17 12:25 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-21 16:55 controling width of graphviz source block result regcl
2014-02-21 17:25 ` Nicolas Goaziou
2014-02-21 20:11   ` regcl
2014-02-22  8:45     ` Nicolas Goaziou
2014-02-23  3:01       ` regcl
2014-06-12 22:29       ` regcl
2014-06-14 11:54         ` Nicolas Goaziou
2014-06-17 12:25         ` Sebastien Vauban

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