On Sat, May 06, 2006 at 07:17:01PM +0200, Tzahi Fadida wrote:
> Well, I also made a hack that uses the unix power.
> (and just finished converting the thesis to have hebrew)
I consider this a workaround, rather than a solution.
>
> I made a script with different stages.
> in the first stage I print in the start of dvi file
> "\newcommand{\SFDPRE}{\ref{a}}{\ref{b}}"
> which results in "\newcommand{\SFDPRE}{1}{2}"
>
> then I use dvi2tty and grep to take the resulting lines
> with the fixed numbers and put it in a .tex file which
> I input in the third stage back to thesis.tex
>
> Then you don't have anymore refs inside equations so you
> can continue with normal compilation.
>
> All I can say: "Thank you linux" :)
>
> I think I'll also try to give your hack a go also.
> 10x.
>
> Here it is. little crazy but it works (thesis.tex has
> \input{equationRefsModel.tex}):
> echo "\input{equationRefs.tex}"> equationRefsModel.tex
> echo "\input{equationRefsPrint.tex}">> equationRefsModel.tex
> elatex -interaction=batchmode thesis.tex
> bibtex thesis
> elatex -interaction=batchmode thesis.tex
> dvi2tty thesis.dvi|grep newcommand > equationRefsManual.tex
And if you have some Hebrew there?
No. This is a bad workaround.
> echo "\input{equationRefsManual.tex}"> equationRefsModel.tex
> elatex thesis.tex
> bibtex thesis
> elatex thesis.tex
BTW: I prefer pdf[e]latex to [e]latex, as it makes life slightly
simpler.
> Regards,
> tzahi.
>
> > -----Original Message-----
> > From: Tzafrir Cohen [mailto:[EMAIL PROTECTED]
> > Sent: Saturday, May 06, 2006 3:55 PM
> > To: Tzahi Fadida
> > Cc: [email protected]
> > Subject: Re: hebtech and elatex.
> >
> > Sorry for the delayed response. Just got back to reading email.
> >
> > Short summary: I have a lame workaround below.
> >
> > On Tue, May 02, 2006 at 12:32:46AM +0200, Tzahi Fadida wrote:
> > > There is a known issue in ivritex that
> > > when you put \ref in an equation environment or $ $
> > > you get an error in the second run of elatex.
> >
> > That i, after references are expanded.
> >
> > >
> > > I use a lot something like this:
> > > \newcommand{\SFDPRE}{\ref{fig:alg:a}:\ref{fig:alg:b}}
> > >
> > > \begin{equation}%
> > > X_{\SFDPRE} = 2s%
> > > \end{equation}%
> > >
> > > What can I do to either solve it or circumvent it. When I look
> > > in the hebtech.cls I can't find something that changes the
> > equation environment.
> >
> > It is hebrew.ldf and the changes are generally around the
> > contents that
> > \label saves.
> >
> > > I have a hunch it is connected somehow to what they do to
> > the .aux file. It does not
> > > look like a regular .aux file and the error only happens on
> > the second run.
> > > I think they also mess with the \ref tag, as I see in
> > hebrew.dtx but I don't know where it finally
> > > goes.
> > >
> > > Maybe there is a way to do early binding of \SFDPRE to some
> > text variable and then put it in the
> > > equation?...
> >
> >
> > I wrote the following test document:
> >
> > \documentclass{article}
> > \usepackage{ucs}
> > \usepackage[utf8x]{inputenc}
> > \usepackage[english,hebrew]{babel}
> > \newcommand{\SFDPRE}{\ref{fig:alg:a}:\ref{fig:alg:b}}
> > \begin{document}
> >
> > \begin{figure}[h]
> > איור ראשון
> > \label{fig:alg:a}
> > \end{figure}
> >
> > \begin{figure}[h]
> > איור שני
> > \label{fig:alg:b}
> > \end{figure}
> >
> > \begin{equation}
> > X_{\SFDPRE} = 2s
> > \end{equation}
> >
> > \end{document}
> >
> >
> > There seem to be problems indeed. You're looking at slightly the wrong
> > place: the contents of the .aux file is written from the
> > command \label
> > at the first run. Indeed a simple workaround for the above file is:
> >
> >
> > Document with a workaround:
> >
> > \documentclass{article}
> > \usepackage{ucs}
> > \usepackage[utf8x]{inputenc}
> > \usepackage[english,hebrew]{babel}
> > \newcommand{\SFDPRE}{\ref{fig:alg:a}:\ref{fig:alg:b}}
> > \makeatletter
> > % \label is originally defined in latex.ltx. redefined in hebrew.ldf .
> > % [EMAIL PROTECTED] is defined/redefined in latex.ltx
> > [EMAIL PROTECTED]
> > [EMAIL PROTECTED]
> > [EMAIL PROTECTED]@enumii)\theenumii(}%
> > [EMAIL PROTECTED]@auxout{}%
> > % The change is here: replaced \beginR [EMAIL PROTECTED] \endR
> > % with: [EMAIL PROTECTED]
> > % - This made it pass latex, but numbers are not displayed.
> > [EMAIL PROTECTED]
> > % If we get rid of the label word itself the number shows up:
> > {\string\newlabel{#1}{{\thepage}}}%
> > \else
> > [EMAIL PROTECTED]@enumii(\theenumii)}%
> > [EMAIL PROTECTED]@auxout{}%
> >
> > [EMAIL PROTECTED]
> > \fi
> > [EMAIL PROTECTED]
> > \makeatother
> > \begin{document}
> >
> > \begin{figure}[h]
> > איור ראשון
> > \label{fig:alg:a}
> > \end{figure}
> >
> > \begin{figure}[h]
> > איור שני
> > \label{fig:alg:b}
> > \end{figure}
> >
> > \begin{equation}
> > X_{\SFDPRE} = 2s
> > \end{equation}
> >
> > \end{document}
> >
> > -- Tzafrir
> >
> >
>
>
=================================================================
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]