Slide 1

Slide 1 text

TEX, the ultimate yakshave Florian Gilcher March 5, 2015

Slide 2

Slide 2 text

Donald Ervin Knuth Born 1938 Professor at Stanfort “father of the analysis of algorithms” Known both as a theoretical and a practical computer scientist Gives a christmas lecture about trees Patron saint of yakshaving

Slide 3

Slide 3 text

The art of computer programming First released in 1968 Describes programming a theoretical, but practical computer.

Slide 4

Slide 4 text

Yakshave 0 Write a book considered a “book of the century”.

Slide 5

Slide 5 text

Yakshave 1 Invent your own computer to illustrate a point.

Slide 6

Slide 6 text

The state of typesetting Less then ideal.

Slide 7

Slide 7 text

In 1976, Knuth prepared a second edition of Volume 2, requiring it to be typeset again, but the style of type used in the first edition (called hot type) was no longer available. In 1977, he decided to spend some time creating something more suitable. Eight years later, he returned with TEX, which is currently used for all volumes.

Slide 8

Slide 8 text

Implementation strategy and language TEX is implemented in WEB, a dialect of PASCAL, that allows for literate programming, an idea invented by Donald Knuth. In literate programming, normal text is interleaved with specially marked code, putting Documentation first.

Slide 9

Slide 9 text

Yakshave 2&3 Invent a programming paradigm. Implement your own programming langage dialect to support it.

Slide 10

Slide 10 text

Problems Word breaking, line breaking and general text layout was not properly done back then.

Slide 11

Slide 11 text

Yakshave 4 Invent a text layout algorithm (“Knuth’s algorithm”).

Slide 12

Slide 12 text

More Problems Layout algorithms lay out objects of several sizes (characters). Characters are provided by font files. Free fonts were few and far between.

Slide 13

Slide 13 text

Yakshave 5 Design a font: “Computer Modern”.

Slide 14

Slide 14 text

Yakshave 6 Invent and implement a program to describe vector fonts: METAFONT.

Slide 15

Slide 15 text

Legacy Later evolved into METAPOST for generic vector drawing.

Slide 16

Slide 16 text

Seriously, I’m still waiting for a JavaScript library to implement diagram layouting of METAPOSTs quality.

Slide 17

Slide 17 text

No content

Slide 18

Slide 18 text

Aside: Versioning TEX versions approach π. METAFONT versions approach Euler’s number.

Slide 19

Slide 19 text

Yakshave 7 Implement a versioning scheme no one else uses.

Slide 20

Slide 20 text

Independence What does a typesetting system produce? Something printable. Every printer back then had their custom format.

Slide 21

Slide 21 text

Yakshave 8 Implement your own Device Independent Format (DVI)

Slide 22

Slide 22 text

We finally got a system here.

Slide 23

Slide 23 text

Community shaving is best shaving Leslie Lamport implemented a macro set for TEX, called L A TEX Others came up with ConTeXt

Slide 24

Slide 24 text

Community Yakshave 0 Create not one, but two ungoogleable projects.

Slide 25

Slide 25 text

Community shaving is best shaving Before UTF-8, another encoding (T1) was invented, to work with characters beyond ASCII

Slide 26

Slide 26 text

Changes We’d like to work with semi-modern formats, e.g. PostScript or PDF. And how about scripting the whole thing? And use modern font formats and UTF-8?

Slide 27

Slide 27 text

Changes pdfla,tex luala,tex xela,tex

Slide 28

Slide 28 text

You cannot reimplement TEX TEX is free software, but any modification must not be called TEX.

Slide 29

Slide 29 text

You cannot reimplement TEX TEX is free software, but any modification must not be called TEX. Their output might differ.

Slide 30

Slide 30 text

You cannot reimplement TEX TEX is free software, but any modification must not be called TEX. Their output might differ. On the plus side, TEX is really just the layouter.

Slide 31

Slide 31 text

Community Yakshave 1 Transpile WEB to C and work from there.

Slide 32

Slide 32 text

Community Yakshave 2 Build a lot of tooling around it.

Slide 33

Slide 33 text

Community Yakshave 2 Build a lot of tooling around it. For years and years.

Slide 34

Slide 34 text

Frustrations TEX is OLD TEX is ODD TEX has legacy TEX is HUGE Backwards-compatibility trumps everything

Slide 35

Slide 35 text

TEX is not a programming language Lots of vocabulary is from typesetting Primitives for logic are bad Do you know what a strut is? A quad, etc?

Slide 36

Slide 36 text

Distribution: texlive 2.8 GB never removes things renames on breaking changes compiles everything under the sun huge toolchain for document management

Slide 37

Slide 37 text

Distribution: texlive basic 98MB allows package by package downloads

Slide 38

Slide 38 text

A system with documentation culture The documentation is the test case From TEX on. A predictable learning curve

Slide 39

Slide 39 text

Fast Still one of the fastest typesetters around Memory-conservative Batchable

Slide 40

Slide 40 text

High quality Exact, repeatable, layout Font support even for weird scripts is great Lots of support for drawings

Slide 41

Slide 41 text

Featureful Lots of special symbols Support for all fields of science Support for References and Bibliography (through packages)

Slide 42

Slide 42 text

What can you learn from TEX? The drawbacks and merits of strict backwards compatibility How software was written 40 years ago The amount of effort necessary to replace this. Actual typography

Slide 43

Slide 43 text

Earn money with TEX Both TEX and “TAOCP” offer bounties for bugs. Typesetting bugs are bugs. http://en.wikipedia.org/wiki/Knuth_reward_check The checks are rare.

Slide 44

Slide 44 text

No content

Slide 45

Slide 45 text

Examples

Slide 46

Slide 46 text

Thank you