انتقل إلى المحتوى الرئيسي
الوصفة رقم 171

دليل الوصفات · الفصل 12 · الكتب المدرسية

كراسة تمارين صينية للتلميذ وللمعلّم

كراسة 练习册 في اللغة والرياضيات: أقسام 一、二、، وأقواس ( )، ومربعات 田字格، وعمليات في أعمدة، منضّدة مرتين من نص واحد، للتلميذ وللمعلّم.

في هذه الصفحة
المُخرَج
Canvas · PDF
المستوى
متوسط
Postext
اختُبرت مع Postext 1.59.0
تتطلب ≥ 1.59.0 · postext-pdf ≥ 1.59.0
الترخيص
حُدّثت في 24 أكتوبر 2026
الشيفرة MIT · النص CC BY 4.0
  • نموذج بلغة أجنبية: لا توجد طبعة عربية بعد
  • مقاس القص 184 × 260 مم
  • عمود واحد
  • Noto Serif SC 10.5/21
  • LXGW WenKai TC
  • Noto Sans SC
  • 8 صفحات
  • المستوى
  • Postext 1.59.0
  • أُخرجت في 124 ms
  • أسطر الشيفرة: 162

باختصار

كراسة تمارين من مدرسة ابتدائية صينية: وحدتان في اللغة والرياضيات. يعطي النص نفسه نسخة التلميذ، بفراغات وحلول في آخرها، ونسخة المعلّم، وفيها كل جواب مكتوب بالأحمر في مكانه.

ما الذي ستنضده

وحدتان من 练习册 للصف الثاني بقياس 16开: وحدة لغة، 春天来了، ووحدة رياضيات في الجمع والطرح حتى 100. تبدأ كل وحدة بشريط من لوحة مائية، ولسان باسم المادة، وسطر للصف والاسم والدرجة، ثم تأتي الأقسام التي تطبعها كراسة صينية: 看拼音写词语، وقراءات يُحاط الصحيح منها بدائرة، و选择题 فيها ( ) بعد نص السؤال والخيارات A. B. C. D. في صف واحد، و判断题 بقوسين في آخر السطر، وفراغات، و连线 بين ألفاظ العدّ والأشياء، وجملة تُكتب في 田字格، و口算 في أربعة أعمدة، و竖式 بمربع لكل رقم، ومسألة. الدرجات مكتوبة في تعليمات كل قسم، حيث يقرؤها التلميذ. ويُنضَّد ملف Markdown نفسه مرتين: كتاب التلميذ، وفي آخر كل وحدة 参考答案، وكتاب المعلّم، وفيه كل جواب مكتوب بخط Kai أحمر في مكانه.

تجيب هذه الوصفة عن

  • كيف أصفّ أسئلة اختبار صينية: قوسان ( ) بعد السؤال والخيارات A. B. C. D. في صف؟
  • كيف أُخرج طبعة المعلم بالإجابات في مواضعها من كتاب التلميذ؟
  • كيف أعطي سؤالًا مفتوحًا تسطير Seyès أو ورق مربعات أو مربعات 田字格 للكتابة؟
  • كيف أصفّ القسمة الطويلة كما تكتبها مدارس كل بلد؟

الجواب المختصر

