# \usepackage[slantedGreek]{newtxmath}: \mathsf{\upOmega} won't render

Feeding

\documentclass{standalone}
\usepackage{newtxtext}
\usepackage[slantedGreek]{newtxmath}
\begin{document}
$$\mathsf{\upOmega}$$
\end{document}


to any of [ps|pdf|lua|xe]latex results in a dot

Is it a bug or a feature? (This question is rhetorical, so, choose the answer you like.)

When compiling with pdflatex, we would like to have newtx fonts (for UTF8 compilers: Times-like fonts) in general, italics serif Latin math and italics serif Greek math by default. Still, from time to time we'd like to typeset some upright sans-serif Greek math letter (in my case, the upright sans-serif Greek capital Omega). Of course, you could tikz the symbol, but then it wouldn't show up in the text layer of the PDF generated. The package upgreek would do the job but increase the vertical spacing a little. So: what's the best possible way to typeset upright sans serif Greek capital Omega without drawing it and without loading (all of) upgreek in the above setting? It is really about that Omega; I don't need other Greek symbols.

Recently, @egreg suggested adding \DeclareMathAlphabet{\mathsf}{OT1}{\sfdefault}{m}{n} to solve the problem. This solution changes the output, though slightly. The minimal example is here:

\documentclass{article}
\usepackage{amsmath}
\usepackage{newtxtext}
\usepackage[slantedGreek]{newtxmath}%%% In particular, loads the upright versions of greek as \upalpha, \upbeta, ...
%\DeclareMathAlphabet{\mathsf}{OT1}{\sfdefault}{m}{n} % newtxmath has T1, should be OT1 instead to be able to display \mathsf{\upOmega}.
\newcommand{\shortDefiningEquals}{\stackrel{\text{def}}{=}}
\begin{document}
$$\shortDefiningEquals$$\\

$$\shortDefiningEquals$$

\strut\\
\begin{itemize}
\item \strut\\\\$\shortDefiningEquals$
\end{itemize}
\strut\\\\$\mathsf{dp}^1$
\end{document}


The existence of the differences can be proven running pdflatex on the version with the suggested line, then on the version without the suggested line, and then comparing the two by the tool diffpdf:

A better understanding of how small the differences may be can be obtained by running latex+dvips on the two versions (with/without the line) and comparing the resulting postscript files with diff -a -C 5 version1.ps version2.ps | tail -24:

*** 2221,2231 ****
end
%%EndSetup
%%Page: 1 1
TeXDict begin 1 0 bop 639 489 a Fh(def)652 538 y Fe(=)639
788 y Fh(def)652 837 y Fe(=)652 1352 y Fd(\210)722 1602
! y Fh(def)735 1650 y Fe(=)515 2165 y Fc(dp)598 2133 y
Fb(1)1926 5255 y Fa(1)p eop end
%%Trailer

userdict /end-hook known{end-hook}if
%%EOF
--- 2221,2231 ----
end
%%EndSetup
%%Page: 1 1
TeXDict begin 1 0 bop 639 489 a Fh(def)652 538 y Fe(=)639
788 y Fh(def)652 837 y Fe(=)652 1352 y Fd(\210)722 1602
! y Fh(def)735 1650 y Fe(=)515 2165 y Fc(dp)598 2134 y
Fb(1)1926 5255 y Fa(1)p eop end
%%Trailer

userdict /end-hook known{end-hook}if
%%EOF


I'm unsure whether other, bigger differences may emerge.

• The tiny difference can be reproduced with just $\mathsf{dp}^1$. Such a difference doesn't seem so big to be worrying. – egreg Apr 8 at 20:55
• Yes. Just that. – egreg Apr 8 at 21:03
• I guess it's just the exponent. I don't know the precise reason: it doesn't happen with \mathsf{p}^1. – egreg Apr 8 at 21:23

The newtxmath chooses for \mathsf a T1-encoded font, which has the dot accent at the position where OT1-encoded fonts have an Omega. Fix it.

This is independent on the option slantedGreek, as far as I can see.

\documentclass{article}
\usepackage{newtxtext}
\usepackage[slantedGreek]{newtxmath}

\DeclareMathAlphabet{\mathsf}{OT1}{\sfdefault}{m}{n} % newtxmath has T1

\begin{document}
X$$\mathsf{\upOmega}$$X
\end{document}


• @user49915 \mathsf, as defined by newtxmath, uses T1/qhv/m/n, I just change T1 to OT1. The shape of Latin letters should be exactly the same, as both are virtual fonts taking the Latin letters from the same source. – egreg Apr 7 at 20:24
• @user49915 I don't have diffpdf, but diff-pdf finds no difference when the single formula $\stackrel{\text{def}}{\Leftrightarrow}\sum$ is in the document. – egreg Apr 7 at 21:23
• @user49915 Of course that's possible. A better idea, in my opinion, would be to investigate on why you get differences: can you please show a minimal example that produces differences when \DeclareMathAlphabet{\mathsf}{OT1}{\sfdefault}{m}{n} is enabled? – egreg Apr 8 at 6:20