# [OS X TeX] Re: TeXShop and latin1

Herbert Schulz herbs at wideopenwest.com
Sun Sep 28 15:05:19 CEST 2008

On Sep 28, 2008, at 6:35 AM, Victor Ivrii wrote:

> On Sun, Sep 28, 2008 at 7:23 AM, Victor Ivrii <vivrii at gmail.com>
> wrote:
>> On Sun, Sep 28, 2008 at 7:21 AM, Victor Ivrii <vivrii at gmail.com>
>> wrote:
>>> Attached file is a nice tex input and if I open it with TS (Latin1
>>> encoding in preferences)  o-umlaut is displayed properly. pdflatex
>>> (or
>>> TS) processes it well.
>>>
>>> However if I save it in TS  o-umlaut becomes \UTF{00F6} and pdflatex
>>> cannot process it.
>>>
>>> ===
>>>
>>> It is rather strange because with Russian one can use
>>>
>>> \usepackage[T2A]{fontenc}
>>> \usepackage[utf8]{inputenc}
>>>
>>> and it works with TS with Unicode-8 in prefs (and actually there
>>> is a
>>> list of different encodings and matching {inputenc} options.
>>>
>>> ===
>>>
>>> Most likely I am doing something wrong will be grateful for
>>> pointing it out
>>>
>>> Victor
>>>
>>
>
> Sorry for little spamming. Actually one needs to uncheck in
>
> TS preferences > Misc >pTeX support
>
> utf export
>
>
> and then everything works fine. Should not be document editing/
> saving option in
>
> TS preferences > Document
>
> rather than Misc?
>
> Victor

Howdy,

There is the Encoding section of TeXShop->Preferences->Document.

Remember that the the commands you give to tell TeX what the file
encoding is and the actual file encoding may not agree. Also, When
TeXShop opens a file that doesn't explicitly tell TeXShop what it's
encoding is (everything gets translated to UTF-8 internally in the
editor by the OS) it will be opened assuming its default encoding.

Here's what I do to change the encoding. Note: not very pretty.
Suppose I have an unmarked (i.e., it doesn't have the %!TEX encoding
= ... line in it) file in an encoding that isn't my default, e.g.,
Latin 1 and my default is Mac OS Roman) file,
First I open TeXShop, open a new document and place the line

%%!TEX encoding = IsoLatin

(if I want to save this new file in Latin 1 encoding) at the top. I
then use the Open dialog, choose the file I want to open (single
click) and set the format to Latin 1 in the drop down menu; that
should open the file in the correct format (saving now will mess the
file up so don't save the original document). I the select and copy
all of the text in this document into the new document and save the
new document. From then on TeXShop will open the document with the
correct encoding.

I wish I could simply open the document with the Open dialog and the
correct encoding chosen, add the %!TEX encoding = ... line, and the
Save (or even Save As...) and overwrite the old version with the new
version but the encoding seems to get messed up.

Sigh... I said it was ugly.

Good Luck,

Herb Schulz
(herbs at wideopenwest dot com)

-------------- next part --------------
----------- Please Consult the Following Before Posting -----------
TeX FAQ: http://www.tex.ac.uk/faq
List Reminders and Etiquette: http://www.esm.psu.edu/mac-tex/list/
List Archive: http://tug.org/pipermail/macostex-archives/
TeX on Mac OS X Website: http://mactex-wiki.tug.org/
List Info: http://email.esm.psu.edu/mailman/listinfo/macosx-tex