emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Bug: Org Bable: Set R-specific buffer-wide graphics headers == no R src block eval [8.2.10 (8.2.10-1-g8b63dc-elpa @ /home/user/.emacs.d/elpa/org-20141027/)]
@ 2014-11-01  4:50 myq larson
  2014-11-02 22:50 ` John Hendy
  0 siblings, 1 reply; 4+ messages in thread
From: myq larson @ 2014-11-01  4:50 UTC (permalink / raw)
  To: emacs-orgmode

Remember to cover the basics, that is, what you expected to happen and
what in fact did happen.  You don't know how to make a good report?  See

     http://orgmode.org/manual/Feedback.html#Feedback

Your bug report will be posted to the Org-mode mailing list.
------------------------------------------------------------------------

The documentation suggests that the following should be possible:

    ,----
    | #+PROPERTY: header-args:R :exports results
    | #+PROPERTY: header-args   :results output graphics
    | #+PROPERTY: header-args:R :width 400
    |
    | #+BEGIN_SRC R :file /tmp/bug.png
    |   plot(rnorm(100));
    | #+END_SRC
    `----

But the third line (`#+PROPERTY: header-args:R :width 400') silently
prevents /all/ R blocks from being evaluated. Changing the document to
the following works:

    ,----
    | #+PROPERTY: header-args:R :exports results
    | #+PROPERTY: header-args   :results output graphics
    |
    | #+BEGIN_SRC R  :width 400 :file /tmp/bug.png
    |   plot(rnorm(100));
    | #+END_SRC
    `----

but doing so means that buffer-wide, /language-specific/ header defaults can not
be set to maintain consistency (at least for R) which is unfortunate. It
seems that buffer-wide headers can be set for /specific languages/, but
not language-specific headers? Maybe I haven't read enough of the
documentation yet, but it seems like that should be possible.

Thank you very much for this wonderful code/format/project. It's very useful!

Emacs  : GNU Emacs 24.3.1 (i686-pc-linux-gnu, GTK+ Version 3.4.2)
 of 2014-02-23 on chindi10, modified by Debian
Package: Org-mode version 8.2.10 (8.2.10-1-g8b63dc-elpa @
/home/myq/.emacs.d/elpa/org-20141027/)

current state:
==============
(setq
 org-ctrl-c-ctrl-c-hook '(org-babel-hash-at-point
org-babel-execute-safely-maybe)
 org-latex-format-headline-function 'org-latex-format-headline-default-function
 org-latex-packages-alist '(("" "booktabs" t))
 org-src-fontify-natively t
 org-html-format-inlinetask-function 'ignore
 org-tab-first-hook '(org-hide-block-toggle-maybe
org-src-native-tab-command-maybe
                      org-babel-hide-result-toggle-maybe
org-babel-header-arg-expand)
 org-cycle-hook '(org-cycle-hide-archived-subtrees
org-cycle-hide-drawers org-cycle-hide-inline-tasks
                  org-cycle-show-empty-lines
org-optimize-window-after-visibility-change)
 org-agenda-before-write-hook '(org-agenda-add-entry-text)
 org-speed-command-hook '(org-speed-command-default-hook
org-babel-speed-command-hook)
 org-ascii-format-inlinetask-function 'org-ascii-format-inlinetask-default
 org-fontify-done-headline t
 org-babel-pre-tangle-hook '(save-buffer)
 org-occur-hook '(org-first-headline-recenter)
 org-src-lang-modes '(("ocaml" . tuareg) ("elisp" . emacs-lisp)
("ditaa" . artist) ("asymptote" . asy)
                      ("dot" . fundamental) ("sqlite" . sql) ("calc" .
fundamental) ("C" . c)
                      ("cpp" . c++) ("C++" . c++) ("screen" .
shell-script) ("bash" . sh))
 org-html-format-headline-function 'ignore
 org-log-done 'time
 org-metaup-hook '(org-babel-load-in-session-maybe)
 org-confirm-elisp-link-function 'yes-or-no-p
 org-default-notes-file "notes.org"
 org-latex-classes '(("beamer" "\\documentclass[presentation]{beamer}"
                      ("\\section{%s}" . "\\section*{%s}")
