Skip to content

notes for the spring 2020 semester typeset in groff with ms macros

Notifications You must be signed in to change notification settings

joshnatis/notes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

notes

Table of Contents

  1. CS260 - Computer Architecture II

  2. CS265 - Computer Theory I

  3. CS335 - Software Design and Analysis III

Background Information

This repository contains my notes for the aforementioned classes. The notes are typeset with groff. Why? you might ask. To quote Andy Tanenbaum of MINIX (and Linus flame war) fame:

What's wrong with LaTeX? Nothing, but real authors use troff.

But really, I was desperate to set up a command-line note taking system that would allow me to bold words and output my result as a PDF. As it turns out, this wasn't so easy (of course, there's pandoc and rmarkdown and other LaTeX-y stuff, but I don't have enough space on my computer to download anything bulky). I finally settled on groff and cupsfilter, which were both already installed by default on my system (macintosh).

Technical Information

When you start to use groff, you need to pick which set of macros you'll be using (macros are pretty much the formatting options available to you). I chose the 'ms' macros.

5 Steps to Perfection

  1. create a file named filename.ms
    • check out my script that prefills some information into the file
  2. check the macros available to you
    • check out my script that lists out some of the common ms macros, for reference
  3. type your document
  4. compile filename.ms into postscript with groff (or skip steps 4 and 5 by using my script)
    • groff -ms filename.ms > filename.ps
  5. convert the postscript file to PDF with cupsfilter
    • groff provides functionality to convert postscript to PDF, but it was apparently not installed on my system
    • cupsfilter filename.ps > filename.pdf
    • rm filename.ps

A More Convenient Setup

  1. Use vim
  2. Add the following to your .vimrc (after downloading my gack script and adding it to your PATH)
    • nnoremap ,, :w<CR>:!gack %<CR><CR>
    • this binds a double-tap of the comma key to save your file, compile it, turn it into a pdf, and open it
  3. create a file with my nota script, edit it with vim (reference the cheatsheet script output), then compile with ,,

scripts

nota - create .ms file with some prefilled information (and open it in vim)

  • nota hello.ms, nota hello.ms cs265

gack - compile a .ms file into a PDF

  • gack hello.ms

cheatsheet - print out common groff-ms macros

  • cheatsheet

About

notes for the spring 2020 semester typeset in groff with ms macros

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages