2

The latest version of newtx interferes with ctex, here's an MWE:

\documentclass{ctexart}
\usepackage{newtxtext}

\begin{document}

Hello, 你好.

\end{document}

I have upgraded to the latest version of newtx (1.732, Nov 6 2023) via tlmgr, and I got the following error when compiling with XeLaTeX:

LaTeX Error: Option clash for package fontspec.

However, when compiled on Overleaf (here's my Overleaf project link), it works perfectly fine.

By experimenting with Tex Live 2022, I find that only the latest version of newtx has this issue.

Is it a bug, or am I not using it correctly?

After reading this answer (for \RequirePackage[no-math]{fontspec}) and this answer (for \defaultfontfeatures{}), I come up with the following workaround, which works well:

\RequirePackage[no-math]{fontspec}
\documentclass{ctexart}
\usepackage{newtxtext}
\defaultfontfeatures{}

\begin{document}

Hello, 你好.

\end{document}

But a command before \documentclass is annoying. In addition, I really don't know why this works.

Since I'm writing a template for others, I wonder if this is a robust workaround.

1 Answer 1

2

Not sure why it didn't before or it does now, but newtxtext wants to load fontspec with the no-math option.

Perhaps there's a native CTEX method, but the following workaround seems to do the job:

\PassOptionsToPackage{no-math}{fontspec}
\documentclass{ctexart}
\usepackage{newtxtext}

\begin{document}

Hello, 你好.

\end{document}

You must log in to answer this question.

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