Disable conversion cache because all lyx instances use the same cache without
any locking between read and write to the cache.
Thanks to Scott catching this case.
Needed font-config (so that this script is probably OK on unix systems only)
Probably needed module for Getopt::Mixed.
On debian systems it is contained in package libgetopt-mixed-perl
The log file generated by latex can contain strings encoded in
whatever supported encoding. Instead of guessing the encoding,
it is better to open it in binary mode and then performing the
necessary comparisons as "bytes". In order to do this, the
strings are encoded in utf8, so that, for example, b"pythön" is
encoded as "pyth\xc3\xb6n" (7 bytes). Of course, this means that
we can only successfully perform comparisons with ascii strings.
However, this is what we actually do, as we only search for
ascii strings in the log file.
Unfortunately, stat.st_ino returns 0 on Windows, at least on Python 2.7, so we can't use that way of telling when we're seeing the same directory again. Surely the real pathname should work.
Three backslashes are needed before a LaTeX command, not one. Before
this commit, the code gave the following error with Python >= 3.6:
re.error: bad escape \g at position 29
This error was introduced with Python 3.6, as documented [1] by the
following line of documentation:
Changed in version 3.6: Unknown escapes in pattern consisting of
'\' and an ASCII letter now are errors.
Although previous Python versions did not give an error, the regular
expression was not working as intended: for example, the "\\n" in
"\\newcommandx" would be interpreted as a new line.
[1] https://docs.python.org/3.6/library/re.html#re.sub
Instead of wait(), use communicate(), as mentioned here:
https://docs.python.org/3/library/subprocess.html
Otherwise, the process seems to hang as cautioned in the above URL.
Also, use byte strings.
This allows to support classes that don't use the Xpaper wording.
Add support for KOMA font (keyval) syntax on top of that.
Also support class-specific font and paper sizes in tex2lyx.
File and layout format change.
By default, the behavior is the same as before, except that the
language of new document is not unconditionally en_US anymore.
The new checkbox "Respect OS keyboard language" (off by default)
governs this behavior.
Update prefs format to 30.
Nix (https://nixos.org) is a Unix package manager, which can be used to
install LaTeX on macOS. A peculiarity of Nix is that all packages are
installed into separate directories and the actual directory tree is
then constructed via symlinks.
This interacts badly with the way LyX currently detects files in the
TeX setup, because TeXFiles.py does not follow symlinks. Therefore,
almost nothing is found when using LyX together with Nix’ LaTeX.
Patch from Michael Roitzsch.
In python it is possible to compare tuples with a lexicographic order.
Take advantage of that since there is no need to resort to the C-trick of converting a version in hex format.
We need to set a dummy version in case we are using ImageMagick to ensure that version is always an integer 3-tuple.
It worked in python2 but not the way the authors imagined. Because hex always returns a string.
From python2:
>>> 1 > "2"
False
>>> "2" > 1
True
>>> "1" > 2
True
The rational is that an integer is always smaller than a string.
In python 3 this because it does not make sense to compare objects of different types.
This is related to the bug #11457 saga and it was my fault.
The debug files should be written only be on if the argument --debug is passed and not --verbose as it was done by mistake.
This effectively allow paragraph breaks in insets only for cosmetic
reasons (e.g., to align contents on different lines).
This is the last change necessary for an enhanced covington gloss support
(which uses the new covington gloss ui)
In python 3 the colors need to be strings and not bytes:
This was the equivalent of
>> print("%s" % b"1")
"b'1'"
since the colors were bytes the call to dvipng was something like
dvipng -Ttight -depth -height -D 115 -fg "b'rgb 0.937255 0.941176 0.945098'" -bg "b'rgb 0.137255 0.149020 0.160784'" "lyxpreviewxBJEqm.dvi"
Note the "b'rgb after both -fg and -bg that wrecked havoc and thus dvipng failed. That was the difference between python2 and python3 calls.