From mboxrd@z Thu Jan 1 00:00:00 1970 From: Robert Klein Subject: Re: org-latex-export: Name sections by CUSTOM_ID (rather than %s)? Date: Sun, 2 Sep 2018 10:31:16 +0200 Message-ID: <20180902103116.333a160d@happy.intern.roklein.de> References: <85592025-5d71-449b-6b7e-7a51e3f73194@colum.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:44305) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fwNnK-0007C8-Ok for emacs-orgmode@gnu.org; Sun, 02 Sep 2018 04:31:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fwNnB-0004hE-83 for emacs-orgmode@gnu.org; Sun, 02 Sep 2018 04:31:37 -0400 Received: from mout.kundenserver.de ([212.227.126.131]:57933) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fwNnA-0004go-CF for emacs-orgmode@gnu.org; Sun, 02 Sep 2018 04:31:32 -0400 In-Reply-To: <85592025-5d71-449b-6b7e-7a51e3f73194@colum.edu> 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.org@gnu.org Sender: "Emacs-orgmode" To: Florian Hollerweger Cc: emacs-orgmode@gnu.org Hi, On Sat, 1 Sep 2018 21:30:19 -0500 Florian Hollerweger wrote: > Hi everyone, >=20 > When exporting an .org file to LaTeX, is it possible to name the > sections in the exported .tex file *not* according to the > corresponding headlines in the .org file, but instead according to > the respective sections' CUSTOM_ID ? >=20 > For example, there might be an equivalent to the %s operator (which > is replaced by the headline string; see > https://orgmode.org/worg/org-tutorials/org-latex-export.html), only > for the section's CUSTOM_ID? >=20 > To clarify, I'd like the .org code >=20 > * My section > :PROPERTIES: > :CUSTOM_ID: foo > :END: >=20 > to result in the following .tex code when exported via C-c C-e C-b l > L: >=20 > \section{foo} > \label{sec:orga20100d} >=20 > and *not* in the following (which is the default behavior): >=20 > \section{My section} > \label{sec:orga20100d} >=20 > For the record, I have also posted this question to StackExchange > (https://emacs.stackexchange.com/questions/44497) and would be more > than happy to provide credit for an answer there. >=20 > Best wishes, > Florian >=20 You could write a derived exporter (from ox-latex) and replace the org-latex-headline function. Otherwise, mechanically replace headlines with their custom-ids before exporting... BTW, the =E2=80=9C%s=E2=80=9D is not an operator, but a format specifier Em= acs uses for strings. See =E2=80=9Cman 3 printf=E2=80=9D under =E2=80=9CConversion Spec= ifier=E2=80=9D on Linux. Best regards Robert