]> git.lyx.org Git - lyx.git/blob - UPGRADING
ANNOUNCE updates.
[lyx.git] / UPGRADING
1 How do I upgrade my existing LyX system to version 2.3.x?
2 ---------------------------------------------------------
3
4 * Upgrading from LyX 2.2.x:
5
6 The external_templates file has been split into one file per template,
7 which are now located in lib/xtemplates/*.xtemplate. This makes it easier
8 to add new templates or modify existing ones. If you have modified
9 the external_templates file, you will have to move the modifications to
10 the respective *.xtemplate file manually.
11
12 By default, LyX 2.3 outputs en- and em-dashes as -- and --- respectively,
13 so that a line break can occur in the output immediately after the dash.
14 Sometimes, this results in undesired line breaks or overfull lines due to
15 suppression of hyphenation in the word preceding the dash.
16 Select "Document->Settings->Fonts->Disallow line breaks after dashes"
17 to keep the LyX 2.2 behaviour.
18 See chapter 3.9.1.1, "Dashes and Line Breaks", of the User Guide
19 for details.
20
21 If trying to compile documents using R scripts and sweave/knitr, LyX
22 2.3.x would not allow for re-running the R scripts, unless the user:
23 1) explicitly disables the "Forbid use of needauth converters"
24 option in the LyX preferences;
25 2) provides explicit consent to the use of the converter on the first
26 compilation of the R-enhanced document.
27
28 LyX now gives a warning if a document mixes title and non-title layouts.
29 In some cases, this warning is harmless, but in other cases the document has
30 a serious problem even though the LaTeX command does not exit with error. For
31 example, create a document with a title layout, then a standard layout, and
32 then an author layout, and you will see in the PDF that the author is not
33 typeset as an author.
34
35 * Upgrading from LyX 2.1.x:
36
37 The format of preference and session files has changed. LyX 2.2.x is able to
38 read old files but will save them in the new format.
39
40 The format of layout files has changed but, as before, layout2layout.py will
41 convert older versions to the new format automatically.
42
43 The 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
46 scheme. Please assure that you adapt external refstyle or prettyref definitions
47 and your own layout files.
48
49 BibTeX errors are now processed and cause LyX to show the errors dialog.
50 Before, these errors were ignored, which means that it may happen that
51 documents that compiled without error with a previous version now
52 compile with error. However, because now in 2.2.x users can click on
53 the "Show Output Anyway" button, the document can still be viewed.
54
55 Missing characters in the output are now reported as errors. This leads
56 to error reports for documents that compiled without error before.
57 However, the error was always present but went undetected!
58
59 Documents using Times fonts and containing Greek characters may now fail
60 to compile under pdflatex for users of MikTeX due to an automatically
61 half-installed "grtimes" package. A workaround in LyX was removed as it
62 stands in the way of alternative approaches (see bug #6469).
63
64 With LuaTeX, LyX now uses polyglossia instead of babel if the language
65 package option "Automatic" is selected. In order to use babel, select
66 "Always babel" instead. This may be needed if a document uses code that
67 is specific to babel.
68
69 * Upgrading from LyX 2.0.x:
70
71 Python version >=2.4 is now required.
72
73 Python version >3.0 is still not yet supported.
74
75 * Upgrading from LyX 1.6.x:
76
77 The typeset of your documents with non-english language can slightly
78 change in case of math environments and floats. LyX 2.0.x now has its
79 own translation machinery for the strings that are not translated by
80 babel.
81
82 The format of preference and session files has changed. LyX 2.0.x is
83 able to read old files but will save them in the new format.
84
85 The format of layout files has changed but, as before, layout2layout.py
86 will convert older versions to the new format automatically.
87
88 The syntax of the languages file has been changed. If you use a
89 modified languages file, you will need to adapt it to the new syntax.
90
91 There has been a large change in how Flex insets are named.
92 When exporting back to 1.6.x format user-defined flex insets will not
93 be properly reverted. See RELEASE-NOTES for details.
94
95 The 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
100 The format of preference and session files has changed. LyX 1.6.x is
101 able to read old files but will save them in the new format.
102
103 The format of layout files has changed but, as before,
104 layout2layout.py will convert older versions to the new format
105 automatically.
106
107 * Upgrading from LyX 1.4.x:
108
109 The biggest change in 1.5 is the switch to Unicode. Please refer to
110 the section "Document transfer" below for some things you might take
111 into account before upgrading.
112
113 The format of the preferences file has changed slightly. LyX 1.5.x is
114 able to read old preferences files, but it will save them in the new
115 format, so it is not possible to run LyX 1.4.x and 1.5.x with the same
116 personal configuration directory. If you are upgrading from 1.4.x and
117 do not intend to continue using 1.4.x, you should delete your existing
118 preferences file and allow LyX to create a new one.
119
120 The list of recently open files is now stored in a different location.
121 It will therefore be reset when upgrading from LyX 1.4.x.
122
123 The format of the layout files has also changed, but LyX 1.5.x uses a
124 converter layout2layout.py written in python that will convert old layout
125 files on the fly (see below, section "Document transfer").
126
127 * Upgrading from LyX 1.3.x:
128
129 The format of the external template file has changed substantially with
130 LyX 1.4.0. Automatic conversion is not available, so you need to convert
131 your external templates manually. The new format of the external template
132 configuration file is described in chapter 6.5 of the Customization Guide.
133
134 * Upgrading from LyX 1.2.x:
135
136 Since 1.3.0, you have to do the following changes:
137
138 One of the perennial bug bears of LyX users in the past has been that
139 they have had to run Edit->Reconfigure when starting their new version
140 of the code for the first time. Strange and wonderful things would
141 often result if they forgot to do this, so LyX 1.3.0 now runs
142 Edit->Reconfigure automatically the first time the program is run.
143
144 If 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
161 The new layout format keywords are described in the Customization
162 manual.
163
164 If you have your own binding files (especially math.bind), you will
165 have 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
176 Build requirements
177 ------------------
178
179 LyX 2.0 uses the Qt 4.x toolkit (see INSTALL file).
180
181 If you do not have the JPEG library installed, you may need to install it
182 before you can use the graphics capabilities of LyX. If you do not have the
183 ImageMagick command-line tools installed, you will need to modify the default
184 set up of LyX, or install them, in order to get previews of your document's
185 graphics.
186
187 Document transfer
188 -----------------
189
190 * Compatibility with older documents/layouts
191
192 LyX 2.0.x uses an external python script, lyx2lyx, to import documents
193 written using previous versions of LyX. All versions of LyX as far back as
194 0.10 are supported.
195
196 Of course, this means that you must have python (>= 2.3.4, <3)
197 installed in order to use LyX 2.0.x with your old documents.
198
199 lyx2lyx also has the framework in place to be able to convert documents to an
200 earlier format (which requires python 2.3.4 at least). However, these
201 converters have only been written for the conversion from 2.0.x to 1.6.x,
202 1.5.x, 1.4.x and 1.3.x, so versions of LyX older than 1.3.0 will NOT be able to
203 read documents saved with LyX 2.0.x. The conversion from 2.0.x to 1.6.x-1.3.x
204 is lossless as long as no new features are used. lyx2lyx tries hard to find
205 something equivalent for new features such as boxes, but this is known to fail
206 sometimes. LyX 1.6.9 contains an updated lyx2lyx that can read documents in
207 2.0.x format.
208
209 Furthermore, LyX uses a converter layout2layout.py, also written in python
210 that will convert old layout files on the fly. You can also call it manually
211 on your layout files if you want to convert them to 2.0.x format permanently.
212
213 * Formatted references
214
215 Before version 2.0, LyX used the LaTeX package "prettyref" to produce 
216 "formatted references", such as "Section 2.1". This package has several 
217 shortcomings when used in a non-English environment, not least of which is 
218 that it has no mechanism for internationalization. (See bug #6421 and those
219 it references.) 
220
221 As of LyX 2.0, users can choose whether to use prettyref or, alternatively,
222 the "refstyle" package. The current version of refstyle, v0.5, ships with 
223 translations for several languages and provides an easy mechanism for users
224 to translate the references it produces into still other languages. It also 
225 defines many more commands than prettyref does, including, for example, ones
226 to produce "ranges", such as "Sections 2.1 to 2.3". Some LyX developers are 
227 already working with the refstyle maintainer, Danie Els, to make it work more 
228 easily  with LyX and to extend the translations it provides. (You are invited 
229 to contribute translations, too!)
230
231 Because many LyX users already have customized prettyref for their purposes,
232 LyX 1.6.x files opened in LyX 2.0 will continue to use prettref by default.
233 New LyX 2.0 files will use refstyle by default. Both can of course be changed 
234 in Document>Settings. Please be advised, however, that prettyref support is to
235 be considered deprecated: It may well be removed in LyX 2.1, and all users are
236 encouraged to adapt their layout files, etc, to refstyle.
237
238 Doing so is fairly simple. With prettyref, one has declarations such as:
239     \newrefformat{for}(Formula \ref{#1}}
240 The refstyle equivalent is:
241     \newref{for}{refcmd={Formula \ref{#1}}}
242 The translation is obviously trivial.
243
244 * Preparing for Unicode:
245
246 As of version 1.5.0, LyX uses Unicode internally. This is a major change that
247 affects documents and layouts likewise. We have tried to do out best to make the
248 transition 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
285 Generally, it is probably wise to keep a backup of the old version of your
286 files, at least until you are sure that the upgrade went smoothly (which it
287 almost always will).
288
289 * Languages/encodings and insets
290
291 One of the bugs fixed in LyX 1.5.0 is that previously, there were certain
292 specific cases in which the LaTeX generated did not correctly reflect
293 language/encoding transitions in and around insets (footnotes, LyX notes).
294 After much deliberation, it was decided not to change older files such that
295 they will still reflect the old LaTeX output; rather, they will now correctly
296 reflect the situation as it appears in the GUI. This means, however, that if
297 you mangled the text in the GUI in the older versions, in order that it
298 generate the correct LaTeX output, the LaTeX will now generate the mangled
299 text. If this is problematic for you, please get in touch with us on the
300 developers mailing list, we do have some possible solutions for this.
301
302 The effects of this will be more pronounced for RTL (Hebrew, Arabic, Farsi)
303 users -- though they affect users of other languages as well.
304
305 * Floatflt in 1.2.x and older
306
307 If you were previously (in LyX 1.1.x) using the floatflt paragraph
308 option to wrap text around a figure, it was necessary to modify this
309 for LyX 1.2.0 manually, as described in the manuals. The feature has
310 been re-implemented as "Floating figure" inset in 1.3.0. Old files will
311 be converted automatically, but you may want to convert the
312 1.2.x-style ERT constructs with the native solution (see section 3.8
313 of the Extended Features manual).
314
315 * Babel changes since 1.2.x
316
317 Since LyX 1.2.0, the babel package is loaded after the user-defined
318 preamble (because some packages really need to be loaded before
319 babel). If you relied, on babel being loaded before your own
320 definitions, you can add an extra "\usepackage{babel}" statement at
321 the beginning of your preamble.
322
323 http://www.lyx.org/trac/ticket/315