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

Receitas · Capítulo 8 · Tabelas

Datasheet: tabelas a partir de dados, cabeçalhos mesclados

Tabelas coladas como TSV, lidas com parseTSV e moldadas com mergeCells, setAlignment e setCellBackground; um mapa de registradores que se divide sozinho.

  • Amostra em inglês: ainda sem edição em português
  • Refile 216 × 279 mm
  • 2 colunas, medianiz de 6 mm
  • Fira Sans 9,3/13
  • Fira Mono
  • Fira Sans Condensed
  • Fira Sans Condensed@tnum
  • Fira Sans@tnum
  • 4 páginas
  • Nível
  • Postext 1.65.0
  • Diagramado em 169 ms
  • 257 linhas de código

Em poucas palavras

A folha técnica de quatro páginas de um sensor eletrônico de temperatura. Mostra como montar tabelas com dados de uma planilha, com títulos compartilhados e uma tabela longa que continua na página seguinte.

O que você vai compor

Este é o datasheet de quatro páginas do PX-7021, um sensor de temperatura de um fabricante imaginário, a Pyxis Microdevices. Quase tudo são tabelas, com cabeçalhos cheios de células mescladas e um mapa de registradores mais comprido que uma coluna. A primeira página abre com uma faixa violeta com o código da peça e três números-chave. Na página 2, uma tabela ocupa a largura da página. O cabeçalho de duas linhas põe Value sobre Min, Typ e Max; os grupos de parâmetros são mesclados ao longo da primeira coluna, e um parâmetro a cada dois recebe fundo cinza. O mapa de registradores quebra no pé da página 3 e continua na página 4 com o cabeçalho repetido, ao lado dos códigos de pedido e acima do desenho do encapsulamento. As tabelas são dados de planilha colados como TSV, porque o Postext não interpreta tabelas Markdown.

Esta receita responde a

  • Como faço uma tabela com linhas de cabeçalho, células mescladas, larguras de coluna e alinhamento por célula?
  • Como divido uma tabela longa entre páginas com o cabeçalho repetido e um aviso de “continua”?
  • Como dou estilos diferentes a várias tabelas (preenchimentos, células zebradas, molduras arredondadas) em um mesmo documento?
  • Como mantenho os diagramas nítidos e com texto selecionável no PDF (SVG, originais para impressão)?
  • Como adiciono imagens e tabelas a partir do código (recursos) em vez de usar ![]() do Markdown?

A resposta curta

script.js · linhas 31–69no código completo
const at = (row, column) => ({ row, col: column });
const span = (r0, c0, r1, c1) => ({ start: at(r0, c0), end: at(r1, c1) });
const C = { group: 0, param: 1, symbol: 2, conditions: 3, min: 4, max: 6, unit: 7 }; // columns
function electricalTable(tsv) {
  // headerRows marks the head, two rows here, which a split table would repeat on each part.
  let m = Object.assign(parseTSV(tsv, { headerRows: 2 }), {
    columnWidths: [22, 44, 16, 38, 15, 15, 15, 15] }); // weights: mm of the 180 mm measure
  // 'Parameter' covers two columns and two rows; 'Value' spans Min, Typ and Max. mergeCells
  // marks the covered cells hiddenBy, so no column shifts (gotcha: merged-cells-hiddenby).
  for (const range of [span(0, C.group, 1, C.param), span(0, C.symbol, 1, C.symbol),
    span(0, C.conditions, 1, C.conditions), span(0, C.min, 0, C.max),
    span(0, C.unit, 1, C.unit)]) {
    m = mergeCells(m, range); // 'Value' is centred over its three columns, the rest set left
    m = setAlignment(m, range.start, range.start.col === C.min ? 'center' : 'left', 'middle');
  }
  // Min, Typ and Max go right, over their figures; setAlignment clears a vAlign it is not given.
  for (let c = C.min; c <= C.max; c++) m = setAlignment(m, at(1, c), 'right');
  let zebra = false;
  for (let r = m.headerRowCount; r < m.rows.length; r++) {
    const row = m.rows[r];
    if (row[C.param].content) zebra = !zebra; // a parameter keeps one fill over its conditions
    for (let c = 0; c < row.length; c++) {
      // An empty cell continues the one above: a group, or a parameter and its symbol.
      if (c <= C.symbol && row[c].content) {
        let end = r;
        while (m.rows[end + 1] && !m.rows[end + 1][c].content
          && (c === C.group || !m.rows[end + 1][C.param].content)) end++;
        m = mergeCells(m, span(r, c, end, c));
      }
      // Figures flush right, as datasheets set them (no decimal tab: gap tab-stops).
      m = setAlignment(m, at(r, c), c >= C.min && c <= C.max ? 'right' : 'left', 'middle');
      // tableStyle.bodyAlternateBackground alternates row by row; this fill changes with the
      // parameter, so it is set cell by cell. Each helper returns a new model, cheap at 20 rows.
      if (c === C.group) m = setCellBackground(m, at(r, c), col('tint'));
      else if (zebra) m = setCellBackground(m, at(r, c), col('zebra'));
    }
  }
  return m;
}

Ingredientes

Tipografia
Fira Sans, Fira Sans Condensed, Fira Mono (SIL OFL 1.1)
Materiais
Nenhum: todas as imagens são desenhadas em código

Preparo

#1 · Colar os dados e depois dar forma à tabela

O código é a resposta curta acima. parseTSV(tsv, { headerRows: 2 }) marca as duas linhas de cabeçalho; se a tabela se dividisse, as duas se repetiriam em cada parte. Os pesos de columnWidths somam 180, a largura da mancha em milímetros, de modo que cada peso é a largura da coluna na página. mergeCells mantém no lugar cada célula coberta e a marca com hiddenBy, assim nenhuma coluna se desloca. setAlignment trabalha célula por célula e apaga o alinhamento vertical quando você não o informa, por isso a maioria das chamadas passa 'middle' de novo. O cinza alterna de um parâmetro para o seguinte, o que mantém as duas linhas de Accuracy no mesmo fundo; alternando por linha, como faz bodyAlternateBackground no estilo de tabela, a segunda ficaria branca.

#2 · Cada modelo vira um recurso

script.js · linhas 493–522no código completo
const svgResource = (id, caption, altText, [w, h], placement) => ({ id, typeId: 'figure',
  kind: 'svg', caption, altText, placement, createdAt: 0, updatedAt: 0,
  svg: { fileId: `${id}.svg`, width: w * SCALE, height: h * SCALE } }); // fitted to its slot
const table = (id, caption, model, { styleId, placement, note } = {}) => ({ id, typeId: 'table',
  kind: 'table', caption, note, placement, table: { model, styleId }, createdAt: 0, updatedAt: 0 });
// A float takes the first free slot after its first :ref; the logo is never cited, only drawn.
const resources = [
  svgResource('logo', '', 'Pyxis Microdevices', LOGO),
  svgResource('pinout', 'Pin configuration, 8-pin DFN, top view.', 'The package from above: '
    + 'pins 1 to 4 down the left side, 5 to 8 up the right.', PINOUT),
  svgResource('circuit', 'Typical application, bus address 48h.', 'The sensor with a 100 nF '
    + 'capacitor, address pins to ground, and SDA, SCL and ALERT pulled up to a host.', CIRCUIT),
  svgResource('outline', 'Package outline and land pattern, 8-pin DFN, in mm.', 'Top, bottom '
    + 'and side views of the 2 × 2 mm body, and the land pattern with its two vias.', OUTLINE,
  { position: 'bottom', span: 'page' }), // a strip across the foot of a page
  table('electrical', 'Electrical characteristics, *V*~DD~ = 1.6 V to 5.5 V and *T*~A~ = −40 °C '
    + 'to 125 °C unless noted', electricalTable(electrical), { styleId: 'electrical',
    placement: { position: 'top', span: 'page' }, note: 'Typical values at 3.3 V and 25 °C. '
      + '^1^ Tested at 25 °C and 50 °C, the rest by characterization. ^2^ Characterized, not '
      + 'tested in production. ^3^ One conversion a second, bus idle.' }),
  // No placement: these float to the first free slot after their reference and split there.
  table('pins', 'Pin functions', groupedTable(pins, [9, 16, 10, 52]), { styleId: 'grouped',
    note: 'Types: P power, G ground, I input, O open-drain output, I/O open-drain input and '
      + 'output.' }),
  table('registers', 'Register map', groupedTable(registers, [9, 17, 11, 50]), {
    styleId: 'grouped', note: 'Reset values apply at power-on and after a general-call reset.' }),
  table('ordering', 'Order codes', Object.assign(parseTSV(ordering, { headerRows: 1 }), {
    columnWidths: [23, 29, 18, 17] }), { styleId: 'ordering',
    note: 'WLCSP-4: fixed address 48h, no ALERT output.' }),
];

