]> git.lyx.org Git - features.git/commit
Amend 58103cf2
authorEnrico Forestieri <forenr@lyx.org>
Wed, 8 Nov 2023 22:59:43 +0000 (23:59 +0100)
committerEnrico Forestieri <forenr@lyx.org>
Wed, 8 Nov 2023 23:21:21 +0000 (00:21 +0100)
commit039de52ad94f47dc86c5a02cc1d7d8bcf991cc99
treee0a01b1d9c102a233e3400f2155afb502917362e
parent53784b90aeaad049b6cc4f9002d28509706fb343
Amend 58103cf2

The \underbar macro is a text mode macro that can also be used
in math mode. However, when inserting it in mathed, LyX helpfully
wraps it in a \text inset. One can dissolve such text inset and
the macro would appear in math mode without any problem. But the
output routine thinks that the user is shooting itself in the
foot and tries to protect him by wrapping \underbar in the
\lyxmathsym macro, whose definition is normally added to the
preamble when an unicode character is used in math mode.

Of course, this is not the case for \underbar and a compile
error arises. The easier solution is to simply add lyxmathsym as
a requirement for \underbar in lib/symbols, but this means
that the definition of \lyxmathsym would be added even when not
necessary (because in the validation routine we miss the info
about the current mode). The correct solution is acknowledging
the dual nature of \underbar as a text-mode macro that can also
be used in math mode. Luckily the correct solution is almost as
easy as the easier one and is what is done in this commit.
lib/symbols
src/mathed/InsetMathDecoration.cpp