Giter Club home page Giter Club logo

sile's Introduction

Actions Build Status Cirrus Build Status Docker Build Status Azure Build Status
Luacheck Lint Status Coveralls Coverage Status
Chat on Gitter Conventional Commits Commitizen Friendly

What is SILE?

SILE is a typesetting system; its job is to produce beautiful printed documents. Conceptually, SILE is similar to TeX—from which it borrows some concepts and even syntax and algorithms—but the similarities end there. Rather than being a derivative of the TeX family SILE is a new typesetting and layout engine written from the ground up using modern technologies and borrowing some ideas from graphical systems such as InDesign.

Where does it run?

SILE can be downloaded & installed to your system or run remotely as a CI job.

What can I do with SILE (that I can’t do with TeX)?

First, have a look at the usage examples gallery. SILE allows you to:

  • Produce complex document layouts using frames.

  • Easily extend the typesetting system in a high-level programming language (Lua).

  • Directly process XML to PDF without the use of XSL stylesheets.

  • Typeset text on a grid.

Download and Installation

For macOS

A formula is available for Homebrew that can install either stable or head versions. For the latest prebuilt stable release:

$ brew install sile

Or to build and install from the latest git commit:

$ brew install sile --HEAD

Note the Homebrew package does not automatically install the default font. The easiest way to install Gentium Plus is through the Homebrew Fonts caskroom:

$ brew tap homebrew/cask-fonts
$ brew install --cask font-gentium-plus

For Linux

Arch Linux

Arch Linux has a prebuilt SILE package in the official package repository:

$ pacman -S sile

The official package uses LuaJIT. If you install LuaRocks for use with SILE via pacman, use the lua51-* variants to match LuaJIT.

Fedora

A COPR repository is available for Fedora users with packages of SILE and all the necessary dependencies. Fedora 38 and later are supported. There is work in progress to get the packages added to the official Fedora repository.

$ dnf copr enable jonny/SILE
$ dnf install sile

OpenSUSE

OpenSUSE has official packages ready to install the usual way:

$ zypper install sile

NixOS

A Nix sile package is available in both the stable and unstable channels; the unstable channel having the latest stable SILE releases and the stable channel being frozen on NixOS releases. You can use all the usual Nix tricks including adding SILE into a nix shell environment or executing it directly with nix run.

See additional usage notes in the Nix section.

Ubuntu

A PPA is available for Ubuntu users with packages of SILE and all the necessary dependencies. We introduced support starting with Bionic (18.04) and maintain packages for all Ubuntu release series since for as long as they are supported by Canonical.

$ add-apt-repository ppa:sile-typesetter/sile
$ apt-get update
$ apt-get install sile

Void Linux

Void Linux packages are available in the default package manager.

Other

Other Linux distros may install via source, via Linux Brew, or via Nix.

For BSD

Install from OpenBSD ports, via source, or via Nix.

For Windows

