Top
Best
New

Posted by zahrevsky 1 day ago

LaTeX Coffee Stains (2021) [pdf](ctan.math.illinois.edu)
379 points | 91 comments
spudlyo 1 day ago|
I'm surprised nobody has yet mentioned how pleasant it is to create coffee stains using Typst, and if only LaTeX wasn't the de-facto standard in academia and stain-related journals, they would have already switched to it.

Of course, you can create coffee stains in HTML as well, but it's not something you can do in Markdown.

bachmeier 1 day ago||
I've been rewriting all my papers in Rust. It's been a pleasant experience getting memory safe coffee stains on my papers.
vlod 1 hour ago|||
Surely coffeescript would have been more appropriate?

[0]: https://coffeescript.org/

anu7df 1 day ago||||
Does coffee accelerate rusting?
semi-extrinsic 1 day ago||
Depends on the acidity.
tristanlukens 12 hours ago||||
Blazingly fast papers!
throwaway17_17 18 hours ago|||
I know it was probably said just as a joke, but are you really writing papers using Rust? I don’ t use Rust, BUT if you’ve got a better way to write symbol heavy type theory and/or logic than having to make PNG’s and put them in as images in a word processor I would love to hear about it.
eru 16 hours ago||
You might like what people have cooked up with Racket.
fourthark 1 day ago|||
Thankfully there is a Typst port of this package!

https://typst.app/universe/package/fleck/

philistine 1 day ago|||
That package still has the core limitation of Typst: images can only be placed top-middle-bottom and left-centre-right. Typst still has yet to support arbitrarily placed images.
doerig 23 hours ago||
You mean absolutely positioning it? You can do that with the place function and displacing it with dx/dy from the origin (https://typst.app/docs/reference/layout/place). Example: #place(top + left, dy: 2cm, dx: 4cm, image("image.png"))
philistine 21 hours ago||
That seems usable for manual layout, but it looks painful to use to place images without knowing exactly where they might end up on a page. I reuse my LaTeX code to make volumes of books, and I never touch the code. It's fire and forget for me, which this does not seem to solve.
tcfhgj 20 hours ago||
> but it looks painful to use to place images without knowing exactly where they might end up on a page.

they end up exactly at the specified location?

antonvs 19 hours ago||
Presumably they're referring to the ability to parameterize the target page size. In that case, absolute coordinates don't work well (if at all).
philistine 16 hours ago|||
Parameterize! That's a new word I didn't know. It adequately describes how I typeset my books, and I must not be alone. The ability to tell LaTeX to drop a picture around here, to the best of its ability, with the possibility of moving it down a paragraph or two if it doesn't fit is vital for me.
kzrdude 8 hours ago||
I think that's a missing feature of Typst yes, to have figures be either "here" or "top next page" automatically, with that priority. It can't do that. The confusing part was that this has nothing to do with the images of this coffee stain package, because they are foreground/background and can be placed freely on the page (any corner or any custom offset from any corner; i.e from top left corner you can use page coordinates).

The coffee stains overlay/underlay text, so no layout problems at all.

mr_mitm 12 hours ago|||
But the dx/dy arguments also take percentages besides absolut lengths. I still don't get what the the other poster means by that fundamental limitation. I think they're confused about absolute positioning of background images vs floating figures. But typst has the analog setting of `[htbp]`, so the same "fire and forget" workflow is possible.
widforss 13 hours ago|||
> two splashes with light colours

Blood. That's blood.

alexitosrv 1 day ago|||
Typst requires a signup? It's web? It says developed in the open, but the main page also offers a login. What can you about latex vs typst?
buo 1 day ago|||
The compiler is open-source and can be run locally. You need an account if you want to use their web editor, which is nice (it shows error messages where they occur along with an explanation and link to docs, and also shows a real-time updated preview).

As for Latex vs Typst, as a language Typst is much better, compiles very quickly, and has sane error messages. However, Typst still has a few rough edges, and can't do everything you can with Latex + packages (yet).

I've been using Typst for most of my documents for a few months and I've been generally happy with it.

cbolton 7 hours ago||
You can use the online editor without login: https://typst.app/play/
tombert 20 hours ago||||
I have never really used the web thing personally. I always use the command line version, and it works perfectly fine and it's FOSS.

I find the syntax to Typst to be generally better than LaTeX. I don't like its equations as much, but Typst has one huge advantage that makes it easier to forgive its faults: it compiles several orders of magnitude faster than LaTeX. This might not sound like much but it honestly sort of changes how you even think about problems. I keep Neovim open on the left, run `typst watch` in the background, and Evince on the right, and my updates show up immediately upon saving.

Also, adding plugins and libraries is trivial. All you have to do is declare it at the top of the file and it will automatically fetch it, which is considerably easier than LaTeX.

I don't like the default font it ships with, but it's easy enough to add a Latin Modern font and get something that looks like LaTeX.

Before Typst, I had typically been using Pandoc with Markdown to write my documents, and that served me well for quite awhile, but it had the disadvantage of being extremely slow to compile. A slide deck that I gave last year [1] would take a bit more than a minute to compile. This became an issue because I had to make a few small last-minute changes and having to wait an entire minute to view them actually made it so I was really pushing against the wire.

If I had done my slides in Typst, they would have compiled in about 40 milliseconds, they wouldn't have looked any worse, and I'd have a syntax not dissimilar to Markdown. I'm pretty much a convert at this point.

[1] https://git.sr.ht/~tombert/lambda_days_2025

ted_dunning 1 day ago||||
No. Typst is an open source application.

There is a very prominent web site that offers a hosted version without much clarity about the fact that you can run it yourself. The hosted version offers collaborative editing similar to what Overleaf provides which is incredibly useful.

See https://github.com/typst/typst for the CLI version

There is a page with pre-compiled binaries as well and on Macs, you can install using homebrew.

_flux 1 day ago||||
The financial aspect of the project is the service they sell, core is open: https://github.com/typst/typst

What the core lacks is the web service that offers e.g. collaborative editing.

quantummagic 1 day ago||||
Typst is an application you can use on your local machine without any signup. The compiler is hosted on GitHub. The Typst web app (the online editor at typst.app) is closed source and offered as a paid with cloud storage, collaboration, autocomplete, etc...
kzrdude 1 day ago|||
You can start using typst by installing it using rust tooling (that's one way to install it): `cargo install typst-cli`

Or install it using vscode's extensions, or install it for neovim using mason. That's a few commonly used distribution paths.

__mharrison__ 15 hours ago|||
I know it would be easier in typst than using this library... Ducks.
asimeqi 1 day ago|||
The best coffee stains by far are created directly in Postscript.
ahazred8ta 1 day ago|||
Hanno's original coffee ring page from 2009. https://web.archive.org/web/20100719202509/http://hanno-rein...
ihaveajob 1 day ago||||
I'd say the best ones are created by coffee...
jbrnh 22 hours ago|||
There was the GIMP Coffee stain filter (though it looks like it is not included in Gimp 3). https://docs.gimp.org/2.10/en/script-fu-coffee-stain.html
mrichman 1 day ago||
I came here to say this! I switched to Typst a couple of months ago and won't be going back.
Rygian 1 day ago||
Feature request: even/odd page stains that line up exactly as a single thru-stain.
aDyslecticCrow 1 day ago|
slightly fading for each page.
blitzar 1 day ago||
Page reordering for the inevitable large scale spill and hurried cleanup.
pdpi 1 day ago||
Everybody knows that coffee stains are the only surefire way to tell whether a paper has been read or just printed out and ignored. A colleague in uni (way back in early 00s) would add these to her documents every once in a while to give them the "has been read" stamp of approval.
cossatot 1 day ago|
And wine glass stains are the only way to know your paper has been graded.
pwagland 22 hours ago||
And tear stains, or the lack thereof, are the only sure sign of quality.
Drunk_Engineer 1 day ago||
Possibly related:

https://badspot.us/Brown-Ring-of-Quality.html

TwoFx 1 day ago||
Maybe I'm just missing the joke, but it feels worth pointing out that almost all of the logos on that page are clearly inspired by the ensō circle from Zen art.
amelius 21 hours ago||
Putting a circle around your logo is about as silly as putting a horizontal line under your signature.
ravila4 1 day ago||
This looks nice, but it is just placing some pre-defined vector files. I wonder if it could be possible to procedurally generate realistic coffee stains.
ted_dunning 1 day ago|
Absolutely!

Go for it!

lelandfe 20 hours ago||
Originally from 2009: https://web.archive.org/web/20201101013903/http://legacy.han...

Previously: https://news.ycombinator.com/from?site=hanno-rein.de and https://news.ycombinator.com/item?id=39316193

This also reminds me of https://news.ycombinator.com/item?id=30024165

jprezant 3 hours ago||
This is a good read for similar "fun" packages: https://tex.stackexchange.com/questions/67656/are-there-othe....
Vicinity9635 17 hours ago||
Love this. My resume has been in LaTeX for over 20 years now.

Underappreciated IMHO. You can version control it, no dealing with wild Word shenanigans. Totally deterministic. Just find a style, insert your bullets and you have a nice sharable PDF.

Nowadays you can even have your preferred LLM do the conversion for you. LaTeX is finicky and I've had it fix warnings in mine that I couldn't be bothered to.

Good stuff, highly recommend a LaTeX resume, whether or not you drink coffee.

Nitrolo 7 hours ago||
Any particular template you'd recommend? My resume is LaTeX too but I'm not 100% happy with it (about 98% happy and much happier than with anything else however).
Vicinity9635 6 hours ago||
I can't find the one I used now. But I just searched "latex resume template" and picked one that I liked. Some good ones at https://www.overleaf.com/gallery/tagged/cv
benttoothpaste 5 hours ago||
Totally agree! I'm adding the coffee stains to my resume as we speak.
kubb 1 day ago||
Not drinking coffee is the only reason I’ve ever felt truly excluded at a software company. Everyone loves their coffee!
nitnelave 22 hours ago||
You need to go all-in on tea and make your own mark. Get a fancy Chinese teapot with holes in the spout to use loose leaf tea, and start getting snobby about traditional vs modern techniques of Pu'er tea, and you'll get your own brand of respect!
bombcar 1 day ago||
I'm in the same boat; I can pretend with tea but it's not really the same experience.

Diet soda sometimes works, but often isn't provided as easily.

pureagave 1 day ago|
This is wonderful to see. I was a student and then entered into the tech industry in the mid 90's and at that time the Internet had fun whimsical things like this almost weekly.
mcswell 1 day ago|
Obviously this was whimsical when it came out. However...we were creating synthetic data for training and testing OCR in multiple scripts. We would take a web page in some language with a non-Roman script, and reproduce it as multiple PDFs using different fonts. We also added various kinds of blurring, using ImageMagick and---of course---this very coffee stains program!
More comments...