Re: Add Sumatra PDF reader to configure before Adobe Reader?
Scott Kostyshak <skostysh <at> lyx.org>
2014-08-20 01:01:54 GMT
On Sat, May 24, 2014 at 7:40 AM, Scott Kostyshak <skostysh <at> lyx.org> wrote:
> On Sat, May 24, 2014 at 6:56 AM, Enrico Forestieri <forenr <at> lyx.org> wrote:
>> On Fri, May 23, 2014 at 10:03:56PM -0400, Scott Kostyshak wrote:
>>> On Fri, May 23, 2014 at 7:40 PM, Enrico Forestieri <forenr <at> lyx.org> wrote:
>>> > That said, SumatraPDF is far superior to Adobe Reader when used as
>>> > a viewer for documents produced by LaTeX, because a document gets
>>> > autoreloaded on change and forward/reverse search is supported.
>>> I didn't know this either. I thought it was just more simple and humble.
>> I don't think it is so simple and humble. It has all you need for
>> previewing a document and, if you need doing something fancy that
>> it does not support, there is a menu option for opening the pdf
>> in Adobe Reader.
>>> In this case, and I'm not convinced myself that we should do this, but
>>> I would be interested in your thoughts:
>>> What about bundling SumatraPDF (only in the Bundle installer) and
>>> optionally installing it?
>> There is nothing to install. The stand-alone version is simply an
>> executable that you can drop everywhere in your PATH and you are done.
>> I think that in this case it doesn't even write in the registry and
>> the preferences are stored in a text file placed alongside the exe.
> Indeed I checked and it does not write to registry.
>>> The stand-alone is 2.7 MB so this would
>>> increase the bundle size from 200 MB to 203MB. Apparently we already
>>> bundle eLyXer and JabRef.
>>> This way, forward/reverse search would work out of the box and we
>>> would have fewer "why does LyX crash when I view a PDF?" questions.
>> It would suffice placing the executable in a directory under the LyX
>> directory tree that is already in the PATH prefix. If LyX is installed
>> in the Windows programs folder, every time a user changes preferences,
>> due to a sort of virtualization, the preferences file gets written
>> somewhere else but it would always appear at that same location.
>> In this way, different users can see different preferences by reading
>> the (seemingly) same file. It seems that they have write permissions
>> to the program folder, but it is really not so.
>> An initial preferences file containing the InverseSearchCmdLine could
>> be provided and a corresponding batch file placed alongside the exe.
>> For example, given the following setting in the SumatraPDF prefs:
>> InverseSearchCmdLine = lyxeditorwin %f %l
>> the batch file would be the following one:
>> $ cat lyxeditorwin.bat
>> <at> echo off
>> set file=%1
>> set row=%2
>> echo LYXCMD:revdvi:server-goto-file-row:%file% %row%> \\.\pipe\lyxpipe.in
>> type \\.\pipe\lyxpipe.out > nul
>> and it would require setting the correct lyxpipe in lyxrc.dist:
>> \serverpipe "\\.\pipe\lyxpipe"
> Excellent, thank you for the details.
>>> Enrico, can you confirm that SumatraPDF is the correct name of the
>>> binary to search for in configure?
>> Yes, it is.
> OK then I committed the patch at e716f1ef in the meantime.
> I'm CC'ing Uwe and Vincent to see if they have any opinions on bundling Sumatra.
Another user's problem was solved by using Sumatra. I have not heard
back from Vincent or Uwe. I think they are both really busy. Does
anyone else have an opinion on this?
I would personally like to see this in 2.2, but I don't have access to
Windows so I would not be able to help develop or test. Would it be
possible to test this through Peter's Windows installers or are those
only for Cygwin (in Cygwin can you access native Windows programs?)?
I'm CC'ing Peter also to see if he's interested in this discussion.