There is no installer yet (track the status in issue #410). Nobody is currently maintaining Windows compatibility in SILE and we expect the state to be a bit broken. Users of WSL (Windows Subsytem for Linux) may use the package manager of their choice depending on the system installed, including the respective Arch Linux or Ubuntu packages, Linux Brew, source, or via [Nix][#nixos].

Some early work is present in the repository that should enable builds via CMake and Visual Studio, see discussion in issue #567, but it needs a refresh for current dependencies. Prebuilt Windows binaries are supposed to be generated by the Azure build pipeline and may be downloaded by selecting a build, opening the Windows job, selecting the artifact link from the final stage, and using the download button next to the sile folder.

Multi-Platform & Containers

Docker

Docker images are available as siletypesetter/sile. Released versions are available as tagged containers matching the release (e.g. v0.10.0). Additionally the latest release will be tagged latest, and a master tag is also available with the freshest development build.

In order to be useful you need to tell the Docker run command a way to reach your source documents. This is done by mounting your project directory inside the container. This also gives SILE a place to write the output. The user and group IDs of the Docker user will be automatically adjusted to match those of the directory you mounted.

You may find it easiest to do all this with an alias like this:

$ alias sile='docker run -it --volume "$(pwd):/data" siletypesetter/sile:latest'
$ sile input.sil

One notable issue with using SILE from a Docker container is that by default it will not have access to your system’s fonts. To work around this you can map a folder of fonts (in any organization usable by fontconfig) into the container. This could be your system’s default font directory, your user one, a folder with project specific resources, or anything of your choosing. You can see where fonts are found on your system using fc-list. The path of your choosing from the host system should be mounted as a volume on /fonts inside the container like this:

$ docker run -it --volume "/usr/share/fonts:/fonts" --volume "$(pwd):/data" siletypesetter/sile:latest

Nix

The nix package manager is available as a standalone package manager on many platforms other than NixOS including most Linux and BSD distributions, macOS, and even for Windows via WSL; and thus presents a viable alternative way to run SILE on most systems.

Nix packages are available in both the stable and unstable channels. We recommend the unstable channel because all fresh packages (including stable SILE releases) land there first and eventually trickle down to the stable channel. You can use all the usual Nix tricks including launching a new shell with the sile command available or running it directly from any shell:

# 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>

The SILE source repository is also a Nix Flake. This means you can run any arbitrary tagged version, branch, or commit with a single command. This is an easy way to run SILE on other platforms, but also to test other versions or run the latest development version of SILE.

# Explicitly run a tagged version
$ nix run github:sile-typesetter/sile/v0.14.13 -- <arguments>

# Use the master branch HEAD that will become the next minor release
$ nix run github:sile-typesetter/sile -- <sile arguments>

# Run the develop branch HEAD that will become the next major release
$ nix run github:sile-typesetter/sile/develop -- <sile arguments>

From Source

SILE source code can be downloaded from its website or directly from the GitHub releases page.

SILE is completely programmable using the Lua programming language. As of v0.15.0, the CLI you actually execute is a Rust binary with a Lua VM built in. (For compatiblity and demonstration purposes a pure Lua version of the CLI is still available as \code{sile-lua}.) The Rust binary can be built based on your system's Lua sources or use its own vendored Lua sources. All SILE's Lua code takes a lowest-common-denominator approach to Lua compatibility. Any of Lua 5.1, 5.2, 5.3, 5.4, or LuaJIT (2.0, 2.1, or OpenResty) are fully supported. Compiling it to match your system's Lua version has the advantage of making it easy to access system installed Lua Rocks, but this is not a requirement.

Compiling from sources will require both a Rust toolchain and Lua sources. At runtime no Rust tooling is required, and the system Lua interpreter is not actually used.

It also relies on external libraries to access fonts and write PDF files. Its preferred combination of libraries is HarfBuzz and libtexpdf, a PDF creation library extracted from TeX. HarfBuzz (minimum version 2.7.4) should be available from your operating system’s package manager. For HarfBuzz to work you will also need fontconfig installed. SILE also requires the ICU libraries for Unicode handling.

On macOS, ICU can be installed via Homebrew:

$ brew install icu4c

After that, you might need to set environment variables. If you try to brew link and you get a series of messages including something like these two lines, you will need to run that export line to correctly set your path:

For pkg-config to find icu4c you may need to set:
  export PKG_CONFIG_PATH="/usr/local/opt/icu4c/lib/pkgconfig"

Optionally you may install the Lua libraries listed in the rockspec to your system (using either your system’s package manager or luarocks (luarocks install --only-deps sile-dev-1.rockspec). By default all the required Lua libraries will be downloaded and bundled alongside the SILE the installation. If you downloaded a source tarball these dependencies are included. If you are using a Git clone of the source repository the build system will require luarocks to fetch them during build. Note that OpenSSL development headers will be required for one of the Lua modules to compile¹. If your system has all the required packages already you may add --with-system-luarocks to the ./configure command to avoid bundling them.

¹ OpenSSL development headers are required to build luasec, please make sure they are setup BEFORE trying to build SILE! If you use your system’s Luarocks packages this will be done for you, otherwise make sure you can compile luasec. You can try just this step in isolation before building SILE using luarocks --tree=/tmp install luasec.

If you are building from a git clone, start by running the script to setup your environment (if you are using the source tarball this is unnecessary):

$ ./bootstrap.sh

If you just plan on installing and using SILE, the default configure options (plus any Lua related options discussed above) should be fine. If you plan on developing SILE itself (whether to just tinker with it for your own use or contribute upstream) there is one particularly useful configuration option. You can add --enable-developer-mode will set the 'installed data' directory to the source location which will enable the compiled binary to run directly from the source directory without being installed at all. Additionally it will enable checks for tooling we expect SILE contributors to have such as tools used for testing. Using this options also enables a number of targets that wouldn’t normally be needed by end users such as make regressions.

Once your dependencies are installed and you know what options you want, it is time to configure the sources, then build them.

$ ./configure
$ make

If you just want to mess with SILE locally you can stop here (especially if you used --enable-developer-mode). However to actually install, you will need to run the installation command with system permissions.

$ sudo make install

On some systems you may also need to make the system aware of the newly installed libraries before first use:

$ ldconfig

Default Font

Since SILE v0.9.5, the default font has been Gentium Plus which is freely available from SIL’s site. (Previously we used Gentium Basic, but that’s getting harder to get hold of.) The math package uses Libertinus Math by default to render formulas. Additionally, monospace text by default is set in Hack. It is not absolutely required that you install default fonts, but if this font is not installed on your system you won’t be able to use the examples without modification.

Testing the installation

If all goes well, after installation you should be able to render a sample document. Try creating a file test.sil with this content:

\begin{document}
Hello world!
\end{document}

And render it to a PDF like this:

$ sile test.sil
SILE v0.12.5 (Lua 5.4)
<test.sil>
[1]

You should now have a PDF file test.pdf ready for review.

Use as a CI job

There are actually many ways to run SILE remotely as part of a CI work flow. Because packages are available for many platforms, one way would be to just use your platforms native package installation system to pull them into whatever CI runner environment you already use. Another way is to pull in the prebuilt Docker container and run that.

As a case study, here is how a workflow could be setup in GitHub Actions:

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.sil

Add to your repository as .github/workflows/sile.yaml. This work flow assumes your project has a source file my-document.sil and will leave behind a my-document.pdf. Note the comments in the section about Docker regarding version tags.

Installing third-party packages

Third-party SILE packages can be installed using the luarocks package manager. Packages may be hosted anywhere, either on the default luarocks.org repository or (as in the example below) listed in a specific server manifest. For example, to install markdown.sile (a plugin that provides a SILE inputter that reads and processes Markdown documents) one could run:

$ luarocks install --server=https://luarocks.org/dev markdown.sile

By default, this will try to install the package to your system. This may not be desired (and usually requires root access), but there are two other ways to install plugins. First you make add --tree ./ to install them in the current directory. In this case (and assuming this is the same directory as your document) SILE will automatically find such plugins. Additionally you make install them to your user profile by adding --local when installing. In this case you will also need to modify your user environment to check for plugins in that path since Lua does not do so by default. This can be done by running eval $(luarocks path) before running SILE (or from your shell’s initialization script).

Finding Lua version in use for running SILE

Third party packages must be installed for the same version of Lua that SILE uses. On systems with more than one Lua version installed, and where SILE does not use the default one you may need to specify the version manually. To get your Lua version which is used for the execution of sile:

$ export LUA_VERSION=$(sile -e 'print(SILE.lua_version);os.exit()' 2> /dev/null)
$ luarocks install --lua-version $LUA_VERSION ...

Finding Out More

Please read the full SILE manual for more information about what SILE is and how it can help you. There are example documents (source and PDF) on the SILE website. There’s also an FAQ available.

Contact

Please report bugs and send patches and pull requests at the github repository. For questions and discussion, please join the mailing list.

License Terms

SILE is distributed under the MIT licence.

sile's People

Contributors

alerque avatar cmfwyp avatar ctrlcctrlv avatar darkyenus avatar deepakjois avatar dependabot-preview[bot] avatar dependabot[bot] avatar doronbehar avatar gnodet avatar goyalyashpal avatar harrysummer avatar jamadagni avatar jmaibaum avatar jodros avatar khaledhosny avatar leorosa avatar matteodelabre avatar mic92 avatar ntd avatar oleastre avatar oliviernicole avatar omikhleia avatar pi-cla avatar pkulchenko avatar rajeeshknambiar avatar raphcode avatar s-gilles avatar simoncozens avatar snan avatar strepon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sile's Issues

Update to docs for building on OS X required

I just tried building on OS X, by following the instructions. I was trying to build directly from the repository. I had to do these things in addition:

  • It seems that the correct way to refer to lpeg is LPeg
  • I also had to brew install automake libtool

It would be nice to add this to the docs

Tolerance issues with justification

Changing the tolerance setting doesn't seem to make a difference - it either can set text, or can't. This in turn breaks hyphenation. Also the tolerance is widely wild of TeX's ranges, so something is wrong with the algorithm somewhere.

Knudth Typesetting Algorithm

Hello Simon,

I apologize, this isn't an issue exactly, but couldn't figure any other way to contact you.

On your blog I saw that you did some typesetting experiments with Perl and also implementing the Knuth TeX algorithm.

I am currently working on a project in Perl, and would be very interested in learning more about how you implemented that TeX algorithm, and what engine you were using to generate the output.

My project in its current state is sitting on top of GROFF as the typesetting engine. So converting a simple markup into GROFF code, then using GROFF to generate a ps or PDF.

But I would be interested in seeing if it's possible to generate my output straight from Perl, as opposed to first translating it to a GROFF macro language, which then gets translated to groff, which then gets translated to Postscript, which then gets translated to PDF.

I would like to be bale to find a way to generate out put without having to go through such a long chain of intermediary steps.

Any advice you can offer from your experience would be great. I am developing in Perl, so when I saw your post with your experiment, I was very excited, and very curious!

([email protected])

Error using .ttc font Kohinoor Devanagari on OS X 10.10

Kohinoor Devanagari is the default Devanagari font included on OS X 10.10. This code however fails to build with error:

libtexpdf:fatal: sfnt: table not found..
\begin[papersize=a5]{document}
\script[src=packages/bidi]
\font[family=Kohinoor Devanagari,size=10pt,language=hi]
यह दाग़ दाग़ उजाला
\end{document}

Similar errors are happening in XeTeX on Tex Live on OS X as well:
http://tug.org/pipermail/xetex/2015-April/025874.html

Because libtexpdf has been extracted from xdvipdfmx, the fixes should be ported over from there as well.

Orphan penalty cannot be set by \set command

SILE manual says (beginning of chapter 7) that orphan penalty can be set by

\set[parameter=typesetter.orphanpenalty, value=250]

However, this leads to an error:

! Setting typesetter.orphanpenalty must be of type integer, not string 250

(Tested in SILE 0.9.1, Ubuntu 14.04.)

BIDI algorithm not working properly?

Here is a sample document. The numbers within the script should be formatted LTR, as per Unicode BIDI rules, but they are not.

I did notice that in the example docs (like showoff.sil) the numbers are explicitly formatted LTR using a \font directive to wrap them. But I believe that should not be required. Any idea what is causing this?

\begin[papersize=a4]{document}
\script[src=packages/bidi]
\thisframeRTL%
\font[size=18pt]
سعادت حسن منٹو اردو کے ایک جانے مانے افسانہ نگار ہیں۔ وہ پنجاب کے لدھانہ ضلع میں  1912 میں پیدا ہوئے۔ ان کے ماں
 باپ کشمیری مسلمان تھے۔ وہ علی گڑھ مسلم یونیورسٹی سے تعلیم حاصل کر نے کے بعد انجمن ترقی پسند مصنفین ہند کے
 ساتھ جڑے۔ 1936 میں وہ بمبئی شہر جا کر بس گئے جہاں انہوں نے اپنے کئی مشہور افسانے اور فلم کے سکرپٹ لکھے
۔1947 میں بٹوارے کے بعد وہ لاہور چلے گئے۔ وہاں ان کی ملاقات فیض احمد فیض، سید ناصر رضا كاظمی
 اور احمد ندیم قاسمی‎ سے ہوئی اور وہ اخباروں کے لئے مضمون لکھنے لگے۔ 1955 میں ان کا انتقال ہوا۔
\end{document}

Error While Trying to Run SILE

Hello, first I would like to say how great to see this project. It's about time new options become available for typesetting. This looks like a very promising alternative to *TeX.

However I am running into the following:

lua sile examples/test.sil
This is SILE 0.0.1
<examples/test.sil>lua: /usr/local/share/lua/5.1/std/string.lua:407: attempt to call global 'totable' (a nil value)
stack traceback:
/usr/local/share/lua/5.1/std/string.lua:407: in function 'pickle'
./core/pango-shaper.lua:29: in function 'getPal'
./core/pango-shaper.lua:82: in function 'shape'
./core/typesetter.lua:113: in function 'setpar'
./core/typesetter.lua:92: in function 'typeset'
./core/inputs-common.lua:23: in function 'process'
./core/inputs-texlike.lua:56: in function 'process'
./core/sile.lua:123: in function 'readFile'
sile:8: in main chunk
[C]: ?

ubuntu 14.04 lts build/run problem

Hello.
Accodring to the SILE manual installation instructions I unable to build/run SILE.

Here is partial fixes:
command luarocks install luaexpat lacts dependency libexpat1-dev.
command luarocks install lgi lacts dependency libgirepository1.0-dev.
So please add into SILE manual DEB apt-get install the dependencies.

Anyway, after installing all the deps and luarocks install ... there is no ./sile to execute in the git cloned repository. Here is only sile.in and other files. How to configure/execute sile anyway?

ubuntu 14.04 lts build problem

$ git pull
$ ./bootstrap.sh
$ ./configure
$ make
....
Making all in libtexpdf
make[1]: Entering directory /home/skylark/wc/sile/libtexpdf' make all-am make[2]: Entering directory/home/skylark/wc/sile/libtexpdf'
/bin/bash ./libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -DXETEX -DBUILDING_LIBTEXPDF -I/usr/include/freetype2 -I.. -g -O2 -MT libtexpdf_la-dpxfile.lo -MD -MP -MF .deps/libtexpdf_la-dpxfile.Tpo -c -o libtexpdf_la-dpxfile.lo test -f 'dpxfile.c' || echo './'dpxfile.c
libtool: compile: gcc -DHAVE_CONFIG_H -I. -DXETEX -DBUILDING_LIBTEXPDF -I/usr/include/freetype2 -I.. -g -O2 -MT libtexpdf_la-dpxfile.lo -MD -MP -MF .deps/libtexpdf_la-dpxfile.Tpo -c dpxfile.c -fPIC -DPIC -o .libs/libtexpdf_la-dpxfile.o
dpxfile.c:40:26: fatal error: kpathsea/lib.h: No such file or directory
#include <kpathsea/lib.h>
^
compilation terminated.
make[2]: *** [libtexpdf_la-dpxfile.lo] Error 1
make[2]: Leaving directory /home/skylark/wc/sile/libtexpdf' make[1]: *** [all] Error 2 make[1]: Leaving directory/home/skylark/wc/sile/libtexpdf'
make: *** [all-recursive] Error 1

Bigger paragraph indent when using \par instead of new line

\par command is an alternative of blank line (AFAIK). However, it leads to bigger indents than required.
This is OK, both indents are 1 cm:

\begin[papersize=a4, class=book]{document}
\set[parameter=document.parindent, value=10mm]
\set[parameter=current.parindent, value=10mm]
First line

First word, first paragraph.

First word, second paragraph.
\end{document}

But this produces an extra horizontal glue before the first line of the first paragraph:

\begin[papersize=a4, class=book]{document}
\set[parameter=document.parindent, value=10mm]
\set[parameter=current.parindent, value=10mm]
First line \par
First word, first paragraph.

First word, second paragraph.
\end{document}

Tested on the latest master.

Ligatures in chrome pdf renderer

Hi

I am not sure if this is the best place to write this, but I just wanted to say that ligatures in the chrome pdf renderer on OS X seems to be offset slightly upwards.
In the default pdf renderer "preview" they show up correctly.

This might be a font problem or a bug in the chrome pdf renderer however.

In "preview" screen shot 2014-10-01 at 17 16 06

In chrome screen shot 2014-10-01 at 17 16 10

Crash when using a very long word

When a very long word is used in document (in practice, maybe some URL addresses), as here:

\begin[papersize=a4, class=book]{document}
verylongwordverylongwordverylongwordverylongwordveryverylongwordveryverylongwordveryverylongwordveryverylongwordveryverylongwordveryverylongwordveryverylongwordverylongwordverylongwordverylongwordverylongwordverylongwordverylongwordverylongwordverylongwordverylongword
\end{document}

the processing crashes by various (random) ways:

  • SIGSEGV
  • Error in /usr/bin/lua': double free or corruption (!prev):`
  • lua: malloc.c:3695: _int_malloc: Assertion (unsigned long) (size) >= (unsigned long) (nb)' failed.`
  • /usr/bin/lua: /usr/local/share/sile/core/length.lua:30: attempt to perform arithmetic on field 'length' (a nil value)
  • or Error in /usr/bin/lua': corrupted double-linked list:`

Long words are rendered over the right margin in justified paragraph(s)

Sometimes, a long word is rendered over the right margin. The word "insignificant" is rendered over the right margin in the below paragraph. The macros \ldquo{} and \rdquo{} are for unicode U+201C and U+201D.

Example of paragraph that can cause this issue (excerpt from "A Vindication of the Rights of Woman" by Mary Wollstonecraft):

\begin[class=book, papersize=129mm x 198mm]{document}
\define[command=em]{\font[family="Garamond Premier Pro",style=italic,
features=+swsh:+dlig:+hlig]{\process}}
% requirement packages
\define[command=smcp]{\font[family="Garamond Premier Pro",features=+smcp]{\process}}

How grossly do they insult us, who thus advise us only to render
ourselves gentle, domestic brutes!  For instance, the winning
softness, so warmly, and frequently recommended, that governs by
obeying.  What childish expressions, and how insignificant is the
being\mdash{}can it be an immortal one?  who will condescend to govern by
such sinister methods! \em{\ldquo{}Certainly,\rdquo{}} says Lord Bacon, \em{\ldquo{}man is of
kin to the beasts by his body: and if he be not of kin to God by
his spirit, he is a base and ignoble creature!\rdquo{}}  Men, indeed,
appear to me to act in a very unphilosophical manner, when they try
to secure the good conduct of women by attempting to keep them
always in a state of childhood.  Rousseau was more consistent when
he wished to stop the progress of reason in both sexes; for if men
eat of the tree of knowledge, women will come in for a taste:  but,
from the imperfect cultivation which their understandings now
receive, they only attain a knowledge of evil.

\end{document}

Sile logo

Here is a quick graphic cleaning on the logo. It is now more simple and clear and based on a custom font that gives a unique subtle identity. Feel free to ask the SVG source file and I’ll make a pull request.

export

export-m

export-s

ubuntu 14.04 lts build problem

Hello again.
According to fresh documentation (with new deps) I ran configure (after ./bootstrap.sh), but again it failed:
$ ./configure
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... ./install-sh -c -d
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking how to create a pax tar archive... gnutar
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking how to print strings... printf
checking for style of include used by make... GNU
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking dependency style of gcc... gcc3
checking for a sed that does not truncate output... /bin/sed
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for fgrep... /bin/grep -F
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking how to convert i686-pc-linux-gnu file names to i686-pc-linux-gnu format... func_convert_file_noop
checking how to convert i686-pc-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for ar... ar
checking for archiver @file support... @
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for sysroot... no
checking for mt... mt
checking if mt is a manifest tool... no
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/bin/ld) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking for shl_load... no
checking for shl_load in -ldld... no
checking for dlopen... no
checking for dlopen in -ldl... yes
checking whether a program can dlopen itself... yes
checking whether a statically linked program can dlopen itself... no
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking for gcc... (cached) gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to accept ISO C89... (cached) none needed
checking whether gcc understands -c and -o together... (cached) yes
checking dependency style of gcc... (cached) gcc3
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for hb_shape in -lharfbuzz... yes
checking for HARFBUZZ... yes
checking for FREETYPE... yes
checking for FONTCONFIG... no
configure: error: in /home/skylark/wc/sile': configure: error: Harfbuzz found but not fontconfig Seeconfig.log' for more details

Missing description in command line help

Command line help sile --help currently contains some default text:

This is SILE 0.9.1
Usage: sile

 Banner text.

 Optional long description text to show when the --help
 option is passed.

 Several lines or paragraphs of long description are permitted.

This should be changed to a useful description.

Error when using custom document.rskip

Setting some document.rskip value leads to an error:

\begin[papersize=a5, class=book]{document}
\script[src=packages/lorem]
\set[parameter=document.rskip, value=20mm]
\lorem[words=50]
\end{document}
/usr/local/share/sile/core/typesetter.lua:381: attempt to call method 'prebreakWidth' (a nil value)

It works if value is changed to e.g. 20mm plus 20mm; document.lskip works as expected.
(Tested on current master, Ubuntu 14.04.)

Wider space between paragraph for accented letters

This is rather a point for discussion than a bugreport. The following code:

\begin[papersize=a5]{document}
\font[size=10pt, family=Times New Roman, language=cs]

1. etapa: Studenec (kostelecko) – Studenec (hasičárna)

2. etapa: Studenec (hasičárna) – Studenec (řeznictví Nosek)

3. etapa: Studenec (řeznictví Nosek) – Studenec (Špice)

musí být hotová do konce letošního května.
\end{document}

produces this result:
ukazka_sile

You can notice a slightly wider space between the second and the third paragraph caused by the accented letter "Š" (and such spaces are sometimes disturbing). I didn't succeed to change it by some of the *skip settings. Is this expected or is there any problem with accented fonts or languages?

For comparison, LaTeX makes the spaces equal:
ukazka_tex

Two newlines after comment do not mean paragraph end

I'm not sure if this is actually a bug, however it confused me a bit. The two newlines after a comment does not end the paragraph and only one paragraph is outputted:

\begin[papersize=a5, class=book]{document}

First paragraph %comment


Second paragraph
\end{document}

This works as expected:

\begin[papersize=a5, class=book]{document}

First paragraph %comment
word

Second paragraph
\end{document}

Example source + PDF

The first thing I look for when deciding whether to install this is some example source and the PDF it generates, I couldn't find any. Perhaps add some links to examples to the readme?

Unmet 'lfs' dependency?

When I run 'lua install. lua', I get:

Testing lua dependencies..

! Could not load lua module lfs

Please consult the README file.

I don't see lfs listed in the dependencies in the README, nor can I find it myself. Installing 'elfs' didn't seem to help.

weird issues on OS X

When I installed SILE 0.9.1 on OS X (10.10.3), I encountered a few weird issues. While the configure and build goes fine once I installed the necessary prerequisites, I see this when I try the examples:

$ sile examples/test
This is SILE 0.9.1
<examples/test.sil><examples/macros.sil>[1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17] [18] [19] [20] [21] [22] [23] [24] [25] 
libtexpdf:fatal: Invalid font: -1 (10)

$ sile examples/showoff
This is SILE 0.9.1
<examples/showoff.sil>[1] No patterns for language ja
[2] [3] [4] 

The apparent error in the latter case may be a minor problem, as I haven't just done anything with Japanese before. The output file shows the Japanese letters fine, though, but the Arabic ones are replaced by boxes.

$ sile examples/osis/kjv
This is SILE 0.9.1
<examples/osis/kjv.sil>/usr/local/bin/lua: core/sile.lua:147: bad argument #1 to 'open' (string expected, got nil)
stack traceback:
[C]: in function 'open'
core/sile.lua:147: in function 'readFile'
core/baseclass.lua:54: in function '?'
core/inputs-common.lua:26: in function 'process'
core/inputs-texlike.lua:56: in function 'process'
core/sile.lua:159: in function 'readFile'
/opt/w21/bin/sile:23: in main chunk
[C]: in ?

Here I thought this might just not find an include file in the sub-sub-directory. But when I change to that, an even stranger error appears:

: wrixum:1:.../sw/sile-0.9.1; cd examples/osis
: wrixum:0:.../examples/osis; sile kjv
This is SILE 0.9.1
<kjv.sil><osis.sil>
! Couldn't parse font size 9 in osis.sil

I have tried to replace the 9 with a 10, only then it complains about the 10.

Now all those problems may be there because I have overlooked something. I am not really sure the Lua installation is totally okay, for instance, as I have never done anything with Lua (and have no real knowledge of the language).

A typescript -- slightly edited to spare you my command line edits -- of the above, including configure and build, can be seen here:

https://gist.github.com/jyrgenn/a03685ee8f3ce1c1f8f6#file-typescript_sile-bug

There are a few compile warnings indicating pointer type mismatches, but I guess they are harmless.

Versions of the involved software:

Installed rocks:

lgi
0.9.0-1 (installed) - /usr/local/lib/luarocks/rocks
lpeg
0.12.2-1 (installed) - /usr/local/lib/luarocks/rocks
luaexpat
1.3.0-1 (installed) - /usr/local/lib/luarocks/rocks

I have upgraded all Homebrew-installed packages before the build, so they should be as current as the Homebrew collection is. They are:

atk gdk-pixbuf intltool meld pygtksourceview bdw-gc geoip jasper mercurial python berkeley-db gettext jpeg nettle quvi berkeley-db4 glib libffi nmap rarian c-ares gmp libgcrypt nvi readline cairo gnu-sed libgpg-error openssl sbcl clisp gnuplot libpng p7zip sdl cscope gnutls libquvi pango sqlite d-bus gobject-introspection libsigsegv pixman w3m fish graphviz libtasn1 pkg-config wget fontconfig gtk+ libtiff pwgen wireshark freetype gtksourceview lua py2cairo xz gd harfbuzz luarocks pygobject gdbm icu4c lynx pygtk

Configure line:
./configure --prefix=/opt/w21

I use the alternative prefix because Homebrew occupies /usr/local and can get confused when there is other stuff in /usr/local/. /opt/w21/bin is in PATH.

As mentioned, my knowledge of Lua is next to non-existing, although I skimmed the canonical Lua books once, so I don't know how to proceed from here. I will happily try anything to narrow down the problem if you give me some guidance, or anything else that might be helpful.

While running ./configure I receive an error

While attempting to compile Sile, I get the following message:

checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating config.h
config.status: executing depfiles commands
config.status: executing libtool commands
rm: cannot remove 'core': Is a directory

I am unsure if this is an error or not but it doesn't look good. However, the following compile seems to work.

Genericize section handling

  • Change the counters.lua package (or write a new one) to support multi-level counters (e.g. 1.0.1)
  • Create a general \sectionheader command which takes a "level" and "numbering=on/off" (and possibly other) options.
  • Implement \chapter, \section and so on in terms of it.

Kannada(kn) language support

Looks like Kannada language is not working,

\begin[papersize=a4]{document}
Hello SILE! \font[family=Noto Sans Kannada,size=10pt,language=kn]{ನಮಸ್ಕಾರ :)}
\end{document}

