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

دليل الوصفات · الفصل 1 · الصفحة والشبكة

ملصق بحثي على صفحة واحدة كبيرة

ملصق مؤتمر 600 × 800 مم: شريط عنوان فوق مجموعة بعرض الصفحة فيها ثلاثة أعمدة من اللوحات، وخريطة حرارية مفتاحها عيّنات لونية، و−4.2 °C بحجم 150 نقطة.

  • نموذج باللغة الإنجليزية: لا توجد طبعة عربية بعد
  • مقاس القص 600 × 800 مم
  • عمودان, فاصل 12 مم بين الأعمدة
  • Rethink Sans 28/38
  • Bitter
  • Saira Condensed
  • صفحة واحدة
  • المستوى
  • Postext 1.57.1
  • أُخرجت في 63 ms
  • أسطر الشيفرة: 203

باختصار

ملصق كبير لمؤتمر علمي عن أشجار الشوارع وحرّ الصيف. يبيّن كيف ترتّب إطارات النص والرسوم البيانية في أعمدة على صفحة واحدة كبيرة جدًا.

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

ملصق مؤتمر لدراسة متخيَّلة عن أشجار الشوارع وحرارة الأرصفة، منضّد على صفحة واحدة مقاسها 600 × 800 مم. على شريط أخضر اسم الملتقى، والعنوان بخط Bitter بحجم 110 نقاط، والمؤلفون مع علامات انتماءاتهم، وشعار كلية الجغرافيا (School of Geography). تحت ملخص من عمودين، تعبر مجموعة :::columns واحدة عمودي المتن وتنضّد ست لوحات في ثلاثة أعمدة، كل منها إطار تحت شريط سماكته 6 نقاط. يبدأ العمود الأوسط بـ −4.2 °C بالبرتقالي بحجم 150 نقطة، ثم خريطة حرارية للهواء حسب الكتلة السكنية والساعة، مفتاحها عيّنات لونية، ثم رسم بياني بالأعمدة لأنواع الرصف. ويقع شريط ملوّن من شارات الكلمات المفتاحية على الهامش السفلي. ينضّد الملف نفسه طبعة إسبانية، ويقدّم المثال الصفحة صورةَ PNG بمقاس 1,701 × 2,268 بكسل.

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

  • كيف أنضد إطارًا بعرض العمودين في منتصف الصفحة، مثل لوحة «بالأرقام» من ثلاث خانات؟
  • كيف أضع عمودين داخل إطار (عمود نص بجانب عمود شكل)؟
  • كيف أضيف عيّنات لونية دليلية إلى النص أو التعليقات أو ملاحظات الجداول؟

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

script.js · الأسطر 86–107في الشيفرة الكاملة
// The body text runs in two columns and the panels in three: a :::columns group in the
// text, and span="page" lays it across both body columns, the gutter apart.
//   :::columns{count=3 breaks="3,4" span="page" marginBottom="0.75em"}
//                                             ← panel 3 opens column 2, panel 4 column 3
//   :::callout{type="panel" title="Introduction"}   ← each panel is a box in the group
//   …
//   :::                                       ← closes the panel; then the other panels
//   :::                                       ← closes the columns group
// marginBottom sets the space under the group: without it the group is followed by a
// line of the summary's paragraph spacing, 38 pt.
// A box in a group takes the width of its column. Its one device is a 6 pt stripe along
// the top.
const panel = { id: 'panel', backgroundEnabled: false,
  stripe: { enabled: true, side: 'top', width: pt(6), color: col('canopy') },
  padding: { top: mm(5), right: pt(0), bottom: pt(0), left: pt(0) },
  titleStyle: { fontFamily: 'Saira Condensed', fontSize: pt(40), fontWeight: 700,
    textTransform: 'uppercase', letterSpacing: pt(4), color: col('canopy'), gap: mm(4) },
  body: { fontSize: pt(22), lineHeight: pt(30) }, // the rest follows bodyText
  marginTop: mm(18) };