("\\subsection{%s}" . "\\subsection*{%s}")
                      ("\\subsubsection{%s}" . "\\subsubsection*{%s}"))
                     ("article" "\\documentclass[11pt]{article}"
("\\section{%s}" . "\\section*{%s}")
                      ("\\subsection{%s}" . "\\subsection*{%s}")
                      ("\\subsubsection{%s}" . "\\subsubsection*{%s}")
                      ("\\paragraph{%s}" . "\\paragraph*{%s}")
                      ("\\subparagraph{%s}" . "\\subparagraph*{%s}"))
                     ("report" "\\documentclass[11pt]{report}"
("\\part{%s}" . "\\part*{%s}")
                      ("\\chapter{%s}" . "\\chapter*{%s}")
("\\section{%s}" . "\\section*{%s}")
                      ("\\subsection{%s}" . "\\subsection*{%s}")
                      ("\\subsubsection{%s}" . "\\subsubsection*{%s}"))
                     ("book" "\\documentclass[11pt]{book}"
("\\part{%s}" . "\\part*{%s}")
                      ("\\chapter{%s}" . "\\chapter*{%s}")
("\\section{%s}" . "\\section*{%s}")
                      ("\\subsection{%s}" . "\\subsection*{%s}")
                      ("\\subsubsection{%s}" . "\\subsubsection*{%s}"))
                     )
 org-babel-exp-call-line-template '\\num{%line}
 org-latex-format-drawer-function '(lambda (name contents) contents)
 org-export-backends '(ascii beamer html icalendar latex md odt org s5)
 org-clock-out-hook '(org-clock-remove-empty-clock-drawer)
 org-latex-tables-booktabs t
 org-latex-default-figure-position "tbh!"
 org-mode-hook '(#[nil "\300\301\302\303\304$\207"
                   [org-add-hook change-major-mode-hook
org-show-block-all append local] 5]
                 #[nil "\300\301\302\303\304$\207"
                   [org-add-hook change-major-mode-hook
org-babel-show-result-all append local] 5]
                 org-babel-result-hide-spec org-babel-hide-all-hashes
                 org-journal-update-auto-mode-alist)
 org-ascii-format-drawer-function '(lambda (name contents width) contents)
 org-directory "~/doc/org"
 org-odt-format-drawer-function '(lambda (name contents) contents)
 org-latex-listings t
 org-html-format-drawer-function '(lambda (name contents) contents)
 org-odt-format-headline-function 'ignore
 org-metadown-hook '(org-babel-pop-to-session-maybe)
 org-drawers '("PROPERTIES" "CLOCK" "LOGBOOK" "RESULTS" "DETAILS")
 org-file-apps '((auto-mode . emacs) ("\\.mm\\'" . default)
("\\.x?html?\\'" . default)
                 ("\\.pdf\\'" . "evince %s"))
 org-src-mode-hook '(org-src-babel-configure-edit-buffer
org-src-mode-configure-edit-buffer)
 org-after-todo-state-change-hook '(org-clock-out-if-current)
 org-odt-format-inlinetask-function 'ignore
 org-babel-tangle-lang-exts '(("latex" . "tex") ("awk" . "awk")
("perl" . "pl") ("emacs-lisp" . "el"))
 org-babel-load-languages '((emacs-lisp . t) (sh . t) (perl . t) (awk
. t) (R . t) (js . t)
                            (ledger . t) (latex . t) (sql . t) (sqlite
. t) (plantuml . t))
 org-latex-format-inlinetask-function 'ignore
 org-confirm-shell-link-function 'yes-or-no-p
 )

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

