# [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}
at 12pt
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}