Re: LyX 1.6.2 -- does it provide inverse search via Yap ?

2009-04-25 Thread Enrico Forestieri
On Thu, Apr 23, 2009 at 08:41:54AM +0200, Jürgen Spitzmüller wrote:

> Pavel Sanda wrote:
> 
> >> It's in the LyX/Cygwin package here:
> >> ftp://ftp.lyx.org/pub/lyx/bin/1.6.2/lyx-1.6.2-cygwin.tar.gz
> > 
> > i see. imho worth to add such file somewere into development/.
> 
> Why not in the manuals?

I documented the reverse DVI search feature in the Extended.lyx manual.

-- 
Enrico


Re: LyX 1.6.2 -- does it provide inverse search via Yap ?

2009-04-22 Thread Jürgen Spitzmüller
Pavel Sanda wrote:

>> It's in the LyX/Cygwin package here:
>> ftp://ftp.lyx.org/pub/lyx/bin/1.6.2/lyx-1.6.2-cygwin.tar.gz
> 
> i see. imho worth to add such file somewere into development/.

Why not in the manuals?

>> I think that a button "Use src-specials" coud be added to
>> Preferences->Output->LaTeX such that \usepackage[active]{srcltx}
>> is inserted in the preamble. After that, you simply need to Ctrl-click
>> in the xdvi (maybe also kdvi) window to initiate the inverse search.
>> In yap, it would be still necessary to modify the preferences from
>> within the application.
> 
> i'm not sure this is system-wide setting - there are only some documents
> you want to use it and usually only in some part of editation process.
> thats why i proposed view menu... or document settings?

I think this is another case where we could have an rc (in LaTeX > Output) 
plus a document setting (in trunk: Document>Settings>Output). The former 
could be implemented in branch, the latter only in trunk.

> secondly instead instead "Use src-specials" use something more general
> and use \usepackage{pdfsync} in preamble for pdf output...

Yes. "Activate Reverse Search" (however, the pdf reverse search is currently 
only implemented in very few PDF viewers, at least the newer pdfsync 
approach).

Jürgen





Re: LyX 1.6.2 -- does it provide inverse search via Yap ?

2009-04-22 Thread Guenter Milde
On 2009-04-22, Pavel Sanda wrote:
> Enrico Forestieri wrote:

>> > i just asked if we can have (easily) something like View->DVI
>> > (reverse) in our output formats, which will work in normal lyx
>> > install, without any additional tweaks so xdvi works...

>> I think that a button "Use src-specials" coud be added to
>> Preferences->Output->LaTeX such that \usepackage[active]{srcltx}
>> is inserted in the preamble. 

>> After that, you simply need to Ctrl-click in the xdvi (maybe also
>> kdvi) window to initiate the inverse search. In yap, it would be still
>> necessary to modify the preferences from within the application.

> i'm not sure this is system-wide setting - there are only some
> documents you want to use it and usually only in some part of editation
> process. thats why i proposed view menu... or document settings?

Could we implement this as a module instead? Then it is a
document-specific setting without additional GUI element.

> secondly, instead "Use src-specials" use something more general
> and use \usepackage{pdfsync} in preamble for pdf output...

Günter




Re: LyX 1.6.2 -- does it provide inverse search via Yap ?

2009-04-22 Thread Pavel Sanda
Enrico Forestieri wrote:
> So, the bug is about "inverse DVI search", which is now implemented (and
> thus the bug should be either closed or renamed), but the last comments
> are about the "forward DVI search" feature.

i renamed the bug
pavel


Re: LyX 1.6.2 -- does it provide inverse search via Yap ?

2009-04-22 Thread Pavel Sanda
Enrico Forestieri wrote:
> > > > you even don't use any
> > > > special converter preferences or scripts for yap?
> > > 
> > > Only a wrapper is necessary. I attach here an excerpt of the README
> > > file in the LyX/Cygwin package, explaining everything.
> > 
> > where is this file located? i just grepped our tree without success.
> 
> It's in the LyX/Cygwin package here:
> ftp://ftp.lyx.org/pub/lyx/bin/1.6.2/lyx-1.6.2-cygwin.tar.gz

