[XeTeX] RTL paragraphs with XeTeX?
Petr Tomasek
tomasek at etf.cuni.cz
Fri Jul 1 18:20:46 CEST 2011
> > -----------------------------------------
> > \parfillskip=0pt\parindent=0pt
> > \leavevmode\beginR \hskip 8em Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris luctus accumsan vulputate. Vivamus vel lacus nunc, a dictum lacus. Duis rutrum, odio blandit dapibus facilisis, ipsum neque vestibulum ligula, ut vulputate leo nisl eget dolor. Donec luctus consequat porta. Duis tristique elit in sapien vulputate non pulvinar felis interdum. Praesent auctor eleifend sollicitudin. In hac habitasse platea dictumst. Donec congue congue interdum. Suspendisse vel dictum nulla. Nullam sit amet mi ut libero blandit scelerisque.\hskip 3em plus 1fil\nobreak\hbox{}\break\endR
> > \par
>
> Don't put all that stuff at the end of the paragraph! For a standard RTL paragraph, you want to still be in RTL mode when the \par is encountered.
>
> So, try:
>
> \noindent \beginR \indent Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris luctus accumsan vulputate. Vivamus vel lacus nunc, a dictum lacus. Duis rutrum, odio blandit dapibus facilisis, ipsum neque vestibulum ligula, ut vulputate leo nisl eget dolor. Donec luctus consequat porta. Duis tristique elit in sapien vulputate non pulvinar felis interdum. Praesent auctor eleifend sollicitudin. In hac habitasse platea dictumst. Donec congue congue interdum. Suspendisse vel dictum nulla. Nullam sit amet mi ut libero blandit scelerisque.\par
>
> Or just precede a series of paragraphs with:
>
> \everypar={\setbox0=\lastbox \beginR \box0 }
Ok, thank a lot!
Don't I need to put \endR somewhere so that it's balanced?
Perhaps that's what puzzled me...
> for automatic RTL-ness. (Explanation: \lastbox is used to retrieve the box that was inserted for the original automatic (LTR) paragraph indent; then after switching directionality, we put it back again so as to get the indent at the right end.)
Ok, that's clear. Will \leftskipt and \rightskipt then be quasi switched too?
Thank You!
Petr Tomasek
--
Petr Tomasek <http://www.etf.cuni.cz/~tomasek>
Jabber: butrus at jabbim.cz
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
EA 355:001 DU DU DU DU
EA 355:002 TU TU TU TU
EA 355:003 NU NU NU NU NU NU NU
EA 355:004 NA NA NA NA NA
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
More information about the XeTeX
mailing list