• Stars
    star
    156
  • Rank 239,589 (Top 5 %)
  • Language
    Python
  • Created about 12 years ago
  • Updated about 3 years ago

Reviews

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

Repository Details

A Python library letting you invoke TeX-inspired typesetting algorithms

A Python Typesetting package

(Note: I plan to add user documentation to the library within the next couple of weeks; simply “watch” this repository here on GitHub if you want to follow along until it appears!)

This prototype library typesets paragraphs using the same approach as TeX and LaTeX, knows how to avoid widow and orphan lines when splitting paragraphs across pages, and produces PDF output:

alt text

Here is an example PDF that is typeset using the library:

examples/steam/book.pdf

The script that produced the above PDF is here in the repository at examples/steam/typeset.py.

The vast difference this library’s approach and that of TeX or LaTeX is that this library leaves you entirely in control — paragraph justification and line breaking are a subroutine that you call from normal Python code that is otherwise free to draw on the page however it wishes! You can draw titles, page numbers, and add media using whatever underlying library calls you want, and the typesetting library stays out of your way. No longer will you be stuck trying to center a title or draw using abstruse configuration piled atop underpowered boxes and glue primitives.

The process of designing this library is described in the 2019 “Typesetting with Python” keynote talk that I delivered at PyLondinium19:

https://www.youtube.com/watch?v=e7RVO0Sqr4s

I am happy that the talk (in the form of the above recording) was also featured at the remote TUG2020 conference in July 2020, which I celebrated by returning to the repository and getting progress underway again!

More Repositories

1

fopnp

Foundations of Python Network Programming (Apress) — scripts and examples
Python
1,356
star
2

python-patterns

Source code behind the python-patterns.guide site by Brandon Rhodes
Python
1,256
star
3

pycon-pandas-tutorial

PyCon 2015 Pandas tutorial materials
Jupyter Notebook
1,016
star
4

pyephem

Scientific-grade astronomy routines for Python
C
737
star
5

python-sgp4

Python version of the SGP4 satellite position library
Python
345
star
6

logging_tree

Debug Python logging problems by printing out the tree of handlers you have defined.
Python
302
star
7

Concentric-CSS

A standard order for CSS properties that starts at the outer edge of the box model and moves inward
CSS
296
star
8

homedir

My home directory dotfiles and customizations
Perl
201
star
9

sphinx-tutorial

Exercises for the Sphinx Tutorial that I used to present each year at PyCon
Python
154
star
10

python-adventure

Original Colossal Caves adventure game, but in Python 3
Python
148
star
11

python-jplephem

Python version of NASA DE4xx ephemerides, the basis for the Astronomical Alamanac
Python
103
star
12

unixpc-font-bdf

Convert the venerable AT&T UNIX PC font to the modern BDF bitmap format
Python
75
star
13

uncommitted

Command-line tool to find projects whose changes have not been committed to version control
Python
74
star
14

luca

Bookkeeping in Python
Python
67
star
15

scrawler

ASCII art animation library for Python
Python
64
star
16

pycon-sql-tutorial

Resources for my PyCon SQL tutorial
Python
52
star
17

python-novas

The United States Naval Observatory NOVAS astronomy library for Python
C
42
star
18

exe-from-python

Python
34
star
19

assay

Attempt to write a Python testing framework I can actually stand
Python
24
star
20

pycon2010-mighty-dictionary

Slides, dict introspection, and dict diagramming tools for my PyCon 2010 Talk “The Mighty Dictionary”
HTML
22
star
21

pyzmq-static

Script to compile a statically-linked version of the Python "zmq" package with ØMQ and libuuid (on Linux systems) built-in instead of relying on shared libraries.
C
22
star
22

dot-emacs

My self-booting .emacs.d directory, mostly for Python and JavaScript development
Emacs Lisp
18
star
23

contingent

The Contingent library for powering a build system with dynamic rules
HTML
11
star
24

gps-to-html

Static site generator that turns GPS tracks into maps and statistics
Python
7
star
25

backpacking-planner

Simple Python script to tally mileages between campgrounds and water sources
Python
7
star
26

blog

Source code for my personal blog
Jupyter Notebook
6
star
27

publicanus

Prototype small business tax calculation for Django Dash 2012
Python
6
star
28

pywinner

Set up a Windows EC2 instance to build Python packages
Python
5
star
29

personal-search-engine

Local and searchable cache of favorite tweets and bookmarked web pages
Python
4
star
30

conda-install

Install Conda packages right from your requirements.txt file
Python
3
star
31

assert_rewriter

Rewrite assert statements in Python bytecode so they support introspection
Python
3
star
32

trace-memory-access

Scripts to trace memory accesses from a program
Python
3
star
33

python-johnhancock

Sign a PDF document with a signature.png file
Python
2
star
34

twiddler-1-driver

Linux driver for original Handykey Twiddler chording keyboard
C
2
star
35

brandon-garmin

Simple Garmin apps for backcountry navigation
Monkey C
2
star
36

website-dillers-flooring

A web site for Diller's Flooring in Bluffton, Ohio
JavaScript
2
star
37

backports

2
star
38

python-spk

A library for parsing and loading SPK files
Python
2
star
39

cmr

cmr
2
star
40

pycon2010-sphinx-tutorial

Python
1
star
41

recursive-family-search

Find out when relatives reached this continent
Python
1
star
42

org-mode-invoicer

Python program to write up an invoice using org-mode
Python
1
star
43

build-butchart-map-index

Scripts to build a map index on my web site
HTML
1
star
44

talk-about-luca

Sample code for my May 2016 Clepy talk
Jupyter Notebook
1
star
45

rhodesmill.org

Personal website, for GitHub Pages
HTML
1
star