emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nick Dokos <nicholas.dokos@hp.com>
To: Eric Schulte <schulte.eric@gmail.com>
Cc: Org Mode <emacs-orgmode@gnu.org>
Subject: Re: suppress \label{} in LaTeX export
Date: Thu, 01 Oct 2009 16:32:45 -0400	[thread overview]
Message-ID: <8757.1254429165@alphaville.usa.hp.com> (raw)
In-Reply-To: Message from "Eric Schulte" <schulte.eric@gmail.com> of "Thu, 01 Oct 2009 14:12:36 MDT." <m2pr96x497.fsf@gmail.com>

Eric Schulte <schulte.eric@gmail.com> wrote:


> Is it possible to suppress the \label{sec-1} lines following each
> headline after a LaTeX export?  I've found no mention of this in the
> manual, and the presence of headline labels is breaking my Beamer TOC.
> 

I don't think so: they seem to be inextricably bound with headings. The
code in org-latex.el says:

  (let* (...
	 (label (org-get-text-property-any 0 'target heading))
         ...)


and then
        ...
	(when label
	  (insert (mapconcat (lambda (l) (format "\\label{%s}" l))
			     label-list "\n") "\n"))
        ...

I recall having problems with labels (among other things) in combination
with beamer before (I "solved" the problem by running the tex file
through a script to just get rid of them), but I don't remember what the
problem was. Maybe it's time to go back and look at the thing again.

Nick

PS. Here is a quick-n-dirty patch to disable them - ymmv, uayor and several
other cya disclaimers :-)

diff --git a/lisp/org-latex.el b/lisp/org-latex.el
index 248d653..f5099f7 100644
--- a/lisp/org-latex.el
+++ b/lisp/org-latex.el
@@ -852,6 +852,8 @@ and its content."
   (let ((num (plist-get org-export-latex-options-plist :section-numbers)))
     (mapc (lambda(x) (org-export-latex-subcontent x num)) subcontent)))
 
+(defvar org-export-latex-labels-enabled nil)
+
 (defun org-export-latex-subcontent (subcontent num)
   "Export each cell of SUBCONTENT to LaTeX.
 If NUM, export sections as numerical sections."
@@ -862,7 +864,7 @@ If NUM, export sections as numerical sections."
 	 (occur (number-to-string (cdr (assoc 'occur subcontent))))
 	 (content (cdr (assoc 'content subcontent)))
 	 (subcontent (cadr (assoc 'subcontent subcontent)))
-	 (label (org-get-text-property-any 0 'target heading))
+	 (label (and org-export-latex-labels-enabled (org-get-text-property-any 0 'target heading)))
 	 (label-list (cons label (cdr (assoc label
 					     org-export-target-aliases)))))
     (cond

  reply	other threads:[~2009-10-01 20:33 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-01 20:12 suppress \label{} in LaTeX export Eric Schulte
2009-10-01 20:32 ` Nick Dokos [this message]
2009-10-01 22:48   ` Eric Schulte
2009-10-02  6:23     ` Carsten Dominik

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=8757.1254429165@alphaville.usa.hp.com \
    --to=nicholas.dokos@hp.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=schulte.eric@gmail.com \
    /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).