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

دليل الوصفات · الفصل 5 · بنية الكتاب

ملاحق الأطروحة: ملحق ومسرد وفهرس أبجدي

الصفحات الأخيرة من أطروحة بالأبيض والأسود: ملحق بحرف، ومسرد في عمودين، ومراجع بأسلوب APA، وفهرس أبجدي يُبنى من علامات في النص.

في هذه الصفحة

ص 174–175 · 4–5 من 7

  • نموذج باللغة الإنجليزية: لا توجد طبعة عربية بعد
  • مقاس القص 176 × 250 مم
  • عمود واحد
  • Libertinus Serif 11/14.6
  • Libertinus Sans
  • Libertinus Serif Display
  • 7 صفحات
  • المستوى
  • Postext 1.57.1
  • أُخرجت في 107 ms
  • أسطر الشيفرة: 183

باختصار

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

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

الصفحات السبع الأخيرة من أطروحة دكتوراه عن القراءة من الشاشات والورق، منضَّدة على صفحة B5 بالأبيض والأسود. يفتح كلٌّ من الفصل 6 والملحق A والمسرد والمراجع والفهرس الأبجدي تحت الشريط الأسود نفسه، بعمق 62 مم، والعنوان مطبوع بالأبيض داخله. يُظهر الفصل رقمه في الشريط والملحق حرفه؛ وفي أقسام المادة الختامية العبارة التمهيدية BACK MATTER وملاحظة قصيرة بالمائل. يجري الفصل في عمود واحد مضبوط. ينتقل المسرد والفهرس إلى عمودين غير مضبوطين وتعود المراجع إلى عمود واحد، وتُزاح الأسطر المرحَّلة لكل مدخل. يأتي الفهرس من علامات في النص: يرتّب المحرّك المصطلحات تحت حروفها، ويجد صفحة كل علامة، ويضم الصفحات المتتالية في نطاقات مثل 171–73. وتشير الأرقام العريضة إلى تعريفات المسرد.

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

  • كيف أنضد قائمة مراجع أو مسردًا (مسافة بادئة معلّقة، حرف أصغر)؟
  • كيف أبني فهرسًا أبجديًّا في آخر الكتاب تتغير أرقام صفحاته من تلقاء نفسها حين يتحرك النص؟
  • كيف أمنع العناوين والكلمات العريضة والنقاط من الظهور باللون الأزرق؟
  • كيف أرقّم العناوين (1، 1.1، 1.1.1) وأنسّق كل مستوى بطريقة مختلفة؟
  • كيف أضبط الترويسات: عنوان الكتاب في الصفحة اليسرى، وعنوان الفصل في اليمنى، ورقم الصفحة في الجانب الخارجي؟
  • كيف أفرض فاصل صفحة أو عمود، وأبدأ كل فصل على صفحة يمنى؟

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

script.js · الأسطر 27–51في الشيفرة الكاملة
// '# Glossary {style="glossary"}' in the Markdown picks a style. Each style starts a page
// of either parity, the appendix a recto (a style that sets no break inherits its level's
// 'odd': gotcha style-inherits-break), stays out of the chapter count (numbered: false, so
// its band has no numeral) and brings its own running heads; the glossary and the index
// set their pages in two columns until the next '#'. The appendix counts, in letters: its
// template prints the level's counter as A, B… config() takes both lists below.
const twoColumns = { layoutType: 'double', gutterWidth: mm(6) };
const backMatter = (id, extra) => ({ id, numbered: false, breakBefore: { enabled: true,
  parity: 'any' }, advancedDesign: opener('Back matter'), header: sectionHeads, ...extra });
const headingStyles = () => [
  backMatter('appendix', { numbered: true, numberingTemplate: '{1:A}', header: appendixHeads,
    breakBefore: { enabled: true, parity: 'odd' }, advancedDesign: opener('Appendix') }),
  backMatter('glossary', { layout: twoColumns }),
  backMatter('references'),
  backMatter('index', { layout: twoColumns }),
];
// One paragraph per entry, in :::paragraphs{style="…"}: the turnover lines hang, so the
// first word of every entry stands clear at the left. Ragged, as APA asks of references,
// with every word whole (hyphenation.ragged is off). The index has its own settings.
const entries = (id, size, lead, hang, extra) => ({ id, fontSize: pt(size),
  lineHeight: pt(lead), textAlign: 'left', hangingIndent: em(hang), ...extra });
