TransWikia.com

Problematic font interactions

TeX - LaTeX Asked by Yvan Velenik on January 8, 2021

In one of my (big) projects of a few years ago, I was using fourier as the main font and roboto condensed as default sans-serif font (mainly used in (sub)section titles). This worked fine.

I tried to recompile the project today and I discovered that, among others, the italic and slanted styles are ignored. This seems to be due to an interaction between roboto condensed and fourier.

Here is a minimal working example that shows my problem:

documentclass{memoir}

usepackage{fourier}
usepackage[condensed]{roboto}

begin{document}
    Test textit{Test} textsl{Test} textbf{Test} (Test) textsf{Test}
end{document}

Here is the output:

enter image description here

If I replace usepackage[condensed]{roboto} by usepackage{roboto}, then the output becomes:

enter image description here

As you can see, the latter work fine, but not the former. What am I doing wrong?

2 Answers

This is quite similar to Problems with italics in other font when using roboto condensed but requires a few more tricks in order to remove annoying spurious warnings. I added also a scaling for Roboto, which otherwise is taller than Fourier (actually Utopia).

documentclass{memoir}
usepackage[T1]{fontenc} % fourier does it, so it's best here

% avoid a spurious warning about cmr
DeclareFontShape{T1}{cmr}{c}{n}{<->ssub*cmr/m/n}{} % avoid a spurious warning

% load roboto (but scaled because fourier is less tall)
usepackage[scaled=0.9,condensed]{roboto}

% avoid a spurious warning about futs
input{t1futs.fd}
DeclareFontShape{T1}{futs}{c}{n}{<->ssub*futs/m/n}{} % avoid a spurious warning

% load fourier
usepackage{fourier}

% fix the wrong setting by roboto
renewcommand{seriesdefault}{m}

begin{document}

Test textit{Test} textsl{Test} textbf{Test} (Test) textsf{Test}

end{document}

enter image description here

Correct answer by egreg on January 8, 2021

Although you mention in the comments that you’re using PDFTeX, another solution is to load OTF versions of the fonts in LuaLaTeX (or XeLaTeX). You can load Erewhon Math as your Fourier replacement, through fourier-otf or unicode-math, and the OpenType version of Roboto with setsansfont.

I would recommend using the modern toolchain when you can, and legacy 8-bit fonts when you have to. Upgrading will wipe out a lot of technical debt to old packages.

Answered by Davislor on January 8, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP