2

Whenever I type something such as The energy's source, TexShop changes the apostrophe into a curly one which does not print in the PDF.

How can I stop future apostrophes from being changed without much of a hassle ?

Using TexShop :

\documentclass[12pt,a4paper]{report}
\usepackage[lmargin=3.81cm,tmargin=2.54cm,rmargin=2.54cm,bmargin=2.52cm]{geometry}
\linespread{1.5}
\usepackage{mathptmx} 

\begin{document}

it's

\end{document}

This is what happens :

I type an apostrophe, the TexShop changes it to a curly apostrophe in the editor :

enter image description here

However this does not print in the PDF file as TexShop doesn't recognise it when it TypeSets.

If I manually change it to

enter image description here

Then it prints normally, but I can't keep changing it manually every time I type apostrophes because (1) I forget (2) it's not convenient.

Razor
  • 2,691
  • Please add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}. –  Apr 25 '13 at 22:09
  • What editor do you use? I don't have that problem in TeXmaker on Mac OS... – jub0bs Apr 25 '13 at 22:09
  • A workaround is to use \usepackage[utf8]{inputenc} to handle "smart quotes" in LaTeX. – Guido Apr 25 '13 at 22:12
  • @Jubobs I tagged TexShop – Razor Apr 25 '13 at 22:12
  • @Papiro question updated – Razor Apr 25 '13 at 22:13
  • @Guido But I don't want to change the text style. – Razor Apr 25 '13 at 22:14
  • @Razor Please, see http://tex.stackexchange.com/questions/63345/how-to-make-a-real-apostrophe-or-single-quote-in-latex –  Apr 25 '13 at 22:17
  • @Papiro Thanks, but using the \usepackage{upquote} package did not fix the problem. – Razor Apr 25 '13 at 22:20
  • I find your question unclear. Do you mean that, when you type a straight single quote in TeXshop ('), 1) it gets replaced by something else in the editor itself? Or that 2) it gets replaced by something else (a curly single quote, perhaps) in the output document? – jub0bs Apr 25 '13 at 22:22
  • @Jubobs Its (1) , I updated question – Razor Apr 25 '13 at 22:23
  • You should expect to get curly quotes in your input file if you copy some text that contains curly quotes and paste it into TeXshop. However, I cannot reproduce the behaviour you describe (in TeXshop 2.47 on Mac OS 10.8.3); when I type a straight quote in TeXshop, I get nothing but a straight quote. Does the same thing happen in, say, TextEdit? – jub0bs Apr 25 '13 at 22:30
  • @Razor using inputenc as suggested by Guido is the correct solution (assuming you want to leave your tex file as it is) Your reply that you didn't want to change the text style was a bit odd as inputenc doesn't change the document style it just tells latex the file encoding of the source. – David Carlisle Apr 25 '13 at 22:31
  • @DavidCarlisle I get an error when I use that : Keyboard character used is undefined in inputcoding 'utf8' \end{itemize}• – Razor Apr 25 '13 at 22:33
  • @Razor well perhaps your editor (and it is the editor not OSX) isn't using utf8 Impossible to tell from the information given, perhaps it is [latin1] or [applemac] encoding. – David Carlisle Apr 25 '13 at 22:35
  • Go to the "Source" menu and turn "Key Bindings" off. However the printed apostrophe is curled in most fonts. – egreg Apr 25 '13 at 22:40
  • @egreg thanks for replying, but the editor still changes ' into a curly ' as soon as I press enter .. – Razor Apr 25 '13 at 22:42
  • 1
    Take a look in your system prefs under Language & Text. There you can change the automatic conversion of quotes. – Saaru Lindestøkke Apr 25 '13 at 22:47
  • @BartArondson Thank you, but I figured out the problem. My TexShop was doing this while I thought it was macosx .. I will update question and answer it. – Razor Apr 25 '13 at 22:51

1 Answers1

3

Apparently using TexShop I should disable this :

Edit > Substitutions > Smart Quotes

The editor doesn't change apostrophes to curly ones anymore.

Razor
  • 2,691
  • @Papiro Thank you for answering though. I was planning to add it is a macro and insert it as a shortcut whenever I type ' if I couldn't figure it out. – Razor Apr 25 '13 at 22:59