Upgrade to Pro — share decks privately, control downloads, hide ads and more …

TeX - The ultimate Yakshave

Florian Gilcher
March 05, 2015
4.5k

TeX - The ultimate Yakshave

Florian Gilcher

March 05, 2015
Tweet

Transcript

  1. TEX, the ultimate yakshave
    Florian Gilcher
    March 5, 2015

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

  5. Yakshave 1
    Invent your own computer to illustrate a point.

    View Slide

  6. The state of typesetting
    Less then ideal.

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

  13. Yakshave 5
    Design a font: “Computer Modern”.

    View Slide

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

    View Slide

  15. Legacy
    Later evolved into METAPOST for generic vector drawing.

    View Slide

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

    View Slide

  17. View Slide

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

    View Slide

  19. Yakshave 7
    Implement a versioning scheme no one else uses.

    View Slide

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

    View Slide

  21. Yakshave 8
    Implement your own Device Independent Format (DVI)

    View Slide

  22. We finally got a system here.

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

  26. 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?

    View Slide

  27. Changes
    pdfla,tex
    luala,tex
    xela,tex

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

  32. Community Yakshave 2
    Build a lot of tooling around it.

    View Slide

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

    View Slide

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

    View Slide

  35. 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?

    View Slide

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

    View Slide

  37. Distribution: texlive basic
    98MB
    allows package by package downloads

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

  44. View Slide

  45. Examples

    View Slide

  46. Thank you

    View Slide