-#LyX 1.6.1 created this file. For more info see http://www.lyx.org/
-\lyxformat 345
+#LyX 2.0.0svn created this file. For more info see http://www.lyx.org/
+\lyxformat 362
\begin_document
\begin_header
\textclass scrbook
\font_sans default
\font_typewriter default
\font_default_family default
+\use_xetex false
\font_sc false
\font_osf false
\font_sf_scale 100
\font_tt_scale 100
\graphics default
+\default_output_format default
+\bibtex_command default
+\index_command default
\paperfontsize 12
\spacing single
\use_hyperref true
\use_esint 0
\cite_engine basic
\use_bibtopic false
+\use_indices false
\paperorientation portrait
\secnumdepth 3
\tocdepth 3
preamble in order to get the desired effects.
\end_layout
+\begin_layout Standard
+For more information on fancy headers, see the
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+fancyhdr
+\end_layout
+
+\end_inset
+
+ package documentation.
+ This can be found in the file
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+fancyhdr.dvi
+\end_layout
+
+\end_inset
+
+, which should have been installed with your LaTeX distribution, or
+\begin_inset CommandInset href
+LatexCommand href
+name "online"
+target "http://www.ctan.org/tex-archive/macros/latex/contrib/fancyhdr/"
+
+\end_inset
+
+.
+\end_layout
+
\begin_layout Standard
The page header is divided into three fields, not surprisingly labeled
\begin_inset Quotes eld
are marked fancy when using the global fancy setting.
\end_layout
-\begin_layout Standard
-There are more complex commands which will let you insert things in the
- upper left on odd numbered pages, etc., but we will refer you to the
-\begin_inset Flex CharStyle:Code
-status collapsed
-
-\begin_layout Plain Layout
-fancyhdr
-\end_layout
-
-\end_inset
-
- package documentation for more information.
- (Find the file
-\begin_inset Flex CharStyle:Code
-status collapsed
-
-\begin_layout Plain Layout
-fancyhdr.dvi
-\end_layout
-
-\end_inset
-
-.)
-\end_layout
-
\begin_layout Standard
As a final example, it is possible to include an image in the header or
footer.
\align center
\begin_inset Tabular
<lyxtabular version="3" rows="7" columns="2">
-<features>
+<features tabularvalignment="middle">
<column alignment="center" valignment="top" width="0pt">
<column alignment="center" valignment="top" width="0pt">
<row>
\begin_layout Standard
Please note that, at present,
\emph on
-the server does not work on Windows
+the server does not work natively on Windows
\emph default
-.
+
\begin_inset Foot
status collapsed
\end_inset
-
+ but it does work with Cygwin versions of LyX.
\end_layout
\begin_layout Section
' 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.
- This means that if LyX crashes, or if for some other reason, a
+ If for some other reason, an unused
\begin_inset Quotes eld
\end_inset
\begin_inset Quotes erd
\end_inset
- pipe is left in existence when LyX closes, then LyX will not start the
- server.
- (This is bug 641.) You will need to delete the pipes manually and then restart
- LyX.
+ pipe is left in existence when LyX closes, then LyX will try to delete
+ it.
+ If this fails for some reason, you will need to delete the pipes manually
+ and then restart LyX.
\end_layout
\begin_layout Standard
\end_layout
\begin_layout Standard
-Other than this, there are a few points to consider:
-\end_layout
-
-\begin_layout Itemize
-Both server and clients must run on UNIX or OS/2 machines.
- Communications between LyX on UNIX and clients on OS/2 or vice versa is
- not possible right now.
-\end_layout
-
-\begin_layout Itemize
-On OS/2, only one client can connect to LyXServer at a time.
-\end_layout
-
-\begin_layout Itemize
-On OS/2, clients must open the input pipe with
+You can find a complete example client written in C in the source distribution
+ as
\begin_inset Flex CharStyle:Code
status collapsed
\begin_layout Plain Layout
-O_WRONLY
+development/lyxserver/server_monitor.c
\end_layout
\end_inset
- mode.
+.
\end_layout
\begin_layout Standard
-You can find a complete example client written in C in the source distribution
- as
+Another useful tool is command-line based client you will find in
\begin_inset Flex CharStyle:Code
status collapsed
\begin_layout Plain Layout
-development/lyxserver/server_monitor.c
+src/client/lyxclient
\end_layout
\end_inset
\begin_layout LyX-Code
echo "LYXCMD:test:beginning-of-buffer:" >~/.lyxpipe.in
-\end_layout
+\begin_inset Newline newline
+\end_inset
-\begin_layout LyX-Code
echo "LYXCMD:test:get-xy:" >~/.lyxpipe.in
\begin_inset Newline newline
\end_inset
\begin_inset Quotes eld
\end_inset
-hello
-\begin_inset Quotes erd
+hello
+\begin_inset Quotes erd
+\end_inset
+
+ is received from a client, LyX will report back to inform the client that
+ it's listening to it's messages, while
+\begin_inset Quotes eld
+\end_inset
+
+bye
+\begin_inset Quotes erd
+\end_inset
+
+ sent from LyX will inform clients that LyX is closing.
+\end_layout
+
+\begin_layout Section
+Reverse DVI/PDF search
+\end_layout
+
+\begin_layout Standard
+Some DVI/PDF viewers
+\begin_inset Foot
+status collapsed
+
+\begin_layout Plain Layout
+The following viewers offer the reverse PDF search feature: Okular on KDE/Linux,
+ Skim on Mac OSX and SumatraPDF on Windows.
+\end_layout
+
+\end_inset
+
+ provide
+\emph on
+reverse search
+\emph default
+ facility (also called
+\emph on
+inverse search
+\emph default
+).
+ This means that you can tell LyX to put the cursor to a specific line in
+ the document by clicking at the respective position in the DVI/PDF output.
+ To achieve this, the viewer must be able to communicate with LyX.
+ This is done via the LyX server either by using the named pipe (
+\emph on
+lyxpipe
+\emph default
+), or the UNIX domain socket (
+\emph on
+lyxsocket
+\emph default
+) that LyX creates in its temporary directory (this is the way the
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+lyxclient
+\end_layout
+
+\end_inset
+
+ program communicates with LyX).
+ In some cases, you need a helper script that mediates between the viewer
+ and LyX, in others, the viewer can communicate with LyX directly.
+ This depends on the selected viewer and on your operating system.
+ The same applies to the way viewers need to be configured and the way the
+ reverse search is actually performed.
+ In what follows, we will thus describe how to setup reverse search for
+ specific viewers.
+ Before we turn to this, though, we will explain what needs to be done generally
+ to enable reverse search in the DVI/PDF output.
+\end_layout
+
+\begin_layout Subsection
+Enabling reverse search
+\end_layout
+
+\begin_layout Standard
+LaTeX provides several different methods for reverse search.
+ Some are built-in in the
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+latex/pdflatex
+\end_layout
+
+\end_inset
+
+ program, some are provided by external packages.
+ Your choice depends on whether your LaTeX distribution already provides
+ a given method (the built-in methods are rather new) and whether your viewer
+ can cope with it.
+ The available methods are described in the following.
+\end_layout
+
+\begin_layout Subsubsection*
+Built-in DVI-search via src-specials (DVI only)
+\end_layout
+
+\begin_layout Standard
+This method provides the DVI file with the necessary information for reverse
+ search.
+ It is available in LaTeX since quite some time (any somewhat recent LaTeX
+ distribution should include it), and it works reliably.
+ To enable it, change the
+\begin_inset Flex CharStyle:MenuItem
+status collapsed
+
+\begin_layout Plain Layout
+LaT
+\begin_inset ERT
+status collapsed
+
+\begin_layout Plain Layout
+
+{}
+\end_layout
+
+\end_inset
+
+eX (plain)->DVI
+\end_layout
+
+\end_inset
+
+ or
+\begin_inset Flex CharStyle:MenuItem
+status collapsed
+
+\begin_layout Plain Layout
+LaT
+\begin_inset ERT
+status collapsed
+
+\begin_layout Plain Layout
+
+{}
+\end_layout
+
+\end_inset
+
+eX (plain)->DraftDVI
+\end_layout
+
+\end_inset
+
+ converter in
+\begin_inset Flex CharStyle:MenuItem
+status collapsed
+
+\begin_layout Plain Layout
+Preferences\SpecialChar \menuseparator
+File Handling\SpecialChar \menuseparator
+Converters
+\end_layout
+
+\end_inset
+
+ to
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+latex -src-specials $$i
+\end_layout
+
+\end_inset
+
+.
+ If this doesn't work, check if your TeX engine needs different options
+ (the syntax might differ in some distributions).
+\end_layout
+
+\begin_layout Subsubsection*
+External Packages (PDFSync and scrltx)
+\end_layout
+
+\begin_layout Standard
+The packages
+\emph on
+pdfsync
+\emph default
+ and
+\emph on
+scrltx
+\emph default
+ provide reverse search facility for PDF output (via pdflatex) and DVI output,
+ respectively.
+ In order to enable it, load the packages in the LyX preamble:
+\end_layout
+
+\begin_layout Itemize
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+
+\backslash
+usepackage{pdfsync}
+\end_layout
+
+\end_inset
+
+ for reverse PDF search,
+\end_layout
+
+\begin_layout Itemize
+
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+
+\backslash
+usepackage[active]{srcltx}
+\end_layout
+
+\end_inset
+
+ for reverse DVI search.
+\end_layout
+
+\begin_layout Standard
+If you want to be able to perform both DVI and PDF reverse searches, you
+ can also insert in the preamble the following lines
+\end_layout
+
+\begin_layout LyX-Code
+
+\backslash
+usepackage{ifpdf}
+\begin_inset Newline newline
+\end_inset
+
+
+\backslash
+ifpdf
+\begin_inset Newline newline
+\end_inset
+
+
+\backslash
+usepackage{pdfsync}
+\begin_inset Newline newline
+\end_inset
+
+
+\backslash
+else
+\begin_inset Newline newline
+\end_inset
+
+
+\backslash
+usepackage[active]{srcltx}
+\begin_inset Newline newline
+\end_inset
+
+
+\backslash
+fi
+\end_layout
+
+\begin_layout Standard
+This way, you can preview the file as either DVI or PDF (pdflatex) and the
+ right package will be used.
+\end_layout
+
+\begin_layout Standard
+Note that PDFSync might affect the output layout of your document.
+ It is therefore advised to disable PDFsync for final documents.
+\end_layout
+
+\begin_layout Subsubsection*
+Built-in reverse search via SyncTeX (DVI and PDF)
+\end_layout
+
+\begin_layout Standard
+Recent versions of
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+(pdf)latex
+\end_layout
+
+\end_inset
+
+ have built-in support for both PDF and DVI reverse search.
+ This so-called
+\emph on
+SyncTeX
+\emph default
+ facility is basically the result of the integration of the PDFSync package
+ to the pdftex program and its merge with the
+\emph on
+scr-specials
+\emph default
+ approach.
+ You need at least TeXLive 2008 or a recent MikTeX distribution in order
+ to use it.
+ Also note that only a few PDF viewers (Skim on the Mac, SumatraPDF on Windows)
+ already provide SyncTeX support.
+\end_layout
+
+\begin_layout Standard
+To enable SyncTeX for DVI output, change the
+\begin_inset Flex CharStyle:MenuItem
+status collapsed
+
+\begin_layout Plain Layout
+LaT
+\begin_inset ERT
+status collapsed
+
+\begin_layout Plain Layout
+
+{}
+\end_layout
+
+\end_inset
+
+eX (plain) -> DVI
+\end_layout
+
+\end_inset
+
+ or
+\begin_inset Flex CharStyle:MenuItem
+status collapsed
+
+\begin_layout Plain Layout
+LaT
+\begin_inset ERT
+status collapsed
+
+\begin_layout Plain Layout
+
+{}
+\end_layout
+
+\end_inset
+
+eX (plain) -> DraftDVI
+\end_layout
+
+\end_inset
+
+ converter in
+\begin_inset Flex CharStyle:MenuItem
+status collapsed
+
+\begin_layout Plain Layout
+Preferences\SpecialChar \menuseparator
+File Handling\SpecialChar \menuseparator
+Converters
+\end_layout
+
+\end_inset
+
+ to
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+latex -synctex=1 $$i
+\end_layout
+
+\end_inset
+
+, and for PDF output, change the
+\begin_inset Flex CharStyle:MenuItem
+status collapsed
+
+\begin_layout Plain Layout
+LaT
+\begin_inset ERT
+status collapsed
+
+\begin_layout Plain Layout
+
+{}
+\end_layout
+
+\end_inset
+
+eX (pdflatex) -> PDF (pdflatex)
+\end_layout
+
+\end_inset
+
+ or converter to
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+pdflatex -synctex=1 $$i
+\end_layout
+
+\end_inset
+
+.
+ Check the documentation of your viewer whether the viewer needs to be configure
+d for the use with SyncTeX.
+\begin_inset Foot
+status collapsed
+
+\begin_layout Plain Layout
+The
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+-synctex=1
+\end_layout
+
+\end_inset
+
+ option enables gzip compression.
+ If your viewer does not support it, you should instead use
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+-synctex=-1
+\end_layout
+
+\end_inset
+
+.
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Subsection
+Configuring and using specific viewers
+\end_layout
+
+\begin_layout Subsubsection*
+Xdvi (all platforms)
+\end_layout
+
+\begin_layout Standard
+If you use
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+xdvi
+\end_layout
+
+\end_inset
+
+, you don't need to do anything else for performing a reverse DVI search,
+ as LyX already provides the necessary hooks for automatically using the
+
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+lyxclient
+\end_layout
+
+\end_inset
+
+ program.
+ Just setup your document as described above (reverse search is triggered
+ by Ctrl-click or Alt-click on Mac OSX, respectively).
+\end_layout
+
+\begin_layout Standard
+However, if for whatever reason you want to use the named pipe instead of
+ the socket for communicating with LyX, simply change the DVI viewer in
+
+\begin_inset Flex CharStyle:MenuItem
+status collapsed
+
+\begin_layout Plain Layout
+Preferences\SpecialChar \menuseparator
+File Handling\SpecialChar \menuseparator
+File formats
+\end_layout
+
+\end_inset
+
+ to
+\begin_inset Foot
+status collapsed
+
+\begin_layout Plain Layout
+On Mac OSX you have to use
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+DISPLAY=:0.0 xdvi -editor 'lyxeditor.sh %f %l'
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\end_inset
+
+
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+xdvi -editor 'lyxeditor.sh %f %l'
+\end_layout
+
+\end_inset
+
+, where
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+lyxeditor.sh
+\end_layout
+
+\end_inset
+
+ is a suitable script.
+ For example, a minimal shell script is the following one:
+\end_layout
+
+\begin_layout LyX-Code
+#!/bin/sh
+\begin_inset Newline newline
+\end_inset
+
+LYXPIPE="/path/to/lyxpipe"
+\begin_inset Newline newline
+\end_inset
+
+COMMAND="LYXCMD:revdvi:server-goto-file-row:$1 $2"
+\begin_inset Newline newline
+\end_inset
+
+echo "$COMMAND" > "${LYXPIPE}".in || exit
+\begin_inset Newline newline
+\end_inset
+
+read < "${LYXPIPE}".out || exit
+\end_layout
+
+\begin_layout Standard
+where
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+/path/to/lyxpipe
+\end_layout
+
+\end_inset
+
+ is the Ly
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+{}
+\end_layout
+
+\end_inset
+
+XServer pipe path specified in
+\begin_inset Flex CharStyle:MenuItem
+status collapsed
+
+\begin_layout Plain Layout
+Preferences\SpecialChar \menuseparator
+Paths
+\end_layout
+
+\end_inset
+
+.
+\begin_inset Foot
+status collapsed
+
+\begin_layout Plain Layout
+In the
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+development/tools
+\end_layout
+
+\end_inset
+
+ folder of a source distribution you can find a
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+lyxeditor
+\end_layout
+
+\end_inset
+
+ script which is able to locate the
+\emph on
+lyxpipe
+\emph default
+ based on your preferences.
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Subsubsection*
+MacDviX (Mac OSX)
+\end_layout
+
+\begin_layout Standard
+At the end of
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+/Applications/MacDviX_Folder/calleditor.script
+\end_layout
+
+\end_inset
+
+, add the following lines:
+\end_layout
+
+\begin_layout LyX-Code
+/Applications/Ly
+\begin_inset ERT
+status collapsed
+
+\begin_layout Plain Layout
+
+{}
+\end_layout
+
+\end_inset
+
+X.app/Contents/MacOS/lyxeditor "$2" $1
+\begin_inset Newline newline
+\end_inset
+
+exit 1
+\end_layout
+
+\begin_layout Standard
+Modify the lines accordingly if you install LyX somewhere else than in the
+ Applications folder.
+\end_layout
+
+\begin_layout Standard
+Reverse search is triggered by Alt-click (OPTION-click).
+\end_layout
+
+\begin_layout Subsubsection*
+Skim (Mac OSX)
+\end_layout
+
+\begin_layout Standard
+Enter
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+open -a Skim.app $$i
+\end_layout
+
+\end_inset
+
+ to 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 then in
+\begin_inset Flex CharStyle:MenuItem
+status collapsed
+
+\begin_layout Plain Layout
+Skim\SpecialChar \menuseparator
+Preferences\SpecialChar \menuseparator
+Sync
+\end_layout
+
+\end_inset
+
+ select Ly
+\begin_inset ERT
+status collapsed
+
+\begin_layout Plain Layout
+
+{}
+\end_layout
+
+\end_inset
+
+X.
+\end_layout
+
+\begin_layout Standard
+Reverse search is triggered by COMMAND-SHIFT-click
+\end_layout
+
+\begin_layout Subsubsection*
+Okular (KDE)
+\end_layout
+
+\begin_layout Standard
+Go to
+\begin_inset Flex CharStyle:MenuItem
+status collapsed
+
+\begin_layout Plain Layout
+Settings\SpecialChar \menuseparator
+Configure Okular\SpecialChar \ldots{}
+\SpecialChar \menuseparator
+Editor
+\end_layout
+
+\end_inset
+
+, select
+\begin_inset Quotes eld
+\end_inset
+
+Custom Text Editor
+\begin_inset Quotes erd
+\end_inset
+
+ and add the command
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+lyxclient -g %f %l
+\end_layout
+
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+Reverse search is triggered by SHIFT-click.
+\end_layout
+
+\begin_layout Subsubsection*
+YAP (Cygwin)
+\end_layout
+
+\begin_layout Standard
+Launch yap, choose its
+\begin_inset Flex CharStyle:MenuItem
+status collapsed
+
+\begin_layout Plain Layout
+View\SpecialChar \menuseparator
+Options
+\end_layout
+
+\end_inset
+
+ menu and select the
+\begin_inset Quotes eld
+\end_inset
+
+Inverse DVI Search
+\begin_inset Quotes erd
+\end_inset
+
+ tab.
+ Click on the
+\begin_inset Quotes eld
+\end_inset
+
+New\SpecialChar \ldots{}
+
+\begin_inset Quotes erd
+\end_inset
+
+ button and, in the window that opens, enter
+\begin_inset Quotes eld
+\end_inset
+
+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 batch
+ file
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+lyxeditor.bat
+\end_layout
+
+\end_inset
+
+ (see below).
+ Select
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+lyxeditor.bat
+\end_layout
+
+\end_inset
+
+ and then specify the program arguments as
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+%f %l
+\end_layout
+
+\end_inset
+
+ if you want to use the shell script above, or as
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+-g %f %l
+\end_layout
+
+\end_inset
+
+ if you want to use the
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+lyxclient
+\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
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+lyxeditor.sh
+\end_layout
+
+\end_inset
+
+ or
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+lyxclient
+\end_layout
+
+\end_inset
+
+, and this is the purpose of the
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+lyxeditor.bat
+\end_layout
+
+\end_inset
+
+ wrapper, which is as follows:
+\end_layout
+
+\begin_layout LyX-Code
+@echo off
+\begin_inset Newline newline
+\end_inset
+
+if "%1" == "-g" goto lyxclient
+\begin_inset Newline newline
+\end_inset
+
+bash -c 'lyxeditor.sh $(cygpath -a "%1") %2'
+\begin_inset Newline newline
+\end_inset
+
+exit
+\begin_inset Newline newline
+\end_inset
+
+:lyxclient
+\begin_inset Newline newline
+\end_inset
+
+bash -c 'lyxclient %1 $(cygpath -a "%2") %3'
+\end_layout
+
+\begin_layout Standard
+You have to make sure that both
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+lyxeditor.sh
+\end_layout
+
+\end_inset
+
+ and
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+lyxclient.exe
+\end_layout
+
+\end_inset
+
+ are in the command PATH, otherwise you have to use their full posix path
+ in the above batch file.
+\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 SumatraPDF, you can set the name of the program that communicates with
+ LyX by simply launching SumatraPDF as
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+SumatraPDF -inverse-search "lyxeditor.bat -g %f %l"
+\end_layout
+
+\end_inset
+
+ and then quit.
+ The program will remember the setting and using the
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+-inverse-search
+\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
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+/usr/local/bin
+\end_layout
+
+\end_inset
+
+.
+\end_layout
+
+\end_inset
+
+ (in this way you will be using the lyxsocket; omit the
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+-g
+\end_layout
+
+\end_inset
+
+ option if you want to use the lyxpipe and be sure that the
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+lyxeditor.sh
+\end_layout
+
+\end_inset
+
+ script is in your command PATH).
+ If SumatraPDF is not your default PDF viewer, you should enter
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+SumatraPDF.sh
+\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
+
+, where
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+SumatraPDF.sh
+\end_layout
+
+\end_inset
+
+ is the following script (to be placed in your command PATH,
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+/usr/local/bin
+\end_layout
+
\end_inset
- is received from a client, LyX will report back to inform the client that
- it's listening to it's messages, while
-\begin_inset Quotes eld
+ being the best choice):
+\end_layout
+
+\begin_layout LyX-Code
+#!/bin/bash
+\begin_inset Newline newline
\end_inset
-bye
-\begin_inset Quotes erd
+cd $(dirname $1)
+\begin_inset Newline newline
\end_inset
- sent from LyX will inform clients that LyX is closing.
+SumatraPDF.exe $(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.
+\end_layout
+
+\begin_layout Standard
+Reverse search is triggered by double-click.
\end_layout
\begin_layout Chapter
\begin_layout Section
Foils [aka
\family sans
-Foil
+FoilTeX
\family default
-\noun on
-TeX
-\noun default
]
\begin_inset CommandInset label
LatexCommand label
There are two document classes that can do this: the default slides class
and the
\family sans
-Foil
+FoilTeX
\family default
-TeX slides class.
+ slides class.
This section documents the latter.
\end_layout
\begin_layout Itemize
\family sans
-Foil
+FoilTeX
\family default
-TeX supports A4 and Letter paper sizes as well as a special size for working
+ supports A4 and Letter paper sizes as well as a special size for working
with 35
\begin_inset space \thinspace{}
\end_inset
setting behaves a bit differently for this class.
\family sans
-Foil
+FoilTeX
\family default
-TeX provides extensive footer and header capabilities including a user-defined
+ provides extensive footer and header capabilities including a user-defined
logo.
See section
\begin_inset space ~
\family default
package although its use with
\family sans
-Foil
+FoilTeX
\family default
-TeX is discouraged by the writer of the
+ is discouraged by the writer of the
\family sans
-Foil
+FoilTeX
\family default
-TeX package because of some potential page layout clashes.
+ package because of some potential page layout clashes.
\end_layout
\end_deeper
document.
This option tells
\family sans
-Foil
+FoilTeX
\family default
-TeX to use the dvips driver to rotate those pages that are set as landscape
+ to use the dvips driver to rotate those pages that are set as landscape
foils.
\end_layout
class.
There are several additional environments provided by
\family sans
-Foil
+FoilTeX
\family default
-TeX as well as a couple added by LyX.
+ as well as a couple added by LyX.
The following environments are shared with other classes:
\end_layout
Since foils are essentially self-contained sections, with a title and body,
\family sans
-Foil
+FoilTeX
\family default
-TeX provides specific commands for starting new foils and these are:
+ provides specific commands for starting new foils and these are:
\end_layout
\begin_layout Itemize
Since foils are often used in presenting ideas or new theorems and such
\family sans
-Foil
+FoilTeX
\family default
-TeX also provides a comprehensive box of goodies for presenting them:
+ also provides a comprehensive box of goodies for presenting them:
\end_layout
\begin_layout Standard
\begin_layout Standard
\family sans
-Foil
+FoilTeX
\family default
-TeX provides some powerful header and footer capabilities that are best
- set in the preamble although they may be set at any point in a document.
+ provides some powerful header and footer capabilities that are best set
+ in the preamble although they may be set at any point in a document.
If you want to change these settings in your document the best place to
do so is at the very top of a foil, i.
\begin_inset space \thinspace{}
\begin_layout Standard
There are also a few commands provided by
\family sans
-Foil
+FoilTeX
\family default
-TeX that aren't directly supported by LyX but I'll tell you what they do
- and how to use them in section
+ that aren't directly supported by LyX but I'll tell you what they do and
+ how to use them in section
\begin_inset space ~
\end_inset
\begin_layout Standard
\family sans
-Foil
+FoilTeX
\family default
-TeX redefines the floating tables and figures so that they appear exactly
- where they are in the text rather than pushing them to the top of the page
- or to some user specified location.
+ redefines the floating tables and figures so that they appear exactly where
+ they are in the text rather than pushing them to the top of the page or
+ to some user specified location.
In fact if you change the float placement settings they are simply ignored.
\end_layout
-Typeset by
\family sans
-Foil
+FoilTeX
\family default
-TeX-
+-
\begin_inset Quotes erd
\end_inset
\begin_layout Subsection
Unsupported
\family sans
-Foil
+FoilTeX
\family default
-TeX Goodies
+ Goodies
\begin_inset CommandInset label
LatexCommand label
name "sec:unsuppfoils"
\family sans
File\SpecialChar \menuseparator
Export\SpecialChar \menuseparator
-La
-\family default
-T
-\family sans
-eX
+LaTeX
\family default
)
\begin_inset Foot
\family default
.
This is thought of as a place to define your own types.
- Copy s
+ Copy scrmacros
\family typewriter
-crmacros.inc
+.inc
\family default
in your personal layout directory and edit the file!
\end_layout
goes in the
\family sans
-La
-\family default
-T
-\family sans
-eX
+LaTeX
\begin_inset space ~
\end_inset
\begin_layout Section
Slides [aka
\noun on
-Sli
+SliTeX
\noun default
-TeX]
+]
\begin_inset CommandInset label
LatexCommand label
name "sec:slitex"
There are two document classes that can do this: the default slides class
and the
\family sans
-Foil
+FoilTeX
\family default
-TeX slides class.
+ slides class.
This section documents the former.
\end_layout
\begin_layout Standard
This class is the LaTeX2e improvement of the old
\noun on
-Sli
+SliTeX
\noun default
-TeX package.
+ package.
Every LaTeX2e distribution includes this class [which I'll just refer to
as
\begin_inset Quotes eld
support for time markers, a
\noun on
-Sli
+SliTeX
\noun default
-TeX feature.
+ feature.
So, you'll have to resort to using the LaTeX codes.
\end_layout
\noun on
-Sli
+SliTeX
\noun default
-TeX emulation
+ emulation
\begin_inset Quotes erd
\end_inset
Control
\family default
submenu.
+ LyX was tested against RCS 5.7.
\end_layout
\begin_layout Subsubsection
\begin_layout Standard
CVS command:
\family typewriter
-cvs -q commit -m"<description>" <file-name>
+cvs -q commit -m"<description>" "<file-name>"
\end_layout
\begin_layout Subsubsection
submenu.
Please note that if you use password protected access to repository via
ssh, you will be asked in terminal window.
+ LyX was tested against SVN 1.4 and 1.5.
\end_layout
\begin_layout Subsubsection
\end_layout
\begin_layout Standard
-SVN command:
+SVN command:
+\begin_inset Foot
+status collapsed
+
+\begin_layout Plain Layout
+In case locking is not enabled.
+ See Section
+\begin_inset CommandInset ref
+LatexCommand ref
+reference "subsec:SVN-File-Locking"
+
+\end_inset
+
+.
+\end_layout
+
+\end_inset
+
+
\family typewriter
svn commit -q -m"<description>" <file-name>
\end_layout
\end_layout
\begin_layout Standard
-SVN command:
+SVN command:
+\begin_inset Foot
+status collapsed
+
+\begin_layout Plain Layout
+Ditto.
+\end_layout
+
+\end_inset
+
+
\family typewriter
svn update
\begin_inset Quotes eld
is shown in a browser.
\end_layout
+\begin_layout Subsubsection
+File Locking
+\begin_inset CommandInset label
+LatexCommand label
+name "subsec:SVN-File-Locking"
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+The file exchange through various revision control systems brings the problem
+ of merge conflicts in case two different users try to edit the same (parts
+ of) document.
+ When such conflict happens it needs manual resolving and one reasonable
+ alternative is to provide some kind of locking mechanism, which guarantees
+ that only one user is allowed to edit file at the given time.
+\end_layout
+
+\begin_layout Standard
+SVN has two mechanisms to provide such kind of mutual exclusivity for file
+ access - locks and automatical setting of write permissions (see sec.
+
+\begin_inset CommandInset ref
+LatexCommand ref
+reference "subsec:Automatical-Locking-Property"
+
+\end_inset
+
+) based on
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+svn:needs-lock
+\end_layout
+
+\end_inset
+
+ file svn property
+\begin_inset Foot
+status open
+
+\begin_layout Plain Layout
+http://svnbook.red-bean.com/en/1.2/svn.advanced.locking.html
+\end_layout
+
+\end_inset
+
+.
+ In a case this property is detected for a given document LyX starts to
+ use SVN locks for document editing automatically and the whole check-in/out
+ mechanism switches to the same regimen as for RCS.
+ This in particular means there are two different modes how file is used
+ in LyX:
+\end_layout
+
+\begin_layout Itemize
+Unlocked state.
+ The loaded file is in the read-only mode.
+ For editation on needs to check-out.
+
+\emph on
+Check-out
+\emph default
+ consists of update from repository and gaining write lock.
+ If the lock is not possible to obtain, we remain in unlocked state.
+\end_layout
+
+\begin_layout Itemize
+Locked state.
+ The loaded file is in the 'normal' edit mode.
+ No other user is allowed to edit the file.
+
+\emph on
+Check-in
+\emph default
+ consists of commiting changes and releasing write-lock.
+ If no changes have been made to the document, no commit will be produced
+\begin_inset Foot
+status collapsed
+
+\begin_layout Plain Layout
+Don't be puzzled by the fact that you will be asked for commit message anyway.
+\end_layout
+
+\end_inset
+
+ and only the write-lock will be released.
+\end_layout
+
+\begin_layout Standard
+SVN commands:
+\end_layout
+
+\begin_layout Labeling
+\labelwidthstring 00.00.0000
+Check-in:
+\family typewriter
+ svn commit -q -m"<description>" "<file-name>"
+\begin_inset Newline newline
+\end_inset
+
+svn unlock "<file-name>"
+\end_layout
+
+\begin_layout Labeling
+\labelwidthstring 00.00.0000
+Check-out:
+\family typewriter
+svn update "<file-name>"
+\begin_inset Newline newline
+\end_inset
+
+svn lock "<file-name>"
+\end_layout
+
+\begin_layout Subsubsection
+
+\family typewriter
+\begin_inset CommandInset label
+LatexCommand label
+name "subsec:Automatical-Locking-Property"
+
+\end_inset
+
+
+\family default
+Automatical Locking Property
+\end_layout
+
+\begin_layout Standard
+The above mentioned automatical setting of write permissions of the .lyx
+ file can be set through
+\family sans
+\bar under
+ F
+\bar default
+ile\SpecialChar \menuseparator
+
+\bar under
+V
+\bar default
+ersion
+\begin_inset space ~
+\end_inset
+
+Control\SpecialChar \menuseparator
+
+\bar under
+T
+\bar default
+oggle locking property
+\family default
+.
+ This command is active only when the file is not locked on the svn server
+ (i.e.
+ you need to check-out before proceeding).
+\end_layout
+
+\begin_layout Labeling
+\labelwidthstring 00.00.0000
+SVN
+\begin_inset space ~
+\end_inset
+
+commands:
+\end_layout
+
+\begin_layout Labeling
+\labelwidthstring 00.00.0000
+Set:
+\family typewriter
+ svn propset svn:needs-lock ON "<file-name>"
+\end_layout
+
+\begin_layout Labeling
+\labelwidthstring 00.00.0000
+Unset:
+\family typewriter
+svn propdel svn:needs-lock "<file-name>"
+\end_layout
+
+\begin_layout Subsubsection
+Revision Information in Documents
+\end_layout
+
+\begin_layout Standard
+Currently there is no way how to provide such kind of information directly
+ from LyX.
+ There are possibilities how to activate it with the help of svn features,
+ but each has its own drawbacks.
+\end_layout
+
+\begin_layout Standard
+One possibility is to use svn keywords
+\begin_inset Foot
+status collapsed
+
+\begin_layout Plain Layout
+http://svnbook.red-bean.com/en/1.4/svn.advanced.props.special.keywords.html
+\end_layout
+
+\end_inset
+
+.
+ In short -- you set file keywords property (e.g.
+
+\family sans
+svn propset svn:keywords 'Rev' file.lyx
+\family default
+) and then paste keyword ERT
+\begin_inset Foot
+status collapsed
+
+\begin_layout Plain Layout
+This is an easy way how to ensure that LyX won't break the line in the middle
+ of keyword tag.
+\end_layout
+
+\end_inset
+
+ tag in your document (e.g.
+
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+$Rev$
+\end_layout
+
+\end_inset
+
+).
+ This way svn client will automatically substitute revision number (e.g.
+
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+$Rev: 59 $
+\end_layout
+
+\end_inset
+
+) after each update and commit.
+ There are more problems with this approach.
+ Firstly, the '$' character is used in TeX world for math equations, so
+ any occurence of math formula
+\begin_inset Formula $Rev$
+\end_inset
+
+ become
+\begin_inset Formula $Rev:59$
+\end_inset
+
+ in your LyX document.
+ Similarly for other keywords like Id, Date, Author, etc.
+ Secondly svn output is dependent on your locales, so its very easy that
+ svn would produce some problematic strings once Date is used.
+ Thirdly you get the whole 'Rev: 59' string in your document instead of
+ the plain number.
+ Until subversion implements user's custom keywords it will be hard to use
+ this approach reliably or let LyX to support it directly .
+\end_layout
+
+\begin_layout Standard
+The second possibility would be to write your own external-material template
+ which calls either
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+svnversion
+\end_layout
+
+\end_inset
+
+ utility or parses the output of
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+svn info file.lyx
+\end_layout
+
+\end_inset
+
+ command and returns the result back, when typeseting the document.
+\end_layout
+
\begin_layout Subsection
SVN and Windows Environment
\end_layout
status collapsed
\begin_layout Plain Layout
-vc-command DS "." "TortoiseProc /command:commit /path:$$p"
+vc-command DR "." "TortoiseProc /command:commit /path:$$p"
\end_layout
\end_inset