From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?UTF-8?Q?Julius_M=c3=bcller?= Subject: how to hack section lines in LaTeX export? Date: Tue, 11 Feb 2020 18:21:48 +0100 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:47586) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j1ZEQ-00065J-KP for emacs-orgmode@gnu.org; Tue, 11 Feb 2020 12:21:55 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j1ZEP-0001fv-LU for emacs-orgmode@gnu.org; Tue, 11 Feb 2020 12:21:54 -0500 Received: from mout.gmx.net ([212.227.17.20]:47247) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1j1ZEP-0001bX-8Z for emacs-orgmode@gnu.org; Tue, 11 Feb 2020 12:21:53 -0500 Received: from [192.168.175.209] ([87.139.53.30]) by mail.gmx.com (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MUXtY-1isfHS3pRY-00QVj4 for ; Tue, 11 Feb 2020 18:21:50 +0100 Content-Language: en-GB List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane-mx.org@gnu.org Sender: "Emacs-orgmode" 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. =2D---------------------------------------------- #+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: =2D------------------------------------------------ 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=C3=BCller