emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Thomas Alexander Gerds <grb615@ku.dk>
To: emacs-orgmode@gnu.org
Subject: orgmode latex export: reference to label rather than section
Date: Mon, 18 Jun 2012 12:35:45 +0200	[thread overview]
Message-ID: <grb615aa00aovy.fsf@linuxifsv005.sund.root.ku.dk> (raw)

Hi

I would be grateful if someone could help me sort out my confusion
regarding references to headings (sections) in latex export.

I am used to latex section labels and references via reftex, e.g. 

,----
| \section{This is a test}
| \label{sec:testit}
| 
| In Section \ref{sec:testit}
`----

To achieve this in orgmode it seems that one should set

,----
| (setq org-export-latex-hyperref-format "\\ref{%s}")
`----

and then write:

,----
| * This is a test
| 
| In Section [[This is a test]]
`----

This seems to work! 

However, if I later change the specific section title ("This is a
test"), then I have to remember to also change all links [[references]]
to this section. I feel this is a potential source of error and would
therefore prefer to explicitly set and refer to a label for this
section. But, the following statement

,----
| #+LABEL: sec:testit
| * This is a test
`----

is exported as 

,----
| \section{This is a test}
| \label{sec-2}
`----

so, my label is ignored.

Is there a workaround for this?

Thanks,
Thomas

ps: running orgmode version 7.8.11 on emacs version 23.3.1 

                 reply	other threads:[~2012-06-18 10:36 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=grb615aa00aovy.fsf@linuxifsv005.sund.root.ku.dk \
    --to=grb615@ku.dk \
    --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).