]> git.lyx.org Git - lyx.git/blobdiff - lib/doc/Additional.lyx
Documentation for customization of citation formats.
[lyx.git] / lib / doc / Additional.lyx
index 324ff77b2842f0e71941bf5563134cd888b6ce7c..10f0e1de8a447149672393fdc8f992fef7f84620 100644 (file)
@@ -1,5 +1,5 @@
 #LyX 2.0.0svn created this file. For more info see http://www.lyx.org/
-\lyxformat 370
+\lyxformat 378
 \begin_document
 \begin_header
 \textclass scrbook
@@ -51,6 +51,7 @@ logicalmkup
 theorems-ams
 theorems-ams-extended
 \end_modules
+\maintain_unincluded_children false
 \begin_local_layout
 Format 7
 InsetLayout CharStyle:MenuItem
@@ -68,6 +69,7 @@ End
 \end_local_layout
 \language english
 \inputencoding latin1
+\fontencoding global
 \font_roman default
 \font_sans default
 \font_typewriter default
@@ -103,6 +105,7 @@ End
 \use_geometry false
 \use_amsmath 0
 \use_esint 0
+\use_mhchem 1
 \cite_engine basic
 \use_bibtopic false
 \use_indices false
@@ -122,6 +125,8 @@ End
 \paperpagestyle headings
 \tracking_changes false
 \output_changes false
+\html_use_mathml true
+\html_be_strict true
 \end_header
 
 \begin_body
@@ -187,20 +192,29 @@ User's Guide
 \emph default
  is already quite lengthy, and it contains information on all of the basic
  features one needs to know in order to prepare most documents.
- However, the LyX Team has worked to LyX extensible through various configuratio
-n files and external packages.
+ However, the LyX Team has worked to make LyX extensible through various
+ configuration files and external packages.
  That means that if you want to support the Fizzwizzle LaTeX package, you
  can create a layout file (or module) for it without having to alter LyX
  itself.
- We've already had contributions of several new features this way.
- This is the place where all of those get documented.
+ We've already had contributions of several new features this way, and some
+ of them are documented here.
+ There are also some more `advanced' features, such as how to control the
+ presentation of bibliographies and how to work with multi-part documents,
+ that are not covered in the 
+\emph on
+User's Guide
+\emph default
+ and are discussed here.
 \end_layout
 
 \begin_layout Standard
 This manual also documents some special features, like fax support, version
  control, and SGML support, which require additional software to work properly.
- Lastly, there's a chapter of LaTeX tools and tips, things you can use to
- spruce up your documents by directly using the powerful features of LaTeX.
+ There is also a chapter on LyX's support for HTML.
+ And lastly, there's a chapter of LaTeX tools and tips, things you can use
+ to spruce up your documents by directly using the powerful features of
+ LaTeX.
  After all, LyX 
 \emph on
 is
@@ -228,7 +242,7 @@ User's Guide
 \end_layout
 
 \begin_layout Standard
-Since all the topics in this manual depend heavily on LyX's interaction
+Since many of the topics in this manual depend heavily on LyX's interaction
  with LaTeX, this first chapter covers the inner workings of LyX and how
  to direct LyX to generate exactly the LaTeX code you want.
  It is obviously for more seasoned LyX users.
@@ -2094,7 +2108,8 @@ Customizing Bibliographies with BibTeX
 \end_layout
 
 \begin_layout Standard
-The basics how to use BibTeX are explained in section 
+The most basic information about how to use BibTeX with LyX is contained
+ in the section 
 \emph on
 Bibliography databases (BibTeX)
 \emph default
@@ -4113,1139 +4128,1189 @@ savelabelitemi}
 \end_layout
 
 \begin_layout Chapter
-The LyX Server
+LyX and the World Wide Web
 \end_layout
 
-\begin_layout Section
-Introduction
+\begin_layout Standard
+LyX has long supported the export of documents to various web-friendly formats,
+ such as HTML.
+ Before verson 1.7, however, HTML export was always accomplished by the use
+ of external converters.
+\begin_inset Foot
+status collapsed
+
+\begin_layout Plain Layout
+For details on the use of external converters with LyX, see the 
+\size normal
+\emph on
+Converters
+\emph default
+ section of the Customization manual.
 \end_layout
 
-\begin_layout Standard
-The `LyX server' allows other programs to talk to LyX, invoke LyX commands,
- and retrieve information about the LyX internal state.
- This is only intended for advanced users, but they should find it useful.
- It is by writing to the LyX server, for example, that bibliography managers,
- such as JabRef, are able to 
-\begin_inset Quotes eld
 \end_inset
 
-push
-\begin_inset Quotes erd
-\end_inset
+ These fall into two large groups: there are converters that use LaTeX as
+ an intermediate format, such as 
+\begin_inset Flex CharStyle:Code
+status collapsed
 
- citations to LyX.
+\begin_layout Plain Layout
+htlatex
 \end_layout
 
-\begin_layout Standard
-Please note that, at present, 
-\emph on
-the server does not work natively on Windows
-\emph default
+\end_inset
 
-\begin_inset Foot
+, 
+\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.
+html2latex
 \end_layout
 
 \end_inset
 
- but it does work with Cygwin versions of LyX.
-\end_layout
+, and 
+\begin_inset Flex CharStyle:Code
+status collapsed
 
-\begin_layout Section
-Starting the LyX Server
+\begin_layout Plain Layout
+plastex
 \end_layout
 
-\begin_layout Standard
-The LyX server works through the use of a pair of named pipes.
- These are usually located in 
+\end_inset
+
+, relying upon LyX to produce the LaTeX; and there is a converter that works
+ directly on LyX files, 
 \begin_inset Flex CharStyle:Code
 status collapsed
 
 \begin_layout Plain Layout
-UserDir
+eLyXer
 \end_layout
 
 \end_inset
 
- and have the names 
-\begin_inset Quotes eld
-\end_inset
-
+.
+ All of these have different advantages and disadvantages.
+\end_layout
 
+\begin_layout Standard
+The LaTeX-based converters have the advantage that, in principle, they know
+ everything about the exported document that LaTeX does.
+ Such converters do not care, for example, if a certain block of code was
+ produced by LyX or was Evil Red Text.
+ They know about 
 \begin_inset Flex CharStyle:Code
 status collapsed
 
 \begin_layout Plain Layout
-lyxpipe.in
+aux
 \end_layout
 
 \end_inset
 
+ files, counters, and references, and can often make use of the 
+\begin_inset Flex CharStyle:Code
+status collapsed
 
-\begin_inset Quotes erd
-\end_inset
+\begin_layout Plain Layout
+bbl
+\end_layout
 
- and 
-\begin_inset Quotes eld
 \end_inset
 
-
+ files generated by BibTeX.
+ On the other hand, LaTeX is a very hard language to parse---it is sometimes
+ said that only TeX itself understands TeX---and LaTeX-based converters
+ will often choke on what seem to be quite simple constructs; complex ones
+ can throw them completely, and as of this writing, for example, the 
+\emph on
+Embedded Objects
+\emph default
+ manual will not export with 
 \begin_inset Flex CharStyle:Code
 status collapsed
 
 \begin_layout Plain Layout
-lyxpipe.out
+htlatex
 \end_layout
 
 \end_inset
 
+, though the others will.
+ The other issue concerns how math is handled.
+ These converters typically convert the formulae into little pictures that
+ are then linked from the HTML document.
+ Since these are actually generated by LaTeX, they are accurate.
+ But they do not scale well, and just getting them to look as if they are
+ actually meant to be in your document---so that the font sizes seem to
+ be roughly the same---can be a challenge.
+\end_layout
+
+\begin_layout Standard
+Alex Fernandez's 
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+eLyXer
+\end_layout
 
-\begin_inset Quotes erd
 \end_inset
 
-.
- External programs write into 
+ solves some of these problems.
+ In particular, its rendering of math tends to look better than 
 \begin_inset Flex CharStyle:Code
 status collapsed
 
 \begin_layout Plain Layout
-.lyxpipe.in
+htlatex
 \end_layout
 
 \end_inset
 
- and read back data from 
+'s, at least in simpler cases, since it renders math using a neat combination
+ of HTML and CSS rather than converting the formulae to images.
+ But more complex formula tend to be rendered less well than with 
 \begin_inset Flex CharStyle:Code
 status collapsed
 
 \begin_layout Plain Layout
-.lyxpipe.out
+htlatex
 \end_layout
 
 \end_inset
 
-.
- The stem of the pipe names can be defined in the 
-\begin_inset Flex CharStyle:MenuItem
+, since there is no reasonable way of scaling parentheses in HTML, for example.
+ More importantly (as of version 0.39, at least), 
+\begin_inset Flex CharStyle:Code
 status collapsed
 
 \begin_layout Plain Layout
-Tools\SpecialChar \menuseparator
-Preferences
+eLyXer
 \end_layout
 
 \end_inset
 
- dialog, for example 
+ has no support for math macros, for user-defined paragraph or character
+ styles, or for tables of contents and figures.
+ These limitations make 
 \begin_inset Flex CharStyle:Code
 status collapsed
 
 \begin_layout Plain Layout
-"/home/myhome/lyxpipe"
+eLyXer
 \end_layout
 
 \end_inset
 
-.
- You 
-\emph on
-must
-\emph default
- configure this manually in order for the server to start.
+ unsuitable for many of the documents more advanced LyX users would produce.
+ In principle, of course, all of these problems could be solved, but the
+ LyX developers have decided to follow a different path and made LyX itself
+ capable of writing XHTML, just as it is capable of writing LaTeX, DocBook,
+ and plaintext.
 \end_layout
 
 \begin_layout Standard
-LyX will add the '
+As of this writing, XHTML output remains under development and should probably
+ be regarded as 
+\begin_inset Quotes eld
+\end_inset
+
+experimental
+\begin_inset Quotes erd
+\end_inset
+
+.
+\begin_inset Foot
+status collapsed
+
+\begin_layout Plain Layout
+The file 
 \begin_inset Flex CharStyle:Code
 status collapsed
 
 \begin_layout Plain Layout
-.in
+development/HTML.notes
 \end_layout
 
 \end_inset
 
-' and '
-\begin_inset Flex CharStyle:Code
+, which can be found in the LyX source tree or 
+\begin_inset CommandInset href
+LatexCommand href
+name "accessed online"
+target "http://www.lyx.org/trac/browser/lyx-devel/trunk/development/HTML/HTML.notes"
+
+\end_inset
+
+, usually contains up-to-date information about the state of XHTML output.
+\end_layout
+
+\end_inset
+
+ Still, the developers have chosen this approach because it has several
+ potential advantages over the other two.
+\end_layout
+
+\begin_layout Standard
+These advantages are primarily due to the fact that the XHTML output routines,
+ since they are part of LyX, know everything LyX knows about the document
+ being exported.
+\begin_inset Foot
 status collapsed
 
 \begin_layout Plain Layout
-.out
+Another advantege is that, since these routines are internal to LyX, they
+ are immune to changes in LyX's file format, or to changes in the semantics
+ of existing insets.
 \end_layout
 
 \end_inset
 
-' 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 
+ So they know about the table of contents (as displayed in the Outline),
+ about the counters associated with different paragraph styles, and about
+ user-defined styles.
+ The XHTML output routines know what LyX knows about internationalization,
+ too, so they will output 
 \begin_inset Quotes eld
 \end_inset
 
-stale
+Chapter 1
 \begin_inset Quotes erd
 \end_inset
 
- 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
+ or 
+\begin_inset Quotes eld
+\end_inset
 
-\begin_layout Standard
-To have several LyX processes with servers at the same time, you have to
- use different configurations, perhaps by using separate user directories,
- each with its own 
-\begin_inset Flex CharStyle:Code
-status collapsed
 
-\begin_layout Plain Layout
-preferences
+\lang ngerman
+Kapitel
+\lang english
+ 1
+\begin_inset Quotes erd
+\end_inset
+
+, depending upon the language in effect at the time.
 \end_layout
 
