Commit Graph

1015 Commits

Author SHA1 Message Date
Kornel Benko
1b3e4c73f8 Cmake tests: Added parser_tools test to the lyx2lyx group tests 2014-06-12 09:07:57 +02:00
Georg Baum
1187b8834e Include lyx2lyx test in tarball 2014-05-29 15:13:59 +02:00
Georg Baum
11be833a2e Execute lyx2lyx unit test when running tests
Actually lyx2lyx has a tiny unit test. Add it to the autotools test machinery
and fix it: Since nobody knew about it the test was of course broken.
2014-05-29 14:57:05 +02:00
Georg Baum
55af9cb006 Fix the fix
MAC-style (pre-OS X) line ends were not recognized anymore
2014-05-29 14:44:38 +02:00
Georg Baum
c75c6e446a Do not corrupt documents without newline at EOF
trim_eol() assumes that a line always ends either with \n, \r, or \r\n.
This assumption is always valid except for the last line of a document, since it
may miss the trailing newline. LyX does not create such documents, bu they may
result from automatic creation tools, and LyX can read them, so lyx2lyx should
be able to read them as well.
2014-05-29 13:15:07 +02:00
Enrico Forestieri
0080201977 Avoid processing multiple times the same paragraph when converting latex arguments. 2014-05-29 11:05:34 +02:00
Enrico Forestieri
dbd4d781dc Fix an off-by-one error in the reversion of beamer documents. 2014-05-29 10:55:30 +02:00
Enrico Forestieri
da75d31948 Fix reversion of box insets. 2014-05-29 10:44:02 +02:00
Georg Baum
4cea2efe21 Native support for \notag
This is mainly needed to reduce the amount of ERT if you convert AMS example
documents with tex2lyx. No GUI support is needed, since \notag is equivalent
to \nonumber.
2014-05-27 22:17:35 +02:00
Georg Baum
5dc9568f8d Native support for \smash[t] and \smash[b]
This is a follow-up of bug #8967. The implementation is self-explaining, the
only part which needs a comment is lyx2lyx: Since a 100% correct solution is
not possible, it has been decided not to switch amsmath off in the forward
conversion if no other ams command than \smash[t] and \smash[b] is used, but
to consider it a bug that older versions do not load amsmath automatically for
these commands. In the backward direction it is easy to keep the document
compilable, so just do that.
2014-05-27 22:13:58 +02:00
Juergen Spitzmueller
c7eb04158f Clean up empty ERTs that are produced in comples beamer argument conversions 2014-05-25 22:46:42 +02:00
Juergen Spitzmueller
e8e75f45b9 Support spreaded argument delimiters in beamer block conversion 2014-05-25 22:42:44 +02:00
Juergen Spitzmueller
57664026f2 In collorary conversion, support argument delimiters spread over several ERTs
The roundtrip still has issues.
2014-05-25 15:08:08 +02:00
Juergen Spitzmueller
36051e1daa Fixes in the beamer block routine
This makes beamerlyxexample1 open after the roundtrip, but the file does not compile yet (remaining issues in other routines)
2014-05-25 15:00:38 +02:00
Juergen Spitzmueller
c21e51a4f9 Fix nesting in some beamer reversion methods.
Patch by Enrico
2014-05-21 11:37:51 +02:00
Juergen Spitzmueller
9b4160e0f8 Fix reversion of beamer overprint when a nested paragraph has an argument 2014-05-21 11:36:47 +02:00
Enrico Forestieri
cda00d8329 Fix reversion of beamer documents.
Beamer documents do not have a "--Separator--" layout but a
"Separator" one. Also fix a thinko causing the deletion of
"\end_layout" tags in some cases.
2014-05-19 19:39:51 +02:00
Richard Heck
72acf9fb27 Fix copy/paste error, and whitespace. 2014-05-19 09:41:05 -04:00
Richard Heck
eb26d85dc9 Add limits to searches in convert_TeX_brace_to_Argument. 2014-05-18 11:24:53 -04:00
Georg Baum
ced24dea55 Fix lyx2lyx warning for tex2lyx files
I would not have thought that reLyX was considered, but not tex2lyx!
2014-05-12 22:06:24 +02:00
Richard Heck
62d4af2f9c Install lyx2lyx/lyx_2_2.py. 2014-05-12 09:16:31 -04:00
Enrico Forestieri
c668ebf611 Fix bugs #8546 and #9055, and introduce new separator inset.
The algorithm used for breaking a paragraph in LaTeX export is changed
for avoiding spurious blank lines causing too much vertical space.
This change is tied to the introduction of a new inset (with two
different specializations) helping in either outputing LaTeX paragraph
breaks or separating environments in LyX. Both of the above goals were
previously achieved by the ---Separator--- layout and can now be
accomplished by the new inset in a more natural way. As an example,
after leaving an environment by hitting the Return key for two times,
a third return automatically inserts a parbreak inset, which is
equivalent to the old separator layout, i.e., it also introduces a
blank line in the output. If this blank line is not wanted, the
parbreak separator can be changed to a plain separator by a right
click of the mouse. Of course, an environment can still be separated
by the following one by using the Alt+P+Return shortcut (or the
corresponding menu key), but now the plain separator inset is used
instead of the old separator layout, such that no blank line occurs in
the LaTeX output.

