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

دليل الوصفات · الفصل 3 · العناوين وصفحات الافتتاح

تحقيق مجلة: من صورة الافتتاح إلى علامة النهاية

صفحة افتتاح واحدة بـadvancedDesign تضع صورة بنزف والعنوان التمهيدي والعنوان والموجز والتوقيع من سطر العنوان؛ ثم إطاران عائمان وعلامة نهاية من شارة.

في هذه الصفحة
  • نموذج باللغة الإنجليزية: لا توجد طبعة عربية بعد
  • مقاس القص 225 × 297 مم
  • عمودان, فاصل 6 مم بين الأعمدة
  • Literata 9.6/13.4
  • Instrument Sans
  • Instrument Serif
  • 4 صفحات
  • المستوى
  • Postext 1.57.1
  • أُخرجت في 113 ms
  • أسطر الشيفرة: 240

باختصار

تحقيق في مجلة عن الطبيعة يبدأ بصورة كبيرة على أعلى الصفحة. يبيّن كيف ترتّب العنوان والمقدمة القصيرة واسم الكاتب واسم المصوّر، ثم الإطارات الجانبية وعلامة صغيرة في النهاية.

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

قسم التحقيقات في العدد الشتوي من Boreal، وهي مجلة عن الطبيعة، على صفحة مقاسها 225 × 297 mm. يبدأ التحقيق تحت صورة بحيرة جبلية تنزف على أعلى الصفحة. تحت الصورة يعلو عنوانٌ تمهيدي متباعد الحروف عنوانًا من سطرين، وعلى يمينه موجز بالمائل وتحته التوقيع؛ واسم المصوّر يجري تحت الصورة. العنوان هو نص عنوان Markdown، أما العنوان التمهيدي والموجز والتوقيع واسم المصوّر فسماته. يستمر التحقيق على صفحتين متقابلتين في عمودين مضبوطين. في الصفحة الزوجية اقتباس بارز بعلامة تنصيص معلّقة، وإطار حقائق في رأس العمود الأيمن؛ وفي الصفحة الفردية شريط من غابة صنوبر في الأعلى ولوحة أرقام داكنة في الأسفل. ومربع صغير يختم التحقيق. وفي ظهر الورقة يعيد دليل ميداني استعمال تصميم الافتتاح مع رسم وعنوان تمهيدي بلون الصدأ.

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

  • كيف أضيف إلى صفحة الافتتاح سطر المؤلف أو مقدمة تمهيدية أو فقرة أولى بحرف استهلالي؟
  • كيف أعطي كل فصل صورته أو لونه أو شكل افتتاحه الخاص؟
  • كيف أنضد نصًّا تصديريًّا أو إهداءً أو توقيعًا أو اقتباسًا بارزًا بعلامة اقتباس كبيرة؟

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

script.js · الأسطر 40–77في الشيفرة الكاملة
const TOP = 22; // top margin in mm: an opener's container starts here
const sans = { fontFamily: 'Instrument Sans', fontWeight: 600, textTransform: 'uppercase' };
const HEAD = 118; // mm: the headline's measure; the standfirst takes the rest of the line
// Empty padding paints nothing but counts: the story starts on the first grid line at least
// 5 mm under the lower of the headline and the byline, however many lines each one runs to.
const air = { padding: { bottom: mm(5) } };
const at = (id, edge, x, y, width) => ({ anchor: { to: id, edge },
  offset: { x: mm(x), y: mm(y) }, ...(width && { size: { width: mm(width) } }) });
