باختصار
فصل من أطروحة دكتوراه. يكتب المؤلف رمزًا قصيرًا لكل مصدر، فيطبع Postext الاستشهادات وقائمة المراجع في آخر الفصل بأسلوب APA.
ما الذي ستنضده
الفصل الثاني من أطروحة دكتوراه في التربية، وهو مراجعة الأدبيات: ما تقوله عشرون سنة من الدراسات عن القراءة على الورق وعلى الشاشات. يُنضَّد الفصل على صفحة A4 مجلّدة من اليسار، بخط Literata وتباعد أسطر 16 نقطة، تحت شريط باهت بلون الجامعة الأزرق. يحفظ المؤلف مصادره في Zotero ويلصق ما يصدّره منه بصيغة BibTeX؛ وكل مصدر في النص مفتاح. ينسّق Postext كل استشهاد بنمط APA 7، فيذكر المؤلف والسنة والصفحة إن وُجدت، ويكتب "Delgado et al. (2018)" حين يكون الاسم جزءًا من الجملة، ويبني قائمة المراجع بالترتيب والشكل اللذين يطلبهما النمط. وحين يطلب المشرف نمط Chicago، يكون النمط هو السطر الوحيد الذي يتغيّر.
تجيب هذه الوصفة عن
- كيف أستشهد بالأعمال وأبني قائمة المراجع بأسلوب APA أو IEEE أو أسلوب استشهاد آخر؟
الجواب المختصر
// Citations are written [@key, p. 33] and formatted by citeproc-js in the chosen CSL
// style; the references come from the BibTeX block at the end of the chapter. Register
// the engine once, before the first build, then the style is one setting.
registerCitationEngine(createCiteprocEngine({ styles: STYLES, locales: LOCALES }));
const citations = {
style: 'apa', // 'chicago-author-date', 'ieee', 'vancouver'… change nothing else
link: true, // each citation jumps to its entry in the PDF and on screen
bibliography: {
// APA asks for a half-inch hanging indent and keeps the list in the text size.
fontSize: em(1), hangingIndent: mm(12.7), entrySpacing: pt(4),
doi: 'link', // printed whole, as APA wants, and clickable
},
};
المكونات
- الميزات
- الاستشهادات بأسلوب توثيققائمة المراجع من البيانات المرجعيةالإحالاتالعناوين المرقّمةأنماط العناوينفصول بلا أرقامصفحات افتتاح مصمَّمةالترويسات وأرقام الصفحاتلوحة ألوان دلاليةالتصدير إلى PDF
- الخطوط
- Literata, Public Sans (SIL OFL 1.1)
- الأصول
- لا شيء: كل صورة مرسومة بالشيفرة
طريقة التحضير
#1 · محرّك واحد ونمط واحد
الشيفرة هي الجواب المختصر أعلاه. يقرأ Postext الاستشهادات ويترك صياغتها لمحرّك استشهاد يُسجَّل مرة واحدة قبل أول بناء؛ والحزمة postext-citeproc تغلّف citeproc-js، المحرّك الذي يستعمله Zotero وMendeley، ومعها ستة عشر نمط CSL وملفات لغاتها. يُنتج [@mangen2013] النص "(Mangen et al., 2013)"، ويضع @delgado2018 بلا أقواس معقوفة أسماء المؤلفين داخل الجملة، وينقل [@ibanez2023, pp. 12–15] نطاق الصفحات إلى داخل القوسين. وإذا كانت لغة المستند الإسبانية، أخذت المفاتيح نفسها أدوات الربط والاختصارات من ملف اللغة الإسبانية، لأن المحرّك يتبع لغة المستند.
#2 · المراجع تأتي من كتلة BibTeX
آخر كتلة في الفصل هي :::references{format=bibtex} وفيها ما صدّره المؤلف من Zotero ملصوقًا كما هو، والحروف المشكولة مكتوبة على هيئة {\'a}. يضع :::bibliography فوقها القائمة تحت عنوان References؛ وبدونه يُلحق Postext القائمة بآخر الفصل. لا تظهر إلا الأعمال المستشهد بها، مرتبةً كما يرتبها APA، وكل استشهاد في النص رابط إلى مدخله.
#3 · عنوان بلا رقم وإحالات بالكلمات
headingStyles: [{ id: 'references', numbered: false }],
crossRefs: { section: t({ en: 'Section {n}', es: 'Sección {n}' }) },
يأخذ عنوان المراجع النمط references، فيبقى في جدول المحتويات خارج الترقيم، ولا تصير القائمة القسم 2.4. ويطبع :ref{id="sec-speed"} النص "Section 2.2" من تسمية crossRefs ويربطه بالعنوان؛ وتأتي الأرقام من startAt=2 على عنوان الفصل، وهو العدّاد نفسه الذي تستعمله العناوين.
#4 · صفحة الافتتاح داخل شريط
const BAND = 92; // mm from the trim's top
const opener = {
enabled: true,
minHeight: mm(BAND - 28 + 10), // the body starts 10 mm under the band
slot: { elements: [
{ kind: 'box', id: 'band', style: { backgroundColor: col('tint') },
placement: { anchor: { to: 'page', edge: 'top-left' },
size: { width: 'fill', height: mm(BAND) } } },
{ kind: 'text', id: 'label', content: t({ en: 'Chapter', es: 'Capítulo' }),
fontFamily: LABEL, fontSize: pt(9), fontWeight: 600, letterSpacing: pt(1.8),
textTransform: 'uppercase',
color: col('accent'), align: 'left',
placement: { anchor: { to: 'container', edge: 'top-left' },
offset: { x: mm(0), y: mm(2) } } },
{ kind: 'text', id: 'number', content: '{number}', fontFamily: TEXT, fontSize: pt(96),
fontWeight: 300, lineHeight: 0.9, color: col('accent'), align: 'right',
placement: { anchor: { to: 'container', edge: 'top-right' },
offset: { x: mm(0), y: mm(-6) },
size: { width: mm(40), height: 'auto' } } },
{ kind: 'text', id: 'title', content: '{titleText}', fontFamily: TEXT, fontSize: pt(24),
lineHeight: 1.12, fontWeight: 600, color: col('ink'), align: 'left', overflow: 'wrap',
placement: { anchor: { to: 'container', edge: 'top-left' },
offset: { x: mm(0), y: mm(14) },
size: { width: mm(108), height: 'auto' } } },
] },
};
الشريط إطار مربوط بحدّ القص، ويبدأ المتن على بعد 10 مم تحته. يُنضَّد الرقم بخط Literata Light بحجم 96 نقطة إلى اليمين، فيُقرأ شكلًا ويترك للعنوان عرض السطر كاملًا.
const palette = {
ink: '#1b1b1f', accent: '#22406a', tint: '#e6ecf4', rule: '#b9bec8', muted: '#5d6370',
};
const col = (id) => ({ hex: palette[id], model: 'hex', paletteId: id });
const colorPalette = Object.entries({ ...palette, 'main-color': palette.accent })
.map(([id, hex]) => ({ id, name: id, value: { hex, model: 'hex' } }));
الوصفة كاملة
// ═══ Postext Cookbook · Nº 087 · A thesis chapter cited in APA 7 ═══════════════════
// https://postext.dev/en/cookbook/apa-thesis-with-bibtex
// Code: MIT · Text: original (CC BY 4.0) · Pictures: none
// Fonts: Literata, Public Sans (SIL OFL 1.1) · Needs postext ≥ 1.57.0
import {
buildDocumentWithFonts, renderPageToCanvas, registerCitationEngine,
} from 'https://esm.sh/postext';
import { renderToPdf, decompressWoff2 } from 'https://esm.sh/postext-pdf';
import { createCiteprocEngine, STYLES, LOCALES } from 'https://esm.sh/postext-citeproc';
const LANG = 'en'; // @lang: the language of the sample document ('en' | 'es')
const RECIPE = 'apa-thesis-with-bibtex';
// ─── 1 · Design ─────────────────────────────────────────────────────────────
// #region palette: a thesis prints in black; the one colour is the university's
const palette = {
ink: '#1b1b1f', accent: '#22406a', tint: '#e6ecf4', rule: '#b9bec8', muted: '#5d6370',
};
const col = (id) => ({ hex: palette[id], model: 'hex', paletteId: id });
const colorPalette = Object.entries({ ...palette, 'main-color': palette.accent })
.map(([id, hex]) => ({ id, name: id, value: { hex, model: 'hex' } }));
// #endregion
const TEXT = 'Literata', LABEL = 'Public Sans';
const LEAD = 16; // pt: double spacing is a typewriter habit; 1.45 reads as well and fits more
// #region answer: the citation engine, APA 7 and how its references look
// Citations are written [@key, p. 33] and formatted by citeproc-js in the chosen CSL
// style; the references come from the BibTeX block at the end of the chapter. Register
// the engine once, before the first build, then the style is one setting.
registerCitationEngine(createCiteprocEngine({ styles: STYLES, locales: LOCALES }));
const citations = {
style: 'apa', // 'chicago-author-date', 'ieee', 'vancouver'… change nothing else
link: true, // each citation jumps to its entry in the PDF and on screen
bibliography: {
// APA asks for a half-inch hanging indent and keeps the list in the text size.
fontSize: em(1), hangingIndent: mm(12.7), entrySpacing: pt(4),
doi: 'link', // printed whole, as APA wants, and clickable
},
};
// #endregion
// #region opener: a pale band at the head of the page, the number large and light in it
const BAND = 92; // mm from the trim's top
const opener = {
enabled: true,
minHeight: mm(BAND - 28 + 10), // the body starts 10 mm under the band
slot: { elements: [
{ kind: 'box', id: 'band', style: { backgroundColor: col('tint') },
يعمل ملف script.js المجمّع كما هو: الصقه في سكربت الوحدة (module) لأي صفحة، أو افتح الوصفة على CodePen. مجلد الوصفة على GitHub ↗ (يفتح في تبويب جديد)
تنويعات
#غيّر النمط
الفصل نفسه بنمط Chicago للمؤلف والسنة يحذف الفاصلة بعد الاسم ويذكر السنة بعد المؤلفين.
- style: 'apa', // 'chicago-author-date', 'ieee', 'vancouver'… change nothing else
+ style: 'chicago-author-date',#اجعل القائمة أصغر من النص
تسمح جامعات كثيرة بأن تُنضَّد قائمة المراجع بحجم أصغر بدرجة واحدة وبتباعد أسطر مفرد.
- fontSize: em(1), hangingIndent: mm(12.7), entrySpacing: pt(4),
+ fontSize: em(0.9), lineHeight: pt(13), hangingIndent: mm(12.7), entrySpacing: pt(3),أخطاء شائعة
- يكتب APA عناوين المقالات والكتب بحالة الجملة (الحرف الكبير في أول كلمة فقط)، ويطبع citeproc-js العناوين كما تأتي في البيانات. ويحفظ Zotero معظم العناوين بحالة العنوان (حرف كبير في أول كل كلمة)، فصحّحها في Zotero أو في BibTeX قبل أن تصل إلى الصفحة.
الحقوق
- الوصفة
- Ignacio Ferro
- النص
- نص أصلي, CC BY 4.0
- الخطوط
- Literata (SIL OFL 1.1) · Public Sans (SIL OFL 1.1)
- الشيفرة
- MIT، مثل Postext
حرّر هذا الشرح ↗ (يفتح في تبويب جديد)مجلد الوصفة على GitHub ↗ (يفتح في تبويب جديد)