Old documents are converted such that the LaTeX output remains unchanged.
As a result of this conversion, the old separator layout is replaced by
the new parbreak inset, which may also appear in places where the old
algorithm was introducing blank lines while the new one is not.
Note that not all blank lines were actually affecting the LaTeX output,
because a blank line is simply ignored by the TeX engine when it occurs
in the so called "vertical mode" (e.g., after an alignment environment).
The old ---Separator--- layout is now gone and old layout files using it
are also automatically converted.

Round trip conversions between old and new format should leave a document
unchanged. This means that the new behavior about paragraph breaking is
not "carried back" to the old format. Indeed, this would need introducing
special LaTeX commands in ERT that would accumulate in roundtrip
conversions, horribly cluttering the document. So, when converting a
modified document to old formats, the LaTeX output may slightly differ in
vertical spacing if the document is processed by an old version of LyX.
In other words, forward compatibility is guaranteed, but not backwards.
2014-05-10 23:25:11 +02:00
Juergen Spitzmueller
769b585176 Beamer block conversion: consider ERT arguments with leading/trailing blanks
Should also go to branch.
2014-05-08 15:14:44 +02:00
Vincent van Ravesteijn
b0629c79ac lyx2lyx: Update the emergency value
Actually, this should not be hardcoded.
2014-04-29 15:50:41 +02:00
Georg Baum
d6fecb4aa4 Fix table rotate conversion to 2.0 format
The old code did create invalid documents, since the space between the rotate
flag dn the previous flag was removed.
2014-04-27 20:58:53 +02:00
Juergen Spitzmueller
dced492489 Fix conversion of beamer block titles that end with a non-ERT inset.
Should also go to branch!
2014-04-26 17:39:56 +02:00
Georg Baum
52d2588613 Fix lyx2lyx math package defaults (bug #9069)
lyx2lyx sets all new math packages to off when converting from old formats.
This is correct if any command which would cause an automatic package loading
exists in the document. However, it is wrong if no command exists: This leads
to problems if later a command is added (bug #9069), which is especially
annoying for templates.
The fix consists of two parts:
1) convert_use_package() considers now the used commands like
   revert_use_package(), and uses them to decide whether to set the package to
   auto or off.
2) convert_undertilde() and revert_undertilde() use a slightly adjusted copy of
   convert_use_package() and revert_use_package(), so that the bug is also
   fixed for undertilde. We cannot use the latter functions directly, because
   of "\usepackage undertilde" vs. "\use_undertilde".