Cada tabela e cada desenho é um recurso com legenda, e as tabelas acrescentam uma nota e um estilo nomeado. Legendas e notas aceitam itálico, subscrito e sobrescrito: a tabela elétrica dá as condições de teste com *V*~DD~ na legenda e numera as notas com ^1^ na nota. Um flutuante ocupa o primeiro espaço livre depois do primeiro :ref. A Tabela 1 é citada na página 1 e posicionada na cabeça de uma página, na largura toda, de modo que abre a página 2. O desenho do encapsulamento vai no pé de uma página, na largura toda, e as outras tabelas mantêm o posicionamento padrão, um flutuante com a largura de uma coluna. Uma tabela posicionada here fica no texto; se não couber no resto da coluna, também se divide entre linhas.

#3 · Deixar uma tabela longa se dividir sozinha

script.js · linhas 73–87no código completo
function groupedTable(tsv, columnWidths) {
  let m = Object.assign(parseTSV(tsv, { headerRows: 1 }), { columnWidths });
  const codes = [0, 2]; // Pin and Type, Addr. and Reset: short codes, centred, in a bare chip
  // A TSV cell holds no line break: the data writes \n, and a line opening with • is a list.
  m.rows = m.rows.map((row, r) => row.map((cell, c) => ({ ...cell,
    content: r > 0 && row[1].content && codes.includes(c) ? `:chip[${cell.content}]{style="code"}`
      : cell.content.replaceAll('\\n', '\n') })));
  for (let r = 0; r < m.rows.length; r++) {
    const last = m.rows[r].length - 1;
    if (r >= m.headerRowCount && !m.rows[r][1].content) { // a lone first cell heads a group
      m = setCellBackground(mergeCells(m, span(r, 0, r, last)), at(r, 0), col('tint'));
    } else for (const c of codes) m = setAlignment(m, at(r, c), 'center');
  }
  return m; // no split code: the engine cuts it between rows and repeats the head
}

A tabela de pinos e o mapa de registradores saem os dois de groupedTable. Uma linha com só a primeira célula preenchida é mesclada na largura da tabela e recebe o fundo violeta de título de grupo. Uma célula TSV não comporta quebra de linha, por isso os dados escrevem \n e a função a transforma numa quebra de verdade; uma linha que começa com • é então composta como item de lista. Os códigos curtos usam o estilo de chip code, que não tem fundo, borda nem preenchimento lateral e os compõe em Fira Mono a 0,9 em. Quando uma tabela flutuante não cabe na coluna vazia que lhe é oferecida, o motor a corta entre linhas e põe o resto no próximo espaço livre, sob o cabeçalho repetido, com (continued) depois da legenda. A linha de continuesMarker, “Continued on the next page”, vai sob a primeira parte, e a nota espera pela última (Tabelas mais altas que a página).

#4 · Um estilo da casa, uma variante por tabela

script.js · linhas 191–206no código completo
  tableStyle: { headerBackground: col('brand'), headerColor: col('paper'), headerFontFamily: COND,
    headerFontSize: pt(8.5), bodyFontSize: pt(8), rules: 'horizontal', borderColor: col('rule'),
    borderWidth: pt(0.5), cellPadding: mm(1.3) },
  tableStyles: [ // a resource picks one with table.styleId
    // White rules cut the fills apart and show where each merge and each group ends.
    { id: 'electrical', borderColor: col('paper'), borderWidth: pt(1.4), cellPadding: mm(1.1),
      figureStyle: 'tabular' }, // Fira's tnum: the digits of Min, Typ and Max line up
    // Written out although it is the default: 'clip' and 'hide' cut a table taller than the page.
    { id: 'grouped', overflow: 'split', continuedSuffix: '(continued)',
      continuesMarker: 'Continued on the next page' },
    // A compact list in the condensed face, boxed by a rounded outer frame.
    { id: 'ordering', headerBackground: col('tint'), headerColor: col('brand'),
      rules: 'outer', borderRadius: mm(1.5), bodyFontFamily: COND },
  ],
  captionStyle: { fontFamily: COND, fontSize: pt(9.5), labelColor: col('brand'), gap: mm(2),
    note: { fontSize: pt(7.5), color: col('muted') } },