ISO639-1 code is kn

Using Libreoffice

libreoffice

Using Sile
sile

Letterspacing issues on Linux

The generation of test.pdf takes 48 seconds and the resulting document is different from the original one.

$ time $LUA sile examples/test.sil
This is SILE 0.9.0
<examples/test.sil><examples/macros.sil>[1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17] [18] [19] [20] [21] [22] [23] [24] [25] [26] [27] [28] [29] [30] [31] [32] [33] [34] 
real    0m48.821s
user    0m48.743s
sys 0m0.053s

Not sure this is a real issue or some misconfiguration on my side though and if the above timing is expected.

Package contribution / publishing

As I started playing with SILE to create songbooks (trying to replace my current LaTeX version), I started writing some packages to help me (with a growing TODO list) and I would like to share that work and get feedback.

So, what is your preferred way to contribute those packages ?
Make pull requests ?
Create a "contrib" folder in SILE ?
Publish them in my own repo ?
Discuss each one to see if it should be published as "contrib" or integrated ?

For example I did a "chord mode" package that typeset chord names above the text:
Input:

\begin[papersize=a4,class=songbook]{document}

\script[src=packages/chordmode]

\begin{chordmode}

  I've be<G>en a wild rover for many's a <C>year

  And I <G>spent all me <D7>money on whiskey and <G>beer

  But now I'm returning with gold in great <C>store

  And I <G>never will <D7>play The Wild Rover no <G>more.

