From 80529f0b47ab620f7f219511d9211e105faf1f2b Mon Sep 17 00:00:00 2001 From: John Ankarstrom Date: Sun, 4 Jul 2021 12:24:35 +0200 Subject: Add krefer.tmac (work in progress) --- mk/krefer.tmac | 82 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 mk/krefer.tmac 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 "/. +.\" "/. +.\" 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 -- cgit v1.2.3