const paragraphStyles = () => [
  entries('term', 9.3, 12.4, 1), // the glossary: a bold term, then its definition
  entries('reference', 9.3, 12.4, 1.5, { spaceBetween: pt(2.4) }),
];

المكونات

الخطوط
Libertinus Serif, Libertinus Serif Display, Libertinus Sans (SIL OFL 1.1)
الأصول
لا شيء: كل صورة مرسومة بالشيفرة

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

#1 · أعطِ كل جزء من المادة الختامية نمط عنوان

الشيفرة هي الجواب المختصر أعلاه. يفتح # Glossary {style="glossary" note="…"} قسمًا يمتد حتى العنوان التالي من المستوى الأول، وتأخذ صفحاته تخطيط النمط وترويساته وصفحة افتتاحه (أنماط العناوين)، فينتقل المسرد والفهرس إلى عمودين بينما تعود المراجع، التي لا يضبط نمطها تخطيطًا، إلى عمود المستند الوحيد. يُبقي numbered: false هذه العناوين خارج عدّ الفصول (احذفه فيطبع شريط المسرد 2)، ويحدّد كل نمط فاصل صفحته، لأن النمط الذي لا يحدّد فاصلًا يرث 'odd' من الفصل ويترك صفحات زوجية فارغة. مداخل المسرد والمراجع فقرات في كتلة :::paragraphs{style="…"} بحجم 9.3 pt على 12.4 pt، مقابل 11 على 14.6 للنص، وأسطرها المرحَّلة تتدلّى بمقدار 1 em في المسرد و1.5 em في المراجع (أنماط الفقرات).

#2 · ارسم شريطًا واحدًا لكل صفحات الافتتاح

script.js · الأسطر 55–79في الشيفرة الكاملة
const SINK = 8; // lines reserved, 41.2 mm: 3.2 mm more than the band, and text on the grid
// Design text sets each baseline 0.8 of its line under the line's top, and a line is 1.2 × the
// size unless lineHeight says otherwise. In mm, a line's part above its baseline and below it:
const PT = 25.4 / 72;
const above = (size, lineHeight = 1.2) => 0.8 * size * lineHeight * PT;
const below = (size, lineHeight = 1.2) => 0.2 * size * lineHeight * PT;
const KICKER = 4.3, TITLE = BAND - TOP - 9.5; // mm under the text block's top: two baselines
// A bottom-aligned box that ends below() under a baseline sets its last line on it. The
// numeral's line is 0.72 of its size, so the line fits inside its box.
const text = (id, content, family, size, lineHeight, baseline, edge, w, extra) => ({
  kind: 'text', id, content, fontFamily: family, fontSize: pt(size), lineHeight,
  color: col('paper'), overflow: 'wrap', align: edge.endsWith('right') ? 'right' : 'left',
  verticalAlign: 'bottom', ...extra, placement: { anchor: { to: 'container', edge },
    size: { width: mm(w), height: mm(baseline + below(size, lineHeight)) } } });
// The mark is '{number}': the chapter's 6, the appendix's A, nothing on an unnumbered heading.
const opener = (label) => ({ enabled: true, minHeight: pt(SINK * LEAD),
  slot: { elements: [
    { kind: 'box', id: 'band', style: { backgroundColor: col('band') }, placement: {
      anchor: { to: 'page', edge: 'top-left' }, size: { width: 'fill', height: mm(BAND) } } },
    text('label', label, LABEL, 8, 1.2, KICKER, 'top-left', 80,
      { fontWeight: 700, letterSpacing: pt(1.6), textTransform: 'uppercase' }),
    text('title', '{titleText}', DISPLAY, 34, 1.04, TITLE, 'top-left', 84),
    text('mark', '{number}', DISPLAY, 118, 0.72, TITLE, 'top-right', 34),
    text('note', '{attr.note}', TEXT, 8.6, 1.3, TITLE, 'top-right', 44, { italic: true }),
  ] } });

العلامة هي {number}: 6 في الفصل، وA في الملحق، ولا شيء في العنوان غير المرقّم. فيخدم تصميم واحد الثلاثة، وتطبع أقسام المادة الختامية {attr.note} حيث كان الرقم سيقف. يحجز minHeight ثمانية أسطر ارتفاع كل منها 14.6 pt، أي 41.2 مم من أعلى كتلة النص، فيتجاوز الشريط بـ3.2 مم ويُبقي النص على شبكته. يضع نص التصميم خط أساسه عند 0.8 من السطر، فالمستطيل المحاذى إلى الأسفل الذي تقع قاعدته below() تحت خط أساس يضع سطره الأخير على ذلك الخط. يقف العنوان والرقم بحجم 118 pt والسطر الأخير من الملاحظة كلها على خط أساس العنوان، على بعد 52.5 مم تحت حدّ القص. سطر الرقم 0.72 من حجمه، فيسعه مستطيله.

