SIMPLE TTY OFFICE, PART 1: WORD PROCESSING AND E-READING ======================================================== Distraction-free writing is all the rage these days. But most writerdeck setups don't serve my needs as a non-fiction writer. Even in distraction-free mode, I still need multiple windows to read and cite electronic documents. In the past, I've used a virtual machine to run Windows 2000 / Office 2000 for distraction-free writing, and that works well enough. However, I have a spare raspberry pi zero w and thought that I might create a very lightweight office setup on the Linux TTY (without X or Wayland). Here's my setup for word processing and document viewing. My system is running DietPi and I use tmux for "windowing." I'll post the tmux setup in the next installment of this little series. My ultimate intention is to post the content as individual setup guides on my gopher hole. I hope it will be helpful for others. I know it will be useful to me when I have to set up a new machine in the future. Comments and suggestions can be sent to me at: visiblink ( at ) gmx ( dot ) com Word Processing with a Text Editor ---------------------------------- Creating MS Word-compatible documents with a text editor can be done using markdown formatting in your text editor and pandoc for conversion. Text editors: If you want word-wrapping and the standard keyboard combinations for cut, copy and paste (ctrl-x, ctrl-c, and ctrl-v), you have a couple of choices: 1. Use the micro text editor. To enable word wrapping and turn off line numbering, my ~/.settings/micro/settings.json file looks like this: { "softwrap": true, "wordwrap": true, "ruler":false } You can also change these settings from within the editor. See the following guides for more information: https://github.com/micro-editor/micro https://forum.garudalinux.org/t/mastering-the-micro-text-editor/32889 2. Use the nano text editor. $nano --softwrap --atblanks --afterends --modernbindings I've added this alias to my .bashrc file: alias word='nano --softwrap --atblanks --afterends --modernbindings' I could probably add these options to my nano config file, but I also like to be able to start nano in regular mode (by typing 'nano') for editing config files and programming. Here is the markdown formatting for almost everything I typically do in a document: *Italics* **Bold** ***Both*** >This is a block quotation. ^[This is a footnote.] << note that the footnote is placed inline with your text.^[Like this] Pandoc handles footnote numbering and automatically inserts the note numbers at the insertion point and at the bottom of the page. The material inside the square brackets appears after the footnote number at the bottom of the page. That's it. I don't make use of a lot of specialized formatting. If you do, you can find more pandoc-specific markdown information at: https://garrettgman.github.io/rmarkdown/authoring_pandoc_markdown.html Save your marked-up text file with the .md extension. Markdown to Word Document Conversion: To convert to the markdown file to MS Word format: $pandoc myfile.md -o myfile.docx To modify the default pandoc markdown-to-docx conversion styles: 1. Generate a .docx file containing the default styles: $pandoc -o custom-reference.docx --print-default-data-file reference.docx 2. Open the file "custom-reference.docx" in MS Word. It contains samples of formatted text (for headings, body text, block quotes, footnotes, etc.). 3. Edit the styles in the document as you see fit. If you're wondering what kind of changes you might want to make, in my case, I've changed the default font to Calibri, altered the body text to be double-spaced, resized footnote text to 10pt, etc. 4. To use the custom style, convert your markdown to docx using the following command: $pandoc --reference-doc=custom-reference.docx myfile.md -o myfile.docx There's more information in the pandoc manual: https://pandoc.org/MANUAL.html#custom-styles Alternatives for command-line word processing include wordgrinder and wordperfect: https://cowlark.com/wordgrinder/ https://github.com/taviso/wpunix eBook Reading ------------- Use epr (for epubs only) or epy (for multiple formats). You can find these programs on Github: https://github.com/wustho/epr https://github.com/wustho/epy I had trouble installing epr on one of my devices and had to fork it to accept a pull request that fixes the issue. If you're experiencing a crash because you have no media player installed, try the fork: https://github.com/Visiblink/epr Alternate: convert epubs to .txt or .html using pandoc. $pandoc myfile.epub -o myfile.txt or $pandoc myfile.epub -o myfile.html Read with an editor, a pager (less or more), or a cli browser like lynx. PDF Reading ----------- $lesspipe myfile.pdf | less To simplify the invocation command, see: gopher://zaibatsu.circumlunar.space/0/~visiblink/phlog/20260701 Alternate: convert the pdf to a text file with lesspipe and read the text file with an editor or pager: $lesspipe myfile.pdf > myfile.txt Note that these methods do not work for scanned image-based PDFs. Next installment: tmux configuration with a fix for text highlighting.