<div dir="ltr">Put it before \begin{document}, in addition you need to put \rightlinenumbers after \resetlinenumber\pagewiselinenumbers<br><br><div class="gmail_quote">On Thu, Sep 22, 2011 at 3:17 PM, Nathan Sidoli <span dir="ltr"><<a href="mailto:nathan.sidoli@utoronto.ca">nathan.sidoli@utoronto.ca</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
  
    
  
  <div bgcolor="#FFFFFF" text="#000000">
    Thanks for this. <br>
    <br>
    Where are you putting this code? <br>
    <br>
    I tried in various places in the preamble. Does it need to be put in
    one of the packages?<div><div></div><div class="h5"><br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    On 11/09/22 2:35, VAFA KHALIGHI wrote:
    <blockquote type="cite">
      
      <div>bidi does not support lineno.sty and you are on your own if
        you decide to use it but here is the fix:<br>
        <br>
        \makeatletter<br>
        \@ifpackageloaded{color}{%<br>
        <p>\def\makeLineNumberRight{% </p>
        <p> \linenumberfont\hskip-\linenumbersep\hskip-\columnwidth</p>
        <p> \hb@xt@\linenumberwidth{\hss\LineNumber}\hss}}{}</p>
        <p>\makeatother<br>
        </p>
        <br>
        If you are curious, why this happens, then I can explain.<br>
        <br>
        <div>On Thu, Sep 22, 2011 at 1:24 AM, Nathan Sidoli <span><<a href="mailto:nathan.sidoli@utoronto.ca" target="_blank">nathan.sidoli@utoronto.ca</a>></span>
          wrote:<br>
          <blockquote>
            <div> Well, as you guessed, it does seem to be something to
              do with the interaction between bidi and pstricks.<br>
              <br>
              Here is a minimal example with no bidi, which shows the
              line numbers along with a figure, etc.<br>
              <br>
              -----------------------<br>
              <br>
              \documentclass{article} <br>
              <br>
              \usepackage{pstricks}<br>
              \usepackage{pst-eps}<br>
              <br>
              <br>
