The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

muse-compile.pl -- format your muse document using Text::Amuse

SYNOPSIS

  muse-compile.pl [ options ] file1.muse [ file2.muse  , .... ]

This program uses Text::Amuse to produce usable output in HTML, EPUB, LaTeX and PDF format.

By default, all formats will be generated. You can specify which format you want using one or more of the following options:

--html

Full HTML output.

--epub

Full EPUB output.

--bare-html

HTML body alone (wrapped in a div tag)

--tex

LaTeX output

--zip

Pack the tex, the source and the html with the attachments in a zip file.

--pdf

PDF output.

--a4-pdf

PDF imposed on A4 paper, with a variable signature in the range of 40-80

--lt-pdf

As above, but on Letter paper.

--ttdir

The directory with the templates. Optional and somehow discouraged for normal usage.

--webfontsdir

For EPUB output, embed the fonts in that directory.

In this directory the program expects to find 4 fonts, a regular, an italic, a bold and a bold italic one. Given that the names are arbitrary, we need an hint. For this you have to provide a file, in the very same directory, with the specifications. The file must be named spec.txt and need the following content:

E.g., for Droid fonts:

  family Droid Serif
  regular DroidSerif-Regular.ttf
  italic DroidSerif-Italic.ttf
  bold DroidSerif-Bold.ttf
  bolditalic DroidSerif-Bold.ttf
  size 10

The four TTF files must be placed in this directory as well. The formats supported are TTF, OTF and WOFF.

The family and size specs are optional.

--output-templates

Option to populated the above directory with the built-in templates.

--log <file>

A file where we can append the report failures

--no-cleanup

Prevent the removing of the status file. This is turned on if you use --recursive, to prevent multiple runs to compile everything again.

--extra key:value

This option can be repeated at will. The key/value pairs will be passed to every template we process, regardless of the type, even if only the built-in LaTeX template support them.

The input is assumed to be UTF-8 (if you pass non-ascii characters). The values, before being passed to the templates, are interpreted as Text::Amuse strings. This normally doesn't have any side effects for simple strings, while for text this has the sane behaviour to escape special characters and to permit inline markup.

Example:

  muse-compile --extra site=http://anarhija.net \
               --extra papersize=a6 --extra division=15 --extra twoside=true \
               --extra bcor=10mm --extra mainfont="Charis SIL" \
               --extra sitename="Testsite" \
               --extra siteslogan="Anticopyright" \
               --extra logo=mylogo \
               --extra cover=mycover.pdf \
               --extra opening=any \
               file.muse

Keep in mind that in this case mylogo has to be or an absolute filename (not recommended, because the full path will remain in the .tex source), or a basename (even without extension) which can be found by kpsewhich (or a file in the current directory, if you aren't doing a recursive compilation). Same applies for cover.

Supported extra keys (documented in Text::Amuse::Compile::Templates):

  • papersize (common values: a4, a5, letter)

  • mainfont (grep fc-list -l for the correct name)

  • fontsize (9, 10, 11, 12) as integer, meaning points (pt)

  • oneside (true or false)

  • twoside (true or false)

  • bcor (binding correction for inner margins)

  • sitename

  • siteslogan

  • site

  • logo (filename)

  • cover (filename for front cover)

  • coverwidth (dimension ratio with the text width, eg. '0.85')

    It requires a float, where 1 is the full text-width, 0.5 half, etc.

  • division (the DIV factor for margin control)

  • nocoverpage

    Use the LaTeX article class if toc is not present

  • notoc

    Never generate a table of contents

  • opening

    Page for starting a chapter: "any" or "right" or (at your own peril) "left"

--recursive <directory>

Using this options, the target directory and a recursive compiling is started, finding all the .muse files without a newer status file, and compiling them accordingly to the options.

No target files can be specified.

--dry-run

For recursive compile, you can pass this option to just list the files which would be compiled.

--luatex

Use lualatex instead of xelatex.