[XeTeX] bidi question

Bruno Le Floch blflatex at gmail.com
Wed Jul 16 03:01:51 CEST 2014


On 7/15/14, maxwell <maxwell at umiacs.umd.edu> wrote:
> I'm attaching the minimal file below.  The PDF output has a blank line
> between the first and second footnotes, which IMO shouldn't be there.  I
> don't get this result if bidi isn't loaded, and with bidi loaded I only
> get this result if the last line of the first footnote ends right at the
> right-hand margin (and TeX doesn't think it can improve the result by
> wrapping onto the next line--hence the rather long final word in the
> minimal example's footnote).
>
> So it's a very minor problem, and easy enough to work around.  My
> problem with the work-around is that the LaTeX code is generated from
> XML, and avoiding that line break before the brace is difficult.


Hello,

TeX inserts a space at the end of every line it reads, which normally
is what you want (to separate words, for instance).  Here, you get a
space just before the brace.

My guess is that without bidi the space ends up at the end of a
paragraph, where TeX removes spaces (since otherwise all paragraphs
would end with a space), so there is no space in what TeX breaks into
lines.  With bidi, there may be some additional node in the list (to
take care of bidirectional typesetting), so the paragraph ends with a
space then some bidi stuff.  TeX does not remove the space.  It breaks
the paragraph-ending-with-a-space into lines, and it may break the
line in such a way that the single space is in a line of its own.
Thus the extra line you get.

To avoid all this, either add the comment character % at the end of
the line which is before the brace (leaving no space between the text
and %), or add \unskip before the brace

...fill.%
}

or

...fill.
\unskip}

depending on what's easiest to generate.

Regards,
Bruno



More information about the XeTeX mailing list