• Stars
    star
    1,161
  • Rank 40,194 (Top 0.8 %)
  • Language
    OCaml
  • License
    GNU Lesser Genera...
  • Created over 9 years ago
  • Updated 3 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A statically-typed, functional typesetting system

logo1

Build Status

日本語版 README はこちら

Summary of SATySFi

SATySFi (pronounced in the same way as the verb “satisfy” in English) is a new typesetting system equipped with a statically-typed, functional programming language. It consists mainly of two “layers” ― the text layer and the program layer. The former is for writing documents in LaTeX-like syntax. The latter, which has OCaml-like syntax, is for defining functions and commands. SATySFi enables you to write documents markuped with flexible commands of your own making. In addition, its informative type error reporting will be a good help to your writing.

This software was supported by:

  • IPA Mitou Project 2017 (June 2017 – February 2018; see the abstract here written in Japanese),
  • Dwango Co., Ltd. (October 2018 – March 2019; as a part-time job), and
  • many anonymous supporters who bought The SATySFi​book,

and its development continues to this day (May 2023).

Install using Satyrographos (for non-devs)

You can install SATySFi with package manager Satyrographos.

# For Ubuntu 20.04
sudo apt-get update
sudo apt-get install build-essential git m4 unzip curl pkg-config
sh <(curl -sL https://raw.githubusercontent.com/ocaml/opam/master/shell/install.sh)

# For Mac
# Please make sure homebrew is installed. Otherwise, follow https://brew.sh/
brew update
brew install opam

# Common: Set up OPAM
opam init
eval $(opam env)
opam repository add satysfi-external https://github.com/gfngfn/satysfi-external-repo.git
opam repository add satyrographos https://github.com/na4zagin3/satyrographos-repo.git
opam update

# Common: Install SATySFi
opam depext satysfi satysfi-dist satyrographos
opam install satysfi satysfi-dist satyrographos

# Common: Set up the SATySFi standard library
satyrographos install

Install using OPAM

Prerequisites

Here is a list of minimally required softwares.

  • bzip2
  • cc
  • git
  • m4
  • make
  • unzip
  • wget or curl
  • opam 2
  • ocaml 4.10.0 (installed by OPAM)

Also, we must add an external OPAM repo to build. This can be done by the following command.

opam repository add satysfi-external https://github.com/gfngfn/satysfi-external-repo.git
opam update

Example (Ubuntu)

sudo apt-get update
sudo apt-get install build-essential git m4 unzip curl

sh <(curl -sL https://raw.githubusercontent.com/ocaml/opam/master/shell/install.sh)

# The following command will ask if you allow OPAM to modify some files (e.g. ~/.bash_profile).
# Be sure to read its instructions. Otherwise, some environment variables won't be set.
opam init --comp 4.10.0

eval $(opam env)

opam repository add satysfi-external https://github.com/gfngfn/satysfi-external-repo.git
opam update

Example (OS X Mavericks or later)

# Before running this scripts, install essential softwares such as GCC and Make. They can be installed from Xcode Command Line Tools.
# Also, install Homebrew.

brew update
brew install opam

# The following command will ask if OPAM modifies some files.
# Be sure to read their instructions. Otherwise, some environment variables won't be set.
opam init --comp 4.10.0

eval $(opam env)

opam repository add satysfi-external https://github.com/gfngfn/satysfi-external-repo.git
opam update

Build

First, clone this repository and submodules. Then build SATySFi using OPAM.

# clone
git clone https://github.com/gfngfn/SATySFi.git
cd SATySFi

# build
opam pin add satysfi .
opam install satysfi
  • To reinstall, run opam reinstall satysfi.
  • To uninstall, run opam uninstall satysfi.

Setup for SATySFi

Before using SATySFi, one should put libraries and fonts onto the appropriate directory. This can be done by invoking the following commands in order:

./download-fonts.sh
./install-libs.sh

The former downloads the fonts required by the default settings into lib-satysfi/dist/fonts/, and the latter copies lib-satysfi/ to /usr/local/share/satysfi/.

During this setup, the following fonts are downloaded. Consult their license before using them.

Usage of SATySFi

Type

satysfi <input file> -o <output file>

in order to convert <input file> into <output file>. For example, when you want to convert doc.saty into output.pdf, the following command will work:

satysfi doc.saty -o output.pdf

Starting out

First of all, let’s try to compile the demo file. It is in demo folder. Because this demo file has MakeFile, All you should do is only type make.

cd demo
make

If demo.pdf is created, then the setup has been finished correctly.

Reference

In addition, a concice reference of SATySFi is written by SATySFi itself in doc folder. You need to compile it to read.

cd doc
make

Command-line options

  • -v, --version: Prints the version.
  • -o, --output: Specify the name of the output PDF file. if this option is not given explicitly, the name of the output file is the concatenation of the base name of the input file and the extension .pdf.
  • -b, --bytecomp: Use byte compiler and enhance performance of computation.
  • --full-path: Displays file names with their absolute path when outputting them to stdout.
  • --type-check-only: Stops after type checking.
  • --debug-show-bbox: Outputs bounding boxes for each glyph (for the purpose of debugging).
  • --debug-show-space: Outputs boxes for spaces (for the purpose of debugging).

Learning SATySFi

Wiki (currently written only in Japanese) has some information about learning SATySFi.

More Repositories

1

Sesterl

An ML-like statically-typed Erlang
OCaml
152
star
2

the_satysfibook

The manuscript for The SATySFi​book (1st edition for the Web)
35
star
3

toy-macro-ml

An implementation of MacroML [Ganz, Sabry & Taha 2001]
OCaml
30
star
4

cs-thesis

A SATySFi class file for writing CS master theses at The University of Tokyo
Makefile
29
star
5

satysfi.el

An Emacs major mode for SATySFi
Emacs Lisp
17
star
6

otfed

An OpenType font format encoder & decoder written in OCaml
OCaml
17
star
7

game_tianjiupai

A Tian Jiu Pai (天九牌) game server written in Sesterl & Elm
Elm
15
star
8

apbuf

Algebraic protocol buffers
OCaml
13
star
9

gfngfn.github.io

HTML
6
star
10

variational_gadts

[WIP] a GADT type inference engine
F#
5
star
11

tex_of_ocaml

A compiler for untyped lambda terms to TeX code
TeX
5
star
12

the_sesterl_book

5
star
13

sesterl_cowboy

A Cowboy (https://github.com/ninenines/cowboy) wrapper for Sesterl (https://github.com/gfngfn/Sesterl)
Erlang
5
star
14

satysfi-external-repo

Custom OPAM repository for external libraries of SATySFi
4
star
15

expandparams

(La)TeX packages that makes you save the cost of writing thousands of \expandafter.
TeX
4
star
16

sesterl_json

A JSON-handling library for Sesterl equipped with APIs similar to those of elm/json
Erlang
3
star
17

satysfi-test

3
star
18

hugo_theme_upcards

A simple card-based Hugo theme
JavaScript
3
star
19

sesterl_testing

A testing library for Sesterl wrapping EUnit
Erlang
3
star
20

StructMath

A structure-based GUI editor for typesetting math formulae
TypeScript
3
star
21

rebar_sesterl_plugin

A Rebar3 plugin for compiling Sesterl programs (https://github.com/gfngfn/Sesterl)
Erlang
2
star
22

satysfi-amidakuji

2
star
23

poly-shift-reset

An implementation of λ_{let}^{s/r} [Asai & Kameyama 2007]
OCaml
2
star
24

test_repository

TeX
1
star
25

public-memos

1
star
26

try-ray-tracing

Rust
1
star
27

sesterl_stdlib

The standard library for Sesterl (https://github.com/gfngfn/Sesterl)
Erlang
1
star
28

trifling_tex_codes

TeX
1
star
29

a_strange_behavior_of_logger_formatter

See: https://github.com/erlang/otp/pull/6036
Erlang
1
star
30

yojson-with-position

A fork of yojson used by SATySFi
OCaml
1
star
31

macrodown-test

OCaml
1
star
32

langprocbase

A minimal, easy-to-extend front-end of a language processor that supports Hindley-Milner type inference and type error reports with code positions
OCaml
1
star
33

ott-paper-template

A template for writing papers using Ott (https://github.com/ott-lang/ott)
TeX
1
star
34

gfn-latex.el

Emacs Lisp
1
star