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.

While recompiling old documents with XeLaTeX and unicode-math I have run into the two problems:

  1. The amsmath \varGamma...\varOmega macros for slanted uppercase Greek math characters are not defined. A simple \let substitution can at least provide characters, but it does not give the required italic characters with the math-style=TeX option. Some font packages have options to change the default uppercase Greek chars to italics (math-style=ISO equivalent), then the \varGamma... are defined to give upright chars. I would like to define these macros to behave consistently with the amsmath/LaTeX definitions.

  2. The \bm macro form the bm package is the "best" way to obtain bold math in LaTeX. Without replacing all the \bm macros in the document, a \let\bm=\mathbf seem to work with unicode-math, but I do not know about potential pitfalls.

The problem is that all these macros are written in Latex3 programming style, which is way above my knowledge level.

\documentclass{article}
\usepackage{ifxetex}
\usepackage{amsmath}% for uppercase greek slanted variants
\ifxetex
    \usepackage{xltxtra}
    \def\mathstyle{TeX}   % or ISO
    \usepackage[math-style=\mathstyle,
                bold-style=\mathstyle,
                vargreek-shape=TeX
               ]{unicode-math}
    \defaultfontfeatures{Ligatures=TeX}
    \setmainfont{TeX Gyre Pagella}
    \setmathfont{Asana Math}
    \let\bm\mathbf
    \AtBeginDocument{
        \let\varGamma  \mitGamma
        \let\varDelta  \Delta
        \let\varTheta  \Theta
        \let\varLambda \Lambda
        \let\varXi     \Xi
        \let\varPi     \Pi
        \let\varSigma  \Sigma
        \let\varUpsilon\Upsilon
        \let\varPhi    \Phi
        \let\varPsi    \Psi
        \let\varOmega  \Omega}
\else
    \usepackage[utf8]{inputenc}
    \usepackage[T1]{fontenc}
    \usepackage{textcomp}
    \usepackage{mathpazo}
    \usepackage{bm}
\fi
\begin{document}
\ifxetex
    \XeLaTeX{} (\texttt{math-style=\mathstyle})
\else
    \LaTeX
\fi
\medskip

\verb+\Gamma...\Omega+\par
$\Gamma\Delta\Theta\Lambda\Xi\Pi\Sigma\Upsilon\Phi\Psi\Omega$\quad
$\bm{\Gamma\Delta\Theta\Lambda\Xi\Pi\Sigma\Upsilon\Phi\Psi\Omega}$
\medskip

\verb+\varGamma...\varOmega+\par
$\varGamma\varDelta\varTheta\varLambda\varXi\varPi\varSigma\varUpsilon\varPhi\varPsi\varOmega$\quad
$\bm{\varGamma\varDelta\varTheta\varLambda\varXi\varPi\varSigma\varUpsilon\varPhi\varPsi\varOmega}$

\end{document}

enter image description here

enter image description here

enter image description here

share|improve this question
add comment

1 Answer

up vote 3 down vote accepted

There is the start of a unicode-math aware version of bm at

http://code.google.com/p/dpctex/source/browse/#svn%2Ftrunk%2Fbm

but I got busy and it's not fully finished (so not on ctan) as you say you can use \mathbf (I'm not sure I agree with unicode-math changing the meaning of \mathbf but anyway that's what it does:-)

You also of course have the option of just entering these characters directly via their unicode numbers. The relevant ranges are in the tables starting at

http://www.w3.org/2003/entities/2007doc/1D4.html

share|improve this answer
    
I actually think it is great that unicode-math fixed \mathbf because its idiosyncratic behaviour WRT Greek lower case is IMO a bug if it weren’t for the idiosyncrasies of Computer Modern math fonts. –  Khaled Hosny Mar 28 '13 at 12:36
    
Hi @KhaledHosny:-) making it work for greek is OK a kind of natural unicode extension but (one of the options) is to change its behaviour on the ascii latin range: \mathbf switches to bold roman not bold italic, but a general "math bold" command would give bold math italic, which is a useful feature but shouldn't be called mathbf (it could be bm for example) –  David Carlisle Mar 28 '13 at 12:54
    
I agree with that (though I have no idea how to achieve it, most of unicode-math is black magic to me). –  Khaled Hosny Mar 28 '13 at 13:50
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.