باختصار
ورقة بحثية قصيرة لمؤتمر، في عمودين. يكتب المؤلف رمزًا لكل مصدر؛ فيرقّم Postext الاستشهادات بين أقواس معقوفة، ويحيل إلى الأقسام برقمها وصفحتها، ويطبع قائمة المراجع المرقّمة في النهاية.
ما الذي ستنضده
ورقة من صفحتين لورشة عمل صغيرة في هندسة المستندات، منضّدة على طريقة أعمال مؤتمرات IEEE: ورق US letter، وعمودان عرض كل منهما ثلاث بوصات ونصف، وخط شبيه بـTimes بحجم 10 pt، وأقسام مرقّمة I وII وIII بحروف كبيرة في الوسط. العنوان وكتل المؤلفين الثلاث والملخص والكلمات المفتاحية تمتد على العمودين تحت شريط شاحب بأزرق ورشة العمل، وهو اللون الوحيد في الصفحات. يستشهد المؤلفون بمفاتيح BibTeX؛ فيطبع Postext [1] بترتيب أول استشهاد بالأعمال، ويجمع ثلاثة أعمال متتالية في [2]–[4]، ويكتب «Knuth and Plass [1]» حين تكون الأسماء جزءًا من الجملة، ويبني القائمة المرقّمة في النهاية بحجم 8 pt. الإحالات إلى الأقسام تطبع «Section IV, on p. 2» وتبقى صحيحة حين يتحرك النص.
تجيب هذه الوصفة عن
- كيف أستشهد بالأعمال وأبني قائمة المراجع بأسلوب APA أو IEEE أو أسلوب استشهاد آخر؟
- كيف أحيل إلى قسم والصفحة التي يقع فيها، وأبقي الاثنين صحيحين حين يتغير الكتاب؟
الجواب المختصر
// [@key] prints [1] in order of first citation, @key in the sentence "Knuth and Plass [1]".
registerCitationEngine(createCiteprocEngine({ styles: STYLES, locales: LOCALES }));
// The bundled IEEE style lists [2], [3], [4]; the IEEE editorial guide writes [2]–[4].
// One attribute on the CSL <citation> element makes citeproc-js join the run.
const ieee = STYLES.ieee.replace('<citation>', '<citation collapse="citation-number">');
const citations = {
style: 'custom', customStyle: ieee, // or style: 'ieee' for the file as it ships
link: true,
bibliography: {
fontSize: em(0.8), lineHeight: pt(9.4), // 8 pt on 9.4 pt, two sizes under the text
labelWidth: mm(6), // the [n] column: wide enough for [10], the turnovers align after it
entrySpacing: pt(1.2),
doi: 'text', // printed, not linked: the PDF stays black
},
};
المكونات
- الميزات
- الاستشهادات بأسلوب توثيققائمة المراجع من البيانات المرجعيةالإحالاتالعناوين المرقّمةأنماط العناوينفصول بلا أرقامصفحات افتتاح مصمَّمةإطارات بعرض الصفحةلوحة ألوان دلاليةالتصدير إلى PDF
- تستخدم أيضًا
- إطارات التنبيهاستشهادات تضع الأشكالسمات العنوانالخطوط المضمَّنة في PDFفواصل الأسطر في العناوين
- الخطوط
- STIX Two Text, Schibsted Grotesk (SIL OFL 1.1)
- الأصول
- لا شيء: كل صورة مرسومة بالشيفرة
طريقة التحضير
#1 · أسلوب IEEE بنطاقاته
الشيفرة في الجواب المختصر أعلاه. بعد تسجيله مرة واحدة، ينسّق postext-citeproc كل [@key] بواسطة citeproc-js وأسلوب IEEE بصيغة CSL، ويرقّم الأعمال بترتيب أول استشهاد بها. ملف الأسلوب المضمَّن في المحرّك يسرد ثلاثة أعمال متتالية هكذا: [2]، [3]، [4]؛ أما دليل IEEE التحريري فيجمعها في [2]–[4]. إضافة collapse="citation-number" إلى العنصر <citation> في الأسلوب وتمرير النتيجة بوصفها customStyle يجعلان citeproc-js يفعل ذلك. ويخصّص labelWidth لأرقام القائمة عمودًا خاصًا بها، فيبدأ السطر الثاني من المدخل تحت الكلمة الأولى، لا تحت القوس.
#2 · كتلة عنوان على العمودين
const text = (id, content, size, extra) => ({ kind: 'text', id, content, fontFamily: SERIF,
fontSize: pt(size), color: col('ink'), align: 'center', overflow: 'wrap', ...extra });
const at = (to, edge, x, y, width) => ({ anchor: { to, edge }, offset: { x: mm(x), y: mm(y) },
...(width && { size: { width: mm(width), height: 'auto' } }) });
const AUTHOR_W = MEASURE / 3;
const titleBlock = {
enabled: true,
minHeight: mm(64), // venue line, two lines of title and five of author block
slot: { elements: [
{ kind: 'box', id: 'band', style: { backgroundColor: col('tint') }, // from the trim's top
placement: { anchor: { to: 'page', edge: 'top-left' },
size: { width: 'fill', height: mm(TOP + 66) } } },
text('venue', '{attr.venue}', 7.5, { fontFamily: SANS, fontWeight: 600, color: col('accent'),
letterSpacing: pt(1.2), textTransform: 'uppercase',
placement: at('container', 'top-left', 0, 0, MEASURE) }),
{ kind: 'rule', id: 'venue-rule', thickness: pt(0.5), color: col('rule'),
placement: at('#venue', 'below', 0, 2, MEASURE) },
text('title', '{titleText}', 23, { lineHeight: 1.1, placement: at('#venue', 'below', 0, 7,
MEASURE) }),
...['a1', 'a2', 'a3'].map((id, i) => text(id, `{attr.${id}}`, 9.5, { lineHeight: 1.25,
placement: at('#title', 'below', i * AUTHOR_W, 6, AUTHOR_W) })),
] },
};
العنوان هو العنوان الوحيد من المستوى الأول في المستند، ونمطه paper. يمتد النمط على عرض الصفحة ويرسم العنوان من تصميمه: سطر الملتقى، والعنوان، وثلاث كتل للمؤلفين عرض كل منها ثلث عرض السطر، تُقرأ كل منها من سمة في العنوان يكسر فيها \n الأسطر. والشريط صندوق مربوط بحدّ القص، فيبلغ الحافة العليا للورقة.
#3 · الملخص والكلمات المفتاحية بالعريض
const calloutStyles = [{ id: 'abstract', span: 'page', backgroundEnabled: false,
border: { enabled: false }, stripe: { enabled: true, side: 'top', width: pt(0.5),
color: col('rule') },
padding: { top: mm(3), right: mm(14), bottom: mm(1), left: mm(14) },
marginTop: pt(0), marginBottom: pt(LEAD),
body: { fontSize: pt(9), lineHeight: pt(11), fontWeight: 700, firstLineIndent: pt(0),
textAlign: 'justify', paragraphSpacing: true } }];
إطار ممتد على عرض الصفحة فيه الملخص والكلمات المفتاحية. متنه بحجم 9 pt عريض كما ينضّده IEEE، و***Abstract*—** في النص يُنتج التسمية المائلة مع شرطتها الطويلة. الخط الرفيع في الأعلى هو شريط الإطار، والحشوة تضيّق عرض السطر إلى نحو مئة حرف.
#4 · أقسام مرقّمة وإحالات إليها
const levels = [
{ level: 1, breakBefore: { enabled: true, parity: 'any' } }, // any page: no forced recto
{ level: 2, numberingTemplate: '{2:I}.', numberSeparator: ' ', fontSize: pt(9),
lineHeight: pt(LEAD), fontWeight: 400, letterSpacing: em(0.06), textTransform: 'uppercase',
marginTop: pt(LEAD), marginBottom: pt(0) }, // a line above, none below: at a column's head
// the margin above drops and the text still starts on the next grid line
];
const headingStyles = [
{ id: 'paper', numbered: false, span: 'page', advancedDesign: titleBlock },
{ id: 'back', numbered: false }, // Acknowledgment and References: no number
];
const crossRefs = { section: t({ en: 'Section {n}', es: 'sección {n}' }) };
يرقّم {2:I}. الأقسام I. وII. وIII. والإحالة تطبع الرقم بلا نقطته، فيُنتج :ref{id="sec:results"} «Section IV» من قالب crossRefs، ويُنتج :ref{id="sec:results" style=page} «p. 2». كلاهما يُحسب من الصفحات بعد إخراجها، فيتبعان النص إذا أُضيفت فقرة أو انتقل قسم. وعنوانا Acknowledgment وReferences يأخذان النمط back ويبقيان بلا ترقيم.
const palette = {
ink: '#16181d', accent: '#1d4a7a', tint: '#e9eef5', rule: '#aeb6c2', muted: '#5a606b',
paper: '#ffffff',
};
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º 088 · A two-column conference paper in IEEE style ═══════
// https://postext.dev/en/cookbook/ieee-conference-paper
// Code: MIT · Text: original (CC BY 4.0) · Pictures: none
// Fonts: STIX Two Text, Schibsted Grotesk (SIL OFL 1.1) · Needs postext ≥ 1.65.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 = 'ieee-conference-paper';
// ─── 1 · Design ─────────────────────────────────────────────────────────────
// #region palette: black type on white, with one blue for the workshop's own marks
const palette = {
ink: '#16181d', accent: '#1d4a7a', tint: '#e9eef5', rule: '#aeb6c2', muted: '#5a606b',
paper: '#ffffff',
};
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 [SERIF, SANS] = ['STIX Two Text', 'Schibsted Grotesk'];
// The IEEE conference template in mm: US letter, 0.75 in head, 1 in foot, 0.625 in sides,
// two columns of 3.5 in with 0.25 in between.
const [TRIM_W, TRIM_H, TOP, BOTTOM, SIDE, GUTTER] = [215.9, 279.4, 19, 25.4, 15.9, 6.35];
const MEASURE = TRIM_W - 2 * SIDE;
const LEAD = 12; // pt: 10 pt type on 12 pt, as the template sets it
// #region answer: IEEE numbers, collapsed ranges and a references list with a label column
// [@key] prints [1] in order of first citation, @key in the sentence "Knuth and Plass [1]".
registerCitationEngine(createCiteprocEngine({ styles: STYLES, locales: LOCALES }));
// The bundled IEEE style lists [2], [3], [4]; the IEEE editorial guide writes [2]–[4].
// One attribute on the CSL <citation> element makes citeproc-js join the run.
const ieee = STYLES.ieee.replace('<citation>', '<citation collapse="citation-number">');
const citations = {
style: 'custom', customStyle: ieee, // or style: 'ieee' for the file as it ships
link: true,
bibliography: {
fontSize: em(0.8), lineHeight: pt(9.4), // 8 pt on 9.4 pt, two sizes under the text
labelWidth: mm(6), // the [n] column: wide enough for [10], the turnovers align after it
entrySpacing: pt(1.2),
doi: 'text', // printed, not linked: the PDF stays black
},
};
// #endregion
يعمل ملف script.js المجمّع كما هو: الصقه في سكربت الوحدة (module) لأي صفحة، أو افتح الوصفة على CodePen. مجلد الوصفة على GitHub ↗ (يفتح في تبويب جديد)
تنويعات
#أبقِ الأسلوب كما يأتي
من غير التعديل تُطبع ثلاثة أعمال متتالية واحدًا واحدًا، وهذا ما تفضّله بعض المجلات.
- style: 'custom', customStyle: ieee, // or style: 'ieee' for the file as it ships
+ style: 'ieee',#اكتب النطاقات داخل زوج واحد من الأقواس
بعض الأساليب المرقّمة تطبع [2–4] بدلًا من ذلك. العلامة brackets تكتب الأرقام بنفسها وتجمع المتتالي منها.
- style: 'custom', customStyle: ieee, // or style: 'ieee' for the file as it ships
+ style: 'ieee', marker: 'brackets', collapseRanges: true,أخطاء شائعة
- حين لا ينتهي عمودا الصفحة الأخيرة على مستوى واحد، انظر إلى ما يقع حيث كان سيُقطع النص: لن يترك المحرّك عنوان قسم في أسفل عمود بعيدًا عن نصه، ويتخلّى عن القطع بدلًا من ذلك. جملة زائدة أو ناقصة في الأقسام الأخيرة تنقل موضع القطع إلى ما بعد العنوان.
- أوامر BibTeX مثل
{\TeX}لا تُوسَّع. اكتبThe {TeX}book؛ فالأقواس المعقوصة تُبقي الحروف الكبيرة على حالها.
الحقوق
- الوصفة
- Ignacio Ferro
- النص
- نص أصلي, CC BY 4.0
- الخطوط
- STIX Two Text (SIL OFL 1.1) · Schibsted Grotesk (SIL OFL 1.1)
- الشيفرة
- MIT، مثل Postext
حرّر هذا الشرح ↗ (يفتح في تبويب جديد)مجلد الوصفة على GitHub ↗ (يفتح في تبويب جديد)


