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.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In an automated system that is generating LaTeX to render PostScript and PDF, i need to avoid an ambiguity in LaTeX:

  • Two backticks (``) produce a closing doublequote:
  • A question/exclamation mark followed by a backtick (?`) produces the inverted character: ¿
  • Combined, when trying to display a question mark followed by a quote (,,wtf?``), LaTeX produces the following output: „wtf¿‘

What is the best practise to avoid this? The desired output is: „wtf?“

share|improve this question
1  
Are you using this for German? – egreg Feb 7 '14 at 13:49
    
@egreg yes! does it make a difference? – Kaii Feb 7 '14 at 13:58
up vote 6 down vote accepted

You can disable the ligatures using microtype:

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage{microtype}
\DisableLigatures[?,!]{encoding=T1}

\begin{document}
,,Hier?``

,,Hier!``
\end{document}

enter image description here

Or teach the automated system to use UTF-8 and input the “real” characters:

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}

\begin{document}
„Hier?“

„Hier!“
\end{document}

As cgnieder suggests, there's another possibility:

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}

\begin{document}
"`Hier?"'

"`Hier!"'
\end{document}
share|improve this answer
2  
More possibilities: babel shortcuts "` and "' for the quotes or using csquotes :) – clemens Feb 7 '14 at 14:01

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.