# [OS X TeX] latex+unicode

Herbert Schulz herbs at wideopenwest.com
Sun Aug 8 08:01:00 EDT 2010

On Aug 8, 2010, at 5:10 AM, Alain Matthes wrote:

>
> Le 8 août 2010 à 09:38, Serdar Akin a écrit :
>
>> I',m trying to write a document in TexShop 2.36 in Swedish language and cannot convert words to a pdf-file containing the characters "åäö".
>>
>> Have tried the codes \usepackage[utf8]{inputence}
>>                                  \usepackage|T1]{fontenc}
>>                                 \usepackage[swedish]{babel}
>> This in combination to saving the files in utf-8 as standard in preference. Further I tried % !TEX encoding = UTF-8 Unicode in the preamble but nothing works.
>
> Hi
> This code works fine (utf8 in the prefs (document) of texshop)
>
> \documentclass[a4paper]{article}
> \usepackage[utf8]{inputenc} % and not inputence
> \usepackage[T1]{fontenc} % [T1]
> \usepackage{lmodern}
> \usepackage[swedish]{babel}
>
> \begin{document}
>   I'm trying to write a document in TexShop 2.36 in Swedish language and cannot convert words to a pdf-file containing the characters "åäö".
>
> \end{document}
>
> Best Regards
>
> Alain Matthes

Howdy,

If you save and then open the file are the å, ä and ö still correct? If not you've got an encoding mismatch between the way the file is being saved and then opened.

Alain's version works fine for me. Only changes are the two lines at the top of the file. (The first line just guarantees that TeXShop will use the correct engine for this file. Even though I've got UTF-8 as my default encoding I never know when I might want to change it and then the file will be read in with the wrong encoding without that second line.) The only other change I made is to use real open/close double quotes (Opt-[ and shift-Opt-[ on US Keyboard).

% !TEX TS-program = pdflatex
% !TEX encoding = UTF-8 Unicode
\documentclass[a4paper]{article}
\usepackage[utf8]{inputenc} % and not inputence
\usepackage[T1]{fontenc} % [T1]
\usepackage{lmodern}
\usepackage[swedish]{babel}

\begin{document}
I'm trying to write a document in TexShop 2.36 in Swedish language and cannot convert words to a pdf-file containing the characters “åäö”.
\end{document}

If you are using a recent MacTeX(TeX Live) Distribution you really don't even need to use the latin modern fonts since using the T1 font encoding will automatically use the CMSuper fonts.

Good Luck,

Herb Schulz
(herbs at wideopenwest dot com)