advertise usage of \linebreak rather than \newline
[PyX/mjg.git] / examples / text / halign.txt
blobb1453d08d4a5caf1e158b028596bfba7391b5035
1 Horizontal alignment
3 The example shows the result of the different text attributes for horizontal
4 alignment. We first need to emphasize, that PyX distinguishes between the
5 alignment of the text box and the alignment of the material within the text
6 box. The first line in the output shows the effect of the box alignment
7 created by `boxleft`, `boxcenter` and `boxright` leading to left, center, and right
8 alignment of the text box with respect to the dotted lines. ...
10 The middle part shows the examples for centering a box, but aligning the
11 content differently inside the box, namely at the left box boundary by
12 `flushleft`, at the center by `flushcenter` and at the right box boundary by
13 `flushright`. Note, that such an alignment of material is available only
14 when you create a parbox in TeX. This is easily done by means of the `parbox`
15 attribute, where you have to specify the width of the box.
17 At the bottom, you can see combinations of `boxleft` and `flushleft`, `boxcenter` and
18 `flushcenter`, and `boxright` and `boxcenter` in action. These combinations are
19 available by the attributes `left`, `center` and `right` to shortcut the setting of
20 both corresponding attributes. You can use these shortcuts for box alignment as
21 well, when you do not create a parbox.
23 !! Note that the alignment features are implemented in such a way, that they work
24 in both, TeX and LaTeX mode. Furthermore, you can always influence the
25 alignment of the box contents by appropriate TeX and LaTeX commands as well.
27 !! If you want to enforce line breaks in a parbox use `\linebreak`, not `\newline` (which
28 is equivalent to `\\`). `\linebreak` makes sure that horizontal alignment is preserved
29 throughout the text box.