0

LaTeX is silently dropping accented characters when I use the T1 font encoding. Here's my MWE:

\documentclass{article}

% Remove this and it works fine
\usepackage[T1]{fontenc}

\font\tensfb = cmssbx11

\begin{document}

% Note the missing letters in the output
{\tensfb Fr\'echet--Dujmovi\'c}

\end{document}

Both latex and pdflatex produce the following output:

LaTeX output

Does anyone know how to fix this? I'm guessing it has to do with the (probably old-school) way the font is being selected. What's the right way to do it?

4
  • 1
    font cmssbx11 almost certainly doesn't contain pre-accented letters, so the T1 encoding isn't doing you any favors here. Oct 17, 2016 at 14:48
  • you just seem to want sans serif bold so \textbf{\textsf{hello}} Oct 17, 2016 at 14:52
  • Yes, easy question. This came up within a .cls file that has been evolving for 7 years (and was originally based on some example that's probably much older).
    – Pat Morin
    Oct 18, 2016 at 13:24
  • Unless the class is older than 1993 it's always been wrong:-) Oct 18, 2016 at 13:27

2 Answers 2

4

T1-encoding redefines the \' so that it points to a position that doesn't exist in your font. Use the normal latex commands to select fonts:

\documentclass{article}

\usepackage[T1]{fontenc}

\begin{document}
\large 

Fr\'echet--Dujmovi\'c

{\sffamily\bfseries \large Fr\'echet--Dujmovi\'c}

{\fontencoding{OT1}\sffamily\bfseries \large Fr\'echet--Dujmovi\'c}

\end{document}

enter image description here

3
  • I selected this as the answer because the third line produces output identical to the original text (not sure I understand why the font encoding should affect the weight, though).
    – Pat Morin
    Oct 18, 2016 at 13:22
  • @PatMorin that's because your document specified T1 (8 bit) font encoding, but you selected a 7bit font, In the last line Ulrike has switched back to the classic OT1 encoding so you get the 7bit font set up for sans serif, matching the font you used. Note that you get no hyphenation in words with accents in OT1 so unless this is a one-off name, T1 is definitely preferred for non-English documents. Oct 18, 2016 at 13:26
  • @DavidCarlisle : In this case it's only in section headings, so hyphenation is not really an issue. This is a class file for a journal, so it's more important to keep it looking the same as other articles in the journal. We may rethink this when we start a new volume next year.
    – Pat Morin
    Oct 18, 2016 at 14:53
6

That is to be expected, by using the \font primitive directly you have undercut the entire mechanism latex uses to ensure that you get the correct fonts for the correct encodings, so latex thinks you have an 8bit T1 encoded font, but you have loaded a 7bit one.

enter image description here

\documentclass{article}

% Remove this and it works fine
\usepackage[T1]{fontenc}



\begin{document}

% Note the missing letters in the output

{\large\sffamily\bfseries Fr\'echet--Dujmovi\'c}

\end{document}

Note that in the log on your original you will see

Missing character: There is no � in font cmssbx11!
Missing character: There is no � in font cmssbx11!

TeX does not drop the characters with no warning.

You must log in to answer this question.

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