LOWDOWN_LATEX_NEW(3)
β¨ LOWDOWN_LATEX_NEW(3) β¨
okay so bestie, welcome to the Library Functions Manual page for lowdown_latex_new, which is part of the library βliblowdownβ π
she's giving very much "I make LaTeX out of Markdown" and honestly? obsessed.
π NAME π
lowdown_latex_new β allocate a Markdown LaTeX renderer
like... she builds you a renderer. a LaTeX one. for Markdown. that's the whole job. iconic behavior fr fr β¨
π LIBRARY π
library βliblowdownβ π«Ά
π¦ SYNOPSIS π¦
#include <sys/queue.h>
#include <stdio.h>
#include <lowdown.h>
void *
lowdown_latex_new(const struct lowdown_opts *opts);
ngl that's the whole vibe right there. one function, one pointer argument, no drama π
π DESCRIPTION π
So basically? lowdown_latex_new allocates a LaTeX renderer, and it sets it up using opts->flags β or, if opts is NULL, it just uses zero instead. no cap. π«Ά
That flags field? it's documented over in lowdown(3), so if you wanna know what's in there, that's your girl.
The pointer you get back is reusable β you can hit lowdown_latex_rndr(3) with it multiple times, like, as many invocations as you want, she doesn't mind π
β but when you're done being obsessed with her, you must free her with lowdown_latex_free(3). periodt. no leaks allowed in this group chat πΈ
Now, the bits that are actually recognised inside opts->oflags are:
LOWDOWN_LATEX_NUMBEREDLOWDOWN_SKIP_HTMLLOWDOWN_STANDALONE
those three, and like, only those three. iykyk β¨
π RETURN VALUES π
She hands you a pointer to the renderer π β or NULL if memory failure happens (rip, tragic, we've all been there π).
And yes, bestie, one more time for the people in the back: the returned pointer must be freed with lowdown_latex_free(3). that's not a suggestion, that's the law π₯
π EXAMPLES π
okay so here's the moment you've been waiting for. this little number parses b of length bsz and outputs in LaTeX format. slay.
struct lowdown_buf *out;
struct lowdown_doc *doc;
struct lowdown_node *n;
void *rndr;
if ((doc = lowdown_doc_new(NULL)) == NULL)
err(1, NULL);
if ((n = lowdown_doc_parse(doc, NULL, b, bsz, NULL)) == NULL)
err(1, NULL);
if ((out = lowdown_buf_new(256)) == NULL)
err(1, NULL);
if ((rndr = lowdown_latex_new(NULL)) == NULL)
err(1, NULL);
if (!lowdown_latex_rndr(out, rndr, n))
err(1, NULL);
fwrite(out->data, 1, out->size, stdout);
lowdown_latex_free(rndr);
lowdown_buf_free(out);
lowdown_node_free(n);
lowdown_doc_free(doc);
look at that cleanup at the bottom. four frees, in order, gorgeous, no notes π that's main character energy right there.
π SEE ALSO π
go read them, they're all part of the same friend group π¦
and that's the page, bestie π this one came from Debian, version $Mdocdate$, filed under LOWDOWN_LATEX_NEW(3). now go free your renderer, drink some water, and slay the rest of your day πβ¨
π¦ where this page comes from
- alpine 3.24: lowdown-doc 3.0.1-r0 Β· ISC
- arch rolling: lowdown 3.2.1-1 Β· ISC
- nixpkgs unstable: lowdown 3.0.1
- nixpkgs unstable: lowdown-unsandboxed 3.0.1
- ubuntu stonking: liblowdown-dev 3.0.1-1 Β· ISC
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms