0

I'm using newtxtext and biblatex with biber backend for my project. But I note that in the bibiliography some accents (like Erd\H{o}s) are missing. Here is a minimal example with screenshots. (Use XeLaTeX and TeXLive 2020 or 2021)

\documentclass{article}
\usepackage{newtxtext}
\usepackage[backend=biber, style=alphabetic, defernumbers=true, hyperref=auto, backref=true, giveninits=true]{biblatex}

\usepackage{filecontents} \begin{filecontents}{\jobname.bib} @article{erdos1983greatest, title={The greatest angle among $n$ points in the $d$-dimensional Euclidean space}, author={Erd\H{o}s, P. and F{"u}redi, Z.}, journal={Annals of Discrete Mathematics}, volume={17}, pages={275--283}, year={1983}, publisher={Citeseer} } \end{filecontents} \addbibresource{\jobname.bib}

\begin{document} Paul Erd\H{o}s published the paper \cite{erdos1983greatest}. \printbibliography \end{document}

enter image description here

Note that the accent in the main body is correctly displayed.

I'm almost sure that it's newtxtext's problem because once I bump its version from 1.64 to 1.70/71 (the newest version), the problem disappears. However, due to some other compatibility issues I don't want to do that (the new version breaks my other font setups and I also have some pst-xxx pacakges in usage which does not work in TeXLive 2021). Is there any work-around for this?

  • The example compiles fine with newtxtext.sty 2022/01/11 v1.705 for me. (I checked with both pdfLaTeX and XeLaTeX, even though I'm not sure if one should use newtxtext with XeLaTeX [many older font packages load fonts in a way that is not best for Unicode engines, not sure about nextxtext in particular].) – moewe Mar 17 '22 at 16:27
  • @moewe Yes, it will work if I update. However I somehow don't want to do that because this new version breaks some other codes (namely CJK font setups using fontspec. I note that the 1.70+ version seems to use fontspec macros differently from before) badly. – Jeffrey Wang Mar 17 '22 at 16:28
  • http://mirrors.ctan.org/fonts/newtx/doc/newtxdoc.pdf says "Versions 1.7–1.71 added the ability to process .tex documents with all current LaTeX engines, adding fontspec based macros as replacements for macros and options formerly defined for non-unicode latex processing as needed for unicode latex processing." which suggests that previously the package did not officially support Unicode engines. If you don't want to upgrade your whole TeX distribution maybe you can look into updating only newtx? – moewe Mar 17 '22 at 16:32
  • Good idea. But I tried using TeXLive 2021 and only updating newtx. It still breaks my code. Is there a way to update newtx while staying at TeXLive 2020? I remember tlmgr prevents me to do this. – Jeffrey Wang Mar 17 '22 at 16:36
  • 1
    You probably can't do that via tlmgr. You'd have to install the package manually (e.g. https://tex.stackexchange.com/q/73016/35864), which might be a bit painful especially for font packages. – moewe Mar 17 '22 at 16:38
  • 2
    Maybe changing your CJK setup to work with recent versions would be better? At some point you will need to upgrade anyway to be able to use documentation/tutorials/Q&A found online and to benefit from bugfixes en new features. – Marijn Mar 17 '22 at 16:41
  • 2
    why don't you simply use \setmainfont{TeX Gyre Termes} instead of the package? – Ulrike Fischer Mar 17 '22 at 16:43
  • @UlrikeFischer Agree. I'd better write some extra code customizing the font instead of newtx. Thanks all you guys! – Jeffrey Wang Mar 17 '22 at 16:45

1 Answers1

1

In your main document you define the character as \H{o} which is fine for older versions of newtxtext, but Biber replaces this by the actual ő which is then a missing character.

Workaround: define the character yourself with \newunicodechar.

\documentclass{article}
\usepackage{newtxtext}
\usepackage{newunicodechar}
\newunicodechar{ő}{\H{o}}
\usepackage[backend=biber, style=alphabetic, defernumbers=true, hyperref=auto, backref=true, giveninits=true]{biblatex}

\usepackage{filecontents} \begin{filecontents}{\jobname.bib} @article{erdos1983greatest, title={The greatest angle among $n$ points in the $d$-dimensional Euclidean space}, author={Erd\H{o}s, P. and F{"u}redi, Z.}, journal={Annals of Discrete Mathematics}, volume={17}, pages={275--283}, year={1983}, publisher={Citeseer} } \end{filecontents} \addbibresource{\jobname.bib}

\begin{document} Paul Erd\H{o}s published the paper \cite{erdos1983greatest}.

\printbibliography

\end{document}

enter image description here

This is with a four year old version of the font package:

(/usr/share/texlive/texmf-dist/tex/latex/newtx/newtxtext.sty
Package: newtxtext 2018/03/27 v1.531

`newtxtext' v1.531, 2018/03/27 Text macros taking advantage of TeX-Gyre Termes fonts (msharpe)

Marijn
  • 37,699
  • 2
    if the ő is not printed correctly that means that the encoding is wrong for xelatex in the document, this can affect hyphenation and other non-ascii chars. – Ulrike Fischer Mar 17 '22 at 17:01
  • Another way to "make things work" would be to run Biber with --output-safechars, but normally you'd expect a Unicode engine like XeLaTeX to be able to handle Unicode input like ő, so using a font setup that is actually compatible with that is probably preferable to patching things together with ASCII-macro-escapes. – moewe Mar 17 '22 at 17:04
  • You are both right of course but the OP seemed interested in keeping his current setup the same, so I posted this workaround for the specific character. @Jeffrey check carefully for other Missing character: There is no .. in font ntx-Regular-tlf-t1 warnings in the log file, you need to apply the same workaround for those. – Marijn Mar 17 '22 at 17:09
  • Yes. I note there's another missing character `\L'. I think I'll consider use fontspec and unicode-math directly afterwards. – Jeffrey Wang Mar 17 '22 at 17:12