const opener = (resourceId, depth) => ({ // depth: how far down the page the picture bleeds
  enabled: true, // no minHeight: the story starts under the headline and byline (see air)
  slot: {
    elements: [ // the photo is an element, not a float: no float reaches the trim
      { kind: 'image', id: 'photo', resourceId, placement: { anchor: { to: 'bleed',
        edge: 'top-left' }, size: { width: 'fill', height: mm(depth) } } },
      // The photo hangs from the page's top edge, the words from the container, TOP mm lower:
      // depth − TOP is the photo's foot, so the credit sits 2 mm under it and the kicker 9 mm.
      { kind: 'text', id: 'credit', content: '{attr.credit}', ...sans, fontWeight: 500,
        fontSize: pt(6.5), letterSpacing: pt(0.6), color: col('muted'), align: 'right',
        placement: at('container', 'top-right', 0, depth - TOP + 2) },
      { kind: 'text', id: 'kicker', content: '{attr.kicker}', ...sans, fontSize: pt(8.5),
        letterSpacing: pt(1.7), color: col('lake'), align: 'left',
        placement: at('container', 'top-left', 0, depth - TOP + 9) },
      { kind: 'text', id: 'headline', content: '{titleText}', fontFamily: 'Instrument Serif',
        fontSize: pt(58), color: col('ink'), align: 'left', box: air, // wraps: a heading design
        lineHeight: 0.94, // tight: the two lines of the headline nearly touch
        placement: at('#kicker', 'below', 0, 2.5, HEAD) },
      { kind: 'text', id: 'standfirst', content: '{attr.standfirst}', italic: true,
        fontFamily: 'Instrument Serif', fontSize: pt(13.5), lineHeight: 1.22, // a multiple
        color: col('ink'), align: 'left',
        placement: at('#headline', 'right-of', 7, 3.2) }, // wraps at the container's edge
      { kind: 'text', id: 'byline', content: '{attr.byline}', ...sans, fontSize: pt(7.5),
        letterSpacing: pt(1.3), color: col('ink'), align: 'left', box: air,
        placement: at('#standfirst', 'below', 0, 3.5) },
    ],
  },
}); // hook-up: headings.levels[0] = { level: 1, span: 'page', breakBefore, advancedDesign:
// opener('lake', 160) }. {titleText} prints the heading's text, {attr.<key>} its <key>="…":
// # The Lake That Keeps Time {kicker="…" standfirst="…" byline="…" credit="…"}

المكونات

الخطوط
Literata, Instrument Serif, Instrument Sans (SIL OFL 1.1)
الأصول
  • lake-2000.jpg
  • thaw-2000.jpg
  • Clouds mirrored in a mountain lake (the opener photograph) (Ales Krivec, CC0 1.0)
  • Walk in a thawing forest (the photo band) (Hannah Donze, CC0 1.0)

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

#1 · ابنِ الافتتاحية من سطر العنوان

الشيفرة في الجواب المختصر أعلاه. كل {attr.<key>} يطبع القيمة <key>="…" من سطر # الخاص بالتحقيق، و{titleText} يطبع العنوان نفسه (سمات العناوين)، فيحتفظ كل تحقيق بكلماته في ملف Markdown الخاص به، وتتشارك كل عناوين المستوى الأول تصميمًا واحدًا. تتدلّى الصورة من الحافة العليا للصفحة ويبدأ الحاوي أدنى منها بـ22 mm، فيكون depth - TOP الحافة السفلى للصورة مقيسة من الحاوي؛ ويقع اسم المصوّر على بعد 2 mm تحت ذلك الخط في أعلى اليمين، والعنوان التمهيدي على بعد 9 mm تحته في أعلى اليسار. يأتي العنوان below العنوان التمهيدي، على عرض HEAD البالغ 118 mm. ويأتي الموجز right-of العنوان بلا عرض خاص به، فيلتفّ عند حافة الحاوي، ويأتي التوقيع below الموجز، فإذا طال الموجز دفع التوقيع إلى الأسفل بدل أن يصطدم به. ليس للمستوى minHeight. العنوان والتوقيع ينتهي كل منهما بحشوة فارغة قدرها 5 mm تُحسب من ارتفاع تصميم الافتتاح، فيبدأ التحقيق على أول خط في الشبكة يقع على بعد 5 mm على الأقل تحت أيهما ينتهي أدنى، مهما بلغ عدد أسطر كل منهما.

