The SILE Typesetter — Simon’s Improved Layout Engine
MIT License
Bot releases are visible (Hide)
This is a relatively minor maintenance release. Thanks again to ongoing work by @Omikhleia, support for bibtex format bibliographies is improving. Date and author parsing and rendering has been improved. Support for CSL is still brewing in the bibliography project.
Additionally the --quiet
flag now correctly suppresses all parts of warning messages for cleaner output when you don't want to debug your project. Even more behind the scenes, the entire code base has also been spell-checked, with hundreds of words in comments, code, and documentation being corrected.
Published by github-actions[bot] 4 months ago
The dust finally settled on the big v0.15.0 release. This patch does include a few more build system touch ups affecting the source tarball that made in require automake when it didn't really need it. But the impetus for this release is actually new features and typesetter bug fixes.
On the language front, @jodros has jumped in with some more domain expertise and Portuguese should now fully support hyphenation of Brazilian locale specific patterns. Additionally we fixed two bugs in the localization system. The locale set for Fluent localizations now properly tracks the document language at any given moment whether set by a font or even a Latin interjection in a bibliography.
Speaking of bibliographies, @Omikhleia is in the middle of a deep overhaul of our bibliography handling. This release has a number of features and bug fixes that lay some groundwork for better parsing and handling bibtex files. More fixes and features are also in progress and even ready for testing. If you have any interest in bibliographies feel free to review ongoing issues and PRs in the bibliography cleanup project.
@string
syntax in bibTeX bibliography (63083ad), closes #2051
@xdata
entry type and xdata field in bibTeX bibliography (ca906f0)document.language
(283fdc3)@preamble
in bibTeX bibliography (742a0c4), closes #2051
Published by github-actions[bot] 4 months ago
This release fixes a regression in v0.15.0 involving 3rd party modules. We were not referencing the LUA_PATH
(and LUA_CPATH
) environment variables at run time, only at build time. This made it unreasonably difficult to install and use 3rd party modules to a user's $HOME
directory and use them in SILE. We were finding modules installed at the system level or locally to a project, but other trees were not being seen.
With this fix, installing modules via luarocks --local install
should be a viable workflow again. Before running SILE, make it aware of these modules with eval $(luarocks --local path)
. The same goes for any arbitrary luarocks --tree
locations.
Published by github-actions[bot] 4 months ago
The big v0.15.0 release had some rough edges. But we mentioned that in the v0.15.1 release notes already. The truth is we fumbled some of the sources in the source tarball again. Here is to being able to build cleanly from the source tarball again.
Published by github-actions[bot] 5 months ago
Published by github-actions[bot] 5 months ago
In the works for over a year with over 500 commits and 100 issues closed, please welcome the biggest single release in SILE history. This is the big “Rewrite it in Rust”! Caveat lector. In truth this is a big release but it is not a rewrite. All the typesetting internals of SILE are still written in Lua and 100% user modifiable at runtime. From an end user or 3rd party module developer standpoint little has changed. However SILE itself is now a compiled Rust application that includes its own Lua interpreter. The build process can (optionally) embed all the Lua and other resources files that makeup SILE and its dependencies in a single binary. This opens the door for improvements such as being able to leverage Rust libraries (including exposing their functions to Lua), write some parts of core functions in Rust for performance or preference, write modules in languages other than Lua or C, package SILE for platforms where Lua is not easy to get running, and much more.
The language change mostly affects building and packaging SILE itself. Once running, relatively little has changed with the way SILE interacts with documents. That being said quite a number of default settings have been changed. See the Usage section of these release notes and the retrograde
module documentation for tips on how to transition smoothly.
For a transition period, the Lua based CLI is still available as sile-lua
. This may be useful for scripting environments that generate inputs and/or parse the output of SILE itself. These should be transitioned to the new Rust CLI sile
which has a few minor differences in argument handling and output message formatting. The Lua CLI will only be available for a limited number of future releases. Please do report any issues using the new CLI.
Extra thanks to @Omikhleia for lots contributions and input during the development cycle; and also to @ctrlcctrlv for generous sponsorships that enabled me to commit quite a bit more time to development.
If you install SILE from your distro's package manager or other packaging, nothing about your process needs to change. Update via your system tools and enjoy.
If you install from source or package SILE, the build command sequence is the same but there are new prerequisite dependencies. It now requires Rust tooling (cargo
, rustc
) as well as some more utilities (jq
) to be available at build time. No new dependencies are needed at run time. In fact it is now no longer necessary to use a Lua VM available at runtime for the new CLI. SILE brings its own Lua VM along. (The legacy sile-lua
CLI of course still uses Lua as before.) Optionally the build process can also be setup to embed all of its runtime dependencies in a single binary. See ./configure --enable-embedded-resources
and ./configure --enable-static
if you want to pursue the single binary route. Most users should use the defaults that install the Lua files and other assets separately as an easy reference for tinkering with and overriding them.
Another notable change is that the default Lua VM has been switched from whatever the system supplied to to LuaJIT. This has been an option for a while, but the default has been whatever the newest PUC Lua version was on the host system. LuaJIT is roughly equivalent to Lua 5.1 and doesn't have some small niceties from 5.4, but it is much much faster. Some of the differences are papered over since SILE depends on and provides the compat53 library compatibility layer. Of course build time SILE can still be configured to used any version of Lua of your choice. This can be used to match compatibility with 3rd party modules or other system components.
A number of command behaviours and default settings have been changed. This will likely cause documents to render with a different flow. It will also break support for some 3rd party modules which will need to be updated to match. Many (but not all) of the changes can be temporarily disabled to cause as few changes when rendering old documents as possible. A new module called retrograde
can be loaded at run time that will reset defaults and even revert some commands and functions to their previous behavior. A target argument can be passed for the version of SILE your document was designed for. Any default setting changes and as much other functionality as practical that may have changed since that release will be reverted.
$ sile -u 'packages.retrograde[target=v0.14.17]' <INPUTS>
Since the Lua VM version used by default is different, you may need to reinstall 3rd party modules with a matching Lua version. You can first query SILE to understand what version of Lua it is using. With that information you can specify the Lua version you want when you install modules as LuaRocks to match. As a demonstration we'll install a Markdown input module in a project-local directory where SILE will find it without extra path configuration, then use it to render a PDF file:
$ sile -q -e 'print(SILE.lua_version); os.exit()'
5.1
$ luarocks --lua-version 5.1 --tree lua_modules install markdown.sile
[…]
$ echo 'Test *Markdown* rendering.' > test.md
$ sile -u inputters.markdown test.md
[…]
Without further ado, here is the nitty–gritty.
packages: Lists now respect the input document spacing and normal settings with regard to paragraphs breaks before, after, and inside lists. This is place of overriding the paragraph skip settings to match the list item spacing setting and always forcing paragraph breaks before and after lists.
classes: Hitherto SILE has cleared the current.parindent setting as soon as it used it at the beginning of a paragraph. With this release, the setting is not being cleared until a paragraph is explicitly ended. This will not have an affect on many documents, but could completely blow up layout code that implicitly relied on the effect. Normal paragraphs (e.g. separated by a blank line in the input) and any use cases that explicitly called far ending a paragraph (e.g. by calling \par
) will be unaffected. But anywhere a paragraph break was simulated by adding vertical space, the indentation will not be applied the next start of a line. This means that calling any variant of \skip
inline in a paragraph will result in content beginning on a new line without using the parindent setting.
Fixing this change in behaviour requires either explicitly resetting the current.parindent setting after it is initially used or explicitly ending a paragraph before or after placing a vertical skip.
inputters: Input documents using the SIL language will now retain whitespace more consistently. Whitespace following environment blocks is no longer swallowed in differently than space following command syntax. Consecutive line breaks in the input will consistently trigger new paragraphs no matter what they follow.
Note that this change cannot be patched over via the retrograde package settings because by the time your document could specify what packages to load or settings to set, the input document has already been parsed. To achieve the same rendering results where environments could be ended leaving any amount of blank lines and still joined to the following content as part of the same paragraphs, you will need to remove the extraneous whitespace.
core: Several top level instance creators of various names have been re-organized under SILE.types.
Specifically SILE.color, SILE.measurement, and SILE.length have the same names, just under SILE.types.. Additionally SILE.nodefactory is now SILE.types.node and SILE.units is not SILE.types.unit.
This brings a little bit of sanity to the naming schemes so that you can guess how to use something from the name, but it also makes room for 3rd party add ons to more easily extend or replace these functions. It also makes it easier to start substituting Rust bits where desired.
core: Use SILE.papersize() instead of SILE.paperSizeParser()
classes: The "center", "raggedleft" and "raggedright" environments formerly reset the margins (left or right skips), meaning they'd take the full frame width. They all cancelled the paragraph indent. The new behaviour honors the fixed part of the parent context's margins, meaning that if you have an environment playing with margins such as an epigraph or an indented quote, those margins are not lost. The raggedleft and raggedright environment also now no longer cancel the paragraph indent.
classes: The \script function was heavily overloaded to have many different functions at once and more targeted tools were introduced in SILE v0.14.0 To load 3rd party modules designed for use with SILE, use \use[module=...] instead of \script[src=...]. To run arbitrary Lua code inline use \lua{}; Lua code may be provided inline or externally via either a require= option to load a regular (non-SILE) Lua module using the Lua module path or src= option to load a file by file path.
core: For ... reasons ... the default width of spaces in SILE has been a highly opinionated and non-standard 1.2 spaces. While it can be argued that this makes some fonts and some documents look better, it is a very strange thing to have as a global default. Unfortunately setting it back to a more conventional 1 space is a major change and will cause many/most documents to re–flow.
The old default can be recovered either in documents with:
\set[parameter=shaper.spaceenlargementfactor,value=1.2,makedefault=true]
...or even from the CLI when rendering a document:
$ sile -e 'SILE.settings:set("shaper.spaceenlargementfactor", 1.2, true)'
core: The previous default paragraph indent was hard coded with a point size (20pt) that did not adapt will to different fonts or page layouts. The new default uses a relative unit that will adjust based on the leading (1bs). This will cause most documents to re–flow. To keep them the same the setting may be reset to the old default either in the document:
\set[parameter=document.parindent,value=20pt,makedefault=true]
...or even from the CLI when rendering a document:
$ sile -e 'SILE.settings:set("document.parindent", "20pt", true)'
utilities: For modules that rely on SILE.utilities
(SU
), and in particular raw content handling functions subContent()
, walkContent()
, stripContentPos()
, hasContent()
, and contentToString()
, these and similar functions have been moved into SILE.utilities.ast
(SU.ast
). The subContent()
implementation also no longer adds id="stuff" attributes to everything.
packages: The default rendering of Ruby readings has changed from just using a bold weight to using the OpenType +ruby feature. Fonts that support this should work with no change, but documents rendered in fonts that do not support it will need to set the ruby.opentype
feature to false
to get the same rendering method as before.
classes: The former implementation of the "em" command did not support nesting and was just setting the font style to italic. The command now alternates italic and regular when nested. * packages: The current (pseudo) idempotent behaviour when loading a package potentially clobbers anything that has been modified since the last load. Loading a package, then modifying a function it provides, then loading the same package again will clobber the modification. This is good for idempotency but not very good for user experience when you may not be modifying all aspects of a document render pipeline at once, as in when using templates.
This change makes the default behaviour to run setting, raw handler, and command registrations only once. An alternative to :loadpackage() called :reloadpackage() can be used to force all these registrations to be rerun when the goal is to make sure of a specific state.
classes: Remove obsolete/broken native markdown class
core: The internal package manager that installed stuff to the system from inside SILE was deprecated back in v0.13.2. It is now completely removed. External 3rd party packages are fully supported using LuaRocks and are much more robust.
develop
tag on GHCR (bd2c6f3)Published by github-actions[bot] 9 months ago
The "big v0.15" is still brewing, but we keep coming up with little improvements that easily fit in the v0.14 series. It turns out the special hyphenation handling we added to Polish (for explicitly hyphenated words) is used by quite a few languages. At this time we've applied it by default to Croatian, Czech, Portuguese, Slovak. and Spanish. Thanks to @Omikhleia for much of the research on this as well as @jodros, @DavidLRowe, @jakubkaczor, and @tomas-vl for domain expertise.
Additionally João contributed an option for columns command to more easily set up column frames with balancing turned on or off.
Published by github-actions[bot] 9 months ago
If goofed up some of the merges involved in the release process for v0.14.15. This doesn't bring any user facing features or fixes, only a bit of refactoring intended to be in the last release. The main purpose is to straighten out the repository so the expected branch contains the release tags. Sorry for the noise.
Published by github-actions[bot] 9 months ago
In today's minor release we tinker with language support.
@Omikhleia contributed improvements to non-breaking space handling in French. He also setup handling of Catalan hyphenation at ela geminada and Polish hyphenation at existing hyphens. Turkish gained a new setting (on by default per the current Turkish Language Association guidelines) for handling hyphenation at apostrophes. The previous behaviour (used by some publisher style guides) is available by toggling off the new setting.
All languages gained an (on by default) setting that makes spaces after em-dashes at the start of paragraphs be fixed width. This is used in at least French and Turkish typography to typeset dialogue and the fixed spacing keeps everything lining up per expectations. Other languages may benefit as well, but also the feature can be disabled if flexible spacing is actually desired.
Details for each of these languages and their related settings are in the SILE manual.
Published by github-actions[bot] 10 months ago
Merry Christmas!
Not this isn't the Rusty release you might want in your stocking. That is coming along nicely though, we're just including an abitioun rollup of breaking changes and going slow to do it right. You can preview the release notes or follow issues in the milestore for teasers. More notably there are already lots of ways to run the development release: Homebrew has --HEAD
support, Docker images are available, the Nix flake works, Arch Linux has VCS packages, and more. If you want to start putting it through the paces go ahead.
Until the cookies are fully baked, this minor release has a few goodies that are not breaking changes. @Omikhleia contributed some updates to the dropcaps
package to better handle fonts with descenders in their capitals. He also contributed some improvements to Unicode handling: soft hyphen and non-breaking spaces work as expected. SILE has perhaps more robust ways of defining custom hyphenation and glue nodes, but the Unicode handling is convenient is handy if you input content has such data anyway. For bonus points some CLI error messages have been dramatically improved to be more informative and less repetative.
Published by github-actions[bot] 12 months ago
This minor release brings a couple improvements from a new contributor, @jodros. We have one new feature, a boolean option flag on our base class that enables landscape mode. Any paper orientation has been supported already, but the preset paper sizes only had the standard portrait orientation and landscape orientations required entering custom dimensions. This flag makes it a bit easier to swap the X and Y dimensions of the standard (or custom) value parsed from the papersize option. Additionally he fixed a bug in the frametricks package such that using the \makecolumns
function doesn't break relative frame constraints used by, for example, footnote or folio frames. This fix only works for TTB-LTR automatic column setups for now.
Finally, some build system fixes and features were backported from v0.15.0 development work. Most significantly the handling of the SILE_PATH
environment variable now allows multiple paths, which in turn allows a single project to utilize multiple external collections of 3rd party packages rather than having to collate them all into one location.
Published by github-actions[bot] about 1 year ago
This is another minor maintenance release. We throw a few less warning messages having dropped a few that were not actually informative. A few memory management bugs have been fixed, most notably affecting Lua 5.1. For the most part we hope you are on LuaJIT anyway (or your system's default Lua, hopefully newer than 5.1) but we do try to keep everything working smoothly on any platform. A few other minor improvements are noted below.
In other news, the v0.15.0 release is coming soon too. It is already stable enough to be used for real work and should play nice with most systems. Issue #1864 has some notes on how to run the development branch for it before it is released.
Published by github-actions[bot] about 1 year ago
Today we only fix the things we broke yesterday. This is a very minor release with only a couple of touch-ups to actual code. The biggest motivation for the release is actually the documentation. Our documentation changes don't show up in the automatic change logs, but we fixed a number of problems with the layout of the manual. Over the last couple releases we introduced several mistakes in the documentation code causing a bit of mess. The manual still isn't perfect, but at least no bits are drawn over other bits any more!
Published by github-actions[bot] over 1 year ago
Not all releases bring groundbreaking changes. This one is a roll-up of bits and bops. A few small quality of live improvements, some localizations, some bug fixes, some conveniences for 3rd party package developers, and so forth. Enjoy.
If you're looking for messy fun, check out the riir branch and PR#1762. As the name suggests, this is a major project overhaul based in Rust. Have no fear! Everything is still fully customizable in Lua. We have no plans of taking away that flexibility. The current proof of concept is a CLI binary is Rust that provides it's own Lua interpreter (optionally linked to the system one or completely vendored). This normalizes the environment, allows targeting environments where Lua is hard to get running, allows parts of the system to be selectively coded in Rust for speed benefits, etc. The PoC already passes 100% of the existing tests, loads 3rd party packages as usual, and is a full drop in replacement for the current Lua based CLI. As of this writing the plan is to land this new CLI in v0.15.0, potentially enabling easy(er) installation on Windows in follow up releases.
If you are a 3rd party developer, by sure to keep an eye on your Lua support. SILE already supports Lua versions 5.1.x through 5.4.x and well as LuaJIT. The same range of support is already achievable at build time in the Rust CLI. The LuaJIT provides the usual massive improvement in speed. We plan to push for this to be the default option in distro packages in the future even on platforms where the default Lua interpreter is 5.4. Making sure your packages run under the existing LuaJIT support should future proof them to easily transition to the Rust based SILE builds.
Published by github-actions[bot] over 1 year ago
Today we have a substantial rollup of small fixes. No one thing here is going to knock your socks off, but lots of things are just better.
On the documentation front a new contributor, @jslabovitz, stepped in with a huge copy-edit of the entire manual.
For shiny new features, @Omikhleia added a new scalebox
package for reshaping other output. He also taught some existing packages new tricks, such as adding style hooks to the url
package and allowing the infinitely stretchy fill glue nodes to be initialized with a starting length. The CLI gained a new --quiet
flag to suppress info and warning messages for those times when you just don't want to know what the engine is telling you.
In bug extermination news, the list of squashed ones is long, and some of them had been around for a long time. Didier did a lot of work under the hood with hboxes and discretionary node handling. The upshot for end users is that a lot of weirdness with parindent
settings and they way content that didn't fit on one page is pushed to the next has been smoothed over. Your indents shouldn't ever get applied twice, underlines won't apply to the indentation space, unnumbered chapters won't sometimes disappear from your ToC, and so forth.
\code
command in the plain class (0d371ba)Published by github-actions[bot] over 1 year ago
If you have extra cake in storage just waiting for something worth celebrating, this might be a good release to bust it out for. @khaledhosny has contributed a major new feature: support for variable fonts! This contribution was supported by a bounty grant from the MFEK Foundation. Many thanks to both Khaled and @ctrlcctrlv for making this possible.
Enabling this significant step forward requires the font instancing support introduced in HarfBuzz 6 (part of the harfbuzz-subset
library). This is a new default minimum requirement for SILE. At the time of writing this is relatively new, although many platforms already have updates available. It is possible to build against older HarfBuzz versions by using the configuration option --disable-font-variations
. When built this way SILE will continue to run on platforms with old HarfBuzz releases but will throw an error if you attempt to render a document using variable font features.
luaEnv
properly (#1679) (a34e1c1)Published by github-actions[bot] almost 2 years ago
Some of the changes that came out in v0.14.6 were … less than optimal. The build system changes were for a good purpose, but made life a bit difficult for some distro packagers. I also managed to introduce a parsing regression. It also came to light that a previous API deprecation didn't come with the usual warning and shim for transitional support.
This release is notable for distribution packagers for two reasons. First, there is now an easier way to skip the font dependency check at build time. Second, this release is the first time using LuaJIT is at 100% parity with regular Lua. If your distro has LuaJIT available there is now little reason not to make the switch.¹ The speed increase is substantial, especially for large documents.²
While I was tinkering with smoothing out the build and fixing regressions a couple other fixes landed. @khaledhosny tackled a long standing issue with the font loader. The opsz
axis can now be used as expected so fonts with OpentType FeatureVariations are usable in SILE. @raphCode also spotted and fixed some outdated code in the manual.
¹: As far as SILE core and all its Lua dependencies are concerned there is no downside. Previously some of the debug and tracing features did not give as much useful information when using LuaJIT. Now the only caveat is related to end users and their documents. If people write custom Lua code in their projects and/or use other 3rd party Lua libraries they will need to consider interpreter support.
²: As a rough comparison on my desktop machine, rendering the 115 page SILE manual takes about 48 seconds with Lua 5.4, 22 seconds with LuaJIT, and 17 seconds with OpenResty.
Published by github-actions[bot] almost 2 years ago
This release has tons of fixes and even a few features, but perhaps the most interesting bit to end users might just be the documentation. Thanks to @hegjon, official SILE packages are in the works for Fedora. The procedure for installing them via COPR is documented and will be updated when they land in default repositories. Also @ctrlcctrlv added some useful notes about installing 3rd-party packages. This is really important because very useful actions like typesetting Markdown are best accomplished with external packages.
Anyone working with the source code for SILE itself should note the build system has been split so only run time dependencies are checked at configure time by default. This means no-change is needed for distro packagers and end users that are just wishing to install and move on. However checking for dependencies needed in order to develop SILE itself (including running tests) now requires different configuration. Using --enable-developer
should be added as a go-to configure option for anyone hacking or wishing to contribute the to SILE sources. Also of interest to developers, using nix develop
should now be a lot more seamless as far as providing a ready-to-use environment.
@Omikhleia has rebuilt the formatNumber()
utility function using ICU. This increases language support from a handful of manually implemented ones to almost complete CLDR coverage. In the process a new utility function collatedSort()
was added to sort Lua data with locale aware collation. He also fixed a number of little typsetter bugs and overhauled some more documentation.
First-time contributer @raphCode submitted a fix for calling citation keys in the bibtex package.
Debug output is now both faster and more robust since it can't crass the typesetter. When errors are encountered, location reports for where in the document an error was triggered are more accurate. Bundled in this release are also a batch of other small bug fixes to the typesetter, page builder, and shaper.
Published by github-actions[bot] almost 2 years ago
We're just squishing bugs today and making the manual a little neater. Working with STDIN streams should be a bit more robust now as the content type detection isn't so picky about whitespace and isn't so prone to false positive detections. Document file restrictions have been relaxed a little too allowing comments and whitespace before the leading document tag. Package developers should have a little bit easier time with in the event their package is loaded twice. Also a number of small typesetting issues in the user manual were cleaned up by @Omikhleia.
Published by github-actions[bot] almost 2 years ago
Today we have a small rollup of fixes and improvements. @Omikhleia overhauled the counters packages as well as fixed up bugs in several other packages. The default center of rotation has been changed to give a more expected result. Text casing functions are accessible again from the Lua side of things, changing masters during a page output doesn't break page breaking, and using the twoside package doesn't force the use of mirroring. @OlivierNicole also stepped in to fixup some math bugs. Also thanks to @ThatGeoGuy and @snan for pointing out and fixing small issues in our documentation.
\unichar
'ed chars with same font only (91a8d40)