When closing a document with the cursor near an icon info inset, LyX
may crash on loading again the same document. This is most probably due
to the fact that compressed svg icons are first uncompressed to a
temporary file before being used. The temporary file is then deleted
but something still expects to find it in place. The exact circumstances
that lead to the crash are unknown, and maybe there is also a race entering
the picture here. However, a document that always leads to a crash can be
found attached here: http://article.gmane.org/gmane.editors.lyx.devel/154566
This commit does not fix the cause of the crash but rather avoids it.
As a bonus, the svg icons used by LyX are not uncompressed anymore before
being used, speeding up startup time. This is not a problem, because Qt
can deal with compressed svg images.
As discussed on the list, but I did not need to create two new pdf formats
since any given document either uses TeX fonts or not. For the same reason
I also added an additional converter to PDF (cropped).
The reason being the backslashes in the path. Note that escaping
does not work here because the path is being interpreted multiple
times (how many times I don't know) and that would be fragile.
For this same reason, the change is not limited to Windows.
This branch implements string-wise metrics computation. The goal is to
have both good metrics computation (and font with proper kerning and
ligatures) and better performance than what we have with
force_paint_single_char. Moreover there has been some code
factorization in TextMetrics, where the same row-breaking algorithm
was basically implemented 3 times.
Globally, the new code is a bit shorter than the existing one, and it
is much cleaner. There is still a lot of potential for code removal,
especially in the RowPainter, which should be rewritten to use the new
Row information.
The bugs fixed and caused by this branch are tracked at ticket #9003:
http://www.lyx.org/trac/ticket/9003
What is done:
* Make TextMetrics methods operate on Row objects: breakRow and
setRowHeight instead of rowBreakPoint and rowHeight.
* Change breakRow operation to operate at strings level to compute
metrics The list of elements is stored in the row object in visual
ordering, not logical. This will eventually allow to get rid of the
Bidi class.
* rename getColumnNearX to getPosNearX (and change code accordingly).
It does not make sense to return a position relative to the start of
row, since nobody needs this.
* Re-implement cursorX and getPosNearX using row elements.
* Get rid of lyxrc.force_paint_single_char. This was a workaround that
is not necessary anymore.
* Implement proper string metrics computation (with cache). Remove
useless workarounds which disable kerning and ligatures.
* Draw also RtL text string-wise. This speeds-up drawing.
* Do not cut strings at selection boundary in RowPainter. This avoids
ligature/kerning breaking in latin text, and bad rendering problems
in Arabic.
* Remove homebrew Arabic and Hebrew support from Encoding.cpp. We now
rely on Qt to do handle complex scripts.
* Get rid of LyXRC::rtl_support, which does not have a real use case.
* Fix display of [] and {} delimiters in Arabic scripts.
For Windows: AcroRd32 and gsview (both 32 and 64 bit versions).
For Unix: qpdfview.
Qpdfview is a nice alternative to Okular for KDE users and a superior
alternative to Evince for Gnome users, due to its complete synctex
support. It only depends on Qt libraries for the graphical interface.
This variable was introduced to guard against any bad consequence of the then-new right-to-left
languages support. Let's be bold and get rid of it altogether!
Now right to left support is always enabled.
It currently does not make a difference that it is before
Adobe Reader in configure.py because as Enrico points out
on Windows the default viewer configured in the OS is used.
If we call tex2lyx on a temporary file created from the clipboard, the
file is always in utf8 encoding, without any temporary changes, even if it
contains encoding changing LaTeX commands. Therefore, we must tell tex2lyx
to use a fixed utf8 encoding for the whole file, and this is done using the
new latexclipboard format. Previously, tex2lyx thought the encoding was
latin1.
As a side effect, the -e option is now also documented in the man page.
With LyX configured in this way, the user would only need to:
File > New from Template > EPS.lyx (or PDF-cropped.lyx):
- insert a math inset and type in an equation, or create whatever
content LaTeX can handle,
- view/export to cropped EPS/PDF.
This would allow for LyX to act as a "generator for includable graphics" (equations, commented graphics, etc).
This fixes bug #7839.
If you have an unmounted dir, ac_dir, in your PATH, the call to
os.path.isfile( os.path.join(ac_dir, ac_word + ext) )
hangs. This is probably a python bug, but the result of configure.py
hanging and LyX freezing is really bad, hence this workaround.
According to the python docs, MacOS doesn't provide os.access();
the hasattr protection is used for this reason.
ps2pdf by default produces the PDF 1.4 format. The PDF 1.3 format was
released in 2000. PDF 1.4 was released in 2001. LyX specified 1.3 as
the output version in 2002 (c1541c22), perhaps because at the time
PDF 1.4 was only a year old so some viewers did not support it.
When using CMake, the binary files are stored in <build-dir>/bin. LyX can't fin tex2lyx with the current code. So, we have to point configure.py to explicitly look in the binary dir.
Before, the converter chain for DocBook -> PDF (ps2pdf) was:
docbook -> DVI
DVI -> Postscript
Postscript -> PDF (ps2pdf)
sgmltools has a backend for PostScript so the first two
steps in the above converter chain are now condensed into
one by adding the following converter for docbook -> Postscript:
sgmltools -b ps $$i
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.
If you do not explicitly specify the output file name, gnuhtml2latex will
guess a file name itself. The result of the guess is not what we expect if
the input file name did not contain a .html extension, but something which
is not related to a format, e.g. .qV9984 from FileName::tempName().
Previously, the format used for included pdf files was the same as for
document export via ps2pdf. This caused unwanted conversion routes, e.g.
export via odt->pdf instead of dvi->ps->pdf.
I renamed the format for included graphics and not for exported documents,
since otherwise the command line syntax for export would change. This would
require more adaptions for the users, since with the chosen solution the
custom converters are almost always changed correctly in prefs2prefs(),
so that only custom external templates need manual adjustement.
Now that we have module support for literate programming, it is possible to do a noweb cleanup. This is basically a patch from Kayvan Sylvan:
- get rid of literate-xxx classes
- rename Scrap to Chunk, since this is the name noweb doc uses (Scrap is from nuweb)
- update lyx file format and add lyx2lyx support for gettting rid of literate-xxx classes
- update documentation
On the top of it, update tex2lyx to
- avoid creating files with literate-xxx class
- fix conflict between parsing << as a quote and parsing it as a Chunk
- create Chunk layouts instead of Scrap ones.
On windows the temporary filename consists of uppercase characters. This
causes that the extension does not get replaced, and the logfile is left
behind.
Checking the extension case insensitively will correctly remove the
logfile.
The Windows shell cannot have a UNC path as the current directory.
However, using pushd to change to the same directory automatically
maps the UNC path to a drive letter and thus it works.
Note that when calling cmd.exe from a UNC path there are still
warnings about the UNC path, but the command is then successfully
executed because the current directory is set to something digestible
by the shell.
- Remove ps->eps converter (see comment for the reason)
- Remove odg-> and odg->pdf converters, since they create A4 sized images
- Get rid of file extension assumption in eps2->eps converter
- Rename eps2 format to better reflect its usage
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@40650 a592a061-630c-0410-9148-cb99ea01b6c8
or any other graphic format that:
- is exportable to EPS
- could not be explicitly exported to PNG yet (i.e., source to PNG was not reachable on the converters graph)
Now, adding the EPS to PNG conversion explicitly allows LyX to find the conversion path.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@39786 a592a061-630c-0410-9148-cb99ea01b6c8
Now you can:
-) include in LyX OpenOffice drawings (.odg or old .sxd files)
-) preview them on the screen
-) view them in the final .ps/.pdf output
-) edit them externally via libreoffice, ooffice, oodraw or soffice (whatever is detected).
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@39706 a592a061-630c-0410-9148-cb99ea01b6c8
(e.g., compressed dia, odg, sxd, ...). These need to be marked via the "zipped=native" flag in the RC file.
The old 'dia' configuration is automatically updated (it used to be hardcoded in the code, now it is handled
via the flag).
See also http://www.mail-archive.com/lyx-devel@lists.lyx.org/msg170974.html
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@39705 a592a061-630c-0410-9148-cb99ea01b6c8
Issues #6339 and #7579 were fixed by specific code targeting those
RC entries. This commit fixes the detection of java and perl scripts
in a general way. As a result:
- The detections of jfig3-itext.jar and jfig3.jar, which where
previously overlooked, are now also fixed, and
- Future additions of java and perl scripts to configure.py are
straight forward.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@39699 a592a061-630c-0410-9148-cb99ea01b6c8
The check on dv2dt and dt2dv is not necessary, since even if these
are not available, we fall back to the legacy convertion method,
which uses ghostscript, and which is available in all cases.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@39698 a592a061-630c-0410-9148-cb99ea01b6c8
- Add "htm" as a known extension for HTML.
- Use all the extensions of a format as file filter,
instead of using only the default extension.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@39671 a592a061-630c-0410-9148-cb99ea01b6c8
Additionnal extensions are separated by commas (,) in lyxrc
preference files, while spaces are ignored, e.g. "jpg, jpeg".
Preference lyxrc file format incremented to 2.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@39670 a592a061-630c-0410-9148-cb99ea01b6c8
- Japanese is now handled by passing the option --latex=platex
to the standard lyxpreview script. This is done in PreviewLoader.
- Remove obsoleted file lyxpreview-platex2bitmap.py and the
corresponding lines in the configure script.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@39659 a592a061-630c-0410-9148-cb99ea01b6c8
- Handle the preprocessing in the main lyxpreview script with the
command-line arguments --lilypond and --lilypond-book=exe.
- Remove the obsoleted file lyxpreview-lytex2bitmap.py and the
corresponding lines in configure.py.
Fix for the japanese preview still to come.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@39658 a592a061-630c-0410-9148-cb99ea01b6c8
Add command-line arguments in a standard unix fashion, using getopt.
Usage: ./lyxpreview2bitmap.py <options> <input file>
Options:
-h, --help: Show this help screen and exit
--dpi=<res>: Resolution per inch (default: 128)
--png, --ppm: Select the output format (default: png)
--fg=<color>: Foreground color (default: black, ie '000000')
--bg=<color>: Background color (default: white, ie 'ffffff')
--latex=<exe>: Specify the executable for latex (default: latex)
The colors are hexadecimal strings, eg 'faf0e6'.
The changes to PreviewLoader.cpp break the preview of lilypond-book
and japanese files, but they will be handled in the next commits.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@39657 a592a061-630c-0410-9148-cb99ea01b6c8
Remove the hack with os.environ and instead directly search for
../src/tex2lyx/tex2lyx relative to where configure.py is found.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@39643 a592a061-630c-0410-9148-cb99ea01b6c8
We still define the tex2lyx converter but we emit a warning.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@39642 a592a061-630c-0410-9148-cb99ea01b6c8
They were tied to undefined formats ods and xls. The actual
internal names for these formats are oocalc and excel.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@39641 a592a061-630c-0410-9148-cb99ea01b6c8
This code seems unnecessary since not_found = "auto" is set in
checkViewer, and thus "auto" is used as the viewer when no viewers
are found, and a lyxrc entry is added anyway. The "auto" string is
special-cased in the code, where we attempt to automatically
determine the viewer from the OS.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@39640 a592a061-630c-0410-9148-cb99ea01b6c8
command hangs if something goes wrong. Also allow any kind of line endings.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@39553 a592a061-630c-0410-9148-cb99ea01b6c8
python 2.7 and throws unwanted exceptions when the process
return value is not 0
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@39533 a592a061-630c-0410-9148-cb99ea01b6c8
This will make reverting the previous commit easier.
This reverts commit 82ab1aef334d8573cc3e861e2620d9b4c59f88fe.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@39532 a592a061-630c-0410-9148-cb99ea01b6c8
(patch from yihui, part of #7555)
http://www.lyx.org/trac/ticket/7555#comment:18
This adds the new format "R/S code" with extension .R and a converter from .Rnw.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@39509 a592a061-630c-0410-9148-cb99ea01b6c8