1

Recently, I asked a question about typesetting a document using a certain set of fonts Amstext (chemmacros) causes problems in selecting math fonts in chemfig and Typeface returns fatal coding errors after update of LaTeX core). In the discussion and answers to those questions switching from compiling using PDFLaTeX to using XeLaTeX was proposed. That did work rather well fontwise, yet it introduced another issue: using XeLaTeX non-Latin characters are not printed, but are flawlessly printed compiling with PDFLaTeX.

In the provided MWE you can see a few entries with Turkish or Serbian surnames. These names aren't correctly printed in both textual citations nor in the bibliography compiling with XeLaTeX. As said, PDFLaTeX compiles correctly.

\documentclass[a4paper,11pt]{article}

\usepackage[dutch]{babel}

%----- lettertypen -----
\let\MakeUppercasesaved\MakeUppercase
\def\MakeUppercase#1{\expanded{\uppercase{#1}}}

\usepackage[
    typeface=gfsartemisia:euler,
    sanstypeface=tgheros:scale:0.92,
    mathtypeface=mathdesign:charter,
    textcomp=dontload,
    inputencoding=dontload,
    ]{typeface}
\let\MakeUppercase\MakeUppercasesaved

%----- opmaak pakketten -----
\usepackage{xcolor}
\usepackage[hidelinks]{hyperref}

%----- layout pakketten -----
\usepackage[body={17.0cm,26cm},top=2.0cm,left=2.0cm]{geometry}

\usepackage{lipsum}

\definecolor{color1}{RGB}{0,0,139} % Color of the article title and sections (navy blue)
\definecolor{color2}{RGB}{255,255,120} % Color of the boxes behind the abstract and headings (dark yellow)
\definecolor{color3}{RGB}{180,0,0} % Color of the headings of the parts (redbrown)
\definecolor{color4}{RGB}{0,139,0} % Color of chemical notations (dark green)
\definecolor{color5}{RGB}{139,0,139} %Color of captions (dark purple)

\setlength{\parindent}{0pt}

\hypersetup{hidelinks,colorlinks,breaklinks=true,urlcolor=color4,citecolor=color1,linkcolor=color1,bookmarksopen=false,pdfdisplaydoctitle=true}


%===== Referenties =====
%----- bibliografie -----
\usepackage[style=apa,sortcites=true,autopunct=true,casechanger=auto,backend=biber]{biblatex}
\usepackage{csquotes}

%----- Bronvermelding -----
\addbibresource{files/\jobname.bib}
\urlstyle{rm}

