VLNA(1)

๐Ÿ“ฆ
version 73908 ยท 3 versions
, in alpine 3.24, arch rolling, debian trixie, fedora 43, fedora 44, opensuse-leap 16.0, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking

โœจ VLNA(1) โœจ

๐Ÿ’– NAME ๐Ÿ’–

okay so meet vlna ๐Ÿฆ‹, the tiny program that adds a tilde after each non-syllabic preposition. it's giving typography queen energy ๐Ÿ‘‘

๐ŸŽ€ USAGE ๐ŸŽ€

vlna [options] [filenames]

๐ŸŒธ PREFACE ๐ŸŒธ

okay bestie, there's a special Czech and Slovak typography rule ๐Ÿ‡จ๐Ÿ‡ฟ you are NOT allowed to leave a non-syllabic preposition hanging at the end of a line and then keep writing on the next one ๐Ÿ’€. so "v lese" (in a forest) can't be split like "v<new-line>lese". it's a whole no-no ๐Ÿ™…โ€โ™€๏ธ

that's where vlna slides in โœจ. it adds an asciitilde between the preposition and the next word and removes the space(s) in that spot, so "v lese" becomes "v~lese". obsessed ๐Ÿ˜ญ. you can even run it as a preprocessor before TeXing ๐Ÿงš. and if you don't love the tilde, you can store a different sequence instead with the -x option (see below) ๐Ÿ’….

๐Ÿ’… DESCRIPTION ๐Ÿ’…

so the program vlna processes one or more files ๐Ÿ“‚, hunts down the non-syllabic prepositions that are followed by space(s), and turns those space(s) into an asciitilde every single time โœจ.

inside the file, you can pause the whole thing with the %~- sequence and bring it back with %~+ ๐ŸŽ€. these sequences can have spaces in them too, so % ~- is a valid sequence as well, iykyk ๐Ÿ™ˆ.

here's how it decides something is a preposition ๐Ÿ”. you can write any number of opening parentheses before the preposition, and before those (optional) parentheses there has to be a space, a tabelator, or a new-line. the preposition itself is a one-letter word, and the letter has to come from this set: {KkSsVvZzOoUuAI}. if you want to change that set, check out the -v option ๐Ÿฆ‹. starting from version 1.2, a TeX sequence can also sit in front of the preposition and before the brace ๐ŸŒˆ. for example, "<new-line>([V lese" becomes "<new-line>([V~lese" ๐Ÿ’–. and "\uv{V lese}" becomes "\uv{V~lese}" ๐Ÿซถ.

at least one blank-space has to come after the preposition before the next word ๐Ÿ“. a blank-space is a space or a tabelator, and one <new-line> can sneak in there too ๐Ÿ™ˆ. all of those characters get removed and replaced with asciitilde (or whatever string you picked with -x) โœจ. if a <new-line> gets deleted, a fresh <new-line> is created before the preposition (and before the optional parentheses) so the number of lines stays exactly the same ๐Ÿ“. for example, "... V<new-line><tabelator>lese" becomes "...<new-line>V~lese" ๐ŸŒท.

the program also checks that TeX's math environments are consistent (unless you use -m) ๐Ÿงฎ. for example, the "$...$$...$" sequence, which means switching into display mode inside text-math mode, throws a warning ๐Ÿ˜ญ. an empty line inside display mode also throws a warning, and then the program handles the next text like normal non-math mode ๐Ÿ’€. a "$" inside display mode is totally accepted though, because stuff like $$..\hbox{..$..$}..$$ is allowed and super common ๐Ÿ’œ.

verbatim mode gets checked too ๐Ÿ”. if the file ends while verbatim mode is still open, you get a warning ๐Ÿšจ. you can switch this off with -n or -w ๐Ÿ™…โ€โ™€๏ธ.

and the program won't touch letters that look like prepositions but aren't, when a TeX or LaTeX sequence comes right before them ๐Ÿ’…. for example, "vlastnosti \TeX u jsou" is NOT converted to "vlastnosti \TeX u~jsou", because after TeX processing it prints as "vlastnosti TeXu jsou". the "u" is a suffix there, not a preposition ๐ŸŒธ.

