0

When I compile my Hebrew document with XeTeX, the resulting PDF displays correctly with the right directionality. However, when I try to search, I have to search the term backwards in order for it to find. For example, if I have אבגד (abcd) I won't find it as is, but I will find it if I search for דגבא (dcba).

Is there any way to make the direction of the PDF search correspond to the text direction?

  • 2
    With the software you're using to view the PDF, are you able to search other Hebrew PDFs successfully? Or, is this the only document which causes you problems? – J.D. Oct 2 '16 at 12:56
1

I hesitate to post an "It's-working-for-me" reply as an "answer", but it might provoke a refinement of OP's issue, if nothing else.

Here is something like a "MWE", using TeXstudio 2.10.8 on a Mac (early 2015) with TL 2015 installed:

%!TEX TS-program = xelatex
%!TEX encoding = UTF-8 Unicode

\documentclass[12pt]{article}

\usepackage{fontspec,xltxtra,xunicode}
\defaultfontfeatures{Mapping=tex-text}
\setmainfont{TeX Gyre Pagella}

\newfontfamily{\Hb}{SBL Hebrew}

\usepackage{bidi}

\title{Very Trying}
\author{David}
%\date{}

\begin{document}
\maketitle

For some time now I have thought about trying to get, {\RL{\Hb מי יודע}}, RTL mixed in, for example, and distinct RTL in my LTR text:\\

\begin{RTL}
{\Hb מי כהחכם ומי יודע פשׁר דבר}\\
\end{RTL}

This is  typeset by \textsf{bidi} package, version \bidiversion, \bididate.

\end{document}

A search of the PDF (using Preview) works exactly as expected:

search

FWIW. (The Hebrew font referenced is SBL Hebrew.)

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.