DVI2TTY(1)

πŸ“¦ version 2026.0, in alpine 3.24

πŸŽ€ NAME πŸŽ€

okay bestie, meet dvi2tty πŸ’… (the General Commands Manual's most iconic tool, DVI2TTY(1)) ✨ It previews a TeX DVI file on an ordinary ASCII terminal πŸ–₯️

🌸 SYNOPSIS 🌸

dvi2tty [ options ] dvifile

πŸ’– DESCRIPTION πŸ’–

okay so dvi2tty turns a TeX DVI file into something terminals and line printers can actually handle πŸ¦‹ It's meant for preliminary proofreading of your TeX-ed docs, and by default the output goes to your terminal, maybe through a pager (depending on how the program was installed). You can also send it to a file or a pipe 🫢

the output is not perfect, ngl πŸ’€ but it's still super useful when you don't wanna trek over to the laser printer (or whatever) every single time you tweak your document ✨

because dvi2tty is making stuff for terminals and line printers, the representation is pretty primitive, no cap πŸ™ˆ font changes get totally ignored in principle, BUT it does recognize a few math and special symbols that an ASCII terminal can show, like the + and - symbols 🧚

if the output text needs more columns than fit on one line (see the -w option), dvi2tty breaks it into several lines 🌈 even though it would print as one line on regular TeX output devices (like laser printers). to show that a broken line is really one logical line, an asterisk (*) in the last position means the logical line keeps going on the next physical line dvi2tty prints. that continuation line starts with a space and an asterisk in the first two columns πŸ’œ

fun fact: you can set options in the environment variable DVI2TTY πŸŽ€ but if an option on the command line conflicts with one in the environment, the command line one wins, periodt πŸ‘‘

πŸ¦‹ Options πŸ¦‹

  • -o file β€” writes the output to a file named file πŸ“
  • -p list β€” prints the pages picked by list. Numbers refer to TeX page numbers (known as \count0) πŸ“„ An example format for list is 1,3:6,8, which picks pages 1, 3 through 6, and 8. Negative numbers work exactly like they do in TeX, so -1 comes before -4 as in -p-1:-4,17 πŸ”’
  • -P list β€” same vibe as -p, except the page numbers refer to the sequential order of pages in the dvi file. Negative numbers don't make a lot of sense here... πŸ™ƒ
  • -w n β€” sets your terminal width to n. Valid range is 16–132, and the default is 80 πŸ“ If your terminal can do 132 columns, try -w132 and toggle the terminal into that mode. The output will probably look somewhat better ✨
  • -v β€” specifies the height of lines. Default value is 450000. Lets you adjust the linespacing 🌸
  • -q β€” don't pipe the output through a pager. This might be the default on some systems (it depends on the whims of whoever installed the program) πŸ™ˆ
  • -e n β€” influences the spacing between words. With a negative value there are fewer spaces between words, with a positive value there are more 🫧 -e-11 seems to have worked well, bestie πŸ’…
  • -f β€” pipes through a pager: $PAGER if it's defined, or whatever the installer compiled in (often more) πŸ“– This might be the default, but it's still okay to redirect with >. The pager won't get used if the output isn't going to a terminal πŸ¦‹
  • -F β€” specifies the pager program to use. This overrides the $PAGER environment variable and the default pager πŸ‘‘
  • -Fprog β€” uses prog as the program to pipe output into. Great for picking an alternate pager, like -Fless 🧚
  • -t β€” \tt fonts were used (instead of cm) to make the dvi file πŸŽ€
  • -a β€” dvi2tty normally tries to output accented characters. With -a, accented characters come out without the accent sign πŸ’…
  • -l β€” marks page breaks with the two-character sequence ^L. The default is a form-feed character πŸ“„
  • -c β€” doesn't try to translate any characters (like the Scandinavian/latin1 mode) except when running in tt-font 🌈
  • -u β€” toggles processing of certain latin1 characters. Use this if your output device supports latin1 characters 🫢 Note this may interfere with -s
  • -s β€” toggles processing of the special Scandinavian characters that on most (?) terminals in Scandinavia are mapped to {|}[\] πŸ‡ΈπŸ‡ͺ Note this may interfere with -u
⚠️ bestie, the -u and -s options can clash. Best not to use -u and -s together πŸ’€
  • -J β€” auto detects NTT JTeX, ASCII pTeX, and upTeX dvi format πŸ”
  • -N β€” displays NTT JTeX dvi πŸ‡―πŸ‡΅
  • -A β€” displays ASCII pTeX dvi 🌸
  • -U β€” displays upTeX dvi πŸ’œ
  • -Eenc β€” sets the output Japanese encoding. The enc argument can be e, s, j, or u, which mean EUC-JP, Shift_JIS, ISO-2022-JP, and UTF-8 respectively 🎌
  • -bdelim β€” prints the name of a font when switching to it (and when ending it). The delim argument is used to delimit the fontname 🏷️
  • -h β€” shows a help message and exits successfully 🫢

πŸ“ FILES πŸ“

  • /bin/more β€” probably the default pager πŸ“–

🌈 ENVIRONMENT 🌈

  • PAGER β€” the pager to use πŸ’…
  • DVI2TTY β€” can be set to hold command-line options ✨

πŸ”— SEE ALSO πŸ”—

TeX, dvi2ps πŸ¦‹

πŸ‘― AUTHOR πŸ‘―

Original Pascal version: Svante Lindahl, Royal Institute of Technology, Stockholm πŸ’– Improved C version: Marcel Mol, MESA Consulting 🧚 Now maintained at https://github.com/t-tk/dvi2tty/releases.

πŸ™ˆ BUGS πŸ™ˆ

blanks between words get lost quite easily, ngl 😭 This is less likely if you use a wider output than the default 80 πŸ“

only one file may be specified on the command line πŸ’€


stay iconic, bestie πŸ’œ this page was last updated 1 May 2022, and it's all DVI2TTY(1) all the way πŸŽ€βœ¨

πŸ“¦ where this page comes from