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

2 Answers 2

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

with current TeXLive2011 I have no problem. My file list:

 *File List*
scrartcl.cls    2011/06/16 v3.09a KOMA-Script document class (article)
scrkbase.sty    2011/06/16 v3.09a KOMA-Script package (KOMA-Script-dependent ba
sics and keyval usage)
 scrbase.sty    2011/06/16 v3.09a KOMA-Script package (KOMA-Script-independent 
basics and keyval usage)
  keyval.sty    1999/03/16 v1.13 key=value parser (DPC)
scrlfile.sty    2011/03/09 v3.09 KOMA-Script package (loading files)
tocbasic.sty    2011/05/30 v3.09a KOMA-Script package (handling toc-files)
scrsize12pt.clo    2011/06/16 v3.09a KOMA-Script font size class option (12pt)
typearea.sty    2011/06/16 v3.09a KOMA-Script package (type area)
geometry.sty    2010/09/12 v5.6 Page Geometry
   ifpdf.sty    2011/01/30 v2.3 Provides the ifpdf switch (HO)
  ifvtex.sty    2010/03/01 v1.5 Switches for detecting VTeX and its modes (HO)
 ifxetex.sty    2010/09/12 v0.6 Provides ifxetex conditional
fontspec.sty    2011/09/18 v2.2a Advanced font selection for XeLaTeX/LuaLaTeX
   expl3.sty    2011/10/09 v2900 L3 Experimental code bundle wrapper
 l3names.sty    2011/10/09 v2896 L3 Experimental namespace for primitives
l3bootstrap.sty    2011/06/19 v2478 L3 Experimental bootstrap code
    etex.sty    1998/03/26 v2.0 eTeX basic definition package (PEB)
    calc.sty    2007/08/22 v4.3 Infix arithmetic (KKT,FJ)
   color.sty    2005/11/14 v1.0j Standard LaTeX Color (DPC)
   color.cfg    2007/01/18 v1.5 color configuration of teTeX/TeXLive
   xetex.def    2009/11/22 v0.94 LaTeX color/graphics driver for XeTeX (RRM/JK)

graphics.sty    2009/02/05 v1.0o Standard LaTeX Graphics (DPC,SPQR)
    trig.sty    1999/03/16 v1.09 sin cos tan (DPC)
graphics.cfg    2010/04/23 v1.9 graphics configuration of TeX Live
l3basics.sty    2011/10/09 v2896 L3 Experimental basic definitions
 l3expan.sty    2011/10/09 v2896 L3 Experimental argument expansion
    l3tl.sty    2011/09/16 v2831 L3 Experimental token lists
   l3seq.sty    2011/10/09 v2896 L3 Experimental sequences and stacks
   l3int.sty    2011/10/09 v2896 L3 Experimental integers
 l3quark.sty    2011/10/09 v2896 L3 Experimental quarks
   l3prg.sty    2011/10/09 v2896 L3 Experimental control structures
 l3clist.sty    2011/10/09 v2896 L3 Experimental comma separated lists
 l3token.sty    2011/10/09 v2896 L3 Experimental token manipulation
  l3prop.sty    2011/09/17 v2839 L3 Experimental property lists
   l3msg.sty    2011/10/09 v2896 L3 Experimental messages
    l3io.sty    2011/10/09 v2896 L3 Experimental input-output operations
  l3file.sty    2011/10/09 v2896 L3 Experimental file operations
  l3skip.sty    2011/10/09 v2896 L3 Experimental dimensions and skips
  l3keys.sty    2011/09/10 v2800 L3 Experimental key-value interfaces
    l3fp.sty    2011/09/26 v2857 L3 Experimental floating-point operations
   l3box.sty    2011/10/09 v2896 L3 Experimental boxes
l3coffins.sty    2011/09/12 v2814 L3 Experimental coffin code layer
 l3color.sty    2011/09/07 v2776 L3 Experimental colour support
l3luatex.sty    2011/09/10 v2798 L3 Experimental LuaTeX-specific functions
  xparse.sty    2011/10/09 v2900 L3 Experimental document command parser
fontspec-patches.sty    2011/09/18 v2.2a Advanced font selection for XeLaTeX/Lu
aLaTeX
fixltx2e.sty    2006/09/13 v1.1m fixes to LaTeX
fontspec-xetex.sty    2011/09/18 v2.2a Advanced font selection for XeLaTeX/LuaL
aTeX
 fontenc.sty
  eu1enc.def    2010/05/27 v0.1h Experimental Unicode font encodings
  eu1lmr.fd    2009/10/30 v1.6 Font defs for Latin Modern
xunicode.sty    2011/09/09 v0.981 provides access to latin accents and many oth
er characters in Unicode lower plane
 eu1lmss.fd    2009/10/30 v1.6 Font defs for Latin Modern
graphicx.sty    1999/02/16 v1.0f Enhanced LaTeX Graphics (DPC,SPQR)
fontspec.cfg
   t3cmr.fd    2001/12/31 TIPA font definitions
 ***********

my fonts:

voss@shania:~> pdffonts test3.pdf
name                                 type              emb sub uni object ID
------------------------------------ ----------------- --- --- --- ---------
BTKFJL+HoeflerText-Regular           CID TrueType      yes yes yes      5  0
ISXWHA+GeezaPro                      CID TrueType      yes yes yes      7  0
DPHHBH+LucidaGrande                  CID TrueType      yes yes yes      9  0
JMAUBN+Osaka                         CID TrueType      yes yes yes     11  0
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.