* Re: Bug: Org Bable: Set R-specific buffer-wide graphics headers == no R src block eval [8.2.10 (8.2.10-1-g8b63dc-elpa @ /home/user/.emacs.d/elpa/org-20141027/)]
  2014-11-01  4:50 Bug: Org Bable: Set R-specific buffer-wide graphics headers == no R src block eval [8.2.10 (8.2.10-1-g8b63dc-elpa @ /home/user/.emacs.d/elpa/org-20141027/)] myq larson
@ 2014-11-02 22:50 ` John Hendy
  2014-11-02 22:55   ` Nicolas Goaziou
  0 siblings, 1 reply; 4+ messages in thread
From: John Hendy @ 2014-11-02 22:50 UTC (permalink / raw)
  To: myq larson; +Cc: emacs-orgmode

On Fri, Oct 31, 2014 at 11:50 PM, myq larson <myq@wordish.org> wrote:
> Remember to cover the basics, that is, what you expected to happen and
> what in fact did happen.  You don't know how to make a good report?  See
>
>      http://orgmode.org/manual/Feedback.html#Feedback
>
> Your bug report will be posted to the Org-mode mailing list.
> ------------------------------------------------------------------------
>
> The documentation suggests that the following should be possible:

Could you link to the /specific/ documentation where you saw this?
Since Org uses a manual as well as a ton of stuff in Worg, I find it
helpful to look at the actual bit of code/explanation you were looking
at. For example, the manual leads me to *somewhat* agree that the
following should be possible (more on that later):
- http://orgmode.org/manual/Header-arguments-in-Org-mode-properties.html

>     ,----
>     | #+PROPERTY: header-args:R :exports results
>     | #+PROPERTY: header-args   :results output graphics
>     | #+PROPERTY: header-args:R :width 400
>     |
>     | #+BEGIN_SRC R :file /tmp/bug.png
>     |   plot(rnorm(100));
>     | #+END_SRC
>     `----
>
> But the third line (`#+PROPERTY: header-args:R :width 400') silently
> prevents /all/ R blocks from being evaluated. Changing the document to
> the following works:

I think your interpretation may be incorrect. Why do you think the
blocks are not being evaluated?

From fiddling around myself, I believe the true cause is that the
buffer can accept only *one* of each of these properties. My guess is
that you're setting a variable somewhere, and adding two
=header-args:R= simply overwrites the variable with the contents of
the second vs. appending it. I could be wrong.

>     ,----
>     | #+PROPERTY: header-args:R :exports results
>     | #+PROPERTY: header-args   :results output graphics
>     |
>     | #+BEGIN_SRC R  :width 400 :file /tmp/bug.png
>     |   plot(rnorm(100));
>     | #+END_SRC
>     `----
>
> but doing so means that buffer-wide, /language-specific/ header defaults can not
> be set to maintain consistency (at least for R) which is unfortunate. It
> seems that buffer-wide headers can be set for /specific languages/, but
> not language-specific headers? Maybe I haven't read enough of the
> documentation yet, but it seems like that should be possible.

Here was my experiment:

Generates bug.png, exports into PDF, and size responds to changing 800 <-> 400
#+PROPERTY: header-args:R :width 800 :exports results
#+PROPERTY: header-args   :results output graphics

Generates bug.png, exports into PDF, but size is not affected by :width arg
#+PROPERTY: header-args:R :width 800
#+PROPERTY: header-args   :results output graphics
#+PROPERTY: header-args:R :exports results

Generates bug.png, does *not* export to PDF, but you can verify that
the size changes by viewing bug.png after using different :width
settings:
#+PROPERTY: header-args:R :exports results
#+PROPERTY: header-args   :results output graphics
#+PROPERTY: header-args:R :width 800

So, my conclusion was that only the second property gets applied. If
your conclusion that the block wasn't being executed was due to the
plot not appearing in your resultant document, then we're on the same
page. If you didn't even get a bug.png file with any of the
combinations above... then maybe we have different issues.

M-x org-version
Org-mode version 8.3beta (release_8.3beta-483-g58bb3a @
/home/jwhendy/.elisp/org.git/lisp/)

It's up to someone else regarding whether or not the #+property
behavior is desired. I wondered what two subsequent #+options lines
would do, for example, and they appear to be cumulative. For example:

#+options:  toc:nil
#+options: num:nil

Yielded both results even though the default contains both. An analog
would have been for my document to retain a toc but with no section
numbers. So, *something's* different between how these behave.


Best regards,
John


> Thank you very much for this wonderful code/format/project. It's very useful!

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

* Re: Bug: Org Bable: Set R-specific buffer-wide graphics headers == no R src block eval [8.2.10 (8.2.10-1-g8b63dc-elpa @ /home/user/.emacs.d/elpa/org-20141027/)]
  2014-11-02 22:50 ` John Hendy
