Skip to content

Commit 29847d2

Browse files
committed
Add preliminary rule for generating PDFs with groff
1 parent e3b85f9 commit 29847d2

File tree

3 files changed

+145
-0
lines changed

3 files changed

+145
-0
lines changed

Makefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ pdf :
44
pandoc --citeproc --csl=src/mla8.csl -o output.pdf --template=src/mla8_pandoc_template.latex temp.md
55
rm temp.md
66

7+
pdfroff :
8+
cat README.md > temp.md
9+
cat src/hanging_indent_bib.md >> temp.md
10+
pandoc --csl=src/mla8.csl -t ms -o output.pdf --template=src/mla8_pandoc_template.roff temp.md --citeproc
11+
rm temp.md
12+
713
docx :
814
cat README.md > temp.md
915
echo >> temp.md

src/hanging_indent_bib.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
2+
# Works Cited

src/mla8_pandoc_template.roff

Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+
.\" **** Custom macro definitions *********************************
2+
.\" * Super/subscript
3+
.\" (https://lists.gnu.org/archive/html/groff/2012-07/msg00046.html)
4+
.ds { \v'-0.3m'\\s[\\n[.s]*9u/12u]
5+
.ds } \s0\v'0.3m'
6+
.ds < \v'0.3m'\s[\\n[.s]*9u/12u]
7+
.ds > \s0\v'-0.3m'
8+
.\" * Horizontal line
9+
.de HLINE
10+
.LP
11+
.ce
12+
\l'20'
13+
..
14+
$if(highlighting-macros)$
15+
.\" * Syntax highlighting macros
16+
$highlighting-macros$
17+
$endif$
18+
.\" **** Settings *************************************************
19+
.\" text width
20+
.nr LL 6.0i
21+
.\" left margin
22+
.nr PO 1.0i
23+
.\" top margin
24+
.nr HM 1.0i
25+
.\" bottom margin
26+
.nr FM 1.0i
27+
.\" header/footer width
28+
.nr LT \n[LL]
29+
.\" point size
30+
.nr PS 12p
31+
.\" line height
32+
.nr VS 24p
33+
.\" font family: A, BM, H, HN, N, P, T, ZCM
34+
.\" .fam P
35+
.fam T
36+
.\" paragraph indent
37+
.nr PI 0.5i
38+
.\" interparagraph space
39+
.nr PD 0.4v
40+
.\" footnote width
41+
.nr FL \n[LL]
42+
.\" footnote point size
43+
.nr FPS (\n[PS] - 2000)
44+
$if(papersize)$
45+
.\" paper size
46+
.ds paper $papersize$
47+
$endif$
48+
.\" color used for strikeout
49+
.defcolor strikecolor rgb 0.7 0.7 0.7
50+
.\" color for links (rgb)
51+
.ds PDFHREF.COLOUR 0.35 0.00 0.60
52+
.\" border for links (default none)
53+
.ds PDFHREF.BORDER 0 0 0
54+
.\" point size difference between heading levels
55+
.nr PSINCR 1p
56+
.\" heading level above which point size no longer changes
57+
.nr GROWPS 2
58+
.\" comment these out if you want a dot after section numbers:
59+
.als SN SN-NO-DOT
60+
.als SN-STYLE SN-NO-DOT
61+
62+
.\" page numbers in the header, right justified
63+
.rm CH
64+
$if(hauthor)$
65+
.ds RH $hauthor$ %
66+
$else$
67+
.ds RH %
68+
$endif$
69+
70+
.\" pdf outline fold level
71+
.nr PDFOUTLINE.FOLDLEVEL 3
72+
.\" start out in outline view
73+
.pdfview /PageMode /UseOutlines
74+
.\" ***************************************************************
75+
.\" PDF metadata
76+
.pdfinfo /Title "$title-meta$"
77+
.pdfinfo /Author "$author-meta$"
78+
$if(adjusting)$
79+
.ad $adjusting$
80+
$endif$
81+
$if(hyphenate)$
82+
.hy
83+
$else$
84+
.nh
85+
$endif$
86+
$if(has-inline-math)$
87+
.EQ
88+
delim @@
89+
.EN
90+
$endif$
91+
$for(header-includes)$
92+
$header-includes$
93+
$endfor$
94+
$for(author)$
95+
.\" .AU
96+
$author$
97+
.\" .sp
98+
.br
99+
$endfor$
100+
$if(instructor)$
101+
$instructor$
102+
.\" .sp
103+
.br
104+
$endif$
105+
$if(course)$
106+
$course$
107+
.br
108+
$endif$
109+
110+
$if(date)$
111+
.\" .AU
112+
.sp 0.5
113+
.ft R
114+
$date$
115+
$endif$
116+
$if(title)$
117+
.TL
118+
$title$
119+
$endif$
120+
$if(abstract)$
121+
.AB
122+
$abstract$
123+
.AE
124+
$endif$
125+
.\" 1 column (use .2C for two column)
126+
.1C
127+
$for(include-before)$
128+
$include-before$
129+
$endfor$
130+
$body$
131+
$if(toc)$
132+
.TC
133+
$endif$
134+
$for(include-after)$
135+
$include-after$
136+
$endfor$
137+
.pdfsync

0 commit comments

Comments
 (0)