Hi there folks,
I have gotten used to write vectors in my documents as $\vec{v}$.
$\vec$, basically, is a mathbf. Naturally, if I have vectors v_1,
v_2, v_3, I'd like to write \vec{v_1}, \vec{v_2}, \vec{v_3}. But
here, I want to mathbf only the `v`. Thus I used this ugly hack,
contributed by fine people at StackExchange, which (1) saves the font
in which a mathbf text would be displayed and (2) changes to mathbf
ONLY the font of the current style:
\def\vec#1{%
%% Gather all the fonts -- text, script, script script --.
\setbox0\hbox{$\mathbf{\xdef\vec@ts{\the\textfont\fam}%
\xdef\vec@ss{\the\scriptfont\fam}%
\xdef\vec@sss{\the\scriptscriptfont\fam}}$}%
\def\vec@font##1##2{##1 0=##2 ##1 1=##2}%
%% Return in the right style, apply the bf font ONLY for the local style.
\mathchoice{\hbox{$\displaystyle\vec@font{\textfont}{\vec@ts} #1$}}%
{\hbox{$\textstyle\vec@font{\textfont}{\vec@ts} #1$}}%
{\hbox{$\scriptstyle\vec@font{\scriptfont}{\vec@ss} #1$}}%
{\hbox{$\scriptscriptstyle\vec@font{\scriptscriptfont}{\vec@sss} #1$}}}%
I do admit I have only the slightest clue of how this precisely works;
especially, I'm not sure why I added \vec@font to set so many font
families. However, it did work, and I went with it.
Then I switched to XeTeX --- I wanted to use the XITS fonts. And as
any ugly hack, mine wasn't supposed to be supported any longer; can't
blame anyone but myself here.
Thus I'm searching for some help to find a clean^H^H^H^H^Hworking
solution for this problem. Any help?
Thanks a lot in advance!
M.
--------------------------------------------------
Subscriptions, Archive, and List information, etc.:
http://tug.org/mailman/listinfo/xetex