-
CS260 - Computer Architecture II
-
CS265 - Computer Theory I
-
CS335 - Software Design and Analysis III
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).
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
- create a file named
filename.ms
- check out my script that prefills some information into the file
- check the macros available to you
- check out my script that lists out some of the common ms macros, for reference
- type your document
- compile
filename.ms
into postscript withgroff
(or skip steps 4 and 5 by using my script)groff -ms filename.ms > filename.ps
- convert the postscript file to PDF with
cupsfilter
groff
provides functionality to convert postscript to PDF, but it was apparently not installed on my systemcupsfilter filename.ps > filename.pdf
rm filename.ps
A More Convenient Setup
- Use vim
- Add the following to your
.vimrc
(after downloading mygack
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
- create a file with my
nota
script, edit it with vim (reference thecheatsheet
script output), then compile with,,
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