Commit Graph

1050 Commits

Author SHA1 Message Date
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
Richard Heck
c1ead6afa1 Simplify a bunch of lyx2lyx code. 2013-07-24 09:56:02 -04:00
Richard Heck
2cdf3d2f6e Remove debugging code. 2013-07-24 09:48:11 -04:00
Richard Heck
96bb5f6dd7 Move helper functions where they belong. 2013-07-24 09:47:14 -04:00
Richard Heck
556a195033 Fix problem with Initial layout conversion reported by Scott on
the list.
2013-07-24 09:41:59 -04:00
Georg Baum
822e171762 Fix inconsistent version in .lyx files (#7951)
LyX, lyx2lyx and tex2lyx produce now all the same version indicator consisting
only of the major and minor version. It is not decided yet whether future
development versions will add a -dev suffix, but for 2.1.0 this change fixes
the inconsistencies.
2013-07-13 16:02:26 +02:00
Juergen Spitzmueller
50426600db Fix beamer frame conversion 2013-07-04 18:25:04 +02:00
Richard Heck
89ced5c3c3 Fix problem with chunk lyx2lyx conversion spotted by Scott.
We assume chunks come at us in a certain form. If not, then
we cannot handle the conversion. In that case, we just leave
the chunks as they were and they will appear as unknown layouts.
2013-06-03 13:01:39 -04:00
Richard Heck
8f044f3c95 Patch to convert Sweave chunk paragraphs to insets (bug #8588). Work
by Liviu (C++) and Richard (Python).
2013-05-30 10:20:34 -04:00
Uwe Stöhr
6c0bc842b7 moderncv.layout: support the command \social
- \social can be used for social network addresses in the address block
2013-05-29 01:11:14 +02:00
Uwe Stöhr
ea2d5947e9 support to set Tibetan as document language
- polyglossia supports http://en.wikipedia.org/wiki/Standard_Tibetan so we can support it too
- fileformat change
2013-05-28 23:40:17 +02:00
Uwe Stöhr
e28625160a aa.layout: updated for A&A 8.2 2013-05-26 05:29:24 +02:00
Jean-Marc Lasgouttes
f04c7711b0 Fix empty width support for Box inset
* InsetBox and GuiBox: Use proper empty length instead of the broken -9.99col% trick
* some slight changes to the logic of GuiBox to make sure that values are set as needed.
* lengthToWidget(): handle properly the empty length case. All the other related Qt helpers did it already, it was probably an oversight. Also set the default_unit parameter as optional (not needed in this patch actually, but I got carried away :)
* allow generating LaTeX code for an empty length, since some broken code does that.
2013-05-24 15:44:59 +02:00
Richard Heck
eba17c9763 Update documentation for parser tools a bit. 2013-05-23 16:11:47 -04:00
Julien Rioux
cde541d785 New \cite_engine_type default.
The default citation capability of LaTeX is not a true numerical
citation engine, rather it uses a mixture of labels/numbers. Thus
we now distinguish them: "numerical" always increments the bibitem
counter and uses its value as a numerical citation label, while
"default" only uses the bibitem counter when no label is provided.

LyX file format incremented to 471.
2013-05-16 20:39:23 +02:00
Georg Baum
7bdc34a987 Implement forced local layouts
These should be used if any new style needs to be introduced in the stable
2.1 series: If the ForceLocal flag of the style is set, it will always be
written to the document header, so that even older 2.1 versions can read
and correctly output the document.
2013-05-15 07:19:49 +02:00
Uwe Stöhr
d750b6610f fix some more typos spotted by Yuri 2013-04-19 23:26:58 +02:00
Georg Baum
c61ef8b205 Support \caption* (bug #3209)
This was a low hanging fruit which would have to wait for a long time because
of a file format change if it was not implemented before 2.1.
2013-03-22 22:23:38 +01:00
Uwe Stöhr
22ad7e4369 support for \mbox and \fbox
- fileformat change
- it was a pity that LyX did not yet support a simple rectangular frame without a defined width but LyX did this for e.g. oval frames
- \fbox and \mbox often occur in TeX files and can now be imported
2013-03-22 01:33:58 +01:00
Uwe Stöhr
b79bc9b566 lyx2lyx/lyx_2_1.py: typos 2013-03-21 02:11:42 +01:00
Uwe Stöhr
f08f5821ec support for the Iwona fonts
- the support for Iwona is exactly the same as for the Kurier fonts
- fileformat change
2013-03-19 00:57:37 +01:00
Juergen Spitzmueller
d8be21fb6c Capitalization fix.
This would be a file format change, but since the previous version is just two hours old, I will do without.
2013-03-18 15:06:49 +01:00
Juergen Spitzmueller
3ab2798b6e Powerdot updates
* Powerdot now also uses the native overlay item arguments
* a list option argument is finally available
* \pause natively supported (like in beamer)
* support for \onslide (via InsetFlex)
* support for \twocolumn

File format change.
2013-03-18 13:36:56 +01:00
Juergen Spitzmueller
4e803c7ebf Fix beamer frame title coversion 2013-03-17 08:40:38 +01:00
Juergen Spitzmueller
370bbbc7f2 Old beamer frames bite the dust
With this commit, old beamer frames are converted to new ones. The old styles are removed (including the infamous \lyxframe).

This should be tested with as much beamer documents as possible (I have already done so), also, tex2lyx now probably produces invalid LyX files.
2013-03-16 12:52:00 +01:00
Georg Baum
13d4b59ac5 Small tweak to cancel revertion
From version 425 to 463, the cancel package is used automatically.
Take this into accound when converting to old formats: For the step
464->463 do nothing if cancel was set to auto. For the step 425->424,
add the \usepackage statement as before.
2013-02-28 21:03:07 +01:00
Kornel Benko
8f36aef17a Added "cancel" to the GUI handled list of LaTeX packages.
Generalized convert_use_???() and revert_use_???() routines in lyx2lyx.
2013-02-27 13:12:03 +01:00
Georg Baum
d2d0f1964d Fix lyx2lyx for layout files with umlauts
lyx2lyx died with UnicodeDecodeError: 'ascii' codec can't decode byte if a
layout with a non-ASCII character in the file name was used, since the
textclass member of the LyX class was of type str, and not unicode.
2013-02-23 12:23:29 +01:00
Julien Rioux
9dd1b7c578 Use the LyX name of encodings instead of the LaTeX names.
- Use the LyX name of encodings instead of the LaTeX names.
  The LyX name must be unique, while the name used by LaTeX
  not necessarily, e.g. different packages might implement
  support for the same encoding.

- Rename koi8 to koi8-r, so that the LyX and LaTeX names match.

- Rename euc-jp-plain to euc-jp-platex, jis-plain to jis-platex
  and shift-jis-plain to shift-jis-platex.

- Add utf8-platex encoding (fixes #8408).

LyX file format incremented to 463.
2013-02-18 23:52:42 +01:00
Uwe Stöhr
eabe77839b moderncv.layout: update to modernCV 1.3
- this new modernCV version fixes the annoying linebreak bug I was suffering so long, it moreover adds 2 new features

- lyx2lyx/lyx_2_1.py: updated to revert the new features
2013-02-16 01:02:32 +01:00
Juergen Spitzmueller
6885007f1d Adjust Libertine font support to most recent version
This needs yet a file format change. I hope the interface is stable now (I had an exchange with the package maintainer, Bob Tennent, about that)
2013-02-15 10:45:11 +01:00
Juergen Spitzmueller
557e2f5ef9 Simplify support for kurier fonts 2013-02-12 20:33:42 +01:00
Uwe Stöhr
487d3bffab support for the kurier sansserif fonts
- fileformat change
2013-02-11 00:47:09 +01:00
Uwe Stöhr
33e185e5ed IEEEtran.layout: support for conference articles
- IEEEtran-Conference.lyx: new template for conference articles of the IEEE
2013-02-09 03:23:34 +01:00
Uwe Stöhr
7c98a16fbb IEEEtran.layout: support command \IEEEPARstart 2013-02-07 02:01:57 +01:00
Uwe Stöhr
a68122d690 - lyx_2_1.py: support for modernCV
- moderncv.layout: whitespace fixes
2013-01-27 05:25:00 +01:00
Uwe Stöhr
b42604c7aa lyx_2_1.py: support fir initial.module
- in [ff718eba/lyxgit] I forgot to force the lyx2lyx conversion, fixes #8515
2013-01-22 23:27:18 +01:00
Juergen Spitzmueller
3cc6dae63f More beamer reversion fixes 2012-12-31 14:30:44 +01:00
Juergen Spitzmueller
0c06a212e3 Beamer reversion fixes 2012-12-31 14:09:54 +01:00
Juergen Spitzmueller
846dd9b995 Introduce new beamer frame layouts
The old layouts are still there (marked as deprecated). The new ones are more or less correctly reverted (polishment required), but the old ones not yet converted to the new. Once this is done, a further file format change should be made.
2012-12-31 13:00:46 +01:00
Juergen Spitzmueller
c246076ed5 Fix the 'caption inset mess' (bug #4647) 2012-12-30 18:29:02 +01:00
Georg Baum
56ece75ad9 Fix bug #8464: stackrel with subscript.
The fix is basically mechanical, the additional code for fraction like insets
with three arguments was stolen from \unitfrac. As any math package,
stackrel.sty needs a buffer parameter to switch it off.
I also added the two stackrel flavours to the toolbar.
2012-12-28 20:08:43 +01:00
Juergen Spitzmueller
d4a00c1a8a tex2lyx glitch 2012-12-28 14:04:24 +01:00
Georg Baum
13b288bc5e Remove duplicate symbols
There were found with -dbg mathed ans entering a math inset.
I kept the AMS versions, except leadsto, which is only an approximation in AMS.
hbar was simply defined twice with identical definitions.
2012-12-28 13:25:42 +01:00
Juergen Spitzmueller
78cd88f5a3 Proper support for memoir epigraph (bug #8151) 2012-12-28 12:32:59 +01:00
Juergen Spitzmueller
483b99193f Support for beamer \frametitle
The \frametitle command is less convenient to use than the \frame argument, but it provides more options (overlay/action and short title). We thus provide this additionally to the option, like beamer itself does.
2012-12-22 16:28:43 +01:00
Juergen Spitzmueller
4818b3e68a Add (overlay-aware) beamer bold inset 2012-12-21 16:42:55 +01:00
Juergen Spitzmueller
ef541d474c Improve overprint conversion.
Deeply nested sequences are still problematic.
2012-12-20 13:29:04 +01:00
Juergen Spitzmueller
4f36061811 Proper support for beamer overprint environment
This has a list-like structure (with \onslide item commands). The previous implementation was rather useless, since it required lots of ERT. Since the new implementation is so different, we use ERT for conersion/reversion.

The lyx2lyx routines are not yet perfect, though.
2012-12-19 19:33:39 +01:00
Georg Baum
f67cf6f4bb Add support for stmaryrd.sty (bug #8434)
The stmaryrd package adds support for lots of math symbols, using a font
designed to accompany the computer modern fonts. The changes in detail:

- Fix generate_symbols_list.py to work with stmaryrd.sty. It loooks like it
  was automatically translated from a perl version and never used.
- Generate the new symbols in lib/symbols using generate_symbols_list.py and
  add some manual adjustments
- Generate stmary10.ttf by a simple ttf export from stmary10.sfd with fontforge
- Add license info for stmary10.ttf
- Create a test file with all symbols from stmaryrd.sty. Actually it would be
  nice to have this for the other fonts as well.
- The mechanics: lyx2lyx, tex2lyx, font machinery etc.
2012-12-15 13:10:31 +01:00
Juergen Spitzmueller
d073cfb458 Support for beamer block arguments (#3280) 2012-12-09 17:19:21 +01:00
Juergen Spitzmueller
bc5582cbc4 More refinements in the lyx2lyx methods 2012-12-09 13:43:13 +01:00
Juergen Spitzmueller
95934b8d27 Some refinements in the lyx2lyx methods 2012-12-09 13:41:42 +01:00
Juergen Spitzmueller
280861cd7d Consider paragraph params when placing arguments at paragraph start (#8449) 2012-12-09 11:40:14 +01:00
Juergen Spitzmueller
30b53ba4a0 beamer revision, part 1: support for overlay arguments 2012-12-09 11:04:56 +01:00
Juergen Spitzmueller
a84a98b545 Also add support for URW Garamond math fonts (via newtx) 2012-12-04 12:55:47 +01:00
Juergen Spitzmueller
52c2fb81e9 Support for the URW Garamond LaTeX fonts 2012-12-04 12:14:26 +01:00
Uwe Stöhr
5dc6293d07 europeCV: complete revision of layout and example file
- also fix in the generic conversion routine the cases
  - that there are one or more optional arguments before the mandatory ones
  - that the conversion does not start with the first argument of a command
2012-12-04 00:55:39 +01:00
Juergen Spitzmueller
f8df33c2fd Fix unused get_containing_inset and get_containing layout parser methods and use the latter 2012-12-03 08:42:26 +01:00
Juergen Spitzmueller
50fe522d03 Cut and paste error 2012-12-02 17:10:46 +01:00
Juergen Spitzmueller
e250fd46ea Some more lyx2lyx fixes 2012-12-02 16:47:27 +01:00
Uwe Stöhr
6c70da4d9e Merge branch 'master' of git.lyx.org:lyx 2012-12-02 15:58:22 +01:00
Uwe Stöhr
ecc0d198df acmsiggraph: complete revision of layout and template file
- also support in the lyx2lyx argument conversion routine the case that "}{" appears in 2 consecutive ERTs
- also fix in lyx2lyx_tools.py the output of ERTs (it is important that we write the same amount of lines as if the ERT would have been inserted via LyX 2.0 or lyX 2.1)
2012-12-02 15:58:14 +01:00
Juergen Spitzmueller
1e681cdc80 Fix lyx2lyx (#8438) 2012-12-02 15:19:40 +01:00
Juergen Spitzmueller
7d1c8b5dc8 Provide convert_arguments with some knowledge about our layouts and modules 2012-12-01 15:28:10 +01:00
Juergen Spitzmueller
e235b96378 Working lyx2lyx reversion of Argument insets. Pythonists, please review 2012-11-30 12:57:55 +01:00