emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Robert Klein <roklein@roklein.de>
To: Florian Hollerweger <fhollerweger@colum.edu>
Cc: emacs-orgmode@gnu.org
Subject: Re: org-latex-export: Name sections by CUSTOM_ID (rather than %s)?
Date: Sun, 2 Sep 2018 10:31:16 +0200	[thread overview]
Message-ID: <20180902103116.333a160d@happy.intern.roklein.de> (raw)
In-Reply-To: <85592025-5d71-449b-6b7e-7a51e3f73194@colum.edu>

Hi,

On Sat, 1 Sep 2018 21:30:19 -0500
Florian Hollerweger <fhollerweger@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

      reply	other threads:[~2018-09-02  8:31 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-02  2:30 org-latex-export: Name sections by CUSTOM_ID (rather than %s)? Florian Hollerweger
2018-09-02  8:31 ` Robert Klein [this message]

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=20180902103116.333a160d@happy.intern.roklein.de \
    --to=roklein@roklein.de \
    --cc=emacs-orgmode@gnu.org \
    --cc=fhollerweger@colum.edu \
    /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).