1How do I upgrade my existing LyX system to version 2.3.x?
2---------------------------------------------------------
3
4* Upgrading from LyX 2.2.x:
5
6The external_templates file has been split into one file per template,
7which are now located in lib/xtemplates/*.xtemplate. This makes it easier
8to add new templates or modify existing ones. If you have modified
9the external_templates file, you will have to move the modifications to
10the respective *.xtemplate file manually.
11
12By default, LyX 2.3 outputs en- and em-dashes as -- and --- respectively,
13so that a line break can occur in the output immediately after the dash.
14Sometimes, this results in undesired line breaks or overfull lines due to
15suppression of hyphenation in the word preceding the dash.
16Select "Document->Settings->Fonts->Disallow line breaks after dashes"
17to keep the LyX 2.2 behaviour.
18See chapter 3.9.1.1, "Dashes and Line Breaks", of the User Guide
19for details.
20
21If trying to compile documents using R scripts and sweave/knitr, LyX
222.3.x would not allow for re-running the R scripts, unless the user:
231) explicitly disables the "Forbid use of needauth converters"
24option in the LyX preferences;
252) provides explicit consent to the use of the converter on the first
26compilation of the R-enhanced document.
27
28LyX now gives a warning if a document mixes title and non-title layouts.
29In some cases, this warning is harmless, but in other cases the document has
30a serious problem even though the LaTeX command does not exit with error. For
31example, create a document with a title layout, then a standard layout, and
32then an author layout, and you will see in the PDF that the author is not
33typeset as an author.
34
35* Upgrading from LyX 2.1.x:
36
37The format of preference and session files has changed. LyX 2.2.x is able to
38read old files but will save them in the new format.
39
40The format of layout files has changed but, as before, layout2layout.py will
41convert older versions to the new format automatically.
42
43The prefix for subsections in labels and references has been changed from
44"sub:" to "subsec:" in order to avoid a clash with subfloats (conflicting
45\subref command, see bug #7550). Files are automatically converted to the new
46scheme. Please assure that you adapt external refstyle or prettyref definitions
47and your own layout files.
48
49BibTeX errors are now processed and cause LyX to show the errors dialog.
50Before, these errors were ignored, which means that it may happen that
51documents that compiled without error with a previous version now
52compile with error. However, because now in 2.2.x users can click on
53the "Show Output Anyway" button, the document can still be viewed.
54
55Missing characters in the output are now reported as errors. This leads
56to error reports for documents that compiled without error before.
57However, the error was always present but went undetected!
58
59Documents using Times fonts and containing Greek characters may now fail
60to compile under pdflatex for users of MikTeX due to an automatically
61half-installed "grtimes" package. A workaround in LyX was removed as it
62stands in the way of alternative approaches (see bug #6469).
63
64With LuaTeX, LyX now uses polyglossia instead of babel if the language
65package option "Automatic" is selected. In order to use babel, select
66"Always babel" instead. This may be needed if a document uses code that
67is specific to babel.
68
69* Upgrading from LyX 2.0.x:
70
71Python version >=2.4 is now required.
72
73Python version >3.0 is still not yet supported.
74
75* Upgrading from LyX 1.6.x:
76
77The typeset of your documents with non-english language can slightly
78change in case of math environments and floats. LyX 2.0.x now has its
79own translation machinery for the strings that are not translated by
80babel.
81
82The format of preference and session files has changed. LyX 2.0.x is
83able to read old files but will save them in the new format.
84
85The format of layout files has changed but, as before, layout2layout.py
86will convert older versions to the new format automatically.
87
88The syntax of the languages file has been changed. If you use a
89modified languages file, you will need to adapt it to the new syntax.
90
91There has been a large change in how Flex insets are named.
92When exporting back to 1.6.x format user-defined flex insets will not
93be properly reverted. See RELEASE-NOTES for details.
94
95The UI layout named "classic.ui" and some localized keyboard bindings
96(sv, pt, fi) are not being shipped anymore.
97
98* Upgrading from LyX 1.5.x:
99
100The format of preference and session files has changed. LyX 1.6.x is
101able to read old files but will save them in the new format.
102
103The format of layout files has changed but, as before,
104layout2layout.py will convert older versions to the new format
105automatically.
106
107* Upgrading from LyX 1.4.x:
108
109The biggest change in 1.5 is the switch to Unicode. Please refer to
110the section "Document transfer" below for some things you might take
111into account before upgrading.
112
113The format of the preferences file has changed slightly. LyX 1.5.x is
114able to read old preferences files, but it will save them in the new
115format, so it is not possible to run LyX 1.4.x and 1.5.x with the same
116personal configuration directory. If you are upgrading from 1.4.x and
117do not intend to continue using 1.4.x, you should delete your existing
118preferences file and allow LyX to create a new one.
119
120The list of recently open files is now stored in a different location.
121It will therefore be reset when upgrading from LyX 1.4.x.
122
123The format of the layout files has also changed, but LyX 1.5.x uses a
124converter layout2layout.py written in python that will convert old layout
125files on the fly (see below, section "Document transfer").
126
127* Upgrading from LyX 1.3.x:
128
129The format of the external template file has changed substantially with
130LyX 1.4.0. Automatic conversion is not available, so you need to convert
131your external templates manually. The new format of the external template
132configuration file is described in chapter 6.5 of the Customization Guide.
133
134* Upgrading from LyX 1.2.x:
135
136Since 1.3.0, you have to do the following changes:
137
138One of the perennial bug bears of LyX users in the past has been that
139they have had to run Edit->Reconfigure when starting their new version
140of the code for the first time. Strange and wonderful things would
141often result if they forgot to do this, so LyX 1.3.0 now runs
142Edit->Reconfigure automatically the first time the program is run.
143
144If you have your own layout files, you may need to update them a little:
145
146- floats are now defined in the layout file, using the "Float"..."End"
147  construct. In most cases, adding "Input stdfloats.inc" to your layout
148  file is enough.
149
150- counters are also defined in the layout files, using the
151  "Counter"..."End" construct. As for floats, adding "Input
152  stdfloats.inc" is probably a good idea.
153
154* Upgrading from LyX 1.1.x:
155
156- all layout files should have a "DefaultStyle" entry
157
158- the "Latex" font style does not exist anymore. If you really need
159  its functionality, consider using the "PassThru" keyword instead.
160
161The new layout format keywords are described in the Customization
162manual.
163
164If you have your own binding files (especially math.bind), you will
165have to update them
166
167- math-insert now takes a latex macro name as argument, so that
168  "math-insert sqrt" should now be "\math-insert \sqrt"
169
170- math-greek-toggle is now gone, and should be replaced by explicit
171  bindings like
172
173  \bind "M-m g a"      "math-insert \alpha"
174
175
176Build requirements
177------------------
178
179LyX 2.0 uses the Qt 4.x toolkit (see INSTALL file).
180
181If you do not have the JPEG library installed, you may need to install it
182before you can use the graphics capabilities of LyX. If you do not have the
183ImageMagick command-line tools installed, you will need to modify the default
184set up of LyX, or install them, in order to get previews of your document's
185graphics.
186
187Document transfer
188-----------------
189
190* Compatibility with older documents/layouts
191
192LyX 2.0.x uses an external python script, lyx2lyx, to import documents
193written using previous versions of LyX. All versions of LyX as far back as
1940.10 are supported.
195
196Of course, this means that you must have python (>= 2.3.4, <3)
197installed in order to use LyX 2.0.x with your old documents.
198
199lyx2lyx also has the framework in place to be able to convert documents to an
200earlier format (which requires python 2.3.4 at least). However, these
201converters have only been written for the conversion from 2.0.x to 1.6.x,
2021.5.x, 1.4.x and 1.3.x, so versions of LyX older than 1.3.0 will NOT be able to
203read documents saved with LyX 2.0.x. The conversion from 2.0.x to 1.6.x-1.3.x
204is lossless as long as no new features are used. lyx2lyx tries hard to find
205something equivalent for new features such as boxes, but this is known to fail
206sometimes. LyX 1.6.9 contains an updated lyx2lyx that can read documents in
2072.0.x format.
208
209Furthermore, LyX uses a converter layout2layout.py, also written in python
210that will convert old layout files on the fly. You can also call it manually
211on your layout files if you want to convert them to 2.0.x format permanently.
212
213* Formatted references
214
215Before version 2.0, LyX used the LaTeX package "prettyref" to produce
216"formatted references", such as "Section 2.1". This package has several
217shortcomings when used in a non-English environment, not least of which is
218that it has no mechanism for internationalization. (See bug #6421 and those
219it references.)
220
221As of LyX 2.0, users can choose whether to use prettyref or, alternatively,
222the "refstyle" package. The current version of refstyle, v0.5, ships with
223translations for several languages and provides an easy mechanism for users
224to translate the references it produces into still other languages. It also
225defines many more commands than prettyref does, including, for example, ones
226to produce "ranges", such as "Sections 2.1 to 2.3". Some LyX developers are
227already working with the refstyle maintainer, Danie Els, to make it work more
228easily  with LyX and to extend the translations it provides. (You are invited
229to contribute translations, too!)
230
231Because many LyX users already have customized prettyref for their purposes,
232LyX 1.6.x files opened in LyX 2.0 will continue to use prettref by default.
233New LyX 2.0 files will use refstyle by default. Both can of course be changed
234in Document>Settings. Please be advised, however, that prettyref support is to
235be considered deprecated: It may well be removed in LyX 2.1, and all users are
236encouraged to adapt their layout files, etc, to refstyle.
237
238Doing so is fairly simple. With prettyref, one has declarations such as:
239    \newrefformat{for}(Formula \ref{#1}}
240The refstyle equivalent is:
241    \newref{for}{refcmd={Formula \ref{#1}}}
242The translation is obviously trivial.
243
244* Preparing for Unicode:
245
246As of version 1.5.0, LyX uses Unicode internally. This is a major change that
247affects documents and layouts likewise. We have tried to do out best to make the
248transition as smooth as possible for you. However, there are some caveats:
249
250- User layout files must be converted to UTF-8
251
252  In versions prior to 1.5.0, layout styles were allowed to use non-ASCII names
253  using the local encodings. LyX-1.5 and later assume that all layout files are
254  UTF-8 encoded. This means that non-ASCII style names are still allowed
255  but they must be valid UTF-8 strings. One way of doing the conversion
256  is to use iconv. Using bash, the script below should work:
257
258     #! /bin/sh
259
260     cd /path/to/layouts
261     for l in *
262     do
263       cp "$l" tmp.txt
264       iconv -f latin1 -t utf8 tmp.txt -o "$l"
265     done
266     rm -f tmp.txt
267
268- Inset encodings and Conversion from earlier LyX versions
269
270  As part of the transition to unicode, lyx2lyx (the scripts used for
271  converting back and forth between different versions of the lyx
272  files) converts old .lyx files, which may use a number of different
273  encodings, to UTF-8. This conversion depends on correctly
274  identifying the language of the text. There were previously some
275  edge-cases (insets embedded in different-language text type
276  scenarios) in which the language was incorrectly identified, which
277  caused some text to appear incorrectly after having upgraded from
278  older versions. This has now been fixed. Unfortunately, however, the
279  fix cannot be applied to files which have already been converted
280  past format 249. So if you have already converted your old files
281  (using a development version or release candidate), this fix won't
282  help, unless you still have the originals lying around (and haven't
283  yet made too many changes to the newer versions ;) ).
284
285Generally, it is probably wise to keep a backup of the old version of your
286files, at least until you are sure that the upgrade went smoothly (which it
287almost always will).
288
289* Languages/encodings and insets
290
291One of the bugs fixed in LyX 1.5.0 is that previously, there were certain
292specific cases in which the LaTeX generated did not correctly reflect
293language/encoding transitions in and around insets (footnotes, LyX notes).
294After much deliberation, it was decided not to change older files such that
295they will still reflect the old LaTeX output; rather, they will now correctly
296reflect the situation as it appears in the GUI. This means, however, that if
297you mangled the text in the GUI in the older versions, in order that it
298generate the correct LaTeX output, the LaTeX will now generate the mangled
299text. If this is problematic for you, please get in touch with us on the
300developers mailing list, we do have some possible solutions for this.
301
302The effects of this will be more pronounced for RTL (Hebrew, Arabic, Farsi)
303users -- though they affect users of other languages as well.
304
305* Floatflt in 1.2.x and older
306
307If you were previously (in LyX 1.1.x) using the floatflt paragraph
308option to wrap text around a figure, it was necessary to modify this
309for LyX 1.2.0 manually, as described in the manuals. The feature has
310been re-implemented as "Floating figure" inset in 1.3.0. Old files will
311be converted automatically, but you may want to convert the
3121.2.x-style ERT constructs with the native solution (see section 3.8
313of the Extended Features manual).
314
315* Babel changes since 1.2.x
316
317Since LyX 1.2.0, the babel package is loaded after the user-defined
318preamble (because some packages really need to be loaded before
319babel). If you relied, on babel being loaded before your own
320definitions, you can add an extra "\usepackage{babel}" statement at
321the beginning of your preamble.
322
323http://www.lyx.org/trac/ticket/315
324