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