باختصار
طبعة علمية لقصيدة من شعر ملتون. يُرقَّم كل سطر خامس في الهامش، وتشير الحواشي بعد القصيدة إلى الأسطر التي تشرحها بأرقامها.
ما الذي ستنضده
Lycidas، مرثية ملتون لإدوارد كينغ، منضّدة طبعةً محقّقة صغيرة بمقاس 138 × 216 مم بنص Poems لسنة 1645 وإملائه. تبدأ الصفحة الأولى تحت غصن من الغار، والعنوان بحروف Imbue الكبيرة الطويلة فوق التمهيد الذي أضافه ملتون سنة 1645. وتليه الأسطر كلها، 193 سطرًا، كل سطر شعري على سطر مطبوع، وبين المقاطع سطر فارغ، والأسطر القصيرة مزاحة إلى الداخل. ولكل سطر خامس رقمه بأخضر الغار، في عمود بعرض 6 مم عند الحافة الأمامية: إلى يمين الشعر في الصفحة الفردية، وإلى يساره في الزوجية. وليس في الشعر علامات حواشٍ. تملأ الحواشي الصفحتين اللتين تليان القصيدة، وتبدأ كل منها برقم سطرها، بخط Libre Franklin الأخضر نفسه الذي في أرقام الهامش.
تجيب هذه الوصفة عن
- كيف أرقّم كل سطر خامس من قصيدة في الهامش وأربط ملاحظاتي بأرقام الأسطر تلك؟
- كيف أنضد الشعر: سطر لكل بيت، وفراغ بين المقاطع، ومسافة بادئة معلّقة للأسطر الملتفّة، وبلا تقسيم كلمات؟
- كيف أضيف الحواشي السفلية؟
- كيف أصمم تخطيط عمود ونصف، فيه عمود نص عريض وعمود جانبي ضيق؟
- كيف أضيف فراغًا رأسيًّا إضافيًّا بين كتلتين، إذا لم تُجدِ الأسطر الفارغة شيئًا؟
الجواب المختصر
// The poem is one :::verse block, written as 1645 prints it: a line of verse a line, a blank
// line between verse paragraphs and two spaces before a short line. lineNumbers counts its
// lines of verse (a line that turned over would still count once) and prints the multiples
// of five beside their lines, on their baselines. position 'side' puts them in the side
// column of the one-and-a-half layout, flush with its edge next to the verse.
const lineNumbers = {
enabled: true,
count: 'verse', // the lines of :::verse poems; the notes are prose and not counted
interval: 5,
restart: 'document', // one count through the poem
position: 'side',
fontFamily: LABEL, fontSize: pt(7.5), color: col('laurel'),
};
// Hook-up: lineNumbers in the config; the Markdown goes to buildDocument as it is written.
المكونات
- الميزات
- ترقيم الأسطرالشعر سطرًا سطرًاعمود هامشي للعناصر العائمةعمود ونصفأنماط الفقراتالشارات داخل السطرهوامش متناظرةصفحات افتتاح مصمَّمةالنصوص والخطوط والمربعات في تصاميم الصفحةالصور في تصاميم الصفحةسمات العنوانأنماط العناوينالبيانات الوصفية للمستندالترويسات وأرقام الصفحاتالترويسات بحسب دور الصفحةلوحة ألوان دلالية
- الخطوط
- Linden Hill, Imbue, Libre Franklin (SIL OFL 1.1)
- الأصول
laurel-1040.jpg- The sprig of bay laurel on the first page, a watercolour (Generated With Diffusion Models, أصلي)
طريقة التحضير
#1 · عُدّ أسطر الشعر
شيفرة هذه الخطوة هي الجواب المختصر أعلاه. تعدّ lineNumbers أسطر القصيدة وتطبع رقم كل سطر خامس إلى جواره، على خط أساسه، بخط Libre Franklin بحجم 7.5 نقاط وبأخضر الغار (ترقيم الأسطر). ولا تعدّ count: 'verse' إلا أسطر قصائد :::verse، فلا تأخذ الفقرة التي عن النص ولا الحواشي بعد القصيدة أرقامًا، والسطر الأطول من عرض العمود يُعدّ مع ذلك مرة واحدة: لا تأخذ بقيّته المنكسرة رقمًا. ويُبقي restart: 'document' عدًّا واحدًا على امتداد القصيدة. وتُرسم الأرقام إلى جوار أسطر وضعها الإخراج من قبل، فلا تحرّك أي سطر أبدًا.
#2 · قناة بعرض ستة مليمترات
const PT = 25.4 / 72; // mm in a point
const [TRIM_W, TRIM_H] = [138, 216]; // mm
const [TOP, INNER] = [21, 20]; // mm
const LINES = 34; // lines of verse to a page
const BOTTOM = TRIM_H - TOP - LINES * LEAD * PT; // 21.08 mm
const [MEASURE, GUTTER, CHANNEL] = [80, 4, 6]; // mm: the longest line of Lycidas is 78.1 mm
const OUTER = TRIM_W - INNER - MEASURE - GUTTER - CHANNEL; // 28 mm beyond the numbers
const layout = {
layoutType: 'oneAndHalf',
sideColumnRole: 'floats', // the side column takes the numbers, never text
sideColumnSide: 'outer', // right of the verse on a recto, left of it on a verso
// 6 of 90 mm. The zero is Libre Franklin's widest figure, so '100' (4.9 mm) is the widest number.
sideColumnPercent: (CHANNEL / (MEASURE + GUTTER + CHANNEL)) * 100,
gutterWidth: mm(GUTTER),
};
const page = { sizePreset: 'custom', width: mm(TRIM_W), height: mm(TRIM_H), dpi: 150,
margins: { top: mm(TOP), bottom: mm(BOTTOM), left: mm(INNER), right: mm(OUTER), mirror: true } };
مع sideColumnRole: 'floats' لا يأخذ العمود الضيق في تخطيط oneAndHalf نصًّا أبدًا (أنواع التخطيط)، ويضع position: 'side' الأرقام فيه، ملاصقةً لحافته التي تلي الشعر؛ والفاصل البالغ 4 مم هو المسافة بين السطر ورقمه. وsideColumnPercent نسبة من كتلة النص، فيشتقها المثال من المليمترات: 6 من 90 مم، وهذا يكفي لأعرض رقم. أرقام Libre Franklin متناسبة العرض، والصفر أعرضها بحجم 7.5 نقاط (1.8 مم، مقابل 1.2 مم للواحد)، فيكون 100، بعرض 4.9 مم، أعرض رقم في القصيدة؛ ويأخذ 180 و190 عرض 4.8 مم. ويتبع 'outer' الهوامش المتناظرة، فتقف الأرقام إلى يمين الشعر في الصفحة الفردية، محاذاةً إلى اليسار، وإلى يساره في الزوجية، محاذاةً إلى اليمين: فتبدأ أو تنتهي في الصفحتين على المسافة نفسها من الشعر. وعرض عمود الشعر 80 مم، أي أكثر بـ1.9 مم من السطر 31، أطول الأسطر، فلا ينكسر أي سطر.
#3 · القصيدة كتلة :::verse واحدة
// A blank line between verse paragraphs leaves one line of the grid (stanzaSpace, 1). Two
// leading spaces set a short line in 2 em (indentStep, 1 em a space here, against the default
// half em). The verse is ragged, like all the text here; a line too long for the measure would
// turn over and hang 2 em past its own start, but none does at 80 mm.
const verse = { indentStep: em(1) };
const verseStyles = [{ id: 'verse', hangingIndent: em(2) }];
تحفظ كتلة :::verse القصيدة كما تُكتب: كل سطر من Markdown سطر من الشعر، وسطر فارغ بين المقاطع، والمسافات قبل السطر إزاحته (:::verse). ويحدّد سطر الفتح نمط الشعر وalign=start، الذي يحاذي القصيدة مع الهامش بدل أن يوسّطها على أطول أسطرها. وبين كل مقطعين سطر فارغ واحد من الشبكة (stanzaSpace، سطر واحد). وتبدأ أسطر ملتون القصيرة الأربعة عشر، ومنها السطر 4، بمسافتين، ويجعل indentStep: em(1) منهما 2 em. ويُسقَط الفراغ بين المقطعين في رأس الصفحة، فتبدأ الصفحة 2 بالسطر 15 في أعلى كتلة النص، ولا يظهر الفاصل بين المقطعين عند السطرين 14 و15 (انظر «أخطاء شائعة»).
#4 · الغار والعنوان والتمهيد
const OPENER_LINES = 20; // of the page's 34: the first verse paragraph, 14 lines, takes the rest
const at = (id, edge, y) => ({ anchor: { to: id, edge }, offset: { x: mm(0), y: mm(y) } });
const title = (size, tracking, placement) => ({ kind: 'text', id: 'title', content: '{titleText}',
fontFamily: DISPLAY, fontWeight: 300, fontSize: pt(size), lineHeight: 1,
letterSpacing: pt(tracking), textTransform: 'uppercase', color: col('ink'), placement });
const opener = { enabled: true, minHeight: pt(OPENER_LINES * LEAD), slot: { elements: [
// The laurel ends above the kicker, so the depth comes from the texts: kicker, title and
// headnote reach down 20 lines. minHeight is a floor at the same depth, so a shorter
// headnote leaves the verse on line 21.
{ kind: 'image', id: 'laurel', resourceId: 'laurel',
placement: { anchor: { to: 'page', edge: 'top-right' }, size: { width: mm(104) } } },
{ kind: 'text', id: 'kicker', content: '{author}', fontFamily: LABEL, fontWeight: 500,
fontSize: pt(8), letterSpacing: pt(1.6), textTransform: 'uppercase', color: col('laurel'),
placement: at('container', 'top-left', 50) },
title(66, 2, at('#kicker', 'below', 1)),
// # Lycidas {headnote="In this Monody …"}: the whole headnote in italic, ragged; at
// 64 mm no word stands alone.
{ kind: 'text', id: 'headnote', content: '{attr.headnote}', fontFamily: TEXT, italic: true,
fontSize: pt(9.5), lineHeight: 13 / 9.5, color: col('ink'), align: 'left',
placement: { ...at('#title', 'below', 3), size: { width: mm(64) } } },
] } };
// The poem opens on a recto. Its design stays in the column, and the laurel, anchored to the
// page's corner, is painted above the text block all the same. With the default
// marginBottom the verse would start on line 22 and send line 14 to page 2.
const poem = { level: 1, breakBefore: { enabled: true, parity: 'odd' },
advancedDesign: opener, marginBottom: pt(0) };
يطبع عنوان المستوى الأول تصميمًا بدل نصه (الامتداد والتصميم المتقدم). يأتي {author} من البيانات التمهيدية، والتمهيد من سمة على سطر العنوان، # Lycidas {headnote="In this Monody …"} (سمات العناوين). والغار ينتهي فوق العنوان التمهيدي، فيأتي عمق صفحة الافتتاح من النصوص التي تحته: العنوان التمهيدي، على بعد 50 مم تحت أعلى كتلة النص، والعنوان، وأسطر التمهيد الأربعة تنزل 20 سطرًا من أسطر الصفحة الأربعة والثلاثين، ويأخذ المقطع الشعري الأول، وهو 14 سطرًا، الباقي. وminHeight حدّ أدنى عند العمق نفسه: اختصر التمهيد إلى ثلاثة أسطر فيبقى الشعر مبتدئًا عند السطر 21، وبدون هذا الحد يصعد إلى السطر 20. ويُبعد marginBottom: pt(0) الهامش الافتراضي للعنوان عن الفجوة؛ ومعه كان الشعر سيبدأ عند السطر 22 ويرسل السطر 14 إلى الصفحة 2. ويبقى التصميم في العمود، والغار المربوط بالزاوية العليا اليمنى للصفحة يُرسم مع ذلك من حدّ القص: فالتصميم المحصور في العمود لا يقصّه إلا أسفل العمود.
#5 · حواشٍ مرتبطة بأرقام الأسطر
const NOTE = 8.6; // pt: the notes, and the note on the text
const noteStyles = [
{ id: 'textnote', fontSize: pt(NOTE), lineHeight: pt(NOTE * 1.33) },
// The note on the text ends on the grid, 2.4 mm below its last line; half a line more
// leaves one blank line before the first note.
{ id: 'note', fontSize: pt(NOTE), lineHeight: pt(NOTE * 1.33), hangingIndent: em(1.6),
marginTop: pt(LEAD / 2) },
{ id: 'colophon', fontFamily: LABEL, fontSize: pt(7), lineHeight: pt(9.5), color: col('muted'),
marginTop: pt(LEAD) },
];
// :chip[8]{style="line"}: Linden Hill has no bold, so the number changes face and colour.
// The chip has no fill, outline or side padding, so nothing is drawn around the number.
const chipStyles = [{ id: 'line', backgroundEnabled: false, borderWidth: pt(0), paddingX: pt(0),
fontFamily: LABEL, fontSize: em(0.9), color: col('laurel') }];
// # Notes {style="notes"} opens the next page under the title's capitals, smaller. A heading
// style keeps the level's break unless it sets its own (gotcha: style-inherits-break). Its
// design stays in the column too, so the title lines up with the notes on either page.
const notesHead = { id: 'notes', breakBefore: { enabled: true, parity: 'any' },
advancedDesign: { enabled: true,
slot: { elements: [title(30, 1, at('container', 'top-left', 0))] } } };
ترتبط الحواشي بأرقام الأسطر، فليس في الشعر علامات حواشٍ، وتتبع القصيدة شرحًا لا يأخذ أي سطر من صفحاتها. تبدأ كل حاشية برقم سطرها، مكتوبًا :chip[8]{style="line"}، ثم الكلمات التي تشرحها بالمائل وقوس إغلاق. وليس للشارة تعبئة ولا حدّ ولا حشوة جانبية، فلا يتغير إلا الخط واللون: Libre Franklin بحجم 7.7 نقاط بأخضر الغار (أنماط الشارات). وليس لخط Linden Hill وزن عريض، فتُميَّز الأرقام بتغيير الخط بدلًا من ذلك. ويزيح نمط الحواشي كل سطر بعد الأول بمقدار 1.6 em، فتبقى الأرقام بارزة على اليسار، وتُنضَّد الحواشي بحافة حرّة، مثل الشعر. وينتقل # Notes {style="notes"} إلى الصفحة 8 وينضّد عنوانه بحروف صفحة الافتتاح الكبيرة، بحجم 30 نقطة.