i see. imho worth to add such file somewere into development/.

> > > > is your solution extendible for xdvi?
> > > 
> > > What do you mean? When using xdvi you only have to be sure that
> > > src-specials are activated and then you simply Ctrl-click in the
> > > xdvi window to jump to the right location in the LyX window.
> > 
> > i just asked if we can have (easily) something like View->DVI (reverse)
> > in our output formats, which will work in normal lyx install, without
> > any additional tweaks so xdvi works...
> 
> I think that a button "Use src-specials" coud be added to
> Preferences->Output->LaTeX such that \usepackage[active]{srcltx}
> is inserted in the preamble. After that, you simply need to Ctrl-click
> in the xdvi (maybe also kdvi) window to initiate the inverse search.
> In yap, it would be still necessary to modify the preferences from
> within the application.

i'm not sure this is system-wide setting - there are only some documents you 
want
to use it and usually only in some part of editation process. thats why i
proposed view menu... or document settings?

secondly instead instead "Use src-specials" use something more general
and use \usepackage{pdfsync} in preamble for pdf output...
pavel


Re: LyX 1.6.2 -- does it provide inverse search via Yap ?

2009-04-22 Thread Enrico Forestieri
On Thu, Apr 23, 2009 at 12:40:15AM +0200, Pavel Sanda wrote:

> Enrico Forestieri wrote:
> > > > > is this version patched somehow?
> > > > 
> > > > No, it works OOTB on cygwin.
> > > 
> > > hmmm i recently studied this bug:
> > > http://www.lyx.org/trac/ticket/94
> > > and thought this is not possible OOTB.
> > 
> > I think this has always been possible OOTB with xdvi, provided that
> > you activate src-specials when producing the dvi.
> 
> by OOTB i meant without touching anything, neither prefs for output
> formats nor writing some wrapper...

Ha... Ok.

> > > you even don't use any
> > > special converter preferences or scripts for yap?
> > 
> > Only a wrapper is necessary. I attach here an excerpt of the README
> > file in the LyX/Cygwin package, explaining everything.
> 
> where is this file located? i just grepped our tree without success.

It's in the LyX/Cygwin package here:
ftp://ftp.lyx.org/pub/lyx/bin/1.6.2/lyx-1.6.2-cygwin.tar.gz

> > > is your solution extendible for xdvi?
> > 
> > What do you mean? When using xdvi you only have to be sure that
> > src-specials are activated and then you simply Ctrl-click in the
> > xdvi window to jump to the right location in the LyX window.
> 
> i just asked if we can have (easily) something like View->DVI (reverse)
> in our output formats, which will work in normal lyx install, without
> any additional tweaks so xdvi works...

I think that a button "Use src-specials" coud be added to
Preferences->Output->LaTeX such that \usepackage[active]{srcltx}
is inserted in the preamble. After that, you simply need to Ctrl-click
in the xdvi (maybe also kdvi) window to initiate the inverse search.
In yap, it would be still necessary to modify the preferences from
within the application.

-- 
Enrico


Re: LyX 1.6.2 -- does it provide inverse search via Yap ?

2009-04-22 Thread Enrico Forestieri
On Wed, Apr 22, 2009 at 11:33:18PM +0200, Pavel Sanda wrote:

> hmmm i recently studied this bug:
> http://www.lyx.org/trac/ticket/94
> and thought this is not possible OOTB.

Now that I read bug 94, I think that there's some confusion there.
Inverse DVI search is already implemented in LyX. What is missing is the
"forward DVI search", i.e., jumping to the correct position in the dvi
file starting from a given position in the LyX window.
So, the bug is about "inverse DVI search", which is now implemented (and
thus the bug should be either closed or renamed), but the last comments
are about the "forward DVI search" feature.

-- 
Enrico


Re: LyX 1.6.2 -- does it provide inverse search via Yap ?

