emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Julius Müller" <Julius.Muller@gmx.net>
To: Org Mode <emacs-orgmode@gnu.org>
Subject: how to hack section lines in LaTeX export?
Date: Tue, 11 Feb 2020 18:21:48 +0100	[thread overview]
Message-ID: <d5d92949-6df0-d441-8c13-1049d3128dc5@gmx.net> (raw)

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	other threads:[~2020-02-11 17:21 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=d5d92949-6df0-d441-8c13-1049d3128dc5@gmx.net \
    --to=julius.muller@gmx.net \
    --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).