#6 · ترويسات بحسب الزوجية والفردية
const HEAD = 13; // mm from the trim to the running heads' baseline
// A design text's first baseline sits 0.8 of a line below the top of its box: 0.96 em at the
// default lineHeight of 1.2, which the running heads keep.
const BASE = 1.2 * 0.8;
const head = (id, parity, content, x, size = 7.5, extra = {}) => ({ kind: 'text', id, parity,
content, pages: 'body', fontFamily: LABEL, fontWeight: 500, fontSize: pt(size),
letterSpacing: pt(1.3), textTransform: 'uppercase', color: col('muted'), ...extra,
placement: { anchor: { to: 'page', edge: parity === 'even' ? 'top-left' : 'top-right' },
offset: { x: mm(x), y: mm(HEAD - BASE * size * PT) } } });
const folio = { fontFamily: TEXT, fontWeight: 400, letterSpacing: pt(0), color: col('ink') };
const header = { elements: [
head('verso-folio', 'even', '{pageNumber}', OUTER, 10, folio),
head('verso-head', 'even', '{author}', OUTER + 9),
head('recto-head', 'odd', '{chapterTitle}', -(OUTER + 9)), // LYCIDAS, then NOTES
head('recto-folio', 'odd', '{pageNumber}', -OUTER, 10, folio),
] };
// The two openers carry their folio at the foot instead, at the outer edge of the text block.
const drop = (parity, edge, x) => ({ ...head(`drop-${parity}`, parity, '{pageNumber}', 0, 10,
folio), pages: 'opener', placement: { anchor: { to: 'page', edge },
offset: { x: mm(x), y: mm(-12) } } });
const footer = { elements: [drop('odd', 'bottom-right', -OUTER),
drop('even', 'bottom-left', OUTER)] };
كل عنصر مربوط بالصفحة ومُرشَّح بـparity وpages: 'body' (العناصر النصية). على الصفحة الزوجية اسم المؤلف، وعلى الفردية {chapterTitle}، الذي يُقرأ LYCIDAS فوق القصيدة وNOTES فوق الحواشي، لأن الحواشي تبدأ بعنوان خاص بها. ويقف رقم الصفحة عند الحافة الخارجية لكتلة النص؛ أما صفحتا الافتتاح، 1 و8، فيقع فيهما في أسفل الصفحة.
الوصفة كاملة
// ═══ Postext Cookbook · Nº 044 · Critical edition: line numbers and line-keyed notes ═══
// https://postext.dev/en/cookbook/critical-edition-line-numbers
// Code: MIT · Text: Milton, Poems (1645) (PD) · Notes: CC BY 4.0 · Laurel: diffusion models
// Fonts: Linden Hill, Imbue, Libre Franklin (SIL OFL 1.1) · Needs postext ≥ 1.25.0
// Lycidas in the spelling of 1645, with a number beside every fifth line and two pages of
// notes keyed to those numbers, so the verse carries no note markers.
import {
buildDocumentWithFonts, renderPageToCanvas, registerResourceImage,
} from 'https://esm.sh/postext';
const LANG = 'en'; // @lang: the language of the sample document ('en')
const RECIPE = 'critical-edition-line-numbers';
// ─── 1 · Design ─────────────────────────────────────────────────────────────
// Black text on white, and one laurel green for the apparatus.
const palette = {
ink: '#1b1b1b', // the text
laurel: '#3c5a3e', // line numbers, note numbers, the kicker
muted: '#6a706a', // running heads, the colophon
paper: '#ffffff',
};
// col(id) carries the hex beside the id of its palette entry.
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' } }));
const [TEXT, DISPLAY, LABEL] = ['Linden Hill', 'Imbue', 'Libre Franklin'];
const LEAD = 14.5; // pt: the leading of the verse, and the grid every page keeps
// #region answer: count the lines, and set every fifth number in the margin
// The poem is one :::verse block, written as 1645 prints it: a line of verse a line, a blank
// line between verse paragraphs and two spaces before a short line. lineNumbers counts its
// lines of verse (a line that turned over would still count once) and prints the multiples
// of five beside their lines, on their baselines. position 'side' puts them in the side
// column of the one-and-a-half layout, flush with its edge next to the verse.
const lineNumbers = {
enabled: true,
count: 'verse', // the lines of :::verse poems; the notes are prose and not counted
interval: 5,
restart: 'document', // one count through the poem
position: 'side',
fontFamily: LABEL, fontSize: pt(7.5), color: col('laurel'),
};
// Hook-up: lineNumbers in the config; the Markdown goes to buildDocument as it is written.
// #endregion
// #region page: a poetry trim, and a channel for the numbers at the fore-edge
const PT = 25.4 / 72; // mm in a point
const [TRIM_W, TRIM_H] = [138, 216]; // mm
يعمل ملف script.js المجمّع كما هو: الصقه في سكربت الوحدة (module) لأي صفحة، أو افتح الوصفة على CodePen. مجلد الوصفة على GitHub ↗ (يفتح في تبويب جديد)
تنويعات
#رقّم كل سطر عاشر
كثيرًا ما تُرقَّم القصائد الطويلة بالعشرات؛ ولا يحتاج العمود ذو 6 مم إلى أي تغيير.
- interval: 5,
+ interval: 10,#أبقِ كل الأرقام إلى يمين الشعر
حين يُوضع العمود الجانبي على اليمين، تقف الأرقام إلى يمين الشعر في كل صفحة، وهذا يضعها عند الكعب في الصفحة الزوجية.
- sideColumnSide: 'outer', // right of the verse on a recto, left of it on a verso
+ sideColumnSide: 'right', // right of the verse on every pageأخطاء شائعة
خطأ شائع
قيم السمات: لا { ولا }؛ ضع القيمة التي فيها " بين علامتي اقتباس مفردتين
تنتهي قيمة السمة عند القوس المعقوف الختامي، فلا يمكن أن تحتوي { أو }. القيمة التي فيها علامة اقتباس مزدوجة توضع بين علامتي اقتباس مفردتين؛ أما علامة الدولار فلا مشكلة فيها. سمات العنوان →
خطأ شائع
يرث نمط العنوان فاصل الصفحة من مستواه
يأخذ مُدخل headingStyles كل حقل يتركه من مستوى عنوانه، بما فيه breakBefore. فصفحة المحتويات أو صفحة بيانات النشر المنسّقة على H1 بعد :::pagebreak ترث الزوجية 'odd' وتقع بعد صفحة فارغة. أعطِ هذا النمط breakBefore: { enabled: false }. أنماط العناوين →
- يُسقَط الفراغ بين المقطعين في رأس الصفحة، فلا يظهر الفاصل بين المقطعين عند السطرين 14 و15، وهو يقع عند الانتقال من الصفحة 1 إلى الصفحة 2. وإن كان على طبعتك أن تُظهر كل فاصل، فأزِح السطر الأول من كل مقطع بدلًا من ذلك، كما تفعل طبعة 1645: مسافتان في أول ذلك السطر.
- تشترك الأرقام في العمود الجانبي مع أي إطار جانبي أو تعليق جانبي تضيفه. والرقم الذي يقع على أحدها يُطبع مع ذلك، ويُصدر عنه Sandbox التحذير
lineNumberOverlap؛ فانقل الإطار، أو ضع الأرقام في الهامش الخارجي بـposition: 'outer'. - ما تزال أرقام الأسطر في الحواشي مكتوبة باليد (
:chip[8]{style="line"}): فلا تستطيع الحاشية بعدُ أن تشير إلى سطر وتطبع رقمه. وإن غيّرت النص، فطابق أرقام الحواشي مع أرقام الهامش.
الحقوق
- الوصفة
- Ignacio Ferro
- النص
- Lycidas, with its headnote, in the text of Poems of Mr. John Milton (1645), pages 57–65, from the proofread Wikisource transcription of the 1927 facsimile; checked against H. C. Beeching’s Oxford text (Project Gutenberg eBook 1745) · John Milton · ملك عام
- The note on the text, the notes and the colophon · Ignacio Ferro · CC BY 4.0
- الصور
- The sprig of bay laurel on the first page, a watercolour · Generated With Diffusion Models · أصلي
- الخطوط
- Linden Hill (SIL OFL 1.1) · Imbue (SIL OFL 1.1) · Libre Franklin (SIL OFL 1.1)
- الشيفرة
- MIT، مثل Postext
حرّر هذا الشرح ↗ (يفتح في تبويب جديد)مجلد الوصفة على GitHub ↗ (يفتح في تبويب جديد)


