0

So I have the following setup in my preamble,

\def\ve#1{\mathchoice{\mbox{\boldmath$\displaystyle\bf#1$}}
    {\mbox{\boldmath$\textstyle\bf#1$}}
    {\mbox{\boldmath$\scriptstyle\bf#1$}}
    {\mbox{\boldmath$\scriptscriptstyle\bf#1$}}}  

\newcommand{\y}{{\ve y}} 

\renewcommand{\v}{{\ve v}}

But now in the text when I am calling $\y$ it does get the bold faced $y$ by on calling $\v$ the same does not happen for v? For v I am getting an error,

Improper \spacefactor. <recently read> \spacefactor

Can someone help fix this?

  • 6
    Don't show code snippets, always make a (small but) complete example starting with \documentclass. And better don't redefine accent commands like \v. – Ulrike Fischer May 29 '18 at 7:36
  • 6
    Plus why are you using \bf it has been depreciated since 1993!!! A simple \mathbf{#1} is enough, or even better use \bm{#1} from the bm package to get a bold italic char. – daleif May 29 '18 at 7:45
  • 3
    you should never use \bf in latex, but why is the definition so complicated rather than just \bm{y} ? Are you sure the \spacefactor error comes from the code you have shown? – David Carlisle May 29 '18 at 7:46
  • 3
    If you do not know exactly what a macro does then NEVER redefine it!!!! – daleif May 29 '18 at 7:46
  • 5
    With renewcommand you are redefining an existing command. That is not a good idea if you don't know what the original command is doing. – Ulrike Fischer May 29 '18 at 7:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.