Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I have got a TeXLive 2011 on an Apple Time Machine and TeXShop on my local MacBook.
When I try to typeset the XeLaTeX template from TeXShop, I get “undefined control sequence” for some of the Unicode text.

The relevant section of the template goes as follows:

%!TEX TS-program = xelatex
%!TEX encoding = UTF-8 Unicode

\documentclass[12pt]{scrartcl}
\usepackage{geometry}
\geometry{a4paper}

\usepackage{fontspec,xltxtra,xunicode}
\defaultfontfeatures{Mapping=tex-text}
\setromanfont[Mapping=tex-text]{Hoefler Text}
\setsansfont[Scale=MatchLowercase,Mapping=tex-text]{Gill Sans}
\setmonofont[Scale=MatchLowercase]{Andale Mono}

\begin{document}

\newfontfamily{\A}{Geeza Pro}
\newfontfamily{\H}[Scale=0.9]{Lucida Grande}
\newfontfamily{\J}[Scale=0.85]{Osaka}

Here are some multilingual Unicode fonts: this is Arabic text: {\A السلام عليكم},
this is Hebrew: {\H שלום}, 
and here's some Japanese: {\J 今日は}.

\end{document}  

When I typeset this, I get:

./Untitled.tex:44: Undefined control sequence.
l.44 ...s: this is Arabic text: {\A \UTF
                                        {0627}\UTF{0644}\UTF{0633}\UTF{0644}...

Strangely, this occurs only for the Arabic and Hebrew texts, however, if I comment these out and leave only the Japanese section, the document is typeset without any errors and correct output.

At first, I thought that something was not passed correctly via the shell, but both bash and tcsh (used by TeXShop) return upon a locale:

LANG="de_DE.UTF-8"
LC_COLLATE="de_DE.UTF-8"
LC_CTYPE="de_DE.UTF-8"
LC_MESSAGES="de_DE.UTF-8"
LC_MONETARY="de_DE.UTF-8"
LC_NUMERIC="de_DE.UTF-8"
LC_TIME="de_DE.UTF-8"
LC_ALL=

I even tried adding setenv LC_CTYPE en_US.UTF-8 (cf. this) to the XeLaTeX engine for TeXShop but that did not help, either.

This is the Log I get with the posted example.

I hope that you have any ideas concerning this problem.
Thank you in advance.

share|improve this question
    
Can you show also the preceding part of the preamble? –  egreg Nov 22 '11 at 12:14
    
Added most of the remainder. Withheld part contained mostly comments, maketitle info and unused packages such as graphicx and amssymb. –  brian-ammon Nov 22 '11 at 12:25
    
Does your example really gives the error? If yes: show the log-file. –  Ulrike Fischer Nov 22 '11 at 12:42
    
Added the link to my log as requested by @UlrikeFischer. –  brian-ammon Nov 22 '11 at 13:36
2  
I would say your editor has exchanged the unicode chars by this \UTF-commands when saving the file. A search in the TeXshop forum came up with this advice: "Please UNCHECK TeXShop->Preferences->Misc->pTeX support-> utf export". –  Ulrike Fischer Nov 22 '11 at 14:31

1 Answer 1

up vote 7 down vote accepted

I would say your editor has exchanged the unicode chars by this \UTF-commands when saving the file. A search in the TeXshop forum came up with this advice: "Please UNCHECK TeXShop->Preferences->Misc->pTeX support-> utf export".

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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