One of the more complex pieces of code in PreTeXt, by most accounts, is that used for positioning objects (frequently
<tabular>, but also
<p>) next to each other. If you’ve tried to do this in LaTeX, you know that it can be challenging on a good day. Fortunately, PreTeXt does the heavy lifting for us.
We include two examples here. The first places the
<sidebyside>directly in the current division and places a
<figure>with a caption inside the
<sidebyside>. The second puts the
<figure>and then uses an
<image>not contained in a
<figure>to include the graphic. It’s possible to do all sorts of nesting and get nice subnumbering automatically. More information on the capabilities of
<sidebyside>can be found in Section 4.22.
The code in Listing 19.3.1 produces the following output:
We can put a paragraph here. Yes, a paragraph. Isn’t this the most exciting paragraph that you’ve ever seen? It goes on and on and on and on and on and on. We want to put enough here to make it wrap, really, is all. Let’s hope that this is enough.
The code in Listing 19.3.3 produces the following output:
For a layout with multiple rows (but the same
@widthsfor each row, PreTeXt provides the side-by-side group using
The code in Listing 19.3.5 produces the following output:
A longer piece of text. It goes on and on and on. And on and on and on. And eventually we will let it end, but we want to show the width.
Another little snippet of text. This time a bit longer so that it will wrap.
We’re going to keep this paragraph shorter.
Here is some text in a row where we have overridden the widths specified above. Isn’t this grand?
Super duper narrow. Look at me!