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:48:32 -0500 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=20cf307f3b62d85f7704d690fcc8 Return-path: Received: from eggs.gnu.org ([208.118.235.92]:59389) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UA36J-00053U-FQ for emacs-orgmode@gnu.org; Mon, 25 Feb 2013 13:48:37 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UA36H-0008W8-7y for emacs-orgmode@gnu.org; Mon, 25 Feb 2013 13:48:35 -0500 Received: from mail-ve0-f180.google.com ([209.85.128.180]:62215) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UA36H-0008W4-1K for emacs-orgmode@gnu.org; Mon, 25 Feb 2013 13:48:33 -0500 Received: by mail-ve0-f180.google.com with SMTP id jx10so2438648veb.25 for ; Mon, 25 Feb 2013 10:48:32 -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: Subhan Tindall Cc: Org-mode , "Thomas S. Dye" --20cf307f3b62d85f7704d690fcc8 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hello, On 25 February 2013 13:40, Subhan Tindall w= rote: > There are 4 different ref commands, all with slightly syntactic > requirements and outputs when compiled using makeinfo. I for one use > @pxref{} a lot, and it has different requirements for placement than > @ref or @xref (namely those two MUST have a . or , following the end > of the ref) > Not entirely true, @ref{} will add a period after the end of the reference in the info output if no period or comma present, @xref{} needs a comma or period. @pxref{} can be followed by a period, comma or right parenthesis, otherwise the info output will include a period as well. So all three must have some sort of punctuation (or paren) following them to ensure that the references are clearly delimited. Regards, > 8.1 Different Cross Reference Commands > There are four different cross reference commands: > @xref Used to start a sentence in the printed manual saying =E2=80=98See = . . . > =E2=80=99 or an Info > cross-reference saying =E2=80=98*Note name : node.=E2=80=99. > @ref Used within or, more often, at the end of a sentence; same as > @xref for Info; > produces just the reference in the printed manual without a preceding > =E2=80=98See=E2=80=99. > @pxref Used within parentheses to make a reference that suits both an > Info file and a > printed book. Starts with a lower case =E2=80=98see=E2=80=99 with= in the > printed manual. (=E2=80=98p=E2=80=99 is > for =E2=80=98parenthesis=E2=80=99.) > @inforef Used to make a reference to an Info file for which there is > no printed manual. > > (from the Texinfo manual) > > On Mon, Feb 25, 2013 at 10:32 AM, Jonathan Leech-Pepin > wrote: > > 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 i= n > > 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 an= d > >> 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 > >> > > > > > > -- > Subhan Michael Tindall | Software Developer > | smt@rentrakmail.com > RENTRAK | www.rentrak.com | NASDAQ: RENT > --20cf307f3b62d85f7704d690fcc8 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hello,

On 25 February 2013 13:40, Subhan = Tindall <subhan.tindall@rentrakmail.com> wrote:=
There are 4 different ref commands, all with slightly syntactic
requirements and outputs when compiled using makeinfo. =C2=A0I for one use<= br> @pxref{} a lot, and it has different requirements for placement than
@ref or @xref (namely those two MUST have a . or , following the end
of the ref)

Not entirely true, @ref{} will add a p= eriod after the end of the reference in the info output
if no period or = comma present, @xref{} needs a comma or period.=C2=A0 @pxref{} can be
fo= llowed by a period, comma or right parenthesis, otherwise the info output w= ill include
a period as well.

So all three must have some sort of punctuation (o= r paren) following them to ensure that
the references are clearly delimi= ted.

Regards,
=C2=A0
8.1 Different Cross Reference Commands
There are four different cross reference commands:
@xref Used to start a sentence in the printed manual saying =E2=80=98See . = . .
=E2=80=99 or an Info
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0cross-reference saying =E2=80=98*Note nam= e : node.=E2=80=99.
@ref Used within or, more often, at the end of a sentence; same as
@xref for Info;
=C2=A0 =C2=A0 produces just the reference in the printed manual without a p= receding =E2=80=98See=E2=80=99.
@pxref Used within parentheses to make a reference that suits both an
Info file and a
=C2=A0 =C2=A0 =C2=A0 =C2=A0 printed book. Starts with a lower case =E2=80= =98see=E2=80=99 within the
printed manual. (=E2=80=98p=E2=80=99 is
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0for =E2=80=98parenth= esis=E2=80=99.)
@inforef Used to make a reference to an Info file for which there is
no printed manual.

(from the Texinfo manual)

On Mon, Feb 25, 2013 at 10:32 AM, Jonathan Leech-Pepin
<jonathan.leechpepin@gm= ail.com> wrote:
> Hello Tom,
>
> On 25 February 2013 12:52, Thomas 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=A0I 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">Conflicts</a&g= t;) while in the info
> file (org) it is shown as (*note Conflicts::).
>
> Opening the info file in Info (C-u C-h i <path to info file>), *= node
> Conflicts:: becomes "see Conflicts". =C2=A0Adding "see&= quot; manually
> before *note does not change the output. =C2=A0The same is the case fo= r
> @xref{}. =C2=A0@xref{} adds "See" before the link in html/La= TeX, 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 <link>" 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<= br> > 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
>> =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\"p= xref\">%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 corr= ectly 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 li= nk like
>> this:
>>
>> [[pxref:Internal link]]
>>
>> is really an internal link, rather than an external link. =C2=A0I&= #39;d like to
>> be able to click on this and end up at <<Internal link>&g= t; in the Org
>> buffer.
>>
>> Is this possible? =C2=A0If 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-0= 866, Fax: 808-529-0= 884
>> http://www.tsdy= e.com
>>
>



--
Subhan Michael Tindall | Software Developer
| smt@rentrakmail.com
RENTRAK | www.rentrak.= com | NASDAQ: RENT

--20cf307f3b62d85f7704d690fcc8--