#2 · صرّح بالصور مرة واحدة، بأبعادها الحقيقية بالبكسل

script.js · الأسطر 205–236في الشيفرة الكاملة
// The pictures are not numbered: their own type, with an empty caption prefix and template,
// keeps a figure number off the pine wood's caption.
const photoType = { id: 'photo', name: t({ en: 'Photograph', es: 'Fotografía' }),
  shortLabel: t({ en: 'photo', es: 'foto' }), captionPrefix: '', numberingTemplate: '',
  resetOn: 'never', counterFormat: 'decimal' };
const PX = 10; // the drawing's pixels per mm
const resources = [
  { id: 'lake', typeId: 'photo', kind: 'bitmap', createdAt: 0, updatedAt: 0, // never cited:
    // the opener fits it inside its box, so the JPEG is cropped to the box, 225 × 160 mm
    bitmap: { fileId: 'lake-2000.jpg', format: 'jpeg', width: 2000, height: 1422 },
    altText: t({ en: 'A still mountain lake mirroring clouds between autumn slopes.',
      es: 'Un lago de montaña en calma que refleja las nubes entre laderas otoñales.' }) },
  { id: 'thaw', typeId: 'photo', kind: 'bitmap', createdAt: 0, updatedAt: 0,
    // Pixels at the page's 150 dpi (gotcha: bitmap-print-size): 2000 px make 339 mm, so the
    // band shrinks to the 195 mm measure. At 300 dpi it would print 169 mm wide.
    bitmap: { fileId: 'thaw-2000.jpg', format: 'jpeg', width: 2000, height: 944 },
    // A top float opens the page after its ::resource line (gotcha: top-float-next-page):
    // the line sits on the verso, so the band heads the recto.
    placement: { position: 'top', span: 'page' },
    caption: t({ en: 'Early March in the pine wood above the shore: the snow goes first where '
      + 'the sun reaches the ground, weeks before the ice lets go of the lake.',
    es: 'Principios de marzo en el pinar sobre la orilla: la nieve se retira primero donde el '
      + 'sol llega al suelo, semanas antes de que el hielo suelte el lago.' }),
    note: t({ en: 'Photograph: Hannah Donze, CC0, via Wikimedia Commons',
      es: 'Fotografía: Hannah Donze, CC0, vía Wikimedia Commons' }),
    altText: t({ en: 'A walker on a snowy path between tall pines.',
      es: 'Un caminante en un sendero nevado entre pinos altos.' }) },
  { id: 'ice-art', typeId: 'photo', kind: 'svg', createdAt: 0, updatedAt: 0, // drawn below
    svg: { fileId: 'ice-art.svg', width: TRIM * PX, height: ART * PX },
    altText: t({ en: 'A lake in section: snow, white ice, black ice and water under a low sun.',
      es: 'Un lago en sección: nieve, hielo blanco, hielo negro y agua bajo un sol bajo.' }) },
];

عنصر التصميم يحدّد صورته بمعرّف المورد، لذلك يُصرَّح بصورة الافتتاح كأي شكل لكن لا يُستشهد بها أبدًا: تصميم الافتتاح وحده يرسمها، حتى حدّ القص، حيث لا يصل أي عنصر عائم. تُقاس الصور النقطية بدقة الصفحة البالغة 150 dpi، فتصنع صورة غابة الصنوبر ببكسلاتها الألفين 339 mm، وتنكمش إلى عرض السطر البالغ 195 mm، أي نحو 260 dpi في الطباعة. للصور نوع خاص بها، ببادئة تعليق فارغة وقالب ترقيم فارغ، فليس في تعليق غابة الصنوبر رقم شكل. الشريط عنصر عائم top بعرض الصفحة، والعنصر العائم في الأعلى يفتتح الصفحة التي تلي الصفحة التي تستشهد به. سطر ::resource الخاص به يقع في الصفحة الزوجية، بعد فقرة 1944، فيتصدّر الشريط الصفحة الفردية.

