<div dir="ltr">By the way, I do not know why you are using ednotes.sty. If it is because of footnote support, bidi package also allows you to do paragraph footnotes. For more details, see bidi manual. ednotes is not supported by bidi and its use together with bidi should be avoided.<br>
<br><div class="gmail_quote">On Thu, Sep 22, 2011 at 5:16 PM, VAFA KHALIGHI <span dir="ltr"><<a href="mailto:vafaklg@gmail.com">vafaklg@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div dir="ltr">I could not be bothered looking through lineno.sty to see what setups they have so this is another quick/dirty fix. The problem is that in the definition of \MakeLineNo, they use \sbox, \sbox itself uses \set@color. bidi changes the definition of \set@color when color/xcolor package is loaded such that in the definition of \sbox at the beginning of \hbox, you get \beginR, and at the end of \hbox, you get \endR, that is, it makes \hbox and consequently \sbox RTL in RTL mode. lineno setup for right linenumbers expect that \hbox or \sbox to be an LTR one. Well, it can be RTL but you need to reverse the process (putting \hskips, etc) I did not have time to look through the whole lineno.sty so instead I used \setbox instead \sbox so it fixes the problem. Replace the previously given code by this one:<br>

<br>

<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">\makeatletter</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">\@ifpackageloaded{color}{%</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">\def\MakeLineNo{%</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">   \@LN@maybe@normalLineNumber                        % v4.31 </p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">   \boxmaxdepth\maxdimen\setbox\z@\vbox{\unvbox\@cclv}%</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">   \@tempdima\dp\z@ \unvbox\z@</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">   \setbox\@tempboxa=\hbox to \z@{\makeLineNumber}%</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">   \stepLineNumber</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">   \ht\@tempboxa\z@ \@LN@depthbox </p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">   \@LN@do@vadjusts </p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">   \count@\lastpenalty </p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">   \ifnum\outputpenalty=-\linenopenaltypar </p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">     \ifnum\count@=\z@ \else  </p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">       \xdef\@LN@parpgbrk{% </p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">         \penalty\the\count@</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">         \global\let\noexpand\@LN@parpgbrk</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">                      \noexpand\@LN@screenoff@pen}% v4.4 </p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">     \fi</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">   \else</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">     \@tempcnta\outputpenalty</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">     \advance\@tempcnta -\linenopenalty</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">     \penalty \ifnum\count@<\@tempcnta \@tempcnta \else \count@ \fi </p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">   \fi</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">   }}{}</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">\makeatother</p><br></div>
</blockquote></div><br></div>