const results = { ...panel, id: 'results', // the finding: the same panel, striped in heat
  stripe: { ...panel.stripe, color: col('heat') },
  titleStyle: { ...panel.titleStyle, color: col('heat') } };

المكونات

الخطوط
Rethink Sans, Bitter, Saira Condensed (SIL OFL 1.1)
الأصول
  • The plan of the street, the heat map, the bar chart and the School of Geography's mark, drawn in code from synthetic data in the poster's palette (Ignacio Ferro, CC BY 4.0)

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

#1 · أخرج الورقة بدقة 72 نقطة في البوصة

script.js · الأسطر 38–48في الشيفرة الكاملة
const SHEET = { width: 600, height: 800, margin: 25 }; // mm: a portrait board, 25 mm all round
const GAP = 12; // mm between the two body columns and between the three panel columns
// The summary's leading is the page's baseline grid: 56 lines fill the 750 mm between the
// margins, so a box floated to the foot of the page ends on the bottom margin.
const LEAD = (((SHEET.height - 2 * SHEET.margin) / 25.4) * 72) / 56; // 37.96 pt
const page = { width: mm(SHEET.width), height: mm(SHEET.height),
  // At 72 dpi a point is a pixel: the page is 1,701 × 2,268 px. The default 300 dpi would give
  // 7,087 × 9,449 px (268 MB of canvas) for the same line breaks.
  dpi: 72, backgroundColor: col('paper'),
  margins: { top: mm(SHEET.margin), bottom: mm(SHEET.margin), left: mm(SHEET.margin),
    right: mm(SHEET.margin) } }; // one sheet, nothing to mirror

بالدقة الافتراضية، 300 نقطة في البوصة، يكسر الملصق كل سطر حيث يكسره بدقة 72، لكن صفحته تبلغ 7,087 × 9,449 بكسل، أي 268 ميغابايت من البكسلات بعد رسمها (مقاسات الصفحات الجاهزة). وبدقة 72 نقطة في البوصة تساوي النقطة بكسلًا واحدًا. يرسم العارض صوره المصغّرة بـrenderPageToCanvas مع scale، وتُنتج renderPage صورة PNG بمقاس 1,701 × 2,268 بكسل التي يطلبها المعرض الإلكتروني للملتقى (رسم صفحة في صورة نقطية). يقسم تباعد الأسطر مسافة 750 مم الواقعة بين الهامشين إلى 56 سطرًا، فينتهي شريط الكلمات المفتاحية العائم إلى أسفل الصفحة على الهامش السفلي. وبقيمة مدوّرة قدرها 38 نقطة لا يتسع إلا 55 سطرًا، آخرها يقصر عن الهامش بمقدار 12.7 مم؛ فلا يعود شريط الكلمات المفتاحية يتسع تحت اللوحات وينتقل إلى صفحة ثانية.

#2 · ارسم شريط العنوان من العنوان

script.js · الأسطر 53–82في الشيفرة الكاملة
const BAND = 158; // mm from the top edge to the foot of the green field
const type = (id, content, family, size, look, placement) => ({ kind: 'text', id, content,
  fontFamily: family, fontSize: pt(size), color: col('paper'), align: 'left',
  overflow: 'wrap', lineHeight: 1.2,
  ...look, placement });