#3 · علّق علامة التنصيص في الهامش

script.js · الأسطر 112–130في الشيفرة الكاملة
// The glyph is centred in an icon square that the box keeps as a column, size + gap wide,
// left of the text. A negative gap pulls the text back over the square's empty right side,
// and a left padding of −(size + gap) moves that column out into the margin, so the text
// starts on the column's edge and the mark hangs outside it. The frame stays on the column
// (a background would stop short of the mark). « sits lower and runs wider than “, so the
// Spanish mark is set smaller.
const MARK = t({ en: { glyph: '“', size: 50, column: 34 }, // pt; the column is 12 mm
  es: { glyph: '«', size: 28, column: 22.5 } });
// The paddings are optical: once the next paragraph snaps to the grid, the quote has
// the same air above and below it, in both languages.
const quote = { id: 'pullquote', backgroundEnabled: false, marginTop: pt(LEAD),
  marginBottom: pt(0), padding: { top: pt(8), right: pt(0), bottom: pt(7),
    left: pt(-MARK.column) }, // negative: the icon column starts out in the margin
  icon: { kind: 'glyph', glyph: MARK.glyph, fontFamily: 'Instrument Serif',
    size: pt(MARK.size), color: col('lake') },
  titleStyle: { gap: pt(MARK.column - MARK.size) }, // negative too: size + gap = column
  body: { fontFamily: 'Instrument Serif', fontSize: pt(19), lineHeight: pt(1.5 * LEAD),
    textAlign: 'left', hyphenation: false, color: col('lake'), // display type: no hyphens
    italicColor: col('lake'), firstLineIndent: pt(0) } };

أيقونة الحرف تأخذ عمودًا خاصًا بها بجانب النص، وهذا يزيح الاقتباس. الفجوة السالبة تعيد النص فوق الجانب الأيمن الفارغ من مربع الحرف. ثم تنقل حشوة يسرى سالبة بعرض ما تبقّى من ذلك العمود (الحجم + الفجوة، 34 pt) العمود إلى الهامش، فيعود النص ليبدأ عند حافة العمود. حدّ الإطار يبقى على العمود، فلو كانت له خلفية لتوقفت قبل العلامة. يبدأ المربع على بعد 12 mm إلى الخارج، والعلامة، وهي في وسطه، تتعلّق نحو 6 mm داخل الهامش الخارجي للصفحة الزوجية البالغ 14 mm. والطبعة الإسبانية تنضّد علامتها « أصغر، لأن علامة التنصيص الزاوية تقع أدنى وتمتد أعرض من علامة التنصيص المنحنية.

#4 · عوّم الصناديق إلى رأس عمود وإلى أسفل الصفحة

script.js · الأسطر 134–157في الشيفرة الكاملة
// Floated boxes keep one body line from the text, so they need no margins of their own.
const glance = { id: 'glance', placement: 'top', // floats to the next column head: no hole
  backgroundEnabled: false, // one device, the stripe; the text keeps the column's edges
  stripe: { enabled: true, side: 'top', width: pt(2.5), color: col('lake') },
  padding: { top: mm(2.5), right: pt(0), bottom: pt(0), left: pt(0) },
  titleStyle: { ...sans, fontWeight: 700, fontSize: pt(7.5), letterSpacing: pt(1.5),
    color: col('lake'), gap: mm(2) },
  body: { fontFamily: 'Instrument Sans', fontSize: pt(8.6), lineHeight: pt(12.2),
    textAlign: 'left', hyphenation: false, firstLineIndent: pt(0) } }; // ink from bodyText
