Коротко
Рабочая тетрадь для восьмилетних о животных с позвоночником. Вопросы и ответы записаны в тексте; один стиль решает, как выглядит каждое упражнение на странице.
Что получится
Урок 5 рабочей тетради по природе для третьего класса, формат A4: Animals with backbones. Урок открывается зелёным полем над иллюстрацией пруда; за ним идут одиннадцать упражнений, у каждого номер в зелёном кружке и значок с карандашом, речью или парой. Есть банк слов в пунктирном тонированном прямоугольнике, фразы с T и F для отметки, животные, которых надо соединить линией с их группами, слова, которые нужно обвести во фразе и в коротком тексте, стадии лягушки для нумерации, поиск слов, животные для сортировки, открытый вопрос на строках и ещё один на клетке. Испанская версия печатает тот же урок так, как принято в своих школах, с V и F и заданием une con flechas. Его иллюстрируют три картины, созданные диффузионной моделью.
Рецепт отвечает на вопросы
- Как набрать страницу заданий рабочей тетради: номера в кружках, банк слов, верно — неверно, соединение линией?
- Как поставить значки вида работы (письмо, устный ответ, работа в парах) рядом с номером упражнения?
- Как сделать рабочий лист: линейки для ответов, рамки, банки слов, списки с флажками?
Короткий ответ
// The Markdown says what each activity asks (:::exercise, [[answers]], - A -> B, - [x]);
// this style says how a Spanish workbook prints it: the number in a disc of the unit
// colour, the instruction in bold, blanks on a line, V/F boxes at the line's end, dots to
// join, the bank in a tinted box, squared paper for writing and the activity icons.
const icon = (id, alt) => ({ resourceId: `icon-${id}`, alt });
const actividad = {
id: 'actividad',
number: { shape: 'disc', background: col('unit'), color: col('paper'),
fontFamily: DISPLAY, fontSize: em(1.05), fontWeight: 800 },
instruction: { bold: true, color: col('ink') },
options: { marker: 'circle' },
blank: { look: 'line', color: col('ink'), weight: pt(0.75), extra: em(2) },
trueFalse: { look: 'boxes' }, // V F in Spanish, T F in English: the language's own words
match: { look: 'dots', gap: em(7), dotSize: em(0.42), color: col('unit') },
bank: { box: 'banco', order: 'alpha', separator: ' ' },
area: { kind: 'lines', spacing: mm(9), color: col('rule'), weight: pt(0.6) },
grid: { cell: mm(9.5), fontFamily: DISPLAY, fontSize: pt(13), rule: col('rule'),
color: col('ink') },
icons: {
escribe: icon('write', t({ es: 'Escribe', en: 'Write' })),
oral: icon('oral', t({ es: 'Actividad oral', en: 'Speaking' })),
pareja: icon('pair', t({ es: 'En pareja', en: 'In pairs' })),
},
marginTop: mm(7), marginBottom: mm(2), itemSpacing: em(0.8),
};
// The same activity written on squared paper (cuadrícula): `style="cuadricula"`.
const cuadricula = { id: 'cuadricula', extends: 'actividad',
area: { kind: 'grid', spacing: mm(5), weight: pt(0.4) } };
Ингредиенты
- Возможности
- Стили упражненийПропуски и банки словСоединение и сортировкаУпражненияВыбор ответа, «верно/неверно»Отметить словаРасстановка по порядкуПоиск слов и кроссвордыОткрытые вопросы и место для ответаОформленные начальные полосыАтрибуты заголовковВрезкиСемантическая палитраЗеркальные поляКолонтитулы по роли страницыСтраницы на холстеЭкспорт в PDFРисунки и таблицы как ресурсыСобственные типы ресурсов
- Также применяет
- Врезки, которые делятся или не разрываютсяОтветыРисунки точно здесьСтили абзацевШрифты, встроенные в PDF
- Шрифты
- Atkinson Hyperlegible Next, Grandstander (SIL OFL 1.1)
- Материалы
charca-1088.jpgciclo-1088.jpgnina-720.jpg- Animals at a pond: a frog, a kingfisher, a trout, a turtle and a rabbit. (Generated With Diffusion Models, оригинал)
- Five stages of a frog's life, in a jumbled order. (Generated With Diffusion Models, оригинал)
- A girl with a magnifying glass watching a sparrow and a lizard on a wall. (Generated With Diffusion Models, оригинал)
Порядок работы
#1 · Запишите упражнения в Markdown, оформите их один раз
// The Markdown says what each activity asks (:::exercise, [[answers]], - A -> B, - [x]);
// this style says how a Spanish workbook prints it: the number in a disc of the unit
// colour, the instruction in bold, blanks on a line, V/F boxes at the line's end, dots to
// join, the bank in a tinted box, squared paper for writing and the activity icons.
const icon = (id, alt) => ({ resourceId: `icon-${id}`, alt });
const actividad = {
id: 'actividad',
number: { shape: 'disc', background: col('unit'), color: col('paper'),
fontFamily: DISPLAY, fontSize: em(1.05), fontWeight: 800 },
instruction: { bold: true, color: col('ink') },
options: { marker: 'circle' },
blank: { look: 'line', color: col('ink'), weight: pt(0.75), extra: em(2) },
trueFalse: { look: 'boxes' }, // V F in Spanish, T F in English: the language's own words
match: { look: 'dots', gap: em(7), dotSize: em(0.42), color: col('unit') },
bank: { box: 'banco', order: 'alpha', separator: ' ' },
area: { kind: 'lines', spacing: mm(9), color: col('rule'), weight: pt(0.6) },
grid: { cell: mm(9.5), fontFamily: DISPLAY, fontSize: pt(13), rule: col('rule'),
color: col('ink') },
icons: {
escribe: icon('write', t({ es: 'Escribe', en: 'Write' })),
oral: icon('oral', t({ es: 'Actividad oral', en: 'Speaking' })),
pareja: icon('pair', t({ es: 'En pareja', en: 'In pairs' })),
},
marginTop: mm(7), marginBottom: mm(2), itemSpacing: em(0.8),
};
// The same activity written on squared paper (cuadrícula): `style="cuadricula"`.
const cuadricula = { id: 'cuadricula', extends: 'actividad',
area: { kind: 'grid', spacing: mm(5), weight: pt(0.4) } };
Каждое упражнение — директива :::exercise. Что читает ученик и что считается верным, стоит в тексте: [[hair]] — пропуск с ответом hair, - [x] — верное утверждение, - Dolphin -> Mammal — пара, [[pelo | (plumas)]] — выбор, где верное слово в скобках. В стиле только вид, поэтому все одиннадцать упражнений делят actividad, а второй стиль, cuadricula, расширяет его (extends) и заменяет строки клеткой. Движок нумерует упражнения, перемешивает правый столбец пар и пункты для порядка по начальному числу, делает пропуски шириной с самый длинный ответ, чтобы ни один не выдал себя, и печатает T и F в английской версии, V и F в испанской, без единого слова в конфигурации.
#2 · Дайте упражнениям значки
const disc = (body) => '<svg xmlns="http://www.w3.org/2000/svg" width="240" height="240" '
+ `viewBox="0 0 24 24"><circle cx="12" cy="12" r="12" fill="${palette.unit}"/>`
+ `<g fill="none" stroke="#fff" stroke-width="1.7" stroke-linecap="round" `
+ `stroke-linejoin="round">${body}</g></svg>`;
const ICONS = {
write: disc('<path d="M7 17l1-4 7.5-7.5 3 3L11 16l-4 1z"/><path d="M14 7l3 3"/>'),
oral: disc('<path d="M6 7.5h12v7.5H11l-3.5 3v-3H6z"/><path d="M9.5 11.2h.01M12 11.2h.01M14.5'
+ ' 11.2h.01" stroke-width="2.2"/>'),
pair: disc('<circle cx="9" cy="9" r="2.3"/><circle cx="15.3" cy="9.6" r="2"/>'
+ '<path d="M4.8 17.5c.4-2.8 2.1-4.3 4.2-4.3s3.8 1.5 4.2 4.3M13.6 13.9c.6-.3 1.1-.4 1.7-.4'
+ ' 1.9 0 3.3 1.3 3.7 3.8"/>'),
};
Значок в exerciseStyles[].icons называет изображение книги, а :::exercise{icon="oral pareja"} ставит изображения после номера в записанном порядке; их читает вслух alt. Это плоские знаки, нарисованные в коде на кружке цвета урока, поэтому в PDF они остаются чёткими и меняются вместе с палитрой. Рабочая тетрадь печатает карандаш рядом с письменными упражнениями; значки речи и пары отмечают последнее, у которого нет места для записи (area="none").
#3 · Откройте урок полем и картиной
const at = (to, edge, x = 0, y = 0, size) => ({ anchor: { to, edge },
offset: { x: mm(x), y: mm(y) }, ...(size && { size }) });
const PIC = 75; // mm: the painting's height (it is 176 × 75 mm, 2.35:1)
const opener = { enabled: true, minHeight: mm(20 + PIC + 4), slot: { elements: [
{ kind: 'box', id: 'band', style: { backgroundColor: col('unit'), borderRadius: mm(4) },
placement: at('container', 'top-left', 0, 0, { width: mm(176), height: mm(18) }) },
{ kind: 'text', id: 'unit', content: '{attr.unidad}', fontFamily: DISPLAY, fontSize: pt(11),
fontWeight: 800, color: col('unit'), align: 'center', verticalAlign: 'middle',
textTransform: 'uppercase', letterSpacing: pt(1.4), lineHeight: 1.1,
box: { backgroundColor: col('paper'), borderRadius: mm(4) },
placement: at('container', 'top-left', 4, 4, { width: mm(30), height: mm(10) }) },
{ kind: 'text', id: 'title', content: '{titleText}', fontFamily: DISPLAY, fontSize: pt(27),
fontWeight: 800, color: col('paper'), align: 'left', lineHeight: 1,
placement: at('container', 'top-left', 40, 4.4, { width: mm(132) }) },
{ kind: 'image', id: 'picture', resourceId: '{attr.pic}', decorative: true,
placement: at('container', 'top-left', 0, 22, { width: mm(176), height: mm(PIC) }) },
] } };
Заголовок первого уровня рисует поле, капсулу с номером и название из своих атрибутов (unidad="Unit 5" pic="charca"), а под полем картину 176 × 75 мм. Изображения внутри упражнений берут тип ресурса без подписи и номера (dibujo), как принято в тетрадях. Текст легко читать младшим школьникам: Atkinson Hyperlegible Next, 12 пт на 17 пт, без переносов, флаговый набор.
Рецепт целиком
// ═══ Postext Cookbook · Nº 168 · Primary workbook unit of activities ═══════════
// https://postext.dev/en/cookbook/primary-workbook-activities
// Code: MIT · Text: original (CC BY 4.0) · Pictures: generated with diffusion models
// Fonts: Atkinson Hyperlegible Next, Grandstander (SIL OFL 1.1) · Needs postext ≥ 1.63.0
import {
buildDocumentWithFonts, renderPageToCanvas, registerResourceImage,
} from 'https://esm.sh/postext';
import { renderToPdf, decompressWoff2 } from 'https://esm.sh/postext-pdf';
const LANG = 'en'; // @lang: the language of the sample document ('es' | 'en')
const RECIPE = 'primary-workbook-activities';
// ─── 1 · Design ─────────────────────────────────────────────────────────────
// #region palette: one unit colour (green for this unit), a pale tint of it, a sun yellow
const palette = {
ink: '#1f2b27', // text: a green-tinted near-black
unit: '#2b7a3d', // the unit's colour: discs, band, folio, dots to join
deep: '#1d5a2b', // the bank's words and the kicker on white
tint: '#e6f2e2', // the reminder box, the bank
sun: '#f2b330', // the reminder's stripe
rule: '#9cc3a2', // writing lines, the squared paper
muted: '#5c6b64', // running heads, colophon
paper: '#ffffff',
};
const col = (id) => ({ hex: palette[id], model: 'hex', paletteId: id });
const colorPalette = [
...Object.entries(palette).map(([id, hex]) => ({ id, name: id, value: { hex, model: 'hex' } })),
{ id: 'main-color', name: 'unit (defaults)', value: { hex: palette.unit, model: 'hex' } },
];
// #endregion
const [TEXT, DISPLAY] = ['Atkinson Hyperlegible Next', 'Grandstander'];
// #region answer: the workbook's activity style, one for every kind of exercise
// The Markdown says what each activity asks (:::exercise, [[answers]], - A -> B, - [x]);
// this style says how a Spanish workbook prints it: the number in a disc of the unit
// colour, the instruction in bold, blanks on a line, V/F boxes at the line's end, dots to
// join, the bank in a tinted box, squared paper for writing and the activity icons.
const icon = (id, alt) => ({ resourceId: `icon-${id}`, alt });
const actividad = {
id: 'actividad',
number: { shape: 'disc', background: col('unit'), color: col('paper'),
fontFamily: DISPLAY, fontSize: em(1.05), fontWeight: 800 },
instruction: { bold: true, color: col('ink') },
options: { marker: 'circle' },
blank: { look: 'line', color: col('ink'), weight: pt(0.75), extra: em(2) },
trueFalse: { look: 'boxes' }, // V F in Spanish, T F in English: the language's own words
match: { look: 'dots', gap: em(7), dotSize: em(0.42), color: col('unit') },
bank: { box: 'banco', order: 'alpha', separator: ' ' },
Собранный script.js работает как есть: вставьте его в модульный скрипт любой страницы или откройте рецепт на CodePen. Папка рецепта на GitHub ↗ (открывается в новой вкладке)
Варианты
#Напечатайте ответы для учителя
Тот же Markdown даёт экземпляр учителя: все пропуски заполнены, верные утверждения отмечены, а верные слова обведены пурпурным.
exerciseStyles: [actividad, cuadricula],
+ exercises: { edition: 'teacher' },#Нумеруйте упражнения в квадратах
Скруглённый квадрат цвета урока читается как стиль другого издательства.
- number: { shape: 'disc', background: col('unit'), color: col('paper'),
+ number: { shape: 'rounded', background: col('unit'), color: col('paper'),Частые ошибки
- Слова для обводки внутри текста оставляют с каждой стороны немного места для кольца, поэтому слово прямо перед запятой или точкой стоит от неё чуть дальше.
Источники и лицензии
- Рецепт
- Ignacio Ferro
- Текст
- Оригинальный текст, CC BY 4.0
- Изображения
- Animals at a pond: a frog, a kingfisher, a trout, a turtle and a rabbit. · Generated With Diffusion Models · оригинал
- Five stages of a frog's life, in a jumbled order. · Generated With Diffusion Models · оригинал
- A girl with a magnifying glass watching a sparrow and a lizard on a wall. · Generated With Diffusion Models · оригинал
- Шрифты
- Atkinson Hyperlegible Next (SIL OFL 1.1) · Grandstander (SIL OFL 1.1)
Изменить описание рецепта ↗ (открывается в новой вкладке)Папка рецепта на GitHub ↗ (открывается в новой вкладке)


