Skip to content

Tutorials#

A tutorial is an editorial: the write-up explaining how to solve a problem rather than how to read it. In rbx, a tutorial is a statement. Same source model, same schema, same build engine, so this page can stay short. Let's walk through the handful of places where tutorials differ; everything on the other three pages applies unchanged.

What tutorials are#

You write a tutorial the way you write a statement: an rbxTeX file, or any other format, with the same fields and the same build pipeline. Two things change. It lives in a separate tutorials list, and it builds to a tutorial-<lang>… PDF instead of a statement-<lang>… one.

The write-up itself goes in a plain legend block, like any statement body:

statements/editorial-en.rbx.tex
%- block legend
Run a breadth-first search from vertex $1$, keeping the parent of every vertex
we reach, and walk the parents back from $N$. The graph is connected, so vertex
$N$ is always reachable, and the whole thing is $O(N + M)$.
%- endblock

Declaring a tutorial#

tutorials is a list parallel to statements, and you will find it on both problem.rbx.yml and contest.rbx.yml with the same fields. If you have declared a statement before, you already know how to declare a tutorial.

A problem tutorial is keyed only by (language, variant), with no name, like a problem statement:

problem.rbx.yml
tutorials:
  - language: en
    file: statements/editorial-en.rbx.tex

A contest tutorial requires a name and, like a contest statement, carries the two problem templates:

contest.rbx.yml
tutorials:
  - name: editorial-en
    language: en
    file: statements/editorial-sheet.rbx.tex
    standaloneProblemTemplate: statements/editorial-standalone.rbx.tex
    contestProblemTemplate: statements/editorial-fragment.rbx.tex

Both templates are optional and behave as they do for a contest statement: a full document for the standalone build, a fragment for the join. Leave the standalone template out and rbx falls back to the bundled default editorial. See Contest statements for the full mechanics.

Building tutorials#

Tutorials get their own builders, mirroring the statement commands with the same flags:

# Build problem tutorials (one PDF per language).rbx tutorials build # alias: rbx tut b# Build the joined editorial book.rbx contest tutorials build # alias: rbx contest tut b# The same flags as the statement commands.rbx tut b --languages en --languages ptrbx tut b -p icpc

The PDFs land in build/, with a tutorial- prefix where a statement would carry statement-:

  • Standalone: build/tutorial-<lang>[-<variant>][-<profile>].pdf.
  • Contest: build/<tutorial-name>[-<profile>].pdf, keyed by the contest tutorial's name.

What carries over, and what differs#

Everything on the other three pages carries over to tutorials unchanged:

There is one difference worth remembering:

documents are statements-only

rbx contest tut b builds the tutorials and nothing else. It does not build documents. Only rbx contest st b does.