The equation number is now correctly generated when using
\ref in \tag, but if equations are numbered within sections,
the \tag'ed equations in the first sections are numbered wrongly.
However, I think this is a preview.sty bug not a lyx one.
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.
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
Remove support for python 1.x (really)
This code has not been used for a long time, probably never, since some code
above requires at least python 2.4 to work.
I got to this code by running futurize from python-future. There are no
significant warnings, mostly are related with the division but since
we are dividing floats there is no change between python 2 and 3.
Fedora ships these chmod 644 and has never seen a problem. The advantage
to doing this is that it better controls what version of python we are
using to launch the script, and it will reveal if we're somehow somewhere
not controlling that properly.
gnuhtml2latex does not handle encodings at all. Therefore the result is not
imported correctly by tex2lyx if the HTML file is encoded in anything else
than ascii or latin1 (the default of tex2lyx). The simple wrapper script
loads inputenc if needed. It may not be possible to compile the result with
LaTeX, (e.gif utf8 is used), but for running tex2lyx it will work just fine.
In particular, lilypond-book is just a python script. On windows,
we need to call the python interpreter, using the full path to
the script while being wary of spaces in the path.
For example, find_exe(["bibtex -min-crossrefs=7"]) should search for
bibtex and if it is found, return the string "bibtex -min-crossrefs=7".
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@39794 a592a061-630c-0410-9148-cb99ea01b6c8
Introduce --debug and --verbose flags to control output. Also, use the
python subprocess module to capture stderr from external commands, thus
bumping the python requirement to version 2.4 or later.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@39660 a592a061-630c-0410-9148-cb99ea01b6c8
Move some common variables to lyxpreview_tools. Otherwise,
add a few variable names, making it easier to track things.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@39656 a592a061-630c-0410-9148-cb99ea01b6c8
Whitespace and line endings only, in preparation for some serious work.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@39655 a592a061-630c-0410-9148-cb99ea01b6c8
when latex fails with a preview. Fixes bug #7303 (IP fails with hyperref).
Patch by Ale with suggestions from Enrico
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@38243 a592a061-630c-0410-9148-cb99ea01b6c8
* src/PreviewLoader.cpp:
- add conditions for preview with pdf output
* lib/scripts/legacy_lyxpreview2ppm.py:
- if no dvi preview file is available, check for a PDF file
and process that, if found
- also produce png output, if requested.
* lib/scripts/lyxpreview2bitmap.py:
- if no dvi preview file is available, check for a PDF file
and process that, if found
* lib/scripts/lyxpreview_tools.py:
- move some common functions here
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@25419 a592a061-630c-0410-9148-cb99ea01b6c8
* src/support/os.[Ch]
(python): new function, return the python command
* lib/lyx2lyx/lyx_1_5.py
(revert_font_settings): replace tabs with spaces
The rest is simply s/python/python -tt/ and
s/"python"/lyx::support::os::python()/ where appropriate.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14270 a592a061-630c-0410-9148-cb99ea01b6c8
Implementation is as similar as possible to the well-tested code in the
1.3.x tree.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@8878 a592a061-630c-0410-9148-cb99ea01b6c8