]> git.lyx.org Git - lyx.git/blobdiff - lib/doc/Development.lyx
UserGuide: "Toggle Inversion" -> "Invert Inset"
[lyx.git] / lib / doc / Development.lyx
index 75782705cf7fc0d5b00bf49e167c2e5e9ae53b22..3f0d490b9a3ad891ee05ad72fffd3239cd765f1e 100644 (file)
@@ -1,5 +1,5 @@
 #LyX 2.2 created this file. For more info see http://www.lyx.org/
-\lyxformat 504
+\lyxformat 508
 \begin_document
 \begin_header
 \save_transient_properties true
@@ -27,7 +27,7 @@ logicalmkup
 \font_tt_scale 100 100
 \graphics default
 \default_output_format pdf2
-\output_sync 0
+\output_sync 1
 \bibtex_command default
 \index_command default
 \paperfontsize 12
@@ -161,12 +161,13 @@ development
  This document is not translated, since the development language of \SpecialChar LyX
  is
  English.
- If you want to use \SpecialChar LyX
- you don't need to read this manual.
+ If you just want to use \SpecialChar LyX
+, then you don't need to read this manual.
  However, if you want to learn more about how \SpecialChar LyX
  is developed, or even want
  to participate in \SpecialChar LyX
- development, you may find some interesting information.
+ development, you may find some interesting information
+ here.
 \end_layout
 
 \begin_layout Section
@@ -200,6 +201,16 @@ name "sec:When-is-an"
 When you are working on a new feature you may ask yourself whether it needs
  an update of the .lyx file format number.
  Whether an update is needed or not is not always obvious.
+ Rule of thumb: 
+\end_layout
+
+\begin_layout Quote
+Whenever there is the danger that a previous version of LyX cannot open
+ a file using the new feature, a file format update is needed.
+\end_layout
+
+\begin_layout Standard
+The file format change allows lyx2lyx rules to implement backwards compatibility.
  Below you can find a list of reasons for file format updates with explanations:
 \end_layout
 
@@ -214,28 +225,6 @@ document
 
 setting Whenever you introduce a new setting that is stored in the document
  header, a file format update is needed.
- This is also true if you add a new valid value to an existing setting,
- e.
-\begin_inset space \thinspace{}
-\end_inset
-
-g.
-\begin_inset space \space{}
-\end_inset
-
-a new language that is stored in 
-\begin_inset Flex Code
-status collapsed
-
-\begin_layout Plain Layout
-
-\backslash
-language
-\end_layout
-
-\end_inset
-
-.
 \end_layout
 
 \begin_layout Description
@@ -256,22 +245,36 @@ New
 \begin_inset space ~
 \end_inset
 
-inset Of course a new inset requires a file format update.
-\end_layout
+valid
+\begin_inset space ~
+\end_inset
 
-\begin_layout Description
-New
+value
 \begin_inset space ~
 \end_inset
 
-style in any layout file or module shipped with \SpecialChar LyX
-, or new shipped layout
- file or module.
- These requirements are currently under discussion and might change in the
- future.
+for
+\begin_inset space ~
+\end_inset
+
+an
+\begin_inset space ~
+\end_inset
+
+existing
+\begin_inset space ~
+\end_inset
+
+setting, e.
+\begin_inset space \thinspace{}
+\end_inset
+
+g.
 \end_layout
 
+\begin_deeper
 \begin_layout Description
+\paragraph_spacing single
 Automatically
 \begin_inset space ~
 \end_inset
@@ -284,12 +287,11 @@ math
 \begin_inset space ~
 \end_inset
 
-package Any new math package that is automatically loaded needs a file format
- update.
- The reason for this is that there is no true ERT inset for math formulas:
- Each command is parsed, and if a user happens to define a local command
- with the same name as a command that triggers an automatic load of a package,
- he needs to be able to switch off the automatic loading of that package.
+package The reason for this is that there is no true ERT inset for math
+ formulas: Each command is parsed, and if a user happens to define a local
+ command with the same name as a command that triggers an automatic load
+ of a package, they need to be able to switch off the automatic loading
+ of that package.
  This switch is stored by the 
 \begin_inset Flex Code
 status collapsed
@@ -303,23 +305,113 @@ use_package
  header setting.
 \end_layout
 
+\begin_layout Description
+New
+\begin_inset space ~
+\end_inset
+
+language that is stored in 
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+
+\backslash
+language
+\end_layout
+
+\end_inset
+
+.
+\begin_inset Note Note
+status collapsed
+
+\begin_layout Plain Layout
+This requirement is under discussion.
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\end_deeper
+\begin_layout Description
+New
+\begin_inset space ~
+\end_inset
+
+inset Of course a new inset requires a file format update.
+\end_layout
+
+\begin_layout Description
+New
+\begin_inset space ~
+\end_inset
+
+style If a new style or inset layout is added to any layout file or module
+ shipped with \SpecialChar LyX
+, then a new file format is needed in the master (development)
+ branch.
+ It is possible to backport new styles to the stable version without a file
+ format change.
+ See 
+\begin_inset CommandInset ref
+LatexCommand ref
+reference "subsec:Backporting-new-styles"
+
+\end_inset
+
+ for more information.
+\end_layout
+
+\begin_layout Description
+Removed
+\begin_inset space ~
+\end_inset
+
+style If a style or inset layout is removed in any layout file or module
+ shipped with \SpecialChar LyX
+, a new file format is required.
+\end_layout
+
+\begin_layout Standard
+However, 
+\series bold
+new
+\series default
+ layouts and modules do 
+\series bold
+not
+\series default
+ require a file format update (changed 03/16, see 
+\begin_inset CommandInset ref
+LatexCommand ref
+reference "subsec:New-layouts"
+
+\end_inset
+
+).
+\end_layout
+
 \begin_layout Standard
 If you are still unsure, please ask on the development list.
 \end_layout
 
 \begin_layout Subsection
