2

I'm writing a little document on LaTeX to explain how to type LaTeX to some of my fellow colleagues. What's giving me a headache are double quotes.

As an alternative to \textquotedblleft text \textquotedblright, I wanted to show them `` text ''. Unfortunately, verbatim beautifies the symbols, so they are not keyboard-like. Which is what I want.

I have tried opening with \ ` (twice) and closing with \textquotesingle (twice too). (See what I mean in WME below.) That gets the proper outcome... despite non-fatal compiling errors.

\documentclass[]{article}
\usepackage{verbatim}
\begin{document}
\textbackslash textquotedblleft method that works \textbackslash textquotedblright

`` the outcome is good, but there are errors \textquotesingle\textquotesingle

\begin{verbatim} `` verbatim does not show the actual symbols '' \end{verbatim} \end{document}

Any help would be appreciated.

Laura F.
  • 116
  • 1
    \usepackage{upquote} for verbatim. – Ulrike Fischer Feb 10 '24 at 12:16
  • Thank you @UlrikeFischer for the sugestion. Actually, looking into it I found another solution that is much to my liking:
    https://tex.stackexchange.com/questions/410434/is-there-upquote-like-package-for-main-text-and-not-just-verbatim-text Solves my one-time issue nicely and without any aditional packages or new settings, which is just perfect.
    – Laura F. Feb 10 '24 at 13:48

3 Answers3

3

You may want to switch to LuaLaTeX, which does not "beautify" the symbols in verbatim mode.

enter image description here

% !TEX TS-program = lualatex
\documentclass{article}

\begin{document}

\begin{verbatim} ``Under LuaLaTeX, verbatim-mode shows the actual symbols'' \end{verbatim}

\noindent \verb+``Under LuaLaTeX, verbatim-mode shows the actual symbols''+

\end{document}

Mico
  • 506,678
3

You want upquote.

\documentclass{article}
\usepackage{upquote}

\begin{document}

\verb|``test''|

\begin{verbatim} ``verbatim does not show the actual symbols'' \end{verbatim}

\end{document}

enter image description here

egreg
  • 1,121,712
0

Thank you guys for the help! Following a (different) suggestion, I arrived to this solution:

\`{}\`{} text \textquotesingle\textquotesingle 

which is based on what I found in this other question.

It's minimal and clean, no errors, requires no aditional packages. Perfect for a one-time issue as was my case.

Laura F.
  • 116