2

I have a problem with œ and Œ unicode characters using fourier with xelatex and lualatex. When I compile with pdflatex (with [T1]{fontenc} and [utf8]{inputenc}) everything is ok.

\documentclass[varwidth,border=7pt]{standalone}
\usepackage{fontspec} % pour le bon encodage des PDFs => police lmodern
% ---------------
\usepackage{fourier}
% ---------------

\begin{document}

  œ, Œ, æ, Æ

  Opération à c{\oe}ur ouvert.
  Autres temps, autres mœurs.
  Œdipe.

  Ædes.
  Penitusque cavæ plangoribus ædes femineis ululant.

\end{document}

enter image description here

I have found how to overcome this using newunicodechar package :

\documentclass[varwidth,border=7pt]{standalone}
\usepackage{fontspec} % pour le bon encodage des PDFs => police lmodern
% ---------------
\usepackage{fourier}
% correct the bug with xe/lualatex
\usepackage{newunicodechar}
\newunicodechar{œ}{\oe}
\newunicodechar{Œ}{\OE}
% ---------------

\begin{document}

  œ, Œ, æ, Æ

  Opération à c{\oe}ur ouvert.
  Autres temps, autres mœurs.
  Œdipe.

  Ædes.
  Penitusque cavæ plangoribus ædes femineis ululant.

\end{document}

enter image description here

My question is : Is this a known (or unknown) bug or am I doing something wrong ?

4

You can't use the fourier package to setup the text font with xelatex and lualatex. It switches to T1 encoding which isn't sensible for this engines.

You can use it to change the math setup, but for the text use e.g. heuristica:

\RequirePackage{luatex85}
\documentclass[varwidth,border=7pt]{standalone}
\usepackage{fourier} %before fontspec
\usepackage{fontspec} % pour le bon encodage des PDFs => police lmodern
\setmainfont{Heuristica}
% ---------------
%
% ---------------

\begin{document}

  œ, Œ, æ, Æ

  Opération à c{\oe}ur ouvert.
  Autres temps, autres mœurs.
  Œdipe.

  Ædes.
  Penitusque cavæ plangoribus ædes femineis ululant.

\end{document}

enter image description here

  • Isn't it necessary then to load fontspec with the no-math option? – Franck Pastor Jan 12 '18 at 21:56
  • @FranckPastor it is not necessary but it can make a difference. – Ulrike Fischer Jan 12 '18 at 22:10
  • How so? I thought that without this option, it was the Latin Modern math fonts that were loaded by fontspec. – Franck Pastor Jan 12 '18 at 22:15
  • @FranckPastor No. You can check it in a minimal example with lualatex: $\int x=y$ will still use cmex and cmmi. But fontspec changes some math alphabets (e.g. \mathrm). – Ulrike Fischer Jan 12 '18 at 22:19
  • @UlrikeFischer and why Æ is working but not Œ ? And why the font is looking like fourier if it is not ? – Kpym Jan 12 '18 at 22:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.