const numbers = { id: 'numbers', span: 'page', placement: 'bottom', // floats to a page foot
  background: col('ink'), columnGap: mm(8),
  padding: { top: mm(5), right: mm(6), bottom: mm(5.5), left: mm(6) },
  titleStyle: { ...sans, fontWeight: 700, fontSize: pt(7.5), letterSpacing: pt(1.5),
    color: col('ice'), gap: mm(1) },
  body: { fontFamily: 'Instrument Sans', fontSize: pt(9), lineHeight: pt(12.5),
    textAlign: 'left', hyphenation: false, color: col('ice'), firstLineIndent: pt(0) } };
// The panel's figures are level-4 headings (#### 31), a level the story never uses.
const figures = { level: 4, fontSize: pt(40), lineHeight: pt(40), color: col('ember'),
  marginBottom: pt(4) };
// The end mark is a chip of one space, :chip[ ]{style="end"}: an empty box. Its lengths are
// in its own ems: paddingX makes the width, and the height is its font size's band (0.8
// ascent + 0.25 descent). It is ink, like the text it closes, in the story and in the guide.
const endMark = { id: 'end', background: col('ink'), borderWidth: pt(0), borderRadius: pt(0),
  fontSize: em(0.62), paddingX: em(0.525), paddingY: em(0), gap: em(0.8) }; // 1.05 em square

مع placement: 'top' يطفو إطار الحقائق: يغادر التدفق ويأخذ أول رأس عمود فارغ، فيجري النص حتى أسفل العمود بدل أن يترك فجوة حيث لم يتسع الإطار. لوحة الأرقام تطفو في الاتجاه الآخر، إلى أسفل الصفحة، وتمتد على العمودين؛ وأرقامها الثلاثة عناوين من المستوى الرابع، وهو مستوى لا يستعمله التحقيق أبدًا، يوزّعها breaks="3,5" الذي يعدّ الكتل الأبناء لا الأسطر. علامة النهاية شارة بلا نص ظاهر. يحدّد paddingX عرض المربع، ويحدّد حجم خط الشارة ارتفاعه، وكلاهما 1.05 em بحجم الشارة نفسها.

#5 · ترويسات تسمّي العدد والتحقيق

script.js · الأسطر 81–108في الشيفرة الكاملة
const FOLIO_PT = 8.5; // the folio's size in pt
const LABEL_PT = 7.5; // the label's size in pt
const SQUARE = 2.1; // mm: the lake square's side, the folio's cap height
const label = { ...sans, fontSize: pt(LABEL_PT), letterSpacing: pt(1.3), color: col('muted') };
const folio = { fontFamily: 'Instrument Sans', fontWeight: 700, fontSize: pt(FOLIO_PT),
  color: col('ink') };
// A design text's baseline sits 0.8 down its line box, 1.2 × its size (the default lineHeight).
const baseline = (size) => size * 1.2 * 0.8 * 25.4 / 72; // mm from its box's top, size in pt
const HEAD_Y = 12; // mm from the top edge to the folio's box, inside the 22 mm top margin
const LINE = HEAD_Y + baseline(FOLIO_PT); // the heads' one baseline, from the top edge
const pin = (edge, x, y = HEAD_Y) => ({ anchor: { to: 'page', edge },
  offset: { x: mm(x), y: mm(y) } }); // in the margin (gotcha: header-paints-over-text)
