Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Add coffee stains to LaTeX documents (2021) (ctan.org)
501 points by todsacerdoti on Feb 9, 2024 | hide | past | favorite | 140 comments


View an example here: https://ctan.math.utah.edu/ctan/tex-archive/graphics/pgf/con...

Maybe the hue is off, or its a different roast or beans, feels less coffee, more science murder mystery?


> This page was intentionally left blank but we had to ruin it by letting you know.

Brilliant!


              This page intentionally left blank.

  (Well, not completely blank, since the above non-empty disclaimer
  appears on the page.  What is meant is that this page is devoid
  of meaningful content related to the rest of the document.  This
  page serves only as a separator between sections, chapters, or
  other divisions of the document.  This page is not completely
  blank so that you know that nothing was unintentionally left out,
  or that the page is not blank because of an error in duplication,
  or that the page is not blank because of some other production
  problem.  If this page were really blank, you wouldn't be reading
  anything.  This page has not been left blank by accident, but is
  left non-blank on purpose.  The statement on the page should say

         "This page was intentionally left non-blank".)
http://www.tytempleton.com/rhf/jokes/93q1/nonblank.html


My favorite was with two sides of a blank page in a document. One side read "This page is intentionally left blank", and the other side read "This page isn't."


I always liked the self-contradictory nature of "This page was unintentionally left blank."


Plot twist: the printer accidentally added the [non-]blank page.


Plot twist: the "blank page" hides internal information and a parting employee's rant against the boss in an official company publication and you only find out weeks later because of strange search engine results.

(No, definitely not triggered.)


thanks for this site!


Aw, these don't look nearly as good as I hoped.


This seems like the sort of thing that happens when one repeatedly tweaks while using the previous iteration as a reference. It might feel like most iterations improve on what came before, but before long one loses the connection to the original reference.

I think Deming compared it to the telephone game.


The recent project of the darktable developer to ansel shows this happening in other open source projects too.


Some of those are wine stains. The pkg does both.


Probably replicating when you scan the paper


yeah the color if off and you can see that it's obviously a vector graphic... it's kind of posterized


I wonder if blurring the edges of the shapes within the stain might help make it look more organic


I was hoping to see dark outlines and a light interior.

https://www.scienceabc.com/pure-sciences/why-are-coffee-stai...


Stains need to be subtler/fainter, waterier, with grain specks


hard to judge on a screen how they will look printed


Would you please print a copy and take a picture of the page laying on a wooden table and then copy/paste the result into a Word docx?

It's the only way to know for certain.


Maybe CMYK colour with no associated profile?


Thanks for linking to that. Really confused why the ctan pages don't.


They do, it’s the ‘English documentation’ link.


First few stains look a bit poopy. And last one a bit murdery. None of them look very covfefe.


Agreed, I was expecting something a bit more like this:

https://geekhack.org/index.php?action=dlattach;topic=102580....


What keyboard is that?


Could be literally any tenkeyless mechanical keyboard, hard to tell from whats in the picture.

I recommend a Keychron k8 as a good entry point if you like the format, been using it for a few years as my main one at home with a K6+little folding laptop stand for anytime I'm staying out of the house for any extended length of time.

k8 - https://www.amazon.com/dp/B08B5WHYTT/ k6 - https://www.amazon.com/dp/B07ZT7W5FP


That‘s the comment I expect on a site named Hacker News


If you're looking for the game ending keyboard you need this one. https://www.aliexpress.com/i/3256803782645256.html

Any mechanical switch, on its own key mount moved on a split or single magnetic board. I suggest split.


Anyone looking for custom keyboard inspiration, look no further than https://kbd.news/.

I personally went for the Stront split keyboard. https://github.com/zzeneg/stront


That looks amazeballs. What I wanted my whole life.

Is it good though or is it impulse buy ewaste that just looks cool?


It is very good. USB-C as well. Here's some English marketing https://www.velocifiretech.com/products/dumang-dk6-ergo-v2

The magnets are not weak and do not dislodge easily. I do not care about any keyboards unless it's better than this one. If anyone knows a better one let me know! I think they said they're working on a mouse or something like other input options a while ago, but I haven't heard of anything new but I haven't checked either.


That page says the software is Windows-only. Is the software just for the setup? Or would this be impossible to use on Linux/Mac even after configuring it?


