From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: Property inheritance in beamer export [7.4] Date: Fri, 11 Nov 2011 17:58:35 +0100 Message-ID: <1CD72022-E05E-477E-8AF0-F569AE3F5FFA@gmail.com> References: Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([140.186.70.92]:53758) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ROvSj-0006Zj-ND for emacs-orgmode@gnu.org; Fri, 11 Nov 2011 13:04:27 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ROvSi-0005FC-8q for emacs-orgmode@gnu.org; Fri, 11 Nov 2011 13:04:25 -0500 Received: from mail-ey0-f169.google.com ([209.85.215.169]:39236) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ROvSh-0005F2-QE for emacs-orgmode@gnu.org; Fri, 11 Nov 2011 13:04:24 -0500 Received: by eye4 with SMTP id 4so4082507eye.0 for ; Fri, 11 Nov 2011 10:04:22 -0800 (PST) In-Reply-To: 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-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Chris Kauffman Cc: emacs-orgmode@gnu.org Hi Chris, On 11.11.2011, at 05:34, Chris Kauffman wrote: >=20 > I use org for constructing simple slide presentations quite a > bit. I'd like to be able to set a global property which shrinks > all text to fit in the allotted space; this is great for source > examples. Have you read the beamer documentation? After reading about shrink, do you still mean to apply this evil thing? :) > After some experimentation I put >=20 > #+PROPERTY: BEAMER_envargs [shrink] >=20 > in the preamble and evaluated >=20 > (set-variable (quote org-use-property-inheritance) t nil) >=20 > According to my understanding of the documentation, this should > make very outline entry inherit the property BEAMER_envargs, > regardless of whether it has a properties list itself. Yes, I agree this is what the documentation looks like. However, the imlementation of org-beamer.el only looks at the local properties. TO speed up processing, Org grabs all properties at each headline and stores them - without inheritance. > After > reloading the file, internally this seems to work fine: I move to > any heading and eval the following lisp >=20 > (org-entry-get (point) "BEAMER_envargs" 1) >=20 > which gives the result "[shrink]". >=20 > However, on exporting the org file to pdf, the shrinking does not > seem to happen. The source code runs off the page. Is property > inheritance not respected during export? Could you please set in .emacs (setq org-beamer-inherited-properties '("BEAMER_envargs")) and then try the following experimental patch = --------------------------------------------------------------------------= --------------- diff --git a/lisp/org-beamer.el b/lisp/org-beamer.el index 118aa75..2208c60 100644 --- a/lisp/org-beamer.el +++ b/lisp/org-beamer.el @@ -482,4 +482,10 @@ The effect is that these values will be accessible = during export." (looking-at ".*?:B_\\(note\\(NH\\)?\\):")) (push (cons "BEAMER_env" (match-string 1)) props)) + (when (org-bound-and-true-p org-beamer-inherited-properties) + (mapc (lambda (p) + (unless (assoc p props) + (let ((v (org-entry-get nil p 'inherit))) + (and v (push (cons p v) props))))) =20 + org-beamer-inherited-properties)) (put-text-property (point-at-bol) (point-at-eol) 'org-props = props))) (setq org-export-latex-options-plist = --------------------------------------------------------------------------= --------------- - Carsten >=20 > Cheers, > Chris >=20 > --Example .org File--- > #+TITLE: Java Lecture > #+AUTHOR: Christopher Kauffman > #+EMAIL: kauffman77@gmail.com > #+LANGUAGE: en > #+OPTIONS: H:3 num:t toc:nil \n:nil @:t ::t |:t ^:t -:t f:t *:t <:t > #+OPTIONS: TeX:t LaTeX:nil skip:nil d:nil todo:t pri:nil = tags:not-in-toc > #+INFOJS_OPT: view:nil toc:nil ltoc:t mouse:underline buttons:0=20 > path:http://orgmode.org/org-info.js > #+EXPORT_SELECT_TAGS: export > #+EXPORT_EXCLUDE_TAGS: noexport > #+STARTUP: beamer > #+STARTUP: showall > #+LaTeX_CLASS: beamer > #+BEAMER_FRAME_LEVEL: 1 > #+PROPERTY: BEAMER_envargs [shrink] >=20 > * Example > Want this shrink > #+BEGIN_SRC java > public class Mouse{ > private int age =3D 0; // age of mouse in days > private double weight =3D 1.0; // weight of mouse in grams > private double percentGrowthRate; // % weight increase per day >=20 > // This method assigns the mouse's percent growth rate. > public void setPercentGrowthRate(double percentGrowthRate) { > this.percentGrowthRate =3D percentGrowthRate; > } >=20 > // This method simulates one day of growth for the mouse. > public void grow() { > this.weight +=3D (.01 * this.percentGrowthRate * this.weight); > this.age++; > } >=20 > // This method prints the mouses's age and weight. > public void display() { > System.out.printf( > "Age =3D %d, weight =3D %.3f\n", this.age, this.weight); > } > }=20 > #+END_SRC >=20 > * Example > :PROPERTIES: > :BEAMER_envargs: [shrink] > :END: >=20 > Must add properties every time > #+BEGIN_SRC java > public class Mouse{ > private int age =3D 0; // age of mouse in days > private double weight =3D 1.0; // weight of mouse in grams > private double percentGrowthRate; // % weight increase per day >=20 > // This method assigns the mouse's percent growth rate. > public void setPercentGrowthRate(double percentGrowthRate) { > this.percentGrowthRate =3D percentGrowthRate; > } >=20 > // This method simulates one day of growth for the mouse. > public void grow() { > this.weight +=3D (.01 * this.percentGrowthRate * this.weight); > this.age++; > } >=20 > // This method prints the mouses's age and weight. > public void display() { > System.out.printf( > "Age =3D %d, weight =3D %.3f\n", this.age, this.weight); > } > }=20 > #+END_SRC >=20 > --END EXAMPLE- >=20 > current state: > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > (setq org-export-latex-after-initial-vars-hook > '(org-beamer-after-initial-vars) org-speed-command-hook > '(org-speed-command-default-hook org-babel-speed-command-hook) > org-agenda-files '("~/mypubs/worklog") org-agenda-window-setup > 'other-window org-metaup-hook '(org-babel-load-in-session-maybe) > org-after-todo-state-change-hook '(org-clock-out-if-current) > org-export-blocks-postblock-hook '(org-exp-res/src-name-cleanup) > org-export-latex-format-toc-function > 'org-export-latex-format-toc-default org-tab-first-hook > '(org-hide-block-toggle-maybe org-src-native-tab-command-maybe > org-babel-hide-result-toggle-maybe) org-src-mode-hook > '(org-src-babel-configure-edit-buffer > org-src-mode-configure-edit-buffer) > org-confirm-shell-link-function 'yes-or-no-p > org-export-first-hook '(org-beamer-initialize-open-trackers) > org-agenda-before-write-hook '(org-agenda-add-entry-text) > outline-mode-hook '((lambda nil > (local-set-key "\356" (quote > outline-next-visible-heading)) > (local-set-key "\360" (quote > outline-previous-visible-heading)) > (local-set-key (quote [f12]) (quote > ck-outline-toggle))) ) > org-babel-pre-tangle-hook '(save-buffer) > org-cycle-hook > '(org-cycle-hide-archived-subtrees > org-cycle-hide-drawers > org-cycle-show-empty-lines > org-optimize-window-after-visibility-change) > org-export-preprocess-before-normalizing-links-hook > '(org-remove-file-link-modifiers) > org-mode-hook '((lambda > nil (local-set-key "=03d" (quote > insert-date-heading)) > (local-set-key "=03=01" (quote org-agenda)) > (local-set-key "\232" (quote format-float-column)) > (local-set-key "=03e" (quote org-example)) > (local-set-key "=03v" (quote org-verbatim)) > (local-set-key "=03q" (quote org-quote)) = (auto-fill-mode 1) > (setq org-agenda-window-setup (quote > other-window))) > #[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-ctrl-c-ctrl-c-hook '(org-babel-hash-at-point > org-babel-execute-safely-maybe) > org-confirm-elisp-link-function 'yes-or-no-p > org-export-interblocks '((lob > org-babel-exp-lob-one-liners) > (src org-babel-exp-inline-src-blocks)) > org-occur-hook '(org-first-headline-recenter) > org-from-is-user-regexp "\\" > org-export-preprocess-before-selecting-backend-code-hook > '(org-beamer-select-beamer-code) org-export-latex-final-hook > '(org-beamer-amend-header org-beamer-fix-toc > org-beamer-auto-fragile-frames > org-beamer-place-default-actions-for-lists) org-metadown-hook > '(org-babel-pop-to-session-maybe) org-export-blocks '((src > org-babel-exp-src-blocks nil) > (comment org-export-blocks-format-comment t) > (ditaa org-export-blocks-format-ditaa nil) > (dot org-export-blocks-format-dot nil)) > ) >=20 >=20 >=20