Commit Graph

3351 Commits

Author SHA1 Message Date
Yuriy Skalko
524073d09f Move HullType functions declared in InsetMath.h into InsetMath.cpp 2020-10-29 15:52:28 +02:00
Yuriy Skalko
10272e4747 Move include of own header to the top. Fix dependencies 2020-10-25 19:58:57 +02:00
Yuriy Skalko
a7018252b7 Constify 2020-10-25 09:28:34 +02:00
Yuriy Skalko
d25c10ed81 Remove duplicate and unused header includes in .cpp files 2020-10-19 18:01:11 +03:00
Yuriy Skalko
a3eeb8a4b5 Clean math headers 2020-10-16 23:05:46 +03:00
Yuriy Skalko
fbefdb10a5 Move Cursor.h from Clipboard.h 2020-10-16 08:02:51 +03:00
Pavel Sanda
560ff6d40d Move MetricsInfo.h from InsetMathSize.h 2020-10-14 14:58:18 +02:00
Jean-Marc Lasgouttes
c516c86d19 Make cursor width depend on current font
This makes the cursor more visible wrt current font.

Moreover make the cursor width scalable by default.
2020-10-13 17:27:52 +02:00
Yuriy Skalko
2a594d3e90 Remove unused forward declarations 2020-10-13 09:57:36 +03:00
Yuriy Skalko
238fd9ac50 Right exception rethrowing 2020-10-12 15:14:55 +02:00
Yuriy Skalko
919a06718a Constify 2020-10-12 15:06:16 +02:00
Yuriy Skalko
7d38a4d126 Loop refactoring 2020-10-09 09:04:20 +03:00
Yuriy Skalko
fe85162a29 Refactoring 2020-10-05 14:55:00 +02:00
Yuriy Skalko
d82adc625b Amend efc0877f
Add more `override` specifiers. Replace `throw()` to `noexcept`.
2020-10-05 09:37:15 +02:00
Yuriy Skalko
14b0da28c2 Amend efc0877f 2020-10-03 21:17:17 +02:00
Yuriy Skalko
715b8cda54 Refactoring based on cppcheck suggestions 2020-10-03 13:39:51 +02:00
Yuriy Skalko
efc0877f8f Add override specifiers to improve code maintainability 2020-10-03 12:43:48 +02:00
Richard Kimberly Heck
2afc68ede2 Whitespace 2020-10-02 13:11:28 -04:00
Jean-Marc Lasgouttes
dd65a97b55 Pass parameters as const references when possible
Fixes some cppcheck warnings.
2020-10-02 18:56:01 +02:00
Jean-Marc Lasgouttes
4d9a2c2e59 Fixup f96b99dc: do not initialize cache too late 2020-10-02 12:17:57 +02:00
Jean-Marc Lasgouttes
a97b384b07 Fixup f96b99dc: thinko
Setting the res value and returning from the function at the same time
does not make sense. After reflection, it is the "return" that shall
go.

No idea what effect it had.
2020-10-02 12:06:32 +02:00
Thibaut Cuvelier
91982ee105 DocBook: new lines around formulae. 2020-09-19 20:43:39 +02:00
Thibaut Cuvelier
78a361778f DocBook: fix float tags (was unduly overridden).
The output was not valid for floats without title.
2020-09-19 20:43:38 +02:00
Thibaut Cuvelier
39ad6e84f0 DocBook: improve equation formatting (new lines for block equations). 2020-09-19 20:43:38 +02:00
Thibaut Cuvelier
87dae26e4a Simplify code to generate only one paragraph at a time. 2020-09-19 20:43:37 +02:00
Yuriy Skalko
fb7b7e5223 Refactor runCommand 2020-09-11 16:13:23 +02:00
Jean-Marc Lasgouttes
eda3219662 Remove unneeded space for \nolimits 2020-09-09 10:35:35 +02:00
Enrico Forestieri
fcd14df230 Avoid spurious requirements
The macros defined in the symbols file are only used for on-screen
representation, so that their definition should not require the use
on any latex package. Their definition should be taken into account
only when they are overridden by user macros with same name.
2020-09-09 01:32:51 +02:00
Jean-Marc Lasgouttes
a58bcf1d27 Fixup f96b99dcb3: read correctly \limits after macros
Move InsetMacro::limits_ to InsetMacro::Private, where it should have
been from the start. This means that limits_ is now copied when the
macro is cloned.
2020-09-07 12:13:42 +02:00
Enrico Forestieri
062d94c5da Fix on-screen display of special math fonts
Make sure that the on-screen representation of the special math fonts
mathbb, mathds, mathfrak, mathcal, and mathscr matches the latex output.
2020-09-06 18:16:04 +02:00
Jean-Marc Lasgouttes
cc349fd031 Add space before display math that starts a paragraph
This extra spacing was missing and is important for detecting extra
par breaks before equations (which are most of the times not wanted).

