Changes

Jump to navigation Jump to search
1,188 bytes removed ,  18:54, 3 June 2020
m
remove link to former font page
< [[Math]] | [[Bold Typewriter]] | [[Fonts]] >
see Hans has descibed how to work with bold math in [http://www.pragma-ade.com/general/magazines/mag-0005.pdf MyWay No.5 about "Mixed Normal and Bold Math"] by Pragma. However, this method only seems to work with lucida fonts. For other fonts (currently only for latin modern and euler), one can also define
== Wrapping in a \hbox ==
 
If the solution presented in that MyWay does not suit your needs, you can always use a \hbox wrapper, by defining something like this:
<texcode>
\definetypeface [boldmath] [mm] [boldmath] [latin-modern] [default]
\setupformulae[method=bold]
\unprotect
\def\boldsymbol@normal#1{\hbox{\formula[boldmath]{#1}}}
\def\boldsymbol@inline{\boldsymbol@normal}
\def\boldsymbol@script#1{\hbox{\formula[boldmath,script]{#1}}}
\def\boldsymbol@scriptscript#1{\hbox{\formula[boldmath,scriptscript]{#1}}}
\def\boldsymbol#1{%
\mathchoice
{\boldsymbol@normal{#1}}%
{\boldsymbol@normal{#1}}%
{\boldsymbol@script{#1}}%
{\boldsymbol@scriptscript{#1}}}
\protect
</texcode>
 
Then you can get bold vectors:
<texcode>
\define\grad{\boldsymbol{\nabla}}
%\define\vec{\boldsymbol} % Raise a warning because \vec
\def\vec{\boldsymbol} % is already defined in ConTeXt.
\define[1]\unitvec{{\hat{\vec{#1}}}}
</texcode>
 
and formulas like this typeset perfectly:
 
<texcode>
\formula{\grad \eta = e^{\vec k \cdot \vec x} \unitvec{n}}
</texcode>
== An Alternate Definition ==An alternate way to define and then use <cmdcode>boldsymbol</cmdcode> is  <texcode>\def\boldsymbol#1% {\mathchoice {\hbox{\switchtoformulabodyfont [boldmath]$#1$}} {\hbox{\switchtoformulabodyfont [boldmath]$#1$}} {\hbox{\switchtoformulabodyfont [boldmath,script]$#1$}} {\hbox{\switchtoformulabodyfont[boldmath,scriptscript]$#1$}}}</texcode> This is slightly more efficient than the first versionaround symbol that you want in bold.   
== Mixing Math Fonts ==

Navigation menu