En pocas palabras
Un póster grande para un congreso científico, sobre los árboles de la calle y el calor. Enseña a ordenar en columnas recuadros de texto y gráficos en una sola página muy grande.
Lo que vas a componer
Un póster de congreso de 600 × 800 mm para un estudio inventado sobre arbolado viario y calor en la acera. Una banda verde lleva el nombre del encuentro, el título en Bitter a 110 pt, los autores con sus filiaciones y la marca del Departamento de Geografía. Bajo un resumen a dos columnas, un grupo :::columns ocupa todo el ancho y compone seis paneles en tres columnas, cada uno un recuadro bajo un filete de 6 pt. La columna central empieza con −4,2 °C en naranja a 150 pt; siguen un mapa de calor del aire por manzana y hora, con su leyenda de muestras de color, y un gráfico de barras del pavimento. Una franja tintada con chips de palabras clave se apoya en el margen inferior. El mismo archivo compone la edición inglesa, y el pen ofrece la página como PNG de 1701 × 2268 px.
Esta receta responde a
- ¿Cómo pongo un recuadro que cruce las dos columnas a media página, como un panel de cifras en tres bloques?
- ¿Cómo pongo dos columnas dentro de un recuadro (una de texto junto a otra con una figura)?
- ¿Cómo añado muestras de color como leyenda en el texto, los pies o las notas de tabla?
La respuesta corta
// 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') } };
Ingredientes
- Funciones
- Columnas en un recuadro o en el textoRecuadros a todo el anchoAperturas diseñadasAtributos de títuloAnclaje de elementos de diseñoImágenes en los diseños de páginaMuestras de colorChips en líneaPaleta de color semánticaRecuadrosFiguras justo aquíEstilos de párrafoFormato de páginaPáginas en un canvasPies numeradosLíneas de fuente y créditoRecuadros flotantesRejilla baseBanda de capítulo a todo el ancho
- También usa
- Bibliografías y glosariosCitas que colocan las figurasFigura y Tabla en tu idiomaColor del papelTipos de recurso propiosFiguras y tablas como recursosEspacio vertical explícito
- Tipografía
- Rethink Sans, Bitter, Saira Condensed (SIL OFL 1.1)
- Recursos
- El plano de la calle, el mapa de calor, el gráfico de barras y la marca del Departamento de Geografía, dibujados en código con datos sintéticos y la paleta del póster (Ignacio Ferro, CC BY 4.0)
Elaboración
#1 · Compón el pliego a 72 ppp
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
A 300 ppp, el valor por defecto, el póster corta cada línea en el mismo sitio que a 72 ppp, pero la página mide 7087 × 9449 px, que una vez pintados ocupan 268 MB (tamaños de página predefinidos). A 72 ppp un punto es un píxel. El visor pinta sus miniaturas con renderPageToCanvas y una scale, y renderPage genera el PNG de 1701 × 2268 px que pide la galería en línea de un congreso (renderizar una página como mapa de bits). El interlineado reparte en 56 líneas los 750 mm que hay entre los márgenes, así que la franja de palabras clave, flotante al pie de la página, acaba en el margen inferior. Con un interlineado redondo de 38 pt caben solo 55 líneas, y la última queda 12,7 mm por encima del margen; la franja ya no cabe bajo los paneles y pasa a una segunda página.
#2 · Dibuja la banda del título desde el encabezado
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) } } },
] } };
El H1 lleva como atributos el encuentro, el número del póster, los autores y las filiaciones, y su diseño los compone sobre un rectángulo verde de 158 mm de alto, anclado a la página (apertura a toda página y diseño avanzado). El rectángulo acaba 133 mm por debajo del margen superior. Sin minHeight, el resumen empezaría a 0,9 mm del verde; un minHeight de once líneas de la rejilla base lo separa 14 mm. Las llamadas de filiación son los caracteres ¹ ² ³, las únicas cifras voladas del rango Latin-1.
#3 · Compón los paneles en un grupo a todo el ancho
// 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') } };
El texto base va a dos columnas y los paneles a tres, así que la retícula es un grupo :::columns{count=3} escrito directamente en el texto, y span="page" lo extiende sobre las dos columnas del texto base, bajo el resumen, con el medianil de la página entre sus columnas (:::columns). Si no se le dice nada, a un grupo en el texto le sigue una línea de separación entre párrafos, aquí 38 pt, y la franja de palabras clave pasaría a una segunda página; marginBottom="0.75em" en la línea de apertura ocupa el lugar de esa línea (postext 1.28), y la franja cabe al pie de la página. Cada panel es un recuadro dentro del grupo: toma su propio estilo, los 175 mm de ancho de la columna y 18 mm de marginTop bajo el panel de encima (el contenedor :::callout). breaks="3,4" lleva el tercer panel, Resultados, a la cabeza de la columna central, y el cuarto, Conclusiones, a la de la última. Sin él, el grupo se equilibra y corta por el panel más próximo a cada tercio de la pila. Con este texto los cortes caen en los mismos dos paneles; el atributo los fija por si el texto cambia.
#4 · Deja cada figura en su panel
// "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 });
Una figura con posición 'here' se queda en el panel donde la pone ::resource; con la colocación por defecto, los tres dibujos salen de sus paneles y el póster pasa a dos páginas. numberingTemplate: '{n}' las numera 1, 2 y 3, mientras que el {h1}.{n} por defecto imprime Figura 1.1 bajo un título que es un H1 (tipos de recurso). La nota bajo cada pie avisa de que los datos son sintéticos.
#5 · Comparte los colores del mapa de calor con su leyenda
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' } },
];
Las celdas del mapa de calor y las cuatro muestras :swatch{color="…"} de su leyenda remiten a las mismas entradas de la paleta, así que un valor nuevo para cool cambia a la vez el mapa y la leyenda (formato en línea). La leyenda es un segundo grupo :::columns, con dos entradas por columna, dentro del panel de Resultados.
#6 · Compón la cifra principal con un estilo de párrafo
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) } };
Los estilos de párrafo se aplican dentro de los recuadros, así que −4,2 °C es un bloque :::paragraphs{style="stat"} en Bitter a 150 pt dentro del panel de Resultados (estilos de párrafo). La cifra va en negrita, así que sale en Bitter 700 y en el boldColor del estilo, el naranja del panel. Un segundo estilo da a las referencias una sangría francesa de 9 mm. La franja de palabras clave es un recuadro tintado con placement="bottom", que flota al pie de la página bajo la retícula.
La receta completa
// ═══ 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 = 'es'; // @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
El script.js compuesto funciona tal cual: pégalo como script de módulo en cualquier página o abre la receta en CodePen. Carpeta de la receta en GitHub ↗ (se abre en una nueva pestaña)
Variantes
#Exporta el póster digital a 150 ppp
Si el congreso pide un archivo mayor, sale un PNG de 3543 × 4724 px con los mismos cortes de línea.
- dpi: 72, backgroundColor: col('paper'),
+ dpi: 150, backgroundColor: col('paper'),Errores frecuentes
- En el canvas, Rethink Sans sustituye una cifra sola entre paréntesis, como el fascículo de 11(3), por la cifra en círculo, así que las referencias dan solo el volumen y las páginas.
- Un recuadro a todo el ancho que cierra el documento pasa a una página nueva si no le quedan debajo dos líneas del texto base. Por eso la franja de palabras clave flota con
placement="bottom", que la asienta en el margen inferior, dentro de los 50 mm que quedan bajo la retícula. containerSpacing: 'add'en los estilosstatyrefscierra sus grupos:::paragraphscon el espacio propio del estilo, y así −4,2 °C queda pegado a la línea que lo explica; los demás grupos del póster siguen la regla del documento (desde postext 1.28; antes la regla solo se podía fijar para todo el documento, conbodyText.paragraphContainerSpacing). Bajo la última referencia ese espacio es elspaceBetweendel estilo, 2,8 mm, de modo que un:::space{lines=0.75}antes del agradecimiento abre 10,8 mm, cerca de los 10,6 mm que separan los demás párrafos de un panel. Sin él, con el'collapse'del documento, a un grupo le sigue una línea de la separación entre párrafos del panel: el agradecimiento no necesita:::space, pero la línea que se añade bajo −4,2 °C manda la franja de palabras clave a una segunda página.
Créditos
- Receta
- Ignacio Ferro
- Texto
- Texto original, CC BY 4.0
- Imágenes
- El plano de la calle, el mapa de calor, el gráfico de barras y la marca del Departamento de Geografía, dibujados en código con datos sintéticos y la paleta del póster · Ignacio Ferro · CC BY 4.0
- Fuentes
- Rethink Sans (SIL OFL 1.1) · Bitter (SIL OFL 1.1) · Saira Condensed (SIL OFL 1.1)
- Código
- MIT, como Postext
Editar este texto ↗ (se abre en una nueva pestaña)Carpeta de la receta en GitHub ↗ (se abre en una nueva pestaña)


