3

I’ve recently moved from TexShop to Sublime Text 3/LaTeXTools/Skim for my Latex work. Occasionally I typeset texts in Swedish including “å”, “ä”, “ö” etc characters. However, when I open such a previously created .tex file in Sublime Text, these characters appear as “Œ”, “Š” and “š" in the .tex file. They typset correctly though in Skim, whereas entered å/ä/ö in Sublime Text typset incorrect. Is this a viewer setting in Sublime text that I’ve merely missed?

Below are the packages I use to make this work in TexShop:

\usepackage[swedish]{babel}
\usepackage[applemac]{inputenc}
\usepackage[T1]{fontenc}  
  • 2
    \usepackage[utf8]{inputenc} is the recommended one. It's probable that Sublime Text uses utf8 encoding itself so it would be a good choice. – Manuel Jan 18 '15 at 15:49
  • Welcome to TeX.SX! Usually, we don't put a greeting or a “thank you” in our posts. While this might seem strange at first, it is not a sign of lack of politeness, but rather part of our trying to keep everything very concise. Accepting and upvoting answers is the preferred way here to say “thank you” to users who helped you. – Reinstate Monica - M. Schröder Jan 18 '15 at 15:50
  • @Manuel That gives the following error in every position I have Swedish characters: Package inputenc Error: Keyboard character used is undefined. – Karl Jan 18 '15 at 16:04
  • You need to save the file with utf8 encoding, apart from using that line of code. I don't know how TeXShop can do that… but may be in Options you find it. – Manuel Jan 18 '15 at 16:12
  • 1
    @Karl A plausible option is: open the file in TeXShop, copy it, then open a new one in Sublime Text, paste it, and then save the file from Sublime. Then I guess it will be saved as utf8 and will compile fine. – Manuel Jan 18 '15 at 16:16
1

(Really non-expert answer.)

That's because Sublime Text expects utf8 encoded files, and in TeXShop you have it configured to save them with “applemac”. So, apart from \usepackage[utf8]{inputenc} you need to save the file with utf8 encoding.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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