\end{chordmode}

\end{document}

Result (the page background is defined in a specific class):
chordmode-example

Space after the first paragraph of the second frame if rskip is set

In case of two frames on the page and a custom value of document.rskip, there is a strange vertical space after the first paragraph of the second frame:

\begin[papersize=a5, class=book]{document}
\set[parameter=document.rskip, value=0mm]

\eject\par%
\begin[first-content-frame=frame1]{pagetemplate}%
\frame[id=frame1, left=left(content), right=right(content), height=0.7cm, top=top(content), next=frame2]%
\frame[id=frame2, left=left(frame1), right=right(frame1), top=bottom(frame1), bottom=bottom(content)]%
\end{pagetemplate}%
\font[size=24pt]{First frame}\par%
Second frame first paragraph\par%
Second frame second paragraph\par%
Second frame third paragraph\par%
\end{document}

If the setting of document.rskip is omitted, everything is OK. I have no idea how these two things can be related:)

Tested on the latest master.

Infinite loop when content does not fit running header

At first, I'd like to say that SILE seems to be a tool which I wished to have for years:)) Something like TeX, but more flexible (frames!) and friendly (e.g. in Unicode and font support) is much appreciated and many thanks for that! I'll try to report what I'll find during my testing...

An infinite loop occurs when height of content of running header is greater than the header height. This code evaluates correctly:

