[XeTeX] Runaway argument in babel and longtable?

Jonathan Kew jonathan at jfkew.plus.com
Mon Oct 27 12:31:28 CET 2008


On 27 Oct 2008, at 11:07 AM, Ján Zahornadský wrote:

> Hi!
>
> I have this script creating a long table which have been working until
> some of the recent changes. Now it's producing the following output:
>
> Runaway argument?
> ! Forbidden control sequence found while scanning use of
> \language at active@arg".
> <inserted text>
>                \par
> l.17 餐 &
>           jídlo \tabularnewline
>
> I have been trying to google the issue up a little, but with no  
> success.
> Does anyone around here have an idea where it might come from?

Apparently the [czech] option for babel is trying to do clever things  
with ", making it an active character; this causes the breakage when  
xetex wants to scan the argument for \XeTeXlinebreaklocale.

To avoid the issue, you could use 'single quotes' instead of "double",  
or even leave the locale name unquoted (it is treated in the same way  
as filenames by TeX; quotes are not actually required). I would  
recommend including a space or \relax after the locale name, to ensure  
scanning is terminated at the right moment. So:

\begin{longtable}[c]{@{\zhong\XeTeXlinebreaklocale  
'zh'\relax}p{0.46\textwidth}@{\hskip0.02\textwidth\rm 
\XeTeXlinebreaklocale 'cz'\relax}p{0.5\textwidth}}

Actually, in practice I think you could simply set  
\XeTeXlinebreaklocale 'zh' at the beginning of your document, and  
leave it that way throughout; this shouldn't have any bad effects on  
the non-Chinese text. So there's no need to constantly switch back and  
forth.

JK

> Attached
> is the (reduced) input to still produce this error.
>
> Thanks everyone in advance!
> Jan
> \documentclass[10pt]{article}
> \usepackage[czech]{babel}
> \usepackage{longtable}
> \usepackage{fontspec}
> \usepackage{xunicode}
>
> %\defaultfontfeatures{Mapping=tex-text}
> \setmainfont[Mapping=tex-text]{Constantia}
>
>
> \begin{document}
>
> \newfontfamily\fzhong{HanWangMingMediumChuIn}
> \def\zhong{\fzhong\fontsize{12pt}{12pt}\selectfont}
>
> \begin{longtable}[c]{@{\zhong\XeTeXlinebreaklocale  
> "zh"}p{0.46\textwidth}@{\hskip0.02\textwidth\rm\XeTeXlinebreaklocale  
> "cz"}p{0.5\textwidth}}
> 餐 & jídlo \tabularnewline
> 布拉格 & Praha \tabularnewline[2.5mm]
> 無數 & nespočet \tabularnewline
> \end{longtable}
>
> \end{document}



More information about the XeTeX mailing list