Skip to main content

Chapter 15.4 · Part III · In practice

Sandbox: books, Word files and saving

Books and chapters, editing comic pages, importing Word documents, exporting a book to Word and bringing the corrections back, and how the Sandbox saves, exports and imports your work

Updated 2026-11-1238 minIn chapter 15 Sandboxenescadefritptzhjaar

In short

This page covers how you organise and keep your work in the Sandbox. A project is a book made of chapters. Comic pages have their own tools for panels and speech. You can bring in a Word file, choose how its styles become Postext styles, send the book to Word for corrections, and bring those corrections back into the book. Your work is saved in your own browser as you go, and you can download it as one file and open it again later.

#Books and chapters

Everything you open in the Sandbox is a book, the way an InDesign book file groups one document per chapter: the configuration, the custom fonts and the resource set are shared by the whole book, and each chapter is its own markdown document. Long works — a five-hundred-page textbook — are edited one chapter at a time, while numbering, cross-references and export still see one document.

  • Structure lives in the Chapters panel and in the Text panel's chapter switcher: add, rename (double-click a row), reorder, split a chapter into one per level-1 heading, merge a chapter into the previous one, delete. Every chapter keeps its own undo history and caret.
  • One chapter at a time. By default the previews lay out the active chapter, continued after the chapters before it: its first page number follows the last page of the previous chapter, level-1 headings keep counting (chapter 4 is numbered 4, its figures 4.1, 4.2, …), {chapterNumber} and {chapterTitle} running heads follow, recto/verso parity is kept (a chapter opener pads a blank page exactly as it would mid-book), and a :ref to a figure first mentioned in chapter 1 keeps that number. The page counts of the preceding chapters come from the layout that last showed each of them; chapters never visited (or edited since) are laid out in the background, one after the other, and the chapter list reads pages pending until they land. Page ranges are exact for chapters that open on a fresh page (the default); a chapter whose text would have run on from the previous page is placed at the top of its own page instead.
  • Whole book. The canvas, the HTML preview and the PDF tab can show the whole book as one continuous document: pick Whole book in the selector at the left of the tab bar (books with more than one chapter). The canvas then lays out every chapter in order, each one after the pages of those before it, and shows the documents stitched together — an edit re-lays out its chapter alone, and the chapters after it only when their first page moved; the chapter list, the chapter= and page= parts of the permalink and the editor sync follow the page's chapter. The choice is kept with the book (a short novel reads as one document, a textbook one chapter at a time), and a preset can open that way through the manifest's view.canvasScope. The HTML preview shares the canvas choice and lays the whole book out as one document from its first page, the contents rows and the fragment following each page's chapter; the PDF tab keeps its own selector.
  • Long books. A book of 120 chapters works like a short one. The chapter menu in the Text panel's header scrolls within the window and opens on the active chapter; the arrow keys move from it. A book in parts (:::part fences in its chapters) lists its chapters under their parts, in the menu and in the Chapters panel, and a click on a part in the menu opens its first chapter. Above 30 chapters the menu has a search field at the top that matches chapter numbers (27) and words of the titles and part names (埋香, 卷三); Enter opens the first match. While an input method is composing (Zhuyin, Cangjie, pinyin, kana), Enter and the arrow keys belong to it: Enter confirms the conversion and opens nothing. A sample book's chapter files load eight at a time, and while the chapters are paginated in the background the Chapters panel shows the progress (Paginating 34/120). The canvas and the HTML preview show a book of more than 200 chapters one chapter at a time, whatever the book or its manifest ask: laying out every chapter at once holds the whole book in memory. A book below that can open whole: 紅樓夢 (129 chapters, some 2,000 pages) takes about 25 seconds and 100 MB on the canvas. The PDF tab can still export any book whole.
  • Front matter. The first chapter's front matter is the book's front matter (title, author, …). A front-matter block at the top of any other chapter is ignored, and the Checks panel says so. buildBundle follows the same rule, so a book renders the same in the Sandbox and in your own program.
  • Page counts. Each chapter is laid out as a document of its own, so {totalPages} counts the chapter's pages. {bookTotalPages} counts the whole book: once every chapter's pages are known, the previews lay each chapter out with that total (only when a header, footer or design prints it). Until then a chapter prints the pages up to its own end. The PDF tab's Whole book counts the pages it lays out, so the file always prints the book's real total.
  • Chapter openers. No page break is forced between chapters: a chapter whose first block is a level-1 heading opens on a fresh page through the heading's own break before setting, exactly like a chapter that starts mid-document.
  • Sync. Clicking a paragraph of any chapter in the Canvas or HTML preview switches the editor to that chapter and places the caret; the editor caret is highlighted in the previews wherever the chapter sits in the book. Warnings carry their chapter.
  • Existing documents open as a book with one chapter; nothing changes until a second chapter is added.

#Editing comics