๐ŸŽ€ OPTIONS ๐ŸŽ€

the options are, like, totally optional ๐Ÿซถ, and you can write them in any order you want, separated by spaces โœจ.

  • -f โ€” filter mode ๐Ÿงš. the [filenames] get treated like this:
vlna -f filename1 filename2
    Input is filename1, output is filename2.

vlna -f filename1
    Input is filename1, output is stdout.

vlna -f
    Input is stdin, output is stdout.

vlna filename1 [filename2 [filename3 ...]]
    If the -f option is omitted then each file is processed
    independently and it is re-written.
  • -s โ€” silent mode ๐Ÿคซ. no messages, warnings, or statistics get printed. only the errors that crash the program early still show up ๐Ÿ’€. if you leave this out, the banner, warnings, and statistics all go to stderr ๐Ÿ“ฃ.
  • -r โ€” no backups ๐Ÿ™…โ€โ™€๏ธ. this one doesn't matter if you're using -f. if you use neither -f nor -r, each rewritten file gets its original contents saved to a backup file. the backup name is the same as the filename, except the last character is swapped for a tilde ๐ŸŽ€.
  • -v characters โ€” choose your own preposition letters ๐Ÿ”ค. the set of characters that count as non-syllabic prepositions is set here. default: -v KkSsVvZzOoUuAI. there has to be a space between -v and the characters ๐Ÿ’–.
  • -x code โ€” swap out the tilde ๐ŸŒˆ. the code is a hexadecimal string, and you need every hex digit, no skipping ๐Ÿ™ˆ. this string gets saved after prepositions instead of the default asciitilde. for example, -x C2A0 stores two bytes after each non-syllabic preposition: the first is C2 and the second is A0, which means a NO-BREAK SPACE in UTF8 encoding โœจ. another one: -x 00A0 gives you the NO-BREAK SPACE in UTF16 ๐Ÿง. and -x 48454C4C4F gives you the string HELLO ๐Ÿ‘‹. you need a space between -x and the code ๐Ÿซถ.
  • -m โ€” ignore math modes ๐Ÿงฎ. $...$ and $$...$$ get ignored, so prepositions get searched for in math mode too. default (without -m): math modes are left alone, because (for example) "v" is a variable in math mode, not a preposition ๐Ÿ™…โ€โ™€๏ธ.
  • -n โ€” ignore verbatim mode ๐Ÿงพ. \verb<char>...<char> and \begtt...\endtt are ignored, so the program can change stuff inside verbatim environments. default (without -n): verbatim mode is left alone ๐Ÿ’….
  • -l โ€” LaTeX mode ๐Ÿ“œ. \begin{display}...\end{display} and \begin{equation}...\end{equation} count as display mode, and \begin{verbatim}...\end{verbatim} counts as verbatim mode ๐ŸŒธ.
  • -w โ€” web mode ๐Ÿ•ธ๏ธ (Knuth's web, no www:-). these sequences count as verbatim: @<, @d...@*, @space, or @>|. so program code stays untouched in *.w or *.web files, and only the web comments get processed ๐Ÿ’œ.

๐Ÿงš EXAMPLES ๐Ÿงš

vlna -m -n -s -r file

this behaves similarly to the old vlnka program ๐Ÿ‘ตโœจ.

vlna *.tex

every file with the .tex suffix in the current directory gets processed, and might get changed ๐Ÿ“‚. (the "*" is a UNIX-shell feature, periodt ๐Ÿš).

vlna -f file > /dev/null

only the consistency checking of math and verbatim modes happens here. no changes are made ๐Ÿ™ˆ.

๐Ÿ’œ AUTHORS ๐Ÿ’œ

Petr Olsak <olsak@math.feld.cvut.cz>. the Man page (Czech original) and Makefile were created by Rulolf Cejka ๐Ÿซถ.


bestie, that's the whole thing ๐Ÿ’…โœจ this man page was dated August 30 2022 ๐ŸŒท, and it's the VLNA(1) page, the General Commands Manual ๐Ÿ“–. go be a main character with your prepositions ๐Ÿ‘‘๐Ÿฆ‹