#LyX 2.0.0svn created this file. For more info see http://www.lyx.org/
-\lyxformat 352
+\lyxformat 362
\begin_document
\begin_header
\textclass scrbook
\graphics default
\default_output_format default
+\bibtex_command default
+\index_command default
\paperfontsize 12
\spacing single
\use_hyperref true
\use_bibtopic false
\use_indices false
\paperorientation portrait
-\backgroundcolor #ffffff
\secnumdepth 3
\tocdepth 3
\paragraph_separation indent
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.
\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
argument
\end_layout
-\begin_layout Description
-clientname is a name that the client can choose arbitrarily.
- Its only use is that LyX will echo it if it sends an answer—so a client
- can dispatch results from different requesters.
+\begin_layout Description
+clientname is a name that the client can choose arbitrarily.
+ Its only use is that LyX will echo it if it sends an answer—so a client
+ can dispatch results from different requesters.
+\end_layout
+
+\begin_layout Description
+function is the function you want LyX to perform.
+ It is the same as the commands you'd use in the minibuffer.
+\end_layout
+
+\begin_layout Description
+argument is an optional argument which is meaningful only to some functions
+ (for instance, the
+\begin_inset Quotes eld
+\end_inset
+
+self-insert
+\begin_inset Quotes erd
+\end_inset
+
+ LFUN will insert the argument as text at the cursor position).
+\end_layout
+
+\begin_layout Standard
+The answer from LyX will arrive in the output pipe and be of the form
+\end_layout
+
+\begin_layout Quote
+INFO:
+\emph on
+clientname
+\emph default
+:
+\emph on
+function
+\emph default
+:
+\emph on
+data
+\end_layout
+
+\begin_layout Standard
+where
+\emph on
+clientname
+\emph default
+ and
+\emph on
+function
+\emph default
+ are just echoed from the command request, while
+\emph on
+data
+\emph default
+ is more or less useful information filled according to how the command
+ execution worked out.
+ Some commands, such as
+\begin_inset Quotes eld
+\end_inset
+
+font-state
+\begin_inset Quotes erd
+\end_inset
+
+, will return information about the internal state of LyX, while other will
+ return an empty data-response.
+ This means that the command execution went fine.
+\end_layout
+
+\begin_layout Standard
+In case of errors, the response from LyX will have this form
+\end_layout
+
+\begin_layout Quote
+ERROR:
+\emph on
+clientname
+\emph default
+:
+\emph on
+function
+\emph default
+:
+\emph on
+error message
+\end_layout
+
+\begin_layout Standard
+where the
+\emph on
+error message
+\emph default
+ should contain an explanation of why the command failed.
+\end_layout
+
+\begin_layout Standard
+Examples:
+\end_layout
+
+\begin_layout LyX-Code
+echo "LYXCMD:test:beginning-of-buffer:" >~/.lyxpipe.in
+\begin_inset Newline newline
+\end_inset
+
+echo "LYXCMD:test:get-xy:" >~/.lyxpipe.in
+\begin_inset Newline newline
+\end_inset
+
+read a <~/.lyxpipe.out
+\begin_inset Newline newline
+\end_inset
+
+echo $a
+\end_layout
+
+\begin_layout Section
+Notification
+\end_layout
+
+\begin_layout Standard
+LyX can notify clients of events going on asynchronously.
+ Currently it will only do this if the user binds a key sequence with the
+ function
+\begin_inset Quotes eld
+\end_inset
+
+notify
+\begin_inset Quotes erd
+\end_inset
+
+.
+ The format of the string LyX sends is as follows:
+\end_layout
+
+\begin_layout Quote
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+NOTIFY:
+\end_layout
+
+\end_inset
+
+
+\emph on
+key-sequence
+\end_layout
+
+\begin_layout Standard
+where
+\emph on
+key-sequence
+\emph default
+ is the printed representation of the key sequence that was actually typed
+ by the user.
+\end_layout
+
+\begin_layout Standard
+This mechanism can be used to extend LyX's command set and implement macros.
+ Bind some key sequence to
+\begin_inset Quotes eld
+\end_inset
+
+notify
+\begin_inset Quotes erd
+\end_inset
+
+.
+ Then start a client that listens on the output pipe, dispatches the command
+ according to the sequence, and starts a function that may use LyX calls
+ and LyX requests to issue a command or a series of commands to LyX.
+\end_layout
+
+\begin_layout Section
+The simple LyX Server Protocol
+\end_layout
+
+\begin_layout Standard
+LyX implements a simple protocol that can be used for session management.
+ All messages are of the form
+\end_layout
+
+\begin_layout Quote
+LYXSRV:
+\emph on
+clientname
+\emph default
+:
+\emph on
+protocol message
+\end_layout
+
+\begin_layout Standard
+where
+\emph on
+protocol message
+\emph default
+ can be
+\begin_inset Quotes eld
+\end_inset
+
+hello
+\begin_inset Quotes erd
+\end_inset
+
+ or
+\begin_inset Quotes eld
+\end_inset
+
+bye
+\begin_inset Quotes erd
+\end_inset
+
+.
+ If
+\begin_inset Quotes eld
+\end_inset
+
+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
-\begin_layout Description
-function is the function you want LyX to perform.
- It is the same as the commands you'd use in the minibuffer.
+\end_inset
+
+ wrapper, which is as follows:
\end_layout
-\begin_layout Description
-argument is an optional argument which is meaningful only to some functions
- (for instance, the
-\begin_inset Quotes eld
+\begin_layout LyX-Code
+@echo off
+\begin_inset Newline newline
\end_inset
-self-insert
-\begin_inset Quotes erd
+if "%1" == "-g" goto lyxclient
+\begin_inset Newline newline
\end_inset
- LFUN will insert the argument as text at the cursor position).
+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
-The answer from LyX will arrive in the output pipe and be of the form
-\end_layout
+You have to make sure that both
+\begin_inset Flex CharStyle:Code
+status collapsed
-\begin_layout Quote
-INFO:
-\emph on
-clientname
-\emph default
-:
-\emph on
-function
-\emph default
-:
-\emph on
-data
+\begin_layout Plain Layout
+lyxeditor.sh
\end_layout
-\begin_layout Standard
-where
-\emph on
-clientname
-\emph default
- and
-\emph on
-function
-\emph default
- are just echoed from the command request, while
-\emph on
-data
-\emph default
- is more or less useful information filled according to how the command
- execution worked out.
- Some commands, such as
-\begin_inset Quotes eld
\end_inset
-font-state
-\begin_inset Quotes erd
+ and
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+lyxclient.exe
+\end_layout
+
\end_inset
-, will return information about the internal state of LyX, while other will
- return an empty data-response.
- This means that the command execution went fine.
+ 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 case of errors, the response from LyX will have this form
+In yap, reverse search is triggered by double-click.
\end_layout
-\begin_layout Quote
-ERROR:
-\emph on
-clientname
-\emph default
-:
-\emph on
-function
-\emph default
-:
-\emph on
-error message
+\begin_layout Subsubsection*
+SumatraPDF (Cygwin)
\end_layout
\begin_layout Standard
-where the
-\emph on
-error message
-\emph default
- should contain an explanation of why the command failed.
-\end_layout
+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 Standard
-Examples:
+\begin_layout Plain Layout
+SumatraPDF -inverse-search "lyxeditor.bat -g %f %l"
\end_layout
-\begin_layout LyX-Code
-echo "LYXCMD:test:beginning-of-buffer:" >~/.lyxpipe.in
+\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
-\begin_layout LyX-Code
-echo "LYXCMD:test:get-xy:" >~/.lyxpipe.in
-\begin_inset Newline newline
\end_inset
-read a <~/.lyxpipe.out
-\begin_inset Newline newline
-\end_inset
+ option will not be needed from now on
+\begin_inset Foot
+status collapsed
-echo $a
-\end_layout
+\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 Section
-Notification
+\begin_layout Plain Layout
+/usr/local/bin
\end_layout
-\begin_layout Standard
-LyX can notify clients of events going on asynchronously.
- Currently it will only do this if the user binds a key sequence with the
- function
-\begin_inset Quotes eld
-\end_inset
-
-notify
-\begin_inset Quotes erd
\end_inset
.
- The format of the string LyX sends is as follows:
\end_layout
-\begin_layout Quote
+\end_inset
+
+ (in this way you will be using the lyxsocket; omit the
\begin_inset Flex CharStyle:Code
status collapsed
\begin_layout Plain Layout
-NOTIFY:
+-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
-\emph on
-key-sequence
+\begin_layout Plain Layout
+lyxeditor.sh
\end_layout
-\begin_layout Standard
-where
-\emph on
-key-sequence
-\emph default
- is the printed representation of the key sequence that was actually typed
- by the user.
+\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
-\begin_layout Standard
-This mechanism can be used to extend LyX's command set and implement macros.
- Bind some key sequence to
-\begin_inset Quotes eld
\end_inset
-notify
-\begin_inset Quotes erd
-\end_inset
+ in the viewer setting in
+\begin_inset Flex CharStyle:MenuItem
+status collapsed
-.
- Then start a client that listens on the output pipe, dispatches the command
- according to the sequence, and starts a function that may use LyX calls
- and LyX requests to issue a command or a series of commands to LyX.
+\begin_layout Plain Layout
+Preferences\SpecialChar \menuseparator
+File Handling\SpecialChar \menuseparator
+File formats\SpecialChar \menuseparator
+PDF (pdflatex)
\end_layout
-\begin_layout Section
-The simple LyX Server Protocol
-\end_layout
+\end_inset
-\begin_layout Standard
-LyX implements a simple protocol that can be used for session management.
- All messages are of the form
-\end_layout
+, where
+\begin_inset Flex CharStyle:Code
+status collapsed
-\begin_layout Quote
-LYXSRV:
-\emph on
-clientname
-\emph default
-:
-\emph on
-protocol message
+\begin_layout Plain Layout
+SumatraPDF.sh
\end_layout
-\begin_layout Standard
-where
-\emph on
-protocol message
-\emph default
- can be
-\begin_inset Quotes eld
\end_inset
-hello
-\begin_inset Quotes erd
-\end_inset
+ is the following script (to be placed in your command PATH,
+\begin_inset Flex CharStyle:Code
+status collapsed
- or
-\begin_inset Quotes eld
-\end_inset
+\begin_layout Plain Layout
+/usr/local/bin
+\end_layout
-bye
-\begin_inset Quotes erd
\end_inset
-.
- If
-\begin_inset Quotes eld
-\end_inset
+ being the best choice):
+\end_layout
-hello
-\begin_inset Quotes erd
+\begin_layout LyX-Code
+#!/bin/bash
+\begin_inset Newline newline
\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
+cd $(dirname $1)
+\begin_inset Newline newline
\end_inset
-bye
-\begin_inset Quotes erd
-\end_inset
+SumatraPDF.exe $(basename $1)
+\end_layout
- sent from LyX will inform clients that LyX is closing.
+\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