const sides = [['even', 'left', 1], ['odd', 'right', -1]]; // 1: the outer edge is on the left
const header = { elements: sides.flatMap(([parity, edge, s]) => [
  { kind: 'text', id: `folio-${parity}`, content: '{pageNumber}', ...folio,
    placement: pin(`top-${edge}`, s * OUTER) },
  { kind: 'box', id: `square-${parity}`, style: { backgroundColor: col('lake') },
    placement: { ...pin(`top-${edge}`, s * (OUTER + 7.5), LINE - SQUARE), // on the line
      size: { width: mm(SQUARE), height: mm(SQUARE) } } },
  // The smaller label's baseline sits higher in its box (0.34 mm at 7.5 and 8.5 pt), so its
  // box goes that much lower: folio, square and label share one baseline at any size.
  { kind: 'text', id: `head-${parity}`, ...label,
    content: s > 0 ? '{title} · {subtitle}' : '{chapterTitle}',
    placement: pin(`top-${edge}`, s * (OUTER + 11.5), LINE - baseline(LABEL_PT)) },
].map((element) => ({ ...element, parity, pages: 'body' }))) }; // no running heads on openers
const footer = { elements: sides.map(([parity, edge, s]) => ({ kind: 'text', parity,
  id: `drop-folio-${parity}`, ...folio, content: '{pageNumber}', pages: 'opener', align: edge,
  placement: pin(`bottom-${edge}`, s * OUTER, -11) })) }; // an opener's only folio, at the foot

عناصر الترويسة تُرسم فوق الصفحة ولا تحجز مساحة، لذلك تُربط كل قطعة بالصفحة في الهامش العلوي بإزاحات بالمليمتر. تذكر الصفحة الزوجية المجلة والعدد من البيانات التمهيدية للملف (frontmatter)، وتذكر الفردية عنوان التحقيق، وpages: 'body' يبعدهما عن صفحات الافتتاح، التي ليس فيها إلا رقم صفحة في أسفلها. خط الأساس لنص التصميم يقع عند 0.8 من ارتفاع مستطيل سطره، وهو 1.2 ضعف حجمه، فتُنزل baseline() التسمية ذات 7.5 pt بمقدار 0.34 mm تحت رقم الصفحة ذي 8.5 pt وتُقيم المربع على السطر نفسه. إذا غيّرت أيًّا من الحجمين بقيت القطع الثلاث على خط أساس واحد.

#6 · أعد استعمال الافتتاحية للمادة التالية

script.js · الأسطر 161–164في الشيفرة الكاملة
const ART = 126; // mm: the drawing bleeds less far down the page than the photograph
// On its pages, 'lake' turns rust in the opener, the headings, the boxes and the chips.
const guide = { id: 'guide', advancedDesign: opener('ice-art', ART),
  palette: { lake: palette.rust } };

تصميم الافتتاح دالة، فيحصل الدليل الميداني على التصميم نفسه بصورته وعمقه الخاصين عبر نمط عنوان، # Five Kinds of Ice {style="guide" kicker="Field guide" …}. ينزف الرسم 126 mm نزولًا في الصفحة بدل 160؛ واسم المصوّر والعنوان التمهيدي يُقاسان من depth - TOP، والكلمات الأخرى تتدلّى من العنوان التمهيدي، فترتفع كلها 34 mm ويبدأ نص الدليل أعلى. لوحة ألوان النمط تجعل lake بلون الصدأ في تلك الصفحات، فيصير العنوان التمهيدي، وأي عنوان داخلي أو إطار مرتبط بـlake، بلون الصدأ من غير وسيط لوني في opener()؛ والشارة المرتبطة بـlake تصير بلون الصدأ هي أيضًا، أما علامة النهاية فبلون الحبر في المادتين.

الوصفة كاملة

Sandbox
// ═══ Postext Cookbook · Nº 004 · Magazine feature: photo opener to end mark ═══════
// https://postext.dev/en/cookbook/magazine-feature-opener
// Code: MIT · Text: original (CC BY 4.0) · Photos: Ales Krivec, Hannah Donze (CC0)
// Fonts: Literata, Instrument Serif, Instrument Sans (SIL OFL 1.1) · Needs postext ≥ 1.25.0
// A nature feature from a winter issue. The level-1 heading carries its kicker, standfirst,
// byline and photo credit as attributes, and one opener design lays them out under a bleed
// photograph; the story runs on with a pull quote, a fact box, a photo band, a numbers panel
// and an end mark, and the next item reuses the opener with a drawing in place of the photo.
import {
  buildDocumentWithFonts, renderPageToCanvas, registerResourceImage,
} from 'https://esm.sh/postext';

