TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

When I collaborate with other individuals, I generally receive text to be typeset in the form of a word document. However, it seems that there are almost always characters that, when I copy and paste - for lack of a better word, "bugger up" pdflatex.

Is there a way to sanitize these special characters and replace them with their plain text cognates?

with ', double-spaces with space, and so on.

Note: I could very well be referring to an issue associated with encoding, but I don't understand that - and neither will my collaborators.

PS: No idea what tag is relevant here, so please do so appropriately should you have the ability to do so.

share|improve this question
Have you tried inputenc with the utf8 option set? – Canageek Mar 2 '12 at 5:49
I recommend sed for tasks like this because I don't think a LaTeX package can/should solve these problems and because sed is made for things like this. – Marc van Dongen Mar 2 '12 at 6:10
@BrandonBertelsen Perhaps it's the other way around (windows isn't particularly sed friendly). – Marc van Dongen Mar 2 '12 at 6:28
sed should work fine in cygwin. I understand the overhead involved in that though. You may want to check out the regular expressions abilities of other languages. Python works extremely well with Windows for example. – qubyte Mar 2 '12 at 7:20
You could try to open the doc-file in OpenOffice and then use the writer2latex plugin. – schmendrich Mar 2 '12 at 8:43
up vote 3 down vote accepted

A summary of the comments, in order of ease of use:

  • \usepackage[utf8]{inputenc}
  • Open in OpenOffice Writer, use writer2latex plugin
  • Use antiword and then pandoc to convert to tex.
  • Use sed to find replace encoded characters
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.