LaTeXM...nicode(3pm)

ok bestie, welcome to LaTeXM...nicode(3pm) โ€” straight outta the User Contributed Perl Documentation, and it's literally the cutest little Unicode toolbox for LaTeXML ๐Ÿฆ‹โœจ

๐Ÿ’– NAME ๐Ÿ’–

LaTeXML::Util::Unicode โ€” Unicode Utilities. periodt ๐Ÿ’…

๐ŸŒธ SYNOPSIS ๐ŸŒธ

LaTeXML::Util::Unicode gives you several genuinely useful utilities for manipulating Unicode for LaTeXML, and it's mostly there to help you out with mathematics ๐Ÿงฎโœจ (iykyk, math is the main character here)

๐ŸŽ€ DESCRIPTION ๐ŸŽ€

okay so here are the three functions, and yes every single one of them slays in its own way ๐Ÿซถ


โญ $string = UTF($codepoint);

Converts the given numeric codepoint to unicode โœจ This one is your bestie for codepoints under 255 โ€” think UTF(0xA0) for non-breaking space โ€” because perl does not reliably handle those ๐Ÿ˜ญ Like, it just doesn't. So use this instead, fr fr.

โญ $mathvariant = unicode_mathvariant($font);

Converts the font to a Unicode-appropriate mathvariant ๐Ÿ’œ The font should be in the string form you generally find during post-processing, eg "bold italic". The mathvariant that comes back can be used in MathML, or passed straight into unicode_convert to convert strings into that given style ๐ŸŒˆ Two-for-one, we love to see it.

โญ $unicode = unicode_convert($string,$style);

Converts the given string to the codepoints corresponding to the requested style ๐ŸŽ€ Returns undef if not all characters in the string can be converted โ€” so like, vibe check your input, bestie ๐Ÿ™ˆ

The recognized styles are literally:

  • "bold"
  • "italic"
  • "bold-italic"
  • "sans-serif"
  • "bold-sans-serif"
  • "sans-serif-italic"
  • "sans-serif-bold-italic"
  • "monospace"
  • "script"
  • "bold-script"
  • "fraktur"
  • "bold-fraktur"
  • "double-struck"

...as well as "superscript" and "subscript" ๐Ÿ‘‘ That's the whole menu and every single one of them ate.


ngl bestie, if unicode_convert hands you back undef, that means something in your string couldn't be converted to the style you asked for โ€” no cap, that's just what the page says ๐Ÿ’€

and that's the whole page!! this was perl v5.40.1, dated 2025-11-16, from LaTeXM...nicode(3pm) โ€” mwah, go convert some codepoints ๐Ÿ’‹๐ŸŒธ

๐Ÿ“ฆ where this page comes from