#3 · دع نمط الملحق يضع حرفه

script.js · الأسطر 109–115في الشيفرة الكاملة
// The style's '{1:A}' (see answer) prints the level's counter as a letter, and startAt=1 on the
// first appendix restarts it after chapter 6. The band and the running head read that letter.
// A resource template's {h1} is a number unless it names a style: '{h1:A}.{n}' counts the
// tables A.1, A.2… and B.1 in a second appendix, with one type for all of them.
const appendixHeads = heads('Appendix {chapterNumber}. {chapterTitle}');
const appendixTables = { ...defaultResourceTypes(LANG).find((type) => type.id === 'table'),
  id: 'table-a', numberingTemplate: '{h1:A}.{n}', resetOn: 'h1' }; // a copy of 'table'

يضع نمط الملحق numberingTemplate: '{1:A}'، فيُطبع عدّاد المستوى حرفًا، ويعيد # Interview guide {style="appendix" startAt=1} بدء ذلك العدّاد، فيكون الملحق الأول A لا G (أنماط العناوين). يقرأ الشريط الحرف عبر {number} والترويسة عبر {chapterNumber}. أما {h1} في نوع المورد فيطبع العدّاد رقمًا ما لم يسمِّ نمطًا، لذا تأخذ جداول الملحق نوعًا قالبه '{h1:A}.{n}': A.1 وA.2 وهكذا، وB.1 في ملحق ثانٍ؛ ومع النوع الافتراضي يكون الجدول Table 1.1. أما عناوين الفصل نفسه فتعدّ من قوالب المستويات: يطبع '{1}.{2}' الرقم 6.1، ويجعل continuation.headings.h1: 5 هذا الفصل السادس.

#4 · ضع الترويسات على الحافة الخارجية

script.js · الأسطر 83–105في الشيفرة الكاملة
const HEAD = 17.5, GAP = 9; // mm: the heads' baseline under the trim; the folio to the words
// Each text is placed by its top, above() over HEAD: the folio and the capitals share a baseline.
const head = (id, content, parity, edge, x, size = 7.5, extra) => ({ kind: 'text', id, content,
  parity, pages: 'body', fontFamily: LABEL, fontSize: pt(size), fontWeight: 700,
  letterSpacing: pt(1.3), textTransform: 'uppercase', color: col('ink'), ...extra, placement: {
    anchor: { to: 'page', edge }, offset: { x: mm(x), y: mm(HEAD - above(size)) } } });
const folio = { fontFamily: TEXT, fontWeight: 400, letterSpacing: pt(0) };
const heads = (recto) => ({ elements: [
  head('verso-folio', '{pageNumber}', 'even', 'top-left', OUTER, 9.5, folio),
  head('verso', '{title}', 'even', 'top-left', OUTER + GAP),
  head('recto', recto, 'odd', 'top-right', -(OUTER + GAP)),
  head('recto-folio', '{pageNumber}', 'odd', 'top-right', -OUTER, 9.5, folio),
  // The header's container spans the text block, so one rule serves both pages.
  { kind: 'rule', id: 'hairline', pages: 'body', direction: 'horizontal', thickness: pt(0.5),
    color: col('rule'), placement: { anchor: { to: 'container', edge: 'top-left' },
      offset: { y: mm(HEAD + 2) }, size: { width: 'fill' } } },
] });
const chapterHeads = heads('Chapter {chapterNumber}. {chapterTitle}');
const sectionHeads = heads('{chapterTitle}'); // 'Glossary', 'References', 'Index'
// Openers drop the folio to the foot, centred under the text block, its baseline 12 mm below.
const footer = { elements: [{ kind: 'text', id: 'drop-folio', content: '{pageNumber}',
  pages: 'opener', ...folio, fontSize: pt(9.5), color: col('ink'), align: 'center',
  placement: { anchor: { to: 'container', edge: 'top' }, offset: { y: mm(12 - above(9.5)) } } }] };

