[tex-k] Horizontal positioning of an hbox in a right-to-left bidi document doesn't work as expected

Laurence.Finston at gmx.net Laurence.Finston at gmx.net
Fri Nov 18 09:15:11 CET 2022


My guess is that the glue for the indentation has a shrink component so that it will shrink in order to prevent an overfull box.  If true, then the indentation is present, it's just doesn't have much if any width.  Somebody familiar with LaTeX would have to give a definitive answer.

For what it's worth, the following code demonstrates that one can put an hbox anywhere one wants with respect to the margins in right-to-left mode using etex (see attachment):

%% ttemp.tex

\special{papersize=297mm, 210mm} %% DIN A4
\hsize=297mm
\vsize=210mm

\advance\hoffset by -1in
\advance\voffset by -1in

\advance\hoffset by 1cm
\advance\voffset by 1cm

\advance\hsize by -2cm

\parindent=0pt

\TeXXeTstate=1

\beginR
\vbox{\line{\hskip3em The quick brown fox jumps over the lazy dog.  The quick brown fox jumps over the lazy dog.
The quick brown fox jumps over the lazy dog.\hss}\vskip.5\baselineskip
\line{\hskip-3em The quick brown fox jumps over the lazy dog.  The quick brown fox jumps over the lazy dog.
The quick brown fox jumps over the lazy dog.\hss}\vskip.5\baselineskip
\line{\hskip10em The quick brown fox jumps over the lazy dog.  The quick brown fox jumps over the lazy dog.
The quick brown fox jumps over the lazy dog.\hss}\vskip.5\baselineskip
\line{\hskip-10em The quick brown fox jumps over the lazy dog.  The quick brown fox jumps over the lazy dog.
The quick brown fox jumps over the lazy dog.\hss}\vskip.5\baselineskip
\line{\hskip30em The quick brown fox jumps over the lazy dog.  The quick brown fox jumps over the lazy dog.
The quick brown fox jumps over the lazy dog.\hss}\vskip.5\baselineskip
\line{\hskip-30em The quick brown fox jumps over the lazy dog.  The quick brown fox jumps over the lazy dog.
The quick brown fox jumps over the lazy dog.\hss}}
\endR

\bye




> Gesendet: Freitag, 18. November 2022 um 08:59 Uhr
> Von: "Evan Aad" <oddeveneven at gmail.com>
> An: Laurence.Finston at gmx.net
> Cc: "tex-ktug.org" <tex-k at tug.org>
> Betreff: Re: Re: [tex-k] Horizontal positioning of an hbox in a right-to-left bidi document doesn't work as expected
>
> On Fri, Nov 18, 2022 at 9:40 AM <Laurence.Finston at gmx.net> wrote:
> > If you would explain exactly what you want to accomplish and provide an example of how it's not working, preferably including the PDF output, I will try to see if I can get it to work with e-tex and plain TeX.
>
> Certainly. Please find attached the PDF file resulting from processing
> my original example with the XeTeX typesetting engine.
>
> Here's a commentary on the PDF file:
>
> The first line of text is meant to visualize the length of the text
> area, as well as its start and end points. Beyond this point, to the
> left and to the right, are the left and right margins, respectively.
> The second and third lines of text are considerably shorter than the
> length of the text area. They are properly indented 3cm left of the
> right margin. These lines are meant to show that as long as a line's
> length is sufficiently short that the indentation does not cause it to
> exceed the text area, the indentation works as expected.
> The fourth line demonstrates the bug. It is as long as the text area
> itself. Despite the fact that the LaTeX code instructed that it should
> be indented 3cm like the previous two lines, it remains unindented. If
> it had been indented, it would exceed the text area, and its left edge
> would protrude into the left margin, which is the desired behavior. It
> is also the expected behavior: when the bidi package is not loaded,
> the last line of text is indented by 3cm, and protrudes beyond the
> (right) margin.
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ttemp.pdf
Type: application/pdf
Size: 4872 bytes
Desc: not available
URL: <https://tug.org/pipermail/tex-k/attachments/20221118/a664fbc4/attachment-0001.pdf>


More information about the tex-k mailing list.