CTAN Comprehensive TeX Archive Network

Verzeichnis macros/luatex/latex/robotkarol

README.md

robotkarol — Robot Karol worlds and block programs for teaching material

Version 3.10 (2026-09-24) — Anselm Wagner <anselm.wagner@posteo.de>

The robotkarol package draws worlds and Blockly-style block programs in the visual style of the German teaching environment Robot Karol Online (https://karol.arrrg.de/), for use in worksheets, exams, and slides. Colours and proportions were measured from the original interface and rebuilt with TikZ; no artwork is copied.

Features

  • karolwelt environment: full 2-D worlds rendered either as a 3-D oblique view (with room frame, brick stacks, markers, walls, and the Karol avatar) or as a 2-D top view matching the original interface.
  • \karolzeile: compact string notation for one-row worlds (\karolzeile{> Z 2 {2M} M Q}), drawn with the very same building blocks as karolwelt — a one-row world is visually a karolwelt with laenge=1, only the input is shorter. Plus helpers for before/after pairs, empty grids, and legends.
  • karolbloecke environment and block commands (\bbefehl, \bwiederholemal, \bwenndannsonst, …) reproducing the Blockly editor: exact colours, flat design, condition plugs, number pills, ghost blocks and empty sockets for cloze exercises.
  • Inline blocks (\ibefehl, \iwenndann, \iwiederholemal, …) set a single block into running text: the block's text baseline sits exactly on the surrounding baseline, the label takes the surrounding font size, and the notches are shallower so the block's height stays close to the line height. Blocks that would span several lines in a stack appear inline with their header only.
  • Start and goal states in one picture, the way the online tasks show them: \ziegel[x=4, y=2, hinlegen] and \marke[x=2, y=2, loeschen] mark what is to appear and what is to go. Unchanged objects look as they always did, objects to be removed are crossed out, objects to be placed appear translucent with an arrow (a yellow cross for markers). The environment key zustand=start|ziel|beides picks the view, the karolweltpaar environment puts start and goal side by side, and auftrag=aufraeumen / auftrag=aufbauen state that the goal or the start is the empty world.
  • nummern writes the coordinates along the edges of a karolwelt, counted from 1 like x= and y=. Since version 3.10 the field numbers of \karolzeile count from 1 as well (they used to start at 0), and so does its hervorheben key.
  • Two figures, switched with \karolfigur{karol} (default) or \karolfigur{emma} (long hair and a flower).
  • The fonts of the online interface: labels in Noto Sans, program text in Hack (falling back to DejaVu Sans Mono when Hack is not installed). Load the package as \usepackage[schrift=dokument]{robotkarol} to use the document's own \sffamily/\ttfamily instead — that also avoids loading fontspec.
  • A toner-saving print mode: \usepackage[druck]{robotkarol} — or \karolsetup{druck=true} at any point, group-local — redraws every view in greyscale. It is deliberately not minimal but sufficient: areas stay as light as possible while everything that carries meaning remains legible — brick stacks stay countable, markers stand out on the bricks they sit on, and a \bbefehl is still told apart from a \baufruf: the latter is hatched at 45°, since the two share the same shape and are told apart by colour alone in the original.
  • \karolonline{2t7t} links to a task in Robot Karol Online: it typesets karol.arrrg.de/#2t7t — what you actually have to type — and links it to https://karol.arrrg.de/#2t7t. This is why the package loads hyperref (at the very end of the preamble, so your own \usepackage[...]{hyperref} still works). Load the package as \usepackage[hyperref=false]{robotkarol} to prevent that; the command then sets the same text without a link.
  • karolcode environment for syntax-highlighted Karol source text and helpers for structograms (via struktex).
  • All colours and dimensions adjustable through \karolsetup.

Requirements

Lua (the package warns if \directlua is missing), expl3, TikZ (including its patterns.meta library), listings, struktex, graphicx, and — unless loaded with schrift=dokument — fontspec and the Noto Sans fonts (both in Live). Unless loaded with hyperref=false, it also loads hyperref.

Installation

Put robotkarol.sty where finds it, e.g.

TEXMFHOME/tex/latex/robotkarol/robotkarol.sty

and refresh the file database (mktexlsr) if your distribution needs it. robotkarol.cwl is a command list for studio's auto-completion and belongs in that editor's completion/user directory; it is not needed to typeset documents.

Files

File Purpose
robotkarol.sty the package
robotkarol-doc.tex, robotkarol-doc.pdf manual (German, English abstract)
robotkarol-beispiel.tex, robotkarol-beispiel.pdf example document
robotkarol.cwl studio auto-completion

Documentation

See robotkarol-doc.pdf (German, with an English abstract). A quick start:

\usepackage{robotkarol}
...
\begin{karolwelt}[breite=5, laenge=3]
  \karol[x=1, y=2, richtung=osten]
  \ziegel[x=2, y=2, anzahl=4]
  \marke[x=5, y=2]
\end{karolwelt}

Karol checks \iwenndann{IstZiegel} and repeats \iwiederholemal{5}.

License

Project Public License, version 1.3c or later (https://www.latex-project.org/lppl.txt). This work has the LPPL maintenance status maintained; the current maintainer is Anselm Wagner.

Copyright (C) 2026 Anselm Wagner <anselm.wagner@posteo.de>

Herunterladen des vollständigen Inhalts dieses Pakets in einem Zip-Archiv (390.3k).

Robotkarol – Worlds and block programs of the German teaching environment Robot Karol

Das Paket robotkarol zeichnet Welten und Blockprogramme im Stil von Robot Karol; für Arbeitsblätter, Präsentationen und Prüfungen. Welten können als 3D-Schrägbild oder als 2D-Draufsicht ausgegeben werden; Farben und Formen sind der Weboberfläche nachempfunden. Einzelne Blöcke lassen sich als Inline-Blöcke in den Fließtext setzen. Das Paket benötigt Lua und expl3.

PaketRobotkarol
Version3.10 2026-09-24
LizenzenThe Project Public License 1.3c
Copyright2026 Anselm Wagner
BetreuerAnselm Wagner
Enthalten inTeX Live als robotkarol
MiKTeX als robotkarol
ThemenDiagramme
Lua
Lehre
PGF/
...
Gästebuch Seiten-Struktur Impressum Autor kontaktieren