From 750b1c9febf27760e70aa2ce49a7fd94121fd145 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Ankarstr=C3=B6m?= Date: Tue, 20 Jul 2021 02:20:48 +0200 Subject: Print volume, pages; add internet address field (%ad) --- refs.lex | 39 +++++++++++++++++++++++++++++++-------- 1 file changed, 31 insertions(+), 8 deletions(-) (limited to 'refs.lex') diff --git a/refs.lex b/refs.lex index 02ebbb0..b78fa4b 100644 --- a/refs.lex +++ b/refs.lex @@ -4,8 +4,11 @@ #define MAX 255 #define AND "och" + #define AVAIL "Tillgänglig: " #define ED "red." + #define PP "ss." #define TR "Övers." + #define VOL "vol." void field(char *); void entry(void); @@ -16,16 +19,17 @@ struct entry { int a; /* Number of authors. */ char au[MAX][MAX]; + char ad[MAX]; char al[MAX]; char bo[MAX]; char ci[MAX]; char da[MAX]; char ed[MAX]; char jo[MAX]; - char no[MAX]; - char pg[MAX]; + char no[MAX]; /* TODO */ + char pp[MAX]; char pu[MAX]; - char se[MAX]; + char se[MAX]; /* TODO */ char ti[MAX]; char tr[MAX]; char vo[MAX]; @@ -58,6 +62,7 @@ field(char *t) t[strcspn(t, "\n")] = 0; AS("au",e.au[e.a++]); + AS("ad",e.ad); AS("al",e.al); AS("bo",e.bo); AS("ci",e.ci); @@ -65,7 +70,7 @@ field(char *t) AS("ed",e.ed); AS("jo",e.jo); AS("no",e.no); - AS("pg",e.pg); + AS("pp",e.pp); AS("pu",e.pu); AS("se",e.se); AS("ti",e.ti); @@ -93,20 +98,38 @@ entry() if(i == e.a-1) printf("%s", e.au[i]); + /* Print date. */ (pf(" (%).\n", e.da) || (e.a ? pf(".\n") : 0)); - if (*e.bo || *e.jo){ + + /* Print title, book/journal. */ + if(*e.bo || *e.jo){ pf("%.\n", e.ti); pf("\\fI%\\fP", EI(e.bo, e.jo)); pf(" ("ED" %)", e.ed); - pf(".\n"); }else - pf("\\fI%\\fP.\n", e.ti); + pf("\\fI%\\fP", e.ti); + + /* Print volume, pages. */ + pf(", "VOL" %", e.vo); + pf(", "PP" %", e.pp); + pf(".\n"); + + /* Print translator. */ pf(TR" %.\n", e.tr); + + /* Print city, publisher. */ (pf("%: %.\n", e.ci, e.pu) || pf("%.\n", e.pu)); + /* Print other information. */ + pf("%.\n", e.QQ); + + /* Print internet address. */ + pf(AVAIL"%\n", e.ad); + #define CL(a) *a = 0 e.a = 0; + CL(e.ad); CL(e.al); CL(e.bo); CL(e.ci); @@ -114,7 +137,7 @@ entry() CL(e.ed); CL(e.jo); CL(e.no); - CL(e.pg); + CL(e.pp); CL(e.pu); CL(e.se); CL(e.ti); -- cgit v1.2.3