From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: suppress \label{} in LaTeX export Date: Fri, 2 Oct 2009 08:23:10 +0200 Message-ID: <040F61DB-BCE6-4844-9383-FFF715DC4E78@gmail.com> References: <8757.1254429165@alphaville.usa.hp.com> Mime-Version: 1.0 (Apple Message framework v936) Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MtcMs-0002ut-Np for emacs-orgmode@gnu.org; Fri, 02 Oct 2009 03:15:54 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MtcMo-0002rp-1k for emacs-orgmode@gnu.org; Fri, 02 Oct 2009 03:15:54 -0400 Received: from [199.232.76.173] (port=54001 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MtcMn-0002rm-TR for emacs-orgmode@gnu.org; Fri, 02 Oct 2009 03:15:49 -0400 Received: from mx20.gnu.org ([199.232.41.8]:40516) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MtcMn-0005Fg-4Y for emacs-orgmode@gnu.org; Fri, 02 Oct 2009 03:15:49 -0400 Received: from mail-ew0-f208.google.com ([209.85.219.208]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MtcMm-0002E4-GX for emacs-orgmode@gnu.org; Fri, 02 Oct 2009 03:15:48 -0400 Received: by ewy4 with SMTP id 4so802928ewy.31 for ; Fri, 02 Oct 2009 00:15:47 -0700 (PDT) In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Eric Schulte Cc: Org Mode Hi Eric, if you make the function first search for \documentclass{beamer}, then you could add it to `org-export-latex-final-hook'. - Carsten On Oct 2, 2009, at 12:48 AM, Eric Schulte wrote: > Hi Nick, > > Thanks for the patch, sadly I rely on labels in my other latex > exports. > For now I'm just using the following little elisp function. > > --8<---------------cut here---------------start------------->8--- > (defun schulte/clean-beamer () > "remove the \label{sec} headers from latex Beamer documents > that have been exported by org." > (interactive) > (save-excursion > (goto-char (point-min)) > (while (re-search-forward "^\\\\label{" nil t) > (move-beginning-of-line nil) > (delete-region (point) (save-excursion (forward-line 1) > (point)))))) > --8<---------------cut here---------------end--------------->8--- > > Thanks -- Eric > > Nick Dokos writes: > >> Eric Schulte 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 > > > _______________________________________________ > Emacs-orgmode mailing list > Remember: use `Reply All' to send replies to the list. > Emacs-orgmode@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-orgmode