Коротко
Двухстраничный рабочий лист по естествознанию и математике о круговороте воды, сделанный десять раз. Вопросы одни и те же; номера, поля для ответов, линейки и деление столбиком такие, как в учебниках каждой страны.
Что получится
Рабочий лист 7 курса естествознания и математики для четвёртого класса, Water on the move («Вода в движении»), в десяти изданиях. Вопросы одинаковы на всех языках: выбрать ответ, отметить верное или неверное, заполнить пропуски из банка слов, соединить слова со значениями, обвести слово, разделить воду в баке, объяснить, зачем её беречь. Каждое издание печатает их так, как принято в его школах. Испанский и каталанский листы ставят номер в кружок, отмечают V или F и делят с делителем в уголке справа от делимого. Французский берёт квадратики, cases à cocher, пропуски точками и бумагу Seyès для ответа. Немецкий пишет R и F, Lückentext и 864 : 4 = в одну строку, а умножение точкой. Бразильский просит V или F в скобках перед утверждением. Английский делит под скобкой ⟌. Китайский нумерует разделы 一、二、, ставит ( ) после каждого вопроса, а A. B. C. в ряд, просит √ или × и кончается заданием 看拼音,写词语 с двумя клетками 田字格 на слово. Японский предлагает ア イ ウ и ○ ×, арабский идёт справа налево с أ ب ج и صح или خطأ.
Рецепт отвечает на вопросы
- Как набрать один рабочий лист так, как набирают упражнения в учебниках каждой страны?
- Как набрать деление столбиком так, как его записывают в школах каждой страны?
- Как набрать китайские тестовые вопросы: скобка ( ) после условия и варианты A. B. C. D. в ряд?
Короткий ответ
// The Markdown of every edition has the same seven exercises. What changes is this table:
// how the number prints, how options are labelled and answered, how true/false reads, where
// a blank is written, the paper of the open answer and the layout of long division.
const disc = { shape: 'disc' };
const square = { shape: 'square' };
const bare = { shape: 'none', suffix: '.' };
const TRADITIONS = {
es: { number: disc, options: { marker: 'none' }, trueFalse: { look: 'boxes' },
blank: { look: 'line' }, area: { kind: 'lines' }, arithmetic: { division: 'potence' } },
fr: { number: square, options: { marker: 'box' }, trueFalse: { look: 'boxes' },
blank: { look: 'dots' }, area: { kind: 'seyes', spacing: mm(8) },
arithmetic: { division: 'potence' } },
de: { number: square, options: { marker: 'box' }, trueFalse: { look: 'boxes' },
blank: { look: 'line' }, area: { kind: 'lines' }, arithmetic: { division: 'inline' } },
it: { number: { shape: 'rounded' }, options: { marker: 'box' }, trueFalse: { look: 'boxes' },
blank: { look: 'dots' }, area: { kind: 'lines' }, arithmetic: { division: 'potence' } },
pt: { number: bare, options: { marker: 'none' }, trueFalse: { look: 'bracket', place: 'start' },
blank: { look: 'line' }, area: { kind: 'lines' }, arithmetic: { division: 'potence' } },
en: { number: bare, options: { marker: 'none' }, trueFalse: { look: 'boxes' },
blank: { look: 'line' }, area: { kind: 'lines' }, arithmetic: { division: 'bracket' } },
// 一、二、 sections; ( ) after the stem and A. B. C. in a row; √ × in a bracket; 田字格.
zh: { number: { shape: 'none', format: 'simp-chinese-informal', suffix: '、' },
options: { labels: 'alpha-upper', suffix: '.', layout: 'row', bracket: true },
trueFalse: { look: 'bracket' }, blank: { look: 'line' },
// 15 mm squares: a word's two and the square after it span a quarter of the measure, so
// the pinyin in four columns stands over its 田字格 (cells="2 2 2 2").
area: { kind: 'tianzige', spacing: mm(15), lines: 1 }, arithmetic: { division: 'bracket' } },
// ア イ ウ in a row with ( ), ○ × in a bracket, the number in a square.
ja: { number: square, options: { labels: 'katakana', suffix: '', layout: 'row', bracket: true },
trueFalse: { look: 'bracket' }, blank: { look: 'line' }, area: { kind: 'lines' },
arithmetic: { division: 'bracket' } },
ar: { number: disc, options: { marker: 'none', prefix: '(', suffix: ')' },
trueFalse: { look: 'boxes' },
blank: { look: 'dots' }, area: { kind: 'lines' }, arithmetic: { division: 'bracket' } },
};
TRADITIONS.ca = TRADITIONS.es; // Catalan schools set exercises as Spanish ones do
Ингредиенты
- Возможности
- Стили упражненийДействия в столбикВыбор ответа, «верно/неверно»УпражненияПропуски и банки словСоединение и сортировкаОткрытые вопросы и место для ответаОформленные начальные полосыАтрибуты заголовковСемантическая палитраКитайские, японские и корейские шрифтыАрабские шрифтыКниги с переплётом справаТекст справа налевоПеренос слов и язык документаСтраницы на холстеЭкспорт в PDF
- Также применяет
- ОтветыСтили абзацевШрифты, встроенные в PDF
- Шрифты
- Nunito, Baloo 2, Noto Serif SC, Noto Sans SC, Klee One, Noto Sans JP, Noto Naskh Arabic, Baloo Bhaijaan 2 (SIL OFL 1.1)
- Материалы
- Нет: все иллюстрации рисует код
Порядок работы
#1 · Запишите каждую традицию в таблицу
// The Markdown of every edition has the same seven exercises. What changes is this table:
// how the number prints, how options are labelled and answered, how true/false reads, where
// a blank is written, the paper of the open answer and the layout of long division.
const disc = { shape: 'disc' };
const square = { shape: 'square' };
const bare = { shape: 'none', suffix: '.' };
const TRADITIONS = {
es: { number: disc, options: { marker: 'none' }, trueFalse: { look: 'boxes' },
blank: { look: 'line' }, area: { kind: 'lines' }, arithmetic: { division: 'potence' } },
fr: { number: square, options: { marker: 'box' }, trueFalse: { look: 'boxes' },
blank: { look: 'dots' }, area: { kind: 'seyes', spacing: mm(8) },
arithmetic: { division: 'potence' } },
de: { number: square, options: { marker: 'box' }, trueFalse: { look: 'boxes' },
blank: { look: 'line' }, area: { kind: 'lines' }, arithmetic: { division: 'inline' } },
it: { number: { shape: 'rounded' }, options: { marker: 'box' }, trueFalse: { look: 'boxes' },
blank: { look: 'dots' }, area: { kind: 'lines' }, arithmetic: { division: 'potence' } },
pt: { number: bare, options: { marker: 'none' }, trueFalse: { look: 'bracket', place: 'start' },
blank: { look: 'line' }, area: { kind: 'lines' }, arithmetic: { division: 'potence' } },
en: { number: bare, options: { marker: 'none' }, trueFalse: { look: 'boxes' },
blank: { look: 'line' }, area: { kind: 'lines' }, arithmetic: { division: 'bracket' } },
// 一、二、 sections; ( ) after the stem and A. B. C. in a row; √ × in a bracket; 田字格.
zh: { number: { shape: 'none', format: 'simp-chinese-informal', suffix: '、' },
options: { labels: 'alpha-upper', suffix: '.', layout: 'row', bracket: true },
trueFalse: { look: 'bracket' }, blank: { look: 'line' },
// 15 mm squares: a word's two and the square after it span a quarter of the measure, so
// the pinyin in four columns stands over its 田字格 (cells="2 2 2 2").
area: { kind: 'tianzige', spacing: mm(15), lines: 1 }, arithmetic: { division: 'bracket' } },
// ア イ ウ in a row with ( ), ○ × in a bracket, the number in a square.
ja: { number: square, options: { labels: 'katakana', suffix: '', layout: 'row', bracket: true },
trueFalse: { look: 'bracket' }, blank: { look: 'line' }, area: { kind: 'lines' },
arithmetic: { division: 'bracket' } },
ar: { number: disc, options: { marker: 'none', prefix: '(', suffix: ')' },
trueFalse: { look: 'boxes' },
blank: { look: 'dots' }, area: { kind: 'lines' }, arithmetic: { division: 'bracket' } },
};
TRADITIONS.ca = TRADITIONS.es; // Catalan schools set exercises as Spanish ones do
Markdown у всех изданий один: семь блоков :::exercise, ответы которых стоят в тексте (- [x], [[vapour]], - Evaporation -> Water turns into vapour, - 864 ÷ 4). Книги разных стран различаются формой, поэтому она живёт в этой таблице и больше нигде: вид номера и цифры, метки вариантов и что делает ученик, ставит галочку или обводит букву, вид «верно или неверно», вид пропуска, место для письма и раскладка деления столбиком. Каталанский берёт испанскую строку без изменений.
#2 · Наложите традицию на общий стиль
const T = TRADITIONS[LANG];
const ficha = {
id: 'ficha', ...T,
number: { background: col('accent'), color: T.number.shape === 'none' ? col('accent')
: col('paper'), fontFamily: LABEL, fontWeight: 700, ...T.number },
// Chinese and Japanese sheets set the instructions in the gothic (黑体, ゴシック).
instruction: { bold: true, color: col('ink'), ...(LANG === 'zh' || LANG === 'ja'
? { fontFamily: LABEL } : {}) },
blank: { color: col('ink'), weight: pt(0.7), ...T.blank },
match: { look: 'dots', gap: em(5), color: col('accent') },
bank: { order: 'alpha' },
area: { color: col('rule'), spacing: mm(9), weight: pt(0.6), ...T.area },
grid: { cell: mm(8.5), fontFamily: TEXT, rule: col('rule'), color: col('ink') },
marginTop: mm(7), marginBottom: mm(1), itemSpacing: em(0.4),
};
Один стиль упражнений, ficha, несёт общее для всех десяти листов (синий цвет номеров, серые линейки, просвет между упражнениями), а строка издания накладывается поверх. То, чего в строке нет, приходит из языка: T F, V F, R F, √ ×, ○ × и صح خطأ — слова самого движка, как и a) b) c), A. B. C., ア イ ウ и أ ب ج, поэтому ни одно издание их не пишет.
#3 · Дайте каждой письменности её гарнитуры
const FACES = {
zh: { text: 'Noto Serif SC', label: 'Noto Sans SC' },
ja: { text: 'Klee One', label: 'Noto Sans JP' },
ar: { text: 'Noto Naskh Arabic', label: 'Baloo Bhaijaan 2' },
}[LANG] ?? { text: 'Nunito', label: 'Baloo 2' };
const [TEXT, LABEL] = [FACES.text, FACES.label];
У латинских изданий общие гарнитуры Nunito и Baloo 2. Китайский лист набирает текст шрифтом сун, а указания хэй; японский — текст Klee One, учебной гарнитурой, а указания готическим шрифтом; арабский берёт Noto Naskh Arabic. Самое жирное начертание Klee One — 600, поэтому японское издание набирает жирное в 600 (boldFontWeight): 700 нарисовал бы браузер, и съёмка завершилась бы ошибкой.
#4 · Поставьте вверху листа линейки для имени
const at = (to, edge, x = 0, y = 0, size) => ({ anchor: { to, edge },
offset: { x: mm(x), y: mm(y) }, ...(size && { size }) });
const field = (id, attr, x, width) => [
{ kind: 'text', id, content: `{attr.${attr}}`, fontFamily: LABEL, fontSize: pt(10),
fontWeight: 700, color: col('muted'), align: 'left', placement: at('container', 'top-left',
x, 28) },
{ kind: 'rule', id: `${id}-line`, direction: 'horizontal', thickness: pt(0.75),
color: col('rule'), placement: at('container', 'top-left', x + 16, 33, { width: mm(width) }) },
];
const head = { enabled: true, minHeight: mm(38), slot: { elements: [
{ kind: 'box', id: 'band', style: { backgroundColor: col('accent'), borderRadius: mm(3) },
placement: at('container', 'top-left', 0, 0, { width: 'fill', height: mm(21) }) },
{ kind: 'text', id: 'kicker', content: '{title} · {subtitle}', fontFamily: LABEL,
fontSize: pt(8.5), fontWeight: 700, color: col('tint'), align: 'left',
placement: at('container', 'top-left', 6, 3.5) },
{ kind: 'text', id: 'title', content: '{titleText}', fontFamily: LABEL, fontSize: pt(22),
fontWeight: 700, color: col('paper'), align: 'left', lineHeight: 1.1,
placement: at('container', 'top-left', 6, 9.5) },
...field('name', 'nombre', 0, 96), ...field('date', 'fecha', 120, 40),
] } };
Заголовок первого уровня рисует полосу, название курса из метаданных и заголовок, а также два поля с линейкой, слова которых берутся из атрибутов заголовка (nombre="Name" fecha="Date"), поэтому немецкий лист пишет Datum, а японский 名前 без единой строки в коде.
Рецепт целиком
// ═══ Postext Cookbook · Nº 169 · One worksheet in ten school traditions ═════════
// https://postext.dev/en/cookbook/school-traditions-worksheet
// Code: MIT · Text: original (CC BY 4.0) · Pictures: none
// Fonts: Nunito, Baloo 2, Klee One, Noto Naskh Arabic and others (SIL OFL) · Needs postext ≥ 1.63.0
import {
buildDocument, withLoadedFonts, renderPageToCanvas,
} from 'https://esm.sh/postext';
import { renderToPdf, decompressWoff2 } from 'https://esm.sh/postext-pdf';
const LANG = 'en'; // @lang: the language of the worksheet (en es ca fr de it pt zh ja ar)
const RECIPE = 'school-traditions-worksheet';
// ─── 1 · Design ─────────────────────────────────────────────────────────────
// #region palette: a blue-black ink, one blue accent, a pale tint, grey rules
const palette = {
ink: '#1d2633', accent: '#2a5d9f', tint: '#e8f0fa', rule: '#a9b6c6', muted: '#5d6878',
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: 'accent (defaults)', value: { hex: palette.accent, model: 'hex' } },
];
// #endregion
// #region faces: Latin editions share two faces; Chinese, Japanese and Arabic their own
const FACES = {
zh: { text: 'Noto Serif SC', label: 'Noto Sans SC' },
ja: { text: 'Klee One', label: 'Noto Sans JP' },
ar: { text: 'Noto Naskh Arabic', label: 'Baloo Bhaijaan 2' },
}[LANG] ?? { text: 'Nunito', label: 'Baloo 2' };
const [TEXT, LABEL] = [FACES.text, FACES.label];
// #endregion
// #region answer: the form of the exercises, as each country's school books set them
// The Markdown of every edition has the same seven exercises. What changes is this table:
// how the number prints, how options are labelled and answered, how true/false reads, where
// a blank is written, the paper of the open answer and the layout of long division.
const disc = { shape: 'disc' };
const square = { shape: 'square' };
const bare = { shape: 'none', suffix: '.' };
const TRADITIONS = {
es: { number: disc, options: { marker: 'none' }, trueFalse: { look: 'boxes' },
blank: { look: 'line' }, area: { kind: 'lines' }, arithmetic: { division: 'potence' } },
fr: { number: square, options: { marker: 'box' }, trueFalse: { look: 'boxes' },
blank: { look: 'dots' }, area: { kind: 'seyes', spacing: mm(8) },
arithmetic: { division: 'potence' } },
de: { number: square, options: { marker: 'box' }, trueFalse: { look: 'boxes' },
Собранный script.js работает как есть: вставьте его в модульный скрипт любой страницы или откройте рецепт на CodePen. Папка рецепта на GitHub ↗ (открывается в новой вкладке)
Варианты
#Напечатайте экземпляр учителя
Каждый ответ встаёт на своё место пурпурным: скобки, рамки, пропуски и частное.
exerciseStyles: [ficha],
+ exercises: { edition: 'teacher' },#Соберите ответы внизу листа
placement: 'after' ставит ключ каждого упражнения под ним, а 'inverted' переворачивает его, как на страницах головоломок.
+ exercises: { solutions: { placement: 'inverted', layout: 'key' } },Частые ошибки
- Если у гарнитуры нет начертания 700, жирные номера вопросов будут синтезированы. Дайте такой текстовой гарнитуре
boldFontWeightс насыщенностью, которая у неё есть. - ○ японских указаний и √ китайских есть только в гарнитурах CJK: ставьте их в предложение текста CJK, а не в латинскую метку.
Источники и лицензии
- Рецепт
- Ignacio Ferro
- Текст
- Оригинальный текст, CC BY 4.0
- Шрифты
- Nunito (SIL OFL 1.1) · Baloo 2 (SIL OFL 1.1) · Noto Serif SC (SIL OFL 1.1) · Noto Sans SC (SIL OFL 1.1) · Klee One (SIL OFL 1.1) · Noto Sans JP (SIL OFL 1.1) · Noto Naskh Arabic (SIL OFL 1.1) · Baloo Bhaijaan 2 (SIL OFL 1.1)
Изменить описание рецепта ↗ (открывается в новой вкладке)Папка рецепта на GitHub ↗ (открывается в новой вкладке)


