« Home

Workflows & Techniques

Twine to PDF

The simplest workflow is to go directly from Twine to a PDF (via Twison/Twee), as explained on the home page. This is a one-way workflow. You export your game from Twine, load it into Gordian, and then produce the PDF. In this workflow, passages are numbered once, when the game is first converted. Converting again would change the numbering, so each time you make changes in Twine and re-export you will get a different order. This is especially relevant to page breaks, and the placement of images.

To place images in this workflow, first import and convert the game, then look at the PDF to see where your images would sit best. Then edit individual passages in Gordian to add the images to them. If you need to absoloutely place images on the page, they cannot be contained in a passage (this is a limitation of MPDF, which we use to produce the PDF). To deal with this, place the image in an <after> tag to place it outside the passage container. When you do this, make sure to give your image an id, so that you can target it in your custom CSS.

Twine to Twine

Once exported from Twine to Gordian, you can export from Gordian back to Twine, using the Export Twine Archive link. Then, in Twine, choose Import From File to re-import your story. Note that, unless you rename your story in Gordian (or in the exported file) first, it will entirely replace the story you have in Twine. Be careful.

Twine to Twee

Once exported from Twine to Gordian, you can export from Gordian to Twee3, a human-readable format for interactive fiction. Gordian uses tags to number the paragraphs in Twee, and includes your custom settings and covers in special passages (such as gb-front-cover, and gb-settings). You should be able to export from Gordian to Twee, and then re-import that Twee and get the same results.

If you should want to get your Twee file back into Twine (e.g. after spell-checking it, or working on it in a text editor), you will need to use tweego to convert the Twee to a Twine archive.

tweego -a -o archive.html exported.twee

Then import the archive into Twine. Note that this will replace your existing game unless you rename the game in the twee file first.

PDF Formatting

PDFs are created using MPDF. You can read the manual to find special tags (such as page breaks, headers, and footers) that you can include in your gb-introduction or other passages.


If you enable covers in settings, GBF will add a front cover page to your PDF containing the game title. This ends with a page break and resets page numbering (so the first page after the title is page 1). If you provide a passage named gb-front-cover then this will override the automatic cover. Gordian provides some utility classes to help lay out your cover as follows:

Note that, due to restrictions in MPDF, nested elements cannot be absolutely positioned, and you cannot use descendent selectors in CSS to target the immediate children of an absolutely positioned element. So, in the example below, you cannot style the title with .cover_top .cover_title, you must use just .cover_title

<div class='cover_top'> <h1 class='cover_title'>Book Name</h1> </div> <div class='cover_image'></div> <div class='cover_bottom'> <h2>By<br>N. N. Author</h2> </div>

Custom CSS

Custom CSS can be entered in the Settings. Alternatively, if importing from Twee, any [stylesheet] sections will be added to the custom CSS. If importing from Twine via Entweedle, the user-stylesheet gets added to the custom stylesheet.