script.js · الأسطر 36–65في الشيفرة الكاملة
// The exercise style is the form; the Markdown holds every word, the points included. The
// same text builds both editions: `edition: 'teacher'` writes each answer into its blank,
// bracket and square in red Kai, rings the right options and draws the matching lines.
const lianxi = {
  id: 'lianxi',
  number: { format: 'simp-chinese-informal', suffix: '、', fontFamily: HEI, color: col('green') },
  instruction: { fontFamily: HEI, bold: false }, // 黑体, not bold: the points stay quiet
  // 选择题: A. B. C. D. in a row, a ( ) after the stem for the letter.
  options: { labels: 'alpha-upper', suffix: '.', layout: 'row', bracket: true },
  trueFalse: { look: 'bracket' }, // 判断题: ( ) at the end of the line, √ or ×
  blank: { look: 'line', color: col('ink') },
  area: { kind: 'tianzige', color: col('rule') }, // 写话 on 田字格
  match: { color: col('green') },
  grid: { fontFamily: SONG, rule: col('rule') },
  answers: { color: col('red'), fontFamily: KAI },
  solutions: { box: 'daan' },
  marginTop: em(1.2), marginBottom: em(0.6),
};
const exerciseStyles = [
  lianxi,
  // 看拼音写词语: a box under each syllable, as wide as its word.
  { id: 'pinyin', extends: 'lianxi', blank: { look: 'box', width: 'answer', color: col('rule') } },
  // 在( )里填: the bracket is in the text, the blank inside it draws nothing.
  { id: 'kuohao', extends: 'lianxi', blank: { look: 'none', width: 'answer' } },
];
let edition = 'student'; // the second build below prints the teacher's book
// The pupil's book: 参考答案 where a :::solutions line stands, at the end of each unit.
// The teacher's book: every answer on the page, so no key at the end.
const exercises = () => ({ edition,
  solutions: { placement: edition === 'teacher' ? 'none' : 'directive' } });

المكونات

الخطوط
Noto Serif SC, Noto Sans SC, LXGW WenKai TC (SIL OFL 1.1)
الأصول
  • market-1600.jpg
  • spring-1600.jpg
  • A Chinese village in early spring: willows, swallows, peach blossom and two children on a path between rice fields. (Generated With Diffusion Models, أصلي)
  • Two children count oranges, apples and pears at a grandmother's fruit stall, a cat on a stool beside them. (Generated With Diffusion Models, أصلي)

طريقة التحضير

#1 · نمط واحد لكل الأقسام

الشيفرة في الجواب المختصر أعلاه. تُعدّ الأقسام بأرقام صينية يليها 、 بعرض كامل، فلا تأتي بعد الرقم مسافة؛ وتُنضَّد التعليمات بخط Hei غير عريض، حتى تُقرأ الدرجات بين القوسين جزءًا منها. يكتب options.bracket القوسين ( ) بعد كل سؤال، وفي كتاب المعلّم يدخلهما الحرف الصحيح. والنمطان الصغيران يوسّعان النمط الرئيسي: يرسم pinyin كل فراغ مربعًا بعرض كلمته، ولا يرسم kuohao شيئًا، لأن قوسي 在( )里填 موجودان في النص.

#2 · كتاب التلميذ وكتاب المعلّم من نص واحد

script.js · الأسطر 334–338في الشيفرة الكاملة
const build = () => withLoadedFonts(() => buildDocument({ markdown, resources }, config()),
  { ...kitFonts(FONTS), text: markdown });
const pupil = await build();
edition = 'teacher';
const docs = [pupil, await build()];

الإعداد دالة، فيأخذ كل تنضيد كائنه الخاص، وتحفظ حزمة Sandbox كائن كتاب التلميذ. يكتب edition: 'teacher' الأجوبة بلون answers وخطه: الكلمات في مربعاتها، والحروف في أقواسها، و√ و× في 判断题، والأرقام في خانات 竖式، والجملة النموذجية بحرف واحد في كل مربع. ويطبع كتاب التلميذ الحلول حيث يقع سطر :::solutions في آخر كل وحدة؛ أما كتاب المعلّم فلا يحتاج إليها.

#3 · افتتاحية وحدة بلوحتها