tableStyle guarda o que todas as tabelas compartilham. Cada entrada de tableStyles define só o que as tabelas mudam, e um recurso escolhe uma com table.styleId. A tabela elétrica troca os fios finos cinza por fios brancos de 1,4 pt, que separam os fundos e mostram onde termina cada mesclagem. A tabela de códigos de pedido ganha uma moldura externa arredondada e a Fira Sans Condensed, para que as quatro colunas caibam numa coluna de texto. O figureStyle: 'tabular' do estilo elétrico pede à Fira Sans o recurso tnum, algarismos de mesma largura, para que os dígitos de Min, Typ e Max se alinhem em cada coluna.

#5 · Rótulos que continuam texto no PDF

script.js · linhas 536–541no código completo
// label() writes each <text> with font-family="Fira Mono". loadSvg runs the markup through
// inlineSvgFonts, which embeds that face in the SVG, so the canvas draws the labels in it;
// the PDF sets them as real text in the Fira Mono it embeds.
await loadSvg('logo.svg', logo);
const drawings = { pinout: pinout(), circuit: circuit(), outline: outline() }; // by resource id
for (const [id, markup] of Object.entries(drawings)) await loadSvg(`${id}.svg`, markup);

Os rótulos da pinagem, do circuito e do desenho do encapsulamento são elementos <text> que pedem a Fira Mono, a fonte de rótulos do documento. Um SVG chega ao canvas como imagem, por isso o loadSvg do kit passa antes a marcação por inlineSvgFonts, que incorpora ao SVG as fontes que o texto dele indica; o canvas desenha então os rótulos em Fira Mono. O PDF compõe cada <text> como texto selecionável nas fontes que incorpora.

#6 · Abertura, cabeço e rodapé

script.js · linhas 96–146no código completo
const place = (to, edge, x, y, size) => ({ anchor: { to, edge }, offset: { x: mm(x), y: mm(y) },
  ...(size && { size }) });
const inset = (edge, y, size) => // a page corner, moved in by the side margin
  place('page', edge, edge.endsWith('left') ? MARGIN.x : -MARGIN.x, y, size);
const text = (id, content, family, size, color, placement, extra) => ({ kind: 'text', id,
  content, fontFamily: family, fontSize: pt(size), color: col(color), placement, ...extra });
const caps = (size, weight = 600) => ({ fontWeight: weight, letterSpacing: pt(size * 0.16),
  textTransform: 'uppercase' });
const badge = { ...caps(7.5, 700), box: { backgroundColor: col('hazard'),
  padding: { top: pt(1.6), bottom: pt(1.4), left: pt(4), right: pt(4) } } };
const mark = (size, edge, y) => ({ kind: 'image', id: 'mark', resourceId: 'logo', // by id
  placement: inset(edge, y, { width: mm(size) }) });
const maker = (size, color, y) => text('maker', 'Pyxis Microdevices', COND, size, color,
  place('#mark', 'right-of', size / 4, y), caps(size));
const keyFigure = (n, y) => [ // {attr.k1} over its label {attr.k1l}, flush right on the band
  text(`k${n}`, `{attr.k${n}}`, COND, 22, 'paper', inset('top-right', y), { fontWeight: 600 }),
  text(`k${n}l`, `{attr.k${n}l}`, COND, 7, 'tint', inset('top-right', y + 9), caps(7))];