const band = { enabled: true,
  // The field ends 133 mm under the top margin; eleven grid lines (147 mm) start the summary
  // 14 mm below it.
  minHeight: pt(11 * LEAD),
  slot: { elements: [
    { kind: 'box', id: 'field', style: { backgroundColor: col('canopy') },
      placement: { ...at('page', 'top-left'), size: { width: 'fill', height: mm(BAND) } } },
    type('meeting', '{attr.meeting}', 'Saira Condensed', 22, { fontWeight: 600,
      textTransform: 'uppercase', letterSpacing: pt(3.5), color: col('tint') },
    { ...at('page', 'top-left', SHEET.margin, 18), size: { width: mm(420) } }),
    type('title', '{titleText}', 'Bitter', 110, { fontWeight: 800, lineHeight: 1 },
      { ...at('#meeting', 'below', 0, 7), size: { width: mm(380) } }),
    type('authors', '{attr.authors}', 'Rethink Sans', 30, { fontWeight: 700 },
      { ...at('#title', 'below', 0, 7), size: { width: 'fill' } }),
    // The affiliation marks are the characters ¹ ² ³, typed in the heading's attributes.
    type('affiliations', '{attr.affiliations}', 'Rethink Sans', 21, { color: col('tint') },
      { ...at('#authors', 'below', 0, 2), size: { width: 'fill' } }),
    type('number', '{attr.poster}', 'Saira Condensed', 30, { fontWeight: 700,
      color: col('canopy'), box: { backgroundColor: col('paper'),
        padding: { top: mm(1.5), right: mm(4), bottom: mm(1), left: mm(4) } } },
    at('page', 'top-right', -SHEET.margin, 15)),
    // The School of Geography's mark, drawn in code.
    { kind: 'image', id: 'mark', resourceId: 'mark',
      placement: { ...at('page', 'top-right', -SHEET.margin, 38), size: { width: mm(92) } } },
  ] } };

يتضمّن عنوان H1 اسم الملتقى ورقم الملصق والمؤلفين والانتماءات على هيئة سمات، ويضعها تصميمه فوق صندوق أخضر مربوط بالصفحة عمقه 158 مم (الامتداد والتصميم المتقدم). ينتهي الصندوق على بعد 133 مم تحت الهامش العلوي. من دون minHeight كان الملخص سيبدأ على بعد 0.9 مم تحت الأخضر؛ وminHeight بأحد عشر سطرًا من الشبكة تترك 14 مم. علامات الانتماء هي المحارف ¹ ² ³، وهي الأرقام العلوية الوحيدة في نطاق Latin-1.

#3 · نضّد اللوحات في مجموعة واحدة عبر الصفحة

script.js · الأسطر 86–107في الشيفرة الكاملة
// The body text runs in two columns and the panels in three: a :::columns group in the
// text, and span="page" lays it across both body columns, the gutter apart.
//   :::columns{count=3 breaks="3,4" span="page" marginBottom="0.75em"}
//                                             ← panel 3 opens column 2, panel 4 column 3
//   :::callout{type="panel" title="Introduction"}   ← each panel is a box in the group
//   …
//   :::                                       ← closes the panel; then the other panels
//   :::                                       ← closes the columns group
// marginBottom sets the space under the group: without it the group is followed by a
// line of the summary's paragraph spacing, 38 pt.
// A box in a group takes the width of its column. Its one device is a 6 pt stripe along
// the top.
const panel = { id: 'panel', backgroundEnabled: false,
  stripe: { enabled: true, side: 'top', width: pt(6), color: col('canopy') },
  padding: { top: mm(5), right: pt(0), bottom: pt(0), left: pt(0) },
  titleStyle: { fontFamily: 'Saira Condensed', fontSize: pt(40), fontWeight: 700,
    textTransform: 'uppercase', letterSpacing: pt(4), color: col('canopy'), gap: mm(4) },
  body: { fontSize: pt(22), lineHeight: pt(30) }, // the rest follows bodyText
  marginTop: mm(18) };
const results = { ...panel, id: 'results', // the finding: the same panel, striped in heat
  stripe: { ...panel.stripe, color: col('heat') },
  titleStyle: { ...panel.titleStyle, color: col('heat') } };

