From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jonathan Leech-Pepin Subject: Re: pxref in texinfo export Date: Mon, 25 Feb 2013 13:32:48 -0500 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=047d7bd6adba9acd4c04d690c4cb Return-path: Received: from eggs.gnu.org ([208.118.235.92]:51809) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UA2r5-0002hi-Jk for emacs-orgmode@gnu.org; Mon, 25 Feb 2013 13:32:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UA2r4-0003VL-29 for emacs-orgmode@gnu.org; Mon, 25 Feb 2013 13:32:51 -0500 Received: from mail-vc0-f178.google.com ([209.85.220.178]:54603) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UA2r3-0003Uw-T5 for emacs-orgmode@gnu.org; Mon, 25 Feb 2013 13:32:50 -0500 Received: by mail-vc0-f178.google.com with SMTP id m8so1880941vcd.23 for ; Mon, 25 Feb 2013 10:32:49 -0800 (PST) In-Reply-To: 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: "Thomas S. Dye" Cc: Org-mode --047d7bd6adba9acd4c04d690c4cb Content-Type: text/plain; charset=UTF-8 Hello Tom, On 25 February 2013 12:52, Thomas S. Dye wrote: > Aloha all, > > IIUC, there is currently no support for @pxref{} in the texinfo > exporter. This is a texinfo @-command that does one thing in the info > output and another in the LaTeX output. > Ultimately there is actually no real difference between "see @ref{}" and "@pxref{}". I just checked using the first @pxref{} in org.texi (Under Activation). In org.texi it is shown as (@pxref{Conflicts}), in org.html it becomes: (see Conflicts) while in the info file (org) it is shown as (*note Conflicts::). Opening the info file in Info (C-u C-h i ), *node Conflicts:: becomes "see Conflicts". Adding "see" manually before *note does not change the output. The same is the case for @xref{}. @xref{} adds "See" before the link in html/LaTeX, and uses *Note in the info document; "See [[link]]" produces the same See in html/LaTeX, and creates "See *note" in the info file (which is inserted as "See " in Emacs Info. Yes the output is different if looking at the info file directly, however when viewing it withing Emacs the text is consistent. I didn't implement support for @xref{} or @pxref{} in the texinfo exporter, because I could not find a way to reliably determine the context so as to use the right type of link in the texi file. Using occur there were already 47 cases in org.texi where "[Ss]ee @ref" was used rather than the stylistically appropriate @pxref/@xref. Regards, Jon > My idea is to create a custom link type, something like this: > > (org-add-link-type > "pxref" nil > (lambda (path desc format) > (cond > ((eq format 'html) > (format "%s" path)) > ((eq format 'latex) > (format "\\ref{%s}" path)) > ((eq format 'texinfo) > (format "@pxref{%s,%s}" path desc))))) > > I haven't tested this, but it should export approximately correctly and > I'm confident I can get the export part working. > > What I can't figure out is how to have Org recognize that a link like > this: > > [[pxref:Internal link]] > > is really an internal link, rather than an external link. I'd like to > be able to click on this and end up at <> in the Org > buffer. > > Is this possible? If so, can you point me to a solution? > All the best, > Tom > > -- > T.S. Dye & Colleagues, Archaeologists > 735 Bishop St, Suite 315, Honolulu, HI 96813 > Tel: 808-529-0866, Fax: 808-529-0884 > http://www.tsdye.com > > --047d7bd6adba9acd4c04d690c4cb Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hello Tom,

On 25 February 2013 12:52, Tho= mas S. Dye <tsd@tsdye.com> wrote:
Aloha all,

IIUC, there is currently no support for @pxref{} in the texinfo
exporter. =C2=A0This is a texinfo @-command that does one thing in the info=
output and another in the LaTeX output.

Ultimately= there is actually no real difference between "see @ref{}"
and= "@pxref{}".=C2=A0 I just checked using the first @pxref{} in org= .texi
(Under Activation).

In org.texi it is shown as (@pxref{Conflicts}), = in org.html it
becomes: (see <a href=3D"#Conflicts">Conf= licts</a>) while in the info
file (org) it is shown as (*note Conf= licts::).

Opening the info file in Info (C-u C-h i <path to info file>), *n= ode
Conflicts:: becomes "see Conflicts".=C2=A0 Adding "se= e" manually
before *note does not change the output.=C2=A0 The same= is the case for
@xref{}.=C2=A0 @xref{} adds "See" before the link in html/LaTeX, = and
uses *Note in the info document; "See [[link]]" produces t= he same See in
html/LaTeX, and creates "See *note" in the info= file (which is
inserted as "See <link>" in Emacs Info.

Yes the outp= ut is different if looking at the info file directly,
however when viewi= ng it withing Emacs the text is consistent.

I didn't implement s= upport for @xref{} or @pxref{} in the texinfo
exporter, because I could not find a way to reliably determine the
conte= xt so as to use the right type of link in the texi file.

Using occur= there were already 47 cases in org.texi where "[Ss]ee
@ref" w= as used rather than the stylistically appropriate @pxref/@xref.

Regards,

Jon


My idea is to create a custom link type, something like this:

(org-add-link-type
=C2=A0 =C2=A0"pxref" nil
=C2=A0 =C2=A0(lambda (path desc format)
=C2=A0 =C2=A0 =C2=A0(cond
=C2=A0 =C2=A0 =C2=A0 ((eq format 'html)
=C2=A0 =C2=A0 =C2=A0 =C2=A0(format "<span class=3D\"pxref\&quo= t;>%s</span>" path))
=C2=A0 =C2=A0 =C2=A0 ((eq format 'latex)
=C2=A0 =C2=A0 =C2=A0 =C2=A0(format "\\ref{%s}" path))
=C2=A0 =C2=A0 =C2=A0 ((eq format 'texinfo)
=C2=A0 =C2=A0 =C2=A0 =C2=A0(format "@pxref{%s,%s}" path desc)))))=

I haven't tested this, but it should export approximately correctly and=
I'm confident I can get the export part working.

What I can't figure out is how to have Org recognize that a link like this:

[[pxref:Internal link]]

is really an internal link, rather than an external link. =C2=A0I'd lik= e to
be able to click on this and end up at <<Internal link>> in the= Org
buffer.

Is this possible? =C2=A0If so, can you point me to a solution?
=C2=A0
All the best,
Tom

--
T.S. Dye & Colleagues, Archaeologists
735 Bishop St, Suite 315, Honolulu, HI 96813
Tel: 808-529-0866, = Fax: 808-529-0884 http://www.tsdye.com=


--047d7bd6adba9acd4c04d690c4cb--