emacs-orgmode
[Top][All Lists]
Advanced

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

how to hack section lines in LaTeX export?


From: Julius Müller
Subject: how to hack section lines in LaTeX export?
Date: Tue, 11 Feb 2020 18:21:48 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.2

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"
    "\\documentclass{article}"
    ("\\QA{%s}" . "\\QA{%s}")
    ("\\QA{%s}" . "\\QA{%s}")
    ("\\QA{%s}" . "\\QA{%s}")
    ("\\QA{%s}" . "\\QA{%s}")
    ("\\QA{%s}" . "\\QA{%s}")
    ("\\QA{%s}" . "\\QA{%s}")
#+end_src

#+LATEX_CLASS: QA

* test section
:PROPERTIES:
:ID:       ylv4e021ami0
:END:
-------------------------------------------------

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

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