Με λίγα λόγια
Τέσσερις σελίδες ενός άτλαντα με φανταστικά νησιά. Δείχνει πώς δίνετε στους χάρτες δικούς τους αριθμούς και πώς γυρίζετε έναν μεγάλο χάρτη στο πλάι ώστε να γεμίσει μια σελίδα.
Τι θα στοιχειοθετήσετε
Το πρώτο φύλλο ενός άτλαντα των Solan Isles, ενός αρχιπελάγους που επινοήθηκε για αυτή τη συνταγή και σχεδιάστηκε με κώδικα από ένα ενιαίο πεδίο υψομέτρων. Η σελίδα 1 ανοίγει με μια ταινία στο μπλε της βαθιάς θάλασσας με το όνομα του άτλαντα σε 56 pt και ένα ανεμολόγιο, και ο Map 1, το ανάγλυφο όλου του συμπλέγματος, γεμίζει το κάτω μέρος της σελίδας. Το βόρειο άκρο του κύριου νησιού και το σχέδιο του λιμανιού του βρίσκονται στην κορυφή των δύο στηλών της σελίδας 2. Στη σελίδα 3 ο χάρτης των νησιών γυρίζει κατά ένα τέταρτο, ώστε το πλέγμα του με τετράγωνα των 8 km να γεμίζει τη σελίδα. Η σελίδα 4 έχει το τοπωνυμικό, δεκαεπτά τόπους σε κόκκινους δίσκους με το τετράγωνο του χάρτη για τον καθένα, και μια γραμμή εκδότη στο κάτω μέρος. Κάθε χάρτης έχει τη λεζάντα του πάνω από το σχέδιο σε μια μπλε λωρίδα, και το υπόμνημα του Map 1 είναι μια σειρά από δείγματα στα χρώματα του χάρτη.
Αυτή η συνταγή απαντά
- Πώς προσθέτω μια εικόνα με αριθμημένη λεζάντα και παραπέμπω σε αυτήν στο κείμενο («βλ. Εικ. 3.2»);
- Πώς ελέγχω πού μπαίνει μια εικόνα: στην κορυφή της σελίδας, σε όλες τις στήλες, ακριβώς εδώ ή στο περιθώριο;
- Πώς προσθέτω δείγματα χρώματος σε κείμενο, λεζάντες ή σημειώσεις πινάκων;
Η σύντομη απάντηση
// Every caption stands above its drawing or table, in the label face. Maps count 1, 2, 3…
// through the atlas as a type of their own and set their caption on a bar in the band colour.
const captionStyle = { fontFamily: LABEL, fontSize: pt(9), labelColor: col('band'),
position: 'above', gap: mm(1.6), note: { fontSize: pt(7.8), color: col('muted') } };
const MAP_WORD = t({ en: 'Map', es: 'Mapa' });
const mapType = { id: 'map', name: MAP_WORD, shortLabel: MAP_WORD, captionPrefix: MAP_WORD,
numberingTemplate: '{n}', resetOn: 'never', counterFormat: 'decimal',
captionStyle: { backgroundEnabled: true, background: col('band'), color: col('paper'),
labelColor: col('paper'), padding: mm(1.4) } }; // the bar only; the rest is captionStyle's
// Each map floats from its first :ref to the first slot its placement allows.
const PLACEMENT = {
relief: { position: 'bottom', span: 'page' }, // the foot of the page that cites it
north: { position: 'top' }, // the head of the next free column
harbour: { position: 'top' },
chart: { rotate: 'ccw' }, // turned a quarter, top to the left, on a page of its own
};
// Drawing sizes in mm. Turned, the chart is laid out along 247.6 mm, the text area's 53 grid
// lines less one for the float gap; the bar and the note leave 182.2 mm of the 196 mm measure.
const MAP = { relief: [196, 136], north: [95, 88], harbour: [95, 88], chart: [247.6, 182.2] };
Υλικά
- Λειτουργίες
- Οριζόντιοι πίνακες και εικόνεςΔείγματα χρώματοςΣτιλ λεζάνταςΠροσαρμοσμένοι τύποι πόρωνΑριθμημένες λεζάντεςΠαραπομπές που τοποθετούν εικόνεςΤοποθέτηση εικόνωνΓραμμές πηγής και πίστωσηςΣημασιολογική χρωματική παλέταΣχεδιασμένες εναρκτήριες σελίδεςΤαινία κεφαλαίου πλήρους πλάτουςΙδιότητες επικεφαλίδωνΣυμμετρικά περιθώριαΠίνακες από δεδομέναΣτιλ πίνακαΕτικέτες μέσα στη γραμμήΤρέχουσες κεφαλίδες και αριθμοί σελίδαςΕικόνες και πίνακες ως πόροιΣελίδες σε καμβά
- Χρησιμοποιεί επίσης
- Στιλ επικεφαλίδωνΕικόνα και Πίνακας στη γλώσσα σαςΧρώμα χαρτιούΚεφαλίδες ανά ρόλο σελίδαςΣτιλ παραγράφωνΤρέχουσες κεφαλίδες ανά ενότητα
- Γραμματοσειρές
- Marcellus, Alegreya Sans, Alegreya Sans SC (SIL OFL 1.1)
- Αρχεία
- Κανένα: κάθε εικόνα σχεδιάζεται με κώδικα
Προετοιμασία
#1 · Μία παλέτα για τη σελίδα και τους χάρτες
const palette = {
ink: '#23282b', paper: '#fbfaf6', // a blue-black on a warm white
band: '#1f4a5c', // the accent: opener band, caption bars, table head, references
road: '#b2432f', // the second colour: roads, lights and the place numbers
muted: '#626a6d', rule: '#c8c2b4', // running heads and notes; hairlines
deep: '#8fb9c6', sea: '#cfe3e8', // the maps' water: over and under 20 m
land: '#efe6cf', hill1: '#d9c9a3', hill2: '#bfa97a', forest: '#7f9b6a', // and their land
};
// col(id) links a colour to its palette entry; the drawings read the same hex from `palette`.
const col = (id) => ({ hex: palette[id], model: 'hex', paletteId: id });
const colorPalette = Object.entries({ ...palette, 'main-color': palette.band }) // the defaults' id
.map(([id, hex]) => ({ id, name: id, value: { hex, model: 'hex' } }));
Οι έξι αποχρώσεις του χάρτη είναι κλειδιά του ίδιου αντικειμένου με τα χρώματα της σελίδας, έτσι το colorPalette τις καταγράφει ως καταχωρίσεις της παλέτας και τα σχέδια παίρνουν τα γεμίσματα SVG τους από το palette[id]. Τα λευκά στο χρώμα του χαρτιού γράμματα πάνω στο band, το μπλε της εναρκτήριας σελίδας, των λωρίδων λεζάντας και της γραμμής κεφαλίδας του πίνακα, έχουν αντίθεση 9,2:1· το road, το μόνο κόκκινο, κρατιέται για δρόμους, φάρους και αριθμούς τόπων και έχει 5,4:1 απέναντι στο χαρτί. Το main-color παίρνει το δεκαεξαδικό του band, και οι προεπιλογές συνδέουν επικεφαλίδες, λωρίδες λεζάντας και σημάδια λιστών με αυτό το id, έτσι όσα από αυτά αφήνει αρρύθμιστα η διαμόρφωση τυπώνονται στο μπλε του άτλαντα.
#2 · Πού πηγαίνει κάθε χάρτης
Ο κώδικας είναι η σύντομη απάντηση παραπάνω. Ο Map 1 είναι κινητό στοιχείο bottom, επειδή ένα κινητό στοιχείο top σε όλο το πλάτος της σελίδας δεν προσγειώνεται ποτέ στη σελίδα που το παραθέτει. Οι Map 2 και 3 είναι κινητά στοιχεία στήλης top που παρατίθενται στη σελίδα 1, έτσι πιάνουν την κορυφή των δύο στηλών της σελίδας 2 (Τοποθέτηση). Το rotate: 'ccw' βάζει την κορυφή του χάρτη στην αριστερή άκρη και του δίνει ολόκληρη τη σελίδα 3. Γυρισμένο, το σχέδιο εκτείνεται 247,6 mm κατά μήκος της σελίδας, οι 53 γραμμές του πλέγματος της επιφάνειας στοιχειοθεσίας μείον μία για το διάκενο του κινητού στοιχείου, και 182,2 mm κατά πλάτος, ό,τι μένει από το πλάτος στοιχειοθεσίας των 196 mm μετά τη λωρίδα λεζάντας και τη σημείωση. Ένα ψηλότερο σχέδιο θα μικραινόταν και θα άφηνε γυμνό χαρτί στο πάνω μέρος της σελίδας.
#3 · Ένα υπόμνημα από τα ίδια id
// The bands the maps are filled with, lowest first. Art and key share each palette id, so one hex
// changes both; the unit is spelled out once, since the small caps print an m as an M.
const RELIEF = [
{ id: 'deep', en: 'sea over 20', es: 'mar de más de 20' },
{ id: 'sea', from: -20, en: 'sea under 20', es: 'de menos de 20' },
{ id: 'land', from: 0, en: 'land to 50', es: 'tierra hasta 50' },
{ id: 'hill1', from: 50, en: '50–120', es: '50–120' },
{ id: 'hill2', from: 120, en: 'over 120', es: 'más de 120' },
{ id: 'forest', en: 'woodland', es: 'bosque' },
];
const legend = t({ en: 'In metres: ', es: 'En metros: ' }) // a thin space more after each swatch
+ RELIEF.map((band) => `:swatch{color="${band.id}"} \u2009${t(band)}`).join(' · ');
Το RELIEF καταγράφει τις ζώνες με τα id τους στην παλέτα και τα υψόμετρα όπου αρχίζουν. Το σχέδιο γεμίζει κάθε ζώνη με palette[id] και το υπόμνημα κάτω από τον Map 1 γράφει ένα :swatch με το ίδιο id, έτσι ένα νέο δεκαεξαδικό στην παλέτα αλλάζει μαζί το σχέδιο και το υπόμνημα. Το υπόμνημα ονομάζει τη μονάδα μία φορά, ολογράφως, επειδή η σημείωση είναι σε Alegreya Sans SC, που τυπώνει ένα πεζό m ως μικρό κεφαλαίο M. Στη σελίδα 2 το κείμενο βάζει τα ίδια δείγματα δίπλα στα δύο βάθη του νερού.
#4 · Οι χάρτες είναι πόροι, αριθμημένοι και τοποθετημένοι από τις παραπομπές τους
// A plan's key: a bare chip keeps each number on the line of its name, and the dot after it.
const key = (names) => names.map((name, i) => `:chip[${i + 1} ${name}${names[i + 1] ? ' ·' : ''}]`
+ '{style="key"}').join(' ');
const TEXTS = t({ // caption, the key under the drawing, and the alt text of each map
en: {
relief: ['The islands: relief and roads', `${legend} · roads in red, ferries dashed`,
'Relief map of Brannay, Orrin, Kellay and Skarra in sand and ochre on blue water, with '
+ 'red roads.'],
north: ['The north end of Brannay', 'Contour interval 25 metres; heights in metres above the '
+ 'sea. The red discs number the places of the gazetteer.', 'The Ward of Brannay, 234 m, in '
+ 'contours, with the Hool Stacks off its north-west point and the road round it to Tofts.'],
harbour: ['Kirkwick harbour', 'Soundings in metres at the lowest tide. '
+ key(['ferry pier and light', 'lifeboat station', 'harbour office', 'fish store', 'kirk']),
'Plan of Kirkwick: one street of houses on a narrow inlet, a pier into its mouth, depths '
+ 'from 2 to 15 m.'],
chart: ['The islands and their approaches, with the gazetteer’s grid', 'Squares of 8 '
+ 'kilometres, lettered west to east and numbered north to south.', 'Chart of the group '
+ 'and the mainland coast on a lettered grid, with the seventeen places in red discs.'],
table: ['Gazetteer of the numbered places', 'Squares are those of :ref{id="chart"}.'],
},
es: {
relief: ['Las islas: relieve y carreteras', `${legend} · carreteras en rojo, `
+ 'transbordadores a trazos', 'Relieve de Brannay, Orrin, Kellay y Skarra en tintas de '
+ 'arena y ocre sobre agua azul, con las carreteras en rojo.'],
north: ['El extremo norte de Brannay', 'Equidistancia de las curvas: 25 metros; alturas en '
+ 'metros sobre el mar. Los discos rojos numeran los lugares del nomenclátor.', 'El Ward '
+ 'of Brannay, de 234 m, en curvas de nivel, con los Hool Stacks frente a su punta noroeste '
+ 'y la carretera de Tofts.'],
harbour: ['El puerto de Kirkwick', 'Sondas en metros con la marea más baja. '
+ key(['muelle y luz', 'estación de salvamento', 'oficina del puerto', 'almacén de pescado',
'iglesia']), 'Plano de Kirkwick: una calle de casas junto a una ensenada estrecha, un '
+ 'muelle en su boca y fondos de 2 a 15 m.'],
chart: ['Las islas y sus accesos, con la cuadrícula del nomenclátor', 'Cuadros de 8 '
+ 'kilómetros, con letras de oeste a este y números de norte a sur.', 'Carta del grupo y de '
+ 'la costa de tierra firme en cuadros, con los diecisiete lugares en discos rojos.'],
table: ['Nomenclátor de los lugares numerados',
'Los cuadros son los del :ref{id="chart" case="lower"}.'],
},
});
const svgResource = (id, [w, h], more) => ({ id, typeId: 'map', kind: 'svg', createdAt: 0,
updatedAt: 0, svg: { fileId: `${id}.svg`, width: w * 10, height: h * 10 }, ...more });
const resources = [
...Object.keys(MAP).map((id) => svgResource(id, MAP[id], { placement: PLACEMENT[id],
caption: TEXTS[id][0], note: TEXTS[id][1], altText: TEXTS[id][2] })),
svgResource('rose', [ROSE, ROSE], { altText: t({ en: 'Compass rose',
es: 'Rosa de los vientos' }) }),
{ id: 'gazetteer', typeId: 'table', kind: 'table', createdAt: 0, updatedAt: 0,
caption: TEXTS.table[0], note: TEXTS.table[1], placement: { position: 'top', span: 'page' },
table: { model: gazetteer() } },
];
const drawings = { relief: reliefMap, north: northMap, harbour: harbourMap, chart: chartMap };
for (const [id, draw] of Object.entries(drawings)) await loadSvg(`${id}.svg`, draw(MAP[id]));
await loadSvg('rose.svg', rose(ROSE)); // drawn by the opener, never cited, so never numbered
Ένας πόρος παίρνει τον αριθμό του από την πρώτη παραπομπή του κειμένου σε αυτόν, και το :ref{id="north"} τυπώνει τη σύντομη ετικέτα του τύπου και αυτόν τον αριθμό, Map 2, στο κυρίως κείμενο ή σε μια σημείωση λεζάντας. Ο ναυτικός χάρτης και το τοπωνυμικό παρατίθενται πρώτη φορά στη σελίδα 2, με αυτή τη σειρά, έτσι ο χάρτης παίρνει τη σελίδα 3 και το τοπωνυμικό την κορυφή της σελίδας 4. Το ανεμολόγιο είναι πόρος του ίδιου τύπου, αλλά μόνο η εναρκτήρια σελίδα το σχεδιάζει και το κείμενο δεν το παραθέτει ποτέ, έτσι οι χάρτες μετρούν πάλι από το 1 ως το 4. Κάθε καταχώριση του υπομνήματος του λιμανιού είναι μία ετικέτα χωρίς γέμισμα, περίγραμμα ή εσωτερικό περιθώριο, έτσι ο αριθμός, το όνομα και η τελεία μετά από αυτό μένουν στην ίδια γραμμή.
#5 · Αριθμοί κοινοί στους χάρτες και στο τοπωνυμικό
const CHART = { y0: -5, square: 8 }; // Map 4's grid: 8 km squares from its top-left corner
const PLACES = [ // name, what it is (en, es), island, x and y in km on the sheet, map mark
['Skarra', ['lighthouse', 'faro'], 'Skarra', 34.4, 5.4, 'light'],
['Hool Stacks', ['sea stacks', 'farallones'], 'Brannay', 22.8, 9],
['Kellay', ['gannet colony', 'colonia de alcatraces'], 'Kellay', 5.4, 10.6],
['Ward of Brannay', ['summit, 234 m', 'cumbre, 234 m'], 'Brannay', 26.38, 12.04, 'summit'],
['Hesta Ness', ['headland', 'cabo'], 'Brannay', 30.1, 15.9],
['Tofts', ['hamlet', 'aldea'], 'Brannay', 22.7, 14.9, 'village'],
['Kirkwick', ['village and ferry pier', 'pueblo y muelle'], 'Brannay', 28.3, 15, 'village'],
['St Brendan’s', ['ruined chapel', 'capilla en ruinas'], 'Brannay', 23.8, 21.6, 'chapel'],
['Brannay Sound', ['strait', 'estrecho'], '—', 25.6, 22.7],
['Scarfa Ness', ['headland', 'cabo'], 'Orrin', 36.3, 22.3],
['Carrick', ['mainland port', 'puerto de tierra firme'], '—', 59.4, 21.2, 'village'],
['Orrinsetter', ['hamlet', 'aldea'], 'Orrin', 31.7, 24.8, 'village'],
['Housa Stone', ['standing stone', 'menhir'], 'Orrin', 29.4, 25.6, 'stone'],
['Leury Sands', ['beach', 'playa'], 'Brannay', 10.9, 25.6],
['Holm of Orrin', ['islet', 'islote'], 'Orrin', 37.74, 28.4],
['Pollwick', ['bay', 'bahía'], 'Orrin', 32.4, 28.3],
['Tang Skerry', ['rock and beacon', 'roca y baliza'], '—', 25.08, 28.88, 'light'],
].map(([name, [en, es], island, x, y, mark]) => ({ name, kind: t({ en, es }), island, x, y, mark }))
.sort((a, b) => a.y - b.y).map((place, i) => ({ ...place, no: i + 1 }));
const square = ({ x, y }) => 'ABCDEFGH'[Math.floor(x / CHART.square)]
+ (Math.floor((y - CHART.y0) / CHART.square) + 1); // the square the place falls in
function gazetteer() {
const heads = t({ en: ['No.', 'Place', 'What it is', 'Island', 'Square'],
es: ['N.º', 'Lugar', 'Qué es', 'Isla', 'Cuadro'] });
const cells = (row, isHeader = false) => row.map((content) => ({ content, isHeader }));
let m = { headerRowCount: 1, columnWidths: [8, 34, 42, 18, 12], rows: [cells(heads, true),
...PLACES.map((p) => cells([`:chip[${p.no}]{style="no"}`, `**${p.name}**`, p.kind, p.island,
square(p)]))] };
for (let row = 0; row < m.rows.length; row++) {
for (const c of [0, 4]) m = setAlignment(m, { row, col: c }, 'center');
}
return m; // the zebra rows are the table style's: tableStyle.bodyAlternateBackground
}
Το PLACES είναι ταξινομημένο από βορρά προς νότο και αριθμημένο με αυτή τη σειρά, και οι χάρτες τυπώνουν τους αριθμούς σε κόκκινους δίσκους και ο πίνακας σε κόκκινες ετικέτες. Το square() υπολογίζει το τετράγωνο του χάρτη από τις ίδιες συντεταγμένες σε χιλιόμετρα που τοποθετούν κάθε σημάδι στους χάρτες, έτσι το Kirkwick, ο αριθμός 6, είναι στο D3 και στον χάρτη και στον πίνακα. Κάθε δεύτερη γραμμή παίρνει το απαλό μπλε της από το στιλ του πίνακα: bodyAlternateBackgroundEnabled, με το bodyAlternateBackground συνδεδεμένο με το sea.
#6 · Το όνομα του άτλαντα σε μια ταινία στο δικό του μπλε
const BAND = 80; // mm from the trim to the foot of the band
const AIR = 7; // mm at least between the band and the first line of text
const ROSE = 50; // mm across the compass rose
const pin = (to, edge, x, y, size) => ({ anchor: { to, edge }, offset: { x: mm(x), y: mm(y) },
...(size && { size }) }); // to: 'page', 'bleed' or '#id' of an element listed before
const text = (id, content, family, size, color, placement, extra) => ({ kind: 'text', id,
content, fontFamily: family, fontSize: pt(size), color: col(color), align: 'left',
overflow: 'wrap', placement, ...extra }); // a long running head wraps too, never '…'
const opener = { enabled: true,
// The band reserves down to its foot; minHeight adds AIR, in whole grid lines.
minHeight: pt(LEAD * Math.ceil((BAND + AIR - PAGE.top) / (LEAD * PT))),
slot: { elements: [ // array order is paint order
{ kind: 'box', id: 'band', style: { backgroundColor: col('band') },
placement: pin('bleed', 'top-left', 0, 0, { height: mm(BAND) }) }, // no width: edge to edge
{ kind: 'image', id: 'rose', resourceId: 'rose', // page 1 is a recto: the fore-edge is right
placement: pin('page', 'top-right', -PAGE.outer, (BAND - ROSE) / 2, { width: mm(ROSE),
height: mm(ROSE) }) },
text('kicker', '{attr.sheet} · {titleText}', LABEL, 9.5, 'sea', pin('page', 'top-left',
PAGE.inner, 23), { fontWeight: 500, letterSpacing: pt(1.4) }),
text('title', '{title}', DISPLAY, 56, 'paper', pin('#kicker', 'below', -1, 2),
{ lineHeight: 1 }),
text('lead', '{attr.lead}', TEXT, 10.5, 'sea', pin('#title', 'below', 1, 3,
{ width: mm(128) }), { italic: true, lineHeight: 1.35 }),
] } }; // hook-up: headings.levels[0] = { span: 'page', breakBefore, advancedDesign: opener }
Η ταινία είναι ένα πλαίσιο αγκυρωμένο στο 'bleed' χωρίς πλάτος, έτσι τρέχει από άκρη σε άκρη. Ο μεγάλος τίτλος είναι το {title}, το όνομα του άτλαντα από το frontmatter, και το κείμενο της ίδιας της επικεφαλίδας ακολουθεί τον αριθμό του φύλλου στον υπέρτιτλο. Μόνη της η ταινία δεσμεύει χώρο ως το κάτω άκρο της, και το κείμενο θα άρχιζε 3,9 mm κάτω από αυτήν· το minHeight ανεβάζει τη δέσμευση σε 14 γραμμές του πλέγματος κάτω από το πάνω περιθώριο, και το κείμενο αρχίζει 8,7 mm κάτω από την ταινία.
Η πλήρης συνταγή
// ═══ Postext Cookbook · Nº 067 · Atlas sheet: numbered maps and a rotated overview ═════
// https://postext.dev/en/cookbook/atlas-map-sheet
// Code: MIT · Text: original (CC BY 4.0) · Maps: generated in code from seed 1874 (CC BY 4.0)
// Fonts: Marcellus, Alegreya Sans, Alegreya Sans SC (SIL OFL 1.1) · Needs postext ≥ 1.34.0
import {
buildDocumentWithFonts, renderPageToCanvas, registerResourceImage, defaultResourceTypes,
setAlignment,
} from 'https://esm.sh/postext';
const LANG = 'en'; // @lang: the language of the sample document ('en' | 'es')
const RECIPE = 'atlas-map-sheet';
// ─── 1 · Design ─────────────────────────────────────────────────────────────
// #region palette: the page's colours and the maps' tints, one object for both
const palette = {
ink: '#23282b', paper: '#fbfaf6', // a blue-black on a warm white
band: '#1f4a5c', // the accent: opener band, caption bars, table head, references
road: '#b2432f', // the second colour: roads, lights and the place numbers
muted: '#626a6d', rule: '#c8c2b4', // running heads and notes; hairlines
deep: '#8fb9c6', sea: '#cfe3e8', // the maps' water: over and under 20 m
land: '#efe6cf', hill1: '#d9c9a3', hill2: '#bfa97a', forest: '#7f9b6a', // and their land
};
// col(id) links a colour to its palette entry; the drawings read the same hex from `palette`.
const col = (id) => ({ hex: palette[id], model: 'hex', paletteId: id });
const colorPalette = Object.entries({ ...palette, 'main-color': palette.band }) // the defaults' id
.map(([id, hex]) => ({ id, name: id, value: { hex, model: 'hex' } }));
// #endregion
const [TEXT, DISPLAY, LABEL] = ['Alegreya Sans', 'Marcellus', 'Alegreya Sans SC'];
const PAGE = { w: 230, h: 300, top: 22, bottom: 22, inner: 18, outer: 16 }; // mm, mirrored
const LEAD = 13.5; // pt: the body's leading and baseline grid
const PT = 25.4 / 72; // mm in a point
// #region answer: a Map type captioned on a bar above the drawing, and where each map goes
// Every caption stands above its drawing or table, in the label face. Maps count 1, 2, 3…
// through the atlas as a type of their own and set their caption on a bar in the band colour.
const captionStyle = { fontFamily: LABEL, fontSize: pt(9), labelColor: col('band'),
position: 'above', gap: mm(1.6), note: { fontSize: pt(7.8), color: col('muted') } };
const MAP_WORD = t({ en: 'Map', es: 'Mapa' });
const mapType = { id: 'map', name: MAP_WORD, shortLabel: MAP_WORD, captionPrefix: MAP_WORD,
numberingTemplate: '{n}', resetOn: 'never', counterFormat: 'decimal',
captionStyle: { backgroundEnabled: true, background: col('band'), color: col('paper'),
labelColor: col('paper'), padding: mm(1.4) } }; // the bar only; the rest is captionStyle's
// Each map floats from its first :ref to the first slot its placement allows.
const PLACEMENT = {
relief: { position: 'bottom', span: 'page' }, // the foot of the page that cites it
north: { position: 'top' }, // the head of the next free column
harbour: { position: 'top' },
chart: { rotate: 'ccw' }, // turned a quarter, top to the left, on a page of its own
Το συντεθειμένο script.js εκτελείται ως έχει: επικολλήστε το στο module script οποιασδήποτε σελίδας ή ανοίξτε τη συνταγή στο CodePen. Φάκελος της συνταγής στο GitHub ↗ (ανοίγει σε νέα καρτέλα)
Παραλλαγές
#Γυρίστε τον χάρτη από την άλλη μεριά
Γυρισμένος δεξιόστροφα, ο χάρτης έχει την κορυφή του και τη λωρίδα λεζάντας στην εξωτερική άκρη της σελίδας 3, και ο αναγνώστης γυρίζει το βιβλίο αντίθετα από τη συνηθισμένη σύμβαση, που την ακολουθεί το 'ccw'.
- chart: { rotate: 'ccw' }, // turned a quarter, top to the left, on a page of its own
+ chart: { rotate: 'cw' }, // turned a quarter, top to the right, on a page of its own#Γυρίστε έναν πίνακα αντί για χάρτη
Ένας πίνακας γυρίζει με την ίδια ρύθμιση και, όταν είναι πολύ φαρδύς για μία σελίδα, συνεχίζει γυρισμένος στην επόμενη κάτω από μια επαναλαμβανόμενη γραμμή κεφαλίδας: δείτε το Ημερολόγιο κήπου: πλέγμα ημερολογίου και οριζόντιος πίνακας.
#Βάλτε έναν χάρτη στο περιθώριο
Σε μια διάταξη μιάμισης στήλης η εξωτερική στήλη μπορεί να έχει εικόνες και τις λεζάντες τους χωρίς κείμενο: δείτε το Σχολικό βιβλίο με στήλη στο περιθώριο.
Συνήθη λάθη
Συνηθισμένο λάθος
Ένα κινητό στοιχείο 'top' πηγαίνει στη σελίδα μετά την παραπομπή του, εκτός αν μπορεί να ανοίξει τη σελίδα της παραπομπής
Από προεπιλογή ένα κινητό στοιχείο δεν μπαίνει ποτέ πάνω από την παραπομπή του, οπότε ένα κινητό στοιχείο 'top' πλάτους σελίδας που παραπέμπεται στη σελίδα Ν ανοίγει τη σελίδα Ν+1. Ορίστε placement.citingPage: true στον πόρο ή στο defaultPlacement του τύπου του (ή layout.floatsAtCitingPage για όλο το βιβλίο, από το postext 1.25), και τότε ανοίγει τη σελίδα Ν, με το κείμενο πάνω από την παραπομπή να κατεβαίνει κάτω από αυτό, όταν χωρά μέσα στο layout.maxTopFraction και η γραμμή της παραπομπής μένει σε αυτή τη σελίδα. Δεν ανοίγει ποτέ την πρώτη σελίδα ενός κεφαλαίου ή μια σελίδα μετά από αναγκαστική αλλαγή: εκεί εξακολουθεί να ανοίγει την επόμενη σελίδα, και τα 'auto' ή 'bottom' μπορούν να πάρουν το κάτω μέρος της σελίδας της παραπομπής. Τοποθέτηση εικόνων →
Ευχαριστίες
- Συνταγή
- Ignacio Ferro
- Κείμενο
- Πρωτότυπο κείμενο, CC BY 4.0
- Γραμματοσειρές
- Marcellus (SIL OFL 1.1) · Alegreya Sans (SIL OFL 1.1) · Alegreya Sans SC (SIL OFL 1.1)
- Κώδικας
- MIT, όπως το Postext
Επεξεργασία αυτού του κειμένου ↗ (ανοίγει σε νέα καρτέλα)Φάκελος της συνταγής στο GitHub ↗ (ανοίγει σε νέα καρτέλα)