عناصر النص الأربعة مربوطة بالصفحة ومصفّاة بـparity، الذي يُبقي رقم الصفحة على الحافة الخارجية للصفحتين؛ ويوضع كل منها من أعلاه، above() فوق خط أساس على بعد 17.5 مم تحت حدّ القص، فيقف رقم الصفحة بحجم 9.5 pt والحروف الكبيرة بحجم 7.5 pt على سطر واحد. على الصفحة الزوجية عنوان الأطروحة ({title}، من البيانات التمهيدية) وعلى الفردية عنوان القسم ({chapterTitle})، مثل INDEX في الصفحة 177. يُبعدها pages: 'body' عن صفحات الافتتاح، التي لا رقم صفحة لها إلا رقم التذييل، متوسَّطًا تحت كتلة النص. كانت الصفحة الفردية للفصل ستقرأ Chapter 6. Conclusion وصفحة الملحق Appendix A. Interview guide، لكن في هذه العيّنة لا يمتد إلى صفحة فردية إلا الفهرس.

#5 · علِّم المصطلحات حيث يناقشها النص

script.js · الأسطر 119–125في الشيفرة الكاملة
// Glossary definitions carry 'main' (bold numbers); runs of pages join as 171–72 (Chicago).
// The heads stand on the entries' 11.6 pt pitch, 7.5 pt of space above them: 19 pt from the
// last entry of a letter to the next letter's baseline, 11.6 pt from a letter to its first entry.
const index = { fontFamily: TEXT, fontSize: pt(9), lineHeight: pt(11.6), color: col('ink'),
  indent: em(1), turnoverIndent: em(2), rangeFormat: 'chicago',
  groups: { fontFamily: DISPLAY, fontSize: pt(13), fontWeight: 400, color: col('ink'),
    marginTop: pt(7.5) } };

يطبع :index[tablet] كلمته ويُدرجها تحت الكلمة نفسها؛ ولا يطبع Rayner:index{term="Rayner, Keith"} شيئًا ويُدرج صفحة Rayner تحت الاسم الكامل؛ ويصنع term="interviews!timing of" مدخلًا فرعيًا. لمصطلحات المسرد main، فتُطبع صفحتها بالعريض، كما تذكر الملاحظة في شريط الفهرس. يطبع :::index تحت # Index {style="index"} المداخل في عمودي النمط، ويعيد buildDocument إخراج المستند حتى تكفّ أرقام الصفحات عن التحرك. المداخل بحجم 9 على 11.6 pt، وأسطرها المرحَّلة تتدلّى 2 em والمداخل الفرعية مزاحة 1 em؛ والحروف بحجم 13 pt بخط العرض. لا تعمل العلامات في خلايا الجداول، فلا تضيف صفوف الجدول 6.1 صفحات: يحيل مدخل look-backs إلى الفقرة التي تتناولها، لا إلى الجدول.

#6 · أبقِ كل القيم الافتراضية بالحبر

script.js · الأسطر 15–19في الشيفرة الكاملة
const palette = { ink: '#000000', band: '#000000', rule: '#000000', paper: '#ffffff' };
const col = (id) => ({ hex: palette[id], model: 'hex', paletteId: id });
// Bold, italic and list markers default to 'main-color': pointed at the ink, they print black.
const colorPalette = Object.entries({ ...palette, 'main-color': palette.ink })
  .map(([id, hex]) => ({ id, name: id, value: { hex, model: 'hex' } }));

تتبع القيم الافتراضية للمحرّك في العريض والمائل وعلامات القوائم والإحالات مدخل لوحة الألوان main-color، فتوجيهه إلى الحبر يطبعها بالأسود بدل الأزرق (لوحة الألوان). ويضع referenceBold: false الإحالة Table 6.1 بالخط القائم، مثل استشهادات المؤلف–السنة المحيطة بها.

الوصفة كاملة

Sandbox
// ═══ Postext Cookbook · Nº 031 · Thesis back matter: appendix, glossary and index ═══
// https://postext.dev/en/cookbook/thesis-back-matter
// Code: MIT · Text: original (CC BY 4.0) · Pictures: none
// Fonts: Libertinus Serif, Serif Display and Sans (SIL OFL 1.1) · Needs postext ≥ 1.28.0
import {
  buildDocumentWithFonts, renderPageToCanvas, defaultResourceTypes,
} from 'https://esm.sh/postext';
import { renderToPdf, decompressWoff2 } from 'https://esm.sh/postext-pdf';

const LANG = 'en'; // @lang: the language of the sample document ('en')
const RECIPE = 'thesis-back-matter';

