logoalt Hacker News

Quarkdown: A modern Markdown-based typesetting system

623 pointsby asicsplast Tuesday at 8:06 AM261 commentsview on HN

Comments

thangalinlast Tuesday at 5:56 PM

My FOSS text editor, KeenWrite[1], takes a similar approach: Markdown -> XHTML -> TeX -> PDF. The software architecture shows how you can have processor chains:

https://gitlab.com/DaveJarvis/KeenWrite/-/blob/main/docs/ima...

I developed KeenWrite to help write a sci-fi novel where I can use variables for character names, places, etc. See the tutorials[2] for details.

For anyone still using pandoc and shell scripts, my Typesetting Markdown[3] series describes building a script-based infrastructure for converting Markdown into PDF.

[1]: https://keenwrite.com/

[2]: https://www.youtube.com/watch?v=CFCqe3A5dFg&t=15s

[3]: https://dave.autonoma.ca/blog/2019/05/22/typesetting-markdow...

show 2 replies
structurallast Tuesday at 8:17 AM

Would be interesting to see a compare and contrast between this and Typst, which has gotten a lot of attention recently.

Kinda surprising that it isn't mentioned in their feature comparison matrix at all.

show 3 replies
blenderoblast Tuesday at 12:26 PM

Is the comparison table accurate? - https://github.com/iamgio/quarkdown#comparison

Surely LaTeX has full scripting ability even though I wouldn't wish such a punishment on anyone.

Surely Quarkdown's gibberish like syntax is not more concise and more readable than Typst?

And surely the learning curve is not easier than Typst? I'd say the learning curve is more or less the same as Typst.

Surely LaTeX can also produce HTML with tex4ht?

show 3 replies
account-5last Tuesday at 8:25 AM

How is this different from Quarto [0]? Quite similar in name, same extension, appears the same aims, but at the minute less functionality.

[0] https://quarto.org/

show 4 replies
looneysquashlast Tuesday at 6:58 PM

The sample outputs look nice!

But I always hate it when a templating language grows function calls and all of that. Maybe it makes sense in this context, I'm not sure.

But if you end up using it together with another language, maybe for server side rendering or some kind of document from data generation, you quickly realize that switching between the two languages wastes a lot of time, and the templating language is never as powerful as the "real" language. So I prefer JSX, or something like Javascript's tagged template literals. Something where you use a real programming language, but where the context of the document is understood, so you don't have to worry about escaping or XSS.

rendawlast Tuesday at 9:02 AM

This, Typst, etc etc are primarily typesetting systems for papers.

I would love alternatives to HTML or whatever, but I tried Typst too and it's very clear that the authors only really care about typesetting for papers and other long form prose. Stuff like forms, invoices, flyers, handouts, leaflets, business cards -- an afterthought, at best.

Edit: Actually I was thinking of Sile not Typst, but I think the same applies to Typst too. I didn't dig into Typst too much because it was commercial though.

show 8 replies
kricklast Tuesday at 4:18 PM

Since 70% of comments under each of these posts are always "why not LaTeX?!", I want to start by reaffirming: yes, I do want a modern Markdown-based typesetting system. There even is a place of several of them. It would be absolutely nice to replace LaTeX, simply because it's old trash with remarkably inconvenient syntax, so, yes, a system with full control over markup is desirable. And if it necessarily increases verbosity, then there absolutely is a place for something "just a touch more powerful than markdown".

However, at a glance it doesn't strike me as what I was looking for. There aren't too many examples, but it seems like it leans heavier towards "just a touch more powerful than markdown" rather than to "replace LaTeX" (or Typst, for that matter). And for the first scenario to play out, it must be really seamless to use. This one doesn't seem to be.

1. Just to take care of the elephant in the room: JVM. Same as many others, I won't even bother installing it to try it out, so it doesn't help virality much.