2014-04-25 22:39:22 +02:00
Georg Baum
5710f68c34 Fix math package conversion to 2.0 format
When doing the lyx2lyx round trip of the 2.0.8 user guide from format
413 -> 474 -> 413 you get an invalid document, because the math packages
mhchem and undertilde are incorrectly converted.
It turned out that the old reversion code did only work for particular
package oderings. The new one works for abitrary sorted packages.
2014-04-25 22:12:04 +02:00
Georg Baum
2fe07e1fe1 Fix data loss in user guide conversion to 2.0.x
When doing the lyx2lyx round trip of the 2.0.8 user guide from format
413 -> 474 -> 413 you do not get a zero diff. The most important problem is
caused by the conversion of the argument insets to the old syntax: This
conversion adds an additional empty line (harmless), and it destroys the
document structure if the first inset in e.g. a subsection is not an argument
inset, but e.g. an index or label inset.
The fix is quite easy: Ensure that the paragraph begin is set to the first
argument inset.
2014-04-25 21:35:51 +02:00
Georg Baum
cacd2a041d Fix warning in lyx2lyx 2.0<->2.1 round trip
revert_justification() issues a warning if the \justification parameter does
not exist, and LyX itself always writes it unconditionally as well, so add it
also in lyx2lyx when converting old documents.
Currently this does not have any user visible effect, but it decouples the
default value of BufferParams::justification from the conversion of old
documents: Now it is possible to set the default to false in LyX, and old
documents will still be converted correctly.
2014-04-24 21:52:32 +02:00
Richard Heck
f83aab43e5 Whitespace. 2014-04-21 11:52:00 -04:00
Richard Heck
f80ef1a159 Typo. 2014-04-21 11:52:00 -04:00
Vincent van Ravesteijn
03a73a40d8 lyx2lyx: Add the 2.2 entry 2014-04-18 14:06:33 +02:00
Richard Heck
b5c2cba0b3 Fix problem with verbatim reversion. 2014-04-11 14:49:41 -04:00
Vincent van Ravesteijn
84827c8705 lyx2lyx: Set last minor version of the 2.0.x series 2014-03-23 17:48:07 +01:00
Vincent van Ravesteijn
6eba310ef7 lyx2lyx: Set conversion table for LyX 2.1 2014-03-23 17:48:06 +01:00
Vincent van Ravesteijn
5d15807954 lyx2lyx: Fix conversion table for LyX 2.0 2014-03-23 17:48:02 +01:00
Georg Baum
8f1cbe000e Fix bug #4036 (lyx2lyx produces invalid LyX 1.4.x)
I should have had a closer look much earlier, since the fix is simple and
safe, but at that time I did not notice. The problem was that an invalid
.lyx document was created when converting unicode characters with two
backslashes in their LaTeX definition from lib/unicodesymbols to pre-unicode
LyX format.
2014-02-19 21:56:00 +01:00
Richard Heck
0ded71a480 Fix silly mistake spotted by Jurgen.
Give k a more descriptive name.
Prettify a bit of the code.
2014-02-07 10:36:55 -05:00
Juergen Spitzmueller
9d6c2bf407 Fix lyx2lyx chunk conversion (bugs #8877, #8876) 2014-02-06 10:11:02 +01:00
Richard Heck
1f231c9538 Typo. 2014-01-31 09:38:00 -05:00
Juergen Spitzmueller
a7a585c7bd beamer conversion: deal with more complicated block titles 2014-01-24 09:24:12 +01:00
Juergen Spitzmueller
50066b46ab Improve beamer conversion: Support default list overlay specification without ERT 2013-12-13 14:55:34 +01:00
Juergen Spitzmueller
0aaf2f2008 Improve beamer frame conversion: frame arguments that use multiple ERTs (one ERT inset per argument) are converted 2013-12-06 11:57:33 +01:00
Juergen Spitzmueller
ac7f7dbdce Factor out identical frame argument conversion 2013-12-06 10:53:49 +01:00
Juergen Spitzmueller
0f18bc753c Improve beamer frame conversion: consider explicit EndFrames between two identical frame types 2013-11-11 09:16:17 +01:00
Juergen Spitzmueller
4741cb99c7 Improve beamer collorary argument conversion (#8828) 2013-09-03 19:02:28 +02:00
Richard Heck
3d36751849 Convert "i = i +1" to "i += 1" and similar. 2013-07-24 10:59:51 -04:00
Richard Heck
0a6e781aea Somehow this line got commented out. 2013-07-24 10:57:36 -04:00
Richard Heck
dad943ad6c Fix dumb mistake. 2013-07-24 10:56:33 -04:00