// ─── 1 · Design ─────────────────────────────────────────────────────────────
// #region palette: one ink; every colour is black or white, each under its own name
const palette = { ink: '#000000', band: '#000000', rule: '#000000', paper: '#ffffff' };
const col = (id) => ({ hex: palette[id], model: 'hex', paletteId: id });
// Bold, italic and list markers default to 'main-color': pointed at the ink, they print black.
const colorPalette = Object.entries({ ...palette, 'main-color': palette.ink })
  .map(([id, hex]) => ({ id, name: id, value: { hex, model: 'hex' } }));
// #endregion
const TEXT = 'Libertinus Serif', DISPLAY = 'Libertinus Serif Display', LABEL = 'Libertinus Sans';
const TOP = 24, INNER = 25, OUTER = 31; // mm: a 120 mm measure, about 70 characters at 11 pt
const LEAD = 14.6; // pt: the body's leading, the grid every page is set on
const BAND = 62; // mm from the trim's top: the black band at the head of every opener

// #region answer: back matter as unnumbered heading styles, entries in hanging indents
// '# Glossary {style="glossary"}' in the Markdown picks a style. Each style starts a page
// of either parity, the appendix a recto (a style that sets no break inherits its level's
// 'odd': gotcha style-inherits-break), stays out of the chapter count (numbered: false, so
// its band has no numeral) and brings its own running heads; the glossary and the index
// set their pages in two columns until the next '#'. The appendix counts, in letters: its
// template prints the level's counter as A, B… config() takes both lists below.
const twoColumns = { layoutType: 'double', gutterWidth: mm(6) };
const backMatter = (id, extra) => ({ id, numbered: false, breakBefore: { enabled: true,
  parity: 'any' }, advancedDesign: opener('Back matter'), header: sectionHeads, ...extra });
const headingStyles = () => [
  backMatter('appendix', { numbered: true, numberingTemplate: '{1:A}', header: appendixHeads,
    breakBefore: { enabled: true, parity: 'odd' }, advancedDesign: opener('Appendix') }),
  backMatter('glossary', { layout: twoColumns }),
  backMatter('references'),
  backMatter('index', { layout: twoColumns }),
];
// One paragraph per entry, in :::paragraphs{style="…"}: the turnover lines hang, so the
// first word of every entry stands clear at the left. Ragged, as APA asks of references,
// with every word whole (hyphenation.ragged is off). The index has its own settings.
const entries = (id, size, lead, hang, extra) => ({ id, fontSize: pt(size),
  lineHeight: pt(lead), textAlign: 'left', hangingIndent: em(hang), ...extra });
const paragraphStyles = () => [

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

تنويعات

#ابدأ كل قسم في صفحة فردية

كثيرًا ما تبدأ الأطروحات المجلَّدة للمكتبات كل قسم في صفحة يمنى. عندها ينتقل المسرد والمراجع والفهرس إلى الصفحات 175 و177 و179، كل منها بعد صفحة زوجية فارغة، وتشير الأرقام العريضة في الفهرس إلى الصفحة 175.

-const backMatter = (id, extra) => ({ id, numbered: false, breakBefore: { enabled: true,
-  parity: 'any' }, advancedDesign: opener('Back matter'), header: sectionHeads, ...extra });
+const backMatter = (id, extra) => ({ id, numbered: false, breakBefore: { enabled: true,
+  parity: 'odd' }, advancedDesign: opener('Back matter'), header: sectionHeads, ...extra });

#نضّد مقدمة الأطروحة أيضًا

الصفحات التمهيدية، المرقّمة بالأرقام الرومانية قبل الصفحة 1، في وصفة صفحات تمهيدية بأرقام رومانية، ثم الصفحة 1.

أخطاء شائعة

خطأ شائع

يرث نمط العنوان فاصل الصفحة من مستواه

يأخذ مُدخل headingStyles كل حقل يتركه من مستوى عنوانه، بما فيه breakBefore. فصفحة المحتويات أو صفحة بيانات النشر المنسّقة على H1 بعد :::pagebreak ترث الزوجية 'odd' وتقع بعد صفحة فارغة. أعطِ هذا النمط breakBefore: { enabled: false }. أنماط العناوين →

خطأ شائع

الصفحة 1 فردية: خطّط الصفحات بأرقامها الفعلية

الصفحة 1 صفحة يمنى والصفحة 2 أول صفحة زوجية، فخطّط الصفحتين المتقابلتين بأرقام الصفحات الفعلية: الافتتاحية في صفحة زوجية تقابل الصفحة الفردية التي تليها. فواصل الصفحات والأعمدة →

الحقوق

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