@ 2014-11-02 22:55   ` Nicolas Goaziou
  2014-11-02 22:58     ` John Hendy
  0 siblings, 1 reply; 4+ messages in thread
From: Nicolas Goaziou @ 2014-11-02 22:55 UTC (permalink / raw)
  To: John Hendy; +Cc: emacs-orgmode, myq larson

Hello,

John Hendy <jw.hendy@gmail.com> writes:

> It's up to someone else regarding whether or not the #+property
> behavior is desired. I wondered what two subsequent #+options lines
> would do, for example, and they appear to be cumulative. For example:
>
> #+options:  toc:nil
> #+options: num:nil
>
> Yielded both results even though the default contains both. An analog
> would have been for my document to retain a toc but with no section
> numbers. So, *something's* different between how these behave.

See

  (info "(org) Property syntax")

in particular, the "var+" syntax.


Regards,

-- 
Nicolas Goaziou

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

* Re: Bug: Org Bable: Set R-specific buffer-wide graphics headers == no R src block eval [8.2.10 (8.2.10-1-g8b63dc-elpa @ /home/user/.emacs.d/elpa/org-20141027/)]
  2014-11-02 22:55   ` Nicolas Goaziou
@ 2014-11-02 22:58     ` John Hendy
  0 siblings, 0 replies; 4+ messages in thread
From: John Hendy @ 2014-11-02 22:58 UTC (permalink / raw)
  To: John Hendy, myq larson, emacs-orgmode

On Sun, Nov 2, 2014 at 4:55 PM, Nicolas Goaziou <mail@nicolasgoaziou.fr> wrote:
> Hello,
>
> John Hendy <jw.hendy@gmail.com> writes:
>
>> It's up to someone else regarding whether or not the #+property
>> behavior is desired. I wondered what two subsequent #+options lines
>> would do, for example, and they appear to be cumulative. For example:
>>
>> #+options:  toc:nil
>> #+options: num:nil
>>
>> Yielded both results even though the default contains both. An analog
>> would have been for my document to retain a toc but with no section
>> numbers. So, *something's* different between how these behave.
>
> See
>
>   (info "(org) Property syntax")
>
> in particular, the "var+" syntax.

Awesome! Indeed, myq, this works, for reference:

#+PROPERTY: header-args:R :exports results
#+PROPERTY: header-args   :results output graphics
#+PROPERTY: header-args:R+ :width 800

Also, don't forget to =C-c C-c= on these arguments (just one of them
in your preamble) to make sure they're updated before trying another
export. (Only mentioning this as I often forget and then think
something didn't work...)


John

>
>
> Regards,
>
> --
> Nicolas Goaziou

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

end of thread, other threads:[~2014-11-02 22:58 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-01  4:50 Bug: Org Bable: Set R-specific buffer-wide graphics headers == no R src block eval [8.2.10 (8.2.10-1-g8b63dc-elpa @ /home/user/.emacs.d/elpa/org-20141027/)] myq larson
2014-11-02 22:50 ` John Hendy
2014-11-02 22:55   ` Nicolas Goaziou
2014-11-02 22:58     ` John Hendy

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