2

I'm preparing a text on how bidirectional formatting works and using xelatex for that. For this I need to put RTL characters exactly as they are placed in the text, with disabled bidi processing, and my results are so far frustrating. Here's an example with hebrew (which by the way is also shown incorrectly here as code, but if you copy-paste it to a non-bidi editor the characters should follow the order as intended to, as 123אפס):

\documentclass{report}
\usepackage{fontspec}
\setmonofont{Courier New}
\setmainfont{Times New Roman}

\begin{document}
'123ספא'
\begin{verbatim}
'123ספא'
\end{verbatim}
\end{document}

Results so far are frustrating:

hebrew

Is it possible either to disable bidi processing completely, at least or do something so that verbatim and non-verbatim results are the same?

Thank you

3

You can get the output you want like this (^^^^202d is the left-to-right-override U+202D):

\documentclass{report}
\usepackage{fontspec}

\setmonofont{Courier New}
\setmainfont{Times New Roman}

\begin{document}
'123ספא'

\ttfamily
^^^^202d'123^^^^202dספא'

\end{document}

enter image description here

But I have no idea why the apostroph needs the override too, and if there is a simpler method.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.