This commit adds the mathed command \mathds that selects a
font more appropriate than \mathbb for typesetting the
mathematical symbols for the natural (N), whole numbers (Z),
rational numbers (Q), real numbers (R), complex numbers (C),
and some others.
As in the \mathbb case, only capital letters are supported,
but in addition one can also typeset a symbol often used for
representing the indicator function (\mathds{1}) and the
letters a, h, k.
Fixes bug #11887.
The above mentionned patch did paint the background of the sublabel to
avoid "bold-like" effect. However the correct backgound color is the
row's one, not the inset's one.
To fix this, extend MetricsInfo::backgroundColor to work when no inset
is specified. The code is also simplified as in master.
(cherry picked from commit 74540c9896)
(cherry picked from commit a71b96ac42)
note-next and reference-next should trigger an update so that metrics
are updated when the cursor ends up in an auto-open inset.
Fixes bug #11870.
(cherry picked from commit 7761e1317e)
The binding <Alt + p, Shift + Return> is already used for
environment-split outer, so we bind <Alt + p, Alt + Return>
to environment-split before.
(cherry picked from commit 386aba099b)
Before, we would continually set the selection to the empty string,
to maintain ownership. This causes problems with clipboard managers
GPaste and CopyQ. Further, in theory this should have better
performance since checking ownership should be faster than setting.
A disadvantage of this change is that the timestamp of the selection
will be old at this point in the code. However, when the selection
is requested, we put the selection contents at that point so the
selection timestamp should be accurate then. Further, the selection
contents are not accurate at this point in the code (they are just
the empty string), so it is not clear whether having an accurate
timestamp is beneficial.
Fixes#11715.
(cherry picked from commit af4ee1a487)
(cherry picked from commit 23abb5aaa3)
Make sure we are actually at the end of the document before issuing
\maketitle because we are at the end of the document.
(cherry picked from commit 7af6575cf6)
This was already done for gcc9 and saves tons of warnings.
Note that the warning in Qt are gone with Qt5.13, so eventually we
will have to get rid of our own copy issues.
(cherry picked from commit e9e8069b17)
(cherry picked from commit db5021c42e)
There are two techniques that I know of for forcing the direction of a
string, regardlessly of whether its contents is naturally LtR, RtL or
undecided.
1/ The unicode LTR/LTR override characters. This is supposed to be the
clean way, however, it does not seem to work with Qt 5.14 (see
#11691).
2/ The undocumented QTextLayout::setFlags method. This is used
internally and allows to pass the (undocumented) flags
Qt::TextForceRightToLeft and Qt::TextForceLeftToRight. This was
used until we had issues with Qt 5.11 (see #11284).
In order to get the best of both worlds, this patch allows to enable
those two methods separately, and actually enables both at the same
time by default!
Fixes bug #11691.
(cherry picked from commit 4d6041a7b6)
As a consequence of fix e64ea357 to ticket #10797, we draw a bit too
much of the inset background outside of the inset (visible for insets
with colored background). #10797 is a ticket that triggers when the
cursor has a width larger than 1.
This patch limits the problems in two respects
* nothing is done on the left, since the cursor width only expands on
the right.
* on the right, the extra width is limited to cursor width.
Fixes bug #11786.
(cherry picked from commit eb92f74d1f)
Move cursor at beginning of selection after deletion. Else backspace
operation gets stuck in a loop (tries to remove the selection again
and again).
This also fixes backspace deletion of insets with confirmDeletion() == true.
Fixes#11630
(cherry picked from commit adfd38e4ef)
If the file of an InsetInclude does not exist, loadIfNeeded will try
again and again to look for it. This is very bad for files with many
include insets, especially on windows.
Fixes bug #11656.
(cherry picked from commit aeed6fb8fa)
This is better than making sure that the inset has exactly one cell.
In the future, inset-dissolve could be extended to dissolve all the
cells contents in the enclosing text.
Note that this check does not appear in mathed, and using dissolve in
e.g. fraction inset may lead to data loss (only current cell contents
is preserved).
(cherry picked from commit 5ac3b88007)
Prevent that another processor (such as xindy) is used when set in prefs.
xindy does not play well with hyperref.
Fixes#11708
(cherry picked from commit cb25603ae1)
This patch is not ready yet. Moreover, change the assertion in
InsetMathGrid::colAlign to a simple test.
As a consequence, math split inset might show a bad alignment in some
situations.
This reverts commit d3fd915662.
Like with macOS, the Wayland compositor seems to require a
backingstore when doing partial updates like we do.
This extends the mechanism that has been introduced for macOS. This
has to be done at run time, not compile time.
Fixes bug #11692.
(cherry picked from commit 575761c665)
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.
(cherry picked from commit 8dd31803b1)
Recent gcc versions return a short version with -dumpversion, e.g. 9.
In this case, use -dumpfullversion, which gives something like 9.1.0.
This makes the gcc 9 detection work properly.
(cherry picked from commit 44bbd0b0ef)
Using a map would sort the elements in alphabetic ordering, which
means that when the number of elements is larger than 100, the wrong
elements get pruned.
This commit uses a list instead. Searching an item needs linear time,
but this should not be a problem for a list with less than 100
elements.
Fixes bug #10310.
(cherry picked from commit 58d22e0c6e)
Make InsetGrid::colAlign a normal method and make it check whether
buffer is valid before using it. This avoids crashes as we have seen
in 2.3.3 (see e.g. #11686).
There is still an assertion so that failure is noticeable before release.
(cherry picked from commit 44816adce6)
Horizontal scrolling used to be taken into account when updating caret
geometry. This is wrong since it may have changed when time comes to
draw the caret. This leads to a situation where the first apparition
of the caret is at a wrong place.
Now the extra horizontal offset is used at drawing time.
Fixes bug #11603.
(cherry picked from commit bdf58b77e7)
When automatic command termination was added to texstream it was
forgotten to reset its status after a math inset.
(cherry picked from commit 0573bf92e0)
When a selection spans more than one line, we now check for whether
there is a change at one position after the last position of each
fully selected line.
This fixes#11629.
(cherry picked from commit 27f89144bb)
More complicated than I wished for, but color handling in RTL is
particularly tricky.
The three versions are needed due to the differences between [pdf]latex,
xetex, luatex/luabidi and luatex/babel.
(cherry picked from commit 4e74dd0d42)
Loading keyval does not work any longer. Fix it properly by de-activating
the equal character locally if graphics options use it.
We do this statically for Turkish and Latin in stable, as opposed to
master (where we have the ActiveChars languages tag)
See the discussion. The decision was just to keep re-trying for a
bit, since the lock preventing us from removing the old file seems
to clear after a bit.
(cherry picked from commit d96a9aa37f)
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.
(cherry picked from commit 642b4acca1)
Do not replace a latex command with the corresponding symbol
in the unicodesymbols file unless it can be encoded in the
document encoding.
The mhchem \ce inset is a text mode environment but allows entering
spaces and mathmode commands. However, even if it doesn't allow unicode
symbols, LyX allows entering them (by copy/paste, for example), causing
latex errors. As a unicode symbol may have a proper latex representation
from the unicodesymbols file, use it instead of the bare symbol. Here, we
don't care about the mode because both text and math mode should be allowed.
For example, the ⟶ symbol is not recognized but its latex representation
(\longrightarrow) is fine. Of course, there may be symbols that are
not recognized anyway, but this is better because they cause explicit
errors from mhchem instead of cryptic iconv errors in case they cannot
be represented in the document encoding.
A branch inset modifies the layout of the internal structures in
which the text is organized. When a branch is active, it is as if it
was not there, but its only presence makes a paragraph which would not
be the last one to actually be the last one, or the check for the
language of the previous paragraph to fail because there is no
previous paragraph before the first one in a branch inset.
Oney way I found to tackle it, is tracking whether the typesetted
paragraphs are actually part of an active branch inset and acting
accordingly.
The "Rows & Columns" optional submenu is more easily accessible in
the math context menu rather having to navigate to the "Edit" menu.
All possible accelerators are already taken, so use the space bar.
(cherry picked from commit ff7eb0eb38)
Avoid an endless loop when in the definition of a macro the macro
itself is used in the LyX representation part.
(cherry picked from commit 1cb2a443b5)
The current heuristics only considered modules with styles that defined
a searched command in their preamble, and only for commands/environments
that were defined in the document's preamble. This limited the module
support drastically.
The new heuristics also checks for commands coming from packages. If the
command is not (re-)defined in the document preamble, it checks modules
that provide a style with a matching LaTeXName, checks for their
requirements and matches those with the packages loaded by the document.
If no module provides a searched style, but we found modules that load
packages that are loaded in the imported tex file, and if those packages
are not auto-loaded by LyX anyway, we also load this module.
fixes: #11259, part of #8229
(cherry picked from commit 0b54650f0e)
This is a much less invasive version of da2696cc+da2696cc, which
reduces the risk to a minimum. There may be other Row members that
need resetting, we'll see that later.
Fixes bug #11396.
This is hardcoded for now for simplicity and to allow backporting to
2.3.
The behavior is unchanged for all languages but Chinese, Japanese or
Korean.
Fixes part of bug #10299.
(cherry picked from commit 26c2811cc4)