emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* how to hack section lines in LaTeX export?
@ 2020-02-11 17:21 Julius Müller
  0 siblings, 0 replies; only message in thread
From: Julius Müller @ 2020-02-11 17:21 UTC (permalink / raw)
  To: Org Mode

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-02-11 17:21 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-11 17:21 how to hack section lines in LaTeX export? Julius Müller

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).