The character "
is made active, to expand to a double opening or closing quote (context depending). However, the typewriter font in OT1 encoding has a backslash where the text fonts have the double opening quote.
Solution:
\documentclass[12pt]{article}
%make " quotation marks
\usepackage[english]{babel}
\usepackage{csquotes}
\MakeOuterQuote{"}
\begingroup\lccode`~=`"
\lowercase{\endgroup
\DeclareTextFontCommand{\texttt}{\ttfamily\def~{"}}%
}
\begin{document}
\texttt{read.table(file, sep = "t")}
\end{document}
This won't work if you nest quoted text in normal font inside \texttt
. It won't work also in the scope of \ttfamily
, but it could be arranged for.

tt
font has a backslash where the standard text font has the opening double quote, so that effect is to be expected.tt
font have an opening quote? Or would I have to use ``t'' (two single quotes at the end)?