\begin[papersize=a4, class=book]{document}
\script[src=packages/frametricks]
\right-running-head{First Line of Header \break \skip[height=12mm] Second Line of Header}
\showframe[id=all]

First page text
\break \skip[height=22cm]
Second page text

\end{document}

If you change the space in running header to \skip[height=13mm], execution ends up in infinite loop.
(Tested in SILE 0.9.1, Ubuntu 14.04.)

Footnotes and page breaks

If SILE is building a paragraph containing a footnote, and the paragraph ends up being broken over a page boundary, the footnote will be placed on the first page, regardless of where the footnote occurs in the broken paragraph.

Parfillskip is not zero in book header

I'm not sure if this is a bug, but the behaviour is a bit unexpected:

\begin[papersize=a5, class=book]{document}
\script[src=packages/frametricks]
\right-running-head{Line begin \hfill Line end}
\showframe[id=all]
Page one
\skip[height=15cm]
Page two
\end{document}

In output, the "Line end" text is not right-aligned. As typesetter log says, that is because glue 0pt plus 10000pt (value of typesetter.parfillskip) is added after the text. It shouldn't happen and parfillskip should be zero - as it is actually defined in book.lua:

SILE.settings.set("typesetter.parfillskip", SILE.nodefactory.zeroGlue)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.