wml::std::label(3)

πŸ“¦
version 2.32.0 Β· 3 versions
, in debian bookworm, debian trixie, ubuntu jammy, ubuntu noble, ubuntu questing

πŸ’– wml::std::label πŸ’– β€” Labels and References

okay bestie, welcome to the wml::std::label(3) page from the EN Tools manual πŸ’… this one is genuinely so useful and I need you to lock in for like two minutes, k?


✨ NAME ✨

wml::std::label β€” Labels and References πŸ·οΈπŸ”—

✨ SYNOPSIS ✨

#use wml::std::label auxfile=NAME

<label name "Label Section">
<ref name>

like. that's it. that's the whole vibe check. πŸŽ€

✨ DESCRIPTION ✨

So this module implements a whole mechanism of labels and references β€” which, no cap, is exactly what it sounds like. Labels get defined via variables, and then those variables get expanded with the <ref> tag. Iconic behaviour, honestly. πŸ‘‘

But here's the little plot twist that lowkey ruins everything if you don't handle it: a super common problem is when labels get referenced before they are defined. 😭 Because obviously the <ref> goes looking for a variable that literally does not exist yet. Messy.

So for this reason β€” this is the whole reason the module works the way it does β€” labels are stored in an auxiliary file. πŸ¦‹

Here's the flow, bestie, step by step:

  1. When the module is loaded, this file is read and labels are defined. πŸ“–
  2. Then input is processed. βš™οΈ
  3. At end of input, labels are compared with their previous value. πŸ”
  4. If some labels changed, then all labels are written to the auxiliary file and a message is printed to warn that labels are wrong. 🚨
so yeah β€” that warning message is not me being dramatic, it literally means the labels are wrong and you probably need another pass. it's giving "two-pass build" energy. iykyk. πŸ”₯

✨ AUTHOR ✨

This masterpiece was brought to you by Denis Barbier 🌈 β€” hit them up at barbier@engelschall.com 🫢

✨ REQUIRES ✨

  • Internal: P2, P3, P4
  • External: --

and that's the page, bestie!! πŸŽ€βœ¨ we're out here reading wml::std::label(3) from the EN Tools collection, dated 2020-11-29, and honestly? she ate. πŸ’… go build something cute, mwah πŸ’–πŸ¦‹

πŸ“¦ where this page comes from