It is just for configuration, I think there is a way to do it unofficially I didn't configure it on Linux but it was plug and play. Someone made this for Linux. https://github.com/mayanez/dumang-keyboard-ctrl


Have you used the Microsoft Sculpt Ergonomic keyboard? I really like that, but it isn't mechanical.


It's very nice, mechanical isn't always better. I really like the sculpt when I used it and if you're happy with it there isn't a big reason to switch.


Thanks. Can you also tilt the halves like a tent for ergonomics?


I have them mounted to a chair I'm not by but I think so. Having a hot swappable keyboard I have them on the arms in a tilt specific to me. I was looking for an American clone but nobody makes anything this cool. https://dygma.com/pages/defy This one isn't magnetic but it's wireless and it has a mouse on it. I love the magnetic and the tactile feeling as well as the ability to mix and match keys and switches on the fly.

I'm not sure what the next iteration would be for a keyboard but I hope to see more ergonomic ones mounted on chairs.


Isn't stenography the end game?


I wanted to like plover because I thought so too, but there isn't anything stopping you from using this as a custom steno either.


What's the name of the keyboard? I cannot visit this particular page, as the item is not shipped to Germany.


$106 for shipping, oof


Nice keeb


This is the kind of discourse I seek out on HN. ty


very murdery! Never even seen coffee that color :)


Maybe the poor civet had bloody bowels that day :(

https://en.wikipedia.org/wiki/Kopi_luwak


Huh, my AI-generated newspaper also adds coffee stains to a LaTeX (technically LuaTeX) document: https://imgur.com/a/NoTr8XX

I cobbled this myself, I didn't know it was such an expansive domain with prior art!


Beautiful project! How long does the 1100 mAh battery last?


About 7 months in the first run. I recently switched things to a more efficient TPS63020-based voltage converter though, which has an extremely low operating quiescent current of only 25uA in low power mode (1/4 of the MT3608 I previously used). I'm hoping for more in the next!

The comparison will also be apples-to-oranges though since I also switched it to a 3500 mAh 18650 during that revision ... self-drain and therefore the battery make itself now become a big factor ... ask me in a few years how it went? :-)


Great project, would be a good expo for Hack-a-day


Incredible! Thanks for sharing


amazing! how much did all the components cost, minus chatgpt sub.


> A lot of time can be saved by printing stains directly on the page rather than adding them manually.

Outstanding.


Bestowing the ''golden ring of quality'' has now been automated.


When a measure becomes a target, it ceases to be a good measure.


Looking forward to using this next time I'm told I have to print, sign, and scan a document. I already have software setup to slightly rotate the page and add some grain, but this will add extra verisimilitude.


    convert \
        -density 150 \
        -colorspace gray \
        +noise Gaussian \
        -rotate 0.5 \
        -depth 2 \
        "$1" \
        "$(echo "$1" | rev | cut -f 2- -d '.' | rev)-scanned.pdf"


You and me both. Maybe someone will find this useful: https://photocopy.fuglede.dk/


Nice! If only I knew this existed last month.

But they also needed a “company seal stamp” which I had to draw


And whenever you want to share a code snippet with someone, instead of using boring tools like Pastebin, use this instead:

https://code.xxut.ru/


Putting in a ruby snippet gives me a light-themed PyCharm with the filename being `scratch_1.txt`

Thanks, I hate it!



I made this a while back for fun -- changing the seed will add different artefacts to the page, rotate it, hole punches, and of course coffee stains: https://sublim.nl/scp/?seed=1234567


I legit had to google the word "verisimilitude"


Me too. What a wordsmith, I am in awe! not being sarcastic, I really do appreciate it


Huh, it's not a common word in English, right? Spanish being my mother tongue, it's not weird for me.

What would be a more anglo word with a similar meaning, if any?


Verisimilitude is the right word, most people I know would know it if they were going to be reading anything about LaTeX. It might be a cultural or regional difference, I am in Australia.


Truthiness or authenticity


It's a perfectly good word, I didn't know it was unknown.


Well, it's pretty common for me...


Now we just need a similar package to smudge and blot the signature slightly, and add a little ink spatter, for the fountain pen look.


I used this library very often when writing a new paper. When the paper was a draft I would put coffee stains on the pages. In this way, I always knew if I was looking at a draft or the final version.


