tectonic-typesetting / tectonic

A modernized, complete, self-contained TeX/LaTeX engine, powered by XeTeX and TeXLive.
https://tectonic-typesetting.github.io/
Other
3.99k stars 162 forks source link

Math minus sign not printed on paper #1232

Open engeir opened 2 weeks ago

engeir commented 2 weeks ago

When printing math formulas with the minus sign to paper, the minus sign is missing. The generated PDF look fine in digital format.

A minimal example is shown below, where all packages I use are included. I included the packages since I thought the issue might be related to some package that is missing.

% src/main.tex
\documentclass[11pt,addpoints]{exam}

\usepackage{amsmath,amssymb,caption,color,hyperref,mhchem,pdfpages,siunitx,tikz}
\usetikzlibrary{decorations.pathreplacing,positioning}

\begin{document}
  Universal gas constant: \(R=\SI{8.314}{\joule\mole^{-1}\kelvin^{-1}}\)%
\end{document}

Generate with tectonic -X build (using the continuous version from Sep 20 2024) and

# Tectonic.toml
[doc]
name = "Exam 2024"
bundle = "https://data1.fullyjustified.net/tlextras-2022.0r0.tar"

# The exam problem set PDF
[[output]]
name = "exam"
type = "pdf"
inputs = "main.tex"

One thing I find to solve the issue is to create a new file with ghostscript and then overwriting:

gs -sDEVICE=pdfwrite -dBATCH -dNOPAUSE -sOutputFile=build/exam/out.pdf build/exam/exam.pdf
mv build/exam/out.pdf build/exam/exam.pdf

The image below show on the left a file re-written with the ghostscript hack, and on the right a PDF compiled with tectonic, both opened in okular. The left PDF is printed to paper just fine, while the right document has minus signs missing. See bottom image.

issue

IMG_20241107_125603

I tried a few things in the main.tex file without success:

\RequirePackage{pdfmanagement-testphase}
\DeclareDocumentMetadata{pdfversion=1.7}
\documentclass[11pt,addpoints]{exam}

\usepackage{amsmath,amssymb,caption,color,hyperref,mhchem,pdfpages,siunitx,tikz}
\usetikzlibrary{decorations.pathreplacing,positioning}

\begin{document}
  Universal gas constant: \(R=\SI{8.314}{\joule\mole^{-1}\kelvin^{-1}}\)%
\end{document}
\documentclass[11pt,addpoints]{exam}

\usepackage{amsmath,amssymb,caption,color,hyperref,mhchem,pdfpages,siunitx,tikz}
\usetikzlibrary{decorations.pathreplacing,positioning}

\usepackage{newunicodechar}
\newunicodechar{−}{-}

\begin{document}
  Universal gas constant: \(R=\SI{8.314}{\joule\mole^{-1}\kelvin^{-1}}\)%
\end{document}