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.

Why do

``` 

and

''' 

produce outputs with different spaces?

enter image description here

\documentclass{article}
\parindent=0pt

\begin{document}
Input:
\begin{verbatim}
```\\
'''
\end{verbatim}

Output:

```\\
'''
\end{document}
share|improve this question
2  
If you load fontenc with the [T1] encoding the spacing is the same for both. –  Alan Munn Jul 4 '12 at 4:54

1 Answer 1

up vote 19 down vote accepted

The TeX Book mentions (Chapter 2: Book Printing versus Ordinary Typing, p 5): "There's usually less space preceding a single left quote than there is preceding a double left quote. (Left and right are opposites.)"

As such, in the default Computer Modern font,

```\ \ldots\ '''

is interpreted as “‘ ... ”’ that has an opening double quote and a closing single quote, resulting in incorrect spacing. In these instances, Knuth suggests using

enter image description here

Outer double, inner single: ``\thinspace`\ \ldots\ '\thinspace'' \par
Outer single, inner double: `\thinspace``\ \ldots\ ''\thinspace'
share|improve this answer

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.