\begin{filecontents}[overwrite]{files/\jobname.bib}
    @article{zeybek2020,
        title = {Analysis of pre-service teachers' learning styles according to {{V}}ermunt learning style model},
        author = {Zeybek, Gülçin and Şentürk, Cihad},
        date = {2020},
        journaltitle = {International Online Journal of Education and Teaching},
        volume = {7},
        number = {2},
        pages = {669--682},
        url = {https://iojet.org/index.php/IOJET/article/view/766},
        urldate = {2022-11-14},
    }
    @article{vermunt2004,
        title = {Patterns in Student Learning: {{Relationships}} between Learning Strategies, Conceptions of Learning, and Learning Orientations},
        shorttitle = {Patterns in Student Learning},
        author = {Vermunt, Jan D. and Vermetten, Yvonne J.},
        date = {2004},
        journaltitle = {Educational Psychology Review},
        volume = {16},
        number = {4},
        pages = {359--384},
        doi = {10.1007/s10648-004-0005-y},
    }
    @incollection{vanwaes2010,
        title = {Fostering {{Students}}' {{Learning}} with {{Study Guides}}: {{The Relationship}} with {{Students}}’ {{Perception}} and {{Learning Patterns}}},
        booktitle = {Facilitating Effective Student Learning through Teacher Research and Innovation},
        author = {Van Waes, Sara and Vanthournout, Gert and Gijbles, David and Donche, Vincent},
        editor = {Valenčič Zuljan, Milena and Vogrinc, Janez},
        date = {2010},
        pages = {49--76},
        publisher = {{Faculty  of Education, University of Ljubljana, Slovenia}},
        location = {{Ljubljana, Slovenia}},
        isbn = {978-961-253-051-8},
        langid = {english}
    }
\end{filecontents}
%===== =====

\begin{document}
    
    \pagenumbering{arabic}

    \lipsum[1][1-2] \parencite{zeybek2020}
    
    \textcite[pg. 670]{zeybek2020} \lipsum[3][4]
    
    \citeauthor{vermunt2004, zeybek2020} refer to \parencite{vanwaes2010} \lipsum[2][6] \citetitle[from][pg. 67]{vanwaes2010}
    
    \nocite{*}
    \printbibliography[title=References] 


\end{document}

The code contains the solution to the Typeface problem and Too many math fonts .. issue asked in the aforementioned questions.

The XeLaTeX output looks like this: enter image description here

The PDFLaTeX output gives: enter image description here

Compare the first and last citations in both examples. This issue resembles the question asked in Only one specific character missing when compiling with biber and xelatex, but the answer given there doesn't work here.

Note (from comments below): replacing the typeface font selection with just \usepackage{gfsartemisia-euler} compiles correctly in both engines. But when the mathdesign font packages are loaded as well, the compiling error returns.

8
  • 1
    the typeface package is imho not suited for a current xelatex, it doesn't support the TU encoding. Use the fontspec package to setup the fonts. Jan 14, 2023 at 23:18
  • 2
    why are you using typeface at all? It is very old and its own documentation says % 1. This package is most suited to pdfLaTeX, and not particularly to other TeX formats ... If using XeTeX, the fontspec package would make far and away the better choice Jan 14, 2023 at 23:19
  • All true. I was looking to circumvent the PDFLatex restrictions on math fonts and maybe be able to drop typeface until it had been updated. Tried fontspec, but that didn't solve anything.
    – alchemist
    Jan 14, 2023 at 23:23
  • Guess I am to use the older PDFLaTeX compiler and the quick solution to typeface you so kindly provided @David Carlisle after all then. At least I know that my other large documents can be complied with that fix.
    – alchemist
    Jan 14, 2023 at 23:26
  • @Ulrike Fischer - are you familiar with the packages fontsetup and mathspec ? The latter loads fontspec and enables to specifically load selected math fonts as addition to the font selections in fontspec. Going to tinker and try and see how this works (looks rather elaborate at first sight).
    – alchemist
    Jan 15, 2023 at 0:11

1 Answer 1

1

The comments to my question let to some trial-by-error experimenting and searching the community for options and solutions. Currently, I am migrating from using PDFLaTeX as compiler to XeLaTeX. I also extensively use the chemmacros and its related packages plus chemfig to create chemistry exams, additional texts and such to educate my students in the abstract art of chemistry. In that I encountered some reading difficulties of chemical formulas by several students, especially when confronted by a molecular bruto formula (giving its elemental composition) and the accompanying structural formula of that compound. That let to the use of a set of fonts, that I found diminished these reading difficulties.

In PDFLaTeX I can use the typeface package together with the patch David Carlisle so kindly provided. The above MWE shows how it can be used to manage the occurrence of the infamous Too many math fonts ... issue.

In switching to the modern compiler XeLaTeX another approach is needed. Ulrike Fisher pointed me the way to this solution:

%----- lettertypen -----
\usepackage[charter]{mathdesign}

\usepackage[sans-style=upright]{unicode-math} % automatically loads fontspec package
\defaultfontfeatures{Scale = MatchLowercase}

\setmainfont{GFS Artemisia}[Scale=1.05]
\setsansfont{FiraSans}[
        Extension = .otf,
        UprightFont = *-Regular,
        ItalicFont = *-Italic,
        BoldFont = *-Medium,
        BoldItalicFont = *-MediumItalic]

This replacement of the typeface section in the above MWE solves the issues about disappearing characters. (I guess I used the fontspec options incorrectly at first.)

With regard to the chemistry: TeX Gyre Heros has a straight lowercase l that is difficult to distinguish from an uppercase I. Fira Sans has a lowercase l that is slightly hooked making reading a compound like AlI3 far better readable even though Fira Sans uses more condensed capitals.

You must log in to answer this question.

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