\usepackage[Bpara,modulo,right,addpageno,perpage,para*]{ednotes}<br>
              \modulolinenumbers[5]<br>
              <br>
              \begin{document}<br>
              <br>
              %\begin{arab}<br>
              \resetlinenumber\pagewiselinenumbers<br>
              <br>
              \Anote{a lemma}{with a note.}<br>
              <br>
              \Anote{another line with another lemma}{and the note.}<br>
              <br>
              \Anote{we have the same thing again}{and there's a note.}<br>
              <br>
              \Anote{a fourth lemma}{a fourth note.}<br>
              <br>
              we should now have a line number<br>
              <br>
              \vspace{2em}<br>
              <br>
              \begin{center}<br>
              \begin{pspicture}(0,0)(3,3)<br>
              \psline[linewidth=1pt](0,0)(0,3)  %base<br>
               \psline[linewidth=1pt](0,0)(3,0) %2e base <br>
              \psline[linewidth=1pt](0,3)(3,3)  %3e base<br>
              \psline[linewidth=1pt](3,0)(3,3)  %oblique 1<br>
              \psline[linewidth=1pt](0,3)(3,0)  %oblique 1<br>
              \rput(1.5,2.4){{lalala}}<br>
              \rput(1.5,3.278){{lalala}}<br>
              \rput*[0,0]{-45}(0.23,1.74){{dedum}}<br>
              \rput*[0,0]{-90}(3.125,2.1){{dedum}}<br>
              \rput*[0,0]{-90}(-0.7,2.1){{ladida}}<br>
              \rput(1.5,-0.275){{ladidum}}<br>
              \end{pspicture}<br>
              \end{center}<br>
              <br>
              \end{document}<br>
              <br>
              ----------------<br>
              <br>
              In the next example, we have six lines of Arabic text and
              we can toggle the marginal line numbers on and off by
              commenting and uncommenting pstricks.<br>
              <br>
              \documentclass{article} <br>
              <br>
              %\usepackage{pstricks}<br>
              <br>
\usepackage[Bpara,modulo,right,addpageno,perpage,para*]{ednotes}<br>
              \modulolinenumbers[5]<br>
              <br>
              <br>
              \usepackage{fontspec}<br>
              \usepackage[novoc,fdf2noalif]{arabxetex}<br>
\newfontfamily\arabicfont[Script=Arabic,Scale=1.4,WordSpace=2]{Scheherazade}<br>
              <br>
              % To make language switching faster:<br>
              % For some reason, \textroman was not working
              out-of-the-box...<br>
              \newcommand{\textroman}[1]{\LR{\rmfamily #1}}<br>
              % And we make some short-hands<br>
              \newcommand{\R}{\textroman}<br>
              \newcommand{\A}{\textarabic}% Lateef, Scheherazade<br>
              <br>
              \begin{document}<br>
              <br>
              %\begin{arab}<br>
              \resetlinenumber\pagewiselinenumbers<br>
              <br>
              \begin{arab}<br>
              \resetlinenumber\pagewiselinenumbers<br>
              <br>
              \begin{center}<br>
              %<br>
              \Anote{\A{\notinnote\Huge ktAb fY AlmsA.hT}}{\A{^gzu' fY
              msA.hT AlAr.dyn \R{(\textit{rubro col.})}.}}<br>
              <br>
              \medskip<br>
              {\Large l|l^sy_h Al`Alm ^s^gA` bn Aslm Alm`rwf b'ab--Y
              kAml} <br>
              <br>
              \medskip<br>
              {\Large r.hmh Al|llh bkrmh} <br>
              <br>
              \medskip<br>
              {\Large ^Amyn} <br>
              <br>
              \bigskip<br>
              \R{\marginpar{$(93\textsuperscript{\bf v})$}}<br>
              bsm Al|llh Alr.hmn Alr.hym \LR{\quad} w.sllY Al|llh `lY
              syydnA m.hmmd w^Alh<br>
              <br>
              \smallskip<br>
              \noindent <br>
              qAl ^s^gA` Abn Aslm Alm`rwf b'ab--Y kAml<br>
              <br>
              \bigskip<br>
              \centerline{\Large bAb msA.hT Al'ar.dyn}<br>
              \end{center}<br>
              <br>
              \end{arab}<br>
              <br>
              \end{document}
              <div>
                <div><br>
                  <br>
                  <br>
                  <br>
                  <br>
                  On 11/09/21 23:52, VAFA KHALIGHI wrote:
                  <blockquote type="cite">
                    <div>do you have a minimal example? Can you create
                      one where bidi is not loaded at all? maybe
                      endnotes does not behave well with pstricks.<br>
                      <br>
                      <div>On Thu, Sep 22, 2011 at 12:48 AM, Nathan
                        Sidoli <span><<a href="mailto:nathan.sidoli@utoronto.ca" target="_blank">nathan.sidoli@utoronto.ca</a>></span>
                        wrote:<br>
                        <blockquote>
                          <div> I have tried loading them in every
                            possible order, but as soon as I load
                            pstricks the marginal numbers disappear. <br>
                            <div>
                              <div> <br>
                                <br>
                                On 11/09/21 23:43, VAFA KHALIGHI wrote:
                                <blockquote type="cite">
                                  <div>No, I think it has to do with
                                    something that tikzpicture or
                                    pspicture environment are in LTR
                                    mode by bidi. you can load endnotes
                                    anywhere you want but certainly bidi
                                    gives you error if you load tikz or
                                    pstricks after bidi, thus you only
                                    will have to load tikz or pstricks
                                    before bidi.<br>
                                    <br>
                                    <div>2011/9/22 Zdenek Wagner <span><<a href="mailto:zdenek.wagner@gmail.com" target="_blank">zdenek.wagner@gmail.com</a>></span><br>
                                      <blockquote> 2011/9/21 VAFA
                                        KHALIGHI <<a href="mailto:vafaklg@gmail.com" target="_blank">vafaklg@gmail.com</a>>:<br>
                                        <div>> I am not sure what is
                                          the actual problem but I can
                                          tell you what bidi does.<br>
                                          > bidi does the following:<br>
                                          ><br>
                                        </div>
                                        Can it depend on the order in
                                        which the packages are loaded?
                                        This is<br>
                                        what I would try. My feeling is
                                        that the correct order would be
                                        tikz,<br>
                                        endnote, bidi.<br>
                                        <div>
                                          <div><br>
                                            > 1- makes l and r
                                            logical such that l means
                                            always left and r always
                                            means<br>
                                            > right (in both RTL and
                                            LTR).<br>
                                            ><br>
                                            > 2- bidi automatically
                                            puts tikzpicture and
                                            pspicture envoronments in
                                            LTR<br>
                                            > mode mainly for two
                                            reasons:<br>
                                            > a) RTL picture
                                            environment does not make
                                            sense.<br>
                                            > b) XeTeX in RTL mode,
                                            with \special has bugs and
                                            tikz and pstricks both uses<br>
                                            > \special so we have no
                                            other choice but putting
                                            pspicture and tikzpicture<br>
                                            > inside LTR mode.<br>
                                            ><br>
                                            > On Thu, Sep 22, 2011 at
                                            12:26 AM, Nathan Sidoli <<a href="mailto:nathan.sidoli@utoronto.ca" target="_blank">nathan.sidoli@utoronto.ca</a>><br>
                                            > wrote:<br>
                                            >><br>
                                            >> I realize this is
                                            not strictly speaking a
                                            XeTeX issue, but I am<br>
                                            >> typesetting a
                                            critical edition of an
                                            Arabic text using XeLaTeX
                                            with the<br>
                                            >> ednotes package and
                                            I want to be able to make
                                            the diagrams for the text<br>
                                            >> using either
                                            pstricks or TikZ so that the
                                            Arabic fonts can be changed
                                            in the<br>
                                            >> text and diagrams
                                            simply by toggling the
                                            initial font setting.<br>
                                            >><br>
                                            >> When I load either
                                            of these graphics packages,
                                            however, the line numbers<br>
                                            >> in the margins of
                                            the Arabic text disappear.<br>
                                            >><br>
                                            >> Has any one had a
                                            similar problem? Can any one
                                            think of a possible<br>
                                            >> solution?<br>
                                            >><br>
                                            >> I can work on a
                                            minimal example, but it will
                                            probably not be that
                                            minimal.<br>
                                            >><br>
                                            >><br>
                                            >><br>
                                            >>
                                            --------------------------------------------------<br>
                                            >> Subscriptions,
                                            Archive, and List
                                            information, etc.:<br>
                                            >>  <a href="http://tug.org/mailman/listinfo/xetex" target="_blank">http://tug.org/mailman/listinfo/xetex</a><br>
                                            ><br>
                                            ><br>
                                            ><br>
                                            ><br>
                                            >
                                            --------------------------------------------------<br>
                                            > Subscriptions, Archive,
                                            and List information, etc.:<br>
                                            >  <a href="http://tug.org/mailman/listinfo/xetex" target="_blank">http://tug.org/mailman/listinfo/xetex</a><br>
                                            ><br>
                                            ><br>
                                            <br>
                                            <br>
                                            <br>
                                          </div>
                                        </div>
                                        --<br>
                                        Zdeněk Wagner<br>
                                        <a href="http://hroch486.icpf.cas.cz/wagner/" target="_blank">http://hroch486.icpf.cas.cz/wagner/</a><br>
                                        <a href="http://icebearsoft.euweb.cz" target="_blank">http://icebearsoft.euweb.cz</a><br>
                                        <div>
                                          <div><br>
                                            <br>
                                            <br>
--------------------------------------------------<br>
                                            Subscriptions, Archive, and
                                            List information, etc.:<br>
                                             <a href="http://tug.org/mailman/listinfo/xetex" target="_blank">http://tug.org/mailman/listinfo/xetex</a><br>
                                          </div>
                                        </div>
                                      </blockquote>
                                    </div>
                                    <br>
                                  </div>
                                  <br>
                                  <br>
                                  <pre>--------------------------------------------------
Subscriptions, Archive, and List information, etc.:
  <a href="http://tug.org/mailman/listinfo/xetex" target="_blank">http://tug.org/mailman/listinfo/xetex</a>
</pre>
                                </blockquote>
                                <br>
                              </div>
                            </div>
                          </div>
                          <br>
                          <br>
                          <br>
--------------------------------------------------<br>
                          Subscriptions, Archive, and List information,
                          etc.:<br>
                           <a href="http://tug.org/mailman/listinfo/xetex" target="_blank">http://tug.org/mailman/listinfo/xetex</a><br>
                          <br>
                        </blockquote>
                      </div>
                      <br>
                    </div>
                    <br>
                    <br>
                    <pre>--------------------------------------------------
Subscriptions, Archive, and List information, etc.:
  <a href="http://tug.org/mailman/listinfo/xetex" target="_blank">http://tug.org/mailman/listinfo/xetex</a>
</pre>
                  </blockquote>
                  <br>
                </div>
              </div>
            </div>
            <br>
            <br>
            <br>
            --------------------------------------------------<br>
            Subscriptions, Archive, and List information, etc.:<br>
             <a href="http://tug.org/mailman/listinfo/xetex" target="_blank">http://tug.org/mailman/listinfo/xetex</a><br>
            <br>
          </blockquote>
        </div>
        <br>
      </div>
      <br>
      <fieldset></fieldset>
      <br>
      <pre>--------------------------------------------------
Subscriptions, Archive, and List information, etc.:
  <a href="http://tug.org/mailman/listinfo/xetex" target="_blank">http://tug.org/mailman/listinfo/xetex</a>
</pre>
    </blockquote>
    <br>
  </div></div></div>

<br><br>
<br>
--------------------------------------------------<br>
Subscriptions, Archive, and List information, etc.:<br>
  <a href="http://tug.org/mailman/listinfo/xetex" target="_blank">http://tug.org/mailman/listinfo/xetex</a><br>
<br></blockquote></div><br></div>