Writing accents and quotes that look like accents and quotes in LaTeX

I had a very strange problem. In my slides for teaching LaTeX I wanted to tell people that they have to write ``test'' to get “test” (in correct quotes). But if you write ` in LaTeX, you get… a single quote sign! So I tried verbatim, \verb|`| and \texttt{`} – which all gives something that looks like a LaTeX quote sign.

After quite some frustration I found the following:

\`{} gives ` (grave accent)
\'{} curiously gives ´ (acute accent)

The straight quote is the hardest, after reading about many creative ways at stackexchange, I chose the easiest: Include package textcomp. Then

\textquotesingle gives ' (single straight quote)

What a mess!

This entry was posted in LaTeX and tagged , , , by swk. Bookmark the permalink.

About swk

I am a computational linguist, teacher of computer science and above all a huge fan of LaTeX. I use LaTeX for everything, including things you never wanted to do with LaTeX. My latest love is lilypond, aka LaTeX for music. I'll post at irregular intervals about cool stuff, stupid hacks and annoying settings I want to remember for the future.