fimblethwicke(1)        FreeBSD General Commands Manual       fimblethwicke(1)

     fimblethwicke - Manuscript Formatter for FreeBSD and Mac OS X

     fimblethwicke [-n] [-r] [-s] [-c | -e | -x | -t] [<infile> [<outfile>]]

     Fimblethwicke converts a text document marked up as a fiction manuscript
     with a simple human-readable markup language or with Tree Structure
     Markup Language into an RTF manuscript, a PDF manuscript, or an EPUB

     Fimblethwicke reads from stdin or from a single file specified on the
     command line and writes to stdout or to another file specified on the
     command line.  To specify an output file without an input file, specify
     an input file of '-'.  If the input document is malformed, fimblethwicke
     exits without explanation.

     Fimblethwicke expects its input to be encoded as UTF-8.

     When producing RTF or PDF files, fimblethwicke only accepts the first 2
     ranges of Unicode: the Basic Latin range (ASCII) and the Latin Supplement
     range (Latin 1).  This is sufficient to support Western European
     languages.  When producing RTF or PDF files, fimblethwicke converts UTF-8
     sequences representing typographical single and double quotes and em-
     dashes into their typewriter equivalents.

     When producing EPUB files, fimblethwicke accepts all Unicode code points.
     When producing EPUB files, fimblethwicke converts typewriter quotes and
     double hyphens to their typographical equivalents and represents break
     paragraphs as 2 typographical em-dashes.  Sections and Chapters start new
     pages.  Both sections and chapters appear in the TOC.

     Fimblethwicke embeds a subsetted version of the Open Source Courier Prime
     typeface into PDFs.  To comply the typeface's license (OFL in the source
     distribution), the modified typeface is named Courier Prime Basic.

     When invoked without options, fimblethwicke reads TSML and writes a PDF
     with 8.5in x 11in pages.

     -c    causes fimblethwicke to convert text input to TSML. The text format
           recognized is described in the section titled, TEXT INPUT.

     -e    causes fimblethwicke to convert TSML input into an ebook hierarchy
           rooted in the current directory or in the directory specified by
           the second command line argument.

     -n    causes 'c' headings to start on a new page.

     -r    causes 's' headings to restart chapter count.

     -s    causes fimblethwicke to embed Courier Prime Basic Sans into PDF
           output instead of Courier Prime Basic.

     -t    causes fimblethwicke to convert TSML input to the text format.

     -x    causes fimblethwicke to produce RTF output instead of PDF.

     TSML is a generic markup language described in tsml(5).  TSML is designed
     to be machine-friendly rather than human-friendly.  Fimblethwicke uses a
     simple TMSL scheme to classify paragraphs by type and to define document

     An example TSML manuscript is included in the source distribution in the
     file document.tsml. A concise example TSML manuscript follows.

       [t[ TITLE 1;;TITLE 2 ]]
       [a[ Author 1; Author 2 ]]
       [c[ Contact 1; Contact 2 ]]
       [r[ Revision 1; Revision 2 ]]
       [h[ TITLE; Author ]]
       [l[ en ]]
       [y[ 2018, Author 1 and Author 2]]l

     [s[ THIS IS SECTION $S ]]
     [c[ THIS IS CHAPTER $C ]]

        _Lorem_ _ipsum_ _dolor_ _sit_ _amet_, consectetur adipiscing elit. Quis est
        enim, in quo sit cupiditas, quin recte cupidus dici possit? Estne, quaeso,
        inquam, sitienti in bibendo voluptas? Quasi ego id curem, quid ille aiat
        aut neget.  Illi enim inter se dissentiunt. Ne amores quidem sanctos a
        sapiente alienos esse arbitrantur. Duo Reges: constructio interrete.

     All elements have names of a single letter.  The toplevel element is
     named 'y'.  It contains one or more instances of the following child

     'm'  Fimblethwicke extracts from the children of the 'm' element the data
          to use in the manuscript's title page, running header, and in the
          PDF Info dictionary.  To specify that the text in these elements be
          formatted into multiple lines, separate the data for each line from
          the others with a semicolon.  To insert a blank line between lines,
          insert 2 contiguous semicolons.  To insert a semicolon into your
          data, insert a tilde '~' instead.


          't'  specifies the title of the manuscript.  Titles are formatted in

          'a'  specifies the authors.

          'c'  specifies contact information.

          'r'  specifies revision information.  To insert the current date,
               make one of the revision lines $D by itself.  To insert the
               word count of the document, make one of the lines $W by itself.

          'h'  specifies the content to be added to the running header of the
               manuscript.  This element should contain 2 lines.  The first
               line should be your last name.  The second line should be one
               or two words from the title of the manuscript.  Subsequent
               lines are ignored.

          'l'  specifies the language of the input document as a BCP 47
               country code.  Fimblethwicke only accesses this element when
               generating ebooks. The value defaults to 'en' (English).

          'y'  specifies a copyright message to be added to the title pages of
               epubs. It should contain the year, a comma, and the name of the
               copyright owner. You can include an email address or web URL
               after another comma, but beware that all text is formatted onto
               a single line. Fimblethwicke will precede the copyright
               information with the text ' Copyright' and the c-in-circle
               copyright symbol. If the 'y' element is missing from the
               metadata, no copyright message is added to epubs.

          The 'm' element should only appear once in a document.  If you
          provide multiple instances, each instance's data supersedes the data
          in preceding instances.  The 5 child elements should only appear
          once each inside 'm'.  If you provide multiple instances, the data
          in each instance supersedes data the data in preceding instances.
          If you do not provide the 't', 'a', 'c', 'h', or 'r' elements,
          placeholder data is used.

     's'  provides the content of a centered, boldface section title. The
          lines of the paragraph are centered on a separate page.  Any
          occurrence of $S in a section is replaced with the section number.
          Sections are numbered from 1.  By default, the parsing of a section
          does not cause chapter numbering to restart.  The -r option makes
          sections restart chapter numbers from 1.

     'c'  provides the content of a centered, boldface chapter heading
          separated from the rest of the manuscript with 2 blank lines before
          and 1 blank line after the centered line.  Any occurrence of $C in a
          chapter is replaced with the number of the chapter.  Chapters are
          numbered from 1.  To force the content of 'c' elements to appear at
          the top of new pages, include the -n option on the command line.

     'b'  provides the content of a body paragraph.

     'i'  indicates a break paragraph that indicates a break in the narrative
          less significant than that which a chapter indicates.  Only the
          first character of the content is used.  The paragraph is rendered
          as a single line containing the centered character.

     Fimblethwicke discards data outside of terminal elements.  You can place
     comments in between terminal elements.

     Inside of terminal elements, fimblethwicke normalizes whitespace by
     converting all whitespace characters into space characters, collapsing
     multiple contiguous spaces into single spaces, and removing leading and
     trailing spaces.

     Fimblethwicke underlines words bookended with underscores.  If you want
     to underline a section of text, you must _underline_ _each_ _word_
     _individually_.  You cannot underline metadata for the title page.

     Fimblethwicke provides no means to change the font.  You cannot embolden
     text or format it in italics.  Boldface is intrusive outside of headings,
     and Courier Oblique is not oblique enough to attract the eye.  To
     emphasize words, underline them.

     To insert [, ], or \ into element content, escape each with a backslash:

     [b[He looks up. \[At what?\]]]

     When the -c option is invoked, fimblethwicke converts text input to TSML.
     Metadata are specified in a paragraph at the start of a manuscript:

     Author: Carnaby Fimblethwicke
       C. Fimblethwicke
       123 Ocean View Terrace
       Coastal City
       Nowhere, Noplace
       555 ZZZ
     Language: en
     Copyright: 2018, Carnaby Fimblethwicke

     To specify multiple lines for a keyword, leave the line after the keyword
     blank and place the content on lines following the keyword line.  Start
     the content lines with whitespace.  A content line of only whitespace
     will be replaced with a blank line in the output.

     To insert editorial content that is not included in the formatted output,
     wrap paragraphs in '[[' and ']]'.  Multiple paragraphs of text may be
     embedded in a single note "paragraph":

     [[Multi-paragraph note.

     Second paragraph of note.]]

     To specify a section paragraph, start the paragraph with an equals sign:

     =SECTION $S

     To specify a chapter paragraph, start the paragraph with a period:

     .CHAPTER $C

     To indicate a break paragraph, put '#' by itself in the paragraph:

     This is the paragraph before the break.


     This is the paragraph after the break.

     All other paragraphs are body paragraphs.

     Separate paragraphs with blank lines.

     Line breaks are ignored in paragraphs.  Paragraphs are reflowed by
     fimblethwicke to fill the output page.

     The process of producing a PDF or RTF file from a text file can be
     automated with a Makefile:

     all: view

     .PHONY: view
     view: manuscript.pdf
        open -a manuscript.pdf

     manuscript.pdf: manuscript.tsml
        fimblethwicke manuscript.tsml manuscript.pdf

     manuscript.tsml: manuscript.txt
        fimblethwicke -c manuscript.txt manuscript.tsml

     After fimblethwicke has generated an EPUB directory hierarchy, you must
     zip it up to form an EPUB document:

     cd ebook
     zip -X ../book.epub mimetype
     zip -r ../book.epub META-INF OEBPS
     cd ..
     rm -r ebook

     The process of converting a text format document into TSML and then into
     an ebook can be automated with a Makefile:

     all: book.epub

     book.epub: manuscript.tsml
        fimblethwicke -e manuscript.tsml
        cd ebook && zip -X ../book.epub mimetype && zip -r ../book.epub META-INF OEBPS
        rm -r ebook

     manuscript.tsml: manuscript.txt
        fimblethwicke -c manuscript.txt manuscript.tsml

     James Bailie <>

                               Fri Apr 05, 2019