LOWDOWN_LATEX_RNDR(3)
β¨ lowdown_latex_rndr(3) β¨
okay bestie, so this is a page from the Library Functions Manual, and it's literally all about one little function that turns your Markdown into LaTeX π no cap.
π NAME π
lowdown_latex_rndr β render Markdown into LaTeX πΈ
π LIBRARY π
you'll find this in the library βliblowdownβ π«Ά
β¨ SYNOPSIS β¨
like, here's how you summon it:
#include <sys/queue.h>
#include <stdio.h>
#include <lowdown.h>
int
lowdown_latex_rndr(struct lowdown_buf *out, void *arg,
const struct lowdown_node *n);
π DESCRIPTION π
okay so here's the tea π: this function renders a node tree n β the kind you get from lowdown_doc_parse(3) or lowdown_diff(3) β using the LaTeX renderer arg, which is what lowdown_latex_new(3) hands you back.
The output gets written into out, and heads up bestie, out has to be initialised and freed by you, the caller. it's giving main character responsibility, fr fr π
π RETURN VALUES π
- returns zero if it fails to allocate memory π
- returns non-zero on success β¨
so like, yes, zero is the bad one here. don't let it gaslight you.
π EXAMPLES π
the following parses b of length bsz and outputs in LaTeX format. iconic, honestly π¦
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);
see how it frees everything at the end? that's the vibe check passing β don't skip it.
π₯ SEE ALSO π₯
and that's the whole page bestie π this one shipped from Debian, version $Mdocdate$, filed under LOWDOWN_LATEX_RNDR(3) β go forth and render, you absolute icon πβ¨
π¦ where this page comes from
- alpine 3.24: lowdown-doc 3.0.1-r0 Β· ISC
- arch rolling: lowdown 3.2.1-1 Β· ISC
- debian trixie: liblowdown-dev 2.0.2-2 Β· ISC
- fedora 43: lowdown-libs 2.0.2-2.fc43 Β· ISC AND BSD-3-Clause AND MIT
- fedora 43: lowdown-libs 2.0.2-2.fc43 Β· ISC AND BSD-3-Clause AND MIT
- fedora 44: lowdown-libs 2.0.2-3.fc44 Β· ISC AND BSD-3-Clause AND MIT
- fedora 44: lowdown-libs 2.0.2-3.fc44 Β· ISC AND BSD-3-Clause AND MIT
- nixpkgs unstable: lowdown 3.0.1
- nixpkgs unstable: lowdown-unsandboxed 3.0.1
- opensuse-leap 16.0: lowdown-devel 1.1.0+git20231119.1200b9f-bp160.1.13 Β· ISC
- opensuse-leap 16.0: lowdown-devel 1.1.0+git20231119.1200b9f-bp160.1.13 Β· ISC
- opensuse-leap 16.0: lowdown-devel 1.1.0+git20231119.1200b9f-bp160.1.13 Β· ISC
- opensuse-leap 16.0: lowdown-devel 1.1.0+git20231119.1200b9f-bp160.1.13 Β· ISC
- ubuntu noble: liblowdown-dev 1.1.0-1 Β· ISC
- ubuntu questing: liblowdown-dev 2.0.2-2
- ubuntu resolute: liblowdown-dev 2.0.4-2 Β· ISC
- 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