Kurz gesagt
Ein großes Poster für eine wissenschaftliche Konferenz über Straßenbäume und Sommerhitze. Es zeigt, wie Kästen mit Text und Diagrammen auf einer sehr großen Seite in Spalten angeordnet werden.
Was Sie setzen
Ein Konferenzposter für eine erfundene Studie über Straßenbäume und Gehweghitze, gesetzt auf einer Seite von 600 × 800 mm. Ein grünes Band enthält die Tagungszeile, den Titel in Bitter in 110 pt, die Autoren mit ihren Institutionszeichen und das Zeichen der School of Geography. Unter einer zweispaltigen Zusammenfassung überquert eine Gruppe :::columns beide Textspalten und setzt sechs Panels in drei Spalten, jedes ein Kasten unter einem Streifen von 6 pt. Die mittlere Spalte beginnt mit −4,2 °C in Orange in 150 pt, dann folgen eine Heatmap der Lufttemperatur nach Block und Stunde, mit Farbfeldern erschlossen, und ein Balkendiagramm des Pflasters. Ein getönter Streifen mit Schlagwort-Chips sitzt auf dem unteren Rand. Dieselbe Datei setzt eine spanische Ausgabe, und der Pen bietet die Seite als PNG von 1.701 × 2.268 px an.
Dieses Rezept beantwortet
- Wie setze ich mitten auf der Seite einen Kasten über beide Spalten, etwa eine dreiteilige „In Zahlen“-Leiste?
- Wie setze ich zwei Spalten in einen Kasten (eine Textspalte neben einer Abbildungsspalte)?
- Wie füge ich Farbfelder als Farblegende in Text, Bildunterschriften oder Tabellenanmerkungen ein?
Die kurze Antwort
// 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') } };
Zutaten
- Funktionen
- Spalten in einem Kasten oder im TextKästen über die SeiteGestaltete AuftakteÜberschriftenattributeGestaltungselemente verankernBilder in SeitengestaltungenFarbfelderInline-ChipsSemantische FarbpaletteKästenAbbildungen genau hierAbsatzformateEndformatSeiten auf einem CanvasNummerierte BildunterschriftenQuellen- und BildnachweiseGleitende KästenGrundlinienrasterKapitelband über die ganze Breite
- Nutzt außerdem
- Literaturverzeichnisse und GlossareVerweise, die Abbildungen platzierenAbbildung und Tabelle in Ihrer SprachePapierfarbeEigene RessourcentypenAbbildungen und Tabellen als RessourcenExpliziter vertikaler Abstand
- Schrift
- Rethink Sans, Bitter, Saira Condensed (SIL OFL 1.1)
- Dateien
- 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)
Zubereitung
#1 · Das Blatt mit 72 dpi setzen
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
Bei den voreingestellten 300 dpi bricht das Poster jede Zeile an derselben Stelle um wie bei 72 dpi, aber seine Seite misst 7.087 × 9.449 px, also 268 MB Pixel, sobald sie gemalt ist (Vorlagen für Seitenformate). Bei 72 dpi ist ein Punkt ein Pixel. Der Betrachter malt seine Miniaturen mit renderPageToCanvas und einem scale, und renderPage liefert das PNG von 1.701 × 2.268 px, das die Online-Galerie einer Tagung verlangt (eine Seite als Bitmap rendern). Der Zeilenabstand teilt die 750 mm zwischen den Rändern in 56 Zeilen, sodass der an den Fuß der Seite gleitende Schlagwortstreifen auf dem unteren Rand endet. Bei runden 38 pt passen nur 55 Zeilen, die letzte 12,7 mm vor dem Rand; der Schlagwortstreifen passt nicht mehr unter die Panels und rückt auf eine zweite Seite.
#2 · Das Titelband aus der Überschrift zeichnen
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) } } },
] } };
Die H1 enthält Tagung, Posternummer, Autoren und Institutionen als Attribute, und ihre Gestaltung setzt sie über einen an der Seite verankerten grünen Kasten von 158 mm Höhe (Span und erweiterte Gestaltung). Der Kasten endet 133 mm unter dem oberen Rand. Ohne minHeight begänne die Zusammenfassung 0,9 mm unter dem Grün; ein minHeight von elf Rasterzeilen lässt 14 mm. Die Institutionszeichen sind die Zeichen ¹ ² ³, die einzigen hochgestellten Ziffern im Bereich Latin-1.
#3 · Die Panels in einer Gruppe über die Seite setzen
// 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') } };
Der Grundtext läuft in zwei Spalten und die Panels in drei, das Raster ist also eine Gruppe :::columns{count=3}, als Container direkt im Text, und span="page" setzt sie über beide Textspalten, unter die Zusammenfassung, mit dem Spaltenabstand der Seite zwischen ihren Spalten (:::columns). Sich selbst überlassen folgt einer Gruppe im Text eine Zeile Absatzabstand, hier 38 pt, und der Schlagwortstreifen rückte auf eine zweite Seite; marginBottom="0.75em" in der öffnenden Zeile tritt an die Stelle dieser Zeile (postext 1.28), und der Streifen passt an den Fuß der Seite. Jedes Panel ist ein Kasten in der Gruppe: Es erhält seinen eigenen Kastenstil, die Spaltenbreite von 175 mm und 18 mm marginTop unter dem Panel darüber (der Container :::callout). breaks="3,4" setzt das dritte Panel, „Results“, an den Kopf der mittleren Spalte und das vierte, „Conclusions“, an den Kopf der letzten. Ohne diese Angabe gleicht die Gruppe aus und trennt beim Panel, das jedem Drittel des Stapels am nächsten liegt. Mit diesem Text liegen die Trennstellen bei denselben zwei Panels; das Attribut hält sie dort, wenn sich der Text ändert.
#4 · Jede Abbildung in ihrem Panel halten
// "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 });
Eine mit 'here' platzierte Abbildung bleibt in dem Panel, in das ::resource sie setzt; mit der voreingestellten Platzierung verlassen die drei Zeichnungen ihre Panels, und das Poster läuft auf eine zweite Seite. numberingTemplate: '{n}' nummeriert sie mit 1, 2, 3, wo das voreingestellte {h1}.{n} unter einem Titel, der eine H1 ist, „Figure 1.1“ ergeben würde (Ressourcentypen). Die Anmerkung unter jeder Legende sagt, dass die Daten synthetisch sind.
#5 · Die Farben der Heatmap mit ihrem Schlüssel teilen
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' } },
];
Die Zellen der Heatmap und die vier Läufe :swatch{color="…"} ihres Schlüssels verweisen auf dieselben Paletteneinträge, sodass ein neuer Wert für cool Karte und Schlüssel zugleich umfärbt (Inline-Formatierung). Der Schlüssel ist eine zweite Gruppe :::columns, zwei Einträge pro Spalte, im Panel „Results“.
#6 · Die Leitzahl in einem Absatzformat setzen
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) } };
Absatzformate gelten auch in Kästen, −4,2 °C ist also ein Block :::paragraphs{style="stat"} in Bitter in 150 pt im Panel „Results“ (Absatzformate). Die Zahl ist fett geschrieben, sie erscheint also in Bitter 700 und in der boldColor des Formats, dem Orange des Panels. Ein zweites Format gibt den Literaturangaben einen hängenden Einzug von 9 mm. Der Schlagwortstreifen ist ein getönter Kasten mit placement="bottom", der unter dem Raster an den Fuß der Seite gleitet.
Das ganze Rezept
// ═══ 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
Das zusammengesetzte script.js läuft unverändert: Fügen Sie es in das Modulskript einer beliebigen Seite ein, oder öffnen Sie das Rezept auf CodePen. Ordner des Rezepts auf GitHub ↗ (öffnet sich in einem neuen Tab)
Varianten
#Das E-Poster mit 150 dpi exportieren
Eine Tagung, die eine größere Datei verlangt, erhält ein PNG von 3.543 × 4.724 px mit denselben Zeilenumbrüchen.
- dpi: 72, backgroundColor: col('paper'),
+ dpi: 150, backgroundColor: col('paper'),Häufige Fehler
- Rethink Sans zeichnet eine einzelne Ziffer in Klammern, etwa die Heftnummer in 11(3), auf dem Canvas als eingekreiste Ziffer; die Literaturangaben nennen daher nur Band und Seiten.
- Ein seitenbreiter Kasten, der das Dokument beendet, rückt auf eine neue Seite, wenn darunter nicht zwei Grundtextzeilen Platz bleiben. Der Schlagwortstreifen gleitet daher mit
placement="bottom", was ihn auf den unteren Rand setzt, in die 50 mm, die unter dem Raster bleiben. containerSpacing: 'add'an den Formatenstatundrefsbeendet ihre Gruppen:::paragraphsmit dem eigenen Abstand des Formats, was −4,2 °C auf der Zeile hält, die es erklärt; jede andere Gruppe des Posters folgt der Regel des Dokuments (seit postext 1.28; davor ließ sich die Regel nur für das ganze Dokument setzen, mitbodyText.paragraphContainerSpacing). Unter der letzten Literaturangabe ist dieser Abstand dasspaceBetweendes Formats, 2,8 mm, sodass ein:::space{lines=0.75}vor der Danksagung 10,8 mm öffnet, nahe an den 10,6 mm zwischen den anderen Absätzen eines Panels. Ohne ihn, unter dem'collapse'des Dokuments, folgt einer Gruppe eine Zeile des Absatzabstands des Panels: Die Danksagung braucht kein:::space, aber die Zeile, die das unter −4,2 °C hinzufügt, schiebt den Schlagwortstreifen auf eine zweite Seite.
Nachweise
- Rezept
- Ignacio Ferro
- Text
- Eigener Text, CC BY 4.0
- Bilder
- 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
- Schriften
- Rethink Sans (SIL OFL 1.1) · Bitter (SIL OFL 1.1) · Saira Condensed (SIL OFL 1.1)
- Code
- MIT, wie Postext
Diesen Text bearbeiten ↗ (öffnet sich in einem neuen Tab)Ordner des Rezepts auf GitHub ↗ (öffnet sich in einem neuen Tab)


