باختصار
مقال بحثي طبي قصير مُخرَج كصفحة مجلة. يستشهد المؤلفون برموز، فيطبع Postext أرقامًا صغيرة مرفوعة في النص ويبني قائمة المراجع المرقّمة في آخره، وكل DOI فيها رابط.
ما الذي ستنضده
ثلاث صفحات من مجلة سريرية: مقال أصلي يعرض تجربة تمهيدية، منضَّد على A4 في عمودين كما تطبعه مجلات ICMJE. يعبر أعلى الصفحة الأولى شريط ترويسة أخضر مزرق، فوق نوع المقال، وعنوان من ثلاثة أسطر، والمؤلفين بأرقام انتساب مرفوعة، وملخص منظَّم على خلفية باهتة. يستشهد المؤلفون بمفاتيح BibTeX، وتُظهر الصفحات ما يتوقعه محرر طبي: أرقام صغيرة مرفوعة بعد النقطة، والأعمال المتتالية مضمومة في صورة 6–8، وعملان غير متتاليين متلاصقان بلا مسافة في صورة 6,9، وقائمة مراجع مرقّمة بصيغة NLM، Lancet 2016;387(10022):957–67، تنتهي بـDOI كل عمل. في ملف PDF ينقلك كل رقم إلى مرجعه ويفتح كل DOI المقالَ. التجربة متخيَّلة؛ أما الأعمال الأحد عشر التي تستشهد بها فحقيقية.
تجيب هذه الوصفة عن
- كيف أنضد أرقام الاستشهادات علوية وأجعل معرّفات DOI روابط فعّالة، كما تفعل المجلات الطبية؟
- كيف أستشهد بالأعمال وأبني قائمة المراجع بأسلوب APA أو IEEE أو أسلوب استشهاد آخر؟
الجواب المختصر
// [@key] prints a raised number in order of first citation. English journals set it after
// the full stop, "control.[@ncdrisc2021]"; Spanish ones before it, "controlada[@ncdrisc2021].".
registerCitationEngine(createCiteprocEngine({ styles: STYLES, locales: LOCALES }));
// elsevier-vancouver is the bundled NLM/Vancouver style (citation-sequence). Two edits bring
// its list to the NLM sample references: "1." instead of "[1]", and the issue after the
// volume, 2015;373(22):2103-16.
const vancouver = STYLES['elsevier-vancouver']
.replace('<text variable="citation-number" prefix="[" suffix="]"/>',
'<text variable="citation-number" suffix="."/>')
.replace('<text variable="volume"/>',
'<group><text variable="volume"/><text variable="issue" prefix="(" suffix=")"/></group>');
const citations = {
style: 'custom', customStyle: vancouver,
marker: 'superscript', collapseRanges: true, // raised 1 and 6–8, not [1] and [6–8]
link: true, // each number jumps to its reference, in the PDF and on screen
// 7.8 pt: the eleven societies of reference 5, ACC/AHA/…/PCNA, fit one line whole
bibliography: { fontSize: em(0.84), lineHeight: pt(10.4), entrySpacing: pt(1.6),
labelWidth: mm(5.5), labelAlign: 'right', // a column for the numbers: 9. and 10. end
// together, and every entry's text starts at one x, first line and turnovers alike
doi: 'link' }, // https://doi.org/… printed whole and clickable
};
المكونات
- الميزات
- الاستشهادات بأسلوب توثيققائمة المراجع من البيانات المرجعيةالنص المرتفع والمنخفضأنماط العناوينسمات العنوانصفحات افتتاح مصمَّمةإطارات التنبيهالترويسات وأرقام الصفحاتنمط الجدولأنماط الأرقامنمط التعليقموضع الأشكاللوحة ألوان دلاليةالتصدير إلى PDF
- تستخدم أيضًا
- استشهادات تضع الأشكال«شكل» و«جدول» بلغتكالخروج عن الشبكة عمدًاالترويسات بحسب دور الصفحةالخطوط المضمَّنة في PDFأنواع موارد مخصّصةالأشكال والجداول بوصفها مواردترقيم روماني للصفحات التمهيديةجداول من البياناتفصول بلا أرقام
- الخطوط
- PT Serif, Fira Sans, Fira Sans Condensed (SIL OFL 1.1)
- الأصول
- لا شيء: كل صورة مرسومة بالشيفرة
طريقة التحضير
#1 · فانكوفر، مرفوعًا ومربوطًا
الشيفرة هي الجواب المختصر أعلاه. من بين الأساليب المضمَّنة، elsevier-vancouver هو الذي يتبع Citing Medicine الصادر عن NLM (ترتيب الاستشهاد، والمؤلفون بصيغة Ettehad D, Emdin CA، وستة أسماء ثم et al.، وعناوين المجلات المختصرة)، فهو الملف الذي تبدأ منه. استبدالان نصيان يقرّبان قائمته من المراجع النموذجية لـNLM: يُكتب الرقم 1. بدل [1]، ويأتي العدد بعد المجلد. يضع marker: 'superscript' الاستشهادات أرقامًا مرفوعة أيًّا كان ما يكتبه الأسلوب، ويُبقي doi: 'link' كل عنوان https://doi.org/ رابطًا. يُطبع عملان غير متتاليين متلاصقين، 6,9: فالمسافة بعد الفاصلة كانت ستتمدد مع السطر المضبوط. وفي القائمة يمنح labelWidth الأرقامَ عمودًا خاصًا بها، ويجعل labelAlign: 'right' الرقمين 9. و10. ينتهيان معًا، فيبدأ نص كل مدخل من الموضع نفسه، في سطره الأول كما في أسطره المرحَّلة. أسلوب AMA مضمَّن أيضًا ويرفع أرقامه بنفسه، لكن قائمته تختلف عن فانكوفر في علامات الترقيم ونطاقات الصفحات.
#2 · كتلة عنوان تمتد عبر العمودين
const text = (id, content, family, size, extra) => ({ kind: 'text', id, content, align: 'left',
fontFamily: family, fontSize: pt(size), color: col('ink'), 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 caps = { fontFamily: COND, fontWeight: 600, letterSpacing: pt(1.3),
textTransform: 'uppercase' };
const JOURNAL = t({ en: 'Almenara Medical Journal', es: 'Revista Médica de Almenara' });
const titleBlock = { enabled: true,
minHeight: mm(62), // the abstract and the text start under the note, on both columns
slot: { elements: [
{ kind: 'box', id: 'band', style: { backgroundColor: col('accent') },
placement: { anchor: { to: 'page', edge: 'top-left' },
size: { width: 'fill', height: mm(15) } } },
text('journal', JOURNAL, COND, 9.5, { ...caps, color: col('paper'),
placement: at('page', 'top-left', INNER, 6) }),
text('issue', '{attr.issue}', COND, 9.5, { ...caps, color: col('paper'),
align: 'right', placement: at('page', 'top-right', -OUTER, 6, 60) }),
text('kind', '{attr.kind}', COND, 9, { ...caps, color: col('accent'),
placement: at('container', 'top-left', 0, 0, MEASURE) }),
text('title', '{titleText}', SANS, 19.5, { fontWeight: 600, lineHeight: 1.16,
placement: at('#kind', 'below', 0, 3, MEASURE - 20) }),
text('authors', '{attr.authors}', SERIF, 10.5, { inlineMarks: true, // ^1^ → ¹
placement: at('#title', 'below', 0, 4.5, MEASURE) }),
text('affiliations', '{attr.affiliations}', SANS, 7.4, { inlineMarks: true,
lineHeight: 1.35, color: col('muted'), placement: at('#authors', 'below', 0, 2, MEASURE) }),
{ kind: 'rule', id: 'rule', thickness: pt(0.5), color: col('rule'),
placement: at('#affiliations', 'below', 0, 3, MEASURE) },
text('note', '{attr.note}', SANS, 7.4, { color: col('muted'),
placement: at('#rule', 'below', 0, 1.6, MEASURE) }),
] },
};
عنوان المقال هو العنوان الوحيد من المستوى الأول، بالنمط article، الذي يمتد عبر الصفحة ويرسمه من تصميمه. يأتي نوع المقال والمؤلفون والانتسابات والملاحظة من سمات العنوان. يحوّل inlineMarks الصيغة ^1^ في السمة إلى رقم انتساب مرفوع، ويبدأ \n في الانتسابات سطرًا لكل مؤسسة. الشريط مربوط بحدّ القص، فيبلغ الحافة العليا للورق.
#3 · ملخص منظَّم وإطار للنقاط الرئيسية
const box = (id, bold, more) => ({ id, border: { enabled: false }, snapToGrid: false,
marginTop: pt(LEAD), marginBottom: pt(LEAD),
titleStyle: { ...caps, fontSize: pt(8.5), color: col('accent') }, // run-in labels in bold
body: { fontFamily: SANS, fontSize: pt(8.3), lineHeight: pt(11.2), textAlign: 'left',
firstLineIndent: pt(0), paragraphSpacing: true, boldColor: col(bold) }, ...more });
const calloutStyles = [
box('abstract', 'accent', { background: col('tint'), padding: mm(3.5), marginTop: pt(0) }),
box('keypoints', 'ink', { backgroundEnabled: false, padding: { top: mm(2.5), right: mm(0),
bottom: mm(1), left: mm(0) }, stripe: { enabled: true, side: 'top', width: pt(2.5),
color: col('accent') } }),
];
يشترك الإطاران في نمط نص واحد: Fira Sans بحجم 8.3 pt مع تسميات عريضة في أول الفقرة، وهي النبرة التي يتوقعها القارئ لمادة التلخيص. للملخص خلفية ملوّنة وتسمياته بالأخضر المزرق؛ وتقع النقاط الرئيسية تحت شريط بسمك 2.5 pt وتسمياتها بالحبر. يُبقي snapToGrid: false الحشوة دقيقة، فيلتصق إطار الملخص بنصه.
#4 · الجدول 1 والشكل 1 في رأس العمود
const resources = () => [
{ id: 'tbl-baseline', typeId: 'table', kind: 'table', createdAt: 0, updatedAt: 0,
placement: { position: 'top' },
caption: t({ en: 'Characteristics of the patients at baseline.',
es: 'Características de los pacientes al inicio.' }),
note: t({ en: 'Values are mean (SD) or number (%). BP, blood pressure, in mm Hg.',
es: 'Valores en media (DE) o número (%). PA, presión arterial, en mm Hg.' }),
table: { model: { headerRowCount: 1, columnWidths: [2.2, 1.1, 1.1],
rows: parseTSV(baseline).rows.map((row, r) => row.map(({ content }, c) => ({ content,
...(r === 0 && { isHeader: true }), ...(c > 0 && { align: 'center' }) }))) } } },
{ id: 'fig-home', typeId: 'figure', kind: 'svg', createdAt: 0, updatedAt: 0,
placement: { position: 'top' }, svg: { fileId: 'home.svg', width: 850, height: 520 },
caption: t({ en: 'Mean home systolic pressure by week in the telemonitoring group, with its '
+ '95% confidence interval. The dashed line is the home target of 135\u00a0mm\u00a0Hg.',
es: 'Presión sistólica domiciliaria media por semana en el grupo de telemonitorización, con '
+ 'su intervalo de confianza del 95\u00a0%. La línea discontinua es el objetivo de '
+ '135\u00a0mm\u00a0Hg.' }),
altText: t({ en: 'A line falling from 158 mm Hg in week 1 to 135 mm Hg in week 12.',
es: 'Una línea que baja de 158 mm Hg en la semana 1 a 135 mm Hg en la semana 12.' }) },
];
يُقرأ الجدول من نص مفصول بعلامات الجدولة، كما يصدّره برنامج الجداول، ويُملأ صف رأسه بالأخضر المزرق مع تسميات بيضاء عريضة. يطفو الموردان إلى رأس عمود بعد الفقرة التي تستشهد بهما. وحين تُضبط shortLabel على الاسم الكامل للنوع يطبع :ref (Table 1) كما تكتبه المجلات، ويُبقي numbered: false على العنوان العدّ عند 1 بدل 1.1. وتُصفّ خلاياه بخط Fira Sans مع figureStyle: 'tabular'، فيأخذ كل رقم العرض نفسه وتصطف متوسطات المجموعتين وأعدادها.
const palette = { ink: '#1a1d21', accent: '#0d5c63', tint: '#e5eff0', rule: '#9fb4b6',
muted: '#566065', 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º 095 · A medical article in Vancouver style ══════════════
// https://postext.dev/en/cookbook/medical-article-vancouver
// Code: MIT · Text: original (CC BY 4.0) · Chart: generated in code (CC BY 4.0)
// Fonts: PT Serif, Fira Sans, Fira Sans Condensed (SIL OFL 1.1) · Needs postext ≥ 1.65.0
import {
buildDocumentWithFonts, renderPageToCanvas, registerCitationEngine, registerResourceImage,
defaultResourceTypes, parseTSV, inlineSvgFonts,
} 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 = 'medical-article-vancouver';
// ─── 1 · Design ─────────────────────────────────────────────────────────────
// #region palette: black text, one clinical teal for the journal's own marks
const palette = { ink: '#1a1d21', accent: '#0d5c63', tint: '#e5eff0', rule: '#9fb4b6',
muted: '#566065', 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, COND] = ['PT Serif', 'Fira Sans', 'Fira Sans Condensed'];
const [TRIM_W, TRIM_H, TOP, BOTTOM, INNER, OUTER, GUTTER] = [210, 297, 24, 22, 17, 17, 6];
const MEASURE = TRIM_W - INNER - OUTER;
const LEAD = 12.8; // pt: 9.3 pt type, as journals set two columns of A4
// #region answer: Vancouver numbers as superscripts, a "1." list and DOIs that are links
// [@key] prints a raised number in order of first citation. English journals set it after
// the full stop, "control.[@ncdrisc2021]"; Spanish ones before it, "controlada[@ncdrisc2021].".
registerCitationEngine(createCiteprocEngine({ styles: STYLES, locales: LOCALES }));
// elsevier-vancouver is the bundled NLM/Vancouver style (citation-sequence). Two edits bring
// its list to the NLM sample references: "1." instead of "[1]", and the issue after the
// volume, 2015;373(22):2103-16.
const vancouver = STYLES['elsevier-vancouver']
.replace('<text variable="citation-number" prefix="[" suffix="]"/>',
'<text variable="citation-number" suffix="."/>')
.replace('<text variable="volume"/>',
'<group><text variable="volume"/><text variable="issue" prefix="(" suffix=")"/></group>');
const citations = {
style: 'custom', customStyle: vancouver,
marker: 'superscript', collapseRanges: true, // raised 1 and 6–8, not [1] and [6–8]
link: true, // each number jumps to its reference, in the PDF and on screen
// 7.8 pt: the eleven societies of reference 5, ACC/AHA/…/PCNA, fit one line whole
bibliography: { fontSize: em(0.84), lineHeight: pt(10.4), entrySpacing: pt(1.6),
labelWidth: mm(5.5), labelAlign: 'right', // a column for the numbers: 9. and 10. end
// together, and every entry's text starts at one x, first line and turnovers alike
doi: 'link' }, // https://doi.org/… printed whole and clickable
يعمل ملف script.js المجمّع كما هو: الصقه في سكربت الوحدة (module) لأي صفحة، أو افتح الوصفة على CodePen. مجلد الوصفة على GitHub ↗ (يفتح في تبويب جديد)
تنويعات
#استعمل أسلوب AMA
يرفع أسلوب AMA أرقامه بنفسه ويسرد الأعمال بصيغة doi:10.1056/…؛ احذف التعديلات والعلامة.
- style: 'custom', customStyle: vancouver,
- marker: 'superscript', collapseRanges: true, // raised 1 and 6–8, not [1] and [6–8]
+ style: 'american-medical-association',#اطبع معرّفات DOI بلا روابط
لملف PDF مخصص للطباعة فقط، أبقِ العناوين نصًا أسود عاديًا.
- doi: 'link' }, // https://doi.org/… printed whole and clickable
+ doi: 'text' },#أرقام بين قوسين معقوفين
تكتب بعض مجلات فانكوفر الأرقام على السطر، بين قوسين معقوفين.
- marker: 'superscript', collapseRanges: true, // raised 1 and 6–8, not [1] and [6–8]
+ marker: 'brackets', collapseRanges: true,أخطاء شائعة
خطأ شائع
ترويسة نمط العنوان تسري على قسمه كله
header: { elements: [] } في نمط العنوان يزيل الترويسات حتى العنوان المنسَّق التالي، لا في الافتتاحية وحدها. لإبعادها عن الصفحة الأولى وحدها، أعطِ عناصر الترويسة pages: 'body'. الترويسات وأرقام الصفحات →
- تسري
headerفي نمط العنوان على القسم كله الذي يفتحه ذلك العنوان، فلو وُضعheader: { elements: [] }على العنوان لأزال الترويسات من كل صفحة حتى العنوان المنمَّط التالي. يكفيpages: 'body'على الترويسات لإبعادها عن الصفحة الأولى.
الحقوق
- الوصفة
- Ignacio Ferro
- النص
- نص أصلي, CC BY 4.0
- الخطوط
- PT Serif (SIL OFL 1.1) · Fira Sans (SIL OFL 1.1) · Fira Sans Condensed (SIL OFL 1.1)
- الشيفرة
- MIT، مثل Postext
حرّر هذا الشرح ↗ (يفتح في تبويب جديد)مجلد الوصفة على GitHub ↗ (يفتح في تبويب جديد)


