Want to take your software engineering career to the next level? Join the mailing list for career tips & advice Click here

Macrodown

A statically-typed, functional typesetting system

Subscribe to updates I use Macrodown


Statistics on Macrodown

Number of watchers on Github 748
Number of open issues 67
Average time to close an issue 3 days
Main language OCaml
Average time to merge a PR about 2 months
Open pull requests 39+
Closed pull requests 12+
Last commit 3 months ago
Repo Created over 5 years ago
Repo Last Updated 2 months ago
Size 4.68 MB
Organization / Authorgfngfn
Contributors2
Page Updated
Do you use Macrodown? Leave a review!
View open issues (67)
View Macrodown activity
View on github
Book a Mock Interview With Me (Silicon Valley Engineering Leader, 100s of interviews conducted)
Software engineers: It's time to get promoted. Starting NOW! Subscribe to my mailing list and I will equip you with tools, tips and actionable advice to grow in your career.
Evaluating Macrodown for your project? Score Explanation
Commits Score (?)
Issues & PR Score (?)

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 SATySFibook,

and its development continues to this day (January 2020).

Install using Homebrew (for OS X users)

A Homebrew formula is provided for SATySFi (v0.0.2).

$ brew install --HEAD nyuichi/satysfi/satysfi

Install using OPAM

Prerequisites

Here is a list of minimally required softwares.

  • bzip2
  • cc
  • git
  • m4
  • make
  • unzip
  • wget or curl
  • ruby
  • opam 2.0 (Installation instructions are here.)
    • Bubblewrap, a tool required for opam 2, cannot be installed easily yet on some kinds of environment such as Windows Subsystem for Linux (WSL) and Ubuntu 16.04. As a workaround for the time being, opam 2 can be installed without bubblewrap by passing --disable-sandboxing option when running opam init. Please see opam's FAQ for details.
  • 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, lets 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.

Macrodown open issues Ask a question     (View All Issues)
  • almost 5 years 0-ary parallel definition is not accepted
  • almost 5 years Cannot infer types defined in modules
Macrodown open pull requests (View All Pulls)
  • Use Ocamlbuild, menhir, and opam
  • bump camel version to >= 4.06.0
  • update core to v0.10.0
  • Remove redundant dependencies for macOS
  • Remove unit token.
  • Add autoconf in README.md to be required on macOS
  • Faster Travis CI
  • add some math commands to math.satyh
  • Add a command line option --type-check-only
  • Implements `string-compare`
  • Implements `string_scan`
  • Unicode-aware string primitives
  • Parser error reform
  • reduce prerequisite (use curl if possible)
  • Add .editorconfig.
  • Move file generation rules in Makefile into Dune files
  • Add --no-default-config option
  • Rename 'open' to 'include', then deprecate 'open'
  • Add read external file support
  • Build some docs in CI to briefly check SATySFi works
  • Add OCaml 4.08 and 4.09 in Travis CI
  • Add floating-point operations, ceil and floor
  • Add some list functions.
  • Improve hyphenation pattern matching
  • Fix math1.saty in the doc directory
  • parser improvements
  • build src/* as a private library
  • fix a compare function of Set
  • Version watermarking by Dune
  • More math char classes (fix #159)
  • Add satysfi-lib-dist.opam for Satyrographos
  • remove dependency on ruby
  • Add some font functions and add bold type
  • Check coding style using ocp-indent with Travis CI.
  • setup ocp-indent
  • Check doc builds
  • Bit operations
  • add demo/satysfi-logo.jpg to generate demo.pdf
  • Add Nix installation method
Macrodown list of languages used
Other projects in OCaml
Powered by Autocode - Instant Webhooks, Scripts and APIs
Autocode logo wordmark