4

The euro symbol in my documents that use cochineal font looks really bad, however in the font tables in the cochineal documentation there's an euro sign which looks decent. Here's the € I get: Text in Cochineal font but € symbol is ugly, 1,99€

\documentclass{report}
\usepackage{cochineal}
\usepackage[T1]{fontenc}

\begin{document}
Text in Cochineal font but € symbol is ugly 1,99€
\end{document}

But I would like to typeset the € sign from the cochineal documentation:

enter image description here

How?

(I installed cochineal from ctan and reran pdflatex on the documentation to make sure the font version isn't the problem)

1
7

Neither the latex format nor the font package itself declares which subset of TS1-encoding the font supports, and so a rather conservative default (9) is used which means that the euro is faked with a C and an equal sign.

You can set the subset number, but someone will have to check which one is actually correct (the 7 in the code below is rather conservative too). At best ask the maintainer of the font. He can then make a request that the setting is added to the latex format (it contains already a long list for various fonts).

\documentclass{report}
\usepackage{cochineal} 
\usepackage[T1]{fontenc}
\DeclareEncodingSubset{TS1}{Cochineal-*}{7} %number should be smaller than 8
\begin{document}
Text in Cochineal font but € symbol is ugly 1,99€
\end{document}

enter image description here

3
  • Thank you so much. I applied that line to my other documents and now they look great. I'll wait a few days if anything comes up here and then inform the package maintainer that they may want to look into this. – Gamification Sep 10 '20 at 12:51
  • 1
    Falling back to combining a C with a = sounds like a terrible choice to be honest. shakes head – Gamification Sep 10 '20 at 12:59
  • 1
    well if a font doesn't have the char it is better than leaving a white space or using some arbitrary euro from another font. But nowadays it is not often needed to fake it, most fonts do have the euro. – Ulrike Fischer Sep 10 '20 at 13:05
4

This seems to be a bug in the package, which I'll mention to the author, but what you can do in the meantime is

% !TEX encoding = UTF-8 Unicode
\documentclass{report}
\usepackage[TS1]{fontenc}
\usepackage{cochineal}
\renewcommand{\texteuro}{{\fontencoding{TS1}\fontfamily{Cochineal-LF}\selectfont \char191 }}

\begin{document}
Text in Cochineal font, and the € symbol is no longer ugly 1,99€

\texteuro 

\end{document}

enter image description here

4
  • I've already accepted Ulrike Fischers answer but yours works just as well. I'm wondering which of the two ways of resolving this is the better. Thank you for mentioning it to the author, now I won't have to do it. – Gamification Sep 10 '20 at 12:53
  • No bug. Just missing information from the font package maintainer. – egreg Sep 10 '20 at 13:02
  • 1
    @Gamification -- My answer is simply a work-around for the single character you were after. Ulrike's answer goes to the heart of the matter and might address some other issues as well. – John Sep 10 '20 at 14:40
  • The most recent updates to Cochineal (now in CTAN) have resolved this issue. – John Sep 25 '20 at 20:25
2

As with a great many questions about legacy 8-bit fonts, you can solve the problem by loading the font in a modern format from LuaLaTeX.

\documentclass{report}
\tracinglostchars=2
\usepackage{fontspec}

\setmainfont{Cochineal}[Scale=1.0]

\begin{document}
Text in Cochineal font but € symbol is ugly 1,99€
\end{document}
1
  • Thanks but I use plain pdflatex. – Gamification Sep 10 '20 at 12:55

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.