2

this is my code, compiled by xelatex:

\documentclass{book}
\usepackage{lipsum}
\usepackage{trimclip}
\usepackage{polyglossia}
\setdefaultlanguage{hebrew}
\setotherlanguage{english}
\newfontfamily\hebrewfont[Script=Hebrew]{Bitstream Vera Sans}

\begin{document}
hi
%\clipbox{0pt 0pt {0.6\width} 0pt}{hi}
hi

\begin{english}
\lipsum[1]
\end{english}
\end{document}

if the clipbox line stays commented-out, you get the expected results (hi hi and lipsum afterwards). but if you uncomment it, using clipbox in RTL context, the page gets mostly blank, and if the document is longer it gets crazy in other interesting ways.

if I use it in LTR it's ok. I know. but my real work is in Hebrew, and I need this clipping for some nice feature I want to add there.

i guess the trimclip package is not aware of bidi but it's deeply involved in text direction. so the weird RTL box confuses it. how can I solve this? or maybe use some other means for clipping a letter (means that work RTL too)?

EDIT: OK. I've investigated it a little bit more. trimbox works just fine, so the problem is only with the clipping, which is carried out by a driver-specific command in the package files. the default uses xetex driver, which seems to have this bug. when loaded the package with [pgf] option, it gave the correct results. yet it requires me to load the graphicx package explicitly beforehand.

yet, if anybody still wishes to correct the xetex driver, or at least point out the problem in it, be he blessed.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.