-\end_inset
+\begin_layout Standard
+Quite generally, the output routines know everything LyX knows about document
+ layout, that is, about the document is to be rendered on screen.
+ We can use this information when we output the document as XHTML.
+ In particular, LyX 
+\emph on
+automatically
+\emph default
+ generates CSS style information corresponding to the layout information
+ it uses to render the document on screen: if section headings are supposed
+ to be sans-serif and bold as seen in LyX, then (by default) they will be
+ sans-serif and bold when viewed in a web browser, too.
+ And this is true not just for pre-defined styles, like Section, but for
+ any style, including user-defined styles.
+  Indeed, the XHTML output routines make no distinction between user-defined
+ paragraph and character styles and LyX's own pre-defined styles: in each
+ case, everything LyX knows about the styles is contained in the layout
+ files.
+ And much the same is true as regards pre-defined textual insets, such as
+ footnotes, and custom versions.
+\end_layout
 
- file, for each process.
+\begin_layout Standard
+The result is that XHTML output can be customized and extended in 
+\emph on
+exactly
+\emph default
+ the same way LaTeX output can be customized and extended: through layout
+ files and modules.
+ See chapter five of the 
+\emph on
+Customization 
+\emph default
+manual for the details.
 \end_layout
 
 \begin_layout Standard
-If you are developing a client program, you might find it useful to enable
- debugging information from the LyX server.
- Do this by starting LyX as 
+As for math, LyX renders math using MathML.
+ This has advantages and disadvantages.
+ The advantage is that MathML is a dialect of XML designed specifically
+ for mathematics on the web, and it typically renders very well in browsers
+ that support it.
+ The first disadvantage is that not all browsers support MathML, and support
+ is not complete even in the Gecko-based browsers, such as Firefox.
+ A second disadvantage, as compared to rendering math by images, is that
+ LyX can only output MathML for LaTeX constructs that it knows about, which
+ means that the use of ERT in math---e.g., the command 
 \begin_inset Flex CharStyle:Code
 status collapsed
 
 \begin_layout Plain Layout
-lyx -dbg lyxserver
+
+\backslash
+BGassert
 \end_layout
 
 \end_inset
 
-.
-\end_layout
-
-\begin_layout Standard
-You can find a complete example client written in C in the source distribution
- as 
+ from the 
 \begin_inset Flex CharStyle:Code
 status collapsed
 
 \begin_layout Plain Layout
-development/lyxserver/server_monitor.c
+begriff.sty
 \end_layout
 
 \end_inset
 
-.
+ package---will produce nothing helpful.
+ Eventually, therefore, LyX will offer the user the option to use MathML
+ or images, and it will offer this choice on a case by case basis.
 \end_layout
 
 \begin_layout Standard
-Another useful tool is command-line based client you will find in 
-\begin_inset Flex CharStyle:Code
-status collapsed
+The remainder of this chapter contains more detailed information on XHTML
+ output, its limitations, and ways around those limitations.
+\end_layout
+
+\begin_layout Standard
+\begin_inset Note Note
+status open
 
 \begin_layout Plain Layout
-src/client/lyxclient
+This is very incomplete at this point!
 \end_layout
 
 \end_inset
 
-.
+
 \end_layout
 
 \begin_layout Section
-Normal communication
+Bibliography and Citations
 \end_layout
 
 \begin_layout Standard
-To issue a LyX call, the client writes a line of ASCII text into the input
- pipe.
- This line has the following format:
+XHTML output fully supports bibliographies and citations.
 \end_layout
 
-\begin_layout Quote
-LYXCMD:
-\emph on
-clientname
-\emph default
-:
-\emph on
-function
-\emph default
-:
-\emph on
-argument
+\begin_layout Standard
+Citation labels are generated by exactly the same machinery that generates
+ LyX's on-screen labels, so the labels will look in the output much as they
+ do in LyX, though better.
+ If you are using numerical citations, then LyX will output numerical labels,
+ such as [1] or [17], rather than simply showing the citation key in square
+ brackets, as it does on-screen.
+ If you are using author-year citations, then LyX will add lowercase letters
+ to the years, just as BibTeX does, if it finds more than one citation for
+ a given author-year combination.
+ The labels will be printed with the bibliography entries.
+ Note that there is, at present, no way to customize the appearance of the
+ labels, for example, to choose between square brackets and parentheses.
 \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 Standard
+Bibliography output is handled by the same machinery that handles the presentati
+on of reference information in the citation dialog, so you will see in the
+ XHTML output pretty much what you would see if you were to look at a given
+ entry in the citation dialog.
+ Unfortunately, the formatting of bibliography entries, too, is at present
+ not customizable, and it is fairly primitive, though this should change
+ shortly.
 \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.
+\begin_layout Standard
+The other significant defect is that cross-referenced information is printed
+ with every entry with which it is associated.
+ So you can see things like this:
 \end_layout
 
-\begin_layout Description
-argument is an optional argument which is meaningful only to some functions
- (for instance, the 
+\begin_layout Quote
+Jason Stanley, 
 \begin_inset Quotes eld
 \end_inset
 
-self-insert
+Context and Logical Form
 \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
+, in 
+\emph on
+Language in Context: Selected Essays
+\emph default
+ (Oxford: Oxford University Press, 2007), pp.
+ 30--68.
 \end_layout
 
 \begin_layout Quote
-INFO:
-\emph on
-clientname
-\emph default
-:
+Jason Stanley, 
+\begin_inset Quotes eld
+\end_inset
+
+Semantics in Context
+\begin_inset Quotes erd
+\end_inset
+
+, in 
 \emph on
-function
+Language in Context: Selected Essays
 \emph default
-:
-\emph on
-data
+ (Oxford: Oxford University Press, 2007), pp.
+ 201--30.
 \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.
+Again, this should be fixed before long.
 \end_layout
 
 \begin_layout Standard
-In case of errors, the response from LyX will have this form
+There is no support at present for sectioned bibliographies.
+ If you have multiple bibliographies, then LyX will print the same bibliography
+ over and over.
 \end_layout
 
-\begin_layout Quote
-ERROR:
-\emph on
-clientname
-\emph default
-:
-\emph on
-function
-\emph default
-:
-\emph on
-error message
+\begin_layout Section
+Indexes
 \end_layout
 
 \begin_layout Standard
-where the 
-\emph on
-error message
-\emph default
- should contain an explanation of why the command failed.
+LyX will happily export indexes as XHTML, but with certain limitations at
+ the moment.
 \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
+Index export will be most reliable when you do not attempt to use the fancy
+ constructs that are described in the section on indexes in the 
+\emph on
+User's Guide
+\emph default
+.
+\begin_inset Foot
+status collapsed
 
-echo "LYXCMD:test:get-xy:" >~/.lyxpipe.in
-\begin_inset Newline newline
-\end_inset
+\begin_layout Plain Layout
+The main issue here is that LyX itself does not really handle these.
+ It just lets you enter what you would have to enter in raw LaTeX.
+\end_layout
 
-read a <~/.lyxpipe.out
-\begin_inset Newline newline
 \end_inset
 
-echo $a
-\end_layout
-
-\begin_layout Section
-Notification
+ We'll describe how they are handled using the subsection headings from
+ that section.
 \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_layout Itemize
+Grouping Index Entries (aka, sub-entries): LyX makes an effort to support
+ these, but the entries must be separated by 
 \begin_inset Quotes eld
 \end_inset
 
-notify
+ ! 
 \begin_inset Quotes erd
 \end_inset
 
-.
- The format of the string LyX sends is as follows:
+, that is, there must be spaces around the exclamation point.
+ This is because it is otherwise too difficult to check for escaped exclamation
+ points, ones in math, and so forth.
 \end_layout
 
-\begin_layout Quote
-\begin_inset Flex CharStyle:Code
-status collapsed
-
-\begin_layout Plain Layout
-NOTIFY:
+\begin_layout Itemize
+Page Ranges: There is no support at all for page ranges, since these make
+ no sense with XHMTL.
+ Instead, you will just get two index entries, one at either end.
 \end_layout
 
+\begin_layout Itemize
+Cross-referencing: There is no support for cross-referencing.
+ If LyX finds an entry containing the 
+\begin_inset Quotes eld
 \end_inset
 
+|see\SpecialChar \ldots{}
 
-\emph on
-key-sequence
+\begin_inset Quotes erd
+\end_inset
+
+ construct, it is just dropped, and the rest is treated as an ordinary index
+ entry.
 \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.
+\begin_layout Itemize
+Index Entry Order: LyX does support attempts to fix the sorting order.
+ It will take what is before the first `@' it finds and use that for sorting,
+ taking what follows the first `@' to be the actual entry.
+ At present, LyX does not check for escaped `@', so do not try to index
+ email addresses.
 \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_layout Itemize
+Index Entry Layout: You can format entries by using the text style dialog,
+ or by using any other method available within LyX itself.
+ There is no support for constructs like: 
 \begin_inset Quotes eld
 \end_inset
 
-notify
+entry|textbf
 \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.
+ Indeed, if LyX finds a pipe symbol, `|', in an entry, it will delete it
+ and everything that follows it.
+\end_layout
+
+\begin_layout Itemize
+Multiple Indexes: There is no support for multiple indexes.
+ Rather, all index entries will be printed as one large index.
+ To avoid our printing several versions of the index, we print only the
+ main index, so make sure you have one.
 \end_layout
 
 \begin_layout Section
-The simple LyX Server Protocol
+Nomenclature and Glossary
 \end_layout
 
 \begin_layout Standard
-LyX implements a simple protocol that can be used for session management.
- All messages are of the form
+There is at present no support for glossaries.
 \end_layout
 
-\begin_layout Quote
-LYXSRV:
-\emph on
-clientname
-\emph default
-:
-\emph on
-protocol message
+\begin_layout Chapter
+The LyX Server
 \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
+\begin_layout Section
+Introduction
+\end_layout
 
- is received from a client, LyX will report back to inform the client that
- it's listening to it's messages, while 
+\begin_layout Standard
+The `LyX server' allows other programs to talk to LyX, invoke LyX commands,
+ and retrieve information about the LyX internal state.
+ This is only intended for advanced users, but they should find it useful.
+ It is by writing to the LyX server, for example, that bibliography managers,
+ such as JabRef, are able to 
 \begin_inset Quotes eld
 \end_inset
 
-bye
+push
 \begin_inset Quotes erd
 \end_inset
 
sent from LyX will inform clients that LyX is closing.
citations to LyX.
 \end_layout
 
 \begin_layout Section
-Reverse DVI/PDF search
+Starting the LyX Server
 \end_layout
 
 \begin_layout Standard
-Some DVI/PDF viewers
-\begin_inset Foot
+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
-The following viewers offer the reverse PDF search feature: Okular on KDE/Linux,
- Skim on Mac OSX and SumatraPDF on Windows.
+UserDir
 \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 (
+, (except on Windows, where 
 \emph on
-lyxsocket
+local
 \emph default
-) that LyX creates in its temporary directory (this is the way the 
+ named pipes are special objects located in 
 \begin_inset Flex CharStyle:Code
 status collapsed
 
 \begin_layout Plain Layout
-lyxclient
+
+\backslash
+
+\backslash
+.
+\backslash
+pipe
 \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
+) and have the names 
+\begin_inset Quotes eld
+\end_inset
 
-\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
+lyxpipe.in
 \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_inset Quotes erd
+\end_inset
 
-\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
+ and 
+\begin_inset Quotes eld
+\end_inset
 
-\begin_layout Plain Layout
-LaT
-\begin_inset ERT
+
+\begin_inset Flex CharStyle:Code
 status collapsed
 
 \begin_layout Plain Layout
-
-{}
+lyxpipe.out
 \end_layout
 
 \end_inset
 
-eX (plain)->DVI
-\end_layout
 
+\begin_inset Quotes erd
 \end_inset
 
- or 
-\begin_inset Flex CharStyle:MenuItem
+.
+ External programs write into 
+\begin_inset Flex CharStyle:Code
 status collapsed
 
 \begin_layout Plain Layout
-LaT
-\begin_inset ERT
-status collapsed
-
-\begin_layout Plain Layout
-
-{}
-\end_layout
+lyxpipe.in
+\end_layout
 
 \end_inset
 
-eX (plain)->DraftDVI
+ and read back data from 
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+lyxpipe.out
 \end_layout
 
 \end_inset
 
- converter in 
+.
+ The stem of the pipe names can be defined in the 
 \begin_inset Flex CharStyle:MenuItem
 status collapsed
 
 \begin_layout Plain Layout
-Preferences\SpecialChar \menuseparator
-File Handling\SpecialChar \menuseparator
-Converters
+Tools\SpecialChar \menuseparator
+Preferences
 \end_layout
 
 \end_inset
 
- to 
+ dialog, for example 
 \begin_inset Flex CharStyle:Code
 status collapsed
 
 \begin_layout Plain Layout
-latex -src-specials $$i
+"/home/myhome/lyxpipe"
 \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
+, or 
 \begin_inset Flex CharStyle:Code
 status collapsed
 
 \begin_layout Plain Layout
+"
+\backslash
 
 \backslash
-usepackage{pdfsync}
+.
+\backslash
+pipe
+\backslash
+lyxpipe"
 \end_layout
 
 \end_inset
 
- for reverse PDF search,
+ on Windows.
+ You 
+\emph on
+must
+\emph default
+ configure this manually in order for the server to start.
 \end_layout
 
-\begin_layout Itemize
+\begin_layout Standard
+LyX will add the '
 \begin_inset Flex CharStyle:Code
 status collapsed
 
 \begin_layout Plain Layout
-
-\backslash
-usepackage[active]{srcltx}
+.in
 \end_layout
 
 \end_inset
 
- for reverse DVI search.
-\end_layout
+' and '
+\begin_inset Flex CharStyle:Code
+status collapsed
 
-\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
+\begin_layout Plain Layout
+.out
 \end_layout
 
-\begin_layout LyX-Code
-
-\backslash
-usepackage{ifpdf}
-\begin_inset Newline newline
 \end_inset
 
-
-\backslash
-ifpdf
-\begin_inset Newline newline
+' 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.
+ On POSIX (Unix like) systems, if for some other reason, an unused 
+\begin_inset Quotes eld
 \end_inset
 
-  
-\backslash
-usepackage{pdfsync}
-\begin_inset Newline newline
+stale
+\begin_inset Quotes erd
 \end_inset
 
-
-\backslash
-else
-\begin_inset Newline newline
+ 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.
+ On Windows, pipes are deleted by the OS on program termination or crash,
+ so 
+\begin_inset Quotes eld
 \end_inset
 
-  
-\backslash
-usepackage[active]{srcltx}
-\begin_inset Newline newline
+stale
+\begin_inset Quotes erd
 \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) 
+ pipes should not be possible.
 \end_layout
 
 \begin_layout Standard
-Recent versions of 
+To have several LyX processes with servers at the same time, you have to
+ use different configurations, perhaps by using separate user directories,
+ each with its own 
 \begin_inset Flex CharStyle:Code
 status collapsed
 
 \begin_layout Plain Layout
-(pdf)latex
+preferences
 \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.
+ file, for each process.
 \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
+If you are developing a client program, you might find it useful to enable
+ debugging information from the LyX server.
+ Do this by starting LyX as 
+\begin_inset Flex CharStyle:Code
 status collapsed
 
 \begin_layout Plain Layout
-
-{}
+lyx -dbg lyxserver
 \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
+\begin_layout Standard
+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
-
-{}
+development/lyxserver/server_monitor.c
 \end_layout
 
 \end_inset
 
-eX (plain) -> DraftDVI
+.
 \end_layout
 
-\end_inset
-
- converter in 
-\begin_inset Flex CharStyle:MenuItem
+\begin_layout Standard
+Another useful tool is command-line based client you will find in 
+\begin_inset Flex CharStyle:Code
 status collapsed
 
 \begin_layout Plain Layout
-Preferences\SpecialChar \menuseparator
-File Handling\SpecialChar \menuseparator
-Converters
+src/client/lyxclient
 \end_layout
 
 \end_inset
 
- to 
-\begin_inset Flex CharStyle:Code
-status collapsed
-
-\begin_layout Plain Layout
-latex -synctex=1 $$i
+.
 \end_layout
 
-\end_inset
+\begin_layout Section
+Normal communication
+\end_layout
 
-, and for PDF output, change the 
-\begin_inset Flex CharStyle:MenuItem
-status collapsed
+\begin_layout Standard
+To issue a LyX call, the client writes a line of ASCII text into the input
+ pipe.
+ This line has the following format:
+\end_layout
 
-\begin_layout Plain Layout
-LaT
-\begin_inset ERT
-status collapsed
+\begin_layout Quote
+LYXCMD:
+\emph on
+clientname
+\emph default
+:
+\emph on
+function
+\emph default
+:
+\emph on
+argument
+\end_layout
 
-\begin_layout Plain 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.
+\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
 
-eX (pdflatex) -> PDF (pdflatex)
-\end_layout
-
+self-insert
+\begin_inset Quotes erd
 \end_inset
 
- or converter to 
-\begin_inset Flex CharStyle:Code
-status collapsed
+ LFUN will insert the argument as text at the cursor position).
+\end_layout
 
-\begin_layout Plain Layout
-pdflatex -synctex=1 $$i
+\begin_layout Standard
+The answer from LyX will arrive in the output pipe and be of the form
 \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
+\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
 
- 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
-
+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
 
-\end_inset
-
-
+\begin_layout Standard
+In case of errors, the response from LyX will have this form
 \end_layout
 
-\begin_layout Subsection
-Configuring and using specific viewers
+\begin_layout Quote
+ERROR:
+\emph on
+clientname
+\emph default
+:
+\emph on
+function
+\emph default
+:
+\emph on
+error message
 \end_layout
 
-\begin_layout Subsubsection*
-Xdvi (all platforms)
+\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
-If you use 
-\begin_inset Flex CharStyle:Code
-status collapsed
-
-\begin_layout Plain Layout
-xdvi
+Examples:
 \end_layout
 
+\begin_layout LyX-Code
+echo "LYXCMD:test:beginning-of-buffer:" >~/.lyxpipe.in
+\begin_inset Newline newline
 \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
+echo "LYXCMD:test:get-xy:" >~/.lyxpipe.in
+\begin_inset Newline newline
+\end_inset
 
+read a <~/.lyxpipe.out
+\begin_inset Newline newline
 \end_inset
 
- program.
- Just setup your document as described above (reverse search is triggered
- by Ctrl-click or Alt-click on Mac OSX, respectively).
+echo $a
 \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
+\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
 
- to
-\begin_inset Foot
-status collapsed
+notify
+\begin_inset Quotes erd
+\end_inset
 
-\begin_layout Plain Layout
-On Mac OSX you have to use 
+.
+ 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
-DISPLAY=:0.0 xdvi -editor 'lyxeditor.sh %f %l'
+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
 
-\begin_inset Flex CharStyle:Code
-status collapsed
+notify
+\begin_inset Quotes erd
+\end_inset
 
-\begin_layout Plain Layout
-xdvi -editor 'lyxeditor.sh %f %l'
+.
+ 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
 
-\end_inset
+\begin_layout Section
+The simple LyX Server Protocol
+\end_layout
 
-, where 
-\begin_inset Flex CharStyle:Code
-status collapsed
+\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 Plain Layout
-lyxeditor.sh
+\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
 
- is a suitable script.
- For example, a minimal shell script is the following one:
-\end_layout
+hello
+\begin_inset Quotes erd
+\end_inset
 
-\begin_layout LyX-Code
-#!/bin/sh
-\begin_inset Newline newline
+ or 
+\begin_inset Quotes eld
 \end_inset
 
-LYXPIPE="/path/to/lyxpipe"
-\begin_inset Newline newline
+bye
+\begin_inset Quotes erd
 \end_inset
 
-COMMAND="LYXCMD:revdvi:server-goto-file-row:$1 $2"
-\begin_inset Newline newline
+.
+ If 
+\begin_inset Quotes eld
 \end_inset
 
-echo "$COMMAND" > "${LYXPIPE}".in || exit
-\begin_inset Newline newline
+hello
+\begin_inset Quotes erd
 \end_inset
 
-read < "${LYXPIPE}".out || exit
+ 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
-where 
-\begin_inset Flex CharStyle:Code
+Some DVI/PDF viewers
+\begin_inset Foot
 status collapsed
 
 \begin_layout Plain Layout
-/path/to/lyxpipe
+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
 
- is the Ly
-\begin_inset ERT
-status collapsed
-
-\begin_layout Plain Layout
-
-{}
-\end_layout
-
-\end_inset
-
-XServer pipe path specified in 
-\begin_inset Flex CharStyle:MenuItem
+ 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
-Preferences\SpecialChar \menuseparator
-Paths
+lyxclient
 \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
+ 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
 
-\end_inset
+\begin_layout Subsection
+Enabling reverse search
+\end_layout
 
- folder of a source distribution you can find a 
+\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
-lyxeditor
-\end_layout
-
-\end_inset
-
- script which is able to locate the 
-\emph on
-lyxpipe
-\emph default
- based on your preferences.
+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*
-MacDviX (Mac OSX)
+Built-in DVI-search via src-specials (DVI only) 
 \end_layout
 
 \begin_layout Standard
-At the end of 
-\begin_inset Flex CharStyle:Code
+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
-/Applications/MacDviX_Folder/calleditor.script
-\end_layout
-
-\end_inset
-
-, add the following lines:
-\end_layout
-
-\begin_layout LyX-Code
-/Applications/Ly
+LaT
 \begin_inset ERT
 status collapsed
 
@@ -5256,384 +5321,405 @@ status collapsed
 
 \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.
+eX (plain)->DVI
 \end_layout
 
-\begin_layout Standard
-Reverse search is triggered by Alt-click (OPTION-click).
-\end_layout
+\end_inset
 
-\begin_layout Subsubsection*
-Skim (Mac OSX)
-\end_layout
+ or 
+\begin_inset Flex CharStyle:MenuItem
+status collapsed
 
-\begin_layout Standard
-Enter 
-\begin_inset Flex CharStyle:Code
+\begin_layout Plain Layout
+LaT
+\begin_inset ERT
 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)
+eX (plain)->DraftDVI
 \end_layout
 
 \end_inset
 
-, and then in 
+ converter in 
 \begin_inset Flex CharStyle:MenuItem
 status collapsed
 
 \begin_layout Plain Layout
-Skim\SpecialChar \menuseparator
 Preferences\SpecialChar \menuseparator
-Sync
+File Handling\SpecialChar \menuseparator
+Converters
 \end_layout
 
 \end_inset
 
- select Ly
-\begin_inset ERT
+ to 
+\begin_inset Flex CharStyle:Code
 status collapsed
 
 \begin_layout Plain Layout
-
-{}
+latex -src-specials $$i
 \end_layout
 
 \end_inset
 
-X.
-\end_layout
-
-\begin_layout Standard
-Reverse search is triggered by COMMAND-SHIFT-click
+.
+ 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*
-Okular (KDE)
+External Packages (PDFSync and scrltx) 
 \end_layout
 
 \begin_layout Standard
-Go to 
-\begin_inset Flex CharStyle:MenuItem
+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
-Settings\SpecialChar \menuseparator
-Configure Okular\SpecialChar \ldots{}
-\SpecialChar \menuseparator
-Editor
-\end_layout
 
-\end_inset
+\backslash
+usepackage{pdfsync}
+\end_layout
 
-, select 
-\begin_inset Quotes eld
 \end_inset
 
-Custom Text Editor
-\begin_inset Quotes erd
-\end_inset
+ for reverse PDF search,
+\end_layout
 
- and add the command 
+\begin_layout Itemize
 \begin_inset Flex CharStyle:Code
 status collapsed
 
 \begin_layout Plain Layout
-lyxclient -g %f %l
+
+\backslash
+usepackage[active]{srcltx}
 \end_layout
 
 \end_inset
 
-.
+ for reverse DVI search.
 \end_layout
 
 \begin_layout Standard
-Reverse search is triggered by SHIFT-click.
-\end_layout
-
-\begin_layout Subsubsection*
-YAP (Cygwin)
+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 Standard
-Launch yap, choose its 
-\begin_inset Flex CharStyle:MenuItem
-status collapsed
-
-\begin_layout Plain Layout
-View\SpecialChar \menuseparator
-Options
-\end_layout
+\begin_layout LyX-Code
 
+\backslash
+usepackage{ifpdf}
+\begin_inset Newline newline
 \end_inset
 
- menu and select the 
-\begin_inset Quotes eld
-\end_inset
 
-Inverse DVI Search
-\begin_inset Quotes erd
+\backslash
+ifpdf
+\begin_inset Newline newline
 \end_inset
 
- tab.
- Click on the 
-\begin_inset Quotes eld
+  
+\backslash
+usepackage{pdfsync}
+\begin_inset Newline newline
 \end_inset
 
-New\SpecialChar \ldots{}
 
-\begin_inset Quotes erd
+\backslash
+else
+\begin_inset Newline newline
 \end_inset
 
- button and, in the window that opens, enter 
-\begin_inset Quotes eld
+  
+\backslash
+usepackage[active]{srcltx}
+\begin_inset Newline newline
 \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
+\backslash
+fi
+\end_layout
 
- field.
- Now click on the button labeled 
-\begin_inset Quotes eld
-\end_inset
+\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
 
-\SpecialChar \ldots{}
+\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_inset Quotes erd
-\end_inset
+\begin_layout Subsubsection*
+Built-in reverse search via SyncTeX (DVI and PDF) 
+\end_layout
 
- to open a file dialog and navigate to the directory containing the batch
- file 
+\begin_layout Standard
+Recent versions of 
 \begin_inset Flex CharStyle:Code
 status collapsed
 
 \begin_layout Plain Layout
-lyxeditor.bat
+(pdf)latex
 \end_layout
 
 \end_inset
 
- (see below).
- Select 
-\begin_inset Flex CharStyle:Code
+ 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
-lyxeditor.bat
+LaT
+\begin_inset ERT
+status collapsed
+
+\begin_layout Plain Layout
+
+{}
 \end_layout
 
 \end_inset
 
- and then specify the program arguments as 
-\begin_inset Flex CharStyle:Code
-status collapsed
-
-\begin_layout Plain Layout
-%f %l
+eX (plain) -> DVI
 \end_layout
 
 \end_inset
 
- if you want to use the shell script above, or as 
-\begin_inset Flex CharStyle:Code
+ or 
+\begin_inset Flex CharStyle:MenuItem
 status collapsed
 
 \begin_layout Plain Layout
--g %f %l
+LaT
+\begin_inset ERT
+status collapsed
+
+\begin_layout Plain Layout
+
+{}
 \end_layout
 
 \end_inset
 
- if you want to use the 
-\begin_inset Flex CharStyle:Code
-status collapsed
-
-\begin_layout Plain Layout
-lyxclient
+eX (plain) -> DraftDVI
 \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
+ converter in 
+\begin_inset Flex CharStyle:MenuItem
 status collapsed
 
 \begin_layout Plain Layout
-lyxeditor.sh
+Preferences\SpecialChar \menuseparator
+File Handling\SpecialChar \menuseparator
+Converters
 \end_layout
 
 \end_inset
 
- or 
+ to 
 \begin_inset Flex CharStyle:Code
 status collapsed
 
 \begin_layout Plain Layout
-lyxclient
+latex -synctex=1 $$i
 \end_layout
 
 \end_inset
 
-, and this is the purpose of the 
-\begin_inset Flex CharStyle:Code
+, and for PDF output, change the 
+\begin_inset Flex CharStyle:MenuItem
 status collapsed
 
 \begin_layout Plain Layout
-lyxeditor.bat
-\end_layout
+LaT
+\begin_inset ERT
+status collapsed
 
-\end_inset
+\begin_layout Plain Layout
 
- 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
+eX (pdflatex) -> PDF (pdflatex)
+\end_layout
 
-bash -c 'lyxeditor.sh $(cygpath -a "%1") %2'
-\begin_inset Newline newline
 \end_inset
 
-exit
-\begin_inset Newline newline
-\end_inset
+ or converter to 
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+pdflatex -synctex=1 $$i
+\end_layout
 
-:lyxclient
-\begin_inset Newline newline
 \end_inset
 
-bash -c 'lyxclient %1 $(cygpath -a "%2") %3'
-\end_layout
+.
+ 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 Standard
-You have to make sure that both 
+\begin_layout Plain Layout
+The 
 \begin_inset Flex CharStyle:Code
 status collapsed
 
 \begin_layout Plain Layout
-lyxeditor.sh
+-synctex=1
 \end_layout
 
 \end_inset
 
- and 
+ 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
-lyxclient.exe
+-synctex=-1
 \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_inset
+
+
+\end_layout
+
+\begin_layout Subsection
+Configuring and using specific viewers
 \end_layout
 
 \begin_layout Subsubsection*
-SumatraPDF (Cygwin)
+Xdvi (all platforms)
 \end_layout
 
 \begin_layout Standard
-In SumatraPDF, you can set the name of the program that communicates with
- LyX by simply launching SumatraPDF as 
+If you use 
 \begin_inset Flex CharStyle:Code
 status collapsed
 
 \begin_layout Plain Layout
-SumatraPDF -inverse-search "lyxeditor.bat -g %f %l"
+xdvi
 \end_layout
 
 \end_inset
 
- and then quit.
- The program will remember the setting and using the 
+, 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
--inverse-search
+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
 
- option will not be needed from now on
+ to
 \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 
+On Mac OSX you have to use 
 \begin_inset Flex CharStyle:Code
 status collapsed
 
 \begin_layout Plain Layout
-/usr/local/bin
+DISPLAY=:0.0 xdvi -editor 'lyxeditor.sh %f %l'
 \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
+xdvi -editor 'lyxeditor.sh %f %l'
 \end_layout
 
 \end_inset
 
- option if you want to use the lyxpipe and be sure that th
+, wher
 \begin_inset Flex CharStyle:Code
 status collapsed
 
@@ -5643,300 +5729,916 @@ lyxeditor.sh
 
 \end_inset
 
- script is in your command PATH).
- If SumatraPDF is not your default PDF viewer, you should enter 
+ 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
-SumatraPDF.sh
+/path/to/lyxpipe
 \end_layout
 
 \end_inset
 
- in the viewer setting in 
+ is the Ly
+\begin_inset ERT
+status collapsed
+
+\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
-File Handling\SpecialChar \menuseparator
-File formats\SpecialChar \menuseparator
-PDF (pdflatex)
+Paths
 \end_layout
 
 \end_inset
 
-, where 
+.
+\begin_inset Foot
+status collapsed
+
+\begin_layout Plain Layout
+In the 
 \begin_inset Flex CharStyle:Code
 status collapsed
 
 \begin_layout Plain Layout
-SumatraPDF.sh
+development/tools
 \end_layout
 
 \end_inset
 
- is the following script (to be placed in your command PATH, 
+ folder of a source distribution you can find a 
 \begin_inset Flex CharStyle:Code
 status collapsed
 
 \begin_layout Plain Layout
-/usr/local/bin
+lyxeditor
 \end_layout
 
 \end_inset
 
- being the best choice):
-\end_layout
-
-\begin_layout LyX-Code
-#!/bin/bash
-\begin_inset Newline newline
-\end_inset
+ script which is able to locate the 
+\emph on
+lyxpipe
+\emph default
+ based on your preferences.
+\end_layout
 
-cd $(dirname $1)
-\begin_inset Newline newline
 \end_inset
 
-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.
+\begin_layout Subsubsection*
+MacDviX (Mac OSX)
 \end_layout
 
-\begin_layout Chapter
-Special Document Classes
-\end_layout
+\begin_layout Standard
+At the end of 
+\begin_inset Flex CharStyle:Code
+status collapsed
 
-\begin_layout Section
-A&A Paper
+\begin_layout Plain Layout
+/Applications/MacDviX_Folder/calleditor.script
 \end_layout
 
-\begin_layout Standard
-by 
-\noun on
-Peter Sütterlin
-\end_layout
+\end_inset
 
-\begin_layout Subsection
-Introduction
+, add the following lines:
 \end_layout
 
-\begin_layout Standard
-This section describes how LyX can be used to write articles for submission
- to the scientific journal 
-\emph on
-Astronomy and Astrophysics
-\emph default
- (www.edpsciences.fr/aa/ 
-\begin_inset Flex URL
+\begin_layout LyX-Code
+/Applications/Ly
+\begin_inset ERT
 status collapsed
 
 \begin_layout Plain Layout
 
-http://www.edpsciences.fr/aa/
+{}
 \end_layout
 
 \end_inset
 
-) using Version 5.01 of the document class 
-\family typewriter
-aa.cls
-\family default
-.
- This package can be downloaded from the ftp site
+X.app/Contents/MacOS/lyxeditor "$2" $1
+\begin_inset Newline newline
+\end_inset
+
+exit 1
 \end_layout
 
 \begin_layout Standard
-\begin_inset VSpace medskip
-\end_inset
+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
-\align center
-\begin_inset Flex URL
+Enter 
+\begin_inset Flex CharStyle:Code
 status collapsed
 
 \begin_layout Plain Layout
-
-ftp://ftp.edpsciences.org/pub/aa/readme.html
+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
 
-\begin_layout Standard
-\begin_inset VSpace medskip
 \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
 
-\begin_layout Standard
-A manual comes together with that package, and this text is not meant to
- replace the original manual but merely a short guide how to realize the
- correct form of your paper.
-\end_layout
-
-\begin_layout Standard
-Please note that the publisher of the journal was changed from Springer
- to EDP Sciences starting January 1, 2001.
- That change implicated also some slight changes of the style files, namely
- the removal of the thesaurus command.
- The LyX class aa supports the newest version of these style files, V 5.01.
- If you have an older version installed, please upgrade.
- For compatibility, the old (version 4) layout has been kept as 
-\family sans
-article (A&A V4)
-\family default
-.
- Please refer to the comments in 
-\family typewriter
-LyXDir/layouts/aapaper.layout
-\family default
-.
-\end_layout
+\end_inset
 
-\begin_layout Subsection
-Getting started
-\end_layout
+ select Ly
+\begin_inset ERT
+status collapsed
 
-\begin_layout Standard
-It is recommended you start from the example template distributed with LyX.
- If you are not using a template, note the following settings:
-\end_layout
+\begin_layout Plain Layout
 
-\begin_layout Itemize
-Select 
-\family sans
-article (A&A)
-\family default
- in the 
-\family sans
-Document\SpecialChar \menuseparator
-Settings
-\family default
- dialog (OK, that one was obvious).
+{}
 \end_layout
 
-\begin_layout Itemize
-Don't change the option 
-\family sans
-Page
-\begin_inset space ~
 \end_inset
 
-style
-\family default
-: Leave it set to 
-\family sans
-default
-\family default
-.
- The whole layout is done by the macros, you shouldn't change anything.
-\end_layout
-
-\begin_layout Subsection
-The header block
+X.
 \end_layout
 
 \begin_layout Standard
-First thing to enter is the header information.
- It consists of seven entries, of which some are optional.
- They are
+Reverse search is triggered by COMMAND-SHIFT-click
 \end_layout
 
-\begin_layout Itemize
-
-\family sans
-Title
-\family default
-: [required] 
+\begin_layout Subsubsection*
+Okular (KDE)
 \end_layout
 
-\begin_layout Itemize
+\begin_layout Standard
+Go to 
+\begin_inset Flex CharStyle:MenuItem
+status collapsed
 
-\family sans
-Subtitle
-\family default
-: [optional] 
+\begin_layout Plain Layout
+Settings\SpecialChar \menuseparator
+Configure Okular\SpecialChar \ldots{}
+\SpecialChar \menuseparator
+Editor
 \end_layout
 
-\begin_layout Itemize
-
-\family sans
-Author
-\family default
-: [required]
-\end_layout
+\end_inset
 
-\begin_layout Itemize
+, select 
+\begin_inset Quotes eld
+\end_inset
 
-\family sans
-Address
-\family default
-: [required]
-\end_layout
+Custom Text Editor
+\begin_inset Quotes erd
+\end_inset
 
-\begin_layout Itemize
+ and add the command 
+\begin_inset Flex CharStyle:Code
+status collapsed
 
-\family sans
-Offprints
-\family default
-: [optional] if more than one author: whom to contact for offprint requests.
+\begin_layout Plain Layout
+lyxclient -g %f %l
 \end_layout
 
-\begin_layout Itemize
+\end_inset
 
-\family sans
-Mail
-\family default
-: [optional] mail address for contacts.
+.
 \end_layout
 
-\begin_layout Itemize
+\begin_layout Standard
+Reverse search is triggered by SHIFT-click.
+\end_layout
 
-\family sans
-Date
-\family default
-: [required].
- Suggested format is 
-\family typewriter
-Received: <date>; Accepted <date> 
+\begin_layout Subsubsection*
+YAP (Windows)
 \end_layout
 
 \begin_layout Standard
-There is no need to issue the 
-\family typewriter
+Launch yap, choose its 
+\begin_inset Flex CharStyle:MenuItem
+status collapsed
 
-\backslash
-maketitle
-\family default
- command, this is done automatically by LyX when the header is finished.
- Although the order of the single header entries doesn't matter it is advised
- to keep the above sequence, just to get the best optics and meets the layout
- of the real document.
+\begin_layout Plain Layout
+View\SpecialChar \menuseparator
+Options
 \end_layout
 
-\begin_layout Standard
-If you want to place footnotes in the header block, e.
-\begin_inset space \thinspace{}
 \end_inset
 
-g.
-\begin_inset space \space{}
+ 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
+
+.
+ The 
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+lyxeditor.bat
+\end_layout
+
+\end_inset
+
+ 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
+
+\backslash
+
+\backslash
+.
+\backslash
+pipe
+\backslash
+lyxpipe
+\end_layout
+
+\end_inset
+
+, otherwise change the 
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+lyxeditor.bat
+\end_layout
+
+\end_inset
+
+ wrapper accordingly.
+\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
+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
+
+, where 
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+lyxeditor.bat
+\end_layout
+
+\end_inset
+
+ is the previous wrapper.
+ If SumatraPDF.exe is not in your command PATH, use its full file name.
+\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
+
+\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 
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+lyxeditor.exe
+\end_layout
+
+\end_inset
+
+ program (which is installed by default on Cygwin along with the LyX executable).
+ Select 
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+lyxeditor.exe
+\end_layout
+
+\end_inset
+
+ and then specify the program arguments as 
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+-g %f %l
+\end_layout
+
+\end_inset
+
+.
+ 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
+, omit the 
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+-g
+\end_layout
+
+\end_inset
+
+ option and be sure to specify the LyXServer pipe path in the LyX preferences.
+\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
+
+\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
+
+ being the best choice):
+\end_layout
+
+\begin_layout LyX-Code
+#!/bin/bash
+\begin_inset Newline newline
+\end_inset
+
+cd $(dirname $1)
+\begin_inset Newline newline
+\end_inset
+
+SumatraPDF -inverse-search "lyxeditor -g %f %l" $(basename $1)
+\end_layout
+
+\begin_layout Standard
+This wrapper script 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.exe is not in your command PATH, use its full posix path in
+ the script above.
+ The 
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+-g
+\end_layout
+
+\end_inset
+
+ enables communication via the 
+\emph on
+lyxsocket
+\emph default
+.
+ Again, 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 
+\emph on
+lyxpipe
+\emph default
+, and be sure to specify the LyXServer pipe path in the LyX preferences.
+\end_layout
+
+\begin_layout Standard
+Reverse search is triggered by double-click.
+\end_layout
+
+\begin_layout Chapter
+Special Document Classes
+\end_layout
+
+\begin_layout Section
+A&A Paper
+\end_layout
+
+\begin_layout Standard
+by 
+\noun on
+Peter Sütterlin
+\end_layout
+
+\begin_layout Subsection
+Introduction
+\end_layout
+
+\begin_layout Standard
+This section describes how LyX can be used to write articles for submission
+ to the scientific journal 
+\emph on
+Astronomy and Astrophysics
+\emph default
+ (www.edpsciences.fr/aa/ 
+\begin_inset Flex URL
+status collapsed
+
+\begin_layout Plain Layout
+
+http://www.edpsciences.fr/aa/
+\end_layout
+
+\end_inset
+
+) using Version 5.01 of the document class 
+\family typewriter
+aa.cls
+\family default
+.
+ This package can be downloaded from the ftp site
+\end_layout
+
+\begin_layout Standard
+\begin_inset VSpace medskip
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\align center
+\begin_inset Flex URL
+status collapsed
+
+\begin_layout Plain Layout
+
+ftp://ftp.edpsciences.org/pub/aa/readme.html
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset VSpace medskip
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+A manual comes together with that package, and this text is not meant to
+ replace the original manual but merely a short guide how to realize the
+ correct form of your paper.
+\end_layout
+
+\begin_layout Standard
+Please note that the publisher of the journal was changed from Springer
+ to EDP Sciences starting January 1, 2001.
+ That change implicated also some slight changes of the style files, namely
+ the removal of the thesaurus command.
+ The LyX class aa supports the newest version of these style files, V 5.01.
+ If you have an older version installed, please upgrade.
+ For compatibility, the old (version 4) layout has been kept as 
+\family sans
+article (A&A V4)
+\family default
+.
+ Please refer to the comments in 
+\family typewriter
+LyXDir/layouts/aapaper.layout
+\family default
+.
+\end_layout
+
+\begin_layout Subsection
+Getting started
+\end_layout
+
+\begin_layout Standard
+It is recommended you start from the example template distributed with LyX.
+ If you are not using a template, note the following settings:
+\end_layout
+
+\begin_layout Itemize
+Select 
+\family sans
+article (A&A)
+\family default
+ in the 
+\family sans
+Document\SpecialChar \menuseparator
+Settings
+\family default
+ dialog (OK, that one was obvious).
+\end_layout
+
+\begin_layout Itemize
+Don't change the option 
+\family sans
+Page
+\begin_inset space ~
+\end_inset
+
+style
+\family default
+: Leave it set to 
+\family sans
+default
+\family default
+.
+ The whole layout is done by the macros, you shouldn't change anything.
+\end_layout
+
+\begin_layout Subsection
+The header block
+\end_layout
+
+\begin_layout Standard
+First thing to enter is the header information.
+ It consists of seven entries, of which some are optional.
+ They are
+\end_layout
+
+\begin_layout Itemize
+
+\family sans
+Title
+\family default
+: [required] 
+\end_layout
+
+\begin_layout Itemize
+
+\family sans
+Subtitle
+\family default
+: [optional] 
+\end_layout
+
+\begin_layout Itemize
+
+\family sans
+Author
+\family default
+: [required]
+\end_layout
+
+\begin_layout Itemize
+
+\family sans
+Address
+\family default
+: [required]
+\end_layout
+
+\begin_layout Itemize
+
+\family sans
+Offprints
+\family default
+: [optional] if more than one author: whom to contact for offprint requests.
+\end_layout
+
+\begin_layout Itemize
+
+\family sans
+Mail
+\family default
+: [optional] mail address for contacts.
+\end_layout
+
+\begin_layout Itemize
+
+\family sans
+Date
+\family default
+: [required].
+ Suggested format is 
+\family typewriter
+Received: <date>; Accepted <date> 
+\end_layout
+
+\begin_layout Standard
+There is no need to issue the 
+\family typewriter
+
+\backslash
+maketitle
+\family default
+ command, this is done automatically by LyX when the header is finished.
+ Although the order of the single header entries doesn't matter it is advised
+ to keep the above sequence, just to get the best optics and meets the layout
+ of the real document.
+\end_layout
+
+\begin_layout Standard
+If you want to place footnotes in the header block, e.
+\begin_inset space \thinspace{}
+\end_inset
+
+g.
+\begin_inset space \space{}
 \end_inset
 
 to state your present address, just use the standard footnote via the menu
@@ -17508,346 +18210,696 @@ You should use "
 \begin_layout Enumerate
 
 \size small
-User-specified pattern found.
+User-specified pattern found.
+\end_layout
+
+\begin_layout Enumerate
+
+\size small
+This command might not be intended.
+\end_layout
+
+\begin_layout Enumerate
+
+\size small
+\emph on
+Comment displayed.
+\end_layout
+
+\begin_layout Enumerate
+
+\size small
+Either 
+\family typewriter
+''
+\backslash
+,'
+\family default
+ or 
+\family typewriter
+'
+\backslash
+,''
+\family default
+ will look better.
+\end_layout
+
+\begin_layout Enumerate
+
+\size small
+Delete this space to maintain correct page references.
+\end_layout
+
+\begin_layout Enumerate
+
+\size small
+\emph on
+You might wish to put this between a pair of 
+\begin_inset Quotes eld
+\end_inset
+
+
+\family typewriter
+{}
+\family default
+
+\begin_inset Quotes erd
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Enumerate
+
+\size small
+You ought to remove spaces in front of punctuation.
+\end_layout
+
+\begin_layout Enumerate
+
+\size small
+Could not execute LaTeX command.
+\end_layout
+
+\begin_layout Enumerate
+
+\size small
+Don't use 
+\family typewriter
+
+\backslash
+/
+\family default
+ in front of small punctuation.
+\end_layout
+
+\begin_layout Enumerate
+
+\family typewriter
+\size small
+$
+\backslash
+times$
+\family default
+ may look prettier here.
+\end_layout
+
+\begin_layout Enumerate
+
+\size small
+\emph on
+Multiple spaces detected in output.
+\end_layout
+
+\begin_layout Enumerate
+
+\size small
+This text may be ignored.
+\end_layout
+
+\begin_layout Enumerate
+
+\size small
+Use 
+\family typewriter
+
+\begin_inset Quotes eld
+\end_inset
+
+
+\family default
+ to begin quotation, not 
+\family typewriter
+'
+\family default
+.
+\end_layout
+
+\begin_layout Enumerate
+
+\size small
+Use 
+\family typewriter
+'
+\family default
+ to end quotation, not 
+\family typewriter
+
+\begin_inset Quotes eld
+\end_inset
+
+
+\family default
+.
+\end_layout
+
+\begin_layout Enumerate
+
+\size small
+Don't mix quotes.
+\end_layout
+
+\begin_layout Enumerate
+
+\size small
+You should perhaps use 
+\begin_inset Quotes eld
+\end_inset
+
+
+\family typewriter
+cmd
+\family default
+
+\begin_inset Quotes erd
+\end_inset
+
+ instead.
+\end_layout
+
+\begin_layout Enumerate
+
+\size small
+You should put a space in front of/after parenthesis.
+\end_layout
+
+\begin_layout Enumerate
+
+\size small
+You should avoid spaces in front of/after parenthesis.
 \end_layout
 
 \begin_layout Enumerate
 
 \size small
-This command might not be intended.
+\emph on
+You should not use punctuation in front of/after quotes.
 \end_layout
 
 \begin_layout Enumerate
 
 \size small
-\emph on
-Comment displayed.
+Double space found.
 \end_layout
 
 \begin_layout Enumerate
 
 \size small
-Either 
-\family typewriter
-''
-\backslash
-,'
-\family default
- or 
-\family typewriter
-'
-\backslash
-,''
-\family default
- will look better.
+You should put punctuation outside inner/inside display math mode.
 \end_layout
 
 \begin_layout Enumerate
 
 \size small
-Delete this space to maintain correct page references.
+You ought to not use primitive TeX in LaTeX code.
 \end_layout
 
 \begin_layout Enumerate
 
 \size small
-\emph on
-You might wish to put this between a pair of 
+You should remove spaces in front of 
 \begin_inset Quotes eld
 \end_inset
 
 
 \family typewriter
-{}
+%s
 \family default
 
 \begin_inset Quotes erd
 \end_inset
 
-.
-\end_layout
-
-\begin_layout Enumerate
 
-\size small
-You ought to remove spaces in front of punctuation.
 \end_layout
 
 \begin_layout Enumerate
 
 \size small
-Could not execute LaTeX command.
-\end_layout
+\begin_inset Quotes eld
+\end_inset
 
-\begin_layout Enumerate
 
-\size small
-Don't use 
 \family typewriter
-
-\backslash
-/
+%s
 \family default
- in front of small punctuation.
-\end_layout
 
-\begin_layout Enumerate
+\begin_inset Quotes erd
+\end_inset
+
+ is normally not followed by 
+\begin_inset Quotes eld
+\end_inset
+
 
 \family typewriter
-\size small
-$
-\backslash
-times$
+%c
 \family default
- may look prettier here.
-\end_layout
 
-\begin_layout Enumerate
+\begin_inset Quotes erd
+\end_inset
 
-\size small
-\emph on
-Multiple spaces detected in output.
+.
 \end_layout
 
-\begin_layout Enumerate
+\begin_layout Standard
+In later versions of LyX, we hope to provide a more complete interface to
+ this tool (and it's smaller cousin 
+\family typewriter
+lacheck
+\family default
+) to exploit the full power of it.
+ But it's not exactly useless as it is now: go try it on one of your existing
+ documents of a certain length and be surprised.
+\end_layout
 
-\size small
-This text may be ignored.
+\begin_layout Section
+Version Control in LyX
 \end_layout
 
-\begin_layout Enumerate
+\begin_layout Standard
+by
+\noun on
+ Lars Gullik Bjønnes 
+\noun default
+and 
+\noun on
+Pavel Sanda
+\end_layout
 
-\size small
-Use 
-\family typewriter
+\begin_layout Subsection
+Introduction
+\end_layout
+
+\begin_layout Standard
+A friend of mine wanted to try LyX for a group project.
+ When he didn't find support for version control or file locking, he dropped
+ it.
+ This angered me a bit, so I thought that I should at least make support
+ for RCS (with the possibility of CVS and/or SCCS as a future improvement.)
+ This has now been done.
+ LyX now supports some of the most basic RCS commands.
+ If you need to something a bit more sophisticated you will have to do that
+ manually in a terminal.
+\end_layout
 
+\begin_layout Standard
+Before you begin to use the version control features in LyX, you should
+ read 
 \begin_inset Quotes eld
 \end_inset
 
+rcsintro
+\begin_inset Quotes erd
+\end_inset
 
+ (a man file, read it with 
+\family typewriter
+man rcsintro
 \family default
- to begin quotation, not 
+).
+ This file describes all the basic features of RCS.
+ You should especially notice the comment about a RCS directory, and the
+ notion of a master RCS file (the file ending in 
 \family typewriter
-'
+,v
 \family default
-.
+).
 \end_layout
 
-\begin_layout Enumerate
+\begin_layout Standard
+Later basic CVS/SVN support was added.
+ You should be familiar with CVS/SVN usage before start using it under LyX.
+ Most of the log messages are not currently displayed after operations -
+ you can check them in Messages pane if unsure.
+\end_layout
 
-\size small
-Use 
-\family typewriter
-'
+\begin_layout Standard
+The implementation in LyX assumes a recent version of the GNU RCS or CVS/SVN
+ package—no guarantees are made for older versions.
+\end_layout
+
+\begin_layout Standard
+For introducing your own external commands consult vc-command in the manual
+ of LyX functions.
+\end_layout
+
+\begin_layout Subsection
+RCS commands in LyX
+\end_layout
+
+\begin_layout Standard
+The following sections describe the RCS commands supported by LyX.
+ You can find them in the 
+\family sans
+File\SpecialChar \menuseparator
+Version
+\begin_inset space ~
+\end_inset
+
+Control
 \family default
- to end quotation, not 
-\family typewriter
+ submenu.
+ LyX was tested against RCS 5.7.
+\end_layout
+
+\begin_layout Subsubsection
+
+\family sans
+Register
+\end_layout
+
+\begin_layout Standard
+If your document is not under revision control, this is the only item shown
+ in the menu.
+ And if it is under revision control, the 
+\family sans
+Register
+\family default
+ item is not visible.
+\end_layout
+
+\begin_layout Standard
+This command registers your document with RCS (unless you are under the
+ directory managed by CVS)\SpecialChar \@.
+ You are asked interactively to supply an initial
+ description of the document.
+ The document is now set in Read-Only mode and you have to 
+\family sans
+Check
+\begin_inset space ~
+\end_inset
+
+Out
+\begin_inset space ~
+\end_inset
+
+For
+\begin_inset space ~
+\end_inset
 
+Edit
+\family default
+, before making any changes to it.
+ A document under revision control has a 
 \begin_inset Quotes eld
 \end_inset
 
+[RCS:<version> <locker>]
+\begin_inset Quotes erd
+\end_inset
+
+ item tagged to the filename in the minibuffer.
+\end_layout
+
+\begin_layout Standard
+RCS command that is run: 
+\family typewriter
+ci -q -u -i -t-"<initial description>" <file-name>
+\end_layout
 
+\begin_layout Standard
+Read 
+\family typewriter
+man ci
 \family default
-.
+ to understand the switches.
 \end_layout
 
-\begin_layout Enumerate
+\begin_layout Subsubsection
 
-\size small
-Don't mix quotes.
+\family sans
+Check In Changes
 \end_layout
 
-\begin_layout Enumerate
+\begin_layout Standard
+When you are finished editing a file, you check in your changes.
+ When you do this, you are asked for a description of the changes.
+ This is stored in the history log.
+ The version number is bumped, your changes are applied to the master RCS
+ file, the document is unlocked and set to Read-Only mode.
+\end_layout
 
-\size small
-You should perhaps use 
-\begin_inset Quotes eld
-\end_inset
+\begin_layout Standard
+RCS command: 
+\family typewriter
+ci -q -u -m"<description>" <file-name>
+\end_layout
+
+\begin_layout Subsubsection
+
+\family sans
+Check Out For Edit
+\end_layout
 
+\begin_layout Standard
+By doing this you lock the document so that only you can edit it.
+ This will also make the document Read-Write only for you.
+ You will usually continue editing for a while and when you are finished
+ you check in your changes.
+ The status line is changed to reflect that you have locked the file.
+\end_layout
 
+\begin_layout Standard
+RCS command: 
 \family typewriter
-cmd
-\family default
-
-\begin_inset Quotes erd
-\end_inset
-
- instead.
+co -q -l <file-name>
 \end_layout
 
-\begin_layout Enumerate
+\begin_layout Subsubsection
 
-\size small
-You should put a space in front of/after parenthesis.
+\family sans
+Revert To Repository Version
 \end_layout
 
-\begin_layout Enumerate
+\begin_layout Standard
+This will discard all changes made to the document since the last check
+ in.
+ You get a warning before changes are discarded.
+\end_layout
 
-\size small
-You should avoid spaces in front of/after parenthesis.
+\begin_layout Standard
+RCS command: 
+\family typewriter
+co -f -u<version> <file-name>
 \end_layout
 
-\begin_layout Enumerate
+\begin_layout Subsubsection
 
-\size small
-\emph on
-You should not use punctuation in front of/after quotes.
+\family sans
+Undo Last Checkin
 \end_layout
 
-\begin_layout Enumerate
+\begin_layout Standard
+This makes as if the last check in never happened.
+ No changes are made to the document loaded into LyX, but the last version
+ is removed from the master RCS file.
+\end_layout
 
-\size small
-Double space found.
+\begin_layout Standard
+RCS command: 
+\family typewriter
+rcs -o<version> <file-name>
 \end_layout
 
-\begin_layout Enumerate
+\begin_layout Subsubsection
 
-\size small
-You should put punctuation outside inner/inside display math mode.
+\family sans
+Show History
 \end_layout
 
-\begin_layout Enumerate
+\begin_layout Standard
+This show the complete history of the RCS document.
+ The output of 
+\family typewriter
+rlog <file-name>
+\family default
+ is shown in a browser.
+ See 
+\family typewriter
+man rlog
+\family default
+ for more info.
+\end_layout
 
-\size small
-You ought to not use primitive TeX in LaTeX code.
+\begin_layout Subsubsection
+Revision info
 \end_layout
 
-\begin_layout Enumerate
+\begin_layout Standard
+LyX supports RCS version number information (only), see 
+\begin_inset CommandInset ref
+LatexCommand ref
+reference "sub:VCS-Revision-Information"
 
-\size small
-You should remove spaces in front of 
-\begin_inset Quotes eld
 \end_inset
 
+ for details.
+\end_layout
 
-\family typewriter
-%s
-\family default
+\begin_layout Subsection
+CVS commands in LyX
+\end_layout
 
-\begin_inset Quotes erd
+\begin_layout Standard
+CVS is now partially supported by LyX.
+ You can find the commands in the 
+\family sans
+File\SpecialChar \menuseparator
+Version
+\begin_inset space ~
 \end_inset
 
-
+Control
+\family default
+ submenu.
+ Focus of the development moved to SVN support, so please use it instead
+ of CVS if possible.
 \end_layout
 
-\begin_layout Enumerate
+\begin_layout Subsubsection
 
-\size small
-\begin_inset Quotes eld
-\end_inset
+\family sans
+Register
+\end_layout
 
+\begin_layout Standard
+If your document is not under revision control, this is the only item shown
+ in the menu.
+ And if it is under revision control, the 
+\family sans
+\bar under
+R
+\bar default
+egister
+\family default
+ item is not visible.
+\end_layout
 
+\begin_layout Standard
+This command registers in CVS your document ONLY in case you have already
+ the documents directory under CVS control (in particular 
 \family typewriter
-%s
+CVS/Entries
 \family default
+ file exists).
+ This means you have to checkout the archive by yourself.
+\end_layout
 
+\begin_layout Standard
+Then you are asked interactively to supply an initial description of the
+ document.
+ Don't forget that registered file is not yet commited.
+\end_layout
+
+\begin_layout Standard
+CVS command that is run: 
+\family typewriter
+cvs -q add -m
 \begin_inset Quotes erd
 \end_inset
 
- is normally not followed by 
+<entered message>" 
 \begin_inset Quotes eld
 \end_inset
 
-
-\family typewriter
-%c
-\family default
-
+<file-name>
 \begin_inset Quotes erd
 \end_inset
 
-.
+
 \end_layout
 
 \begin_layout Standard
-In later versions of LyX, we hope to provide a more complete interface to
- this tool (and it's smaller cousin 
+Read 
 \family typewriter
-lacheck
+man svn
 \family default
-) to exploit the full power of it.
- But it's not exactly useless as it is now: go try it on one of your existing
- documents of a certain length and be surprised.
+ to understand the switches.
 \end_layout
 
-\begin_layout Section
-Version Control in LyX
+\begin_layout Subsubsection
+
+\family sans
+Check In Changes
 \end_layout
 
 \begin_layout Standard
-by
-\noun on
- Lars Gullik Bjønnes, 
-\noun default
-updated by 
-\noun on
-Pavel Sanda
+When you are finished editing a file, you commit your changes.
+ When you do this, you are asked for a description of the changes.
+ After that changes are commited.
 \end_layout
 
-\begin_layout Subsection
-Introduction
+\begin_layout Standard
+CVS command: 
+\family typewriter
+cvs -q commit -m"<description>" "<file-name>"
+\end_layout
+
+\begin_layout Subsubsection
+
+\family sans
+Revert To Repository Version
 \end_layout
 
 \begin_layout Standard
-A friend of mine wanted to try LyX for a group project.
- When he didn't find support for version control or file locking, he dropped
- it.
- This angered me a bit, so I thought that I should at least make support
- for RCS (with the possibility of CVS and/or SCCS as a future improvement.)
- This has now been done.
- LyX now supports some of the most basic RCS commands.
- If you need to something a bit more sophisticated you will have to do that
- manually in an xterm.
+This will discard all changes made to the document since the last check
+ in.
+ You get a warning before changes are discarded.
+ Firstly the file is deleted, secondly CVS update command is run.
 \end_layout
 
 \begin_layout Standard
-Before you begin to use the version control features in LyX, you should
- read 
+CVS command: 
+\family typewriter
+cvs update 
 \begin_inset Quotes eld
 \end_inset
 
-rcsintro
+<file-name>
 \begin_inset Quotes erd
 \end_inset
 
- (a man file, read it with 
-\family typewriter
-man rcsintro
-\family default
-).
- This file describes all the basic features of RCS.
- You should especially notice the comment about a RCS directory, and the
- notion of a master RCS file (the file ending in 
-\family typewriter
-,v
-\family default
-).
-\end_layout
 
-\begin_layout Standard
-Later basic CVS/SVN support was added.
- You should be familiar with CVS/SVN usage before start using it under LyX.
- Most of the log messages are not currently displayed after operations -
- you can check them in terminal window if unsure.
 \end_layout
 
-\begin_layout Standard
-The implementation in LyX assumes a recent version of the GNU RCS or CVS/SVN
- package—no guarantees are made for older versions.
+\begin_layout Subsubsection
+
+\family sans
+Show History
 \end_layout
 
 \begin_layout Standard
-For introducing your own external commands consult vc-command in the manual
- of LyX functions.
+This show the complete history of the CVS document.
+ The output of 
+\family typewriter
+cvs log 
+\begin_inset Quotes eld
+\end_inset
+
+<file-name>
+\begin_inset Quotes erd
+\end_inset
+
+
+\family default
+ is shown in a browser.
 \end_layout
 
 \begin_layout Subsection
-RCS commands in LyX
+SVN commands in LyX
 \end_layout
 
-\begin_layout Standard
-The following sections describe the RCS commands supported by LyX.
- You can find them in the 
+\begin_layout Standard
+SVN is now partially supported by LyX.
+ You can find the commands in the 
 \family sans
 File\SpecialChar \menuseparator
 Version
@@ -17857,7 +18909,26 @@ Version
 Control
 \family default
  submenu.
- LyX was tested against RCS 5.7.
+ 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.5 and 1.6
+\begin_inset Foot
+status collapsed
+
+\begin_layout Plain Layout
+Most of the commands will work with 1.4 too, see 
+\begin_inset CommandInset ref
+LatexCommand ref
+reference "sub:SVN-Repo-Update"
+
+\end_inset
+
+.
+\end_layout
+
+\end_inset
+
+
 \end_layout
 
 \begin_layout Subsubsection
@@ -17871,55 +18942,50 @@ If your document is not under revision control, this is the only item shown
  in the menu.
  And if it is under revision control, the 
 \family sans
-Register
+\bar under
+R
+\bar default
+egister
 \family default
  item is not visible.
  
 \end_layout
 
 \begin_layout Standard
-This command registers your document with RCS (unless you are under the
- directory managed by CVS)\SpecialChar \@.
- You are asked interactively to supply an initial
- description of the document.
- The document is now set in Read-Only mode and you have to 
-\family sans
-Check
-\begin_inset space ~
-\end_inset
-
-Out
-\begin_inset space ~
-\end_inset
+This command registers in SVN your document ONLY in case you have already
+ the documents directory under SVN control (in particular 
+\family typewriter
+.svn/entries
+\family default
+ file exists).
+ This means you have to checkout the archive by yourself.
+\end_layout
 
-For
-\begin_inset space ~
-\end_inset
+\begin_layout Standard
+Then you are asked interactively to supply an initial description of the
+ document.
+ Don't forget that registered file is not yet commited.
+\end_layout
 
-Edit
-\family default
-, before making any changes to it.
- A document under revision control has a 
+\begin_layout Standard
+SVN command that is run: 
+\family typewriter
+svn add -q 
 \begin_inset Quotes eld
 \end_inset
 
-[RCS:<version> <locker>]
+<file-name>
 \begin_inset Quotes erd
 \end_inset
 
- item tagged to the filename in the minibuffer.
-\end_layout
 
-\begin_layout Standard
-RCS command that is run: 
-\family typewriter
-ci -q -u -i -t-"<initial description>" <file-name>
 \end_layout
 
 \begin_layout Standard
 Read 
 \family typewriter
-man ci
+man svn
 \family default
  to understand the switches.
  
@@ -17932,18 +18998,33 @@ Check In Changes
 \end_layout
 
 \begin_layout Standard
-When you are finished editing a file, you check in your changes.
+When you are finished editing a file, you commit your changes.
  When you do this, you are asked for a description of the changes.
- This is stored in the history log.
- The version number is bumped, your changes are applied to the master RCS
- file, the document is unlocked and set to Read-Only mode.
+ After that changes are commited.
 \end_layout
 
 \begin_layout Standard
-RCS 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
-ci -q -u -m"<description>" <file-name>
+svn commit -q -m"<description>" <file-name>
 \end_layout
 
 \begin_layout Subsubsection
@@ -17953,18 +19034,33 @@ Check Out For Edit
 \end_layout
 
 \begin_layout Standard
-By doing this you lock the document so that only you can edit it.
- This will also make the document Read-Write only for you.
- You will usually continue editing for a while and when you are finished
- you check in your changes.
- The status line is changed to reflect that you have locked the file.
+Updates the changes of this file from the repository.
+ Be sure you understand SVN merging and conflicts resolving before using
+ this function, because all conflicts has to be resolved manually by you!
 \end_layout
 
 \begin_layout Standard
-RCS command: 
+SVN command:
+\begin_inset Foot
+status collapsed
+
+\begin_layout Plain Layout
+Ditto.
+\end_layout
+
+\end_inset
+
 \family typewriter
-co -q -l <file-name>
+svn update --non-interactive 
+\begin_inset Quotes eld
+\end_inset
+
+<file-name>
+\begin_inset Quotes erd
+\end_inset
+
+
 \end_layout
 
 \begin_layout Subsubsection
@@ -17977,178 +19073,148 @@ Revert To Repository Version
 This will discard all changes made to the document since the last check
  in.
  You get a warning before changes are discarded.
 \end_layout
 
 \begin_layout Standard
-RCS command: 
+SVN command: 
 \family typewriter
-co -f -u<version> <file-name>
+svn revert -q 
+\begin_inset Quotes eld
+\end_inset
+
+<file-name>
+\begin_inset Quotes erd
+\end_inset
+
+
 \end_layout
 
 \begin_layout Subsubsection
+\begin_inset CommandInset label
+LatexCommand label
+name "sub:SVN-Repo-Update"
 
-\family sans
-Undo Last Checkin
-\end_layout
+\end_inset
 
-\begin_layout Standard
-This makes as if the last check in never happened.
- No changes are made to the document loaded into LyX, but the last version
- is removed from the master RCS file.
-\end_layout
+Update of the local directory checkout from repository
+\begin_inset Foot
+status collapsed
 
-\begin_layout Standard
-RCS command: 
-\family typewriter
-rcs -o<version> <file-name>
-\end_layout
+\begin_layout Plain Layout
+Note that this command will work only with subversion 
+\begin_inset Formula $\geqq1.5$
+\end_inset
 
-\begin_layout Subsubsection
 
-\family sans
-Show History
 \end_layout
 
-\begin_layout Standard
-This show the complete history of the RCS document.
- The output of 
-\family typewriter
-rlog <file-name>
-\family default
- is shown in a browser.
- See 
-\family typewriter
-man rlog
-\family default
- for more info.
-\end_layout
+\end_inset
+
 
-\begin_layout Subsection
-CVS commands in LyX
 \end_layout
 
 \begin_layout Standard
-CVS is now partially supported by LyX.
- You can find the commands in the 
-\family sans
-File\SpecialChar \menuseparator
-Version
-\begin_inset space ~
-\end_inset
+All the commands above have one shortcomming - they deal with the current
+ document only.
+ Once your document contains pictures, includes external 
+\begin_inset Flex CharStyle:Code
+status collapsed
 
-Control
-\family default
- submenu.
+\begin_layout Plain Layout
+.tex
 \end_layout
 
-\begin_layout Subsubsection
+\end_inset
 
-\family sans
-Register
-\end_layout
+ files and so on administration becomes more complicated.
+ LyX now supports updating the whole tree in which resides the document
+\begin_inset Foot
+status collapsed
 
-\begin_layout Standard
-If your document is not under revision control, this is the only item shown
- in the menu.
- And if it is under revision control, the 
-\family sans
-\bar under
-R
-\bar default
-egister
-\family default
- item is not visible.
+\begin_layout Plain Layout
+One need to organize the files structure so that all external files are
+ in the same directory or subdirectories of the document.
  
 \end_layout
 
-\begin_layout Standard
-This command registers in CVS your document ONLY in case you have already
- the documents directory under CVS control (in particular 
-\family typewriter
-CVS/Entries
-\family default
- file exists).
- This means you have to checkout the archive by yourself.
+\end_inset
+
+.
+ This become especially useful once you cooperate with people which neither
+ know about subversion management nor they have ambition to commit additional
+ material to the repository.
  
 \end_layout
 
 \begin_layout Standard
-Then you are asked interactively to supply an initial description of the
- document.
- Don't forget that registered file is not yet commited.
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+Update local directory from repository
 \end_layout
 
-\begin_layout Standard
-CVS command that is run: 
-\family typewriter
-cvs -q add -m
-\begin_inset Quotes erd
 \end_inset
 
-<entered message>" 
-\begin_inset Quotes eld
+ command updates the whole directory and in case of merge conflicts local
+ version of the files are left, so no unintended data loss occurs.
+ If local changes are detected user is warned before update starts.
+\end_layout
+
+\begin_layout Labeling
+\labelwidthstring 00.00.0000
+SVN
+\begin_inset space ~
+\end_inset
+
+commands: 
+\begin_inset space ~
+\end_inset
+
+
+\begin_inset Newline newline
 \end_inset
 
-<file-name>
-\begin_inset Quotes erd
-\end_inset
 
+\begin_inset Flex CharStyle:Code
+status collapsed
 
+\begin_layout Plain Layout
+svn diff $path
 \end_layout
 
-\begin_layout Standard
-Read 
-\family typewriter
-man svn
-\family default
- to understand the switches.
-\end_layout
+\end_inset
 
-\begin_layout Subsubsection
+ (Ask if changes are detected.)
+\begin_inset Newline newline
+\end_inset
 
-\family sans
-Check In Changes
-\end_layout
 
-\begin_layout Standard
-When you are finished editing a file, you commit your changes.
- When you do this, you are asked for a description of the changes.
- After that changes are commited.
-\end_layout
+\begin_inset Flex CharStyle:Code
+status collapsed
 
-\begin_layout Standard
-CVS command: 
-\family typewriter
-cvs -q commit -m"<description>" "<file-name>"
+\begin_layout Plain Layout
+svn update --accept mine-full $path
 \end_layout
 
-\begin_layout Subsubsection
+\end_inset
 
-\family sans
-Revert To Repository Version
-\end_layout
 
-\begin_layout Standard
-This will discard all changes made to the document since the last check
- in.
- You get a warning before changes are discarded.
- Firstly the file is deleted, secondly CVS update command is run.
 \end_layout
 
 \begin_layout Standard
-CVS command: 
-\family typewriter
-cvs update 
-\begin_inset Quotes eld
-\end_inset
+where 
+\begin_inset Flex CharStyle:Code
+status collapsed
 
-<file-name>
-\begin_inset Quotes erd
-\end_inset
+\begin_layout Plain Layout
+$path
+\end_layout
 
+\end_inset
 
+ stands for the path to the document.
 \end_layout
 
 \begin_layout Subsubsection
@@ -18158,10 +19224,10 @@ Show History
 \end_layout
 
 \begin_layout Standard
-This show the complete history of the CVS document.
+This show the complete history of the SVN document.
  The output of 
 \family typewriter
-cvs log 
+svn log 
 \begin_inset Quotes eld
 \end_inset
 
@@ -18174,406 +19240,486 @@ cvs log
  is shown in a browser.
 \end_layout
 
-\begin_layout Subsection
-SVN commands in LyX
+\begin_layout Subsubsection
+File Locking
+\begin_inset CommandInset label
+LatexCommand label
+name "subsec:SVN-File-Locking"
+
+\end_inset
+
+
 \end_layout
 
 \begin_layout Standard
-SVN is now partially supported by LyX.
- You can find the commands in the 
-\family sans
-File\SpecialChar \menuseparator
-Version
-\begin_inset space ~
+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
 
-Control
-\family default
- 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.
+) based on 
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+svn:needs-lock
 \end_layout
 
-\begin_layout Subsubsection
+\end_inset
 
-\family sans
-Register
+ 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
 
-\begin_layout Standard
-If your document is not under revision control, this is the only item shown
- in the menu.
- And if it is under revision control, the 
-\family sans
-\bar under
-R
-\bar default
-egister
-\family default
- item is not visible.
+\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 Standard
-This command registers in SVN your document ONLY in case you have already
- the documents directory under SVN control (in particular 
-\family typewriter
-.svn/entries
-\family default
- file exists).
- This means you have to checkout the archive by yourself.
+\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
 
-\begin_layout Standard
-Then you are asked interactively to supply an initial description of the
- document.
- Don't forget that registered file is not yet commited.
+\end_inset
+
+ and only the write-lock will be released.
 \end_layout
 
 \begin_layout Standard
-SVN command that is run: 
+SVN commands:
+\end_layout
+
+\begin_layout Labeling
+\labelwidthstring 00.00.0000
+Check-in:
 \family typewriter
-snv add -q 
-\begin_inset Quotes eld
+ svn commit -q -m"<description>" "<file-name>"
+\begin_inset Newline newline
 \end_inset
 
-<file-name>
-\begin_inset Quotes erd
+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
-Read 
+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
-man svn
-\family default
- to understand the switches.
+svn propdel svn:needs-lock "<file-name>"
 \end_layout
 
 \begin_layout Subsubsection
+\begin_inset CommandInset label
+LatexCommand label
+name "sub:VCS-Revision-Information"
 
-\family sans
-Check In Changes
+\end_inset
+
+Revision Information in Documents
 \end_layout
 
 \begin_layout Standard
-When you are finished editing a file, you commit your changes.
- When you do this, you are asked for a description of the changes.
- After that changes are commited.
+There are more possibilities how to activate revision information in our
+ document.
 \end_layout
 
-\begin_layout Standard
-SVN command:
-\begin_inset Foot
+\begin_layout Itemize
+LyX supports directly:
+\end_layout
+
+\begin_deeper
+\begin_layout Itemize
+tree revision information (
+\begin_inset Flex CharStyle:Code
 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"
+vcs-tree-revision
+\end_layout
 
 \end_inset
 
-.
+).
+ The result is the output of the 
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+svnversion
 \end_layout
 
 \end_inset
 
-\family typewriter
-svn commit -q -m"<description>" <file-name>
+ command, the following table gives you an idea, how to read the results.
 \end_layout
 
-\begin_layout Subsubsection
+\begin_layout Standard
+\align center
+\begin_inset Tabular
+<lyxtabular version="3" rows="6" columns="2">
+<features tabularvalignment="middle">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<row>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
 
-\family sans
-Check Out For Edit
+\begin_layout Plain Layout
+Output
 \end_layout
 
-\begin_layout Standard
-Updates the changes of this file from the repository.
- Be sure you understand SVN merging and conflicts resolving before using
- this function, because all conflicts has to be done manually by you!
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+Meaning
 \end_layout
 
-\begin_layout Standard
-SVN command:
-\begin_inset Foot
-status collapsed
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
 
 \begin_layout Plain Layout
-Ditto.
+4123:4168
 \end_layout
 
 \end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
 
-\family typewriter
-svn update 
-\begin_inset Quotes eld
-\end_inset
+\begin_layout Plain Layout
+mixed revision working copy
+\end_layout
 
-<file-name>
-\begin_inset Quotes erd
 \end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
 
-
+\begin_layout Plain Layout
+4168M
 \end_layout
 
-\begin_layout Subsubsection
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
 
-\family sans
-Revert To Repository Version
+\begin_layout Plain Layout
+modified working copy
 \end_layout
 
-\begin_layout Standard
-This will discard all changes made to the document since the last check
- in.
- You get a warning before changes are discarded.
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+4123S
 \end_layout
 
-\begin_layout Standard
-SVN command: 
-\family typewriter
-svn revert -q 
-\begin_inset Quotes eld
 \end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
 
-<file-name>
-\begin_inset Quotes erd
-\end_inset
+\begin_layout Plain Layout
+switched working copy
+\end_layout
 
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
 
+\begin_layout Plain Layout
+4123P
 \end_layout
 
-\begin_layout Subsubsection
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
 
-\family sans
-Show History
+\begin_layout Plain Layout
+partial working copy, from a sparse checkout
 \end_layout
 
-\begin_layout Standard
-This show the complete history of the SVN document.
- The output of 
-\family typewriter
-svn log 
-\begin_inset Quotes eld
 \end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
 
-<file-name>
-\begin_inset Quotes erd
-\end_inset
+\begin_layout Plain Layout
+4123:4168MS
+\end_layout
 
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
 
-\family default
- is shown in a browser.
+\begin_layout Plain Layout
+mixed revision, modified, switched working copy
 \end_layout
 
-\begin_layout Subsubsection
-File Locking
-\begin_inset CommandInset label
-LatexCommand label
-name "subsec:SVN-File-Locking"
-
 \end_inset
+</cell>
+</row>
+</lyxtabular>
 
+\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_layout Itemize
+file revision information.
+ The result comes from parsing the output of 
 \begin_inset Flex CharStyle:Code
 status collapsed
 
 \begin_layout Plain Layout
-svn:needs-lock
-\end_layout
+svn
+\begin_inset space ~
+\end_inset
 
+info
+\begin_inset space ~
 \end_inset
 
- file svn property
-\begin_inset Foot
-status open
+--xml
+\begin_inset space ~
+\end_inset
 
-\begin_layout Plain Layout
-http://svnbook.red-bean.com/en/1.2/svn.advanced.locking.html
+file.lyx
 \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.
+ Supported flags are:
 \end_layout
 
+\begin_deeper
 \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
+version number of the last commit (
+\begin_inset Flex CharStyle:Code
 status collapsed
 
 \begin_layout Plain Layout
-Don't be puzzled by the fact that you will be asked for commit message anyway.
+vcs-revision
 \end_layout
 
 \end_inset
 
- and only the write-lock will be released.
+)
 \end_layout
 
-\begin_layout Standard
-SVN commands:
+\begin_layout Itemize
+author of the last commit (
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+vcs-author
 \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 Itemize
+date of the last commit (
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+vcs-date
 \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
+\begin_layout Itemize
+time of the last commit (
+\begin_inset Flex CharStyle:Code
+status collapsed
 
-\family typewriter
-\begin_inset CommandInset label
-LatexCommand label
-name "subsec:Automatical-Locking-Property"
+\begin_layout Plain Layout
+vcs-time
+\end_layout
 
 \end_inset
 
-
-\family default
-Automatical Locking Property
+)
 \end_layout
 
+\end_deeper
 \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
+You can obtain this info via InsetInfo (e.g.
+\begin_inset Flex CharStyle:Code
+status collapsed
 
-\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).
+\begin_layout Plain Layout
+info-insert buffer vcs-date
 \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
+).
+ The information will be available only when you have the file stored under
+ svn managment (i.e.
+ the 
+\begin_inset Flex CharStyle:Code
+status collapsed
 
-\begin_layout Labeling
-\labelwidthstring 00.00.0000
-Unset: 
-\family typewriter
-svn propdel svn:needs-lock "<file-name>"
+\begin_layout Plain Layout
+.svn
 \end_layout
 
-\begin_layout Subsubsection
-Revision Information in Documents
-\end_layout
+\end_inset
 
-\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.
+ directory is available with your document).
 \end_layout
 
-\begin_layout Standard
-One possibility is to use svn keywords
+\end_deeper
+\begin_layout Itemize
+Another---a hacking one---possibility is to use svn keywords
 \begin_inset Foot
 status collapsed
 
@@ -18643,32 +19789,7 @@ $Rev: 59 $
  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.
+ this approach reliably or let LyX to support it directly.
 \end_layout
 
 \begin_layout Subsection
@@ -18856,6 +19977,206 @@ Control
  client program from a command prompt.
 \end_layout
 
+\begin_layout Subsubsection
+SSH tunel used with SVN under Windows
+\end_layout
+
+\begin_layout Standard
+Compared to linux setting svn client to communicate over ssh under Windows
+ is rather troublesome task.
+ We will at least make some hints how to setup client side but former knowledge
+ about ssh and Windows command line is needed, also be prepared for a great
+ deal of frustration...
+\end_layout
+
+\begin_layout Enumerate
+Get svn client for windows, as described in previous sections.
+ When it is fresh install run some svn command (e.g.
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+svn --version
+\end_layout
+
+\end_inset
+
+) to have created config files, which you will need to change later on.
+\end_layout
+
+\begin_layout Enumerate
+Choose ssh client for Windows.
+ There are more possibilities, we will use the one from Putty tools
+\begin_inset Foot
+status collapsed
+
+\begin_layout Plain Layout
+\begin_inset Flex URL
+status collapsed
+
+\begin_layout Plain Layout
+
+http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\end_inset
+
+.
+ You will need to automatize connection, so client doesn't ask for any password
+ from you.
+ To keep things easy we will use only keys without any additional password
+ protection etc.
+\end_layout
+
+\begin_deeper
+\begin_layout Enumerate
+Generate keys by 
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+puttygen
+\end_layout
+
+\end_inset
+
+.
+ Save your private .ppk key file and put the public one on the server side.
+ In case the SVN server runs on linux, note that the format of the public
+ key is not compatible with linux openssh and you will need to direcly copy-past
+e the key from the “
+\emph on
+Public key for pasting into OpenSSH authorized_keys file
+\emph default
+:” edit field into the server's 
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+~/.ssh/authorized_keys
+\end_layout
+
+\end_inset
+
+/ 
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+authorized_keys2
+\end_layout
+
+\end_inset
+
+ file.
+\end_layout
+
+\begin_layout Enumerate
+Get the Putty's 
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+plink
+\end_layout
+
+\end_inset
+
+.
+ In the SVN config file
+\begin_inset Foot
+status collapsed
+
+\begin_layout Plain Layout
+Exact path depends on Windows version, usually somewhere around 
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+c:
+\backslash
+Documents and Settings
+\backslash
+user
+\backslash
+Application Data
+\backslash
+Subversion
+\backslash
+config
+\end_layout
+
+\end_inset
+
+ / 
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+AppData
+\backslash
+Roaming
+\backslash
+Subversion
+\end_layout
+
+\end_inset
+
+.
+\end_layout
+
+\end_inset
+
+, section [tunnels], setup ssh command, e.g.
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+ssh=c:/path/plink.exe -i c:/path/private_key.ppk
+\end_layout
+
+\end_inset
+
+.
+\begin_inset Foot
+status collapsed
+
+\begin_layout Plain Layout
+It will usually take a lot of time to get exact command right and it depends
+ on many things.
+ For example do not have some remote server saved as a default session in
+ Putty etc.
+ If things fail, try to connect via plink without SVN first.
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\end_deeper
+\begin_layout Enumerate
+Checkout the SVN archive, e.g.
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+svn co svn+ssh://user@server/repository_path
+\end_layout
+
+\end_inset
+
+.
+\end_layout
+
 \begin_layout Subsection
 Further tuning
 \end_layout