From c41557504376e0f508b41e0d18c2872abdc3d8d8 Mon Sep 17 00:00:00 2001 From: Enrico Forestieri Date: Sun, 23 Aug 2009 18:18:39 +0000 Subject: [PATCH] Update docs about the LyX server and the reverse search feature. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@31214 a592a061-630c-0410-9148-cb99ea01b6c8 --- lib/doc/Additional.lyx | 377 ++++++++++++++++++++++++++++++++--------- 1 file changed, 294 insertions(+), 83 deletions(-) diff --git a/lib/doc/Additional.lyx b/lib/doc/Additional.lyx index 324ff77b28..9764dd9762 100644 --- a/lib/doc/Additional.lyx +++ b/lib/doc/Additional.lyx @@ -4136,38 +4136,48 @@ push citations to LyX. \end_layout -\begin_layout Standard -Please note that, at present, -\emph on -the server does not work natively on Windows -\emph default +\begin_layout Section +Starting the LyX Server +\end_layout -\begin_inset Foot +\begin_layout Standard +The LyX server works through the use of a pair of named pipes. + These are usually located in +\begin_inset Flex CharStyle:Code status collapsed \begin_layout Plain Layout -There is no reason it cannot do so. - But none of the developers on Windows have yet implemented this functionality - there. +UserDir \end_layout \end_inset - but it does work with Cygwin versions of LyX. -\end_layout -\begin_layout Section -Starting the LyX Server -\end_layout +\begin_inset Foot +status collapsed -\begin_layout Standard -The LyX server works through the use of a pair of named pipes. - These are usually located in +\begin_layout Plain Layout +On Windows, +\emph on +local +\emph default + named pipes are special objects located in \begin_inset Flex CharStyle:Code status collapsed \begin_layout Plain Layout -UserDir + +\backslash + +\backslash +. +\backslash +pipe +\end_layout + +\end_inset + +. \end_layout \end_inset @@ -4214,7 +4224,7 @@ lyxpipe.out status collapsed \begin_layout Plain Layout -.lyxpipe.in +lyxpipe.in \end_layout \end_inset @@ -4224,7 +4234,7 @@ status collapsed status collapsed \begin_layout Plain Layout -.lyxpipe.out +lyxpipe.out \end_layout \end_inset @@ -4251,7 +4261,25 @@ status collapsed \end_inset +, or +\begin_inset Flex CharStyle:Code +status collapsed + +\begin_layout Plain Layout +" +\backslash + +\backslash . +\backslash +pipe +\backslash +lyxpipe" +\end_layout + +\end_inset + + on Windows. You \emph on must @@ -4283,7 +4311,7 @@ status collapsed ' to create the pipes. If one of the pipes already exists, LyX will assume that another LyX process is already running and will not start the server. - If for some other reason, an unused + On POSIX (Unix like) systems, if for some other reason, an unused \begin_inset Quotes eld \end_inset @@ -4295,6 +4323,16 @@ stale it. If this fails for some reason, you will need to delete the pipes manually and then restart LyX. + On Windows, pipes are deleted by the OS on program termination or crash, + so +\begin_inset Quotes eld +\end_inset + +stale +\begin_inset Quotes erd +\end_inset + + pipes should not be possible. \end_layout \begin_layout Standard @@ -5374,7 +5412,7 @@ Reverse search is triggered by SHIFT-click. \end_layout \begin_layout Subsubsection* -YAP (Cygwin) +YAP (Windows) \end_layout \begin_layout Standard @@ -5465,49 +5503,130 @@ status collapsed \end_inset - if you want to use the shell script above, or as +. + The \begin_inset Flex CharStyle:Code status collapsed \begin_layout Plain Layout --g %f %l +lyxeditor.bat \end_layout \end_inset - if you want to use the + wrapper is used for communicating with LyX through the +\emph on +lyxpipe +\emph default + and is as follows: +\end_layout + +\begin_layout LyX-Code +@echo off +\begin_inset Newline newline +\end_inset + +echo LYXCMD:revdvi:server-goto-file-row:%1 %2> +\backslash + +\backslash +. +\backslash +pipe +\backslash +lyxpipe.in +\begin_inset Newline newline +\end_inset + +type +\backslash + +\backslash +. +\backslash +pipe +\backslash +lyxpipe.out +\end_layout + +\begin_layout Standard +Make sure that the LyXServer pipe path you specified in LyX is \begin_inset Flex CharStyle:Code status collapsed \begin_layout Plain Layout -lyxclient + +\backslash + +\backslash +. +\backslash +pipe +\backslash +lyxpipe \end_layout \end_inset - program. - Since yap is a native Windows application, the filename it provides should - be converted to POSIX style before being passed to +, otherwise change the \begin_inset Flex CharStyle:Code status collapsed \begin_layout Plain Layout -lyxeditor.sh +lyxeditor.bat \end_layout \end_inset - or + wrapper accordingly. + You are advised to select in +\begin_inset Flex CharStyle:MenuItem +status collapsed + +\begin_layout Plain Layout +Preferences\SpecialChar \menuseparator +Paths +\end_layout + +\end_inset + + a temporary directory whose name does not contain spaces, otherwise inverse + search will fail. +\end_layout + +\begin_layout Standard +In yap, reverse search is triggered by double-click. +\end_layout + +\begin_layout Subsubsection* +SumatraPDF (Windows) +\end_layout + +\begin_layout Standard +In order to use SumatraPDF for inverse search, enter \begin_inset Flex CharStyle:Code status collapsed \begin_layout Plain Layout -lyxclient +SumatraPDF -inverse-search "lyxeditor.bat %f %l" +\end_layout + +\end_inset + + in the viewer setting in +\begin_inset Flex CharStyle:MenuItem +status collapsed + +\begin_layout Plain Layout +Preferences\SpecialChar \menuseparator +File Handling\SpecialChar \menuseparator +File formats\SpecialChar \menuseparator +PDF (pdflatex) \end_layout \end_inset -, and this is the purpose of the +, where \begin_inset Flex CharStyle:Code status collapsed @@ -5517,45 +5636,89 @@ lyxeditor.bat \end_inset - wrapper, which is as follows: + is the previous wrapper. + If SumatraPDF.exe is not in your command PATH, use its full file name. + Again, make sure that the LyX temporary directory name does not contain + spaces, otherwise inverse search will fail. +\end_layout + +\begin_layout Standard +Reverse search is triggered by double-click. +\end_layout + +\begin_layout Subsubsection* +YAP (Cygwin) +\end_layout + +\begin_layout Standard +First of all, make sure that yap is your default DVI viewer in the Windows + environment, then launch it, choose its +\begin_inset Flex CharStyle:MenuItem +status collapsed + +\begin_layout Plain Layout +View\SpecialChar \menuseparator +Options \end_layout -\begin_layout LyX-Code -@echo off -\begin_inset Newline newline \end_inset -if "%1" == "-g" goto lyxclient -\begin_inset Newline newline + menu and select the +\begin_inset Quotes eld \end_inset -bash -c 'lyxeditor.sh $(cygpath -a "%1") %2' -\begin_inset Newline newline +Inverse DVI Search +\begin_inset Quotes erd \end_inset -exit -\begin_inset Newline newline + tab. + Click on the +\begin_inset Quotes eld \end_inset -:lyxclient -\begin_inset Newline newline +New\SpecialChar \ldots{} + +\begin_inset Quotes erd \end_inset -bash -c 'lyxclient %1 $(cygpath -a "%2") %3' -\end_layout + button and, in the window that opens, enter +\begin_inset Quotes eld +\end_inset -\begin_layout Standard -You have to make sure that both +LyX Editor +\begin_inset Quotes erd +\end_inset + + (or any other name you like) in the +\begin_inset Quotes eld +\end_inset + +Name: +\begin_inset Quotes erd +\end_inset + + field. + Now click on the button labeled +\begin_inset Quotes eld +\end_inset + +\SpecialChar \ldots{} + +\begin_inset Quotes erd +\end_inset + + to open a file dialog and navigate to the directory containing the \begin_inset Flex CharStyle:Code status collapsed \begin_layout Plain Layout -lyxeditor.sh +lyxclient.exe \end_layout \end_inset - and + program. + Select \begin_inset Flex CharStyle:Code status collapsed @@ -5565,75 +5728,77 @@ lyxclient.exe \end_inset - are in the command PATH, otherwise you have to use their full posix path - in the above batch file. -\end_layout + and then specify the program arguments as as +\begin_inset Flex CharStyle:Code +status collapsed -\begin_layout Standard -In yap, reverse search is triggered by double-click. +\begin_layout Plain Layout +-g %f %l \end_layout -\begin_layout Subsubsection* -SumatraPDF (Cygwin) -\end_layout +\end_inset -\begin_layout Standard -In SumatraPDF, you can set the name of the program that communicates with - LyX by simply launching SumatraPDF as +. + In this way, you will be using the +\emph on +lyxsocket +\emph default + for communicating with LyX. + If, for whatever reason, you want to use the +\emph on +lyxpipe +\emph default +, select \begin_inset Flex CharStyle:Code status collapsed \begin_layout Plain Layout -SumatraPDF -inverse-search "lyxeditor.bat -g %f %l" +bash.exe \end_layout \end_inset - and then quit. - The program will remember the setting and using the + instead of \begin_inset Flex CharStyle:Code status collapsed \begin_layout Plain Layout --inverse-search +lyxclient.exe \end_layout \end_inset - option will not be needed from now on -\begin_inset Foot -status collapsed - -\begin_layout Plain Layout -It has been reported that SumatraPDF is not able to remember the settings - if it is installed in the Program Files system folder. - This problem can be avoided by installing it somewhere else, for example - in + and specify \begin_inset Flex CharStyle:Code status collapsed \begin_layout Plain Layout -/usr/local/bin +-c 'lyxeditor.sh "%f" %l' \end_layout \end_inset -. + as program arguments (here, don't forget the double quotes around +\begin_inset Flex CharStyle:Code +status collapsed + +\begin_layout Plain Layout +%f \end_layout \end_inset - (in this way you will be using the lyxsocket; omit the + as they are essential), where \begin_inset Flex CharStyle:Code status collapsed \begin_layout Plain Layout --g +lyxeditor.sh \end_layout \end_inset - option if you want to use the lyxpipe and be sure that the + is the previously introduced shell script (make sure that \begin_inset Flex CharStyle:Code status collapsed @@ -5643,8 +5808,19 @@ lyxeditor.sh \end_inset - script is in your command PATH). - If SumatraPDF is not your default PDF viewer, you should enter + is in the bash command PATH, otherwise use its full posix name). +\end_layout + +\begin_layout Standard +In yap, reverse search is triggered by double-click. +\end_layout + +\begin_layout Subsubsection* +SumatraPDF (Cygwin) +\end_layout + +\begin_layout Standard +In order to use SumatraPDF for inverse search, enter \begin_inset Flex CharStyle:Code status collapsed @@ -5699,12 +5875,47 @@ cd $(dirname $1) \begin_inset Newline newline \end_inset -SumatraPDF.exe $(basename $1) +SumatraPDF -inverse-search "lyxclient -g %f %l" $(basename $1) \end_layout \begin_layout Standard This is needed because SumatraPDF is a native Windows application and does not understand the posix paths used by the Cygwin version of LyX. + If SumatraPDF is not in your command PATH, use its full posix path in the + script above. + Again, if you want to use the +\emph on +lyxpipe +\emph default + instead of the +\emph on +lyxsocket +\emph default +, replace +\begin_inset Flex CharStyle:Code +status collapsed + +\begin_layout Plain Layout +"lyxclient -g %f %l" +\end_layout + +\end_inset + + with +\begin_inset Flex CharStyle:Code +status collapsed + +\begin_layout Plain Layout +"bash -c 'lyxeditor.sh +\backslash +"%f +\backslash +" %l'" +\end_layout + +\end_inset + +. \end_layout \begin_layout Standard -- 2.39.2