# [pdftex] How to set Right Edge binding attribute in pdfLaTeX?

Reinhard Kotucha reinhard.kotucha at web.de
Mon Mar 8 02:06:39 CET 2004

>>>>> "Tigran" == Tigran Aivazian <tigran at aivazian.fsnet.co.uk> writes:

> How to typeset 9 "spaces" (well, by "space" I mean space of
> length 1ex in a given font) in such a way that TeX may introduce
> linebreaks if needed (i.e. will NOT push the previous text on a
> line into the margin which will happen if I just do
> \hskip9ex).

A "space" should behave like a word.  You need glue with zero width
between them and at the beginning and the end.  See example below.

> And also, if a linebreak was introduced then I want
> the following line indented (say by 2ex) even if 9ex fitted
> nicely at the end of the previous line, so it would look like

This is quite difficult.  Maybe it is best to do it manually.  You
cannot use \parshape because you don't know *where* this occurs in

On the other hand, the larger the value of \linewidth, the smaller the
probability that all the nine spaces are at the end of the line.
If a space must not be exactly 1ex, you can slightly modify the width
of the spaces (\rule) to avoid any occurence of this situation at all.

In the following example I used a \rule instead of an empty box
because you might also consider to add a bit strechability to the
glue, for instance {0pt plus .1ex} to give TeX more freedom to
optimize interword glue.  Then you can set the second parameter of
\rule to .1pt to make your spaces visible.

\documentclass{minimal}
\setlength{\textwidth}{4cm}
\setlength{\parindent}{0pt}
\newcommand{\ebox}{\rule{1ex}{0pt}}
\newcommand{\glue}{\hspace{0pt}}
\newcommand{\ninespaces}{\glue\ebox\glue\ebox\glue\ebox\glue%
\ebox\glue\ebox\glue\ebox\glue\ebox\glue\ebox\glue\ebox\glue}
\begin{document}
\makebox[\textwidth]{\smash{\rule[-50pt]{.1pt}{50pt}}%
\hspace{\fill}\smash{\rule[-50pt]{.1pt}{50pt}}}\par
xxxxxx xxxx xxxxxx\ninespaces xxxxx xxxxx
\end{document}

Regards,
Reinhard

--
----------------------------------------------------------------------------
Reinhard Kotucha			              Phone: +49-511-4592165
Marschnerstr. 25
D-30167 Hannover	                      mailto:reinhard.kotucha at web.de
----------------------------------------------------------------------------
Microsoft isn't the answer. Microsoft is the question, and the answer is NO.
----------------------------------------------------------------------------