Skip to main content

Chapter 17 Worksheets

A <worksheet> is a specialized division that can be a child of most divisions and can contain most PreTeXt tags. The general idea, however, would be to assemble a sequence of <exercise>s or project-like elements with some interspersed <p>, <figure>, and <sidebyside>. One of the few times that PreTeXt allows you to manipulate page layout in terms of giving blank space and specifying page breaks is in the <worksheet> tag. A <worksheet> is also the only place you can put an <exercise> inside a <sidebyside>. The sample code in ListingĀ 17.0.1 is not meant to demonstrate everything you can do, but rather to give you a skeleton to start exploring. The rendered output from the listing appears immediately after it.

<worksheet xml:id="basics-sample-worksheet">
  <title>A Skeletal Worksheet</title>
  <objectives>
    <ul>
      <li>Something really cool</li>
      <li>A less important thing you'll learn</li>
    </ul>
  </objectives>
  <introduction>
    <p>It can be helpful to say what the point of the worksheet is.</p>
  </introduction>

  <page>
    <exercise workspace="4in">
      <statement>
        <p>Here's a first exercise in this worksheet.
	Notice how we set the workspace in inches.</p>
      </statement>
    </exercise>

    <exercise workspace="1cm">
      <introduction>
	<p>A second exercise, this time structured with tasks. The
	workspace specification is assigned to each task. </p>
      </introduction>
      <task>
	<statement>
	  <p>Here's the first task.</p>
	</statement>
	<hint>
	  <p>Why not give a hint here, we're nice authors, right?</p>
	</hint>
      </task>
      <task>
	<statement>
	  <p>The second task. No hint this time!</p>
	</statement>
      </task>
    </exercise>
  </page>

  <page>
    <p>OK, we're now onto a second page, one of the few times you can
    force this.</p>
    <figure>
      <caption>Just a little figure</caption>
      <image src="image-4.svg" width="50%" />
    </figure>
    <sidebyside margins="0%" widths="30% 60%" valign="top">
      <exercise workspace="4.5in">
        <statement>
	  Only inside a worksheet can you put an exercise in a
	  sidebyside! 
        </statement>
	<answer>
	  <p>Sure, you can have an answer here.</p>
	</answer>
      </exercise>
      <exercise workspace="2in">
        <statement>
          <p>Here's the second column. We also could have just put a
	  figure here if we needed for layout.</p>
        </statement>
      </exercise>
    </sidebyside>
    <exercise workspace="2.54cm">
      <p>One more exercise to do.</p>
    </exercise>
  </page>

  <conclusion>
    <title>Final thoughts</title>
    <p>Put something here because you might run out of time.</p>
  </conclusion>
</worksheet>
Listing 17.0.1. Structure of <worksheet>.

Worksheet A Skeletal Worksheet

It can be helpful to say what the point of the worksheet is.

1.

Here's a first exercise in this worksheet. Notice how we set the workspace in inches.

2.

A second exercise, this time structured with tasks. The workspace specification is assigned to each task.

(a)

Here's the first task.

Hint.

Why not give a hint here, we're nice authors, right?

(b)

The second task. No hint this time!

OK, we're now onto a second page, one of the few times you can force this.

Figure 17.0.2. Just a little figure
3.
Only inside a worksheet can you put an exercise in a sidebyside!
Answer.

Sure, you can have an answer here.

4.

Here's the second column. We also could have just put a figure here if we needed for layout.

5.

One more exercise to do.

Final thoughts.

Put something here because you might run out of time.