A chapter with comic pages (:::page) or strips (:::strip) can be edited on the pages themselves, in the Canvas tab, the HTML tab and the Folio's select mode. The tools work the same on a strip set in a column, floated to the head of a page or across it, narrower than its measure or under a caption, and write into the strip's own fence. Every change is written into the chapter's Markdown, as a typed edit would be, so the editor's undo takes it back. The markup and the lettering rules are explained in Comics.

  • Splitters. Over the gutter between two panels the pointer turns into a resize cursor. Drag it to move the split line; on release the new percentage is written into the page's split attribute (added to the fence when the page has none) and the page is laid out again. Shift snaps the line to steps of 5 %, Alt moves only the end nearer the pointer, slanting the line, and no panel gets narrower than 5 %. While you drag, a panel whose picture would no longer keep its safe area in view is marked, with a hint. Each splitter is also a focusable separator: the arrow keys move it by 1 % (5 % with Shift), Enter writes the position and Escape puts it back.
  • Split and merge. Over a panel a small toolbar offers Split with a horizontal line, Split with a vertical line (an empty ::panel line is added for the new cell, right after this panel) and Merge with the next panel: the line between them goes, and the merged panel keeps the first panel's picture and takes the script lines of both. The panels can also be reached with Tab: a focused panel is outlined, H splits it with a horizontal line, V with a vertical one, and M merges it with the next panel; focus stays on the panel after the page is laid out again. Enter opens the toolbar, and Escape goes back from it to the panel.
  • Balloons. Drag a balloon to pin it: on release its script line gets at="x% y%", the point in percentages of the panel's picture (of the cell for a panel without one), so the pin stays on the same spot of the drawing through crops, splitter drags and translations. A joined group moves as one, pinned by its first balloon. The arrow keys nudge a focused balloon by 1 % (5 % with Shift), and a double click on a pinned balloon removes its at, handing it back to the automatic placement. A single click puts the editor's caret on the balloon's line.
  • Overflow hint. While a balloon moves, by pointer or by arrow keys, the preview checks where it would land. If it would cover a face or an avoid zone, or run out of its panel further than it does now, the moving outline turns orange, the panel's faces and avoid zones are drawn dashed, and the tooltip says which: Here it would cover a face, Here it would cover a part of the picture kept clear, Here it would run out of the panel. A line with break is not flagged for leaving its panel. The hint does not foresee how the other balloons of the panel will move to make room.
  • Tails. Over the tip of a tail the pointer turns into a crosshair. Drag the tip to where the tail should aim: on release the line gets to="x% y%", the point in percentages of the panel's picture, and the tail turns toward it, stopping short of it as it does before a mouth. Escape cancels the drag, and a double click on the tip removes to, so the tail points at its speaker again. From the keyboard, T on a focused balloon moves to its tail: the arrow keys move the point it aims at by 1 % (5 % with Shift), Enter writes it, Escape puts it back, Delete removes to, and T goes back to the balloon.
  • Speakers and avoid zones. On a picture in the Resources panel, the Safe area & lettering field opens a dialog with three modes. Safe area marks the part of the picture that must stay in view. Speakers places one point per character: a click on the picture adds a speaker there and focuses its id, which must be the speaker key the script uses (maya: …); its mouth, head (where thought bubbles point) and face (never covered by a balloon) are dragged into place. Avoid zones are rectangles no balloon covers, drawn by dragging over the picture. The same mode marks the faces of people who do not speak (Add bystander face, or the A face switch on a zone's row): no balloon covers such a face, where an avoid zone gives way when a panel has no other room. Every mark can be moved with the arrow keys (Shift for larger steps) and removed with Delete; the dialog keeps its own undo, and a speaker outside the safe area is flagged. On a map the same rectangles mark symbols, such as a city dot or an icon: the Checks panel reports a label that runs onto one (labelOverlap). On an SVG map, Symbols of the drawing adds a zone over each element named by an id prefix or a class. The zones belong to the picture and serve every edition; they are not read from the drawing at layout, so read it again after it changes (zones already there are not added twice). Since postext 1.43.
  • Settings. The Design panel's Comics group holds the comics configuration: reading direction and mirrored pictures, the frame and the gutters, the default panel and the named panel styles, the lettering, the balloon styles, each with a preview of its outline, and the cast: per speaker, its balloon style, the colours of its lettering and balloons and its face.
  • Editor and checks. The text editor colours :::page, :::strip, ::panel lines and the keys and attributes of script lines. The Checks panel lists the comic warnings (an unreadable split, panels and cells that do not match, a balloon that does not fit…) at the line they concern; see Comics › Comic warnings.

#Word documents

Word works both ways. A manuscript written in Word comes in with its styles mapped to the book's. The book goes out to Word in one of two forms, and a file exported from the book comes back with the corrections made in it, each one in the place it came from. The file is read and written in the browser and never uploaded.

Word, both ways: send a book to the copy editor and bring every correction back, with PostextWatch on YouTube (opens in a new tab) · The player loads from YouTube when you press play.

#Importing a manuscript

Manuscripts usually arrive as Word files. The Text panel imports a .docx directly, with no AI agent and nothing to install, and maps its styles the way Place does in InDesign. Import a Word document reads the file in the browser (it is never uploaded) and opens a dialog; the book changes only when you press Import. A file that is not a Word document, such as an old binary .doc, is refused with a message that says so; save it from Word as .docx first.

The dialog has these parts, each of which folds away:

  • Quality of the original. A verdict on how the manuscript was prepared: Well styled (it converts cleanly), Partly styled (some paragraphs are formatted by hand) or No styles (everything is in Normal, so the text comes in as plain paragraphs). Under it, the counts (paragraphs, how many are in a style other than Normal, pictures, tables, notes) and what was found, each with the first words of a few paragraphs where it happens: paragraphs with formatting set by hand (fonts, sizes, colours, alignment; it is left out, as the design sets it), short bold paragraphs that look like headings typed by hand, numbers or bullets typed instead of Word lists, manual line breaks, manual page breaks, empty paragraphs used as spacing, tabs and double spaces, tracked changes (insertions are kept and deletions left out; accept or reject them in Word first), comments (not imported), text boxes (their text follows the paragraph each is anchored to), equations (converted to TeX; check them), hidden text and pictures in formats the browser cannot show (EMF, WMF, TIFF).
  • Import template. The mapping in use: Automatic (by style name), a saved template, or Saved in this document for a file that carries its mapping (the Sandbox wrote one into its Word exports up to postext 1.67). Save as a new template asks for a name and keeps the mapping, every style of this document included, in the browser; Save changes updates the selected template; the download button writes it as a .json file and the upload button loads one, so a whole team can share the same template. Delete asks for confirmation. The template last used is offered first next time.
  • Paragraph styles. Every paragraph style the document uses, with how many paragraphs use it and the first words of one, and what it becomes: Body text, Heading (a level from 1 to 6 and, when the design has heading styles, one of them), Paragraph style (one of the design's paragraph styles; consecutive paragraphs in it make one :::paragraphs group), Callout (consecutive paragraphs make one box of that type), Callout title (opens a box titled with the paragraph's text), Quote, Caption of the picture or table beside it, Start of a new chapter, Postext Markdown, as written (the text is copied as it is, for directives typed in Word) or Leave out. Paragraphs in Word's numbered and bulleted lists become Postext lists whatever their style, with their numbers and nesting. Poem (:::verse, line by line) sets the style's paragraphs as a :::verse poem, optionally in one of the design's paragraph styles: Shift+Enter breaks a line, a paragraph is a stanza, one-line paragraphs in a row make one stanza and an empty paragraph a stanza break; it is guessed for styles named Verse, Poem or Poesía.
  • Character styles. The same for character styles: Plain text, Bold, Italic, Bold italic, Small capitals, Superscript, Subscript, Chip (one of the design's chip styles), Character style (one of the book's character styles), Postext Markdown, as written or Leave out.
  • Options. Manual line breaks (Shift+Enter) are kept as line breaks inside the paragraph (a backslash at the end of the Markdown line, the default), joined with a space or start a new paragraph; bold, italic, small capitals and scripts set by hand are kept or left out; short bold paragraphs stay paragraphs or become headings of a level; manual page breaks are left out (the design turns the pages) or kept as :::pagebreak; pictures and tables are added as resources or not. A Take the character spacing of the Word styles switch (on when there is something to take; since postext 1.40) puts the letter spacing of the Word styles in use, in em, on the book's paragraph styles, heading styles, heading levels and callout titles they map to. A style that already sets its own spacing keeps it, and the dialog lists both groups.
  • Preview of the Markdown, updated as the mapping changes.

The footer chooses where the text goes: Replace this chapter, New chapters after this one or Replace the whole book; the last two start a chapter at every level-1 heading. Pictures (PNG, JPEG, GIF, WebP, SVG) become figure resources and tables become table resources (header rows, merged cells, column widths and cell fills kept), each placed with ::resource{id="…"} where it was and captioned by a Caption paragraph next to it, its typed label (Figure 3.) left out because Postext numbers resources. Footnotes and endnotes become Postext footnotes ([^1]), Word index entries (XE fields) become :index marks, links stay links and equations become $…$ / $$…$$. A tab in body text becomes :tab with the stop Word set for it (:tab{at=432pt align=end leader="."}), or a bare :tab when the paragraph goes to a paragraph style of the book that has stops of its own; Word's dot, hyphen and middle-dot leaders become ., - and ·, its underscore and heavy leaders a rule. A tab in a heading, a table cell or a note becomes a space.

Before matching styles by name, the automatic mapping recognises Word's own roles in any interface language (heading 1–6, Title, Quote, Caption; table-of-contents, index, header and footer paragraphs are left out) and the design's styles: a Word style with the same name as a paragraph style, callout type, heading style or chip style of the book (by id or name, ignoring case and accents) maps to it.

#Exporting to Word

Export to Word opens a dialog with two choices: What to export (This chapter or The whole book) and Kind of document. Download .docx writes the file while a progress bar follows the work: fonts prepared, then the document written. When something will look different in Word, the dialog stays open after the download and lists it under What Word will show differently: each font that could not be embedded, with the reason, and the content Word sets its own way. Since postext 1.68.

Both kinds of document place a hidden bookmark around every piece of exported text, and carry a map of where each piece came from together with a copy of the chapters as they were exported. That is what brings the corrections back (see Correcting a book in Word).

Both kinds are flowing text that Word and Google Docs open and edit. They are built from the Markdown, not from the pages, with the structures Word has of its own:

  • Headings in Word's heading styles, or in a style for each heading style of the design (Heading 2: Opener). The design's paragraph styles become Word styles with the same names.
  • Lists become Word lists and footnotes Word footnotes. Links stay links, :index marks become Word index entries (XE fields), anchors become bookmarks, and page and column breaks become Word breaks.
  • Each character style (:span[…]{style="id"}) becomes a Word character style named Postext Style: …, with its face, size, colour, tracking and case; the highlight style it names gives the run a shading of its band's colour over white, and its line becomes Word's nearest underline or a strike-through. Word has no rough edge and no translucent shading.
  • A box becomes a content control around a shaded one-cell table, in a Box: style for its type; the control's tag (ptx:box:note) keeps the type. Parts and :::paragraphs groups are content controls too.
  • Figures and table resources become Word pictures and tables with their captions; the label and number of a caption (Figure 3.) are the book's.
  • Equations become Word equations, and code takes the Postext Code style.
  • Citations print the text the citation style gives them, in the Postext Citation character style, which keeps the weight and colour of the text around them as the book does; with a note style a citation becomes a Word footnote. The cross-references keep the look of the design's references in Postext Reference.

What Word has no structure for travels as its source: a content control tagged ptx:raw:<kind> holds the exact Markdown in the grey Postext Source style. Front matter goes this way, and so do exercises, solutions and hints, modules, composed pages and their frames, :::figure blocks, comic pages, music scores, other directives, an equation that cannot be converted and a resource Word cannot show (a video). An inline construct that cannot be converted takes the Postext Source Char character style. This text is mapped character by character, so an edit made in it comes back as typed: the attributes of a directive can be corrected in Word.

Semantic is the content alone, for whoever corrects the words. It is a plain document: A4 pages, one column, Arial. Each paragraph is in the Word style that names what it is (a heading of its level, body text, a box of its type, a caption), and nothing of the book's design goes in: no page size, columns, fonts, colours, chapter openers or running heads.

Formatted, the kind the dialog opens on, is the same editable text set with the book's design as far as Word allows. The page size, margins and columns become Word sections, with the chapter title as the running head; the Word styles take the design's fonts, sizes, indents and letter spacing; chapter openers, boxes, figures and tables take the look they have in the book. Word breaks the lines and the pages itself, so they do not fall where the PDF has them.

Fonts. The formatted document embeds the faces the book sets text in, so its pages look the same on a computer that does not have them. Each face goes in as a static TrueType font (the unicode-range slices of a web font merged into one) and obfuscated, as Word requires. A weight or width beyond Word's regular, bold, italic and bold italic becomes a Word family of its own. The embedded families carry the suffix PTX (Lora PTX), so an installed copy of another version of the font does not take the place of the book's. Google Docs does not read embedded fonts: it uses its own copy of a family when it has one, and another font when it does not. The semantic document is set in Arial and embeds nothing. A font is left out, with a note, when:

  • its licence forbids embedding (the font's fsType flags). A font that allows preview and print only is embedded; Word shows and prints it but does not let text set in it be edited;
  • it has PostScript (CFF) outlines or is a variable font, neither of which Word embeds;
  • its files could not be fetched or merged.

Embedding a font gives a copy of it to everyone who receives the file. The open licences of most web fonts (SIL Open Font License, Apache) allow it; a commercial licence may not, even when the font's flags do. Read the licence before a formatted file leaves the people who already hold the fonts.

Word, Google Docs, LibreOffice and Pages. Both documents are written for Microsoft Word, on Windows, on the Mac and on the web, and both open in Google Docs, where the text is edited as in Word. LibreOffice opens them and reads the embedded fonts; it ignores the OpenType settings written for Word, such as old-style figures. Pages does not use embedded fonts, so a formatted document looks right there only with the book's fonts installed. Save the corrected file as .docx (in Google Docs, File › Download › Microsoft Word): a program that drops the hidden bookmarks when it saves leaves the corrections nothing to be placed by.

Page facsimile. A third document shows the pages as the PDF prints them. It is not in the dialog: it comes from the command line (postext docx --variant facsimile) and from the API (facsimileDocx). The book is laid out as for the PDF. Each page becomes a Word section of its exact size with no margins, and each column of text a text box placed where the layout put it. Every line ends where the engine ended it, with the engine's hyphens, justification, letter spacing and line pitch, and Word's own hyphenation is off. Rules, boxes and drawings are Word shapes; pictures are Word pictures (an SVG with a PNG beside it for readers that need one); tables are Word tables inside a text box. Running heads, folios, list bullets and numbers are there to be seen, not edited, and equations are pictures. It is for looking at the layout in desktop Word, not for editing and not for Google Docs: text in boxes does not reflow, so a changed line can run past its box. LibreOffice breaks every line of it where the PDF does. Two things look different there: it sets each line of text a little lower than Word does (a point or two in body text, more in large type), because it places the baseline of a line of fixed height its own way, and it cuts off marks that hang far below the line, such as the dots under some Arabic letters.

#Correcting a book in Word

Send the exported file to whoever corrects it. When it comes back, open it with Import a Word document in the Text panel. The Sandbox recognises a file exported from the book and, instead of the mapping dialog, opens Changes from Word. It compares the text of the file with the copy of the chapters the file carries, turns each difference into a change to the Markdown and lists every change, grouped by chapter and by resource, before anything is written:

  • Goes in. The change is placed where its text came from. Words typed or deleted, a paragraph split or two joined, a paragraph deleted, a heading, a list item, a box, a footnote or a table cell all come back this way, and so do the caption, note, alternative text and table cells of a resource, which go into the resource. Bold, italic, superscript and subscript set or removed in Word come back as Markdown (**…**, *…*, ^…^, ~…~). The markup between the characters (a link, an index mark, a footnote reference) stays where it was. In a citation, what the author wrote between its brackets comes back into it: a corrected page number or other locator, and the words before or after the work ([see also @simmons1991, 346–47]), whether the citation is in the text or in a note.
  • Conflict. The same text also changed in the book after the export, two changes overlap, or the text is no longer in the book (its chapter or resource was deleted). Because the file carries the chapters as they were exported, the corrections are merged into the book as it is now: what changed elsewhere in the book since the export stays, and only a correction to text that changed on both sides is held back.
  • Not brought in. Text the book makes itself (the label and number of a caption, the number a reference prints, note numbers, and what a citation style writes from the bibliography: the author's name, the title, Ibid.), and formatting that runs across Postext markup or covers only part of a marked span. A number is changed in the book, not in Word. A change inside a citation names the citation by its keys; a part the author wrote that the book prints otherwise than it is written (a range typed 346--47 and printed 346–47) is listed with its place in the book, to be changed there. The running heads, folios and list bullets of a page facsimile are not compared at all.

Tracked changes need not be accepted first: insertions come in and deletions go out, as if accepted, and the list marks them as tracked. Comments are listed with their author and the text they are on, to be read beside the changes; they are not written into the book. If the hidden bookmarks are gone (the text was copied into a new document, or the file was saved by a program that does not keep them), the dialog says so and places nothing.

Google Docs. A file edited in Google Docs and downloaded as .docx comes back too. Docs leaves out the map and the copy of the chapters; the import writes the map again from the book, and the dialog says so. Because that file carries no copy of the exported text, it is compared with the book as it is now. If the book changed since the export, the dialog warns about it, and a change made in the book meanwhile may show as an edit that undoes it. Import a Docs file into the book it was exported from, before changing that book; a file saved by Word keeps its map and merges with later changes to the book. Docs also removes the hidden bookmark of a text that is replaced whole (a heading, a table cell, a caption, a box title, a footnote). The import finds such a text by its place between its neighbours, so a heading stays a heading and a caption goes to its resource. When that cannot be decided, for example because a paragraph was also typed beside it and nothing tells the two apart, the list shows a deletion and an addition instead. Importing the same file a second time brings nothing.

Some edits have no exported text to hold on to and are left out without a line in the list: a paragraph typed before the first exported one, a footnote created in Word, text typed outside the text boxes of a page facsimile, and a picture replaced in Word.

Apply changes writes everything marked Goes in as one step, which a single Undo takes back. Conflicts and changes not brought in are for you to make in the text by hand, with the list as a guide.

For conversions this dialog does not cover (PDF, PowerPoint or EPUB sources, reproducing an original's layout rules), use the agent skill.

#Importing an InDesign document

New book from an InDesign document (IDML) and New book from an InDesign package (.zip), in the New menu, open an InDesign document or a zipped package as a new book. The dialog, its choices and its report are described in InDesign › Importing an InDesign document.

Each item of the New menu opens a file picker that offers only the files it names: .postext, .idml or .zip. A file of another kind chosen through the picker's All files entry is refused by the import, which says why.

#Persistence

The Sandbox automatically saves your work to the browser:

  • Book and configuration — The chapters, the active chapter and the canvas scope are auto-saved to localStorage under postext-sandbox-book (a single document saved by an earlier version is read from postext-sandbox-markdown as a one-chapter book and migrated on the first save); the configuration is saved after 1 second of inactivity with defaults stripped so only your overrides are stored, together with its version (postext-sandbox-config-version); a configuration saved before the version existed is read as described under Heading breaks saved by postext 1.4 or earlier below
  • UI state — The active panel and viewport tab, sidebar width, the Design panel's open group (postext-sandbox-settings-group), its Show every explanation switch (postext-sandbox-settings-help) and section open states, hidden sample books, canvas zoom/fit/view modes, HTML font scale and column mode, the EPUB tab's rendition (postext-sandbox-epub-layout), and toolbar pin states are all persisted in localStorage
  • Open book — The id of the open book of your own (a project) is stored in localStorage under postext-sandbox-project. The projects themselves (chapters, configuration and resource records) live in the projects store of the sandbox's IndexedDB database, and their binary payloads share the blob and font stores with the working document. A record carries version: 15, the engine's CONFIG_VERSION, which the working configuration and postext-config.json exports are stamped with too, so each is migrated once when the engine's rules change. Single-document records from earlier versions are migrated when read. In older records these settings are pinned as described below: the heading breaks (records older than version 3); the maths size (older than 4); the space under inline figures (older than 5); the space around inline figures in boxes, the heading marks, the drop-cap sizes, the room under a colon line and the box cuts (older than 6); the breaks at dashes and the breaking of ragged text (older than 7); and the splits under a heading, the breaks at compounds' hyphens and the space under the :::paragraphs containers (older than 8). Payloads are garbage-collected when neither the working document nor any project references them
  • Edited sample books — Your version of a sample book (its chapters, active chapter, canvas scope, configuration and resource records, with what the sample applied when you opened it) is saved in the presetDrafts store of the sandbox's IndexedDB database, one record per sample and content language, and its files are kept by the garbage collection like a project's. Restoring the original deletes it
  • Sample book covers — The cover taken from the first page of a sample book that ships no thumbnail is kept in the presetCovers store of the sandbox's IndexedDB database, one record per sample and content language (see Books panel). A book of your own keeps its cover in its project record.
  • Saving on the way out — Pending edits are written at once when the page is hidden or closed, when you leave the sandbox through a link (the logo) and before another book opens, rather than after the 1-second pause
  • Open sample book — The id of the last loaded preset is stored in localStorage under postext-sandbox-preset, so the panels' Reset buttons keep restoring that preset across sessions (a preset that is no longer served shows as unavailable). What that preset applied — its bundle fingerprint plus hashes of the markdown, configuration and resource set — is stored under postext-sandbox-preset-applied, which is how the next visit tells an untouched document from an edited one
  • Resources and fonts — Resource records, their binary blobs (bitmaps and SVGs), and custom font files persist in IndexedDB; when IndexedDB is unavailable (e.g. some private-browsing modes), a storage unavailable warning appears in the Checks panel (under Browser)
  • Size — localStorage holds about 5 MB per site in most browsers, shared by the working book and the working configuration; resources, fonts and the projects themselves are in IndexedDB, which has no limit of that size. A configuration near 1 MB usually carries the book's text typed into styles, which the Text held in the configuration check lists and Move the text to the Markdown takes out (the dialog gives the configuration's size before and after). If the browser refuses to write the working copy of the book, the project record in IndexedDB is the copy that counts.
  • Permalink — The URL fragment names what is on screen, so a reload, a bookmark or a link passed to someone else lands on the same page of the same book in the same viewer: #preset=bioquimica-feduchi&lang=es&view=canvas&chapter=1&page=7 opens the Bioquímica preset in Spanish on the Canvas tab at chapter 1, page 7 (the number printed on the page). view is canvas, pdf, folio, html or epub; on the Folio tab the page is the right-hand page of the open spread. A local project is named as project=ID — its storage id, so only the browser holding the project can follow such a link. The sandbox keeps the fragment current as you switch books, tabs and chapters and as you scroll. A part left out means whatever is there (no page: the chapter's first page; no book: the one last open), and a book the browser cannot open is passed over. Pasting a link into the address bar of an open sandbox opens it in place. When the page is opened on a link to a book other than the one last open, the sandbox shows its loading state until the linked book is in, never the previous one. A host can also link to books of its own with the hashBundles prop (see Props): the website opens a Cookbook recipe with #recipe=<slug>&lang=es. The first visit imports the recipe's .postext file as one of your books. A later visit to the same link asks first (You already have this book): Open my copy opens that book, your edits included, and Replace with the published version imports the recipe afresh, which may have been corrected since, and deletes your copy once the new one is open; Escape keeps your copy. The fragment then names the project. The interface language stays in the path (/en/sandbox, /es/sandbox); lang is the content language of a bilingual bundle, any BCP 47 tag, kept in canonical case (lang=zh-hant reads zh-Hant). A tag the bundle does not list opens the edition that serves it: zh-TW and zh-HK open the Traditional Chinese one (zh-Hant), zh and zh-CN the Simplified one (zh-Hans), en-GB the English one. The other Chinese script is read only when the bundle has no edition in the reader's: a zh-TW link to a book in zh-Hans and English opens the Simplified text, not the English. A link without lang opens the bundle's openLocale when it names one, else the edition in the interface language. The chapter and page of a link apply to the edition it opens, and the fragment then names that edition by its own tag (lang=zh-TW&chapter=28 becomes lang=zh-Hant&chapter=28).

Heading breaks saved by postext 1.4 or earlier. Up to postext 1.4, a configuration with a headings object laid its level-1 headings out with no page break unless it set the H1 Break before switch explicitly (and saving dropped a switched-off H1 break), a partial H1 break took its missing field from the no-break default, and a heading style's break did the same instead of merging onto its level's. The engine now keeps each level's default — H1 opens on a fresh recto (always-odd) — and merges a partial break onto it. So that a book saved then keeps the pages it had, the Sandbox writes those breaks out when it reads a project record older than version 3 or an unversioned working configuration: enabled: false on H1 where the break was off, and parity: 'any' beside an enabled: true that named no parity, on H1 and on heading styles. The Design panel then shows the break the pages were laid out with. Files record the version too since postext 1.5: a .postext file whose manifest has no configVersion, and a postext-config.json with none, were written by postext 1.4 or earlier, and are read the same way when they are imported or opened (see Bundles written by postext 1.4 or earlier).

Maths size saved before postext 1.5. Up to postext 1.4 every formula came out 1.131 times larger than its Size scale says (see Formula size). So that a book saved then keeps its pages, the Sandbox pins that size when it reads a project record older than version 4, a working configuration saved under an older stamp (or none), a .postext file whose manifest is older than configVersion: 4, or a postext-config.json exported before it: Size scale becomes the saved scale × 1.1312 and a display margin in em is divided by 1.1312, so the formulas and the space around them stay as they were. A book whose chapters have no $ is left as it was (a postext-config.json carries no chapters, so its size is pinned whenever maths is on), and so is one with Enable LaTeX off. The Formulas section then shows the values the book is laid out with; reset Size scale, Display margin top and Display margin bottom to set it at today's size. The pin is written once: the record is saved again under the current version and read as it is from then on. A preset applied then and never edited still counts as untouched (the Sandbox compares it with its pinned values, and this holds for the heading-break pin too): reloading it or switching books does not ask to discard edits you never made, and a newer version of the preset, such as the built-in guide's, still replaces it.

Inline figures saved before postext 1.5. Up to postext 1.4 a figure or table set inline in the text (placement Inline (here)) kept a line of space above it only: the text after it resumed at the next grid line, however close that was. It now keeps the same line below it (Columns → Space around inline figures, Above and below). So that a book saved then keeps its pages, the Sandbox sets Space around inline figures to Above only when it reads a project record older than version 5, a working configuration saved under an older stamp (or none), a .postext file whose manifest is older than configVersion: 5, or a postext-config.json exported before it, when a line of the book embeds a resource — ::resource{id="…"} alone on its line, not a mention in the text. A postext-config.json carries no chapters, so there it is set whenever the file is older. Choose Above and below to lay the book out with today's spacing.

Inline figures in boxes saved before postext 1.5. Up to postext 1.4 a figure or table set inline inside a box sat right against the box text around it. It now keeps a line of the box text above it, and below it too with Above and below (Columns → Space around figures in boxes). So that a book saved then keeps its pages, the Sandbox switches Space around figures in boxes off when it reads a project record older than version 6, a working configuration saved under an older stamp (or none), a .postext file whose manifest is older than configVersion: 6, or a postext-config.json exported before it, when a box of the book embeds a resource on a line of its own. A postext-config.json carries no chapters, so there it is switched off whenever the file is older. Switch it on to lay the book out with today's spacing.

Heading marks and drop caps saved before postext 1.5. Up to postext 1.4 a heading printed the words of its *italic*, **bold** and other marks in its own plain style, and a drop cap with no size was as tall as all the lines it spans, its top above the first line. A heading now sets its marks (Headings → Inline marks in headings), and a drop cap's top is level with the capitals of the first line. So that a book saved then keeps its pages, the Sandbox turns Inline marks in headings off when it reads a project record older than version 6, a working configuration saved under an older stamp (or none), a .postext file whose manifest is older than configVersion: 6, or a postext-config.json exported before it, when a heading of the book carries a mark (a postext-config.json carries no chapters, so there it is turned off whenever the file is older); and it writes the size each drop cap was set at into its Drop cap size. Turn the switch on, or clear the size, to set the book with today's rules. Mind that an italic heading whose whole title is marked *…* then comes out upright.

Lists after a colon saved before postext 1.5. Up to postext 1.4 Keep colon with list took one line of room under the line ending in a colon as enough for the list, so a two-line first item that the orphan and widow rules keep whole went on to the next column and left the colon line alone at the foot. It now asks for the room the first item needs (Typography → Body text → Widows, orphans and short lines → Room Under the Colon, What the first item needs). So that a book saved then keeps its pages, the Sandbox sets Room Under the Colon to One line (1.4) when it reads a project record older than version 6, a working configuration saved under an older stamp (or none), a .postext file whose manifest is older than configVersion: 6, or a postext-config.json exported before it, when a list of the book follows a line ending in a colon. A postext-config.json carries no chapters, so there it is set whenever the file is older. Choose What the first item needs to lay the book out with today's rule.

Box cuts saved before postext 1.5. Up to postext 1.4 a box that split inside a paragraph or list item could leave one line of it on a side, as long as each side of the box held its Lines kept on each side of a split. A cut now leaves at least two lines of the paragraph or item on each side (Columns → Lines of a paragraph at a box cut). So that a book saved then keeps its pages, the Sandbox sets Lines of a paragraph at a box cut to 1 when it reads a project record older than version 6, a working configuration saved under an older stamp (or none), a .postext file whose manifest is older than configVersion: 6, or a postext-config.json exported before it, when a chapter of the book opens a :::callout. A postext-config.json carries no chapters, so there it is set whenever the file is older. Set it back to 2 to lay the book out with today's rule.

Dashes and ragged text saved before postext 1.5. Up to postext 1.4 optimal line breaking never ended a line after an em or en dash set closed between words (say—that’s), and ragged text was always set line by line, each line filled before the next. A line may now end after such a dash (Typography → Body text → Paragraphs → Break After Dashes), and ragged running text is broken with Knuth-Plass too (Optimal Breaking of Ragged Text). So that a book saved then keeps its pages, the Sandbox switches Break After Dashes off when it reads a project record older than version 7, a working configuration saved under an older stamp (or none), a .postext file whose manifest is older than configVersion: 7, or a postext-config.json exported before it, when a chapter of the book sets such a dash (a postext-config.json carries no chapters, so there it is switched off whenever the file is older); and it switches Optimal Breaking of Ragged Text off when the configuration sets some running text ragged: the body text, a paragraph style, a box body, the body of a part or the body of a section style. Switch them on to lay the book out with today's rules.

Splits under a heading saved before postext 1.5. Up to postext 1.4 the paragraph under a heading at the foot of a column kept as many lines as fit there, however few went on to the next column. It now keeps the orphan minimum too, or the heading moves on with it (Headings & contents → Headings → Split Under a Heading). So that a book saved then keeps its pages, the Sandbox sets Split Under a Heading to Fill the column when it reads a project record older than version 8, a working configuration saved under an older stamp (or none), a .postext file whose manifest is older than configVersion: 8, or a postext-config.json exported before it, when a chapter of the book has a heading (a postext-config.json carries no chapters, so there it is set whenever the file is older) and the configuration keeps Keep With Next and orphan control on. Set it to By the rules to lay the book out with today's rule.

Paragraph containers saved before postext 1.5. Up to postext 1.4 the space under a :::paragraphs container was the style's own (the larger of its space between paragraphs and its bottom margin), set under the last line before the text snapped back to the grid; the space a heading keeps above itself was added under it, and the body's paragraph spacing did not count, so a heading sat further from a bibliography than from a paragraph, and the paragraph after a group of tight entries sat closer to it than to any other. The space now merges with the next block's own and is at least the text's paragraph spacing (Typography → Paragraph styles → Space under a container, Collapse). So that a book saved then keeps its pages, the Sandbox sets Space under a container to Add (1.4) when it reads a project record older than version 8, a working configuration saved under an older stamp (or none), a .postext file whose manifest is older than configVersion: 8, or a postext-config.json exported before it, when the configuration declares a paragraph style and a chapter of the book opens a :::paragraphs container. A postext-config.json carries no chapters, so there it is set whenever the file is older and declares a paragraph style. Choose Collapse to lay the book out with today's rule.

Compounds saved before postext 1.5. Up to postext 1.4 optimal line breaking never ended a justified line after the hyphen of a compound (well-known) in a paragraph without bold, italics or other formatting, while it did in one with formatting. A line may now end there in every paragraph (Typography → Body text → Paragraphs → Break After Hyphens). So that a book saved then keeps its pages, the Sandbox switches Break After Hyphens off when it reads a project record older than version 8, a working configuration saved under an older stamp (or none), a .postext file whose manifest is older than configVersion: 8, or a postext-config.json exported before it, when a chapter of the book sets a hyphen between two letters (a postext-config.json carries no chapters, so there it is switched off whenever the file is older). Switch it on to lay the book out with today's rule.

Poems and hanging styles saved before postext 1.23. Up to postext 1.22 a :::verse poem whose lines carried no || was set as single hemistichs, each line centred, and a paragraph style's hanging indent replaced its first-line indent. Such a poem is now set line by line (Typography → Body text → Verse → Poems Without Separator, Line by line), and a style that sets both indents starts its first line at the first-line indent. So that a book saved then keeps its pages, the Sandbox sets Poems Without Separator to As hemistichs (1.22) when it reads a project record older than version 9, a working configuration or a postext-config.json export stamped below 9 whose chapters hold such a poem, and drops the first-line indent of a style that also hangs. It also switches Forced Line Breaks (Typography → Body text → Paragraphs) off when the chapters of such a record end a line with a backslash or set \\ before a space, which printed up to postext 1.22 (for a postext-config.json export, which carries no chapters, always). And it switches Code fences (Typography → Code) off when the chapters hold a ``` or ~~~ fence, whose lines were read as Markdown up to postext 1.22 (for an export, always).

Poems saved with postext 1.23. In postext 1.23 a line of a poem set line by line that was even a little wider than the measure turned over. It now tightens its word spaces, down to the minimum word spacing, and stays on one line when that is enough (Typography → Body text → Verse → Tighten Before Turning Over). So that a book saved then keeps its pages, the Sandbox switches Tighten Before Turning Over off when it reads a project record, a working configuration or a postext-config.json export stamped 9 or below whose chapters set a poem line by line (for an export, which carries no chapters, always).

Design texts saved with postext 1.23. Up to postext 1.23 a text element of a heading design or a part page that set no overflow was cut to one line with an ellipsis. It now wraps onto more lines, and Add text leaves Overflow to the slot. So that a book saved then keeps its pages, the Sandbox sets Overflow to Ellipsis at the end (…) on each of those elements when it reads a project record, a working configuration, a .postext file or a postext-config.json export stamped 9 or below.

Inline tables and columns saved with postext 1.24. Up to postext 1.24 a table placed here that did not fit the rest of its column moved whole to the next one, a :::columns fence outside a box was ignored, and a box never cut inside a :::columns group. Now the table is cut between rows and the group sets its blocks in columns and goes on in the next column or page. So that a book saved then keeps its pages, the Sandbox switches Apply to tables set in the text (Tables) off when it reads a project record, a working configuration or a postext-config.json export stamped below 11 whose chapters embed a resource, and Columns in the text, and groups that split (Columns) off when they hold a :::columns fence (for an export, which carries no chapters, always).

Rules of postext 1.25 to 1.30. A project record, a working configuration, a .postext file or a postext-config.json export stamped below 12, 13 or 14 gets the pins of the rules that came later, the same ones a bundle gets (see Bundles written by postext 1.4 or earlier): among them the order of the column-balancing levers, the breaks of a reference's label, the box of a task item and the language the text is shaped in. Version 15 adds page templates and label styles, and pins nothing.

These pins hold back what each of those rule changes would move. Version 1.5 also fixes layout bugs, and a fix has no pin, so a saved book can still see a page move where one of them applies: the band of a page-wide chapter heading without a design, a drop cap in a heading design, a paragraph in a box, a loose paragraph that balancing stretches, a floated box with a margin wider than a line, a centred or right-aligned running head with tracking, the second column under a page-wide opener, a running head taken from a heading broken after a hyphen, a word wider than its line cut next to its own hyphen, the rest of a word wider than its line, which now keeps its own break points, the item after a list nested in another (see Formula size for the list).

Storage is shared across UI locales. A pristine default document swaps to the current locale's default markdown and reseeds the example resources when the locale changes — so opening the Spanish sandbox shows Spanish examples. Any user edit opts the document out of this behavior. All previews also derive a hyphenation locale from the UI locale when the configuration names no language (neither a hyphenation locale nor locale).

#Export and import

A whole book travels as a .postext file: a zip archive with exactly the layout of a preset bundle directory — preset.json, chapters/*.md, resources/* and fonts/* (see Preset bundle format). The archive also carries the book's pagination as layouts.json — each chapter's page count and numbering, stamped with the engine version, configuration and resources it was built with — so an imported book opens paginated and only what those stamps no longer vouch for is laid out again. A bundle in several languages sets each with its own configuration, so it may carry one per language instead, layouts.<locale>.json (layouts.zh-Hant.json), read before layouts.json. The active document exports the pagination it holds; a project or preset exported from its row carries the one recorded while it was last the working book. A cover image is written as the manifest's thumbnail, so it survives the round trip. The Books panel's New menu (Open a .postext file…) imports a file as a new book; every row's ⋯ menu has its own Download (.postext), and the open book's exports the working document. Files written by earlier versions (a version 1 manifest with a single document.md) import as a one-chapter book. A book in one language keeps the figure and table labels of that language whatever the interface language: a Spanish file opened from /en/sandbox prints Figura and Tabla unless its configuration names other resource types. The language is the one the file names or, when it names none, the one its configuration sets (locale, then the hyphenation language). Import accepts the files at the archive root or under one top-level folder (as produced by zipping the folder itself; __MACOSX entries and dotfiles are ignored). Fonts are written as separate files, never inside config.customFonts; .woff faces are skipped with a warning both ways, as are resources whose bytes are missing. Unzip an exported file into <presets-root>/<dir>/ and add an index.json entry to serve it as a preset.

Download as PDF, Download as HTML and Download as EPUB 3, in the same ⋯ menu, write the whole book to one file, open or not (since postext 1.81). A book in several languages asks which language to write. The book is laid out apart from the one on screen, with its own fonts, pictures and pagination, and the book you are working on is left as it is. The chapters whose pagination is not stored yet are numbered first, so the contents print their page numbers; the pages are then laid out and written as the PDF and EPUB tabs do it, with the same print settings, fonts and cover. The HTML is one self-contained page with the book's pages one under another and its pictures and fonts inside, written by the same code as postext html --mode single. The panel shows the progress and a Cancel button; the other books stay at hand meanwhile, and deleting the book stops its file. The file's warnings appear in the panel's notice. An EPUB takes the book's cover picture; a book without one has its first page painted as the cover in its own fonts, whatever book is on screen (since postext 1.82).

A book in several languages keeps them all. Importing a .postext file whose manifest lists several languages reads every one into the project and asks only which to open first. The row in Books then shows a tag per language: click one to open the book in it. The rail at the start edge of the canvas switches the language, and the Checks panel and Side by side (see Previews) read every language of the project, as they do for a sample. Each language keeps its own edits: switching saves the one on screen and opens the other as you left it. The permalink names the language (#project=ID&lang=ca). Duplicate copies every language, and Download (.postext) writes them all back as one file, the language on screen first; a file written without a list of languages stays in one. Each language also keeps its own title: the project's name and description follow the language on screen, as the bundle names them (localized.<lang>.name), until you rename the project, and that name then stands in every language and in the file. Download (.postext) writes the pagination of every language the project has laid out, one layouts.<lang>.json beside layouts.json, so each opens paginated (since postext 1.42). The languages share general settings and each keeps the settings it sets itself; the switch at the top of the Design panel chooses which you edit (see Design panel). The file carries the general settings as the manifest's config and each language's own as its localized.<lang>.config (see General settings and per-language overrides).

Add a language to a book, whether it has one language or several, from its row in Books: press ⋯, choose Add a language…, pick the language and press Add and open (since postext 1.43). The Sandbox copies the language on screen into a new edition, sets its Document language, opens it and adds it to the tags of the row; the text is still the original's, waiting to be translated. For Arabic, Chinese and Japanese it also applies the defaults of the language, as a new book in it gets them (typefaces, caption words, digits, reading direction), and leaves the settings you had chosen yourself; a book set vertically gets a vertical Japanese edition, one set horizontally a horizontal one. The notice says how many settings moved. Going from one of those languages to another language does not undo them: change direction, binding and writing mode in Language and direction. The rail of the canvas, Side by side and the Checks panel then read both languages. A language the book already has is not offered. On a book in several languages, Rename… has a box, Only for the … edition: ticked, the name and description belong to that language alone and the others keep the title they show; unticked, the name stands in every language, as above (since postext 1.43). In the Checks entry of the activity bar the number is that of the language on screen, which the entry tells screen readers; the panel lists every language. A copy made with Make my own copy or Duplicate takes the book's name with copy added.

A font file the manifest names that the archive does not hold (a pack that left licensed faces out) does not stop the import: the face is skipped with a warning, and the Checks panel lists the family as unknown until it is uploaded as a custom font. When the manifest names a fallback for that family (an open family of about the same width), the family stays and its faces are set in the fallback, so the pages break their lines near where the real face does and the family is not listed as unknown. The Fonts panel shows it with its Stand-in family, and a book exported with its licensed family left out writes the name again, with no files (since postext 1.42).

The same files are read and written by the postext package (openBundle, createBundle, buildBundle; see Bundles). A book exported here opens in your own program, and a book your program writes opens here. That makes the Sandbox a place to inspect and fine-tune what a program lays out: export it from the program, import it here, fix it with the live preview, export it again and load it back in the program. The agent skill delivers its ports as .postext files too.

Export to InDesign (IDML), in the Text panel header, lays the whole book out as the PDF tab does for the whole book (every chapter after the ones before it) and downloads it as <book>.idml, an InDesign Markup package to open in InDesign. The pages stand in spreads of facing pages when the book has facing-page margins, and one to a spread otherwise; rules, boxes and pictures become InDesign page items, with the pictures (and the PDF print masters of SVG figures) embedded; the text of each frame becomes one story, in paragraph styles named after the book's. Every line ends where Postext ended it, so InDesign shows the same lines as the PDF. The dialog has four options. Lines keeps every line where the PDF ends it, or leaves the paragraphs to InDesign's composer, for a book that will be set again there. Spreads follows the margins or sets facing pages or single pages whatever they say. Pictures embeds them in the document or links them from a Links folder. Include the fonts puts the font files of the book's faces in a Document fonts folder, where InDesign finds them; a family marked as not redistributable is left out, and the dialog names it. With linked pictures or with the fonts, the download is a .zip that holds the .idml beside its folders: unpack it before opening the document. A bar follows the work: the chapters laid out, then the package written. When the writer has something to report (a picture without its file, an SVG that older versions of InDesign do not place, a page of another size), the dialog stays open after the download and lists it under What InDesign will show differently. The command line (postext idml) and the API (postext-idml) write the same package (see Programmatic usage › InDesign packages).

The text and the design also export separately from the Text and Design panel headers.

The Design panel header exports the book's design as a design file, a .postext with no chapters (see Design bundles), and imports one, the design of a whole book's .postext, or a postext-config.json written by earlier versions (see Designs).

The Text panel header downloads the active chapter as a plain .md file and its Import button replaces the active chapter with a .md file's contents. The postext-markdown.json wrapper and the combined postext-sandbox.json format from earlier versions no longer exist.