Hi folks,

I would like to add a property's contents to the section line in LaTeX
export. Is there a way to do that?

Here's a minimal (not) working example. Use it with 'emacs -q', execute
the source block to add the class definition to org, then export to LaTeX.

#+begin_src elisp :exports none :results none
(require 'ox-latex)
(add-to-list 'org-latex-classes
    ("\\QA{%s}" . "\\QA{%s}")
    ("\\QA{%s}" . "\\QA{%s}")
    ("\\QA{%s}" . "\\QA{%s}")
    ("\\QA{%s}" . "\\QA{%s}")
    ("\\QA{%s}" . "\\QA{%s}")
    ("\\QA{%s}" . "\\QA{%s}")


* test section
:ID:       ylv4e021ami0

Currently this produces section headers like

\QA{test section}

in LaTeX export.

I would like to have org produce section headers like

\QA[ID: ylv4e021ami0]{test section}.

I know the ID can be extracted with something like

(if (org-id-get) (insert (format "\n\\ID: %s\n" (org-id-get))))

but how can I add that to the section header?

John Kitchin kindly provided some code to extract the ID at the end of
the metadata block, but unfortunately that's too late for the effect I
am after :-(

Thanks for any pointers,

Julius Müller

Reply via email to