Amends 7bb30286.
Tested cases are now handled fine.
(There are still many cases where the language support emulation
is too complex for lyx2lyx and manual fixes are required after
lyx2lyx conversion.)
The objective is to identify common operations and place them
in functions in order to improve the readability and correctness of the code.
is_document_option(document, option):
Find if _option_ is a document option (\\options in the header).
insert_document_option(document, option):
Insert _option_ as a document option.
remove_document_option(document, option):
Remove _option_ as a document option.
* use unicode.transform() instead of loop over replacements
* telling variable names
* remove trailing whitespace
* documentation update
* don't set use_ligature_dashes if both dash types are found
* remove spurious warning, normalize indentation, and use
Python idioms in revert_baselineskip()
* Increase LyX format
* New function convert_info_insets in lyx2lyx_tools.py
Use this function in the future for future updates of info insets
* Convert "inset-modify tabular" to "tabular-feature" in info insets
* Remove icon naming hack regarding "inset-modify tabular"
These were using lyx2latex, assuming the result can be used in verbatim
insets as is, which is not the case (mostly due to \\backslash).
A new lyx2verbatim function is now used instead. Also, ERT insets are
dissolved in the gloss reversion process.
This brings the external inset on par with the graphics insets as far as the
clipping option is concerned. The graphicxs package supports both: A bounding
box without units (which means that bp ia assumed), and a bounding box with
units, so we can simply output the values including the units.
The escaping of symbols read from unicodesymbols was inconsistent, which lead
to wrong replacements (bug 9559). Now the escaping is consistent: unicode_reps
contains unescaped LaTeX commands, the needed escaping for LyX files is
applied in put_cmd_in_ert() and lyx2latex().
Most of the changes are related with dictionaries returning views instead of
lists.
xrange -> range (since xrange is gone in python 3)
The code that is special to support both python 2 and 3 is enclosed in a comment
\# Provide support for both python 2 and 3
and
\# End of code to support for both python 2 and 3
And so later it can be removed safely when python 2 is no longer supported.
- 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)
In particular, it makes paragraph breaks generate single \n in latex output
when ParbreakIsNewline is true
This means that it is not necessary anymore to use newlines to break lines.
Plain paragraph breaks can be used instead, like is done now in ERT/Listings.
This is mainly aimed at sweave support.
lyx2lyx support courtesy of Richard Heck
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36163 a592a061-630c-0410-9148-cb99ea01b6c8
various calls to each.
This should more or less complete the lyx2lyx orgy. Some things probably
will have been broken by accident. Hopefully not too many, and more
things that were broken got fixed.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36133 a592a061-630c-0410-9148-cb99ea01b6c8
This is crucial, because people often do put the same sort of comment as
the first line.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36110 a592a061-630c-0410-9148-cb99ea01b6c8