Live data from Hacker News

Sile: A Modern Rewrite of TeX

sile-typesetter.org

161–170 of 181 posts

Re: Sile: A Modern Rewrite of TeX

#161
post #108

TeX and Literate Programming (and Lisp) are my fundamental, day-to-day tools. Code it, explain it, generate a Literate PDF containing the code. The programming cycle is simple. Write the code in a latex block. Run make. The makefile extracts the code from the latex, compiles it, runs the test cases (also in the latex), and regenerates the PDF. Code and explanations are always up to date and in sync. I have found no b…

About 12 years ago, I used LaTex to write a semantic web book, but in 2 editions: Common Lisp and Java. It was very cool to have 2/3 of the manuscript common text, and about 1/3 unique to the programming language.

For the last two evenings, I have been revisiting my old manuscript materials because I am thinking of updating the material and also creating additional editions for more programming languages: Python, JavaScript, and maybe Swift and Prolog.

I had forgot how cool TeX and LaTex are. It was very easy to start working with again, even after a 12 year gap.

Re: Sile: A Modern Rewrite of TeX

#162
post #4

Even if LaTeX3 brought some nice things to the TeX world, TeX programming is every year lagging more and more behind modern programming languages and practices. SILE has a long way to go before it can compete with math-heavy publications made with TeX, but I think it is already a good solution for typesetting technical documentation or prose fiction.

For prose fiction, I don't see much here that is going to drive people away from Indesign. Designers and typesetters aren't really interested in doing that kind of work in a system that would require generating new output for every correction. Even relatively simple tasks like balancing columns in a spread would become a pain.

The whole point is you shouldn't have to manually balance columns in a spread. Obviously a round trip from source to output to fiddle with balancing every spread would be tedious. But if you can say "For this content I want to use spread X defined as this shape and balanced in this way" and then be able to fiddle with your content and have your spread always work, then where is the tedium? That's what SILE is supposed to do.

Many publisher's workflows involve a round of content editing bouncing a word file back and forth, then a period where a typesetter uses InDesign or similar to lay it all out, then it goes to press. You can't keep copy-editing after the designer takes over. With a workflow using source documents in Markdown and typesetting handled by SILE I am able to allow copy-edits to book manuscripts up until minutes before going to press.

Re: Sile: A Modern Rewrite of TeX

#163
post #3

Does it come with a context-free syntax? If not, that would be a grave mistake. Being unparseable is one of the biggest problems of TeX, IMO. Not the least because you cannot automatically work with TeX "documents".

Yes it comes with its own context-free syntax that (despite some surface resemblance to TeX) is quite easy to parse. It can also ingest XML and some other formats.

Re: Sile: A Modern Rewrite of TeX

#164

Earlier quoted context omitted.

https://en.wikipedia.org/wiki/Grid_(graphic_design) TeX usually tries to adjust the space between lines so that a single typeblock is more visually appealing. Unfortunately, doing this adjustment independently for side-by-side columns leads to output where the text lines don't line up, and that is way less visually appealing.

Thanks for the link. Why is that particularly relevant to typesetting a Bible?

If you do a Google image search for [bible] and look at typical layouts used, I think this might be apparent.

Less obvious is that bibles are often printed on thin paper to fit a big document in a small space, so having things line up on one side of a leaf to the other is more important than in most other books.

Re: Sile: A Modern Rewrite of TeX

#165

If it can get sane error messages, then it's already miles better than TeX.

On a scale of LaTeX=0 (absolutely inscrutable) to Rust=10 (holds your hand through the fix) I would say SILE is about a 5. Caveat, I speak as one of the authors. It helpfully traces the location of any problem to an exact location in your document, mostly clarifying what it was trying to do, has a trace stack with code locations for everything it was trying to do leading up to the problem, and in many common cases has sensible descriptive errors. That being said if even as a contributing author I only give it a 5 it clearly has room to improve!

Re: Sile: A Modern Rewrite of TeX

#166
post #97
post #7

Reminds me of reportlab, which I loathe only because of their lack of documentation. Typesetting is hard. But at this point why not use semantic html and a specially crafted css?

Sile will take Docbook XML as an input format. Close enough?

Actually it just takes XML as an input format, but depending on your XML you need to provide a class that defines how to typeset each tag. For Docbook SILE has an example class with about 40% of the possible tags defined to something sensible. If you want to typeset Docbook you'd need to round that out to cover your use case. To date it is only supplied as an example of how to process XML.

Re: Sile: A Modern Rewrite of TeX

#167
post #79

I'm excited for the project, but disappointed that they kept the arcane syntax of TeX/LaTeX. Math expressions are hideous to write and read in LaTeX syntax.

SILE can also read XML or Markdown. I use it for publishing books from Markdown via Pandoc (there are several paths from Markdown→SILE).

And for the record the native SIL syntax resembles TeX at first blush but is actually vastly simpler because it is regular and uses a smaller set of possible syntax variations. If you don't like the look or feel of the syntax you can use something else for your source format and provide your own reader that generates a document AST.

Re: Sile: A Modern Rewrite of TeX

#168

Title is inaccurate. It uses TeX algorithms, seems (LuaLa)TeX syntax too, and "modern standards". But those don't justify calling it a rewrite. "Modern TeX-inspired system" is a better fit.

True.

Edit: I initially said none of the upstream maintainers call it a rewrite, but I was wrong because the original author did in fact use that turn of phrase on several occasions including in the manual and in a talk.

I agree though it's not an ideal way to describe it because it has some many differences too. It's not a port of TeX to a different language. As you suggest TeX-inspired is much nearer the mark. It's a from-scratch effort at addressing roughly the same problem space. It does re-implement some of the same algorithms. One of it's input syntaxs resembles TeX (although the resemblance is not even skin deep). But no it is not a rewrite, just a new take.

Re: Sile: A Modern Rewrite of TeX

#169
post #142

Earlier quoted context omitted.

This description of TeX's process (originally by Knuth himself) is quite tongue in cheek but I fail to see why this makes TeX's programming paradigm 'awful'. Think of it this way: both C and C++ (even Rust has macros, which I heard is the new hotness) have a preprocessor, which is exactly what TeX's 'mouth' is. The fact that the language of the preprocessor looks very similar to the main language does not make it wei…

I'll probably try SILE just because it does not support macro. I personally think the adoption macro is the embodiment of non intuitive programming languages and why a modern programming languages, for example Rust is supporting macro is beyond me. I'm not alone in this regard, D a modern successor of C and C++ does not support macro. Hopefully one day Walter will write document on "Macro Considered Harmful" to enlig…

I respect your stance (although I disagree strongly) but you might consider something other than Sile, as Chapter 6 of Sile's manual is called 'SILE Macros and Commands'. Also from reading about D, his strongest objection to using macros is that they do not respect the scope. This is probably the main source of macros' strength as code generators. Again, I respect your aversion to macros, I am not sure I understand the reasons, though.

Re: Sile: A Modern Rewrite of TeX

#170

Earlier quoted context omitted.

Thanks for the link. Why is that particularly relevant to typesetting a Bible?

If you do a Google image search for [bible] and look at typical layouts used, I think this might be apparent. Less obvious is that bibles are often printed on thin paper to fit a big document in a small space, so having things line up on one side of a leaf to the other is more important than in most other books.

I did that, but it wasn't apparent. I don't know much about typography, and less about why TeX can't manage.

One of the examples I found is https://www.behance.net/gallery/91186859/Typography-of-the-B... .

Is it to have parallel translations keep the verses side-by-side, as the first image shows between German and Greek?

I did mention the thin paper example earlier. :)

Post reply on HN