script.js · الأسطر 69–87في الشيفرة الكاملة
const BAND = 184 / 2.4; // mm: the painting's height at the page's width
const opener = { enabled: true, minHeight: mm(BAND - 22 + 23), slot: { elements: [
  { kind: 'image', id: 'picture', resourceId: '{attr.pic}', decorative: true, reserve: false,
    placement: { anchor: { to: 'page', edge: 'top-left' },
      size: { width: mm(184), height: mm(BAND) } } },
  { kind: 'text', id: 'subject', content: '{attr.kicker}', fontFamily: HEI, fontSize: pt(11),
    fontWeight: 700, color: col('paper'), letterSpacing: pt(2), align: 'center',
    box: { backgroundColor: col('green'), borderRadius: mm(1.5),
      padding: { top: mm(0.8), bottom: mm(0.8), left: mm(2.4), right: mm(2) } },
    placement: { anchor: { to: 'container', edge: 'top-left' },
      offset: { x: mm(0), y: mm(BAND - 22 + 6) } } },
  { kind: 'text', id: 'title', content: '{titleText}', fontFamily: HEI, fontSize: pt(24),
    fontWeight: 700, color: col('ink'), align: 'left',
    placement: { anchor: { to: '#subject', edge: 'right-of' },
      offset: { x: mm(4), y: mm(-2.6) } } },
  { kind: 'rule', id: 'rule', direction: 'horizontal', thickness: pt(1.2), color: col('green'),
    placement: { anchor: { to: 'container', edge: 'top-left' },
      offset: { x: mm(0), y: mm(BAND - 22 + 19) }, size: { width: 'fill' } } },
] } };

اللوحة مثبّتة في الصفحة، فتبلغ الحافة العليا في الصفحة الفردية والزوجية على السواء؛ ويوضع لسان المادة والعنوان انطلاقًا من أعلى منطقة النص، تحت أسفل اللوحة. وتشترك الوحدتان في التصميم، ولا تختلفان إلا في سمتي عنوانهما kicker وpic.

#4 · أرقام الصفحات في الأسفل

script.js · الأسطر 91–101في الشيفرة الكاملة
const foot = (id, content, parity, edge, x, extra = {}) => ({ kind: 'text', id, content,
  parity, fontFamily: HEI, fontSize: pt(8), color: col('muted'),
  placement: { anchor: { to: 'page', edge }, offset: { x: mm(x), y: mm(-10) } }, ...extra });
const footer = { elements: [
  foot('folio-v', '{pageNumber}', 'even', 'bottom-left', 16,
    { fontWeight: 700, color: col('green') }),
  foot('series', '{title}', 'even', 'bottom-left', 24),
  foot('unit', '{chapterTitle}', 'odd', 'bottom-right', -24, { align: 'right' }),
  foot('folio-r', '{pageNumber}', 'odd', 'bottom-right', -16,
    { fontWeight: 700, color: col('green'), align: 'right' }),
] };

تضع الكراسات الصينية رقم الصفحة في أسفلها. ويأتي اسم السلسلة من البيانات التمهيدية لملف Markdown ‏({title})، واسم الوحدة من عنوانها ({chapterTitle}).

الوصفة كاملة

Sandbox
// ═══ Postext Cookbook · Nº 171 · A Chinese exercise book, pupil's and teacher's ═══
// https://postext.dev/en/cookbook/chinese-exercise-book
// Code: MIT · Text: original (CC BY 4.0) · Pictures: generated with diffusion models
// Fonts: Noto Serif SC, Noto Sans SC, LXGW WenKai TC (SIL OFL 1.1) · Needs postext ≥ 1.59.0
import {
  buildDocument, withLoadedFonts, renderPageToCanvas, registerResourceImage,
} from 'https://esm.sh/postext';
import { renderToPdf, decompressWoff2 } from 'https://esm.sh/postext-pdf';

const LANG = 'zh'; // @lang: the language of the frame; the exercise book is Chinese in all
const RECIPE = 'chinese-exercise-book';

// ─── 1 · Design ─────────────────────────────────────────────────────────────
// #region palette: a green exercise book, and the red of the teacher's pen
const palette = {
  ink: '#1f2523', // text: a green-tinted near-black
  green: '#2c7350', // the one accent: section numbers, the subject tab, the squares
  red: '#d0352c', // the teacher's answers
  tint: '#e6f2ea', // the subject tab's ground, the answers box
  rule: '#8fb9a2', // 田字格, the matching dots' lines
  muted: '#68736d', // folios, the series line
  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.green, model: 'hex' } },
];
// #endregion
// 宋 for the text, 黑 for the instructions and labels, 楷 for what the teacher writes.
const [SONG, HEI, KAI] = ['Noto Serif SC', 'Noto Sans SC', 'LXGW WenKai TC'];
const CHARS = 40; // characters per line: 40 × 10.5 pt = 148 mm
const SIZE = 10.5; // pt: 五号, the size of a school book's text

