emacs-orgmode
[Top][All Lists]
Advanced

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

[O] Subtree export problems


From: Thomas S . Dye
Subject: [O] Subtree export problems
Date: Fri, 05 Feb 2016 14:34:15 -1000
User-agent: mu4e 0.9.16-1c0bfe8; emacs 24.5.1

Aloha all,

The following ECM gives me two problems.

1) When I export the full file, all is well, I get this pertinent part:

,------------------------------------------
| \section{Top Level Headline}             
| \label{sec:orgheadline2}                 
| \setmarginnotefont{\itshape\footnotesize}
|                                          
| \subsection{Second Level Headline}       
| \label{sec:orgheadline1}                 
|                                          
| \setmarginnotefont{\itshape\footnotesize}
`------------------------------------------

However, when I attempt to export the Second Level Headline subtree, I
get this pertinent part:

,------------------------
| \setmarginnotefont{nil}
`------------------------

2) Subtree export doesn't work when the Second Level Headline is
followed on the next line by the #+header: line (with no empty line or
some text between them).  I'm left in the *Org Export Dispatcher*, where
I can get out with C-g.

Org-mode version 8.3.3 (release_8.3.3-449-gd85ff3 @
/Users/dk/.emacs.d/src/org-mode/lisp/)

Here is the ECM:

#+MARGIN-NOTE-FONT: \itshape\footnotesize
#+SELECT_TAGS: export
#+EXCLUDE_TAGS: noexport

* Top Level Headline
#+header: :var marginnote-font=(jk-org-kwd "MARGIN-NOTE-FONT")
#+header: :results raw :exports results
#+begin_src emacs-lisp
(format "\\setmarginnotefont{%s}" marginnote-font)
#+end_src

** Second Level Headline
#+header: :var marginnote-font=(jk-org-kwd "MARGIN-NOTE-FONT")
#+header: :results raw :exports results
#+begin_src emacs-lisp
(format "\\setmarginnotefont{%s}" marginnote-font)
#+end_src

* Access keyword values                                            :noexport:

#+name: jk-keywords
#+header: :results silent
#+begin_src emacs-lisp
(defun jk-org-kwds ()
  "parse the buffer and return a cons list of (property . value)
from lines like: #+PROPERTY: value"
  (org-element-map (org-element-parse-buffer 'element) '(keyword node-property)
                   (lambda (keyword) (cons (org-element-property :key keyword)
                                           (org-element-property :value 
keyword)))))

(defun jk-org-kwd (KEYWORD)
  "get the value of a KEYWORD in the form of #+KEYWORD: value"
  (cdr (assoc KEYWORD (jk-org-kwds))))
#+end_src



-- 
Thomas S. Dye
http://www.tsdye.com



reply via email to

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