[XeTeX] fontspec and tabularx (was: Colored Arabic in Tables)
François Charette
firmicus at ankabut.net
Wed Mar 11 21:41:00 CET 2009
> arabxetex use \addfontfeature to switch between novoc/fullvoc, and
> your color command uses this too.
>
> tabularx does some quite complicated processing of the tabular body
> and my guess is that this confuse the font declarations.
>
>
Indeed, it really appears to confuse fontspec.
For the same minimal example as in my previous post, but without
fontspec, works just fine, so the problem is with fontspec's
\addfontfeature, or rather with its interaction with tabularx.
\documentclass{minimal}
\usepackage{tabularx}
\font\arabicnovoc="Scheherazade:script=arab,mapping=arabtex-fdf2alif-novoc"
at 12pt
\font\arabicfullvoc="Scheherazade:script=arab,mapping=arabtex-fdf2alif-fullvoc"
at 12pt
\begin{document}
\begin{tabularx}{\linewidth}{X}
{\arabicfullvoc ha}\\
\end{tabularx}
{\arabicnovoc h}
\end{document}
Note that the problem also occurs more generally with any font mapping.
Any change in a given font mapping outside tabularx is simply ignored by
fontspec:
\documentclass{minimal}
\usepackage{fontspec}
\newfontfamily\testfont{Linux Libertine}
\usepackage{tabularx}
\begin{document}
\begin{tabularx}{\linewidth}{X}
{\testfont\addfontfeature{Mapping=tex-text} 1--2}\\
\end{tabularx}
{\testfont\addfontfeature{Mapping=this_is_simply_ignored} 1--2}
\end{document}
More information about the XeTeX
mailing list