2009-04-22 Thread Pavel Sanda
Enrico Forestieri wrote:
> > > > is this version patched somehow?
> > > 
> > > No, it works OOTB on cygwin.
> > 
> > hmmm i recently studied this bug:
> > http://www.lyx.org/trac/ticket/94
> > and thought this is not possible OOTB.
> 
> I think this has always been possible OOTB with xdvi, provided that
> you activate src-specials when producing the dvi.

by OOTB i meant without touching anything, neither prefs for output
formats nor writing some wrapper...

> > you even don't use any
> > special converter preferences or scripts for yap?
> 
> Only a wrapper is necessary. I attach here an excerpt of the README
> file in the LyX/Cygwin package, explaining everything.

where is this file located? i just grepped our tree without success.

> > is your solution extendible for xdvi?
> 
> What do you mean? When using xdvi you only have to be sure that
> src-specials are activated and then you simply Ctrl-click in the
> xdvi window to jump to the right location in the LyX window.

i just asked if we can have (easily) something like View->DVI (reverse)
in our output formats, which will work in normal lyx install, without
any additional tweaks so xdvi works...

pavel


Re: LyX 1.6.2 -- does it provide inverse search via Yap ?

2009-04-22 Thread Enrico Forestieri
On Wed, Apr 22, 2009 at 11:33:18PM +0200, Pavel Sanda wrote:

> Enrico Forestieri wrote:
> > On Wed, Apr 22, 2009 at 06:08:12PM +0200, Pavel Sanda wrote:
> > 
> > > Enrico Forestieri wrote:
> > > > On Tue, Apr 21, 2009 at 07:27:46PM -0700, sykes wrote:
> > > > 
> > > > > I'm running LyX 1.6.2 on Windows XP.  I would like to perform inverse
> > > > > searches from Yap back to the actual line in LyX.  Is this possible?  
> > > > >  
> > > > 
> > > > This is possible only with the cygwin version of LyX.
> > > 
> > > is this version patched somehow?
> > 
> > No, it works OOTB on cygwin.
> 
> hmmm i recently studied this bug:
> http://www.lyx.org/trac/ticket/94
> and thought this is not possible OOTB.

I think this has always been possible OOTB with xdvi, provided that
you activate src-specials when producing the dvi.

> you even don't use any
> special converter preferences or scripts for yap?

Only a wrapper is necessary. I attach here an excerpt of the README
file in the LyX/Cygwin package, explaining everything.

> is your solution extendible for xdvi?

What do you mean? When using xdvi you only have to be sure that
src-specials are activated and then you simply Ctrl-click in the
xdvi window to jump to the right location in the LyX window.

-- 
Enrico
Reverse DVI search
--

Reverse DVI search allows the cursor in LyX to automatically jump to the
point corresponding to where you Ctrl-click (if using xdvi) or double click
(if using yap) in the previewed DVI file.
This feature can be enabled as follows:

  * Activate src-specials by changing the "LaTeX (plain)->DraftDVI" converter
in Tools->Preferences->File Handling->Converters to "latex --src $$i"
if you use tetex, or to "latex -src-specials $$i" if you use miktex.
As an alternative to redefining the converter (maybe because you use
pplatex instead of latex for producing a DraftDVI), you can insert
"\usepackage[active]{srcltx}" in the preamble of the LyX file.

  * A program or script will be called by the dvi viewer when initiating
a reverse dvi search (xdvi uses Ctrl-click, yap uses double click).
This program should take 2 arguments, a filename and a line number, and
should pass this info to a running instance of LyX. This can be done
either using the lyxpipe (set by default to ~/.lyx/lyxpipe) or the
unix domain socket that lyx creates in its temporary directory.
A suitable script (/usr/local/bin/lyxeditor.sh) is already included in
this package for using the lyxpipe machinery. You could modify it in order
to better fit your needs, but it should already work out of the box.
Alternatively, you can use lyxclient.exe for communicating with lyx
through the socket mechanism.

  * If you use xdvi, you don't need to do anything else, as lyx already
