Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I have a document where the \"u is not rendered as ü, but more like a u with a strikethrough mark:

Example of wrong diacritic

Directly using the UTF-8 encoded ü character in the input file works as expected, however. I have the following classes/packages loaded (all with their default options, in this order):

  • letter
  • ifthen
  • graphicx
  • lastpage
  • fontenc
  • ragged2e
  • ngerman
  • hyperref

Anybody knows what could be the cause of this issue?

share|improve this question
2  
Welcome to TeX.sx! Please add a minimal working example (MWE) that illustrates your problem. –  Joseph Wright Jun 28 '12 at 11:12
    
I've tried and failed ;-) The problem cropped up when creating a new letter class. Just putting equivalent commands in a normal .tex file didn't exhibit the same problem. –  Michael Wild Jun 28 '12 at 11:14
3  
Isn't that a small umlaut on a big letter rather than a strikethrough? I think you will need to show what fonts you are using, and how you loaded them. Start with the document that does that and remove packages one at a time until you can remove nothing more, then edit your question to add the MWE –  David Carlisle Jun 28 '12 at 12:06
3  
Try if the problem goes away if you use babel with the option ngerman instead of the package ngerman. –  Ulrike Fischer Jun 28 '12 at 12:17
2  
The output looks like the output of \accent127 u (when using a T1 encoded font). I could reproduce your output by forcing the use of an T1-encoded font while OT1-encoding is active. So check if your code use some font primitives like \font or \newfont, or if does some encoding switches. Edit: My crystalball seems to be in good shape. Your code uses \newfont{\xiiiv}{phvr8t at 8.5pt}. That's not a good idea! –  Ulrike Fischer Jun 28 '12 at 15:16
show 4 more comments

1 Answer

up vote 4 down vote accepted

Tricky problem. The issue is the following:

In your class file you define a number of "fixed fonts".

\DeclareFixedFont{\x}{T1}{phv}{m}{n}{10}
\DeclareFixedFont{\xb}{T1}{phv}{b}{n}{10}
\newfont{\xiiiv}{phvr8t at 8.5pt}
\newfont{\xiiivb}{phvb8t at 8.5pt}

But this is wrong in several respects.

  • \newfont is not a LaTeX interface since 1994 (LaTeX2e) it is really only there for compatibility with 2.09 documents it should be \DeclareFixedFont throughout
  • However, \DeclareFixedFontis not meant to load fonts for general typesetting. It gives you a font, right, but it doesn't set up the machinery to get all the special symbols autmatically choose the right slots. All that needs to be done by yourself in that case.

\DeclareFixedFont means that you load a font in a particular encoding in a particular size, but LaTeX afterwards doesn't know anything about this font. So all the hard work that automatically makes \"u select the right glyph or produce and accent on top of some glyph, etc. is not available.

Thus what happens is that LaTeX thinks it is typesetting in OT1 encoding (which means \"u produces an accent on top of u) while in reality the \closing command called \x (a T1 font). So it picks up the umlaut from the OT1 position (but in T1 there is this bar in this slot) and happily positions this on top of u.

So bottom line, forget about \DeclareFixedFontif you want to typeset general text and you don't know what diacritics come along and instead use the somewhat slower

\fontsize{10}{12}\usefont{T1}{phv}{m}{n}

but then you have all diacritics set up correctly.

share|improve this answer
    
Thanks a lot for that very thorough explanation. I actually tried not to meddle with the font code of the previous author of the class, but it seems I'll have to. I will give it a try immediately. –  Michael Wild Jun 28 '12 at 15:39
    
Thanks, I now rewrote everything in terms of \fontsize and \usefont using \(re)newcommand, and it seems to work perfectly. Provided I understood the font naming conventions correctly, I now also have the correct fonts following the corporate design... –  Michael Wild Jun 28 '12 at 15:59
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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