2

I usually use something like \boldsymbol\sigma to obtain bold greek letters, which only requires \usepackage{amsmath}.

This doesn't seem to work when using XeLatex and Tex Gyre Pagella, as shown in the following MWE:

\documentclass{article}
\usepackage{amsmath}

\usepackage{unicode-math}
\usepackage{parskip}
\defaultfontfeatures{Scale=MatchLowercase}
\setmainfont{TeX Gyre Pagella}[Scale = 1.0]
\setmathfont{Asana Math}
\begin{document}
$\sigma\boldsymbol{\sigma}$
\end{document}

This gives two identical sigma symbols, while removing the block changing the font makes boldsymbol work as intended again.

Is there a way to use bold greek symbols with this font?

glS
  • 546
  • Maybe with \bm? – Bernard Oct 13 '19 at 23:04
  • @Bernard ah, that seems to work. It means to use \pbm instead of \boldsymbol though. Can I just safely use \renewcommand{\boldsymbol}{\pmb} for backward compatibility of documents that used the boldsymbol syntax? – glS Oct 13 '19 at 23:09
  • 1
    But, as far as I know, \pmb creates bitmaps. Why not use \mathbf? – Bernard Oct 13 '19 at 23:12
  • @Bernard is mathbf supposed to work on greek symbols? I doesn't work for me (it produces nothing). Using \bm\sigma also produces weird output (a bold $0$ instead of the sigma) – glS Oct 13 '19 at 23:16
  • this post also contains a lot of info on how to make bold symbols, but some of the solutions there don't work when I use this Gyre Pagella font, while others do, and I'm not sure which solution is the preferred one in this case – glS Oct 13 '19 at 23:20
  • You should be using Asana Math for the symbol - not TeX Gyre Pagella. At least, that's what your code seems to want to do. – cfr Oct 13 '19 at 23:28
  • @cfr does that make a difference? It's not working whether I include the Asana Math line or not – glS Oct 13 '19 at 23:35
  • If it is suppose to be a symbol, it is supposed to come from the maths font and should be \symbf{\sigma}. If it is intended to be text, it should use \mathbf, but \sigma isn't a text-thing, so not what you want here. – cfr Oct 14 '19 at 00:09

1 Answers1

4

You want, I think, \symbf. However, I can't get this to work correctly with Asana Math, even when I load it by filename as XeLaTeX wants.

Here's what it looks like with Latin Modern Math for comparison purposes:

\documentclass{article}
\usepackage{amsmath}
\usepackage{unicode-math}
\usepackage{parskip}
\defaultfontfeatures{Scale=MatchLowercase}
\setmainfont{TeX Gyre Pagella}[Scale = 1.0]
% \setmathfont{Asana-Math.otf}% ???
\setmathfont{latinmodern-math.otf}% default is equivalent
\begin{document}
\begin{tabular}{llll}
  & \verb|\math**| & \verb|\sym**| & \verb|\text**|\\
  $xxx$&$\mathup{xxx}$&$\symup{xxx}$&\textup{xxx}\\
  &$\mathit{xxx}$&$\symit{xxx}$&\textit{xxx}\\
  &$\mathbf{xxx}$&$\symbf{xxx}$&\textbf{xxx}\\
  & --&$\symbfit{xxx}$&\textbf{\itshape xxx}\\
  $\sigma$&$\mathup{σ}$&$\symup{σ}$&\textup{σ}\\
  &$\mathit{σ}$&$\symit{σ}$&\textit{σ}\\
  &$\mathbf{σ}$&$\symbf{σ}$&\textbf{σ}\\
  & -- &$\symbfit{σ}$&\textbf{\itshape σ}\\
\end{tabular}

\end{document}

cf. text vs. maths

If I comment the Latin Modern call and uncomment Asana's, I no longer get a distinction between text and maths --- it all looks like TGP, though the console output doesn't complain.

cfr
  • 198,882