يجري المتن في عمودين واللوحات في ثلاثة، لذا فالشبكة مجموعة :::columns{count=3} مكتوبة مباشرة في النص، وspan="page" يضعها عبر عمودي المتن، تحت الملخص، ويفصل بين أعمدتها الفاصل بين عمودي الصفحة (:::columns). وإن تُركت المجموعة في النص على حالها تبعها سطر من المسافة بين الفقرات، 38 pt هنا، فينتقل شريط الكلمات المفتاحية إلى صفحة ثانية؛ أما marginBottom="0.75em" في سطر الفتح فتحلّ محلّ ذلك السطر (postext 1.28)، فيتّسع أسفل الصفحة للشريط. كل لوحة إطار (callout) داخل المجموعة: يأخذ نمطه الخاص، وعرض العمود البالغ 175 مم، و18 مم من marginTop تحت اللوحة التي فوقه (الحاوية :::callout). يرسل breaks="3,4" اللوحة الثالثة، Results، إلى رأس العمود الأوسط، والرابعة، Conclusions، إلى رأس العمود الأخير. ومن دونه توازن المجموعة أعمدتها وتقطع عند اللوحة الأقرب إلى كل ثلث من الكومة. بهذا النص تقع نقاط القطع عند اللوحتين نفسيهما؛ أما السمة فتبقيها هناك حين يتغير النص.

#4 · أبقِ كل شكل في لوحته

script.js · الأسطر 156–163في الشيفرة الكاملة
// "Figure 1", not "Figure 1.1": the poster has no chapters.
const figureType = { ...defaultResourceTypes(LANG)[0], numberingTemplate: '{n}' };
const resourceTypes = [figureType];
const figure = (id, [width, height], caption, altText) => ({ id, typeId: figureType.id,
  kind: 'svg', svg: { fileId: `${id}.svg`, width: width * 10, height: height * 10 },
  placement: { position: 'here' }, // stays in its panel, where ::resource puts it; else floats
  caption, altText, note: t({ en: 'Synthetic data, generated for this poster.',
    es: 'Datos sintéticos, generados para este póster.' }), createdAt: 0, updatedAt: 0 });

الشكل الموضوع 'here' يبقى في اللوحة التي يضعه فيها ::resource؛ أما بالموضع الافتراضي فتغادر الرسوم الثلاثة لوحاتها ويمتد الملصق إلى صفحة ثانية. يرقّمها numberingTemplate: '{n}' بـ 1 و2 و3، بينما يطبع القالب الافتراضي {h1}.{n} عبارة Figure 1.1 تحت عنوان هو H1 (أنواع الموارد). وتذكر الملاحظة تحت كل تعليق أن البيانات اصطناعية.

#5 · اجعل ألوان الخريطة الحرارية هي ألوان مفتاحها

script.js · الأسطر 15–34في الشيفرة الكاملة
const palette = {
  ink: '#102a2c', // text: a green-black
  paper: '#f7faf7', // the sheet, and type on the band
  canopy: '#2e7d4f', // the band, the stripes and titles of five panels, the tree crowns
  tint: '#e6f2ea', // the keyword strip, the park on the plan, lines of type on the band
  rule: '#bcd2c4', // buildings on the plan, the chart's grid
  muted: '#587068', // the notes under the figures, the axis titles inside them
  // The key of Figure 2, the air against the street mean at the same hour. The heat map's
  // cells and the :swatch runs of its key read the same four entries.
  cool: '#3b82c4', // −1.5 °C or less
  mist: '#a9c9e6', // −1.5 to 0 °C
  blush: '#f2b492', // 0 to +1.5 °C
  heat: '#d9572b', // +1.5 °C or more; also −4.2 °C, the Results panel, the loggers, the sun
};
// Every colour is linked to its palette entry by id.
const col = (id) => ({ hex: palette[id], model: 'hex', paletteId: id });
const colorPalette = [ // defaults link to 'main-color': point it at the canopy green
  ...Object.entries(palette).map(([id, hex]) => ({ id, name: id, value: { hex, model: 'hex' } })),
  { id: 'main-color', name: 'canopy (defaults)', value: { hex: palette.canopy, model: 'hex' } },
];

تشير خلايا الخريطة الحرارية والمقاطع الأربعة :swatch{color="…"} في مفتاحها إلى مداخل لوحة الألوان نفسها، فقيمة جديدة لـcool تعيد تلوين الخريطة والمفتاح معًا (التنسيق داخل السطر). المفتاح مجموعة :::columns ثانية، فيها مدخلان في كل عمود، داخل لوحة Results.