// #region answer: sections 一、二、 that print the pupil's book or the teacher's
// The exercise style is the form; the Markdown holds every word, the points included. The
// same text builds both editions: `edition: 'teacher'` writes each answer into its blank,
// bracket and square in red Kai, rings the right options and draws the matching lines.
const lianxi = {
  id: 'lianxi',
  number: { format: 'simp-chinese-informal', suffix: '、', fontFamily: HEI, color: col('green') },
  instruction: { fontFamily: HEI, bold: false }, // 黑体, not bold: the points stay quiet
  // 选择题: A. B. C. D. in a row, a ( ) after the stem for the letter.
  options: { labels: 'alpha-upper', suffix: '.', layout: 'row', bracket: true },
  trueFalse: { look: 'bracket' }, // 判断题: ( ) at the end of the line, √ or ×
  blank: { look: 'line', color: col('ink') },
  area: { kind: 'tianzige', color: col('rule') }, // 写话 on 田字格
  match: { color: col('green') },

يعمل ملف script.js المجمّع كما هو: الصقه في سكربت الوحدة (module) لأي صفحة، أو افتح الوصفة على CodePen. مجلد الوصفة على GitHub ↗ (يفتح في تبويب جديد)

تنويعات

#اطبع الحلول في آخر الفصل

من غير أسطر :::solutions، يجمع chapterEnd حلول كل وحدة قبل العنوان التالي من المستوى الأول.

-  solutions: { placement: edition === 'teacher' ? 'none' : 'directive' } });
+  solutions: { placement: edition === 'teacher' ? 'none' : 'chapterEnd' } });

#اكتب القراءات بجانب الفراغات

يضع كتاب القراءة بالبينيين البينيين فوق حروفه بطريقة ruby، وهذا ما لا يتسع له الفراغ بعد.

أخطاء شائعة

خطأ شائع

الخطوط الصينية تُحمَّل شرائح، عبر الكتلة cjk

يقدّم Fontsource العائلة الصينية أو اليابانية أو الكورية في نحو مئة ملف لكل وزن، يغطي كل منها نطاقًا من الحروف. لا يجلب loadFonts إلا ملف latin، فتأتي حروف الهان على الشاشة من خط النظام وتُقاس خطأً، ويسلّم fontsourceProvider ملف latin ذاك إلى PDF، فيطبعها مربعات فارغة. اذكر كتلة الأدوات cjk، واستدعِ loadCjkFonts(FONTS, markdown) بعد loadFonts (مرة لكل صوت، مع النص الذي يضعه، حين يستخدم الكتاب عدة خطوط CJK)، وأعطِ renderToPdf القيمة fontProvider: cjkPdfProvider: كلاهما يأخذ الملفات التي تحتوي حروف النص. الخطوط الصينية واليابانية والكورية →

  • لا يمكن بعدُ وضع قراءة فوق فراغ: الـruby داخل [[…]] جزء من الجواب المخفي، ومنطقة 田字格 تأخذ عرض السطر كله. لذلك يضع قسم 看拼音写词语 كل مقطع على سطر وحده والمربع تحته، أربعة في كل صف داخل مجموعة :::columns.
  • لا ينضّد خط Kai إلا الأجوبة، فلا يحمّل إلا حروف الفراغات والأجوبة النموذجية؛ وأي حرف ينضّده في موضع آخر يجب أن يُضاف إلى ذلك النص.

الحقوق

الوصفة
Ignacio Ferro
النص
نص أصلي, CC BY 4.0
الصور
  • A Chinese village in early spring: willows, swallows, peach blossom and two children on a path between rice fields. · Generated With Diffusion Models · أصلي
  • Two children count oranges, apples and pears at a grandmother's fruit stall, a cat on a stool beside them. · Generated With Diffusion Models · أصلي
الخطوط
Noto Serif SC (SIL OFL 1.1) · Noto Sans SC (SIL OFL 1.1) · LXGW WenKai TC (SIL OFL 1.1)
الشيفرة
MIT، مثل Postext
Sandbox