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?

4
  • The minus sign shows for me in both places when I compile that sample code.
    – frabjous
    Jan 18 at 1:17
  • Are you sure that is not a pdf viewer zoom problem?
    – Sigur
    Jan 18 at 1:22
  • @frabjous I forgot to say, use XeLaTeX.
    – youthdoo
    Jan 18 at 1:27
  • Don't do \everymath{\displaystyle}. And don't use txfonts, but \usepackage{newtxtext,newtxmath}.
    – egreg
    Jan 18 at 7:51

2 Answers 2

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.

3
  • You're right. But without txfonts, LaTeX formulae supports both.
    – youthdoo
    Jan 18 at 5:24
  • Sorry to interrupt, is \everymath{\displaystyle} really needs?
    – MadyYuvi
    Jan 18 at 5:40
  • @MadyYuvi it is certainly not needed, I just copied the code from the question and I did not remove it.
    – Vincent
    Jan 18 at 13:08
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.

2
  • 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 at 9:10
  • 1
    @youthdoo No, you shouldn't use \displaystyle to inline formulas to begin with.
    – egreg
    Jan 18 at 9:28

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .