Tufte-LaTeX typeset with XeTeX is broken

221 views
Skip to first unread message

星川冬夜

unread,
Feb 4, 2016, 3:27:57 AM2/4/16
to tufte-latex
Thanks for approving me.

Yesterday, after updating my MacTeX installation, I can no longer typeset my document with XeLaTeX. I have a launchd job that runs "tlmgr update --self --all" every day. I went back and checked the logs to see what was updated, and found the xetex and fontspec had updates.

Using the sample-book.tex file downloaded from the github website, I added the following code that allows it to be compiled with XeLaTeX:

\ifxetex
  \newcommand{\textls}[2][5]{%
    \begingroup\addfontfeatures{LetterSpace=#1}#2\endgroup
  }
  \renewcommand{\allcapsspacing}[1]{\textls[15]{#1}}
  \renewcommand{\smallcapsspacing}[1]{\textls[10]{#1}}
  \renewcommand{\allcaps}[1]{\textls[15]{\MakeTextUppercase{#1}}}
  \renewcommand{\smallcaps}[1]{\smallcapsspacing{\scshape\MakeTextLowercase{#1}}}
  \renewcommand{\textsc}[1]{\smallcapsspacing{\textsmallcaps{#1}}}
\fi


I add the package "xeCJK" and assign the font.

Until yesterday, this worked perfectly.

The problem is with the xeCJK package. If I comment out that line, then the document will typeset. However, I need Japanese language support, which is why I'm using xeCJK and XeLaTeX.

I have attached the tex file that has the code above. Simple comment or uncomment to reproduce the errors below.

The error messages I get are all of the same type. Examples below.

! Extra }, or forgotten \endgroup.
<argument> \xeCJK_class_group_end:
                                   \CJKecglue
l.530 ...idenote}[\docopt{number}][\docopt{offset}
                                                  ]\{\docarg{Sidenote text.}\}

! Extra }, or forgotten \endgroup.
<argument> \xeCJK_class_group_end:
                                   \CJKecglue
l.552   \doccmd{sidenote}[][\docopt{offset}
                                           ]\{\docarg{Sidenote text.}\}

! Extra }, or forgotten \endgroup.
<recently read> }

l.614 ...h{begin\{marginfigure\}[\docopt{offset}]}
                                                  \\

! Extra }, or forgotten \endgroup.
<recently read> }

l.618 ...sh{begin\{margintable\}[\docopt{offset}]}
                                                  \\

! Extra }, or forgotten \endgroup.
<argument> \xeCJK_class_group_end:
                                   \CJKecglue
l.649   \doccmd{caption}[][\docopt{offset}
                                          ]\{\docarg{long caption}\}\\

! Extra }, or forgotten \endgroup.
<argument> \xeCJK_class_group_end:
                                   \CJKecglue
l.650 ...}[\docarg{short caption}][\docopt{offset}
                                                  ]%

! Extra }, or forgotten \endgroup.
<XeTeXinterchartoks> \xeCJK_class_group_end:
                                             \CJKecglue
l.662   \doccmd{caption}[Hilbert curves...][6
                                             pt]\{Hilbert curves...\}

When I typeset my own document, the errors are all of the same type.

My experience with deeply investigating these problems is limited, and I haven't been very successful in the past. What I can tell you is this. I went and redownloaded the MacTeX package, reinstalled it, and it started working again. using tlmgr, I updated xetex only, and it broke. With a fully updated TeXLive installation, simply removing the xeCJK package allows the document to compile file with XeLaTeX (provided the above mentioned code is added to the preamble). Of course, removing that package means none of the Japanese in my document is typeset.

I really like the Tufte layout, and would like to keep using it if possible. If anyone has anything thoughts, I would be very thankful.

Thank you.

sample-book-xelatex.tex

Steve quinlan

unread,
Feb 4, 2016, 8:46:12 AM2/4/16
to tufte...@googlegroups.com
I use xeCJK in one of my documents. Here are the lines I had to insert into my preamble to ensure it works. Perhaps this will help you.

%%% document preamble

%% XeLaTeXs required packages.
\usepackage{fontspec}
\usepackage{xunicode,xltxtra}

%xeCJK options.

\usepackage[CJKchecksingle=true]{xeCJK}

%Set the font that you want to use
\setCJKmainfont{WenQuanYi Micro Hei Light}

%tufte xelatex spacing workaround
\renewcommand{\allcapsspacing}[1]{{\addfontfeature{LetterSpace=20.0}#1}}
\renewcommand{\smallcapsspacing}[1]{{\addfontfeature{LetterSpace=5.0}#1}}

\renewcommand{\textsc}[1]{\smallcapsspacing{\textsmallcaps{#1}}}
\renewcommand{\smallcaps}[1]{\smallcapsspacing{\scshape\MakeTextLowercase{#1}}}


-Steve

--
You received this message because you are subscribed to the Google Groups "tufte-latex" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tufte-latex...@googlegroups.com.
To post to this group, send email to tufte...@googlegroups.com.
Visit this group at https://groups.google.com/group/tufte-latex.
For more options, visit https://groups.google.com/d/optout.

星川冬夜

unread,
Feb 4, 2016, 8:49:43 AM2/4/16
to tufte-latex
Steve:

Thanks for the reply.

xeCJK by default already calls flntspec, so I would think that line could be removed. I'll try adding the other options you mentioned. However, xeCJK and XeLaTeX were working fine as is before the update came out.

Thanks again.

2016年2月4日木曜日 22時46分12秒 UTC+9 Steve quinlan:

星川冬夜

unread,
Feb 4, 2016, 8:54:11 AM2/4/16
to tufte-latex
Okay, just checked, and still have the same problems. This is definitely a problem with one of the updates that came out.

Kevin Godby

unread,
Feb 4, 2016, 1:54:51 PM2/4/16
to tufte-latex
On Thu, Feb 4, 2016 at 7:54 AM, 星川冬夜 <tetraki...@gmail.com> wrote:
> Okay, just checked, and still have the same problems. This is definitely a
> problem with one of the updates that came out.

Can you create a minimal document (smallest preamble and document
text) that demonstrates the errors?

—Kevin

星川冬夜

unread,
Feb 4, 2016, 6:22:35 PM2/4/16
to tufte-latex
I wanted to report that the problem did turn out to be caused by xeCJK. An update has been released, and all is working fine again.

Thank you

Kevin Godby

unread,
Feb 4, 2016, 7:08:55 PM2/4/16
to tufte-latex
On Thu, Feb 4, 2016 at 5:22 PM, 星川冬夜 <tetraki...@gmail.com> wrote:
> I wanted to report that the problem did turn out to be caused by xeCJK. An
> update has been released, and all is working fine again.

Ah, good to hear! Thanks for letting us know.

—Kevin
Reply all
Reply to author
Forward
0 new messages