const BAND = 84; // mm: the violet band across the head of page 1
// The band under the top margin and 9 mm or more of white, in whole grid lines (16 here).
const OPENER_LINES = Math.ceil((BAND - MARGIN.y + 9) / (LEAD * 25.4 / 72));
const opener = {
  enabled: true, minHeight: pt(OPENER_LINES * LEAD), // so the columns under it start on the grid
  slot: { elements: [
    { kind: 'box', id: 'band', style: { backgroundColor: col('brand') }, placement: {
      anchor: { to: 'bleed', edge: 'top-left' }, size: { width: 'fill', height: mm(BAND) } } },
    mark(6, 'top-left', 12), maker(8.5, 'paper', 1.7),
    text('doc', 'Datasheet {subtitle} · {publishDate}', MONO, 7.5, 'tint',
      inset('top-right', 13.6)),
    text('kicker', '{attr.kicker}', COND, 9.5, 'tint', inset('top-left', 30), caps(9.5)),
    text('title', '{titleText}', COND, 64, 'paper', place('#kicker', 'below', 0, 0.5),
      { fontWeight: 700, lineHeight: 1 }),
    text('lead', '{attr.lead}', 'Fira Sans', 12, 'paper', place('#title', 'below', 0, 2.5,
      { width: mm(108) }), { lineHeight: 1.32, align: 'left' }), // wraps within its width
    text('status', 'Preliminary', COND, 7.5, 'ink', place('#lead', 'below', 0, 4.5), badge),
    ...[1, 2, 3].flatMap((n) => keyFigure(n, 15 + 15 * n)),
  ] },
};
const header = { elements: [ // body pages only: the opener has its band
  text('running-title', '{chapterTitle}', COND, 9, 'brand', inset('top-left', 10.4),
    { fontWeight: 700, pages: 'body' }),
  text('flag', 'Preliminary', COND, 7.5, 'ink', inset('top-right', 10.2),
    { ...badge, pages: 'body' }),
  { kind: 'rule', id: 'hairline', pages: 'body', thickness: pt(0.5), color: col('rule'),
    placement: inset('top-left', 15.5, { width: mm(TRIM[0] - 2 * MARGIN.x) }) },
] };
const footer = { elements: [ // every page: an image element works in a running slot too
  mark(4.5, 'bottom-left', -9), maker(7, 'ink', 1.2),
  text('folio', '{pageNumber}/{totalPages}', COND, 8, 'brand', inset('bottom-right', -9.6),
    { fontWeight: 700 }),
  text('doc', '{subtitle} ·', MONO, 7, 'muted', place('#folio', 'left-of', -1.5, 0.4)),
] };

O código da peça é o título de nível 1, e o espaço de design dele desenha a abertura: uma caixa violeta até a sangria, o logotipo, e um antetítulo, uma linha fina e três números-chave lidos dos atributos do título. Elementos de imagem funcionam nos espaços de design do cabeçalho e do rodapé assim como nas aberturas, de modo que o rodapé começa com um que aponta para o recurso do logotipo. Os elementos do cabeço usam pages: 'body', por isso nenhum deles sai na primeira página.

A receita completa

Sandbox
// ═══ Postext Cookbook · Nº 010 · Datasheet: tables from data, merged headers ════════
// https://postext.dev/en/cookbook/technical-datasheet
// Code: MIT · Text: original (CC BY 4.0) · Drawings: generated in code (CC BY 4.0)
// Fonts: Fira Sans, Fira Sans Condensed, Fira Mono (SIL OFL 1.1) · Needs postext ≥ 1.65.0
// The datasheet of a fictional sensor. Postext reads no pipe tables, so the tables are data:
// TSV pasted from a spreadsheet, parsed into table models, then merged, aligned and filled.
import {
  buildDocumentWithFonts, prepareFonts, renderPageToCanvas, registerResourceImage,
  defaultResourceTypes, parseTSV, mergeCells, setAlignment, setCellBackground, inlineSvgFonts,
} from 'https://esm.sh/postext';
import { renderToPdf, decompressWoff2 } from 'https://esm.sh/postext-pdf';

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

// ─── 1 · Design ─────────────────────────────────────────────────────────────
const palette = { // eight named colours; every colour in the config links to one of them
  ink: '#16181d', brand: '#5a2a8a', // text; Pyxis violet: the band, table heads, numbers
  tint: '#eee6f5', zebra: '#f3f4f6', // violet wash for groups and pins; every other row
  hazard: '#f2b705', rule: '#c9ccd3', // maximum ratings and the badge; hairlines
  muted: '#5d636d', paper: '#ffffff', // running heads, notes and units; white
};
// Every colour carries its paletteId: change a value in `palette` and all its uses follow.
const col = (id) => ({ hex: palette[id], model: 'hex', paletteId: id });
const colorPalette = [ // the defaults link to 'main-color', so it is set to the brand violet
  ...Object.entries(palette).map(([id, hex]) => ({ id, name: id, value: { hex, model: 'hex' } })),
  { id: 'main-color', name: 'brand (defaults)', value: { hex: palette.brand, model: 'hex' } },
];

