1

I am using the usual apostrophe key on my keyboard, but when I try to compile the file it halts at the apostrophe. It seems to think it's an AE ligature!

Someone suggested adding a command to change the encoding to UTF8 and I tried this, but still the same problem!

Surely the apostrophe is a perfectly standard character?

I am using Word to edit the TEX file. Don't know if that's relevant.

Thanks

Edit:

I am not sure what you mean by a short compilabe code. The TEX file compiles fine and then if I type an apostrophe it crashes.

The DOS box of the compiler stops with a question mark on the left and it repeats the offending sentence, but with an AE ligature where my apostrophe was

Edit 2::

But the TEX file is pretty large. I am not really sure what to strip out to show you.

Basically, the file compiles perfectly unless I type an apostrophe in a sentence. So I know it's the apostrophe causing the problem.

The compiler is pausing at this sentence and showing an AE ligature where the apostrophe should be.

So I am assuming that the apostrophe I type in using Word is somehow creating the wrong character. Are there other ways to type an apostrophe in Word besides the one on the @ key (just to the left of the return key)?

Mensch
  • 65,388
Stuart
  • 21
  • 2
    Welcome to TeX.SE! Please add ashort, compilable code resulting in your error. And please add the error message from the log file. Why do you use word to edit? There are better editors/ide for that ... – Mensch Aug 27 '16 at 12:35
  • 2
    'Better editors' is an interesting way to put it. Word is an editor not suited for writing plain text files, which LaTeX-files happen to be. – pschulz Aug 27 '16 at 12:36
  • 7
    Word adds gunk, it also might be converting your ' to a curly apostrophe . This might be causing your problems. Take a look at this question for advice on TeX editors/IDEs. Word is totally unsuitable, even if it isn't your problem in this case! – Au101 Aug 27 '16 at 13:04
  • 1
    As others have said, you shouldn't use Word. You need an editor that can write in plain text, formatted text is absolutely not the right choice to write not only Latex, but any programming/mark-up language. – Alenanno Aug 27 '16 at 13:08
  • 3
    This is how to write an MWE (Minimal Working Example). Just give us the preamble you have at the moment (the bit at the start with \documentclass and all the \usepackages. Ideally you would strip this down as far as possible, getting rid of any packages that aren't important). Then give us \begin{document} one of your sentences with an apostrophe in it and \end{document} That would probably do, but make sure you copy it from word, don't type it into the question box – Au101 Aug 27 '16 at 13:22
  • 8
    Please do yourself a big favour and don't use word to edit your tex file. Some people out there use word to produce documents, that's fine if they are happy with that (as long as I don't have to read the output :). But editing tex code is basically the same as source code. And This is something word was never designed for and is totally unsuitable. It will mess all kinds of things like autoreplacing apostrophes. Use either a normal text editor or a dedicated latex editor. This will give you all kinds of benefits like syntax highlighting, auto-completion of comments, ... – samcarter_is_at_topanswers.xyz Aug 27 '16 at 13:39
  • A minimal working example would be: \documentclass{article}\begin{document}a'\end{document}. Compile that and copy and paste the entire error code as an [edit] to your question. – Teepeemm Aug 27 '16 at 14:48
  • 1
    Regarding your answer that should be an edit: as other have said, Word cannot be used to edit TeX files (use Notepad if you refuse to install a LaTeX editor). Also, what keyboard layout are you using that has @ just to the left of return? – Teepeemm Aug 27 '16 at 14:53
  • I guess that adding \usepackage[utf8]{inputenc} can solve the issue. – egreg Aug 27 '16 at 20:23

1 Answers1

1

In case this helps someone else -

Microsoft Word gives you an apostrophe that looks like this: ’ (unicode symbol: PRIVATE USE ONE (U+0091)).

TeXStudio or a text editor like Notepad or browsers will give you this: ' (unicode symbol: APOSTROPHE (U+0027))

If you copy from a Word document, make sure to change all the curled quotation marks to straight apostrophes. If you are editing TeX in a Word document, you could type the apostrophe in your browser or a text-editor, and use find-and-replace-all. (Or as other people have said: don't use Word to edit TeX if you can avoid it.)

Ollyver
  • 223
  • 1
  • 7
  • I haven't had a problem using LibreOffice. When it inserts curly apostrophes and quotes, they really are the standard Unicode characters, not private use. Then, exporting text as UTF-8 without BOM, I can use the text directly in LuaLaTeX with fontspec. –  Dec 21 '17 at 15:46