aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mk/krefer.tmac82
1 files changed, 82 insertions, 0 deletions
diff --git a/mk/krefer.tmac b/mk/krefer.tmac
new file mode 100644
index 0000000..78de825
--- /dev/null
+++ b/mk/krefer.tmac
@@ -0,0 +1,82 @@
+.\" "/.
+.\" refer support for mk "/.
+.\" (harvard) "/.
+.\" "/.
+.\" Permission to use, copy, modify and/or "/.
+.\" distribute this software for any purpose "/.
+.\" with or without fee is hereby granted. "/.
+.\" "/.
+.\" Use the following command line: "/.
+.\" refer -P -S -e -p <bib> "/.
+.\" "/.
+.\" If you want to use a manual inline "/.
+.\" citation format, provide the -k flag and "/.
+.\" put the correct reference format in the "/.
+.\" %L field of each reference, e.g.: "/.
+.\" %L Davidson et al 1990 "/.
+.\" "/.
+.
+.eo
+.
+. \" translation of "and" in author list
+. ds [& and
+.
+. \" oxford comma in author list (disabled by default)
+. ds [,
+.
+.\" ]< -- begin reference list
+.de ]<
+..
+.
+.\" ]> -- end reference list
+.de ]>
+..
+.
+.\" ][ -- put full reference
+.de ][
+. [\$1
+..
+.
+.\" [0 -- other
+.de [0
+. x
+. [a
+\*([A
+..
+.
+.\" [1 -- book
+.
+.\" [2 -- article
+.
+.\" [3 -- journal article
+.
+.\" [4 -- tech report
+.
+.\" [5 -- ???
+.
+.\" [a -- replace "(,) and" in list of authors
+.de [a
+. if '\*([,',' .if '\*([&'and' .return
+.
+. \" replace ", and "
+. index _ [A ", and
+. if \n_>-1 \{\
+. ds _a \*([A
+. ds _b \*([A
+. substring _a 0 \n_-3
+. substring _b \n_+4
+. ds [A "\*(_a\*([, \*([& \*(_b
+. return
+.\}
+.
+. \" replace " and "
+. index _ [A " and
+. if \n_=-1 .return
+. ds _a \*([A
+. ds _b \*([A
+. substring _a 0 \n_
+. substring _b \n_+2
+. ds [A "\*(_a \*([& \*(_b
+..
+.
+.ec