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.

One can define a new mathversion using \DeclareMathVersion{sans}.

I wonder if I can test the existence of such a font definition, for example with

\IfMathVersionDefined{sansmath}
  {math font is defined}
  {math font is not defined}
share|improve this question
add comment

2 Answers

up vote 4 down vote accepted

Are you just looking for this?

\makeatletter
\newcommand{\IfMathVersionDefined}[3]{%
  \expandafter\@ifundefined\csname mv@#1\endcsname{#3}{#2}%
}
\makeatother

The above is motivated by the fact that \DeclareMathVersion{#1} defines \mv@#1.

share|improve this answer
    
Exactly. I failed to find the code where this is defined. –  Matthias Pospiech Jan 12 '12 at 20:39
add comment
\documentclass{article}

\DeclareMathVersion{blub}


\begin{document}
\ifcsname mv@blub\endcsname
 math version blub exist
\else
 math version blub  doesnt exist
\fi 

\ifcsname mv@bla\endcsname
 math version bla exist
\else
 math version bla doesnt exist
\fi 

\end{document} 
share|improve this answer
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.