I am helping a friend use LaTeX to generate a book of short stories. The stories are received from the authors in MS Word -- unfortunately that is only text editor most of the world knows. There is no math content to worry about, just plain text. However, Word likes to convert some plain text into other characters: The two that I have noticed so far are the quotes and ...
.
I tried the suggested approach of using inputenc
without any success even with various input encoding. I am using \inputencoding
as opposed to a package option as I feel as if I might need to change them between various stories.
So, what is the suggested approach to handle this? Ideally, I'd prefer to have some way of mapping these characters to the appropriate LaTeX friendly ones.
Notes:
- I personally don't like leaving the smart quotes as there are cases where the authors have missed a closing quote and then all the subsequent quotes are incorrect. If this is caught early on, it can easily be corrected in the Word doc before pasting into a .tex file. But often, the editor has made significant edits to the .tex file before this problem is noticed. Hence, the preference to have
csquotes
handle this problem rather than using the specific open and close quotes.
References
How to make apostrophes appear normally when copy-pasting from a MS Word document? provides a script to do a one time conversion of some characters, but I'd prefer to keep those intact in the source .tex file if possible.
I found this to be a good reference on fontenc vs inputenc.
Code:
\documentclass{article}
\usepackage{inputenc}
\usepackage{csquotes}
\MakeOuterQuote{"}
%\inputencoding{utf8}
%\inputencoding{latin1}
%\inputencoding{ansinew}
\inputencoding{cp1252}
\begin{document}
"It's too late now…" (should have \ldots\ before end quote)
“Please, sir, don’t.” (should have left and right quotes)
\end{document}
Libre Office
, convert toodt
format and then usewriter2latex
.utf8
encoding, thenutf8
encoding works well, and the same forcp1252
.