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.
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.
With advent of qt5 glyphs on codepoints 10, 12, 13 can't be shown anymore.
In this patch we copy the glyph pairs to new codepoints:
dotsint: 19->41 (this one was already moved by Goerg, now moving to the same block)
oint: 11->43
oiint:13->45
I couldn't find fix where both qt4 & qt5 would show correct results,
so this patch fixes qt5 situation, but breaks qt4, which hopefully
won't be needed for master.
Testing and debuging is somewhat tricky, becuse qt sometimes prefer to
load global fonts in /usr/share while ignoring the local git tree.
To be continued in other fonts.
Related reports:
https://www.lyx.org/trac/ticket/8493https://bugreports.qt.io/browse/QTBUG-66266
It seems that QTextLayout does not handle properly a single character
with 0 width. This breaks drawing of things like \not.
Actually the problem had been worked around already in lib/symbol. The
work around can therefore by removed now.
[additionally, remove extra spacing from \mapsto, \Mapsto]
Move math style to FontInfo and compute the font sizes for scriptstyle and
scriptscriptstyle according to standard proportions: 0.73 and 0.55.
This is simpler and more accurate. It also fixes the font size of
${\scriptscriptstyle {\textstyle A}}A$ which exposed the limitations of the
previous approach.
Try as far as possible to use the same definitions as in the LaTeX files.
An example of that is the definition and subsequent use of \joinrel,
\relbar and \Relbar.
This is mostly Guillaume's work.
* set up a replacement of *, -, and : by the adequate symbols (#9893)
* fix the wrong character selection and operator spacing in \text mode
* hide some internal symbols from the auto-completion.
* Fix spacing in lib/symbols after recent commits about math spacing, as well as
older spacing issues (e.g. \Join).
* InsetMathKern now uses the same em value as other math length commands.
What is nice is that the kerning amount now matches the ones found in the
packages definition (modulo 10mu that lyx currently adds between relations).
Testcase: $\CheckedBox\LEFTcircle\RIGHTcircle\photon\gluon\vcentcolon\dblcolon\Coloneqq\eqcolon\models\hookrightarrow\bowtie\hookleftarrow\Join\APLinv\neq$
The XHTML entries were added in the wrong field, if they are given we need
extra xhtml requires. The order is inconsistent, there are discussions on the
list about that but for now I'll use the existing order to fix the export tests.
The format of the lib/symbols file does not support "" for empty strings.
One would have to use x for fields that are not set (this is a hack), but
actually we know how to fill the extra field.
\it and the other oldfont commands are deprecated and the new forms
(e.g. \mathit) should be used instead. The old forms can lead to a
warning in TeX Live 2015 and an error in TeX Live 2016.
Note that with this commit only affects completion, so LyX still
supports displaying e.g. \it in math if the user enters it without
completion.
This is consistent with 24d01111.
Thanks to Guillaume for the patch.
Now that 5mu are added on each side of : (because it is a relation), there is no need to do the same in the definition of \vcentcolon.
This is closer to what is done in mathtools.sty.
We also get a consistent look with amsmath, so require esint or amsmath.
When resolving alternatives, do also take into account whether the package
is available. For this to work, we also need to test for amsmath.sty (which
was surprisingly not yet done).
The \lightning symbol is text mode only. Hence, for using it in
mathed, it must be inserted in a text mode environment such as
\mbox, \text, etc. However, as it is not marked as textmode,
LyX "helpfully" encloses it in \ensuremath everytime one tries
to put it in a text mode environment, thus defying the countermeasure.
By declaring it textmode only, LyX stops doing that and thus it can be
correctly output by simply selecting it and hitting Ctrl-M.
We have some math macros that exist only because LyX can display them easily,
but which require user preamble code. These commands should not appear in
autocompletion, they are only there to make the formulas of users who actually
need thgese symbols and know what to put into the preamble more beautiful.
After the str-metrics merge, the kludge for displaying symbols whose
code point corresponds to a soft-hyphen was not working anymore.
The solution is replicating the offending glyphs with index 0x00ad
at a different index. They were replicated at 0x00ac, whose glyph
was missing in all affected fonts.
However, this would not work by alone because, if a system font with
same family name exists, it would be picked up instead of the right one
(at least on non-Windows platforms). For this reason, the style of the
fonts has been changed from "Regular" to "Lyx", so that we can discriminate
the right font. However, this requires using at least Qt 4.8. If an
older Qt is used *and* a system font with same family name is already
available, the affected glyphs will all turn out on screen as the
"logical not" symbol.
I have also set the executable flag on the font files, because on Windows
they are loaded only in this case.
This solves #9229.
This is a part of bug #9372. The remaining part (\ne) is not easy to fix,
since \ne is a predefined macro internally, so the HTML output is done for
the expanded macro, and we have no machinery to assign a HTML output to a
complete macro.
Thanks to maciejr we know now what the remaining problem was with bug 7954:
My unicode symbol fallback works fine, the problem was that a font named
"Symbol" is available on OS X, but it does not use the font-specific encoding
we expect: Almost all glyphs are at their unicode code point.
Therefore the bug is fixed by re-enabling the unicode workaround and blocking
the Symbol font on OS X.
Some macros defined by wasysym.sty work only in text mode: They either
produce an error in math mode, or wrong output. These symbols are now marked
as text symbols, so that no \ensuremath is created for LaTeX export if they
appear inside \text{}, and the correct images are created.
There were found with -dbg mathed ans entering a math inset.
I kept the AMS versions, except leadsto, which is only an approximation in AMS.
hbar was simply defined twice with identical definitions.
llltr is a copy-paste error, the correct name is llless.
astrosun needs the wasysym package (the automatism does not kick in because
the font is cmsy, not wasy).
The stmaryrd package adds support for lots of math symbols, using a font
designed to accompany the computer modern fonts. The changes in detail:
- Fix generate_symbols_list.py to work with stmaryrd.sty. It loooks like it
was automatically translated from a perl version and never used.
- Generate the new symbols in lib/symbols using generate_symbols_list.py and
add some manual adjustments
- Generate stmary10.ttf by a simple ttf export from stmary10.sfd with fontforge
- Add license info for stmary10.ttf
- Create a test file with all symbols from stmaryrd.sty. Actually it would be
nice to have this for the other fonts as well.
- The mechanics: lyx2lyx, tex2lyx, font machinery etc.