const LANG = 'en'; // @lang: the language of the sample document ('en' | 'es')
const RECIPE = 'magazine-feature-opener';

// ─── 1 · Design ─────────────────────────────────────────────────────────────
// Every colour below is linked to this palette by id.
const palette = {
  ink: '#15191c', // text: a blue-black
  lake: '#2d6a7d', // the accent: kickers, crossheads, the quote, the fact box's stripe
  ember: '#c8773d', // the panel's figures: 5.2:1 on ink (only 3.4:1 on paper)
  rust: '#9a5a2e', // the field guide's accent, swapped in for 'lake' by its heading style
  ice: '#dbe8ec', // the type on the dark panel and the drawing's sky
  rule: '#c7cdd1', // the drawing's far ridge and air bubbles
  muted: '#66707a', // running heads, credits, the 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' } })),
  // The engine's defaults link to 'main-color': point it at the accent, so nothing prints blue.
  { id: 'main-color', name: 'lake (defaults)', value: { hex: palette.lake, model: 'hex' } },
];
const TRIM = 225; // page width in mm, shared with the drawing
const INNER = 16; // inner margin in mm
const OUTER = 14; // outer margin in mm: folios and running heads align to it
const LEAD = 13.4; // body leading in pt: the baseline grid

// #region answer: a bleed photo, then the heading's kicker, headline, standfirst, byline and credit
const TOP = 22; // top margin in mm: an opener's container starts here
const sans = { fontFamily: 'Instrument Sans', fontWeight: 600, textTransform: 'uppercase' };
const HEAD = 118; // mm: the headline's measure; the standfirst takes the rest of the line
// Empty padding paints nothing but counts: the story starts on the first grid line at least
// 5 mm under the lower of the headline and the byline, however many lines each one runs to.
const air = { padding: { bottom: mm(5) } };
const at = (id, edge, x, y, width) => ({ anchor: { to: id, edge },
  offset: { x: mm(x), y: mm(y) }, ...(width && { size: { width: mm(width) } }) });
