[Tex/LaTex] How to display two single quotes in LaTeX

punctuationsyntax

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?

Best Answer

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