How do I prevent "s from turning into ß with babel?
The character "
should never be used in running text to denote quotes. For double English quotes, use
``Test'' s
If you want German style quotes, use
"`Test"' s
With UTF-8 input, you can use
“Test” s
for English style and
„Test“ s
for German style. The alternative \glqq Test\grqq\ s
is less convenient.
Examples:
\documentclass[a4paper]{article}
\usepackage[T1]{fontenc}
%\usepackage[utf8]{inputenc} % not needed with LaTeX after 2018-04-01
\usepackage[ngerman]{babel}
\usepackage{upquote,booktabs} % for the table
\begin{document}
\begin{tabular}{lll}
\toprule
\multicolumn{1}{c}{Style} &
\multicolumn{1}{c}{Input} &
\multicolumn{1}{c}{Output} \\
\midrule
English & \verb|``Test'' s| & ``Test'' s
\\
English & \verb|“Test” s| & “Test” s
\\
German & \verb|"`Test"' s| & "`Test"' s
\\
German & \verb|„Test“ s| & „Test“ s
\\
German & \verb|\glqq Test\grqq\ s| & \glqq Test\grqq\ s
\\
\bottomrule
\end{tabular}
\end{document}
Solution 3: use left and right quotes in the source too, as David Carlisle auggested:
\documentclass{article}
\usepackage[ngerman]{babel}
\usepackage[latin1]{inputenc}
\usepackage[T1]{fontenc}
\begin{document}
“Test”s, and “test” s too (but I’d use “test”~s, then).
\end{document}
This is the output I get:
If you want to use latin1 (which is ISO 8859-1), then I have collected two solutions which are already mentioned in the comments.
The problem is, that in some cases*
"A, "O, "U, "a, "o, "u, "s
are commands for special characters (instead of\"A, \"O or \ss{}
for example). So LaTeX cannot know what you mean in your example.*Depending on the loaded packages, in this case, the
babel
package.
\documentclass{article}
\usepackage[ngerman]{babel}
\usepackage[latin1]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{csquotes}
\begin{document}
\section*{They are all the same regarding the ß}
\begin{itemize}
\item "Test" s
\item " s
\item "s
\item But: "\ s % Thanks to comment of user Dũng Vũ
\end{itemize}
\section*{Solution 1: Use \texttt{babel}'s quotation marks}
% See also https://www.namsu.de/Extra/befehle/Anfuehrungszeichen.html
% https://de.wikibooks.org/wiki/LaTeX-W%C3%B6rterbuch:_Anf%C3%BChrungszeichen
% \glqq --> German Left Double Quote
% \grqq --> German Right Double Quote
% \glq --> German Left Single Quote
% \grq --> German Right Single Quote
\begin{itemize}
\item \glqq Test\grqq\ s (Don't forget the \textbackslash\ after the command)
\item \glq Test\grq\ s
\end{itemize}
\section*{Solution 2: Use the \texttt{csquote} package}
% For more information, have a look at the manual
% https://ctan.org/pkg/csquotes
\enquote{Test} s
\end{document}
Note: On the screenshot, you see on the bottom right that I use the correct encoding in the editor, in this case ISO-8859-1 which is latin1.