-How to update the file format number of .lyx files
 \begin_inset CommandInset label
 LatexCommand label
 name "subsec:update_lyx_files"
 
 \end_inset
 
-
+How to update the file format number of .lyx files
 \end_layout
 
 \begin_layout Standard
-Once you came to the conclusion that a file format update is needed you
+Once you come to the conclusion that a file format update is needed, you
  should use the following procedure to perform the update:
 \end_layout
 
@@ -332,6 +424,12 @@ Implement and test the new feature, including the reading and writing of
 \end_layout
 
 \begin_layout Enumerate
+\begin_inset CommandInset label
+LatexCommand label
+name "enu:Describe_format"
+
+\end_inset
+
 Describe the new format in 
 \begin_inset Flex Code
 status collapsed
@@ -385,6 +483,12 @@ lib/lyx2lyx/LyX.py
 \end_layout
 
 \begin_layout Enumerate
+\begin_inset CommandInset label
+LatexCommand label
+name "enu:Add-an-entry"
+
+\end_inset
+
 Add an entry to both format lists (for conversion and reversion) in
 \begin_inset Newline newline
 \end_inset
@@ -394,7 +498,7 @@ Add an entry to both format lists (for conversion and reversion) in
 status collapsed
 
 \begin_layout Plain Layout
-lib/lyx2lyx/lyx_2_2.py
+lib/lyx2lyx/lyx_2_3.py
 \end_layout
 
 \end_inset
@@ -404,22 +508,23 @@ lib/lyx2lyx/lyx_2_2.py
 \begin_inset space \thinspace{}
 \end_inset
 
-g.
-\begin_inset space \space{}
+g., a new header setting always needs a conversion that adds the new setting,
+ but a new document language does not need one).
+ Add a reversion routine if needed.
+\begin_inset Newline newline
 \end_inset
 
-a new header setting always needs a conversion that adds the new setting,
- a new document language does not need one).
- Add a reversion routine if needed.
- While the conversion routine is required to produce a document that is
- equivalent to the old version, the requirements of the reversion are not
- that strict.
+While the conversion routine is required to produce a document that is equivalen
+t to the old version, the requirements of the reversion are not that strict.
  If possible, try to produce a proper reversion, using ERT if needed, but
  for some features this might be too complicated.
  In this case, the minimum requirement of the reversion routine is that
  it produces a valid document which can be read by an older \SpecialChar LyX
 .
  If absolutely needed, even data loss is allowed for the reversion.
+ (In that case, you might want to add a LyX comment that indicates what
+ you have had to do, so the user is at least warned).
 \end_layout
 
 \begin_layout Enumerate
@@ -432,10 +537,6 @@ Since tex2lyx has several implicit file format dependencies caused by sharing
  format numbers differ.
  In many cases the tex2lyx update requires only the first and last item
  of the list below:
-\begin_inset Separator parbreak
-\end_inset
-
-
 \end_layout
 
 \begin_deeper
@@ -474,7 +575,7 @@ reference "sec:Updating-test-references"
 
 \end_deeper
 \begin_layout Enumerate
-If you did not implement full tex2lyx support of the new feature, add a
+If you did not implement full tex2lyx support for the new feature, add a
  line to 
 \begin_inset Flex Code
 status collapsed
@@ -491,15 +592,16 @@ src/tex2lyx/TODO.txt
  syntax of the produced .lyx file.
  It is no problem if some features supported by \SpecialChar LyX
  are still output as ERT
- by tex2lyx, since the problems in the past that resulted in the update
- recommendation were related to mixed version syntax, not ERT.
+ by tex2lyx.
+ The problems in the past that resulted in the update recommendation were
+ related to mixed version syntax, not ERT.
 \end_layout
 
 \begin_layout Enumerate
 It would be nice if you could create a .lyx test file which contains instances
  of all changed or added features.
  This could then be used to test lyx2lyx and tex2lyx.
- Unfortunately it has not yet been decided how to collect such examples,
+ Unfortunately, it has not yet been decided how to collect such examples,
  so please ask on the development list if you want to create one.
 \end_layout
 
@@ -515,7 +617,7 @@ Update LyX's .lyx documentation files to the new format.
  inspecting the resulting diff.
  Because of this, you might be able to catch a bug in the lyx2lyx code that
  updates the format just by taking a quick scan through the large diff that
- is the result
+ is the result.
 \begin_inset Note Note
 status collapsed
 
@@ -527,7 +629,6 @@ Another advantage is that if later we suspect a bug in lyx2lyx we can easily
 
 \end_inset
 
