2

I used XeLaTeX to compile the code

\documentclass{article}
\usepackage{txfonts}
\everymath{\displaystyle}
\begin{document}
\[\sum a^k=p\sum a^{k−1}−q\sum a^{k−2}+r\sum a^{k−3}.\]
\end{document}

I found that the minus sign in the display doesn't show. So the superscript was like k1.

Why is there such a problem? Are there any methods for times math fonts that're more stable?

youthdoo
  • 861

2 Answers2

4

There's no reason for using XeTeX with txfonts, because the fonts are only available in Type1 format. Besides, txfonts is to be considered obsolete because the fonts it provides have many problems with spacings and character sidebearings.

And don't do \everymath{\displaystyle}. Even if you think that it's good, trust me and don't use it.

With the fixed

\documentclass{article}
\usepackage{newtxtext,newtxmath}

\begin{document}

[\sum a^k=p\sum a^{k−1}−q\sum a^{k−2}+r\sum a^{k−3}.]

\end{document}

I get

Missing character: There is no − ("2212) in font ntx-Regular-tlf-ot1!

four times.

This happens when copying material from other sources. Doing “find and replace” would work, but it's probably easier if you make U+2212 known to TeX math:

\documentclass{article}
\usepackage{newtxtext,newtxmath}

% Make U+2212 MINUS SIGN known \Umathcodenum"2212=\Umathcodenum`-

\begin{document}

[\sum a^k=p\sum a^{k−1}−q\sum a^{k−2}+r\sum a^{k−3}.]

\end{document}

enter image description here

The same with txfonts

enter image description here

Look closely for the differences, in particular for the minus sign. There are many others.

egreg
  • 1,121,712
  • So if I don't write \everymath{\displaystyle} and add \displaystyle to all inline formulae (which I did before), would it be better? – youthdoo Jan 18 '23 at 09:10
  • 1
    @youthdoo No, you shouldn't use \displaystyle to inline formulas to begin with. – egreg Jan 18 '23 at 09:28
3

I think the problem is that the minus symbol in your code is an actual minus symbol rather than a hyphen -. If I just replace the minus symbols with hyphens, they appear in the output as expected.

\documentclass{article}
\usepackage{txfonts}
\everymath{\displaystyle}
\begin{document}
\[\sum a^k=p\sum a^{k-1}-q\sum a^{k-2}+r\sum a^{k-3}.\]
\end{document}

Also, if you want to use a Times clone you should probably be using newtx rather than txfonts.

Vincent
  • 20,157