On Mon, Mar 10, 2008 at 01:37:28AM +0100, Enrico Forestieri wrote: > On Sun, Mar 09, 2008 at 11:23:51PM -0000, [EMAIL PROTECTED] wrote: > > > Author: uwestoehr > > Date: Mon Mar 10 00:23:50 2008 > > New Revision: 23608 > > > > URL: http://www.lyx.org/trac/changeset/23608 > > Log: > > InsetMathNest.cpp: Ctrl-b uses now \boldsymbol (fixes > > http://bugzilla.lyx.org/show_bug.cgi?id=499) > > This breaks bold super and subscripts. Please revert. > > \boldsymbol uses \mbox, thus preventing the use of the correct size. > Moreover, the output of \boldsymbol{c} is different from \mathbf{c}. > \boldsymbol is to be used only in certain circumstances and should > not be easily and unknowingly obtainable as a substitute for \mathbf. > I think that bug 499 should be marked as WONTFIX. If you need a bold > greek letter, you can type \boldsymbol in mathed. Of course, the > documentation should also warn about the consequences of using \boldsymbol.
While looking at this problem, it occurred to me that the definition of the \boldsymbol macro as done by LyX is flawed. Indeed, the amsmath package defines it such that the correct size is used in super and subscripts and the italic shape is always used. This means that, when using \boldsymbol, different output is generated depending on whether the amsmath package is loaded or not. I think that this is not acceptable and propose the attached patch, such that \bm is used for bold math. In this way, the output remains the same independently from the fact that the amsmath package is loaded or not, sub and superscripts have the correct size, and bug 499 remains fixed. I fear that the \boldmath macro as defined by LyX cannot be ditched altogether for backward compatibility reasons. I also don't like italic bold letters, and often when writing bold math you really need a roman typeface (why do you think \mathbf behaves like that?), but luckily \mathbf is still there, even if not so easily accessible as before. As a last note, it would kindly ask that sensitive changes are discussed before being applied. -- Enrico
Index: src/mathed/InsetMathNest.cpp =================================================================== --- src/mathed/InsetMathNest.cpp (revision 23611) +++ src/mathed/InsetMathNest.cpp (working copy) @@ -808,7 +808,7 @@ void InsetMathNest::doDispatch(Cursor & if (currentMode() == TEXT_MODE) handleFont(cur, cmd.argument(), "textbf"); else - handleFont(cur, cmd.argument(), "boldsymbol"); + handleFont(cur, cmd.argument(), "bm"); break; case LFUN_FONT_SANS: if (currentMode() == TEXT_MODE) Index: src/LaTeXFeatures.cpp =================================================================== --- src/LaTeXFeatures.cpp (revision 23611) +++ src/LaTeXFeatures.cpp (working copy) @@ -754,7 +754,7 @@ string const LaTeXFeatures::getMacros() macros << guillemotright_def << '\n'; // Math mode - if (mustProvide("boldsymbol") && !isRequired("amsmath")) + if (mustProvide("boldsymbol") && !(isRequired("amsmath") || isRequired("bm"))) macros << boldsymbol_def << '\n'; if (mustProvide("binom") && !isRequired("amsmath")) macros << binom_def << '\n';