From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: [PATCH] Change underscores to hyphens in section labels Date: Wed, 18 May 2011 15:58:40 -0400 Message-ID: <5905.1305748720@alphaville.americas.hpqcorp.net> Reply-To: nick@dokosmarshall.org Return-path: Received: from eggs.gnu.org ([140.186.70.92]:51833) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QMmtI-0007zf-4i for emacs-orgmode@gnu.org; Wed, 18 May 2011 15:58:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QMmtG-00028H-Qc for emacs-orgmode@gnu.org; Wed, 18 May 2011 15:58:44 -0400 Received: from g4t0017.houston.hp.com ([15.201.24.20]:15947) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QMmtG-00028A-Lm for emacs-orgmode@gnu.org; Wed, 18 May 2011 15:58:42 -0400 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Cc: nick@dokosmarshall.org commit 5b6ac88c0c021f77d214d4fea37b305ab4928ebd Author: Nick Dokos Date: Sun May 15 16:49:55 2011 -0400 Change underscores to hyphens for labels * lisp/org-exp.el (org-export-define-heading-targets): Currently, the section number (a string of the form "X.Y.Z") is used to manufacture a section label of the form sec-X_Y_Z. Underscores are overloaded however, both in org and in LaTeX, and cause conflicts with some packages. This patch changes underscores to hyphens in section labels. TINYCHANGE --- Peter Frings reported a conflict with the ``syntax'' LaTeX package. Light testing (exporting simple files to LaTeX, by both Peter and myself, as well as exporting to ascii and HTML) has not uncovered any problems. I have not tested docbook, or Jambunathan K's odt exporter. diff --git a/lisp/org-exp.el b/lisp/org-exp.el index cda1f98..ac07c68 100644 --- a/lisp/org-exp.el +++ b/lisp/org-exp.el @@ -1298,7 +1298,7 @@ Also find all ID and CUSTOM_ID properties and store them." (org-outline-level)))) (setq target (org-solidify-link-text (format "sec-%s" (replace-regexp-in-string - "\\." "_" + "\\." "-" (org-section-number level))))) (setq last-section-target target) (push (cons target target) target-alist)