From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rasmus Subject: Re: Target and link text normalised to `orgtargetn' Date: Mon, 20 Apr 2015 15:13:10 +0200 Message-ID: <87618rc595.fsf@gmx.us> References: <20150414092530.GC2957@chitra.no-ip.org> <20150414120852.GD2957@chitra.no-ip.org> <87zj699ez9.fsf@gmx.us> <20150416001830.GC14328@chitra.no-ip.org> <87egnk9ycz.fsf@gmx.us> <87k2x9cddu.fsf@nicolasgoaziou.fr> <20150419121305.GZ14328@chitra.no-ip.org> <87618smg2i.fsf@nicolasgoaziou.fr> <87d230rzak.fsf@gmx.us> <87vbgsdw2c.fsf@nicolasgoaziou.fr> <87pp70qi9w.fsf@gmx.us> <87oamkdu5v.fsf@nicolasgoaziou.fr> <87lhhoqbsc.fsf@gmx.us> <87fv7wdkz2.fsf@nicolasgoaziou.fr> <87383vqiuh.fsf@gmx.us> <87618rdv3w.fsf@nicolasgoaziou.fr> <87wq17p2x1.fsf@gmx.us> <87wq17ce98.fsf@nicolasgoaziou.fr> <87oamjce2q.fsf@gmx.us> <87sibvccnc.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:36780) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YkBVq-0005KT-MS for emacs-orgmode@gnu.org; Mon, 20 Apr 2015 09:13:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YkBVn-00025s-FH for emacs-orgmode@gnu.org; Mon, 20 Apr 2015 09:13:22 -0400 Received: from mout.gmx.net ([212.227.15.18]:65018) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YkBVn-00025b-2i for emacs-orgmode@gnu.org; Mon, 20 Apr 2015 09:13:19 -0400 Received: from x200s ([46.166.186.233]) by mail.gmx.com (mrgmx003) with ESMTPSA (Nemesis) id 0MXqaN-1YoBpa2oRr-00WjeQ for ; Mon, 20 Apr 2015 15:13:17 +0200 In-Reply-To: <87sibvccnc.fsf@nicolasgoaziou.fr> (Nicolas Goaziou's message of "Mon, 20 Apr 2015 12:33:27 +0200") 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 --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Nicolas Goaziou writes: > Rasmus writes: > >> Nicolas Goaziou writes: >> >>> However, "tab:orgtable1" or "sec:orgheadline1" are fine, IMO, since >>> "org" part can keep the label out of userland. >> >> That's fine with me as well. > > Fair enough. Do you want to take care of extending `org-latex--label' > appropriately? Can we have conditional dependence on texmathp? If so, maybe something like the attached, though the latex-environment part is ugly. Results areq pretty ugly. E.g. for headline, table, figure, latex-math env, latex-env: \ref{sec:orgheadline1}, \ref{tab:orgtable1}, \ref{fig:orgparagraph1}, \ref{eq:orglatexenvironment1}, \ref{orglatexenvironment2} =E2=80=94Rasmus --=20 Vote for proprietary math! --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-ox-latex-Use-standard-LaTeX-label-prefixes.patch >From cc2c027ab611c3abcdc5c7cac46b6f45d682657f Mon Sep 17 00:00:00 2001 From: Rasmus Date: Mon, 20 Apr 2015 15:06:55 +0200 Subject: [PATCH] ox-latex: Use standard LaTeX label prefixes. * ox-latex.el (org-latex--label): Use standard LaTeX prefixes. --- lisp/ox-latex.el | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/lisp/ox-latex.el b/lisp/ox-latex.el index 2727f1c..075f4e4 100644 --- a/lisp/ox-latex.el +++ b/lisp/ox-latex.el @@ -1067,7 +1067,22 @@ Eventually, if FULL is non-nil, wrap label within \"\\label{}\"." (and (or user-label force) (if (and user-label (plist-get info :latex-prefer-user-labels)) user-label - (org-export-get-reference datum info))))) + (concat (case type + (headline "sec:") + (table "tab:") + (latex-environment + (and (featurep 'texmathp) + (with-temp-buffer + (insert (org-element-property :value datum)) + (goto-char (point-min)) + (search-forward "}" nil t) + (latex-mode) + (texmathp)) + "eq:")) + (paragraph + (when (org-element-property :caption datum) + "fig:"))) + (org-export-get-reference datum info)))))) (cond ((not full) label) (label (format "\\label{%s}%s" label -- 2.3.5 --=-=-=--