To do that, add a new member vmode to MetricsInfo which is equivalent
to LaTeX's \ifvmode (start of paragraph).

If in vmode, add the equivalent of an empty line before a display math inset.

At the same time, tweak value of \(above|below)displayskip, which was
12pt, whereas LaTeX uses 10pt in 10pt size (our reference).

Fixes bug #11891.
2020-08-25 13:20:37 +02:00
Juergen Spitzmueller
55f7b337cc Simplification 2020-08-17 13:29:55 +02:00
Stephan Witt
c88f331a06 Avoid a type mismatch warning resp. error for signed vs unsigned typed values comparison 2020-08-17 12:25:35 +02:00
Juergen Spitzmueller
957b615b1f Fix another crash with Grid pasting (follow-up to #11906) 2020-08-16 17:24:13 +02:00
Stephan Witt
0fa4b7e736 #9376 prepare use of Length in lyxrc - move the class Length to support 2020-08-07 09:24:31 +02:00
Juergen Spitzmueller
8415041b1f Use hexnames only for x11 colors
This prevents wrong color allocation with ambiguous names.

Fixes #11828

Patch by D. Ramöller with extensions by me.
2020-08-03 14:10:46 +02:00
Enrico Forestieri
7441172d4d Assure correct spacing of colored items in mathed
When coloring a non-ordinary math atom, explicitly apply its
math class, so that to leave unchanged the spacing around it.
Fixes #11827.
2020-08-02 18:58:40 +02:00
Thibaut Cuvelier
c1ec3394c6 DocBook: improve new lines around maths. 2020-08-01 22:45:56 +02:00
Juergen Spitzmueller
53e872455a Revert "Fix #11827"
This reverts commit b521d36bfb.

Not ready yet
2020-07-31 09:18:37 +02:00
Daniel Ramoeller
b521d36bfb Fix #11827
Keep spacing of math intact.
2020-07-30 16:24:17 +02:00
Thibaut Cuvelier
d75ff9931d Revert "Support the mathbbm font."
This reverts commit e709a6626e.
2020-07-28 18:01:38 +02:00
Thibaut Cuvelier
e709a6626e Support the mathbbm font.
Should just be able to read formulae, not add it from the GUI, as it's mostly redundant with mathds and mathbb.
2020-07-27 03:15:00 +02:00
Thibaut Cuvelier
8dd2e7e681 DocBook: solve issue with formulae within font tags.
This is not valid DocBook either!
2020-07-26 23:23:02 +02:00
Enrico Forestieri
0b3e69167c Fix placement of limits with integral signs
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.
2020-07-24 12:32:24 +02:00
Jean-Marc Lasgouttes
f96b99dcb3 Implement properly \limits and \nolimits
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.
2020-07-20 23:20:26 +02:00
Jean-Marc Lasgouttes
e8ee0100fc Implement variable size bigops
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.
2020-07-17 22:25:18 +02:00
Jean-Marc Lasgouttes
8d54457dbf Improve metrics for \limits in display mode 2020-07-17 22:18:43 +02:00
Juergen Spitzmueller
61cf165521 Consider single-cell insets when pasting multiple cells (#11906) 2020-07-14 10:39:49 +02:00
Juergen Spitzmueller
4884476eb6 Do not blindly disable inset-modify in MathNest
Fixes #11784
2020-07-13 16:50:11 +02:00
Jean-Marc Lasgouttes
1c956cdc16 Improve drawing of macro template frame
Use Inset::xxxOffset as offsets and draw the frame in the middle of
the empty space.

Fixes bug #9657.
2020-07-12 15:39:37 +02:00