Without this, wouldn't you know which version of your document you're looking at? What is the workflow leading to that?


Well, of course, I could put a version number on top of each page... but hey, what's the fun about that?


Working in France, I remember having to provide a "Scan of an original of Bank Account information slip" (approximate translation). It's just a number! That I could have copy/pasted in an email to make sure the secretary won't fuck it up, or I could download the document from my bank and email it, but no, HR insisted it had to be an original.

I eventually downloaded one from my bank, converted it to JPEG, added a light coffee stain with Gimp and sent that, to pretend it was an actual scan of an actual document actually printed by the bank.


> I eventually downloaded one from my bank

Had the same experience, but that I could not do, as my bank would only give out some crude Netscape era HTML laid out with a borderless <table>, that might just as well have been plain text. I literally had to fake something that looked like a pretty paper one, complete with the bank cooler palette and slapping a semi-transparent logo in the background.

Another marvel: once I received some paperwork, and was asked to sign and scan, which I did.

I had a nice scanner. It produced perfectly noise free, upright scans. I had a nice pen. It produced very clean scripture.

Apparently too nice as the recipient lectured me that I had to print, physically sign, and scan, that they could not accept a digital signature on a digital document. The fact that I received the paperwork on actual paper by snail mail and never could have had access to a digital version completely eluded them.


That almost made me nostalgic for the French love of paperwork. 'La paperasse' I seem to recall. Watching an official in action is like performance art.


It's probably the same in other countries, but some day I did rent a field to plant some vegetables and run a small business. Every single day for one entire month I had to fill forms, sign papers, ask the field owner to give me some random information queried by some french institutions related to : nature, forest, ecology, commerce, entreprenership, business, water, rental etc.. Most of the time the field owner had to go to the "mairie" of his town to get the proper informations which would contact other services (--recursively) so I could get the information that I need to fill the forms. I am pretty sure the field owner has administration-related PTSD if he sees me again.


If you think the French love paperwork, try Japan!


Some other great CTAN packages with an "amusements" tag: https://ctan.org/topic/amusements


realhats is pretty great.


I can have an aperiodic tile "Einstein's Hat" hat on my basis vectors! That's just outstanding.


The code didn't look as I expected. He more-or-less embedded an svg into the sty-file.

https://framagit.org/Pathe/coffeestains/-/blob/main/coffeest...

I am looking forward to a real generative AI that produces coffee stains.


This reminds me of the old Philip and Alex's Guide to Web Publishing* posts from the 90's and his sketcherly / back of the napkin diagram style.

* http://philip.greenspun.com/panda/?


What goes through someone's mind that they spend all the time and effort to create a visual gag and then don't put images of said visual gag on the documentation?


The supporting code repo contains a sample PDF

https://framagit.org/Pathe/coffeestains/-/blob/main/coffeest...


What do you mean? It is on the documentation?

https://ca.mirrors.cicku.me/ctan/graphics/pgf/contrib/coffee...


Old-school internet vibes



Package name should have been Lattex.


Why aren't there mugs with hydrophobic coating on the bottom? It seems like this should be an easy problem to solve compared to all the petaflop GPU's and spacecraft we're building.


Normally, mugs are ceramic and thus the parts that had to touch the shelf in the kiln are unglazed.

Maybe we just need to make pottery in 0G.


Not all tableware is barefooted / dry-footed. You can use a stilt, which is a ceramic with sharp metal (eg Kanthal) pins on which the glazed ceramic is supported. Pieces fired this way have small marks on the bottom like the injection marks some moulded plastic has.

Fully glazed ware is good for wet areas when the ceramic may not be entirely vitrified, as this prevents water from soaking into the ceramic body.

Dry-footed ware that hasn't been high-fired will soak up moisture, eg when washing, and so cause problems - crazing, and getting very hot when used in a microwave oven (which can cause more crazing, but also burn your hand!

Source: am potter.

The foot ring on dry-footed mugs is a useful knife sharpener in a pinch.


Huh, TIL

The bare ceramic on the bottom of the mug is of those things I've always noticed about coffee cups but never really thought about.


Could you just suspend them on a cushion of air like indoor skydiving?


One of the primary motivations behind LK99 and other efforts to create room-temp superconductors is to fashion coffee mugs that harness the Meissner effect to levitate above journal print-outs.


