1HXCITE(1)                       HTML-XML-utils                       HXCITE(1)
2
3
4

NAME

6       hxcite - replace bibliographic references by hyperlinks
7

SYNOPSIS

9       hxcite  [  -b base ] [ -p pattern ] [ -a auxfile ] [ -m marker ] [ -c ]
10       bibfile [ file ]
11

DESCRIPTION

13       The hxcite commands copies the file to  standard  output,  looking  for
14       strings  of  the form [[label]].  The label may not include white space
15       and the double pair of square brackets must enclose the  label  without
16       any  spaces  in  between. If hxcite finds the label in the bibfile, the
17       string is replaced by the pattern.  The  pattern  can  include  certain
18       variables. If the label is not found in bibfile, it is left unchanged.
19
20       The default pattern replaces the string with a hyperlink, but if the -p
21       option is used, the replacement can be any pattern. The  input  doesn't
22       even have to be HTML.
23
24       If the label is enclosed in {{...}} instead of [[...]], it is copied to
25       the output unchanged and not replaced by the pattern, but the label  is
26       still searched in the bibfile.
27

OPTIONS

29       The following options are supported:
30
31       -p pattern
32                 Specifies  the  pattern  by  which  the  string  [[label]] is
33                 replaced.  The pattern may include the variables %b (which is
34                 replaced  by  the  value  of  the  -b  option),  %m (which is
35                 replaced by the value of the -m  option)  and  %L  (which  is
36                 replaced by the label).  The default pattern is
37
38                     <a href="%b#%L" rel="biblioentry">[%L]<!--{{%m%L}}--></a>
39
40
41       -b base   Sets  the value for the %b variable in the pattern. Typically
42                 this is set to a relative or absolute URL.  By  default  this
43                 value is an empty string.
44
45       -a auxfile
46                 All labels that have been found and replaced are also written
47                 to a file. This is so that hxmkbib(1) can find them and  cre‐
48                 ate  a  bibliography. The default auxfile is constructed from
49                 the name of the file by removing the last extension (if  any)
50                 and replacing it by ".aux".  If no file is given, the default
51                 name is "aux.aux".
52
53       -m marker By default, the program looks for "[[name]]", but it  can  be
54                 made  to look for "[[#name]]" where # is some string, usually
55                 a symbol such as '!' or '='. This  allows  references  to  be
56                 classified,  e.g.,  "[[!name]]"  for normative references and
57                 "[[name]]" for non-normative references.
58
59       -c        Causes "[[name]]" to be ignored when  it  occurs  inside  XML
60                 comments  ("<!--...-->"). This is useful for files where such
61                 labels occur in comments, to avoid that they be expanded  and
62                 possibly  lead  to  invalid  output; useful also if hxcite is
63                 used for non-HTML files which may contain "<!--" that are not
64                 comment.  Occurrences  of  "{{name}}" are not affected by -c.
65                 (But see warning under BUGS below.)
66

OPERANDS

68       The following operands are supported:
69
70       bibfile   The name of a bibliographic database must be given.  It  must
71                 be  a  file  in  refer(1) format and every entry must have at
72                 least a %L field, which is used as  label.  (Entries  without
73                 such a field will be ignored.)
74
75       file      The  name  of  the  input file is optional. If absent, hxcite
76                 will read from stdin. The file does not have to  be  an  HTML
77                 file,  but  the  default  pattern (see the -p option) assumes
78                 HTML.
79

DIAGNOSTICS

81       The following exit values are returned:
82
83       0         Successful completion.
84
85       > 0       An error occurred. Usually this is because a file  could  not
86                 be  opened.   Very  rarely  it  may  also be an out of memory
87                 error.
88

BUGS

90       hxcite does not actually parse HTML or XML input and the -c option sim‐
91       ply  treats  every  occurence of "<!--" as the start of an XML comment,
92       even if it occurs inside an attribute value or a CDATA  section.  Like‐
93       wise for "-->" for the end of a comment.
94
95       There  is  currently no way to use numbers for references (e.g., "[1]",
96       "[2]") instead of the labels ("[Lie1996]", "[UTN22]").
97
98       hxcite requires the %L (label) field to be present in  every  entry  in
99       bibfile, which is not the case for refer(1).  hxcite does not implement
100       refer's keyword search.
101

EXAMPLE

103       The  following  looks  for  reference  of  the  form  "[[!label]]"   in
104       "myfile.html", skipping references that occur inside HTML comments, and
105       looks  up  the  labels  in  "biblio.ref".  The  output  is  written  to
106       "new.html" and the list of recognized labels to "myfile.aux".
107
108           hxcite -c -m '!' biblio.ref myfile.html > new.html
109
110

SEE ALSO

112       asc2xml(1), refer(1), hxmkbib(1), hxnormalize(1), hxnum(1), hxprune(1),
113       hxtoc(1), hxunent(1), xml2asc(1), UTF-8 (RFC 2279)
114

HISTORY

116       March 2000: created by Bert Bos <bert@w3.org> as "cite".
117
118       August 2008: renamed to "hxcite".
119
120       Currently maintained by Bert Bos.
121
122
123
1245.x                               21 Nov 2008                        HXCITE(1)
Impressum