Fonts & Character SetsMathspec Verdana cos/sin ...

Information and discussion about fonts and character sets (e.g. how to use language specific characters)
Post Reply
nitrogen28
Posts: 12
Joined: Tue Dec 16, 2008 1:20 am

Mathspec Verdana cos/sin ...

Post by nitrogen28 »

I am having a little problem concerning the mathspec package I am using to get the same Verdana font for my formulas and text.
Yes, I know Verdana is not the best choice, but it is mandatory for me. :roll:
This my preamble:

Code: Select all

\usepackage{mathspec}
\defaultfontfeatures{Mapping=text-text}
\setsansfont{Verdana}
\renewcommand*{\familydefault}{\sfdefault}
\setmathfont(Greek){Verdana}
And this is the formula

Code: Select all

\begin{equation}
\sigma_r=\sigma_xcos^2\theta+\sigma_ysin^2\theta+2\tau_{xy}cos\theta sin\theta
\end{equation}
And this is the result using XeTeX:
Screen shot 2010-10-09 at 12.57.15.png
Screen shot 2010-10-09 at 12.57.15.png (6.7 KiB) Viewed 3341 times
The greek letter are in Verdana but some how all other character are in different font.
I am having to many formulas to type so switching between math mode and text mode is unacceptable.
Switching to a font that looks similar to Verdana might be an option.

Thank for your help.
Last edited by nitrogen28 on Sat Oct 09, 2010 5:14 am, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
User avatar
frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

Mathspec Verdana cos/sin ...

Post by frabjous »

Well, it's just doing what you told it to do, i.e., use Verdana for Greek (mathit) variables.

Also, you should use the operators like \sin for "sin" and \cos for "cos" so that they are put in mathrm with normal letter spacing rather than mathit.

If you want digits, latin characters and the mathrm alphabet to use Verdana too, you have to say so. See the mathspec manual for more info.

Code: Select all

\documentclass{article}
\usepackage{amsmath}
\usepackage{mathspec}
\defaultfontfeatures{Mapping=text-text}
\setsansfont{Verdana}
\renewcommand*{\familydefault}{\sfdefault}
\setmathfont(Greek,Digits,Latin){Verdana}
\setmathrm{Verdana}
\begin{document}
\begin{equation}
\sigma_r=\sigma_x\cos^2\theta+\sigma_y\sin^2\theta+2\tau_{xy}\cos\theta \sin\theta
\end{equation}
\end{document}
Also, in the future, please make use of full minimal working examples, not just snippets.
nitrogen28
Posts: 12
Joined: Tue Dec 16, 2008 1:20 am

Mathspec Verdana cos/sin ...

Post by nitrogen28 »

Sorry for the snippets!

Thanks for the fast response. Works perfectly.
Screen shot 2010-10-09 at 14.07.42.png
Screen shot 2010-10-09 at 14.07.42.png (7.09 KiB) Viewed 3341 times
Post Reply