Reading the docs of upquote
package indicates that, for the standard CM fonts, a \ttfamily\char13
already produces the desired glyph, so I just made the '
active and redefined it.
EDITED so that straight quote is only active in the sftabbing
environment, and restores to normal quote thereafter.
EDITED to include cmap
package which allows proper cut/paste of quote character from PDF (see Can't copy-paste from my PDF. Any idea why?)
ADDENDUM added for those for whom cmap
approach does not work.
\RequirePackage{cmap}
\documentclass{article}
\newenvironment{sftabbing}
{\par\sffamily\small\squoteon\tabbing}
{\endtabbing\squoteoff\par}
\let\svquote'
\catcode`'=\active
\def\squoteon{\catcode`'=\active%
\def'{\setbox0=\hbox{\ttfamily\char13}\raisebox{1pt}{\box0}}}
\def\squoteoff{\catcode`'=12\let\'\svquote}
\catcode`'=12
\begin{document}
\begin{sftabbing}
INSERT \= INTO Shippers(CompanyName, Phone) \\
\> VALUES ('Federal Express', '02 752 75 75') \\ \\
UPDATE \= Shippers \\
SET \> CompanyName='Fedex' \\
WHERE \> CompanyName='Federal Express' \\ \\
SELECT \> ProductID, ProductName \\
FROM \> Products P \\
WHERE \> EXISTS ( \\
\> SELECT \= * \\
\> FROM \> Orders O JOIN Customers C ON \\
\> \> O.CustomerID = C.CustomerID JOIN \\
\> \> OrderDetails D ON O.OrderID = D.OrderID \\
\> WHERE \> C.Country = 'Germany' AND D.ProductID = P.ProductID )
\end{sftabbing}
Test's of quote
\end{document}
Zoom:
For comparison, the straight quote activated by the textcomp
package in \sffamily
looks like a rectangular block, which may be more in keeping with the sf style, but which I find unattractive:
I thus chose to retain the \ttfamily
look for the quote character.
ADDENDUM:
For those for whom the cmap
package does not provide relief for the copy/paste feature from PDFs, an alternative "glyph-to-unicode" approach is here. Both methods work for me, but the OP was having difficulty with the cmap
approach.
\documentclass{article}
\newenvironment{sftabbing}
{\par\sffamily\small\squoteon\tabbing}
{\endtabbing\squoteoff\par}
\let\svquote'
\catcode`'=\active
\def\squoteon{\catcode`'=\active%
\def'{\setbox0=\hbox{\ttfamily\char13}\raisebox{1pt}{\box0}}}
\def\squoteoff{\catcode`'=12\let\'\svquote}
\catcode`'=12
\pdfgentounicode=1 %
\input glyphtounicode.tex %
\begin{document}
\begin{sftabbing}
INSERT \= INTO Shippers(CompanyName, Phone) \\
\> VALUES ('Federal Express', '02 752 75 75') \\ \\
UPDATE \= Shippers \\
SET \> CompanyName='Fedex' \\
WHERE \> CompanyName='Federal Express' \\ \\
SELECT \> ProductID, ProductName \\
FROM \> Products P \\
WHERE \> EXISTS ( \\
\> SELECT \= * \\
\> FROM \> Orders O JOIN Customers C ON \\
\> \> O.CustomerID = C.CustomerID JOIN \\
\> \> OrderDetails D ON O.OrderID = D.OrderID \\
\> WHERE \> C.Country = 'Germany' AND D.ProductID = P.ProductID )
\end{sftabbing}
Test's of quote
\end{document}