filmov
tv
Groff: Typesetting Documents on the Command Line (A pleasant workflow)

Показать описание
Hello there kind people of the world, this is a walkthrough of my workflow with groff (GNU troff). There aren't too many helpful resources for groff online, so I thought I'd give it a go.
(1) Why should you use groff?
- If you're using a WYSIWYG (what you see is what you get) editor for your notes, then you should read others' arguments for why a markup language is preferable -- there are many (arguments... and reasons). Search up "arguments against WYSIWYG" or something like that.
- If you have a lot of free disk space and don't mind installing more programs, then by all means get LaTeX and use that instead. If you're like me and you barely have any space left on your computer, groff is preferable, as it comes preinstalled. Especially if you're on a Mac, you can set this up without doing much of anything (let alone installing anything new).
- You want to use your editor of choice, not be forced to use some word processing application made for geriatrics. Of course you can just take plaintext notes using whatever you'd like, but at least minimal formatting (like bolding/underlining) and conversion to PDF were things that I deemed necessary.
- TLDR; you don't have space and you want to type formatted notes in vim.
(2) Where can I find more resources for learning how to use groff?
(3) Ok, how should I start?
- If you're on Linux, make sure you have groff and ghostscript downloaded. If you're on a Mac, you're good as you are.
- Choose a set of macros (ms, mom, man, and so on)
- Type away young lad (reference the relevant macros and syntax by searching for the documentation online). More info is provided in the video. Maybe take an example file from online and edit it for your purposes.
- If on Linux, skip the conversion and simply tack on "-T pdf" to the end of the first command.
- If you're gonna be using eqn, tbl, or pic (preprocessors that let you do mathstuff, tables, and diagrams), tack on the "-e -t -p" flags in the first command.
- You're done! Open the PDF, observe, make changes, repeat.
(4) Gimme a good workflow:
- Bind a keyboard shortcut in vim that compiles your current file and opens it as a PDF -- this would simply save the file and call the compiling script on it.
- Simply make changes and continuously compile the file with the keyboard shortcut in vim to see the changes.
Errata:
(1) Why should you use groff?
- If you're using a WYSIWYG (what you see is what you get) editor for your notes, then you should read others' arguments for why a markup language is preferable -- there are many (arguments... and reasons). Search up "arguments against WYSIWYG" or something like that.
- If you have a lot of free disk space and don't mind installing more programs, then by all means get LaTeX and use that instead. If you're like me and you barely have any space left on your computer, groff is preferable, as it comes preinstalled. Especially if you're on a Mac, you can set this up without doing much of anything (let alone installing anything new).
- You want to use your editor of choice, not be forced to use some word processing application made for geriatrics. Of course you can just take plaintext notes using whatever you'd like, but at least minimal formatting (like bolding/underlining) and conversion to PDF were things that I deemed necessary.
- TLDR; you don't have space and you want to type formatted notes in vim.
(2) Where can I find more resources for learning how to use groff?
(3) Ok, how should I start?
- If you're on Linux, make sure you have groff and ghostscript downloaded. If you're on a Mac, you're good as you are.
- Choose a set of macros (ms, mom, man, and so on)
- Type away young lad (reference the relevant macros and syntax by searching for the documentation online). More info is provided in the video. Maybe take an example file from online and edit it for your purposes.
- If on Linux, skip the conversion and simply tack on "-T pdf" to the end of the first command.
- If you're gonna be using eqn, tbl, or pic (preprocessors that let you do mathstuff, tables, and diagrams), tack on the "-e -t -p" flags in the first command.
- You're done! Open the PDF, observe, make changes, repeat.
(4) Gimme a good workflow:
- Bind a keyboard shortcut in vim that compiles your current file and opens it as a PDF -- this would simply save the file and call the compiling script on it.
- Simply make changes and continuously compile the file with the keyboard shortcut in vim to see the changes.
Errata:
Комментарии