Pular para o conteúdo principal
Receita número 59

Receitas · Capítulo 1 · Página e grade

Pôster científico numa única página grande

Pôster de congresso de 600 × 800 mm: faixa de título sobre um grupo na largura da página com três colunas de painéis, mapa de calor e −4,2 °C em 150 pt.

  • Amostra em inglês: ainda sem edição em português
  • Refile 600 × 800 mm
  • 2 colunas, medianiz de 12 mm
  • Rethink Sans 28/38
  • Bitter
  • Saira Condensed
  • 1 página
  • Nível
  • Postext 1.57.1
  • Diagramado em 63 ms
  • 203 linhas de código

Em poucas palavras

Um pôster grande para um congresso científico, sobre as árvores da rua e o calor do verão. Mostra como organizar em colunas caixas de texto e gráficos numa única página muito grande.

O que você vai compor

Um pôster de congresso para um estudo inventado sobre árvores de rua e calor na calçada, composto numa única página de 600 × 800 mm. Uma faixa verde traz o encontro, o título em Bitter de 110 pt, os autores com as marcas de afiliação e a marca da School of Geography. Sob um resumo em duas colunas, um grupo :::columns atravessa as duas colunas do corpo e compõe seis painéis em três colunas, cada um num box sob uma tarja de 6 pt. A coluna do meio abre com −4,2 °C em laranja de 150 pt, seguido de um mapa de calor do ar por quarteirão e hora, com legenda em amostras de cor, e de um gráfico de barras da pavimentação. Uma faixa tingida com chips de palavras-chave fica apoiada na margem inferior. O mesmo arquivo compõe uma edição em espanhol, e o pen oferece a página como um PNG de 1.701 × 2.268 px.

Esta receita responde a

  • Como coloco um boxe atravessando as duas colunas no meio da página, como um painel “em números” com três blocos?
  • Como coloco duas colunas dentro de um boxe (uma coluna de texto ao lado de uma coluna com figura)?
  • Como acrescento amostras de cor, como chave de cores, ao texto, às legendas ou às notas de tabela?

A resposta curta

script.js · linhas 86–107no código completo
// 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

Tipografia
Rethink Sans, Bitter, Saira Condensed (SIL OFL 1.1)
Materiais
  • 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)

Preparo

#1 · Diagrame a folha a 72 dpi

script.js · linhas 38–48no código completo
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

Nos 300 dpi padrão, o pôster quebra cada linha no mesmo lugar que a 72 dpi, mas a página mede 7.087 × 9.449 px, ou 268 MB de pixels depois de pintada (tamanhos de página predefinidos). A 72 dpi, um ponto é um pixel. O visualizador pinta as miniaturas com renderPageToCanvas e uma scale, e renderPage gera o PNG de 1.701 × 2.268 px que a galeria on-line de um congresso pede (renderizar uma página como bitmap). A entrelinha divide os 750 mm entre as margens em 56 linhas, e assim a faixa de palavras-chave, flutuando no pé da página, termina na margem inferior. Com 38 pt redondos cabem só 55 linhas, e a última fica 12,7 mm acima da margem; a faixa de palavras-chave já não cabe sob os painéis e vai para uma segunda página.

#2 · Desenhe a faixa do título a partir do título

script.js · linhas 53–82no código completo
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) } } },
  ] } };

O H1 leva como atributos o encontro, o número do pôster, os autores e as afiliações, e o design os compõe sobre uma caixa verde ancorada à página, com 158 mm de altura (span e design avançado). A caixa termina 133 mm abaixo da margem superior. Sem minHeight, o resumo começaria 0,9 mm abaixo do verde; um minHeight de onze linhas da grade deixa 14 mm. As marcas de afiliação são os caracteres ¹ ² ³, os únicos algarismos sobrescritos da faixa Latin-1.

#3 · Componha os painéis num grupo na largura da página

script.js · linhas 86–107no código completo
// 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') } };

