[tex-k] Re: [pdftex] pdfeTeX: bad interaction of \pdfstartlink...\pdfendlink with \beginR...\endR

Peter Breitenlohner peb at mppmu.mpg.de
Mon Jan 17 13:29:04 CET 2005

On Wed, 29 Dec 2004, Vladimir Volovich wrote:

> > In order to avoid confusion with TeX-XeT the present implementation
> > of mixed-direction typesetting is called TeX--XeT. It uses the same
> > text-direction primitives, but differs from TeX-XeT in several
> > important aspects:
> > (1) Right-to-left text is reversed explicitly by e-TeX and is
> > written to a normal DVI file without any begin_reflect or
> > end_reflect commands;
> apparently this reflection feature is causing the bug (according to
> your analysis); and also i noticed that it causes other negative
> impact: the \write commands (not \immediate ones) in the right-to-left
> text are being processed during the shipout in the left-to-right
> order, and as a result they write information to files not in logical
> order of occurrance in the document, but in reverse order, if there
> hapen to be two or more \write commands on the same line.

Hi Vladimir,

there are actually two (somewhat related) problems. Here I'd like to dicuss
the conceptual aspects; once they are clarified, we can talk about
implementation issues.

(1) \beginR...\pdfstartlink....\pdfendlink...\endR

This is clearly a pdfTeX + e-TeX problem.

(1.1) I think one ought to require (and enforce) that in every \hbox all
three of \pdfstartlink...\pdfendlink, \beginL...\endL, and \beginR...\endR
are properly nested with respect to each other.

(1.2) The line breaking algorithm should take care of that, as it presently
does independently for \pdfstartlink....\pdfendlink and for \beginL...\endL,

(2.2) A \pdfstartlink...\pdfendlink must not be interrupted by display math
(as it can be for \beginL...\endL and \beginR...\endR).

(2.2) Whenever \pdfstartlink....\pdfendlink occurs in an R-to-L context
it ought to be replaced (explicitly or implicitly) by

> Question to e-TeX developers: is this (\write execution in
> right-to-left which does not match the "logical order" used in the
> document) also considered a feature, or it was overlooked when the
> design decision of doing explicit reversing was made?

(2) \beginR...XXX...XXX...\endR

where XXX could be a non-immediate \write or some \special

I really don't know how to discuss that, except by going into some detail:

(2.1) At present the reversal of \write's is a (mis-)feature of e-TeX.
I think non-immediate \write's probably shouldn't be reversed. As long as
there is no sneaky way to write out such things as the current dvi position
that should be easy to handle.

(2.2) color \special's probably shouldn't be reversed (and should be treated
as if they were properly nested?)

(2.3) graphics \special's certainly should be reversed, they depend on the
current dvi position.

(2.4) Other special's: I just dont know.

Any opinions?

Peter Breitenlohner <peb at mppmu.mpg.de>

More information about the tex-k mailing list