emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Thomas S. Dye <tsd@tsdye.com>
To: Org Mode <emacs-orgmode@gnu.org>
Subject: Subtree export problems
Date: Fri, 05 Feb 2016 14:34:15 -1000	[thread overview]
Message-ID: <m28u2yismw.fsf@tsdye.com> (raw)

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	other threads:[~2016-02-06  0:34 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-06  0:34 Thomas S. Dye [this message]
2016-02-06 14:17 ` Subtree export problems Rasmus
2016-02-06 22:08   ` Aaron Ecay
2016-02-06 22:24     ` Rasmus
2016-02-06 23:39     ` Thomas S. Dye
2016-02-06 23:03   ` Thomas S. Dye
2016-02-07  0:14     ` Rasmus

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m28u2yismw.fsf@tsdye.com \
    --to=tsd@tsdye.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).