Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I have a report written in MS Word which I would like to turn into a LaTeX document. I copy-pasted the content of the document in my LaTeX editor (TeXShop, LaTeX, pdfTeX) and everything comes out fine except for the apostrophes ' which come out as ? (so for example, instead of outputting I'm, I?m is output instead).

In my LaTeX editor, the apostrophes appear as they should, it's only in the compiled pdf document that they are turned into ?.

For a strange reason, I've noticed that if I delete (in the editor) an apostrophe and retype the same apostrophe in the editor, then they are output normally. This trick doesn't work if I do Find and Replace, so the solution I have up to now is simply to manually delete and retype each apostrophe in the text.

This however is very time consuming so I would love to find a better solution!

share|improve this question
    
It sounds like your latex file is using an input encoding that's not compatible with your version of MS Word. (Unlike the basic letters and numerals, for which most input encodings use the same representations, this is not the case for "auxiliary" glyphs such as single and double apostrophes.) With a MWE (minimum working example) it's going to be well-nigh impossible to indicate a robust fix to the problem you're facing. Hence, please consider posting such an MWE. Alternatively, you could try a command such as \usepackage[utf8]{inputenc} and see if this solves the issues you're reporting. –  Mico Sep 3 '12 at 16:56
    
You should put an example document (at best in a zip-file, so that the encoding is not changed by copy&paste) somewhere for download. –  Ulrike Fischer Sep 3 '12 at 16:58
add comment

2 Answers

up vote 6 down vote accepted

Word auto corrects input ' to the typographically correct . LaTeX does this, too.

  1. You can try to search-and-replace all to ' in Word itself or
  2. Use another input encoding, for example UTF8: \usepackage[utf8]{inputenc}
share|improve this answer
    
Solution 1 worked for me, thanks. –  Percy Sep 3 '12 at 21:55
add comment

I have had such problems too. To me it seems Word does dark replacement magic with all kinds of special characters that are neither "," nor ".". What exactly it does seems to depend on language settings and Word versions.

I'm using my own voodoo to deal with that, amongs which is this sed-script

#!/bin/sed -f
s/\x84/,,/g
s/\x93/''/g
s/\xE2\x80\x98/'/g
s/\xE2\x80\x99/'/g
s/\x85/\\ldots/g
s/\x96/--/g
s/\xE2\x80\x9C//g
s/\xE2\x80\x9D//g
s/\xE2\x80//g

For your purposes the first 4-5 rules should be the most interesting. As always, YMMV.

share|improve this answer
    
Your script works well if the file is saved in utf8 (2Byte). How can I extend it so that it can works well with utf8 2Byte? –  lazyboy Sep 3 '12 at 19:55
1  
I don't understand your question, but if you want to fiddle with character encondings and Word exports, have a look at tidy and iconv. –  user1129682 Sep 3 '12 at 20:40
    
Oh, I'm sorry. I means utf-16 (A character is saved in 2 bytes if necessary). But it is not so important. I have a look in tidy and iconv and solved my trouble. –  lazyboy Sep 5 '12 at 10:15
    
I'm glad you had your problem solved. UTF-16 is up to 4 bytes IIRC, UTF-8 already can be 2 bytes a character if necessary –  user1129682 Sep 5 '12 at 10:41
add comment

Your Answer

 
discard

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.