[HN Gopher] Typst, a new markup-based typesetting system, is now...
___________________________________________________________________
Typst, a new markup-based typesetting system, is now open source
Author : reknih
Score : 371 points
Date : 2023-03-21 18:18 UTC (4 hours ago)
(HTM) web link (github.com)
(TXT) w3m dump (github.com)
| kirillbobyrev wrote:
| This looks cool!
|
| I understand that, just like any tool that has sufficiently many
| users, (La)TeX grew exponentially in terms of the number of
| features it has. I like the its core, and I also like the ability
| to write scientific texts somewhat conveniently. I haven't used
| Typst yet, but it looks to be something I wanted for quite a
| while: similar convenience to LaTeX and yet much more simplicity.
|
| To be fair, though, Markdown + KaTeX and MathJax are kind of
| everything I need right now. Jupyter Notebooks can render enough
| LaTeX formulas for me to use it when I needed it, even in the
| university when I'm writing some CS algorithm overview/tutorial
| or need to do some calculations and hand it in with the
| explanation. Whenever we had labs in Physics I would do all the
| calculations in Jupyter Notebooks and that actually looked pretty
| good. And for my personal blog, I just set up the KaTeX + Hugo
| which I love: the convenience of Markdown + LaTeX is enough.
|
| This being said, I'm sure there are many people who still have to
| write papers and would find it useful, but at least for me LaTeX
| is not a standalone tool that I would use anymore.
|
| Also, part of the value that LaTeX has is an enormous amount of
| templates that I don't understand but I use them because I have
| to (e.g. when writing a thesis - it has all the right
| typesetting, formatting and so on) or because they look very good
| (I still maintain my Resume in LaTeX format. This is hard to
| replicate or capture with a new system.
|
| EDIT: Oh, and also Mermaid.js which is now integrated into both
| GitHub Markdown and Hugo is wonderful for a very small version of
| TikZ. Although, it is very inconvenient for my taste, but it's
| still very useful.
| aarpmcgee wrote:
| If any of the project maintainers are seeing this -- I am trying
| to sign up for the public beta, but the verification email never
| arrives. I've confirmed that I have submitted the correct email
| address. Any ideas?
| alephaleph wrote:
| people are reporting similar in the discord, I think their
| email service is just getting a little hammered rn
| aj7 wrote:
| Heh heh. ChatGTP got hold of Typist.
|
| The Fibonacci series is not a geometric sequence.
| fictorial wrote:
| Where did the code example for Fibonacci go in the typeset
| output?
| laurmaedje wrote:
| It's not a code example. It's Typst code that is used to
| calculate the fibonacci numbers that are displayed in the
| table.
| fictorial wrote:
| I see, thanks! That's pretty neat.
| Falcondor wrote:
| I think, if I am reading it correctly, that was not a code
| example, that was actual code. count and nums are variables
| being defined, and fib is a function. Then the function is
| being called to build the table (you can see str(fib(n)) in the
| second to last line)
| TT-392 wrote:
| So, I will try it once I have time, but how doable is it to bent
| this thing to your will? Because the main problem I have with
| latex is that I am often trying to do something, which it just
| isn't made to handle.
|
| For example, I often find lots of hyphens and justified text hard
| to read, so I try to get latex to not use justified text and to
| never hyphenate.
|
| However, latex seems to be really bad when you want to do
| unconventional stuff like that, having to use hackey workarounds
| which often cause errors all over the place.
| sebzim4500 wrote:
| Typst is still quite early in development, so there are missing
| features. Having said that, based on the docs it looks like
| unjustified text without hyphens is already possible.
| M3L0NM4N wrote:
| Looks very cool, but LaTeX still feels superior for non-
| mathematical documents like a resume, right?
| spoiler wrote:
| In the case of CVs/resumes, I've never liked LaTeX CVs when I
| encountered them... Most of the time they just looked horrible
| and messy. Or they were for some reason being rendered without
| anti-aliasing and text selection broken when exported as a PDF.
| Probably because people gave up trying to get it to work.
|
| I'd rather use something like JSONResume, Markdown, or even
| HTML/CSS and printing to PDF. Google docs also has a few nice
| CV templates.
| Gualdrapo wrote:
| You should try ConTeXt.
| Yaina wrote:
| How so?
| xavxav wrote:
| I was looking for a way to procrastinate on my thesis writing,
| maybe I'll convert it all to typst!
|
| More seriously, I am really following this project closely, and
| now that it's open source I'd like to see if its possible to add
| the key libraries my field needs: mathpartir, and something like
| semantics? especially if typst can provide better syntax and
| errors!
| alephaleph wrote:
| Unfortunately Typst is completely incompatible with LaTeX and
| its packages, so you either have to go back to working on your
| thesis or procrastinate even more by reimplementing these
| yourself!
| xavxav wrote:
| Yes that's what I meant, I'm curious if the Typst api would
| allow equivalents of those packages.
| jcuenod wrote:
| Does it handle footnotes? A search on github suggested yes, but
| the docs don't seem to mention anything.
| shuntress wrote:
| I have spent probably too much time trying to gain a comfortable
| level of proficiency with LaTex and I have not been able too.
| Maybe I just don't use it often enough but I always now find
| myself just using HTML/CSS instead. Even when the thing I'm
| laying out is specifically just something to be printed.
|
| I feel similarly about LaTeX and Vim. I like them. They are
| interesting. I appreciate the history around their development
| and use. But I just cannot convince myself they are _worth_
| learning.
| soperj wrote:
| Vim is pretty easy to remember though, LaTex is something
| entirely different.
| nohaydeprobleme wrote:
| That's fascinating. I genuinely believe you, but in my
| personal experience, I've felt the opposite way.
|
| A first-year computer science course I took required all the
| students to develop a basic understanding of LaTeX in 1-2
| weeks, and we used LaTeX the rest of the term. I then got
| used to LaTeX commands, because in my personal experience,
| I've had plenty of opportunities as part of coursework to use
| LaTeX (oftentimes, it was required). In the meantime, I
| haven't yet learned Vim because I've read that it takes a
| while to learn--at least four weeks of consistent practice,
| often even longer, e.g. according to this discussion on HN:
| https://news.ycombinator.com/item?id=15414544
|
| For myself, as someone without personal experience using Vim,
| LaTeX is essential to my work with commands that I've
| internalized, whereas Sublime Text and IDEs like Visual
| Studio Code and PyCharm have been great for editing code
| (though I recognize that Vim can be an essential tool for
| editing remote files). I'm curious to learn from others about
| why Vim can be a better tool for certain tasks, even for
| local files, in contrast to Sublime or IDEs.
| jcparkyn wrote:
| > Vim can be an essential tool for editing remote files
|
| Even this point is being weakened by how good vscode's
| remote editing support is.
| pkulak wrote:
| Well, if you learn Vim you will use it every day (if you ever
| program, or work with any markup). And that's even if you never
| open the Vim editor itself; the bindings are available
| everywhere.
| stu2b50 wrote:
| The issue with latex is that I don't personally use it every
| day, and I suspect many people are in that camp. When you just
| use it ocassionally, all that syntax just falls out of your
| brain, leading to a frustrating loop where you're constantly
| relearning latex.
|
| In comparison, I use vim keybindings every day. As a result,
| despite how esoteric it may be, it's well ingrained into my
| muscle memory.
| nohaydeprobleme wrote:
| If you need to share a professional document that involves
| mathematical expressions and equations, LaTeX is very helpful
| as a tool to use. The need arises if you are a professional or
| student registered in a course in mathematics or computer
| science. It's much easier to type multiple lines of equations,
| with the equation signs aligned, in LaTeX than in Word.
|
| It's a bit of a grind, but you can learn the fundamentals of
| LaTeX in less than a week if you have an hour a day. It was
| actually a requirement to learn LaTeX well enough to submit a
| basic report within 1-2 weeks, as part of a first-year computer
| science course at the University of Toronto.
|
| The course instructors provided a basic LaTeX template (which
| included some instructions as a guide to how LaTeX worked), and
| also linked to free online tutorials for more in-depth
| instructions, which included LaTeX Tutorial from memory, at
| https://www.latex-tutorial.com . I wrote out notes from
| articles 01-09 and a few others on the website (as the other
| articles were less relevant to my purposes) to learn the
| basics, and then reinforced and developed my understanding of
| how to use LaTeX by writing future assignments in the course
| with it.
|
| As an illustration for how LaTeX solves a nice problem, a
| recent popular submission on HN explored the complexity of
| typesetting a mathematical document (named "How did Dennis
| Ritchie produce his PhD thesis? A typographical mystery"):
| https://news.ycombinator.com/item?id=35177110 . You might not
| have as much of a need to learn LaTeX if you don't regularly
| share lots of mathematical equations, but it's relatively quick
| to learn. LaTeX has also been quite useful to me for writing a
| professionally-formatted resume, which has been much easier to
| update than when I formatted my resume using Word.
| magicalhippo wrote:
| Yeah for math stuff I loved LaTeX. I even solved large
| equations directly in the document, was so easy to read.
|
| But once I had to write some pseudocode, make some larger
| tables, or embed images I suddenly longed for Word. Word
| certainly can make me curse, but it was still far easier than
| getting that done in LaTeX.
| shuntress wrote:
| I used LaTeX in school too and I agree theres probably no
| better tool for math-heavy documents.
|
| I stopped using it for my resume because I was too frustrated
| with essentially re-learning latex basics every time I wanted
| to make minor changes to content or format.
| jcparkyn wrote:
| > It's much easier to type multiple lines of equations, with
| the equation signs aligned, in LaTeX than in Word.
|
| I actually disagree. The equation editor in word is really
| quite good (if a little laggy sometimes), once you learn the
| shortcuts. Being able to see your fractions laid out properly
| is a massive productivity boost, and makes it much easier to
| quickly find the part you want to edit. The dealbreaker for
| me is the lack of equation numbering, without doing quite a
| few hacks.
|
| Personally, I'd still take the LyX math editor over Word
| though, for the macros and better performance.
| sampo wrote:
| > I have spent probably too much time trying to gain a
| comfortable level of proficiency with LaTex and I have not been
| able too.
|
| I got quite comfortable with LaTeX after I read a book. For me
| it was the Kopka & Daly book. Maybe these days it's a bit old-
| fashioned to get familiar with a programming language, by
| reading a book? But I think it works.
|
| https://www.latex-project.org/help/books/
| squidsoup wrote:
| You can develop muscle memory for vim, less so with LaTeX. Vim
| motions are absolutely worth learning, even if you don't use
| vim itself - it is the most efficient way to navigate and
| manipulate text.
| shuntress wrote:
| My main problem with vim is navigating and manipulating
| _files_ rather than _text_.
|
| I use vim fairly frequently for quick edits and small changes
| but as soon as the scope of the change starts to span more
| than one file vim starts to feel really frustrating really
| fast (to me).
| erik_seaberg wrote:
| Does this delegate to plain TeX or render text by itself? Knuth
| spent years on stuff like kerning of formulas and hyphenation.
| laurmaedje wrote:
| It's built completely from scratch, but the math layout
| algorithm is based on TeX.
| jl2718 wrote:
| It seems to me that LaTeX is primarily used as academic
| gatekeeping. This is one step better, but why a new DSL versus a
| library to build your layout representation from a common
| language?
| mananaysiempre wrote:
| People familliar with LaTeX will use it in places where it is
| definitely not required and sometimes even where it's arguably
| not a very good fit, such as for presentation slides,
| illustrated posters laid out in complicated ways, or in one
| notable case a diagramming package with automatic graph layout,
| plotting, symbols for circuits, and a boatloat of other things
| (TikZ).
|
| It might be difficult to believe given the unfriendly failure
| modes characteristic of a macroexpander and an abundance of
| dusty corners, but LaTeX really _is_ very convenient for a
| proficient user when the problem fits (e.g. not a magazine).
| BrandonS113 wrote:
| I have to disagree to "arguably not a very good fit, such as
| for presentation slides." I have to make regular work
| presentations with a lot of math. There are two choices:
| Powerpoint and Latex/beamer. While the latter is far from
| painless, powerpoint takes much more time and is much worse
| to revise.
| tonnydourado wrote:
| Etching slides into clay tablets with your hands tied
| behind your back is less painful than PowerPoint. Beating
| that isn't much of a flex.
| mathematicaster wrote:
| An open source, very well documented piece of software that run
| on many different operative systems used for gate keeping?
| klodolph wrote:
| Why do you say that LaTeX is gatekeeping? My experience is that
| it's easy to get LaTeX help, and most people don't care if you
| write your paper in Word.
|
| A big chunk of academic papers are done in Word, even in
| mathematics.
|
| I think a DSL really makes sense here, because that's what you
| spend half of your time dealing with--the syntax--so there is a
| lot of room to make it easier.
| dccsillag wrote:
| Because a library in a programming language would be madly
| inconvenient? I can't see something like this being pleasant to
| use: document( paragraph("blah blah
| blah"), math("sum_(i=1)^n i = (n (n+1))/2"),
| paragraph("foo bar") )
|
| Also, I'd imagine being a DSL and having a dedicated compiler
| is what let's Typst have such great incremental compilation
| (it's actually instant).
| mananaysiempre wrote:
| Not to say people haven't done it, though, and with enough
| willingness to adapt the syntax of the host language it can
| work quite well[1,2,perhaps 3].
|
| [1] https://docs.racket-lang.org/scribble/
|
| [2] https://docs.racket-lang.org/pollen/
|
| [3] https://patoline.github.io/
| fortran77 wrote:
| Just like math is used as academic gatekeeping? (An insane
| argument that many have made.)
| AnnikaL wrote:
| I tried using the provided binary and it doesn't seem to work
| very well.
|
| Using the basic syntax from the tutorial, I got this PDF
| rendering: https://shottr.cc/s/MVhq/SCR-20230321-ipq.png
| 2h wrote:
| can you comment or link to the syntax you used?
| convolvatron wrote:
| is there vector graphics support of any kind?
| laurmaedje wrote:
| Yes, SVG support is built-in.
| DominikPeters wrote:
| Is there a larger example output pdf available, to be able to
| compare to latex?
| miloignis wrote:
| Yes, the thesis introducing the language is typeset in Typst:
| https://www.user.tu-berlin.de/laurmaedje/programmable-markup...
| lifeisstillgood wrote:
| Ok. Most STEM students find themselves at one point diving deeper
| into LaTeX than the actual report subject they are writing.
|
| But developing your own replacement to LaTeX is whole new level.
|
| Nice one :-)
| swyx wrote:
| i wonder if gpt4 eases that pain a bit
|
| i suspect it does for basic usecases but will still be ultra
| painful for advanced ones
| sebzim4500 wrote:
| GPT-4 probably makes it much easier to write, but modifying
| latex will still be a pain. Unless you want to copy it into
| another window, tell ChatGPT what modification you want, and
| then copy it back.
| varenc wrote:
| .tex files work fine in VSCode with the Copilot AI
| integration. Haven't tried actually writing LaTeX with it
| but some cursory investigation shows that it seems to be
| working well. I suspect it'll perform decently for basic
| modifications!
|
| (Side note: it's always impressed me how Copilot works well
| in even the more obscure languages)
| codetrotter wrote:
| > Unless you want to copy it into another window, tell
| ChatGPT what modification you want, and then copy it back.
|
| There will be no copying. Plug-ins exist or will exist,
| such that you will be able to ask GPT-4 directly from
| within your editor and the plug-in will pass the contents
| of the document or selection alongside your prompt.
| Conversely the plug-in for your editor will replace the
| contents of your document or selection with the output of
| GPT-4.
| mananaysiempre wrote:
| Do note[1] that TeX itself was written as a result of Knuth
| being unsatisfied with the typesetting of then-newly reissued
| volume 2 of TAoCP. I don't know if Lamport encountered the same
| yak with LaTeX, but I do know he's a distributed systems
| researcher, not a programmer in a relevant area :)
|
| [1] https://yakshav.es/the-patron-saint-of-yakshaves/
| bombcar wrote:
| LaTeX was and is just a collection of macros on top of TeX.
|
| Few people have every used TeX itself, compared to the
| massive amounts who have used LaTeX; but if you haven't used
| raw TeX you should try it sometime; it's surprisingly how
| simple and powerful it is.
| jkepler wrote:
| I agree. However, it can be tough finding documentation how
| to use plain TeX. I find that increasingly I'm using OpTeX,
| which is a much smaller set of macros than LaTeX, simpler
| this use, understand, and reason about.
|
| https://petr.olsak.net/optex/
| mananaysiempre wrote:
| > However, it can be tough finding documentation how to
| use plain TeX.
|
| I hate to be that guy, but... the _TeXbook_ works and
| recently (finally!) had an official ebook release,
| illustrations and all. It's a peculiar value of "works"--
| personally, I had to be stuck home sick for a couple of
| weeks with no reading material to get through it from
| beginning to end, it doesn't really start to get
| rewarding unless you get through at least half of it or
| so, and I went away from it thinking that I like neither
| Knuth's way of writing nor his approach to programming
| language design ("computers follow rules"). But it still
| has a lot of helpful stuff.
|
| When it comes to more systematic descriptions and
| connections with more conventional programming-language
| ideas (it took me some time to recognize that TeX uses
| what is essentially dynamic scope throughout), I like
| _TeX by Topic_ [1].
|
| [1] https://www.eijkhout.net/tex/tex-by-topic.html
| bombcar wrote:
| The TeXbook works well - but many people don't really
| know what they really want to make it look like, and want
| guidance - which is what LaTeX provides.
|
| TeX itself is quite powerful, but you end up finding
| you're reinventing a macro package.
|
| But you can use it basically as markdown and it formats
| things quite well.
| jbaber wrote:
| I ended up using plain TeX because I learned from Spivak's
| _The Joy of TeX_. It teaches AMS-TeX which is just a thin
| veneer on top of plain. Before I stopped shaving the yak, I
| 'd setteled on eplain which was just enough to make plain
| really practical.
| einpoklum wrote:
| So, I'm a moderately-experienced LaTeX user. What is the argument
| for me switching to typst? I read the repository's README, and
| would be tempted to consider it as a complete newbie with limited
| needs, but I couldn't find the compelling argument for ditching
| (La)TeX in favor of this. Especially given the size of the LaTeX
| community and availability and accessibility of (sometimes hacky)
| LaTeX solutions for a zillion situations.
| YoumuChan wrote:
| Apart from writing papers, I also use LaTeX to make
| presentations accompanying the papers (beamer). I make heavy
| use of tikz to create figures (I work in geometry-related
| field). The workflow is painful (slow compilation, bad overleaf
| support) to say the least. If typst could meet this need in the
| future (seems lacking at the moment), I won't hesitate to make
| a switch.
| jcparkyn wrote:
| For me the biggest ones are:
|
| 1. Compilation is ridiculously fast. 2. The language is miles
| more intuitive, and doesn't require nearly as many hacks. In a
| handful of hours using typst I've written much more interesting
| things than I ever would've attempted using latex macros. This
| might be less important for you, but my latex usage is
| intermittent, so I've always forgotten it by the next document
| I write.
| einpoklum wrote:
| And do the intuitiveness and speed not come at the expense of
| some expressive power limitation?
| it wrote:
| I've long enjoyed quality results from LaTeX, and now I can get
| that with something more like the ease of markdown. Thank you!
| Kuraj wrote:
| Looks like LaTeX with the learning curve of Markdown, which is
| fantastic. I will definitely be using this at some point.
| miloignis wrote:
| Very cool, thank you for open sourcing it! I'd like to try it out
| for documenting formal semantics of programming languages, and
| this FOSS release makes me comfortable doing so :D I found the
| paper describing the system very interesting when it was on HN
| before:
|
| https://news.ycombinator.com/item?id=34423590 - Typst: A
| Programmable Markup Language for Typesetting [pdf]
|
| previous discussion of website:
|
| https://news.ycombinator.com/item?id=32209794 - Typst: Compose
| Papers Faster
| JustSomeNobody wrote:
| LaTeX _is_ modern. As well as timeless.
| BrandonS113 wrote:
| Its doomed to failure.
|
| Latex is horrible but makes beautiful documents and the relevant
| world either uses latex or Mircosoft Office. Why use anything
| else? Latex lives by the community of people who use latex for
| their work and to collaborate. All know 20 year old latex
| documents will be compilable in 20 years. No competitor outside
| of Microsoft can survive that.
| Gualdrapo wrote:
| It's all about use cases.
|
| I as a graphic designer have been using ConTeXt for more than
| 10 years now, and I think it's amazing for producing more
| 'custom' documents and handling typography and stuff. LaTeX and
| Word fall too short in that purpose.
|
| I guess Typst more of a tool oriented for programmers and
| computer science people as it seems targeted to give some
| programming power right into their documents. I may be wrong,
| but I don't see LaTeX that approachabe from that way (unless
| you have a decent knowledge of TeX and you are not prone to
| headaches caused by backslashes).
| dccsillag wrote:
| > All know 20 year old latex documents will be compilable in 20
| years.
|
| Except it's not. For example, in 2021, the NeurIPS template
| compiled differently in different versions of TeXLive
| (https://tex.stackexchange.com/questions/598567/different-
| pdf...). To my knowledge this change of behaviour has not been
| addressed in TexLive.
|
| > Latex is horrible but makes beautiful documents and the
| relevant world either uses latex or Mircosoft Office. Why use
| anything else?
|
| And why invent anything new when there are already existing
| alternatives? Why invent C++, Rust, Zig when there already was
| C? Why invent Clang when there already was GCC? Why invent Git
| when there was already CVS? And so on. (Maybe not the best
| examples, but that's what I could think of on the spot.)
|
| The point is that there are aspects in which the current
| solutions (in this case, LaTeX) fails, and new systems can
| address them, since they tend to have much more liberty in the
| design space than the older system.
| piz wrote:
| > Its doomed to failure.
|
| Let's agree to disagree. So many people can't use LaTeX
| properly because it's too esoteric and dream of using something
| different than Office.
| WolfOliver wrote:
| In my opinion, markdown, LaTeX, HTML, ... is all a cognitive
| overhead distracting you form writing your content. That is why I
| started to work on MonsterWriter [1]
|
| [1] https://www.monsterwriter.app/
| kzrdude wrote:
| I like programming, so the "programming" parts of latex are
| just a procrastrination trap for me. I'd like something that's
| not programming please.
| SCLeo wrote:
| So far, my favorite thing about it is matching parentheses scale
| automatically. No more \left(\right) nonsenses.
| justeleblanc wrote:
| Except that \left\right is almost always the wrong solution.
| It's one of my pet peeves when collaborating on papers. Your
| parentheses shouldn't scale all the way up and down your
| equation, unless you want them to be disgustingly tall (just
| try \left( \int_0^1 \frac{dx}{x} \right) to see what I mean).
| You should choose \big[lr], \bigg[lr], \Big[lr] or \Bigg[lr]
| based on what looks good, and the computer is not good at
| guessing which one will be visually pleasant.
| kzrdude wrote:
| Their size order seems to be \big, \Big, \bigg, \Bigg
| windowshopping wrote:
| Can you show an example of what you mean by "scaling
| automatically"?
| shwestrick wrote:
| in latex, when typesetting math, by default, parentheses (and
| other brackets) are always a constant height. So if you put
| something which is taller than one line in between
| parentheses, it will look strange, with the content sticking
| out past the parentheses at the top and/or bottom.
|
| The fix for this (in latex) it to mark pairs of matching
| parentheses with the macros `\left` and `\right`, (for
| example: `\left( \frac{x}{y} \right)`) which informs latex
| that it should figure out how tall the content between the
| brackets is, and then resize the parentheses appropriately.
| airstrike wrote:
| I'm not really into LaTeX but I am really into the specific
| problem of authoring documents with a certain (user-defined)
| look-and-feel by leveraging some (very user-friendly) DSL that is
| close to markdown but with more features
|
| Does Typst support themes so that I can achieve that? Are there
| other tools I should be aware of?
|
| Are there tools that do all of the above and have themes defined
| as CSS?
|
| I'm aware of RMarkdown + Knitr which is a fantastic combo (and
| honestly my inspiration for digging into this problem) but that's
| obviously still too much "programming" for wider adoption
| V__ wrote:
| If you don't have high typesetting needs, maybe WeasyPrint fits
| your use case.
|
| [1] https://weasyprint.org/
| airstrike wrote:
| Oh my god, this is fantastic. It doesn't solve the DSL part
| but it does solve the output-to-PDF-using-CSS part. They also
| seem so nice!
|
| I guess I can clobber together my own DSL and then run with
| this. I can't thank you enough
| V__ wrote:
| Glad to be of help. Just out of curiosity, what's your use
| case?
| airstrike wrote:
| Starting my own company to solve other people's use cases
| :-)
|
| I'm a business "end user" who also loves programming.
| After 10+ years being a part of both worlds, I feel like
| I have a very strong vision for how these tools _should_
| work, so I 've decided to build my own. It's a daunting
| task, but if I can leverage existing tools, maybe it's
| just a matter of gluing everything together neatly
| xico wrote:
| I really like the default choices (floor as a "function", lots of
| latex heritage, ...). The first example is a bit weird though:
| the word "The" is not left aligned as it would be in a
| typesetting system, taking perception into account, but merely
| bounding box aligned with the word below. In practice the
| beginning of the sentence looks slightly off to the right.
| Sharlin wrote:
| While we're nitpicking, the space between the heading and the
| body in the example (ie. the line height of the heading) is too
| narrow and makes the first line look cramped.
| rrishi wrote:
| It's written in Rust!
| Rochus wrote:
| RIIR
| dang wrote:
| Related:
|
| _Typst: A Programmable Markup Language for Typesetting [pdf]_ -
| https://news.ycombinator.com/item?id=34423590 - Jan 2023 (53
| comments)
|
| _Typst: Compose Papers Faster_ -
| https://news.ycombinator.com/item?id=32209794 - July 2022 (30
| comments)
|
| _Typst: Compose Papers Faster_ -
| https://news.ycombinator.com/item?id=32205005 - July 2022 (1
| comment)
|
| Also
|
| _Writing an Incremental Typesetting Engine_ -
| https://news.ycombinator.com/item?id=33215909 - Oct 2022 (0
| comments, but looks interesting)
| 2h wrote:
| does not build for Windows:
|
| https://github.com/typst/typst/issues/99
| sho_hn wrote:
| There's also Sile: https://sile-typesetter.org/
|
| LaTeX (Well, LuaTeX) powers my E-ink newspaper
| (https://imgur.com/a/NoTr8XX), but I've been curious to use it as
| a vehicle to try out some of these alternatives and see if they
| can put together a non-trivial layout.
| guax wrote:
| This is awesome! Now I want to build one.
| kingds wrote:
| coffee stain is incredible lol
| sho_hn wrote:
| :) Thanks!
| TRiG_Ireland wrote:
| SILE also has an XML format. (That is, SILE can read arbitrary
| XML and format it according to document class rules, but also,
| separately, SILE itself has an XML format.) https://sile-
| typesetter.org/manual/sile-0.14.5.pdf#page=27 This
| theoretically makes it easier to use a GUI editor, or to output
| XML SILE documents from, say PHP (invoices from a webshop, for
| example).
| mananaysiempre wrote:
| Also Scribble[1] / Pollen[2] (Racket, extensible in same) and
| Patoline[3] (O'Caml, extensible in same).
|
| [1] https://docs.racket-lang.org/scribble/
|
| [2] https://docs.racket-lang.org/pollen/
|
| [3] https://patoline.github.io/
| UncleEntity wrote:
| I wonder if using Bluetooth LE would use less power as you
| wouldn't have to connect to a hotspot?
|
| The display could wake up and ping the raspberry pi which would
| send it the new image and everyone goes back to sleep until the
| next morning.
|
| Probably doesn't matter all that much but if you wanted maximum
| battery life, maybe?
| sho_hn wrote:
| Might be worth trying :-). BLE has the lower data rate so the
| transfer takes overall longer, though. Wonder how that adds
| up.
|
| I already have tuned things to lower the RF power output of
| the esp32 Wifi habitually - there's a Fritz Wifi repeater
| just across the room in a corner with near line of sight, so
| the little thing doesn't exactly have to strain to reach the
| hotspot.
|
| Also curious how the optimized -S3 and the upcoming -C6 do in
| the various transfer/power equations.
| tarsiel wrote:
| Wow this is cool! I made a sort of similar e-ink display piece
| that shows your current song on Spotify -
| https://github.com/CampbellOwen/NowPlaying. Your project is
| making me want to try another e-ink project! I'm especially
| impressed with the overall polish of the enclosure and
| hardware, that's always my weak point.
|
| I saw you mentioned you wrote a custom driver for the display
| controller. I'm curious how you found that process? I got the
| feeling a lot of these devices aren't documented very well, but
| that sounds like a fun project to tackle.
| sho_hn wrote:
| "Driver" is in all honesty a bit overly braggy!
|
| Technically it's a driver, but in practice I'm just talking
| over a chip via SPI. It's weird and quirky SPI - I think this
| chip originally just had an I80 interface (Intel 8080
| protocol) and then they added a SPI frontend that internally
| translates to I80. That means you have to SPI with I80-ish
| chip select semantics etc. which is not what the SPI APIs in
| the ESP-IDF or Arduino frameworks do by default (leading to
| things not working unexpectedly), so I had to "bit-bang" CS.
| Aside from quirks like this it was pretty simple and just
| following the datasheet to stream the right commands and
| data.
|
| One thing that made it functionally worth it (aside from the
| hacking fun and learning) is that E-ink panels perform best
| if run at a particular drive voltage ('VCOM') that is
| determined at manufacturing time and attached as a little
| sticker to the flex cabling sticking out of the unit. I
| stumbled upon this while reading various data sheets, and as
| a result my custom code will set the correct voltage, driven
| by config. If I had used a random lib I probably wouldn't
| have encountered this.
|
| That said, I've found there's very cool projects out there
| that go a level deeper. Instead of using an EPD controller
| like the IT8951 as a convenience, this project runs E-ink
| panels directly off a MCU by implementing the waveforms
| directly: https://github.com/vroland/epdiy
|
| After reading the panel datasheets I find that approach quite
| interesting, and am considering doing fresh Rust impl of that
| as well.
|
| The Spotify project looks cool! I dig the dithering style.
| Would like to try a multi-color panel as well.
| tarsiel wrote:
| Thanks for the reply, that's great info! I'll keep an eye
| out for the VCOM stickers, I had no idea that was a
| concern.
|
| The waveshare e-paper screens I'm using come with some
| decent sample code for driving them, and I just found this
| Rust implementation that looks interesting as well
| https://github.com/caemor/epd-waveshare.
|
| I do agree with you though that the idea of driving them
| directly with the waveforms sounds quite fun. I've seen
| some interesting stuff online where people have been
| customizing the waveforms to get even more performance out
| of them (maybe partial refresh would be fun to look into as
| well).
|
| As someone who's only exposed to embedded development in a
| hobbyist way, that epdiy repo looks quite useful, thanks
| for linking that.
|
| Now to find the time to add on yet more personal projects
| :)
| ibn_khaldun wrote:
| Name checks out. This is awesome.
| abdullahkhalids wrote:
| Latex is "typesetting-complete". This language is not, so it's
| not a replacement. For instance
|
| * The syntax does not use escape sequences for functions/symbols,
| i.e. phi instead of \phi or floor instead of \floor. You will
| inevitably run into situations where, for instance, you want to
| write the letters phi, and have to resort to some ugly hack to
| write the natural language. This is not okay.
|
| * There is reasonable syntax for text-formatting in bulk (whole
| paragraphs), but if you want to format a single word or sentence,
| the syntax seems to involve way too much work.
|
| A side concern: This uses a mix of markdown-style formatting
| (asterisks for bold text) and programming style formatting.
| Personally, I think this makes it difficult to visually parse
| complex documents.
| kirillbobyrev wrote:
| > Latex is "typesetting-complete". This language is not, so
| it's not a replacement.
|
| Based the documentation (and the title), it isn't meant to be
| _a replacement_, but rather _an alternative_ and that's totally
| OK. Not everything needs a drop-in replacement.
| m4lvin wrote:
| > i.e. phi instead of \phi or floor instead of \floor. You will
| inevitably run into situations where, for instance, you want to
| write the letters phi, and have to resort to some ugly hack to
| write the natural language.
|
| I thought exactly the same: What if I want to write the product
| of f,l,o,o,r? Well, the "ugly hack" is explained in the readme:
| You just write "floor" with quotes instead of floor. Seems
| alright to me ;-)
| elteammate wrote:
| [dead]
| alephaleph wrote:
| this isn't even a hack -- in Typst you write `$a b$` for
| implicit products, `$ab$` is always parsed as an identifier
| and you'll get a compile error if its not defined.
| LelouBil wrote:
| > The syntax does not use escape sequences for
| functions/symbols, i.e. phi instead of \phi or floor instead of
| \floor. You will inevitably run into situations where, for
| instance, you want to write the letters phi, and have to resort
| to some ugly hack to write the natural language. This is not
| okay.
|
| Down in the README it's written that you need to put
| identifiers into quotes to write them in math blocks
| laurmaedje wrote:
| If you want to write the letters phi, you can write p h i if
| you mean implied multiplication or "phi" if it should be a
| single unit. In general, Typst's syntax is designed to make
| every sequence of characters expressible, just like TeX.
| datadeft wrote:
| I need 80% of LaTex with 10% of its problems. Typst, could be
| exactly that.
| alephaleph wrote:
| The first bullet point is incorrect. In normal text, you use #
| for functions and symbols, i.e. #sym.phi or #emph. In math
| blocks, you don't use # for stuff like phi or floor but that's
| because it interprets everything as a function or symbol, with
| an exception for single letters. If you want _any_ plain text
| in a math block, whether it 's a function name or not, you just
| put quotes around it. If you want implicit multiplication, you
| need spaces between each letter.
|
| I also don't know what you mean by the second bullet point. If
| you want repeatable single word or sentence formatting, you can
| define a function for it, which there is easy syntax for.
| abdullahkhalids wrote:
| > If you want any plain text in a math block, whether it's a
| function name or not, you just put quotes around it.
|
| Math fonts and plain text fonts should be different. If you
| put quotes around something, you get plain text font.
|
| > If you want implicit multiplication, you need spaces
| between each letter.
|
| Probably the first rule of any good typographical system is
| that it should not force the user to change how they normally
| write (barring special exceptions). Any syntax for typography
| should be additional to this, which is why escape syntax is
| so good. Forcing the user to put spaces between variables is
| a no go.
| dark-star wrote:
| We had programming languages that didn't require spaces
| back in the 80s. It led to code like this:
| 10 IFA=3ANDB=5THENPRINT"HELLO"
| lapinot wrote:
| I'd encourage you reading through the thesis explaining the
| decisions and the thing in details. Just did skimmed through
| myself and all your concerns are easily answered
| (https://www.user.tu-berlin.de/laurmaedje/programmable-
| markup...).
|
| Your first concern is just wrong, afaik content and code live
| in different syntactic worlds. Code in content has a "#" sigil
| (and ends at some point) and content in code is delimited with
| square brackets. Your second concern is weird. For one off
| things you definitely just wrap it in a function call
| `#myweirdthing[blabla]`.
|
| Last remark: you're bikeshedding. Seeing your previous remarks
| i'm not sure you should. Makes complete sense to have a simple
| powerful syntax and a handful of shortcuts for markdown-level
| common typography.
|
| I'm absolutely not affiliated btw, just thought about very
| similar stuff for some time and been waiting for the release. I
| would've done a couple things sightly differently but the big
| decisions look very sensible and i'm sure they thought about it
| for a long time. Good work releasing this and thanks for the
| free software work!
| mrazomor wrote:
| LaTeX is simple if you:
|
| - have a good template (most of the conferences & some other
| parts of academia provide this),
|
| - use a decent IDE (many LaTeX editors I tried in the past were
| great, now I'm fine with just vim),
|
| - stick with the basics (text, tables, formulas, images; it's
| easy to Google it).
|
| The last point is what matters the most. As soon as you want to
| change the margins, stylize the table in a different way, tune
| the text so it looks exactly as you imagine, is when things get
| complicated. People expect M$ Word and get frustrated with LaTeX.
| From what I see, Typst solves this in a different way -- it
| doesn't provide the ability to do that (yet, when it provides it,
| it will become as complicated as LaTeX).
|
| Why even learn LaTeX or TeX? The Internet is full of recepies.
| That all you need. Why learning new syntax for formulas when you
| have a mountain of resources about LaTeX formulas to typeset
| anything you need.
|
| There are a few "solved problems" in computer science, and
| typesetting documents is one of them. The progress is made by
| building TeXmaker, TeXstudio, TeX Live, MiKTeX, XeTeX, LuaTeX,
| etc. Not segmenting the space.
| piz wrote:
| > There are a few "solved problems" in computer science
|
| It's like saying transport is solved when the wheel was
| invented. Yes LaTeX is great, but it lacks so many decent
| things, such as good error message, or incremental compilation.
| Typst is going in the right direction, not segmenting the
| space.
| alephaleph wrote:
| I don't think the fact that you need to look up and copy
| recipes and download packages to do most complex formatting is
| a strength of LaTeX, and one of Typst's stated design goals is
| to make formatting composable enough that you don't need a
| package for everything. But guess only time will tell whether
| that works out.
|
| The other selling point you're missing though is that Typst's
| compiler is designed for fast incremental compilation, which
| makes the Typst live preview and Multiplayer/Google Docs-style
| collaboration experience significantly nicer than Overleaf's,
| where a change to a large document could easily take 30 seconds
| or more to render.
| mrazomor wrote:
| Typst still has a syntax that one needs to learn (or Google
| it).
|
| Overleaf's slowness is not a LaTeX issue. I was using LaTeX
| IDEs with near-instant previews more than 10y ago.
|
| Then again, why such emphasis on the preview? Both LaTeX and
| Typst are not WYSIWYG. The content is already in front of
| you. There's space for improvement, but building new systems
| is not the most optimal solution.
| maweki wrote:
| As a computer science researcher, I have hundreds of LaTeX
| macros, basically a DSL for my specific field of research, where
| I more or less write out natural language and it comes out as
| formulae with all the specific symbols and stuff.
|
| I think for people who write LaTeX in this kind of professional
| capacity, the macro language is the killer feature.
|
| But I could see fields light on formalism embracing something
| like this over Ms word, if there was a nice Toolchain for
| collaborative writing and versioning.
| charlieyu1 wrote:
| Writing LaTeX macros to do something useful is hard. While this
| particular new system has functions as native object.
| nmca wrote:
| Typst supports macros/functions, more pleasantly than Latex
| too!
___________________________________________________________________
(page generated 2023-03-21 23:01 UTC)