12 ms·
LaTeX3: Programming in LaTeX with Ease (2020)
- bombcar 3y agoEvery time I've tried to stray from LaTeX 2e to something else TeX or TeX adjacent such as LaTeX 3 I've always found that programmatically generating LaTeX 2e is easier for me, often because I don't have time to learn how to do it "properly" or the macro packages I want to use aren't available, etc.
- TheRealPomax 3y agoI have a similar experience with XeLaTeX. The "it's not unicode unless you jump through hoops" and "oh you want to use opentype fonts? I'm sorry to hear that" of plain LaTeX2e always make me go back to XeLaTeX instead.
- chaosite 3y agoSo, someone will probably correct me further but: You're still using (mostly the same) plain old LaTeX 2e with pdftex, xetex, and luatex (pdflatex, xelatex, and lualatex). Those are just 3 different engines for Knuth's original tex. As far as I know, some parts of all 3 are written in WEB (which is a language that persists mostly because Knuth's TeX is written in it).
- hfkwer 3y agoWhile what you're saying is true, I get the feeling that you want to say that this is in contrast to LaTeX3, which isn't "plain old LaTeX 2e". Except... that it is. The project to have a new engine has been scrapped a long time ago. LaTeX3 is just another layer above LaTeX 2e. With all its cruft.
- TheRealPomax 3y agoNote that LaTeX2e is just a set of commands, a bunch of which are absolutely ridiculous to use in plain LaTeX, and simply not used when using LaTeX in conjunction with XeTeX as engine, because XeTeX can do things that plain TeX just can't, and so all the insanity that LaTeX2 had to invent to make TeX "do things it was never designed for" simply aren't used when you're writing XeLaTeX documents. Like everything being Unicode by default, no packages/macros/special affordances required. Including not needing stuff like \hat{...} or \grave{...} because those make no sense when everything's Unicode: just write text. Or having direct font access instead of needing to go through the horrendously outdated TeX font metric concept.
- trostaft 3y agoI write LaTeX pretty much every day (math graduate student), and I like LaTeX quite a bit. It's a piece of software that solves a difficult problem, and after the (admittedly nearly vertical) learning curve, you can quite easily produce beautiful documents with it. It's a reproducible, programmatic solution. However, it is also clear that there's quite a lot of legacy pains within the language, much of which occurs when trying to stretch the macro system. If you're interested in this (and already know LaTeX), consider reading the full expl3 design document: https://texdoc.org/serve/expl3/0 https://texdoc.org/serve/expl3/0 I don't know if LaTeX is what I'll be writing in the future (at least, hopefully not in its current incarnation). I'm keeping my eyes open for a language with a similar design philosophy, but, frankly, it's a monumental effort to write anything similar, let alone build the community around it (packages, but also journal styles, etc.).
- borg16 3y ago> and after the (admittedly nearly vertical) learning curve, you can quite easily produce beautiful documents with it. what helped you get over this curve?
- mettamage 3y agoNot a math student, used to be a CS master student (with not so great math skills). For me, it took 40 hours to learn with Overleaf/Sharelatex (or whatever they're called nowadays). Just creating many small proof of concept thingies, and slowly building them out. I did this until I was comfortable enough. After 40 hours of learning it, I was about 90% as fast as typing in MS Word. There was one difference though, LaTeX made me way more structured because I commented at every paragraph what the intention of that paragraph was. So my writing became way more focused.
- QuadmasterXLII 3y agoThe most common way to learn is to co-author a paper with someone who’s proficient- but that’s an expensive resource!
- jyunwai 3y ago
- velcrovan 3y agoSkip it and go straight to Typst. https://github.com/typst/typst https://github.com/typst/typst https://github.com/qjcg/awesome-typst https://github.com/qjcg/awesome-typst
- distcs 3y agoLaTeX is a de-facto standard in academia and journals. Makes it very hard to just skip and go to Typst or any of the other recent takes on math typesetting.
- wenc 3y agoLooks interesting and I could see this being adopted in limited situations. Most Latex users only use a tiny subset of its capabilities. Most non-math journals also easily accept non Latex manuscripts. The math part seems similar to Latex (without backslashes) which is important since most folks have built muscle memory there (not just for documents but also for typing math in other situations like Markdown docs and Mathjax or KaTeX websites) The only issue is the ecosystem for specialized fields with their own typesetting requirements. But I’m all for anything that is easier to debug than Latex. That said I feel it will never truly compete with LaTeX in terms of adoption. LaTex is like SQL — it’s long in the tooth and has some minor design issues but represents something very fundamental that defies reinvention.
- benterix 3y agoThank you for this, I might consider it for my next paper - it seems great at a first glance. Do you use it on a daily basis? Any problems I should be aware of? I see quite a few open issues - do they actually matter?
- lugao 3y agoI've utilized it to craft a number of high-school level mathematics and physics problems and solutions, and the experience was genuinely pleasing. The scripting language brings a fresh perspective to the markup language, while the plugin ecosystem is steadily expanding and improving. Though I don't have firsthand experience in formatting documents to meet publication standards, the flexibility it offers seems promising for such applications. My sincere hope is that it garners the recognition it truly deserves, and that significant publications in the future will embrace it, rolling out official templates directly in typst.
- hfkwer 3y agoI'm a math professor. I've written articles, books, lecture notes, exams, exercise sheets, presentations... with latex. Hell, even a custom class for a journal I participate in. I hate this language with a passion. The design choices may have made sense in the 80s when 128 kB of RAM was considered high-end, "tooling" was an unknown term, and modern parser design an academic matter. If I have to read "Runaway argument" and sift through a hundred lines of log to find an error again I will have a stroke. LaTeX3? I have great admiration for the work they've done. But they have made at least two mistakes. 1. The fundamental mistake of insisting on backwards compatibility. Latex is choke-full of historical cruft. How many times have I read things to the effect of: "Oh, you want an inline list? And you're using the inline-list package?! You poor fool! You should be using inllst3 with the xtabl option. Holy shit, you're using hyperref too?? (Spoiler alert: everyone uses fucking hyperref.) You cretin. Well, you should load these three other packages in this specific order. Then paste these esoteric commands: \makeatletter\def\tbl@lst#1{\hy@tbl\vphantom{#2}#1\strut\lbl@lst##&!@\makeatother No, I'm not going to explain what the commands do. Figure it out. Documentation? In the texbook. It's not online, you expect Knuth to work for free? Go buy it on amazon, you freeloader." Don't get me started on how to get arXiv to accept your biblatex files. Throw all this into the trash and start anew. There's no other good way forward. 2. The superficial on creating a theoretically beautiful and consistent syntax that is designed for computers, not for humans. Seriously, go to the authors' website, the "LaTeX3 examples" page https://www.alanshawn.com/tech/2020/05/25/latex-3.html#examples https://www.alanshawn.com/tech/2020/05/25/latex-3.html#examp.... Here's how you multiply a length by a float and store it somewhere. \cs_generate_variant:Nn \fp_set:Nn {Nx} % #1: input name % #2: output name % #3: factor \cs_set:Npn \__multiply_length:NNn #1#2#3 { \fp_set:Nx \l_tmpa_fp {\dim_to_fp:n {#1}} \fp_set:Nx \l_tmpb_fp {\l_tmpa_fp * #3} \dim_set:Nx \l_tmpa_dim {\fp_to_dim:n {\l_tmpb_fp}} \dim_set_eq:NN #2 \l_tmpa_dim } How anyone can look at this and think "that's the proper way of doing things" is beyond me. I've started writing stuff with msword and I honestly like it better. Even UTN28 kind of makes sense. Yes, I'm expecting a fight after writing this.
- fabiensanglard 3y agoI have written three books in Latex and I also hate it. I am thinking of a fourth one but I don't think I can take another of these night trying to figure out why the lines in a table don't connect. At this point I will try anything else.
- queuebert 3y agoWhile LaTeX's future replacement could certainly learn a lot from modern languages like Markdown, I hope that the creators will use as much rigor in designing the typesetting system as Knuth did. Part of LaTeX's success was the absolutely beautiful documents it can make with nothing but a personal computer. For example, to compute line breaks, it solves an optimization problem over the whole page.
- taeric 3y agoOddly, I would cite Knuth's rigor in stability as much as in rigor of algorithm choice and creation. Specifically, TeX still works well today because of deliberate choices to not break things. He is well aware of modern techniques for many of the things that people complain about. He likes that he can still build every one of his documents today, with no concerns over things having "moved on to better ways."
- thangalin 3y ago> modern languages like Markdown Markdown was created in 2004. From the creator: > ... the single biggest source of inspiration for Markdown’s syntax is the format of plain text email. Email goes back to 1965, though I suspect Markdown's influence stems from the more widely adopted email usage of the 1990s. I'm not sure if I'd call Markdown "modern". Quite popular though! > Part of LaTeX's success was the absolutely beautiful documents it can make with nothing but a personal computer. I'd say that was TeX's success, with LaTeX bolted on later to greatly improve TeX's extensibility. Keep in mind, there are a number of TeX-centric implementations beyond LaTeX. For example, my fork of NTS, called KeenType, is a pure Java version of TeX that can typeset beautifully and has at its core Knuth's original TeX files. I specifically avoided integrating LaTeX. https://github.com/DaveJarvis/KeenType/tree/main/tex/src/main/resources/base https://github.com/DaveJarvis/KeenType/tree/main/tex/src/mai... My Markdown text editor, KeenWrite, uses KeenType to preview math in documents. https://github.com/DaveJarvis/KeenWrite/blob/main/docs/screenshots.md#equations https://github.com/DaveJarvis/KeenWrite/blob/main/docs/scree... When exporting to PDF, KeenWrite uses ConTeXt to typeset the final document. ConTeXt being another TeX-based system. This is the reason why KeenWrite only uses TeX: to give users the ability to choose what TeX flavour to use for typesetting the PDF. https://wiki.contextgarden.net/Main_Page https://wiki.contextgarden.net/Main_Page
- coliveira 3y agoJust to clarify, this is not a new version of the TeX engine or a new language, it is a new set of macro interfaces that one can use to implement features in the LaTeX macro package. It provides certain facilities that make it easier to write larger macro packages for users.