provides the necessary hooks for automatically using lyxclient.exe.
However, if for whatever reason you want to use the lyxpipe instead
of the socket for communicating with lyx, simply change the DVI
viewer in "Tools->Preferences->File Handling->File formats" to
"xdvi -editor 'lyxeditor.sh %f %l'" (without double quotes), where
lyxeditor.sh is the aforementioned script.

  * If you use yap, you should set the name of the program directly in yap
through the View->Options menu. However, as yap is a native Windows
application, both lyxeditor.sh and lyxclient.exe have to be launched
through the wrapper program /usr/local/bin/lyxeditor.exe (after
installation, you will find its source in the /usr/local/share/lyx/etc
directory). After launching yap, choose the View->Options menu and select
the "Inverse DVI Search" tab. Click on the "New..." button and, in the
window which opens, enter "LyX Editor" (or any other name you like) in
the "Name:" field. Now click on the button labeled "..." to open a
filedialog and navigate to the directory containing lyxeditor.exe (it
will be C:\cygwin\usr\local\bin if C:\cygwin is your root directory).
Select lyxeditor.exe and then specify the program arguments as "%f %l"
(without the double quotes) if you want to use the lyxpipe, or as
"-g %f %l" (again, without quotes) if you want to use the lyxsocket.

  * If you did no mistakes, and if src-specials are activated as previously
described, whenever you Ctrl-click in xdvi, or double click in yap, the
cursor in LyX should jump to the desired location.


Re: LyX 1.6.2 -- does it provide inverse search via Yap ?

2009-04-22 Thread Pavel Sanda
Enrico Forestieri wrote:
> On Wed, Apr 22, 2009 at 06:08:12PM +0200, Pavel Sanda wrote:
> 
> > Enrico Forestieri wrote:
> > > On Tue, Apr 21, 2009 at 07:27:46PM -0700, sykes wrote:
> > > 
> > > > I'm running LyX 1.6.2 on Windows XP.  I would like to perform inverse
> > > > searches from Yap back to the actual line in LyX.  Is this possible?   
> > > 
> > > This is possible only with the cygwin version of LyX.
> > 
> > is this version patched somehow?
> 
> No, it works OOTB on cygwin.

hmmm i recently studied this bug:
http://www.lyx.org/trac/ticket/94
and thought this is not possible OOTB. you even don't use any
special converter preferences or scripts for yap?
is your solution extendible for xdvi?

pavel


Re: LyX 1.6.2 -- does it provide inverse search via Yap ?

2009-04-22 Thread Enrico Forestieri
On Wed, Apr 22, 2009 at 06:08:12PM +0200, Pavel Sanda wrote:

> Enrico Forestieri wrote:
> > On Tue, Apr 21, 2009 at 07:27:46PM -0700, sykes wrote:
> > 
> > > I'm running LyX 1.6.2 on Windows XP.  I would like to perform inverse
> > > searches from Yap back to the actual line in LyX.  Is this possible?   
> > 
> > This is possible only with the cygwin version of LyX.
> 
> is this version patched somehow?

No, it works OOTB on cygwin.

-- 
Enrico


Re: LyX 1.6.2 -- does it provide inverse search via Yap ?

2009-04-22 Thread Pavel Sanda
Enrico Forestieri wrote:
> On Tue, Apr 21, 2009 at 07:27:46PM -0700, sykes wrote:
> 
> > I'm running LyX 1.6.2 on Windows XP.  I would like to perform inverse
> > searches from Yap back to the actual line in LyX.  Is this possible?   
> 
> This is possible only with the cygwin version of LyX.

is this version patched somehow?
pavel


Re: LyX 1.6.2 -- does it provide inverse search via Yap ?

2009-04-22 Thread Enrico Forestieri
On Tue, Apr 21, 2009 at 07:27:46PM -0700, sykes wrote:

> I'm running LyX 1.6.2 on Windows XP.  I would like to perform inverse
> searches from Yap back to the actual line in LyX.  Is this possible?   

This is possible only with the cygwin version of LyX.

-- 
Enrico