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 need to display two single quotes without anything between them (I'm preparing computer science lecture slides and I want to display '\''), but of course LaTeX wants to translate '' to closing double quotes.

What can I do to bypass what is now a limitation for me?

share|improve this question
2  
This question triggered a lot of different suggestions and I learned a lot from most of them... I elected the answer with the solution I actually chose, but many of them would have worked. Thanks guys! –  Eusebius Sep 24 '12 at 19:36
add comment

4 Answers

up vote 6 down vote accepted

Depending on whether you need ordinary or "straight" (i.e., perfectly vertical) single quotes, you could use a verbatim environment or some of the macros of the textcomp package:

\documentclass{article}
\usepackage{fancyvrb} % for \Verb instruction
\usepackage[T1]{fontenc}
\usepackage{textcomp} % for \textquotesingle
\begin{document}
\Verb+'\''+

\texttt{\textquotesingle\textbackslash\textquotesingle\textquotesingle}
\end{document}

enter image description here

share|improve this answer
    
Thanks, useful set of suggestions. I went for verbatim, I just didn't know I could use verbatim stuff in-line. –  Eusebius Sep 24 '12 at 19:34
add comment

Using '\null' or '\hspace{0pt}' works for me.

share|improve this answer
add comment

Put a {} between the quotes:

'\textbackslash'{}'
share|improve this answer
add comment

You can set a single left quote using \textquoteleft and a single right quote using \textquoteright, so

\textquoteleft\textquoteright
share|improve this answer
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.