Since be836909c5 the positioning of super- and subscripts
for symbol fonts has been broken because the metrics of the
font of the environment (rather than those of the symbol itself)
were used.
These are now properties of insets that can be operators :
InsetMathSymbols, InsetMathDecoration (for over/underbrace) and
InsetMathMacro (for its contents).
Each of these has a limit_ member that allows to remember a limit
forcing and a member defaultLimits() that indicates what to do in the
absence of such forcing. Moreover the write() method calls
writeLimits().
This allows to simplify the definitions of integrals in lib/symbols by
defining the integrals as macros of their "op" version, as it is done in
the style files.
Also, many hardcoded assumptions can now be removed.
The handling of LFUN_MATH_LIMITS is now done in InsetNest, which tries
successively to apply the limit change to (1) the character after
cursor, (2) the character before cursor and (3) the character at the
end of the inset (useful for script insets?)
The new code allows to define
\newcommand\int{\intop\limits}
but not
\newcommand\makelimits#1{#1\limits}
It is also possible to type explicitly \limits or \nolimits to modify
a symbol.
The goal is to reproduce the change of size of operators like \sum wen they
are in display style.
The syntax of the symbols file has been extended to allow for two code
points (like 80|88 for \sum). In this case, the second one will be
used in display style.
Update the symbols file to handle all bigops from cmex, esint, wasy and
stmaryrd.
Let the code for math symbol inset handle symbols which can change size,
using the information from the symbols file.
It did access par_metrics_[] directly because there was no non-const
parMetrics().
This patch adds one and unfriends BufferView. The code is equivalent
since in all these cases, the metrics have just been computed with
redoParagraph().
When running redoParagraph, it may happen that the ascent of the first
row changes. Since the ParagraphMetrics position is actually the
baseline of its first row, it may be necessary to update it.
Fixes bug #11601.
The 20px space on top and bottom of document have traditionally been
obtained by adding them to the ascent/descent of the first/last row.
This leads to annoyances like selections that are drawn in these
margins and issues with the nesting marker.
The change is to add the value to the ParagraphMetrics ascent/descent
only and to correct one place where the ascent of the first row may be
different from the ascent of the ParagraphMetrcs object. There may be
other places where this should be done.
Fixes bug #9545.
The 20px space on top and bottom of document have traditionally been
obtained by adding the to the ascent/descent of the first/last row.
This reads to annoyances like selections that are drawn in these
margins and issues with the nesting marker.
The change is to add the values to a separate member of the Row
object, and to add new Row::total(Ascent|Descent) methods that add the
effect of this padding.
Moreover, some methods are added to TextMetrics to simplify the
BufferView code.
Fixes bug #9545.
The old code in GuiPainter::filterColor did not work. Tricks with
colors should take place in HSV space, not RGB IMO.
Replace the code with a simpler one which maps the grayscale value
of the original color on the blend color. It works nin the case where
original color is red, but might not work as well when blend color is
not black. Time will tell.
Fixes bug #11904.
The is a fixup to commit 611df441. It seems that the wrong unicode
property was selected. It could be that both classes should be used.
Fixes bug #11900.
Add new RowFlags value CanBreakAfter, which says that the row can be
broken after the inset if needed. There is no CanBreakBefore yet,
because I do not know of an inset that needs it.
This makes screen closer to the actual behavior of insets.
Currently, only unprotected spaces and some special characters are
concerned. There may be more that need this handling.
Fixes bug #11621.
The enum DisplayType is replaced with the flags RowFlags that can be
combined. Here is the correspondence between the old DisplayType and
the new Inset::RowFlags:
DisplayType RowFLags Meaning
Inline Inline plain inline inset
-- BreakBefore row ends before this inset
-- BreakAfter the row ends after this inset
AlignCenter Display the inset is centered on its own row
AlignLeft Display | AlignLeft the inset is left-aligned on its row
AlignRight Display | AlignRight the inset is right-aligned on its row
-- RowAfter an extra row is needed after this inset
Display is just a shortcut for BreakBefore | BreakAfter.
The flags for the newline inset will be BreakAfter | RowAfter,
while the separator inset will just use BreakAfter.
This groundwork does not introduce any new feature at this point. It
aims to remve the numerous isNewLine and isSeparator all over the
code, and to eventually optional break after some insets like spaces
(see #11621).
Most display() methods are renamed to rowFlags(). Some are removed
because they returned Inline.
Now display() is only a helper function for hull insets.
Fix paragraph id in xHTML output to the pre-refactoring status.
Tested on math manual (plus minus nonessential newlines).
Slightly modified patch from Thibaut Cuvelier.
Return early when format is unknown. I am not sure whether this is
supposed to happen and whether we should assert on this condition.
Spotted by coverity.
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.
It turns out that the resources were mostly not used anyway. Removing
them shrinks LyX binary by ~6MB.
Only autotools have been adapted. cmake will require the same
simplification.
The automatic icons for "command-alternative", "math-insert",
"math-(big)delim" and "command" can be overriden by an explicit icon
name.
Besides that, the iconName function is refactored, and now returns an
additional bool that indicates whether the icon should be flipped.
The code that uses resources is still useless. This will be the
subject of further work.
74540c98 was a fixup of d207e85c, which avoided using inset background
as inset label background.
d207e85c introduced a background under inset labels to avoid fake bold
effect.
Hopefully, this last variation will be the right one !
This is a modern alternative for makeindex that is fully unicode-aware
and written in lua.
As opposed to xindy, it is more lightweight and actively maintained.
The program is still in a rather early stage of development, so we do
not propose this as default.
This relies on xindex 0.22 (about to be released) to function properly.
Due to a hint from Scott:
> I don't think it should be printed to LYXERR0. That goes to the terminal
> for the user. Even our lyx2lyx tests fail if they detect any information
> printed to the terminal (although we escape some warnings). If "find" is
> not a good debug level for it, maybe we can put it in "info" (the first
> debug level)?
It seems that the use of zoom in determining the size of the minimal
value was a bad idea.
It still think that the situation is not very satisfying, we need a new idea.
The code was checking only for particular vertical alignment requests
in order to decide to nest a standard array into a 1x1 ams matrix.
However, also vertical lines are not possible in ams matrices.
These uses are inefficient (a loop really) and require that pit_type
is ptrdiff_t.
Instead, RandomAccesslist::constIterator is renamed to iterator_at and
a version adding a non-const iterator is added. Additionally, the
method retirns end() when position is equal to the size of the
container (see #11861).
lyx::next and lyx::prev are removed, and std::prev is used in the few
places where the code requires it (for no good reason IMO).
These uses are inefficient (a loop really) and require that pit_type
is ptrdiff_t.
Instead, RandomAccesslist::constIterator is renamed to iterator_at and
a version adding a non-const iterator is added.
lyx::next and lyx::prev are removed, and std::prev is used in the few
places where the code requires it (for no good reason IMO).
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.
This inset allows counters to be set, reset, saved, restored, etc,
both in the LyX GUI and in the output; optionally, the effect can be
limited to the GUI. Of course, LaTeX provides means for doing all of
these things, so they could previously be done with ERT, as far as
the output is concerned. But there was no mechanism for manipulating
counters in the GUI and none for other output formats.
Keep track of nested includes and just refuse to re-enter a file
we're already in the process of handling.
There's a question whether we should do this in updateBuffer and
validate, or whether we should do it separately. For now, this seems
to work.
Other than issuing a warning on the console, now the LyX window is
raised when in single-instance mode and no files to load are specified.
In this way, the user is aware that something happened after double
clicking the program icon. To support this functionality the new lfun
window-raise has been introduced.
Actually the change is affecting only builds if
1.) Using cmake build
2.) on unix
To use it on
cygwin: one has to patch development/cygwin/lyxrc.dist.in
MacOSX: -//- development/MacOSX/lyxrc.dist.in
We need also a Windows-version
Also the compilation with automake lacks the handling of development/unix/lyxrc.dist.in
Most of the RtL icons that we provide are simply mirrors of the LtR ones.
Therefore let the code do that by default if no +rtl icon is found.
The only RtL icon left for now is for "layout Enumerate" (notice the
numbers in it).
Also remove useless getPixmap wrapper and several old bidi_xxx icons
that were forgotten in previous patch.
When the cursor in RTL text, icons for "depth-increment" or
"layout-toggle Enumerate" look wrong.
Instead of relying on the clumsy "bidi" lfun of 2898c335, this new
version relies on a new Toobar tag BidiItem that inserts an action
which can have two icons, depending on the direction of the paragraph
containing the caret (or of the direction of the UI when no file is
open).
The alternative icon has the same name as the original one, with a
"+rtl" string appended to the lfun string. The alternative icon is
only active if the file is found. The icon themes `default', `oxygen'
and `classic' have been updated accordingly.
Fixes bug #4451.
This should work on Windows, but needs test.
The changes (namely the installation directory for the dtl executables)
for automake are not yet done. (JMarc?)
It may fix bug #11325 if cmake configured with '-DLYX_EXTERNAL_DTL=OFF'
After commit 6a936d63, the helpful debug message tries to display
non-existing elements and crashes the program :(
Fix by radical simplification of the message.
Part of bug #11777.
The ^ is interpretted as bitwise XOR, so 2^(20) evaluated to 22.
Thanks to Riki for the << trick. This way, we do not have to use
pow() and include the <cmath> header for this one expression.
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.
There is a chance that this code is still useful for Qt 4. We keep
it around just in case.
For the case of Qt 4, this commit restores the code changed in
f8e40f8a, d255339a, and d4ff3a29.
This reverts commit 438f15da21.
Revert "Track whether we have warned about mixing layouts across e.g. branches."
This reverts commit 861c6167ca.
Revert "Track whether title has been issued via OutputParams."
This reverts commit b536759c07.
There are massive complications here, and I don't have time to fix them all
right now.
Use QFontMetrics::boundingRect() instead. QFontMetrics::width() does
not actually calculate the width of the bounding box and is mostly
useful for knowing where to draw text after a string, taking into
account bearings. Indeed, it has been renamed to
QFontMetrics::horizontalAdvance().
For the code touched in this commit, we want to center a string.
Either method would likely be fine, but it is more easy to
understand exactly what QFontMetrics::boundingRect() does.
This commit does change functionality, although it should not be
noticeable.
Setting the family to "family" is already attempted above. A
different case was adapted to be this duplicate case at d4ff3a29,
but it should have just been removed.
Spotted by Enrico.