#6 · نضّد الرقم الرئيسي بنمط فقرة

script.js · الأسطر 111–128في الشيفرة الكاملة
const paragraphStyles = [
  // Paragraph styles apply inside boxes. The figure is written **bold**: that sets it in
  // Bitter 700 and in the style's boldColor.
  // containerSpacing 'add': the group ends on the style's own space, with no line of
  // paragraph spacing under it. −4.2 °C sits on the line that explains it, and a :::space
  // sets the gap under the references.
  { id: 'stat', fontFamily: 'Bitter', fontSize: pt(150), lineHeight: pt(130),
    boldColor: col('heat'), containerSpacing: 'add' },
  { id: 'refs', fontSize: pt(19), lineHeight: pt(26), hangingIndent: mm(9), spaceBetween: pt(8),
    containerSpacing: 'add' },
  { id: 'key', fontSize: pt(19), lineHeight: pt(28) }, // the key of Figure 2
];
const chipStyles = [{ id: 'keyword', background: col('paper'), borderColor: col('canopy'),
  borderWidth: pt(1.5), borderRadius: em(1), paddingX: em(0.55), paddingY: em(0.14),
  color: col('canopy'), bold: true, gap: em(0.35) }];
const strip = { id: 'strip', background: col('tint'), // one device: a tint
  padding: { top: mm(4), right: mm(8), bottom: mm(4), left: mm(8) }, columnGap: mm(GAP),
  body: { fontSize: pt(18), lineHeight: pt(24) } };

أنماط الفقرات تعمل داخل الإطارات، لذا فإن −4.2 °C كتلة :::paragraphs{style="stat"} بخط Bitter بحجم 150 نقطة داخل لوحة Results (أنماط الفقرات). يُكتب الرقم بخط عريض، فيُطبع بـBitter 700 وبلون boldColor في النمط، برتقالي اللوحة. ويمنح نمط ثانٍ المراجع إزاحة معلّقة قدرها 9 مم. شريط الكلمات المفتاحية إطار ملوّن بـplacement="bottom"، يطفو إلى أسفل الصفحة تحت الشبكة.

الوصفة كاملة

Sandbox
// ═══ Postext Cookbook · Nº 059 · Research poster on one big page ══════════════════
// https://postext.dev/en/cookbook/research-poster
// Code: MIT · Text and data: original, synthetic (CC BY 4.0) · Figures: generated in code
// Fonts: Rethink Sans, Bitter, Saira Condensed (SIL OFL 1.1) · Needs postext ≥ 1.28.0
import {
  buildDocumentWithFonts, renderPage, renderPageToCanvas, registerResourceImage,
  defaultResourceTypes, inlineSvgFonts,
} from 'https://esm.sh/postext';

const LANG = 'en'; // @lang: the language of the sample document ('en' | 'es')
const RECIPE = 'research-poster';

// ─── 1 · Design ─────────────────────────────────────────────────────────────
// #region palette: six colours for the poster, four for the heat map's key
const palette = {
  ink: '#102a2c', // text: a green-black
  paper: '#f7faf7', // the sheet, and type on the band
  canopy: '#2e7d4f', // the band, the stripes and titles of five panels, the tree crowns
  tint: '#e6f2ea', // the keyword strip, the park on the plan, lines of type on the band
  rule: '#bcd2c4', // buildings on the plan, the chart's grid
  muted: '#587068', // the notes under the figures, the axis titles inside them
  // The key of Figure 2, the air against the street mean at the same hour. The heat map's
  // cells and the :swatch runs of its key read the same four entries.
  cool: '#3b82c4', // −1.5 °C or less
  mist: '#a9c9e6', // −1.5 to 0 °C
  blush: '#f2b492', // 0 to +1.5 °C
  heat: '#d9572b', // +1.5 °C or more; also −4.2 °C, the Results panel, the loggers, the sun
};
// Every colour is linked to its palette entry by id.
const col = (id) => ({ hex: palette[id], model: 'hex', paletteId: id });
const colorPalette = [ // defaults link to 'main-color': point it at the canopy green
  ...Object.entries(palette).map(([id, hex]) => ({ id, name: id, value: { hex, model: 'hex' } })),
  { id: 'main-color', name: 'canopy (defaults)', value: { hex: palette.canopy, model: 'hex' } },
];
// #endregion