// #region answer: pasted TSV becomes a table: two header rows, merged cells, zebra fills
const at = (row, column) => ({ row, col: column });
const span = (r0, c0, r1, c1) => ({ start: at(r0, c0), end: at(r1, c1) });
const C = { group: 0, param: 1, symbol: 2, conditions: 3, min: 4, max: 6, unit: 7 }; // columns
function electricalTable(tsv) {
  // headerRows marks the head, two rows here, which a split table would repeat on each part.
  let m = Object.assign(parseTSV(tsv, { headerRows: 2 }), {
    columnWidths: [22, 44, 16, 38, 15, 15, 15, 15] }); // weights: mm of the 180 mm measure
  // 'Parameter' covers two columns and two rows; 'Value' spans Min, Typ and Max. mergeCells
  // marks the covered cells hiddenBy, so no column shifts (gotcha: merged-cells-hiddenby).
  for (const range of [span(0, C.group, 1, C.param), span(0, C.symbol, 1, C.symbol),
    span(0, C.conditions, 1, C.conditions), span(0, C.min, 0, C.max),
    span(0, C.unit, 1, C.unit)]) {
    m = mergeCells(m, range); // 'Value' is centred over its three columns, the rest set left
    m = setAlignment(m, range.start, range.start.col === C.min ? 'center' : 'left', 'middle');
  }
  // Min, Typ and Max go right, over their figures; setAlignment clears a vAlign it is not given.
  for (let c = C.min; c <= C.max; c++) m = setAlignment(m, at(1, c), 'right');
  let zebra = false;

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

#Separar todas as linhas com fios cinza

Fios de meio ponto no cinza rule da paleta separam todas as linhas, com fundo ou sem; os brancos somem onde duas linhas sem fundo se encontram.

-    { id: 'electrical', borderColor: col('paper'), borderWidth: pt(1.4), cellPadding: mm(1.1),
+    { id: 'electrical', borderColor: col('rule'), borderWidth: pt(0.5), cellPadding: mm(1.1),

#Pôr as legendas das tabelas sobre uma barra

O estilo de legenda do tipo tabela pode pintar uma barra atrás da legenda, aqui na cor da tinta, com o rótulo no amarelo de advertência.

-    ...(type.id === 'table' && { captionStyle: { position: 'above' } }) })),
+    ...(type.id === 'table' && { captionStyle: { position: 'above', backgroundEnabled: true,
+      background: col('ink'), color: col('paper'), labelColor: col('hazard') } }) })),

Erros comuns

Erro comum

Células mescladas precisam de hiddenBy: use mergeCells

As células são posicionadas pela posição no array da linha, então uma célula mesclada precisa de células de preenchimento marcadas com hiddenBy onde ela se estende; omiti-las, como no HTML, desloca todas as colunas seguintes. Crie as mesclagens com mergeCells. Desde o postext 1.5, uma tabela com grade irregular é informada em doc.contentWarnings como raggedTableGrid, e parseTSV(text, { headerRows }) marca as linhas de cabeçalho. Tabelas a partir de dados →

Erro comum

Os arquivos do Fontsource cobrem letras, não símbolos

O kit incorpora o arquivo latin do Fontsource de cada fonte e, quando o texto usa esses caracteres, o arquivo latin-ext para č, ł, † e o arquivo greek para α, χ (em uma família que o tenha: Lora e Gelasio não têm), na tela e no PDF. Símbolos como →, ≈, ✓ e ★ não estão em nenhum desses arquivos e somem no PDF: desenhe-os, componha-os como matemática ou escolha uma fonte cujos arquivos os tenham. Fontes incorporadas ao PDF →

  • A primeira parte de uma tabela dividida deixa o pé da coluna para o texto quando cabem três linhas ou mais embaixo dela, e sempre faz isso numa coluna que já tem um flutuante. Comece uma tabela longa numa coluna sem outro flutuante, como faz o mapa de registradores, e ajuste as linhas para que a primeira parte chegue ao pé da coluna.
  • Os elementos de texto de design são centralizados por padrão. A linha fina tem largura fixa, por isso precisa de align: 'left' para se alinhar sob o código da peça.
  • Na página de fechamento de um capítulo, o Postext sobe os flutuantes na largura da página posicionados abaixo do texto até uma linha do texto corrido abaixo dele, de modo que uma figura bottom ali fica sob a última linha de texto, e não no pé da página. O texto da página 4 foi redigido para encher as colunas, e o desenho do encapsulamento tem 48,3 mm de altura para que o texto acima dele termine numa linha da grade. Assim o desenho não tem espaço para subir e termina na mesma altura do pé das outras páginas. Com layout.hugClosingFloats: false, ele não os sobe.

Créditos

Texto
Texto original, CC BY 4.0
Fontes
Fira Sans (SIL OFL 1.1) · Fira Sans Condensed (SIL OFL 1.1) · Fira Mono (SIL OFL 1.1)
SandboxPDF