2. I don't like the syntax. It needs to be as compatible with plain markdown as possible, and this one isn't quite. My main issue is with argument to a function being tabulated. It seems like it will lead to the whole document being tabulated. It is a natural for markdown-compatible add-ons to employ a code/monospace blocks, but ```plugin-name is a better way to do it, because it doesn't mean you have to reformat your whole document when you decide to step off from plain markdown.

3. Since a "better markdown" is something more suitable for something that starts as your personal notes (if you are specifically working on preparing a document for publishing, indeed you can just do it in LaTeX as well), I suppose it's only useful to an extent it is integrated into your notetaking app. Surely, there are still some people who do it in Emacs or Vim, but even such a retrograde as myself eventually moved on to Obsidian. I want ways to control my document structure better inside my notetaking app with a potential ability to publish. But as a standalone thing, I'm not sure why would I use it. At least Typst has a proprietary online editor. I suppose, that's also how nearly everyone uses it.

show 1 reply
Lammylast Tuesday at 5:54 PM

> What could be mistaken for a planet is actually a quark or, more specifically, a down quark, an elementary particle that is a major constituent of matter: they give life to every complex structure we know of, while also being one of the lightest objects in existence.

Cool project, but seems dangerous to use the word “Quark” in a publishing context RE: QuarkXPress:

- https://tsdr.uspto.gov/#caseNumber=90886976&caseSearchType=U...

- https://tsdr.uspto.gov/#caseNumber=97009034&caseSearchType=U...

(Why do they have two for the same word?)

cbarricklast Tuesday at 3:03 PM

This just looks like reStructuredText.

Quarkdown:

    .somefunction {arg1} {arg2}
        Body argument
rST:

    .. somefunction:: {arg1} {arg2}
        Body argument
AmazingTurtlelast Tuesday at 11:15 AM

Markdown, Quardown, Typst, this and that. This looks to LaTeX. All of this became so confusing and un-standardized - I went back to HTML+CSS.

show 6 replies
silvestrovlast Tuesday at 10:21 AM

    .function {greet}

    .greet {world} from:{iamgio}
I strongly suggest that the greet call uses a slightly different syntax (e.g. two dots) as the system otherwise can't introduce new keywords without risking conflict with function names in existing documents.
show 2 replies
TheEdonianlast Tuesday at 8:32 AM

I like it for what it is, a layer on top of markdown. That said, the main usage of markdown for me is that it's just the content and it doesn't have any opinions on the layout let alone logic.

I can add those with the use of css/js for web and interpreters and themes for print/non web.

bryanhoganlast Tuesday at 5:03 PM

Interested in this! Recently wrote a thesis. Wanted to use markdown, but that had too many limitations.

After learning and using LaTeX for a bit I got used to it, but the overall experience of setting it up and its usability leaves a lot of room for improvements. But on the other hand it's established in academic writing.

Do hope to see something based on markdown be able to replace LaTeX in the future.

show 2 replies
ryukopostinglast Tuesday at 11:30 AM

Very intriguing. I write my resume in a blend of LaTeX and Markdown, use Pandoc to convert the file to LaTeX, which then gets turned into a PDF. This might be a tidier solution on the front end, though I like my current flow because the maturity of all the tools means I can come back to my resume after several years and it'll still compile.

ChuckMcMlast Wednesday at 12:58 AM

I get that people don't like the braces in TeX but ... :-)

I'm only half sarcastic here, I don't like them either. I have recently been using pandoc[1] to do the things they are talking about, I had added some stuff in perl using the Template Toolkit[2] to make HTML pages. My issue is that I have very different fugue states for writing vs. coding. Switching states breaks my flow so I've been trying to make the two modes as orthogonal as possible.

I'm curious if anyone has used something like this to go straight to PNG. My use case is that I have a surplus epaper display that can display pngs it fetches from the network and I've been forwarding it my todo list. Have been doing this with a LuaTeX flow but would like something a bit more seamless.

[1] Pandoc -- https://pandoc.org/

[2] Template Toolkit -- https://template-toolkit.org/

francislavoielast Tuesday at 9:28 AM

Very cool, but CLI tools with a JVM language? :( I'd be much quicker to try this out with a static binary.

show 1 reply
enriqutolast Tuesday at 8:57 AM

The comparison to LaTeX is a bit unfair... the latex code is much larger than it needs to, and does things that the quarkdown doesn't (like floating the figure in the page).

Once you remove that, both versions look essentially equivalent and just as readable.

show 1 reply
rcarmolast Tuesday at 1:27 PM

I was a bit surprised to see Kotlin as the main language (I quite like it, but had to move away from JRE-based anything) I hope it can be built as a native binary...

show 1 reply
randomtoastlast Tuesday at 8:34 AM

I would like to have a compiled demo PDF available for download, along with a direct comparison of the same paper created in LaTeX. I would like to see the differences both on screen and in print.

xvfLJfx9last Tuesday at 9:04 AM

Interesting, but I wonder what does this offer that typst doesn't?

show 1 reply
quaintdevlast Tuesday at 8:26 AM

Typst is missing from comparison

show 1 reply
jamesgilllast Tuesday at 12:38 PM

Instead of bolting an engine onto a bicycle to travel long distances, why not just use a motorcycle?

show 2 replies
bovermyerlast Tuesday at 9:29 AM

I wonder how much control this gives you. For example, drop-caps, kerning, text flow around images, etc.

show 1 reply
skwee357last Tuesday at 8:50 AM

This looks very interesting and more approachable than Typst.

As some who uses headless chrome to turn html into pdf (for invoices), I have been looking for something simpler and faster.

I tried typst, but it felt messy to me. I wonder if quarkdown offers more streamlined experience

show 3 replies
RollingRo11last Tuesday at 10:01 PM

I want to move on from LaTeX syntax as much as the next person (hard to read, etc.),

But as a consumer/user, wouldn't a more uniform syntax (large adoption of Typst, etc) be preferable to having multiple different typesetting systems. I feel like the prevailing aspect of LaTeX is its universality?

(Then again, who hates options).

infogulchlast Tuesday at 8:08 PM

I've recently started rewriting basic process documentation into markdown, which also needs to be printed with a simple header and footer. I found that rendering to html, adding pagedjs cdn, and adding a styled header & footer tags looks and prints great already.

It's surprising how close html & css are to being a pretty good layout system.

skrebbellast Tuesday at 8:19 AM

This is so powerful, it makes me wonder why they didn't just make a new markdowny syntax for Latex so they could reuse everything from the Latex ecosystem. A bit like what CoffeeScript was for JavaScript, I mean.

show 2 replies
DrNosferatulast Tuesday at 4:56 PM

Pandoc should have been in the comparison table.

zzo38computerlast Tuesday at 6:24 PM

Some things I would want to see in a typesetting system:

- Having a typesetting quality and control like TeX does, including mathematical typesetting, although improvements could be made to that, too. (I think I would also like the syntax more like TeX has)

- You can include PostScript codes within the document which can run during the typesetting process (rather than only during output), therefore allowing it to affect decisions of page breaks, etc, as well as allowing PostScript to draw diagrams and control text rendering. (I had written a PostScript program to load PK fonts, so that would make it possible to use PK fonts from TeX as well.)

- Full support for non-Unicode text (without converting it internally to Unicode). (It is OK if it also supports Unicode as long as the code to support Unicode is avoided when not using it (in the entire document or in a part of it).)

show 2 replies
jdthedisciplelast Tuesday at 6:05 PM

Looks amazing of course, but usually it is the nitty gritty details where the mess and headache begins. How can I be confident that this is a viable alternative to fully fledged and mature alternatives like LaTeX?

darkhorse13last Tuesday at 10:41 AM

Slightly related, but for forms: https://forms.md

show 1 reply
Faelian2last Tuesday at 9:11 AM

That's a really interesting project.

I have been generating documents for a while using https://github.com/enhuiz/eisvogel. It's nice to use markdown, but I feel really limited, and can't do much customization.

I would love to see some templates for this.

charlie0last Tuesday at 11:40 PM

My first impression was this looks nothing like Markdown. It looks cool, but hardly resembles anything I've seen in Markdown before.

show 1 reply
codedokodelast Tuesday at 1:56 PM

I don't like the idea of using programming languages for text formatting because it is unclear how to implement a GUI editor for such format.

Also Markdown is pretty bad format, for example it doesn't even have a specification, lot of ambiguity etc. Avoid it.

show 1 reply
jinaylast Tuesday at 2:54 PM

Please add an llms.txt file! https://llmstxt.org/

I'd love to see how far I can take this by giving it to an LLM and asking it to format for me with Quarkdown.

show 1 reply
AceJohnny2last Wednesday at 10:45 AM

The pendulum swings back...

SuperV1234last Tuesday at 10:39 AM

This is pretty cool! Could you compare your approach to the one taken in Majsdown?

https://github.com/vittorioromeo/majsdown

Aloisiuslast Tuesday at 7:32 PM

What's the rationale behind hand coded typesetting these days, besides the cost of desktop publishing software?

freefrog334433last Tuesday at 9:38 AM

I've started using presenterm for markdown presentations. Given that markdown is just a format, a comprehensive comparison should find the tools using markdown to export to pdf and epub.

show 1 reply
asplakelast Tuesday at 8:34 AM

Nice! Any plans for epub?

pedro_movailast Tuesday at 9:39 AM

I made a similar project, but functions are made in js.

https://github.com/pedroth/nabladown.js

oukedlast Tuesday at 8:54 AM

Looks cool - is this "backwards compatible" with Markdown? As in, could a Quarkdown file be legible from a regular Markdown renderer?

apatheticonionlast Tuesday at 1:02 PM

I've achieved something similar by passing markdown into handlebars/ejs first before converting it to html

dariosalvi78last Tuesday at 8:52 AM

very nice and would be cool for scientific publishing, but without the publishers (or community) offering templates it'll never fly

blueflowlast Tuesday at 3:01 PM

Give the functions two-letter names and you have looped back to 1970's roff.

ants_everywherelast Tuesday at 12:15 PM

oh no it's LaTeX with significant white space

EDIT: I was just teasing, probably inappropriately my apologies. I use org-mode -> LaTeX for a similar markdown to article flow. I think it's a good idea and the results look nice.

GZGavinZhaolast Tuesday at 6:45 PM

Typst gang, unite!

formerly_provenlast Tuesday at 9:41 AM

Looks kinda like restructuredtext, but with exactly half the dots and 100% more curly braces.

show 1 reply
andrepdlast Wednesday at 8:58 AM

Looks good but Typst seems miles ahead.

🔗 View 15 more comments