Obtaining the necessary laminar flow in the presence of the handle might be challenging.


How do you "just" suspend a mug on a cushion of air?


Maybe like indoor skydiving?


That's a very low tech solution. What we need is an internet connected mug that senses with a camera if it's about to be set on top of a piece of paper and starts beeping uncontrollably.

With a firmware update and an additional charge to the customer a model for detecting polished wooden furniture could also be used.


It also needs a permanent internet connection, as the inference for the paper detection is run in the cloud, and a subscription to keep it working.

I call it No-SaaS, No Stains as a Service.


Because that is a hardware fix.

Why fix in hardware what can be fixed in software? A simple Latex package could add hydrophobic coating feature to the document file.

Next: the device driver team will be tasked with a software patch to correct for the burned out light bulb on the device.


Oh great, one more ink cartridge for printer manufactures to sell. And, of course, the printer will refuse to work if your hydrophobic coating cartridges is empty even tough all other cartridges are fine.


They tend to get destroyed when cleaning the items. It happens a lot with clothing that has hydrophobic coatings so I'd imagine a dishwasher would ruin it almost immediately, leading to complaints and returns.


Then how would we tell which papers have been read?


How would a hydrophobic coating help?


I can imagine two ways. First, on the very bottom, if you place the mug into a puddle of coffee, then no coffee will wet the bottom of the mug. Second, around the side, when coffee runs down the side of the mug, a hydrophobic coating might stop a drop in its path if it is not too heavy. Not sure if the second thing would actually work.


The coating around the side should form a V, with the handle being the lowest point, and make a little indentation on the bottom of the inside of handle to collect all the liquid...


So make a GoreTex sleeve that waterproofs the bottom of your coffee mug?


Aren't most hydrophobic coatings very toxic and wear easily?


Think of all the work that was done on this package INSTEAD the paper the author should have been working on.


I do hope they got tenure for this!

:D


Stains add a whole layer of history to a document - I remember a prof at uni once apologizing for the wine stains on our papers...

In the same vein as stains, I love how non-waterproof inks react with water; the organic smudges and splotches add a bit of watercolor to an ordinary journal page (1).

1: https://nexus.armylane.com/files/Journal-Ink-splotches.jpg


I remember using something similar like a decade ago, maybe one I linked below? I added one to a paper for a math class I turned in and the teacher loved it so much that the next semester he used it on almost every handout; it was quite annoying after a while, hahaha.

https://www.overleaf.com/latex/examples/latex-coffee-stains/...

http://legacy.hanno-rein.de/hanno-rein.de/archives/349


Brings back memories from time when printed documents were still the norm. A coworker used to call it my "seal of approval" if a document was on top of my desk long enough to accumulate a hefty dose of coffee stains.


I'm gonna need a decaf option


What about green tea?


Or Diet Coke.


Or Maté?


or Monster?




I'm fairly sure this is either older than stated, or is based off an older package. I distinctly remember a similar package existing when I was in high school in the 00's, I turned in a paper for AP CS with a faked coffee stain once as a joke.


Hanno's version made a big splash in 2009. We discussed LaTeX coffee rings back in 2010 - https://news.ycombinator.com/item?id=1924697


Need to fork to make it bloodstains


There is example of bloodstain at the bottom


Maybe you can combine coffee stains and watermarks.


“ A lot of time can be saved by printing stains directly on the page rather than adding them manually.” I love this humor.


Once had my advisor give me a paper to read. On it, fairly clearly, were his kid's boogers.


This is why I read HN every day.


Why do you like this?

Surely I'd have appreciated a more aesthetic design or decoration!


I'm sure the extra cost of color printing makes it less economical.


I still cling to doing it manually, as a bonus you get coffee too!


Or use overpic and the coffee stain filter from Gimp.


Honestly if I got a resume featuring this I would immediately call them in for an interview it counts for massive bonus points.


would you lower the points awarded if they were not to scale?


Can we also get a decaf version. Or tears.


This is essential


agreed


Sometimes I exchange printed papers and documents with colleagues that have actual coffee stains. Would be interesting to have digital and physical stains at the same time. I will test that. Some will complain about the perfect shapes /s


I actually like their take on the vacat page [0] even more.

0: https://en.wikipedia.org/wiki/Intentionally_blank_page




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: