General ⇒ Redefining Characters in Math Mode
-
- Posts: 3
- Joined: Tue Nov 18, 2008 4:27 am
Redefining Characters in Math Mode
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?
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
Redefining Characters in Math Mode
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}