Hi, On Sat, 1 Sep 2018 21:30:19 -0500 Florian Hollerweger <fhollerwe...@colum.edu> wrote:
> Hi everyone, > > 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 ? > > 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? > > To clarify, I'd like the .org code > > * My section > :PROPERTIES: > :CUSTOM_ID: foo > :END: > > to result in the following .tex code when exported via C-c C-e C-b l > L: > > \section{foo} > \label{sec:orga20100d} > > and *not* in the following (which is the default behavior): > > \section{My section} > \label{sec:orga20100d} > > 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. > > Best wishes, > Florian > 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 “%s” is not an operator, but a format specifier Emacs uses for strings. See “man 3 printf” under “Conversion Specifier” on Linux. Best regards Robert