-.
  To do this, first make sure that there are no changes to the git repository
  that you will not want to commit (this is needed because it will be convenient
  to commit with the command 
@@ -552,7 +653,19 @@ python development/tools/updatedocs.py
 \end_inset
 
 .
- Then, revert the change to 
+ Look at the resulting changes using the command 
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+git diff
+\end_layout
+
+\end_inset
+
+.
+ If anything looks surprising, please investigate.
+ Keep in mind that the case of 
 \begin_inset Flex Code
 status collapsed
 
@@ -562,158 +675,893 @@ LFUNs.lyx
 
 \end_inset
 
- because that file is meant to be generated separately: 
+ is special, because it is first generated with 
 \begin_inset Flex Code
 status collapsed
 
 \begin_layout Plain Layout
-git checkout lib/doc/LFUNs.lyx
+gen_lfuns.py
 \end_layout
 
 \end_inset
 
+ before being converted to the latest format.
+ Finally, commit using 
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+git commit -a
+\end_layout
+
+\end_inset
 
-\begin_inset Note Note
+.
+\end_layout
+
+\begin_layout Subsection
+Updating the file format number of layout files
+\end_layout
+
+\begin_layout Standard
+The procedure for updating the layout files is similar to that in step 
+\begin_inset CommandInset ref
+LatexCommand ref
+reference "enu:updatefiles"
+
+\end_inset
+
+ in section 
+\begin_inset CommandInset ref
+LatexCommand ref
+reference "subsec:update_lyx_files"
+
+\end_inset
+
+.
+ One need only run 
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+python development/tools/updatelayouts.py
+\end_layout
+
+\end_inset
+
+ instead of 
+\begin_inset Flex Code
 status collapsed
 
 \begin_layout Plain Layout
-TODO: this step should be done within updatedocs.py
+updatedocs.py
 \end_layout
 
 \end_inset
 
 .
- Look at the resulting changes using the command 
+\end_layout
+
+\begin_layout Standard
+Note that we do not automatically any local layout used in the 
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+.lyx
+\end_layout
+
+\end_inset
+
+ files shipped with \SpecialChar LyX
+ because users would then not be able to export to older
+ formats.
+ For example, if a 2.2.0 user exported a template to 2.1.x format and tried
+ to open the file in \SpecialChar LyX
+ 2.1.x, there would be an error because the file would
+ contain a local layout whose format is too new.
+ The root reason for this is that we do not support converting layouts to
+ older layout formats, as we do for the 
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+.lyx
+\end_layout
+
+\end_inset
+
+ file format.
+\end_layout
+
+\begin_layout Subsection
+Updating the file format number of bind/ui files
+\end_layout
+
+\begin_layout Standard
+A change to the functionality of existing LFUNs can require a conversion
+ of 
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+.bind
+\end_layout
+
+\end_inset
+
+ and 
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+.ui
+\end_layout
+
+\end_inset
+
+ files, and therefore an increment of the LFUN format, as well as a conversion
+ of Info insets in 
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+.lyx
+\end_layout
+
+\end_inset
+
+ files for manuals.
+ The latter cannot be done automatically and also requires an update of
+ the \SpecialChar LyX
+ file format.
+ (Think e.g.
+\begin_inset space \space{}
+\end_inset
+
+of someone who might have made a set of \SpecialChar LyX
+ teaching manuals for use in their
+ own group.)
+\begin_inset Foot
+status open
+
+\begin_layout Plain Layout
+\begin_inset Flex URL
+status open
+
+\begin_layout Plain Layout
+
+http://www.lyx.org/trac/ticket/9794
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+To update the LFUN format:
+\end_layout
+
+\begin_layout Enumerate
+Increment the LFUN file format number in 
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+src/LyXAction.h
+\end_layout
+
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Enumerate
+Implement the LFUN conversion in 
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+lib/scripts/prefs2prefs_lfuns.py
+\end_layout
+
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Enumerate
+See step 
+\begin_inset CommandInset ref
+LatexCommand ref
+reference "enu:updatefiles"
+
+\end_inset
+
+ in section 
+\begin_inset CommandInset ref
+LatexCommand ref
+reference "subsec:update_lyx_files"
+
+\end_inset
+
+ but instead of the 
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+updatedocs.py
+\end_layout
+
+\end_inset
+
+ command, use this command: 
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+bash development/tools/updatelfuns.sh
+\end_layout
+
+\end_inset
+
+.
+\begin_inset Note Note
+status open
+
+\begin_layout Plain Layout
+This file should really be converted to python.
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Enumerate
+Update Info insets in 
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+.lyx
+\end_layout
+
+\end_inset
+
+ files.
+ To do so, increment the \SpecialChar LyX
+ format and proceed as in 
+\begin_inset CommandInset ref
+LatexCommand ref
+reference "subsec:update_lyx_files"
+
+\end_inset
+
+, steps 
+\begin_inset CommandInset ref
+LatexCommand ref
+reference "enu:Describe_format"
+
+\end_inset
+
+–
+\begin_inset CommandInset ref
+LatexCommand ref
+reference "enu:updatefiles"
+
+\end_inset
+
+.
+ In the lyx2lyx implementation (step 
+\begin_inset CommandInset ref
+LatexCommand ref
+reference "enu:Add-an-entry"
+
+\end_inset
+
+), implement a conversion similar to the one in 
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+prefs2prefs_lfuns.py
+\end_layout
+
+\end_inset
+
+ above, as well as a corresponding reversion; for this one can use 
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+convert_info_insets
+\end_layout
+
+\end_inset
+
+ from 
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+lib/lyx2lyx/lyx2lyx_tools.py
+\end_layout
+
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Subsection
+Backporting new styles to the stable version
+\begin_inset CommandInset label
+LatexCommand label
+name "subsec:Backporting-new-styles"
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+Starting with the stable \SpecialChar LyX
+ 2.1 branch, there is a mechanism in place to backport
+ new styles to the stable version without the need to update the file format.
+ The basic idea is that the new style definition is automatically copied
+ to the document preamble so that it can even be used by older minor versions
+ that did not yet include the style.
+ To backport a new style to the stable version, the following steps are
+ needed:
+\end_layout
+
+\begin_layout Enumerate
+Add the line 
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+ForceLocal -1
+\end_layout
+
+\end_inset
+
+ to the style definition in the development version.
+\end_layout
+
+\begin_layout Enumerate
+Copy the style definition to the stable version, but use 
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+ForceLocal 1
+\end_layout
+
+\end_inset
+
+ instead.
+ If needed adjust the format to the one used by the stable version (see
+ the customization manual for details of the layout file format).
+\end_layout
+
+\begin_layout Enumerate
+For each update of the style in a later stable version, increase the argument
+ of 
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+ForceLocal
+\end_layout
+
+\end_inset
+
+ by one.
+ (In the stable version, the development version should not be touched.)
+\end_layout
+
+\begin_layout Standard
+For details about the 
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+ForceLocal
+\end_layout
+
+\end_inset
+
+ flag see the customization manual.
+ No 
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+lyx2lyx
+\end_layout
+
+\end_inset
+
+ support is needed for backported styles: Since the style of the development
+ version has an infinite version number, it will always be used.
+ Furthermore, since its version number is less than one, the style will
+ not be written anymore to the document header for files saved by the new
+ version.
+\end_layout
+
+\begin_layout Section
+New layouts and modules
+\end_layout
+
+\begin_layout Standard
+\begin_inset Note Greyedout
+status open
+
+\begin_layout Description
+Note: This section is currently only a proposal under discussion.
+ Please correct/amend as suited.
+ Remove this note once a consensus is found.
+\end_layout
+
+\begin_layout Plain Layout
+See the thread 
+\begin_inset Quotes eld
+\end_inset
+
+Proposal for a guide on updating layouts
+\begin_inset Quotes erd
+\end_inset
+
+ for details and background
+\end_layout
+
+\begin_layout Plain Layout
+http://permalink.gmane.org/gmane.editors.lyx.devel/161126 
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Subsection
+\begin_inset CommandInset label
+LatexCommand label
+name "subsec:New-layouts"
+
+\end_inset
+
+New layouts
+\end_layout
+
+\begin_layout Standard
+Adding a new layout file to the \SpecialChar LyX
+ library makes it an 
+\begin_inset Quotes eld
+\end_inset
+
+officially supported
+\begin_inset Quotes erd
+\end_inset
+
+ layout.
+ You should therefore think carefully about whether you really want to do
+ this and discuss it on lyx-devel, since you will need to be prepared to
+ update and fix the layout if necessary.
+ If the layout is experimental or for a rarely used document class, then
+ it may be better to add it to the relevant portion of the \SpecialChar LyX
+ wiki, as a user
+ contribution.
+ See 
+\begin_inset CommandInset href
+LatexCommand href
+target "https://wiki.lyx.org/Layouts/Layouts"
+
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+In older versions of this document, it was stated that new layout files
+ require a file format change.
+ After some discussion it was decided that this is not needed.
+\begin_inset Foot
+status open
+
+\begin_layout Plain Layout
+See 
+\begin_inset CommandInset href
+LatexCommand href
+name "the thread “Proposal for a guide on updating layouts”"
+target "http://permalink.gmane.org/gmane.editors.lyx.devel/161202"
+
+\end_inset
+
+.
+\end_layout
+
+\end_inset
+
+\end_layout
+
+\begin_layout Quote
+For reference, here are the arguments on each side
+\end_layout
+
+\begin_deeper
+\begin_layout Description
+Pro 
+\begin_inset Quotes eld
+\end_inset
+
+New layout files are a file format change
+\begin_inset Quotes erd
+\end_inset
+
+
+\end_layout
+
+\begin_layout Itemize
+All documents produced by 2.2.
+\begin_inset Formula $x$
+\end_inset
+
+ can always be edited and exported even if 
+\begin_inset Formula $x$
+\end_inset
+
+ is different.
+ This is important for people using different machines, or exchanging work
+ with colleagues.
+\end_layout
+
+\begin_layout Description
+Con 
+\begin_inset Quotes eld
+\end_inset
+
+New layout files are not a file format change
+\begin_inset Quotes erd
+\end_inset
+
+
+\end_layout
+
+\begin_layout Itemize
+No new LaTeX classes can be supported in a stable version, and stable versions
+ have a typical lifetime of 2–3 years.
+\end_layout
+
+\begin_layout Itemize
+We have the same situation already with custom layout files: If a document
+ using a custom layout file is moved between machines or people, then the
+ layout file needs to be exchanged as well.
+ If that is not done, then we have a fallback implemented so that such documents
+ can still be edited, but not exported, and the user gets a warning.
+\end_layout
+
+\begin_layout Itemize
+The lyx2lyx script cannot do anything useful in such a case.
+\end_layout
+
+\end_deeper
+\begin_layout Standard
+If you have decided that you are going to add a new layout file to \SpecialChar LyX
+ itself,
+ then, you should do the following:
+\end_layout
+
+\begin_layout Enumerate
+Put your new layout file in 
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+lib/layouts/
+\end_layout
+
+\end_inset
+
+ and add it to Git (
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+git add lib/layouts/newlayout.layout
+\end_layout
+
+\end_inset
+
+) so that it will be committed.
+\end_layout
+
+\begin_layout Enumerate
+Add an entry in 
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+lib/Makefile.am
+\end_layout
+
+\end_inset
+
+, so that the new layout actually gets installed.
+\end_layout
+
+\begin_layout Enumerate
+Add an entry in 
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+lib/doc/LaTeXConfig.lyx
+\end_layout
+
+\end_inset
+
+ containing in particular a line like 
+\end_layout
+
+\begin_deeper
+\begin_layout Quote
+Found: [InsetInfo] 
+\end_layout
+
+\begin_layout Standard
+where [InsetInfo] is obtained by entering in the minibuffer (Alt+X) 
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+info-insert textclass <name>
+\end_layout
+
+\end_inset
+
+.
+ This inset will automatically display a boxed 
+\begin_inset Quotes eld
+\end_inset
+
+yes
+\begin_inset Quotes erd
+\end_inset
+
+ or 
+\begin_inset Quotes eld
+\end_inset
+
+no
+\begin_inset Quotes erd
+\end_inset
+
+ depending on the availability of the package.
+\end_layout
+
+\end_deeper
+\begin_layout Enumerate
+A template or example is strongly encouraged (but not necessarily required).
+ It is also possible to provide both.
+ Add them to 
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+lib/templates/
+\end_layout
+
+\end_inset
+
+ or 
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+lib/examples/
+\end_layout
+
+\end_inset
+
+, respectively.
+\end_layout
+
+\begin_layout Enumerate
+Reconfigure \SpecialChar LyX
+.
+\end_layout
+
+\begin_layout Enumerate
+Ensure the autotests for the new layout pass (see 
+\begin_inset CommandInset ref
+LatexCommand ref
+reference "par:when-to-run-an-export-test"
+
+\end_inset
+
+).
+\end_layout
+
+\begin_layout Subsection
+New modules
+\end_layout
+
+\begin_layout Standard
+Adding a new module is very similar to adding a new layout.
+ Therefore, the previous section applies to new modules as well, with two
+ exceptions: 
+\end_layout
+
+\begin_layout Enumerate
+You only need to add an entry to 
 \begin_inset Flex Code
 status collapsed
 
 \begin_layout Plain Layout
-git diff
+lib/doc/LaTeXConfig.lyx
 \end_layout
 
 \end_inset
 
-.
- If anything looks surprising, please investigate.
- Finally, commit using 
+ if the module requires a LaTeX package.
+ In that case, the command for entering the InsetInfo is: 
 \begin_inset Flex Code
 status collapsed
 
 \begin_layout Plain Layout
-git commit -a
+\paragraph_spacing single
+info-insert package <name>
 \end_layout
 
 \end_inset
 
-.
+
+\end_layout
+
+\begin_layout Enumerate
+Modules do not need a template, only an example, which is strongly encouraged
+ but not necessarily required.
 \end_layout
 
 \begin_layout Subsection
-Updating the file format number of layout files
+Layouts for document classes with incompatible versions
 \end_layout
 
 \begin_layout Standard
-See step 
-\begin_inset CommandInset ref
-LatexCommand ref
-reference "enu:updatefiles"
-
-\end_inset
-
- in section 
-\begin_inset CommandInset ref
-LatexCommand ref
-reference "subsec:update_lyx_files"
-
-\end_inset
-
- but instead of the 
-\begin_inset Flex Code
+Every now and then, there are changes to LaTeX document classes that break
+ backwards compatibility.
+\begin_inset Foot
 status collapsed
 
 \begin_layout Plain Layout
-updatedocs.py
+Uwe has suggested we implement automatic detection of changes in class files.
+ This could be done by running a script every month that checks if a document
+ class was changed at CTAN and at the homepages of the scientific journals.
+ If it reports a change, we can check if our template and layout file are
+ still usable with the changed document class.
+ (This is different from the autotests insofar, as this would also catch
+ changes that do not result in compilation errors.)
 \end_layout
 
 \end_inset
 
- command, use this command: 
+ Reasons can be a new name for the 
 \begin_inset Flex Code
 status collapsed
 
 \begin_layout Plain Layout
-python development/tools/updatelayouts.py
+*.cls
 \end_layout
 
 \end_inset
 
-.
+ file, removed \SpecialChar LaTeX
+ commands, or both.
+ How should this best be handled in \SpecialChar LyX
+? 
 \end_layout
 
 \begin_layout Standard
-Note that we do not update the local layout of our 
+The idea is to support the new version with a new \SpecialChar LyX
+ layout so that:
+\end_layout
+
+\begin_layout Itemize
+Existing documents can still be opened in \SpecialChar LyX
+ and will continue to work on
+ systems where the old version is still installed.
+\end_layout
+
+\begin_layout Itemize
+With differently named 
 \begin_inset Flex Code
 status collapsed
 
 \begin_layout Plain Layout
-.lyx
+*.cls
 \end_layout
 
 \end_inset
 
- files because users would then not be able to export to older formats.
- For example, if a 2.2.0 user exported a template to 2.1.x format and tried
- to open the file in LyX 2.1.x, there would be an error because the file would
- contain a local layout whose format is too new.
- The root reason for this is that we do not support converting layouts to
- older layout formats, as we do for the 
-\begin_inset Flex Code
+ files, \SpecialChar LyX
+ can check for the availability of the particular version and reflect
+ this in the GUI.
+ Different document class versions with the same file name are currently
+ (2.2.x) not detected by the configuration script.
+ This is planned for 2.3.
+\begin_inset Foot
 status collapsed
 
 \begin_layout Plain Layout
-.lyx
+https://www.mail-archive.com/lyx-devel@lists.lyx.org/msg192467.html
 \end_layout
 
-\end_inset
-
- file format.
+\begin_layout Plain Layout
+However, what we really need is version detection for the configuration,
+ so that the user can be warned if the required class file has the wrong
+ version.
+ (If the class file keeps the name over the version change, only one of
+ the two layout files generates compilable documents.)
 \end_layout
 
-\begin_layout Subsection
-Updating the file format number of bind/ui files
+\begin_layout Plain Layout
+This point was also made here: http://permalink.gmane.org/gmane.editors.lyx.devel/143
+798 
 \end_layout
 
-\begin_layout Standard
-See step 
-\begin_inset CommandInset ref
-LatexCommand ref
-reference "enu:updatefiles"
-
 \end_inset
 
- in section 
+
+\end_layout
+
+\begin_layout Itemize
+The new layout can be added both to the master and the stable branches,
+ in accord with the policy discussed in 
 \begin_inset CommandInset ref
-LatexCommand ref
-reference "subsec:update_lyx_files"
+LatexCommand formatted
+reference "subsec:New-layouts"
 
 \end_inset
 
- but instead of the 
-\begin_inset Flex Code
-status collapsed
+.
+ No lyx2lyx conversion is then required when a new major version is released.
+\end_layout
 
-\begin_layout Plain Layout
-updatedocs.py
+\begin_layout Standard
+The user can move an existing document to the new version simply by selecting
+ a new document class.
+ This step is well supported by \SpecialChar LyX
+, with established methods for handling
+ unsupported styles and other changes.
+ This way, no lyx2lyx code is required.
 \end_layout
 
-\end_inset
+\begin_layout Standard
+The steps to support a new version of an existing document class are thus:
+\end_layout
 
- command, use this command: 
+\begin_layout Itemize
+Create a new layout file including the upstream version in the name (avoid
+ special characters like spaces and dots), e.g.
 \begin_inset Flex Code
 status collapsed
 
 \begin_layout Plain Layout
-bash development/tools/updatelfuns.sh
+acmsiggraph-v0-92.layout
 \end_layout
 
 \end_inset
@@ -721,95 +1569,135 @@ bash development/tools/updatelfuns.sh
 .
 \end_layout
 
-\begin_layout Subsection
-Backporting new styles to the stable version
-\end_layout
+\begin_layout Itemize
+Include the name of the 
+\begin_inset Flex Code
+status collapsed
 
-\begin_layout Standard
-Starting with the stable \SpecialChar LyX
- 2.1 branch, there is a mechanism in place to backport
- new styles to the stable version without the need to update the file format.
- The basic idea is that the new style definition is automatically copied
- to the document preamble, so that it can even be used by older minor revisions
- that did not yet include the style.
- To backport a new style to the stable version, the following steps are
- needed:
+\begin_layout Plain Layout
+*.cls
 \end_layout
 
-\begin_layout Enumerate
-Add the line 
+\end_inset
+
+ file as an optional argument in the 
 \begin_inset Flex Code
 status collapsed
 
 \begin_layout Plain Layout
-ForceLocal -1
+
+\backslash
+DeclareLaTeXClass
 \end_layout
 
 \end_inset
 
- to the style definition in the development version.
-\end_layout
+ line and include the version number in the GUI name:
+\begin_inset Newline newline
+\end_inset
+
 
-\begin_layout Enumerate
-Copy the style definition to the stable version, but use 
 \begin_inset Flex Code
 status collapsed
 
 \begin_layout Plain Layout
-ForceLocal 1
+
+\backslash
+DeclareLaTeXClass[acmsiggraph]{ACM SIGGGRAPH (v.
+\begin_inset space ~
+\end_inset
+
+0.92)}
 \end_layout
 
 \end_inset
 
- instead.
- If needed adjust the format to the one used by the stable version (see
- the customization manual for details of the layout file format).
+
 \end_layout
 
-\begin_layout Enumerate
-For each update of the style in a later stable version, increase the argument
- of 
+\begin_layout Itemize
+Update the GUI name in the old layout file (whose name should not be changed),
+ e.g.:
+\begin_inset Newline newline
+\end_inset
+
+
 \begin_inset Flex Code
 status collapsed
 
 \begin_layout Plain Layout
-ForceLocal
+
+\backslash
+DeclareLaTeXClass{ACM SIGGRAPH (<= v.
+\begin_inset space ~
+\end_inset
+
+0.91, obsolete)}
 \end_layout
 
 \end_inset
 
- by one (in the stable version, the development version should not be touched).
+
 \end_layout
 
-\begin_layout Standard
-For details about the 
+\begin_layout Itemize
+To avoid duplicate definitions, the new layout can 
 \begin_inset Flex Code
 status collapsed
 
 \begin_layout Plain Layout
-ForceLocal
+Input
 \end_layout
 
 \end_inset
 
- flag see the customization manual.
- No 
+ the old layout file and add\SpecialChar breakableslash
+remove\SpecialChar breakableslash
+obsolete\SpecialChar breakableslash
+modify settings and styles (similar
+ to the inclusion of 
 \begin_inset Flex Code
 status collapsed
 
 \begin_layout Plain Layout
-lyx2lyx
+*.inc
 \end_layout
 
 \end_inset
 
- support is needed for backported styles: Since the style of the development
- version has an infinite version number, it will always be used.
- Furthermore, since its version number is less than one, the style will
- not be written anymore to the document header for files saved by the new
- version.
+ files).
+\end_layout
+
+\begin_deeper
+\begin_layout Standard
+It may be tempting to let the new layout be the 
+\begin_inset Quotes eld
+\end_inset
+
+master version
+\begin_inset Quotes erd
+\end_inset
+
+ and have the old layout import it.
+ However, this should not be done because any changes to the new layout
+ would need undo steps in the importing old layout.
+\end_layout
+
+\end_deeper
+\begin_layout Itemize
+If the new LaTeX document class obsoletes the old one, update the example
+ and template files to use the new layout.
+ Add a note about the changes (preferably with a pointer to the documentation
+ of the changes).
+\end_layout
+
+\begin_deeper
+\begin_layout Standard
+This way, new documents based on the template or example will use the up-to-date
+ document class version.
 \end_layout
 
+\end_deeper
 \begin_layout Standard
 \begin_inset Newpage newpage
 \end_inset
@@ -1379,11 +2267,17 @@ status collapsed
 \end_inset
 
  command line option.
- The test checks for errors reported by LyX (However, error-free export
- is no guarantee for an error-free output document.)
+ The tests checks for errors reported by LyX.
(However, error-free export is no guarantee for an error-free output document.)
 \end_layout
 
 \begin_layout Paragraph
+\begin_inset CommandInset label
+LatexCommand label
+name "par:when-to-run-an-export-test"
+
+\end_inset
+
 Expectations of LyX developers
 \end_layout
 
@@ -1401,6 +2295,67 @@ When making a non-trivial change to a .layout file, run the export and layout
 \begin_layout Itemize
 When making non-trivial changes to a .lyx file, run the export tests correspondin
 g to that .lyx file.
+\begin_inset Foot
+status collapsed
+
+\begin_layout Plain Layout
+This rule is due to revision.
+\end_layout
+
+\begin_layout Plain Layout
+There is an objection from the documentation maintainer that working on
+ the documentation must not be complicated by having to consider non-standard
+ exports.
+\end_layout
+
+\begin_layout Itemize
+successful compiling/testing an edited documentation file with pdflatex
+ suffices to ensure it can be commited, not tests with other exports are
+ required.
+\end_layout
+
+\begin_layout Plain Layout
+If sudden failures with other exports due to “half-tested” documentation
+ updates are a problem for the test maintainer, the test suite should use
+ copies that are 
+\end_layout
+
+\begin_layout Itemize
+copied to a cache dir (autotests/samples/doc/, say) but not changed,
+\end_layout
+
+\begin_layout Itemize
+updated regularely (but on a time chosen by the test suite maintainer) from
+ the originals in lib/doc/
+\end_layout
+
+\begin_layout Plain Layout
+This way, 
+\end_layout
+
+\begin_layout Itemize
+no test will fail due to ongoing work on documentation,
+\end_layout
+
+\begin_layout Itemize
+the documentation is still tested in full (with some delay),
+\end_layout
+
+\begin_layout Itemize
+failures with non-default export can be examined and handled accordingly
+ in one run with the cache update,
+\end_layout
+
+\begin_layout Itemize
+“interesting failures” (like the nested-language+polyglossia problem in
+ es/Customization can be separated and moved into dedicated test samples.
+\end_layout
+
+\end_inset
+
+
 \end_layout
 
 \begin_layout Itemize
@@ -1512,42 +2467,42 @@ LaTeX:
 
 \begin_deeper
 \begin_layout Labeling
-\labelwidthstring pdf5_systemFM
+\labelwidthstring pdf5msystemFM
 dvi DVI (8-bit latex)
 \end_layout
 
 \begin_layout Labeling
-\labelwidthstring pdf5_systemFM
+\labelwidthstring pdf5msystemFM
 dvi3_texF DVI (LuaTeX with 8-bit TeX fonts)
 \end_layout
 
 \begin_layout Labeling
-\labelwidthstring pdf5_systemFM
+\labelwidthstring pdf5msystemFM
 dvi3_systemF DVI (LuaTeX with Unicode fonts)
 \end_layout
 
 \begin_layout Labeling
-\labelwidthstring pdf5_systemFM
+\labelwidthstring pdf5msystemFM
 pdf2 PDF (pdflatex)
 \end_layout
 
 \begin_layout Labeling
-\labelwidthstring pdf5_systemFM
+\labelwidthstring pdf5msystemFM
 pdf4_texF PDF (XeTeX with 8-bit TeX fonts)
 \end_layout
 
 \begin_layout Labeling
-\labelwidthstring pdf5_systemFM
+\labelwidthstring pdf5msystemFM
 pdf4_systemF PDF (XeTeX with Unicode fonts)
 \end_layout
 
 \begin_layout Labeling
-\labelwidthstring pdf5_systemFM
+\labelwidthstring pdf5msystemFM
 pdf5_texF PDF (LuaTeX with 8-bit TeX fonts)
 \end_layout
 
 \begin_layout Labeling
-\labelwidthstring pdf5_systemFM
+\labelwidthstring pdf5msystemFM
 pdf5_systemF PDF (LuaTeX with Unicode fonts)
 \end_layout
 
@@ -1575,12 +2530,12 @@ postprocessing:
 
 \begin_deeper
 \begin_layout Labeling
-\labelwidthstring pdf5_systemFM
+\labelwidthstring pdf5msystemFM
 pdf DVI -> PS (dvips) -> PDF (ps2pdf)
 \end_layout
 
 \begin_layout Labeling
-\labelwidthstring pdf5_systemFM
+\labelwidthstring pdf5msystemFM
 pdf3 DVI -> PDF (dvipdfm)
 \end_layout
 
@@ -1596,72 +2551,72 @@ tested: (or only if set as default output format in the document source)
 
 \begin_deeper
 \begin_layout Labeling
-\labelwidthstring pdf5_systemFM
+\labelwidthstring pdf5msystemFM
 latex LaTeX (plain)
 \end_layout
 
 \begin_layout Labeling
-\labelwidthstring pdf5_systemFM
+\labelwidthstring pdf5msystemFM
 luatex LaTeX (LuaTeX)
 \end_layout
 
 \begin_layout Labeling
-\labelwidthstring pdf5_systemFM
+\labelwidthstring pdf5msystemFM
 dviluatex LaTeX (dviluatex)
 \end_layout
 
 \begin_layout Labeling
-\labelwidthstring pdf5_systemFM
+\labelwidthstring pdf5msystemFM
 pdflatex LaTeX (pdflatex)
 \end_layout
 
 \begin_layout Labeling
-\labelwidthstring pdf5_systemFM
+\labelwidthstring pdf5msystemFM
 platex LaTeX (pLaTeX)
 \end_layout
 
 \begin_layout Labeling
-\labelwidthstring pdf5_systemFM
+\labelwidthstring pdf5msystemFM
 xetex LaTeX (XeTeX) 
 \end_layout
 
 \begin_layout Labeling
-\labelwidthstring pdf5_systemFM
+\labelwidthstring pdf5msystemFM
 eps3 EPS (encapsulated Postscript) (cropped)
 \end_layout
 
 \begin_layout Labeling
-\labelwidthstring pdf5_systemFM
+\labelwidthstring pdf5msystemFM
 ps DVI -> Postscript (dvips)
 \end_layout
 
 \begin_layout Labeling
-\labelwidthstring pdf5_systemFM
+\labelwidthstring pdf5msystemFM
 odf
 \end_layout
 
 \begin_layout Labeling
-\labelwidthstring pdf5_systemFM
+\labelwidthstring pdf5msystemFM
 text (nor text2, ..., text4)
 \end_layout
 
 \begin_layout Labeling
-\labelwidthstring pdf5_systemFM
+\labelwidthstring pdf5msystemFM
 textparagraph
 \end_layout
 
 \begin_layout Labeling
-\labelwidthstring pdf5_systemFM
+\labelwidthstring pdf5msystemFM
 word
 \end_layout
 
 \begin_layout Labeling
-\labelwidthstring pdf5_systemFM
+\labelwidthstring pdf5msystemFM
 word2
 \end_layout
 
 \begin_layout Labeling
-\labelwidthstring pdf5_systemFM
+\labelwidthstring pdf5msystemFM
 wordhtml
 \end_layout
 
@@ -1738,6 +2693,17 @@ ctest
 
 \end_inset
 
+.
+ A full, up-to-date TeXLive installation is recommended to run the tests.
+ Otherwise, some tests will fail.
+ Tests with additional requirements are labeled 
+\begin_inset Quotes eld
+\end_inset
+
+unreliable:nonstandard
+\begin_inset Quotes erd
+\end_inset
+
 .
  
 \end_layout
@@ -1894,7 +2860,6 @@ We are still working on getting the tests to run in parallel.
  pass when run sequentially.
  A reasonable approach is to first run the tests in parallel and then run
  the failed tests sequentially.
 \end_layout
 
 \begin_layout Standard
@@ -1929,6 +2894,35 @@ rerun-failed
 
 \end_layout
 
+\begin_layout Standard
+When specifying a subset of the tests (e.g.
+ using 
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+\SpecialChar nobreakdash
+R <pattern>
+\end_layout
+
+\end_inset
+
+), the same subset must be specified when using the 
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+\SpecialChar nobreakdash
+\SpecialChar nobreakdash
+rerun-failed
+\end_layout
+
+\end_inset
+
+ option because it is the test numbers that are used to index which tests
+ failed on the previous run.
+\end_layout
+
 \begin_layout Standard
 \noindent
 Note that some tests cannot be run in parallel.
@@ -2377,6 +3371,20 @@ reference "par:Unreliable-tests"
 ).
 \end_layout
 
+\begin_layout Itemize
+In case of tests failing due to missing requirements (when only a subset
+ of TeXLive is installed or a test labeled 
+\begin_inset Quotes eld
+\end_inset
+
+unreliable:nonstandard
+\begin_inset Quotes erd
+\end_inset
+
+ fails), ignore the failure, ask for someone else to run the test, or install
+ the missing ressources and try again.
+\end_layout
+
 \begin_layout Paragraph
 \begin_inset CommandInset label
 LatexCommand label
@@ -3737,7 +4745,6 @@ development/autotests
 
  subfolder of the \SpecialChar LyX
  source code distribution.
- T
 \end_layout
 
 \begin_layout Subsubsection