SILE Typesetter Documentation
repository·master·Indexed 23 days ago
https://github.com/sile-typesetter/sileSILE (Simon’s Improved Layout Engine) is a modern typesetting and layout engine designed for high-quality printed documents. It combines TeX's algorithmic strengths with the flexibility of graphical systems like InDesign and is extensible via Lua. Key capabilities include complex frame-based layouts, grid layouts, direct XML-to-PDF processing, and support for Citation Style Language (CSL).
What's inside SILE
- SILE is a typesetting system designed to produce high-quality printed documents. While it borrows some concepts and algorithms from TeX, it is a ground-up implementation built with modern technologies. It functions more like a graphical layout system (similar to Adobe InDesign) than a traditional TeX derivative.
Use CSL style files in SILE
masterSILE includes a default set of Citation Style Language (CSL) style files for testing and implementation purposes. These files are sourced from the official Citation Style Language project.
Note that these files are provided for convenience; for the most up-to-date styles, you should refer to the official Citation Style Language project.
How to support a language in SILE
masterTo provide support for a new language in SILE, you must implement a combination of the following components:
- A base module: This is a required component for any language support.
- Hyphenation patterns module: Provides rules for the Knuth-Liang hyphenation algorithm.
- Localization strings: Provides translations for strings output in documents via a
messages.ftlfile for each locale.
Key capabilities of SILE
masterSILE provides several layout features that distinguish it from TeX-based systems:
- Complex Layouts: Use frames to produce sophisticated document layouts.
- Extensibility: The system can be extended using the Lua programming language.
- XML Processing: Directly process XML to PDF without requiring XSL stylesheets.
- Grid Layouts: Typeset text on a defined grid.
Understand the source of CSL locale files in SILE
masterSILE includes a default set of locale files for Citation Style Language (CSL) styles to facilitate testing and default behavior. These files are sourced from the official Citation Style Language project.
Note that because these are provided for convenience within the SILE repository, they may not always be the most recent versions available from the upstream CSL project.
Run SILE using Docker
masterDocker images are available on Docker Hub as
siletypesetter/sile. You can use thelatesttag or specific version tags (e.g.,v0.10.0).To use SILE effectively in Docker, you must mount your project directory as a volume so SILE can access source files and write output.
Accessing System Fonts: By default, the container does not have access to your host's fonts. To fix this, mount your host's font directory to
/fontsinside the container.# Create an alias for easier usage (mounts current dir to /data) $ alias sile='docker run -it --volume "$(pwd):/data" siletypesetter/sile:latest' $ sile input.sil # Run with host fonts mounted to /fonts $ docker run -it --volume "/usr/share/fonts:/fonts" --volume "$(pwd):/data" siletypesetter/sile:latestInstall SILE on macOS
masterYou can install SILE on macOS using Homebrew. You can choose between the stable release or the latest development version from the git HEAD.
Note: The Homebrew package does not automatically install the default font (Gentium Plus). It is recommended to install it via the Homebrew Fonts caskroom.
Build SILE from source
masterBuilding from source requires a Rust toolchain and Lua sources. SILE relies on HarfBuzz (min version 2.7.4), fontconfig, and ICU libraries.
Key Steps:
- Ensure dependencies (HarfBuzz, fontconfig, ICU, OpenSSL development headers) are installed.
- If using a Git clone, run
./bootstrap.shfirst. - Run
./configureandmake. - Use
sudo make installto install to the system.
Developer Mode: If you are developing SILE, use the
--enable-developer-modeflag during configuration. This sets the 'installed data' directory to your source location, allowing the binary to run directly from the source without installation, and enables testing targets likemake regressions.Use SILE in GitHub Actions CI workflows
masterYou can automate document rendering in a CI environment using GitHub Actions. The easiest way is to use the
sile-typesetter/sile@v0action. This action assumes your repository contains a source file (e.g.,my-document.sil) and will output a PDF (e.g.,my-document.pdf).name: SILE on: [ push, pull_request ] jobs: sile: runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v3 - name: Render document with SILE uses: sile-typesetter/sile@v0 with: args: my-document.silInstall SILE on Linux
masterSILE is available in the official repositories for several Linux distributions:
- Arch Linux: Uses the official package. If using LuaRocks via
pacman, uselua51-*variants to match LuaJIT. - Fedora: Available in official repositories. You may need to install fonts separately.
- OpenSUSE: Available via
zypper. - NixOS: Available in both stable and unstable channels.
- Ubuntu: Available via a PPA.
- Void Linux: Available in the default package manager.
# Arch Linux $ pacman -S sile # Fedora $ dnf install sile # To install default fonts on Fedora: $ dnf install sil-gentium-plus-fonts alerque-libertinus-fonts hack-fonts # OpenSUSE $ zypper install sile # Ubuntu $ add-apt-repository ppa:sile-typesetter/sile $ apt-get update $ apt-get install sile- Arch Linux: Uses the official package. If using LuaRocks via
Install third-party SILE packages via luarocks
masterSILE plugins are managed via
luarocks. To ensure compatibility, you must install packages for the specific Lua version that SILE uses. You can query SILE's Lua version usingsile -q <<< SILE.lua_version.Installation Locations
- System-wide (Default): Uses the
--globaloption (usually requires root). - Local Directory: Use
--tree lua_modulesto install into alua_modulesdirectory in your current folder. SILE automatically detects plugins in this directory if it is adjacent to your document. - User Profile: Use the
--localoption to install to your user profile.
Configuring Plugin Paths
If you install plugins to a custom directory (other than
lua_modules), you must tell SILE where to find them:- Environment Variable: Run
eval $(luarocks --lua-version $(sile -q <<< SILE.lua_version) path --local)(or use your specific--treepath) to update your shell environment. - CLI Argument: Pass the
--luarocks-tree <path>argument directly to thesilecommand.
- System-wide (Default): Uses the
Run SILE using Nix
masterNix is a viable alternative for running SILE on most platforms (Linux, BSD, macOS, and Windows via WSL). The
unstablechannel is recommended for the latest releases.You can launch a shell with SILE available or run it directly as a single command. Since the source is a Nix Flake, you can also run specific tagged versions or branches directly.
# Launch a new shell with SILE available $ nix shell nixpkgs/nixpkgs-unstable#sile $ sile <arguments> # Run SILE directly as a single command $ nix run nixpkgs/nixpkgs-unstable#sile -- <arguments> # Explicitly run a tagged version $ nix run github:sile-typesetter/sile/v0.14.13 -- <arguments> # Run the master branch HEAD $ nix run github:sile-typesetter/sile -- <sile arguments> # Run the develop branch HEAD $ nix run github:sile-typesetter/sile/develop -- <sile arguments>