const opener = (resourceId, depth) => ({ // depth: how far down the page the picture bleeds

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

تنويعات

#افتتح كل مادة في صفحة فردية

مع 'odd' ينتقل الدليل الميداني إلى الصفحة 61، وتبقى الصفحة 60 فارغة.

- { level: 1, span: 'page', breakBefore: { enabled: true, parity: 'any' },
+ { level: 1, span: 'page', breakBefore: { enabled: true, parity: 'odd' },

#ضع العنوان على شريط ملوّن

لفصل في كتاب مدرسي، حيث يحلّ شريط ملوّن ورقم كبير محل الصورة، انظر افتتاح فصل على شريط بنزف كامل.

أخطاء شائعة

خطأ شائع

قيم السمات: لا { ولا }؛ ضع القيمة التي فيها " بين علامتي اقتباس مفردتين

تنتهي قيمة السمة عند القوس المعقوف الختامي، فلا يمكن أن تحتوي { أو }. القيمة التي فيها علامة اقتباس مزدوجة توضع بين علامتي اقتباس مفردتين؛ أما علامة الدولار فلا مشكلة فيها. سمات العنوان →

خطأ شائع

الصور النقطية تأخذ مقاس طباعتها من دقتها: صرّح بالدقة لا ببكسلات محسوبة للطباعة

الصورة النقطية بلا دقة تُوضع ببكسل لكل بكسل تخطيط بدقة dpi المستند، فصورة من 2400 px عرضها 406 mm في صفحة 150 dpi. صرّح ببكسلات الملف الحقيقية وأعطِ الصورة دقتها (bitmap.resolution: 300)، أو اضبط layout.bitmapResolution لكل الصور النقطية: قيمة ppi، أو 'file' لقراءة الدقة التي يذكرها الملف. يظل العمود يحدّ الصورة. الأشكال والجداول بوصفها موارد →

خطأ شائع

العنصر العائم 'top' يذهب إلى الصفحة التالية لإحالته ما لم يُسمح له بتصدر صفحة الإحالة

افتراضيًا لا يصعد العنصر العائم أبدًا فوق الإحالة إليه، فالعنصر العائم 'top' الممتد بعرض الصفحة والمُحال إليه في الصفحة N يفتتح الصفحة N+1. اضبط placement.citingPage: true على المورد أو على defaultPlacement لنوعه (أو layout.floatsAtCitingPage للكتاب كله، منذ postext 1.25) فيتصدر الصفحة N بدلًا من ذلك، وينزل النص الذي فوق الإحالة تحته، إذا اتسع له المكان في حدود layout.maxTopFraction وبقي سطر الإحالة في تلك الصفحة. ولا يتصدر أبدًا الصفحة الأولى من فصل ولا صفحة بعد فاصل قسري: فهناك يظل يفتتح الصفحة التالية، ويمكن للموضع 'auto' أو 'bottom' أن يشغل أسفل صفحة الإحالة. موضع الأشكال →

خطأ شائع

عناصر الترويسة والتذييل تُرسَم فوق النص

تُرسَم عناصر الترويسة والتذييل فوق الصفحة، ولا تُفسح منطقة النص لها مكانًا. أبقِها داخل الهوامش، فالهوامش هي التي تحجز مساحتها. الترويسات وأرقام الصفحات →

فحص Sandbox · bitmapTooSmall

صورة منخفضة الدقة

السبب. صورة نقطية تُرسم بعرض يزيد على 1.5 ضعف عدد نقاطها، فستبدو ضبابية في الطباعة.

الحل. وفّر نحو 300 dpi بالحجم المطبوع، وصرّح بالعرض والارتفاع الحقيقيين للصورة النقطية. التوثيق →

  • عنصر الصورة يُدخل الصورة كلها في مستطيله ولا يقصّها أبدًا. قصّ ملف JPEG بنسب المستطيل، 225 × 160 mm هنا، وإلا انكمشت الصورة وتركت شرائط بيضاء عند حواف الصفحة.
  • العلامة المعلّقة تحتاج إلى هامش. إذا نقل تعديلٌ الاقتباس البارز إلى عمود أيمن، ملأت العلامة الفاصل بين العمودين البالغ 6 mm ولامست نص العمود الأيسر: انقل الاقتباس فقرة إلى الأمام أو إلى الوراء.
  • طول التحقيق مضبوط لينتهي في الصفحة 59، فوق لوحة الأرقام. بضعة أسطر إضافية ترسل ذيله إلى صفحة خاصة به، لذلك اضبط طول النص من جديد في اللغتين بعد كل تعديل.
  • runtMinCharacters: 40 يمنع أن يكون السطر الأخير كلمة واحدة. حين لا تستطيع خوارزمية تقسيم الأسطر تجنّب سطر أخير قصير، ينضّد المحرّك الفقرة أقصر بسطر، بمسافات أضيق بين الكلمات، وإن لم يكفِ ذلك، بتقليص ما بين الحروف حتى 0.01 em. بعد أي تعديل ابحث عن فقرة منضّدة بهذا الضيق، واحذف منها بضع كلمات أو أضف إليها بدلًا من ذلك؛ النص المنشور لا يحتاج إلى هذا الإصلاح في أي من اللغتين.

الحقوق

الوصفة
Ignacio Ferro
النص
نص أصلي, CC BY 4.0
الصور
الخطوط
Literata (SIL OFL 1.1) · Instrument Serif (SIL OFL 1.1) · Instrument Sans (SIL OFL 1.1)
الشيفرة
MIT، مثل Postext
Sandbox