Fancy Euclid's “Elements” in TeX
habr.com
habr.com
This linked post on habr.com is definitely worth reading; also see the sources on GitHub page here: https://github.com/jemmybutton/byrne-euclid
A scan of Byrne's 1847 original here: https://archive.org/details/firstsixbooksofe00byrn/page/n6
Another person's (Nicholas Rougeux's) reproduction here: https://www.c82.net/euclid/about/
A publisher's attempt to “extend” Byrne's work from 6 to all 13 books here (Kickstarter + preorder; I don't believe it's done yet): https://www.kroneckerwallis.com/product/euclids-elements-com...
There's also a facsimile reproduction of Byrne's original by the publisher Taschen, with a review here that goes into some detail on Euclid editions and on Byrne: https://www.maa.org/publications/maa-reviews/the-first-six-b...
Nice (un)intended pun. :-)
It's not that I'm super fond of LaTeX, it's just that I assumed its warts were more or less inevitable in a stringy macro framework, and ConTeXt can't avoid that either.
1. No need to run `pdflatex; bibtex; pdflatex; pdflatex` multiple times. The wrapper script `context` takes care of that.
2. Easy to add graphic elements to the page and layout in a consistent and _fast_ manner.
3. Export to XML/XHTML/ePub.
4. Can compile XML.
5. Programatically generate documents using a Lua interface (this is different from LuaTeX; ConTeXt has a nice Lua interface called ConTeXt Lua Documents, so it seems that you are writing Lua code rather than a wrapper script).
6 Consistent of interface. See https://tex.stackexchange.com/questions/4987/why-should-i-be...
Let me give a few examples of how I use ConTeXt (not necessary with ConTeXt Lua Documents)
1. Create a simple key-value driven interface for "complex" layouts https://adityam.github.io/context-blog/post/exam-coverpage/ This is still a "string-macro-framework", but ConTeXt has enough (and well named!) macros that it almost appears to be a "normal" template language. The code in ERB or other template languages would not be too different.
2. Generate Lab assignments for an undergraduate linear control systems course where the students learn how to interface MATLAB with real-time hardware. We create the lab in Matlab (`.m` file) and convert it to Matlab live script (which is Matlab's version of jupyter notebooks) which the students have to fill in. But, the live script notebooks are not convenient for browsing (say, for students who want to view the lab on their phone). Matlab offers a PDF as well as LaTeX export, which look ugly IMHO. So, we convert the `.m` to XML (Matlab does an XML export), and then use context to convert XML to PDF. The code is written using "stringy-macro-framework" but again the interface is nice enough that it would have looked similar in any other XSLT framework in any high-level language.
3. As an academic, I need to generate various versions of my CV (full publication record, pubs in the last `n` years for various values of `n`, etc.). I store my pubs in an XML file, use the XML parsing lib in ConTeXt to convert the data to Lua tables, and then use ConTeXt Lua Document syntax to generate different versions of my CV (depending on the command line flags to the `context` compiler. Once the data is converted to a Lua table, it is trivial to do things like group pubs by year, group pubs by research areas, etc.
One reason for the practical gap is that there is an order of magnitude more info on LaTeX online. Googling for ConTeXt is a miserable experience and the official documentation is far from enough.
On the other hand, if you do master it — well then it's easier to do the kind of things the OP does, which I think is really impressive.
https://archive.org/details/euclid_heath_2nd_ed
It's the most detailed and complete translation, addressing numerous issues. Not all, thought, there's one grave translation error unaddressed in pretty much all translations, and more importantly, repeated in ALMOST all translations:
http://cgm.cs.mcgill.ca/~godfried/teaching/dm-reading-assign...
Even today, most mathematicians aren't aware of the difference. (And this despite the fact that the Wikipedia article on the axiom DOES mention it.)
I wish we'd have Byrne-style drawings of The Elements as implemented in this paper, albeit the authors of it & the various precursor papers to it seem unaware of the above, too—and hence (almost) reinvent the wheel:
https://link.springer.com/article/10.1007/s10472-018-9603-0
(Note: There exists a 'secret' sequel to that paper, which one can find here: http://t-news.cn/Floc2018/FLoC2018-pages/preprint_cX1w.pdf — I say 'secret' as they only cite the above indirectly, by citing "Mark Bickford, Rich Eaton, and Ariel Kellison. Nuprl Theory: euclidean plane geometry, 2018.", which makes the connection between them undiscoverable via services like citationgecko.com & Google Scholar.)
TeX Live is a TeX distribution, meaning it contains TeX, LaTeX, ConTeXt, and a variety of other macro packages (including packages building on top of LaTeX, for example), fonts, and so on.
I think it should be possible to implement this in a dependently typed language like Idris, but haven't really worked on this (yet). Any thoughts?
It seems a dependently typed language might be overkill, "The proofs described in this paper only need a rather weak logic. There are no function symbols", "only existential quantifiers; universal quantification over the free variables is left implicit."
They wrote a translator then to convert the proofs to HOL, and Coq, you could presumably do the same for e.g. idris