-.\" cv.tmac - troff/groff macros for a CV PDF document
-.\" by Cian Bagshaw (2022)
+.ps 12
+.vs 13
.
-.\" macros are documented in the format:
-.\" .MA - macro description: arguments
-.
-.ps 12 \" text point size
-.vs 13 \" vertical line spacing
-.
-.\" .LB - left border for content between .LB and .BE
.de LB
-.nr LB \\n(nl \" record start position
-.in +.5m \" indent text, yielding space for line
+. nr LB \\n(nl
+. in +.5m
..
-.\" .BE - left border content end, draw border/line
.de BE
-.in -.5m \" reset indent
-.nr LB \\n(nl-\\n(LB \" get and store area height (current-start pos)
-\v'-\\n(LBu-1v'\L'\\n(LBu' \" go up to start, and draw a line back down
-.sp 0 \" newline
+. in -.5m
+. nr LB \\n(nl-\\n(LB
+\v'-\\n(LBu-1v'\L'\\n(LBu'
+. sp 0
..
-.\" .HS - start heading, render title and content between .HS and .HE: name,
-.\" picture.pdf (optional)
.de HS
-.nr HS \\n(nl \" record start position
-\X'pdf: pdfpic \\$2 -L 2i' \" gropdf pdfpic, left alligned, 2i wide
-.in +2.2i \" indent text to left of image
-.ps 40 \" set title size
-.sp 1.3 \" newline
-\\$1 \" print title name
-.ps \" reset font size
-.sp 0.3 \" newline
-.ps +3 \" subtitle and info font size
-\fICurriculum Vitae\fP \" italic subtitle
-.sp 0.7 \" newline
-.LB \" start left border for info text
-.sp 0.3 \" newline
+. nr HS \\n(nl
+\X'pdf: pdfpic \\$2 -L 2i'
+. in +2.2i
+. ps 40
+. sp 1.3
+\\$1
+. ps
+. sp 0.3
+. ps +3
+\fICurriculum Vitae\fP
+. sp 0.7
+. LB
+. sp 0.3
..
-.\" .HE - end heading
.de HE
-.BE \" end border
-.ps \" reset font size
-.in -2.2i \" reset indent
-.sp \\n(HSu+2i+1v-\\n(nlu \" newline of correct size (start+2i+1v-end)
+. BE
+. ps
+. in -2.2i
+. sp \\n(HSu+2i+1v-\\n(nlu
..
-.\" .IN - info colon separated: label, value
.de IN
-.ta T 0.7i \" set tab size
-\fB\\$1:\fP\t\\$2 \" print bold label with colon, tab, value in roman
-.sp 0.3 \" newline
-.ta T 0.5 \" reset tab size
+. ta T 0.7i
+\fB\\$1:\fP\t\\$2
+. sp 0.3
+. ta T 0.5
..
-.\" .LS - list with columns: items per column, column width (ems)
.de LS
-.sp .3 \" newline
-.nr LC \\$1 \" record max items per column
-.nr LW \\$2 \" record column width
-.nr LS \\n(nl \" record top position
-.nr LI 0 \" record current number of items (0)
-.nr NC 0 \" record current number of columns (0)
+. sp .3
+. nr LC \\$1
+. nr LW \\$2
+. nr LS \\n(nl
+. nr LI 0
+. nr NC 0
..
-.\" .LI - list item: text
.de LI
-.nr CI \\n(NC*\\n(LW \" record/calculate indent (columns*width)
-.nr LI \\n(LI+1 \" record/calculate item number
-.nr NC \\n(LI/\\n(LC \" record/calculate number of columns (itemNumber/max)
-.in \\n(CI+1.2 \" indent
-\(bu \\$1\" \" print bullet and text
-.sp .3 \" newline
-.if !\\n(LI%\\n(LC .sp \\n(LSu-\\n(nlu \" if new column, go to top
+. nr CI \\n(NC*\\n(LW
+. nr LI \\n(LI+1
+. nr NC \\n(LI/\\n(LC
+. in \\n(CI+1.2
+\(bu \\$1\"
+. sp .3
+. if !\\n(LI%\\n(LC \
+. sp \\n(LSu-\\n(nlu
..
-.\" .LE - list end
.de LE
-.in -\\n(CI+1.2 \" reset indent (-currentIndent)
-.sp \\n(LSu-\\n(nlu+\\n(LCv+1 \" space to bottom of list (top-position+items+1)
+. in -\\n(CI+1.2
+. sp \\n(LSu-\\n(nlu+\\n(LCv+1
..
-.\" .SH - section heading: name
.de SH
-.sp 1.5 \" newline
-.ps 20 \" heading font-size
-\v'.3m'\l'6.5i'\h'-6.5i'\v'-.3m'\\$1 \" go down, draw line, go back, go up, print title
-.sp .3m \" newline
-.ps \" reset font size
+. sp 1.5
+. ps 20
+\v'.3m'\l'6.5i'\h'-6.5i'\v'-.3m'\\$1
+. sp .3m
+. ps
..
-.\" .DA - date timeline, description between .DA and .DE: from, to, place,
-.\" course/position (optional)
.de DA
-.sp .5 \" newline
-.in +1.2 \" indent
-.ll -1.2 \" decrease line-length respectively
-\fI\\$1 \- \\$2\fP \" print dates in bold
-.in +1i \" indent text to the right of date
-.sp -1 \" go up a line (indent causes newline)
-.LB \" start left border
-\fB\\$3\fP \" title
-.sp 0 \" newline
-.if \\n(.$.=4 \fB\\$4\fP: \" if course specified, print bold
+. sp .5
+. in +1.2
+. ll -1.2
+\fI\\$1 \- \\$2\fP
+. in +1i
+. sp -1
+. LB
+\fB\\$3\fP
+. sp 0
+. if \\n(.$.=4 \fB\\$4\fP:
..
-.\" .DE - date end
.de DE
-.BE \" end border
-.in -1i+1.2 \" reset indent
-.ll +1.2 \" reset line length
-.sp -1
+. BE
+. in -1i+1.2
+. ll +1.2
+. sp -1
..
-.\" .DF - draw footer and start new page
.de DF
-'sp \" newline, no text break
-.tl ''\s-2\\*(FO\s+2'' \" draw centered footer title, from FO string
-'sp 2 \" newlines, no text break
+' sp
+. tl ''\s-2\\*(FO\s+2''
+' sp 2
..
-.\" set trap for .DF macro, 2m from bottom of each page
.wh -2m DF