[Tex/LaTex] Single quotes in csquotes

csquotespunctuation

I'm using the csquotes package with the modifications recommended by this answer, to detect quotation marks in my text (pasted from Microsoft Word) and make them look good in the output.

Is there any way to have it also detect single quotes, so that they are oriented the correct way and not treated as apostrophes, without messing up the existing apostrophes? (I don't want to have to manually find all of the quote-within-quotes and replace ' with `.)

\documentclass{article}

\usepackage{csquotes}
\usepackage[american]{babel}
\DeclareQuoteStyle[american]{english}% verified
  {\textquotedblleft}
  [\textquotedblleft]
  {\textquotedblright}
  [0.05em]
  {\textquoteleft}
  {\textquoteright}
\MakeOuterQuote{"}

\begin{document}
I say: "These quotes look nice, but 'if I quote someone else within a quote like this,'
or 'like this,' they don't."
\end{document}

quote screenshot

Best Answer

Although the csquotes package allows you to define certain characters as "active" quotes, as your sample document does for the " character, the single quote character cannot be so used, since it is a reserved character in TeX.

Since you mention that you are using text from an MSWord document, a better solution in this case would be to encode your source file as UTF-8 and either use the inputenc package (if you are using pdfLaTeX) or a UTF-8 aware engine (XeLaTeX or LuaLaTeX) to compile your document. In this way you can use the "smart" quote characters ,, , and directly in your source document. MSWord is quite good at automatically converting quotes correctly. If your document doesn't currently use the smart quotes, you can turn that on and then do a global replace for both ' and " and all the quotes will then be correctly changed.

Source with these quotes can then be used in your LaTeX document. In this case, you don't need to use the csquotes package at all (although you can, still if you have a mixture of quotation marks in the source.)

Using pdfLaTeX

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\begin{document}
I say: “These quotes look nice, but ‘if I quote someone else within a quote like
this,’ or ‘like this,’ they don’t.”
\end{document}

Using XeLaTeX or LuaLaTeX

\documentclass{article}
\usepackage{fontspec}
\begin{document}
I say: “These quotes look nice, but ‘if I quote someone else within a quote like
this,’ or ‘like this,’ they don’t.”
\end{document}

output of code