O corpo corre em duas colunas e os painéis em três, de modo que a grade é um grupo :::columns{count=3} escrito direto no texto, e span="page" o estende sobre as duas colunas do corpo, sob o resumo, com a medianiz da página entre as colunas (:::columns). Sem mais nada, um grupo no texto é seguido por uma linha de espaço entre parágrafos, aqui 38 pt, e a faixa de palavras-chave passaria para uma segunda página; marginBottom="0.75em" na linha de abertura fica no lugar dessa linha (postext 1.28), e a faixa cabe no pé da página. Cada painel é um boxe dentro do grupo: recebe o próprio estilo, os 175 mm de largura da coluna e 18 mm de marginTop sob o painel de cima (o contêiner :::callout). breaks="3,4" manda o terceiro painel, Results, para o alto da coluna do meio e o quarto, Conclusions, para o alto da última. Sem ele, o grupo se equilibra e corta no painel mais próximo de cada terço da pilha. Com este texto, os cortes caem nos mesmos dois painéis; o atributo os mantém ali quando o texto mudar.

#4 · Mantenha cada figura no seu painel

script.js · linhas 156–163no código completo
// "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 });

Uma figura com posicionamento 'here' fica no painel em que ::resource a põe; com o posicionamento padrão, os três desenhos saem dos painéis e o pôster passa para duas páginas. numberingTemplate: '{n}' os numera 1, 2, 3, enquanto o {h1}.{n} padrão imprimiria Figure 1.1 sob um título que é um H1 (tipos de recurso). A nota sob cada legenda avisa que os dados são sintéticos.

#5 · Compartilhe as cores do mapa de calor com a legenda

script.js · linhas 15–34no código completo
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' } },
];

As células do mapa de calor e os quatro trechos :swatch{color="…"} da legenda apontam para as mesmas entradas da paleta, por isso um novo valor para cool repinta o mapa e a legenda juntos (formatação inline). A legenda é um segundo grupo :::columns, com duas entradas por coluna, dentro do painel Results.

#6 · Componha o número de destaque com um estilo de parágrafo

script.js · linhas 111–128no código completo
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) } };

Os estilos de parágrafo valem dentro dos boxes, por isso −4,2 °C é um bloco :::paragraphs{style="stat"} em Bitter de 150 pt dentro do painel Results (estilos de parágrafo). O número é escrito em negrito, de modo que sai em Bitter 700 e no boldColor do estilo, o laranja do painel. Um segundo estilo dá às referências um recuo deslocado de 9 mm. A faixa de palavras-chave é um box tingido com placement="bottom", flutuando no pé da página sob a grade.

A receita completa

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

O script.js montado funciona como está: cole-o como script de módulo em qualquer página ou abra a receita no CodePen. Pasta da receita no GitHub ↗ (abre em uma nova aba)

Variações

#Exporte o e-pôster a 150 dpi

Um congresso que peça um arquivo maior recebe um PNG de 3.543 × 4.724 px com as mesmas quebras de linha.

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

Erros comuns

  • No canvas, a Rethink Sans desenha um único algarismo entre parênteses, como o número do fascículo em 11(3), como um algarismo dentro de um círculo; por isso as referências trazem só o volume e as páginas.
  • Um box na largura da página que fecha o documento passa para uma nova página a menos que sobrem abaixo dele duas linhas do corpo. Por isso a faixa de palavras-chave flutua com placement="bottom", que a põe na margem inferior, nos 50 mm que sobram sob a grade.
  • containerSpacing: 'add' nos estilos stat e refs fecha os grupos :::paragraphs deles com o espaço próprio do estilo, o que mantém −4,2 °C junto da linha que o explica; os outros grupos do pôster seguem a regra do documento (desde o postext 1.28; antes a regra só podia ser definida para o documento inteiro, com bodyText.paragraphContainerSpacing). Sob a última referência esse espaço é o spaceBetween do estilo, 2,8 mm, por isso um :::space{lines=0.75} antes do agradecimento abre 10,8 mm, perto dos 10,6 mm entre os outros parágrafos de um painel. Sem ele, com o 'collapse' do documento, um grupo é seguido por uma linha do espaço entre parágrafos do painel: o agradecimento dispensa o :::space, mas a linha acrescentada sob −4,2 °C empurra a faixa de palavras-chave para uma segunda página.

Créditos

Texto
Texto original, CC BY 4.0
Imagens
  • 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
Fontes
Rethink Sans (SIL OFL 1.1) · Bitter (SIL OFL 1.1) · Saira Condensed (SIL OFL 1.1)
Sandbox