GeneralRedefining Characters in Math Mode

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
SterlingChase
Posts: 3
Joined: Tue Nov 18, 2008 4:27 am

Redefining Characters in Math Mode

Post by SterlingChase »

Hello all!
I'm currently in a Linear Algebra class and like to type up my solutions to the weekly homework. I follow the convention in the textbook to write linear operators and vector spaces as captial, sans-serif characters, for instance:

Instead of $T$, we would write $\mathsf{T}$.

So it's become a real pain having to write "\mathsf{}" so many times. Is there any way to have "T" automatically change to "\mathsf{T}" in math mode, unless I somehow explicitly say not to?

I would like to do this to the characters T, U, V, and W. Is this possible?

I suppose another solution to be to define a command for each of those characters as follows:
\newcommand{\T}{\mathsf{T}}

But if I can avoid this, that would be nice. Any suggestions?

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

phi
Posts: 577
Joined: Tue Oct 21, 2008 8:10 pm

Redefining Characters in Math Mode

Post by phi »

Hello,
add this to your preamble:

Code: Select all

\DeclareSymbolFont{sansserif}{OT1}{\sfdefault}{m}{n}
\DeclareMathSymbol{T}{\mathalpha}{sansserif}{`T}
\DeclareMathSymbol{U}{\mathalpha}{sansserif}{`U}
\DeclareMathSymbol{V}{\mathalpha}{sansserif}{`V}
\DeclareMathSymbol{W}{\mathalpha}{sansserif}{`W}
Post Reply