Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I would like to implement the suggestions in the TUGboat 30:3, 2009 about the upright/italic and bold/normal in scalars, vectors and tensors. All this is about math.

I use this font:

\usepackage[charter]{mathdesign}

For vectors, I always used \vec, so I just redefined it like so:

\renewcommand{\vec}[1]{\boldsymbol{#1}}

Now they are bold and italic, just like I want them. Is that even the correct way to do this?

How can I get characters in bold, italic and sans-serif?

I almost got it with this, they are just upright and not italic:

\newcommand{\tens}[1]{\boldsymbol{\mathsf{#1}}}
share|improve this question
    
It's not clear, but are you looking for: \mathbf \mathit \nathsf` –  David Carlisle Oct 14 '12 at 18:39
    
\mathbf makes the font upright. And I cannot combine \mathsf and \mathbb. –  queueoverflow Oct 14 '12 at 18:50
    
Have a look here: tex.stackexchange.com/q/24035/14100 –  Scott H. Nov 14 '12 at 20:42
add comment

1 Answer

up vote 7 down vote accepted

The cleanest way is to define a new math alphabet:

\DeclareMathAlphabet{\mathbfsf}{\encodingdefault}{\sfdefault}{bx}{n}

and then

\newcommand{\tens}[1]{\mathbfsf{#1}}

If you want italic bold sans serif, just change the first declaration into

\DeclareMathAlphabet{\mathbfsf}{\encodingdefault}{\sfdefault}{bx}{sl}

but keep in mind that the OT1 encoded Computer Modern Sans fonts don't have slanted bold face, so also

\usepackage[T1]{fontenc}

or

\usepackage{lmodern}

is required.


You should also consider using \bm of the bm package instead of \boldsymbol, so that \bm{\mathsf{T}} would be equivalent to the \mathbfsf{T} with the first declaration. However there is no predefined sans serif italic math alphabet. So, if you need also sans serif italic, a more economic setting would be

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage{bm}

\DeclareMathAlphabet{\mathsfit}{\encodingdefault}{\sfdefault}{m}{sl}
\SetMathAlphabet{\mathsfit}{bold}{\encodingdefault}{\sfdefault}{bx}{sl}

\newcommand{\tens}[1]{\bm{\mathsfit{#1}}}

\begin{document}
$\tens{T}$
\end{document}

enter image description here

share|improve this answer
    
There is a brace } missing at the end of the \newcommand-line. I cannot edit it since it is just a single char. –  queueoverflow Jan 26 '13 at 21:03
    
The latter works great, even with greek letters. Thank you! –  queueoverflow Jan 26 '13 at 21:03
    
@queueoverflow Added the brace, thanks. –  egreg Jan 26 '13 at 21:43
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.