aboutsummaryrefslogtreecommitdiff
path: root/fref.lex
diff options
context:
space:
mode:
Diffstat (limited to 'fref.lex')
-rw-r--r--fref.lex38
1 files changed, 13 insertions, 25 deletions
diff --git a/fref.lex b/fref.lex
index 4a34aa8..750711c 100644
--- a/fref.lex
+++ b/fref.lex
@@ -23,12 +23,12 @@
DO("da",da,e.da) /* Date (year). */ \
DO("ed",ed,e.ed) /* Editor. */ \
DO("hr",hr,e.hr) /* Hypertext reference. */ \
+ DO("is",is,e.is) /* Issuer, publisher. */ \
DO("jo",jo,e.jo) /* Journal. */ \
DO("la",la,e.la) /* Label. */ \
- DO("lg",lg,e.lg) /* Reference-specific language. */ \
+ DO("lc",lc,e.lc) /* Reference-specific language. */ \
DO("no",no,e.no) /* TODO: Issue number. */ \
- DO("pp",pp,e.pp) /* Pages. */ \
- DO("pu",pu,e.pu) /* Publisher. */ \
+ DO("pg",pg,e.pg) /* Page number(s). */ \
DO("se",se,e.se) /* TODO: Series. */ \
DO("ti",ti,e.ti) /* Title. */ \
DO("tr",tr,e.tr) /* Translator. */ \
@@ -38,7 +38,6 @@
void entry(void);
void field(char *);
- void harvard(void);
struct trans *gettrans(char *);
int pf(char *, ...);
@@ -143,23 +142,12 @@ field(char *s)
void
entry()
{
- /*
- Presently, fref supports only Harvard-style citations, but
- this allows for future extensions.
- */
- harvard();
-}
-
-/* Print Harvard-formatted entry. */
-void
-harvard()
-{
struct trans *t;
int i;
/* Get translation strings. */
- t = gettrans(*e.lg ? e.lg : lang);
- *e.lg = 0;
+ t = gettrans(*e.lc ? e.lc : lang);
+ *e.lc = 0;
/* Print label. */
pf("% = ", e.la);
@@ -191,21 +179,21 @@ harvard()
pf(", *%", t->vo, e.vo);
/* Print pages, converting hyphens to en dashes. */
- if(*e.pp){
- pf(", *", strpbrk(e.pp, ",-") ? t->pp : t->p);
- for(i = 0; i < strlen(e.pp); i++){
- if(e.pp[i] == '-') putchar('\\');
- putchar(e.pp[i]);
+ if(*e.pg){
+ pf(", *", strpbrk(e.pg, ",-") ? t->pp : t->p);
+ for(i = 0; i < strlen(e.pg); i++){
+ if(e.pg[i] == '-') putchar('\\');
+ putchar(e.pg[i]);
}
- *e.pp = 0;
+ *e.pg = 0;
}
pf(".\n");
/* Print translator. */
pf("*%.\n", t->tr, e.tr);
- /* Print city, publisher. */
- (pf("%: %.\n", e.ci, e.pu) || pf("%.\n", e.pu));
+ /* Print city, issuer. */
+ (pf("%: %.\n", e.ci, e.is) || pf("%.\n", e.is));
/* Print other information. */
pf("%.\n", e.xx);