[XeTeX] subfig, TikZ, XeLatex and Left-To-Right

Hadi SAOUD hadidev at gmail.com
Wed May 5 15:52:31 CEST 2010


hello,
I've prbolems in using subfig and TikZ packages with XeLaTeX, they're 
not fully compatible with it;
when I use them in a Right-To-Left environment (such as arabic or hebrew 
docs), TikZ images are not rendered.

I give an example in the following code:

%%%%%%%%%%%%%%%%%%%%%%%%
\documentclass[12pt, a4paper]{article}

\usepackage{graphicx}

\usepackage{tikz}

\usepackage[no-math]{fontspec}

\usepackage{subfig}

\usepackage{xunicode}

\usepackage[quiet]{polyglossia}

\usepackage{bidi}

\setdefaultlanguage[variant=british]{english}

\setromanfont{Times New Roman}

\defaultfontfeatures{Scale=MatchLowercase}

\setmonofont{Arial}

\setsansfont{Courier New}


\begin{document}

\setLR

a figure in an Left-To-Right environment

\begin{figure}[htbp]

     \centering

     \subfloat[first]{%

         \begin{tikzpicture}[scale=1]

             \draw [line width=1.25pt] (0,0) +(0,1.2) -- +(1.9,1.2) --

                 +(2.1, 0.7) -- +(3.9,0.7) -- +(4.1,0.2) -- +(5,0.2);

         \end{tikzpicture}

     } \qquad

     \subfloat[second]{boston}

\end{figure}


\newpage

and a figure in an Right-to-Left environment

\setRL

\begin{figure}[htbp]

     \centering

     \subfloat[first]{%

         \begin{tikzpicture}[scale=1]

             \draw [line width=1.25pt] (0,0) +(0,1.2) -- +(1.9,1.2) --

                 +(2.1, 0.7) -- +(3.9,0.7) -- +(4.1,0.2) -- +(5,0.2);

             \end{tikzpicture}

         } \qquad
         \subfloat[second]{boston}

     \end{figure}

\end{document}
%%%%%%%%%%%%%%%%%%%%%%%%


Do you have a method to correct this problem? or do you know a package 
that can be used instead of subfig? I tried subfigure but it has the 
same problem.


Thanks


Hadi




More information about the XeTeX mailing list