LTX2UNITXT(1)

πŸ“¦
version 76255 Β· 5 versions
, in debian trixie, fedora 44, opensuse-leap 16.0, ubuntu questing

✨ ltx2unitxt ✨

okay bestie, welcome to ltx2unitxt β€” it's a User Commands manual page and it's literally here to convert LaTeX source fragments into plain (Unicode) text, or, if you're feeling spicy, into simple html πŸ’…


🌸 SYNOPSIS 🌸

ltx2unitxt [-c CONFIG] [-o OUTPUT] [--html] [...] [INFILE]...

πŸ¦‹ DESCRIPTION πŸ¦‹

So the whole vibe is this: it takes the LaTeX source in INFILE (or from standard input, if you're just piping stuff in like a main character) and converts it to plain text, using Unicode code points for accents and other special characters. OR β€” plot twist β€” it can optionally output HTML with simple translations for font changes and url commands. Iconic behavior honestly.

Common accent sequences, special characters, and simple markup commands get translated, but don't get it twisted: there is no attempt at completeness. Math, tables, figures, sectioning, etc., are not handled in any way, and are mostly just left in their TeX form in the output. No cap. The translations assume standard LaTeX meanings for characters and control sequences; macros in the input are not considered. πŸ™ˆ

The input can be a fragment of text, not a full document, because the whole purpose of this script was to handle bibliography entries and abstracts (for the ltx2crossrefxml script that is part of the crossrefware package). Patches to extend this script are welcome β€” fr fr, come thru. It uses the LaTeX::ToUnicode Perl library for the conversion; see its documentation for details. πŸ“š

Conversion is currently done line by line, so TeX constructs that cross multiple lines are not handled properly. If it turns out to be useful, conversion could be done by paragraph instead. (not me being honest about the limitations πŸ’€)

The config file is read as a Perl source file. It can define a function LaTeX_ToUnicode_convert_hook() which will be called early; the value it returns (which must be a string) will then be subject to the standard conversion. πŸŽ€

For an example of using this script and associated code, see the TUGboat processing at https://github.com/TeXUsersGroup/tugboat/tree/trunk/capsules/crossref. πŸ‘‘


πŸ’– OPTIONS πŸ’–

  • -c, --config=FILE β€” read (Perl) config FILE for a hook, as explained above ✨
  • -e, --entities β€” output entities &#xNNNN; instead of literal characters
  • -g, --german β€” handle some features of the german package πŸ‡©πŸ‡ͺ
  • -h, --html β€” output simplistic HTML instead of plain text 🌈
  • -o, --output=FILE β€” output to FILE instead of stdout
  • -v, --verbose β€” be verbose (tell me everything bestie)
  • -V, --version β€” output version information and exit
  • -?, --help β€” display this help and exit

Options can be abbreviated unambiguously, and start with either - or --. Slay. πŸ’…


🫢 THE LORE 🫢

Dev sources, bug tracker: https://github.com/borisveytsman/bibtexperllibs Releases: https://ctan.org/pkg/bibtexperllibs

ltx2unitxt (bibtexperllibs) 0.51 Copyright 2023 Karl Berry. This is free software: you can redistribute it and/or modify it under the same terms as Perl itself. πŸ‘‘


and that's the whole page, bestie β€” ltx2unitxt, September 2024, from the ltx2unitxt manual. go forth and convert ur LaTeX, u got this πŸ’œβœ¨

πŸ“¦ where this page comes from