On Tue, 1 Mar 2016, Riccardo (Jack) Lucchetti wrote:
On Tue, 1 Mar 2016, Allin Cottrell wrote:
>> That said, I suspect that a setting I have with both evince and atril by
>> which those two programs remember the page they where at when a given file
>> was last closed is maybe interfering with the desired outcome, but I
>> wouldn't know how to turn it off/on (I actually like it).
>
> My evince also remembers the last-viewed position in PDF files; nonethless
> it respects the option passed by gretl. You can test this (what gretl's
> doing) at the command line. For example
>
> evince gretl-guide.pdf --named-dest=chap:join
>
> should open at the top of the "Joining data sources" chapter.
> (Though maybe not if the Guide is already open in evince?)
Problem solved with evince. As for atril, it seems that at least 1.12.2 it
doesn't have the equivalent option. It does have, however, an option for
opening a document at a specific page number. Perhaps we could use a
\pageref{}?
That would be more complicated: we'd have to grub around in the
auxiliary files produced by a build of the PDF doc to find the page
numbers corresponding to the chapter starts. And of course this would
be a faster-moving target than the chapter numbers.
What we do now is scan gretl-guide.tex for chapter inclusions and
write out a little XML file that maps from chapter labels, such as
"chap:dpanel" to the chapter number, as in
<ref key="chap:dpanel" chapter="19"/>
This XML file is then sourced by the XSL transformation that produces
the GUI help files. XSL generates a piece of text in gretlcmd.hlp such
as
chapter 19 of the <@pdf="Gretl User's Guide#chap:dpanel">
When gretl reads the <@pdf...> chunk in gretlcmd.hlp it hides the
"#chap:dpanel" bit and stuffs it into a GtkTextTag that
anchors a hyperlink to the Guide. Click on the link, and gretl
recovers the chapter info and formats it as required for a specific
viewer:
evince: gretl-guide.pdf --named-dest=chap:dpanel
xpdf: gretl-guide.pdf +chap:dpanel
okular: gretl-guide.pdf#chap:dpanel
(Isn't standardization wonderful?)
Anyway, I see that atril offers a --page-label=PAGE option (as opposed
to --page-index=NUMBER). Perhaps you could try to find out how that
works, we could maybe use it.
Allin