// #region sheet: one 600 × 800 mm page, laid out at 72 dpi
const SHEET = { width: 600, height: 800, margin: 25 }; // mm: a portrait board, 25 mm all round
const GAP = 12; // mm between the two body columns and between the three panel columns
// The summary's leading is the page's baseline grid: 56 lines fill the 750 mm between the
// margins, so a box floated to the foot of the page ends on the bottom margin.
const LEAD = (((SHEET.height - 2 * SHEET.margin) / 25.4) * 72) / 56; // 37.96 pt
const page = { width: mm(SHEET.width), height: mm(SHEET.height),
  // At 72 dpi a point is a pixel: the page is 1,701 × 2,268 px. The default 300 dpi would give
  // 7,087 × 9,449 px (268 MB of canvas) for the same line breaks.
  dpi: 72, backgroundColor: col('paper'),
  margins: { top: mm(SHEET.margin), bottom: mm(SHEET.margin), left: mm(SHEET.margin),
    right: mm(SHEET.margin) } }; // one sheet, nothing to mirror

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

تنويعات

#صدّر الملصق الإلكتروني بدقة 150 نقطة في البوصة

الملتقى الذي يطلب ملفًا أكبر يحصل على صورة PNG بمقاس 3,543 × 4,724 بكسل بفواصل الأسطر نفسها.

-  dpi: 72, backgroundColor: col('paper'),
+  dpi: 150, backgroundColor: col('paper'),

أخطاء شائعة

  • يرسم Rethink Sans الرقم المفرد بين قوسين، مثل رقم العدد في 11(3)، رقمًا داخل دائرة في Canvas، لذا لا تذكر المراجع إلا المجلد والصفحات.
  • ينتقل الإطار الممتد على الصفحة الذي يختم المستند إلى صفحة جديدة ما لم يبقَ تحته متسع لسطرين من المتن. لذلك يطفو شريط الكلمات المفتاحية بـplacement="bottom"، الذي يضعه على الهامش السفلي، في مسافة 50 مم الباقية تحت الشبكة.
  • تُنهي containerSpacing: 'add' في النمطين stat وrefs مجموعات :::paragraphs التابعة لهما بمسافة النمط نفسه، فيبقى −4.2 °C ملاصقًا للسطر الذي يشرحه؛ أما بقية مجموعات الملصق فتتبع قاعدة المستند (منذ postext 1.28؛ وقبله لم تكن القاعدة تُضبط إلا للمستند كله، عبر bodyText.paragraphContainerSpacing). وتحت آخر مرجع هذه المسافة هي spaceBetween في النمط، 2.8 مم، ولذلك يفتح :::space{lines=0.75} قبل فقرة الشكر 10.8 مم، قريبًا من 10.6 مم بين فقرات اللوحة الأخرى. ومن دونها، مع 'collapse' في المستند، يتبع المجموعةَ سطرٌ من المسافة بين فقرات اللوحة: فلا تحتاج فقرة الشكر إلى :::space، لكن السطر المضاف تحت −4.2 °C يدفع شريط الكلمات المفتاحية إلى صفحة ثانية.

الحقوق

الوصفة
Ignacio Ferro
النص
نص أصلي, CC BY 4.0
الصور
  • The plan of the street, the heat map, the bar chart and the School of Geography's mark, drawn in code from synthetic data in the poster's palette · Ignacio Ferro · CC BY 4.0
الخطوط
Rethink Sans (SIL OFL 1.1) · Bitter (SIL OFL 1.1) · Saira Condensed (SIL OFL 1.1)
الشيفرة
MIT، مثل Postext
Sandbox