-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbibtex2web.html
669 lines (585 loc) · 20.8 KB
/
bibtex2web.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>bibtex2web: create webpages from BibTeX bibliography files</title>
</head>
<body>
<h1>bibtex2web: create webpages from BibTeX bibliography files</h1> <!-- omit from toc -->
<p>
The bibtex2web package creates
webpages from BibTeX bibliography files. It can be downloaded from
<a href="http://homes.cs.washington.edu/~mernst/software/#bibtex2web">http://homes.cs.washington.edu/~mernst/software/#bibtex2web</a>.
</p>
<p>Contents:</p>
<!-- start toc. do not edit; run html-update-toc instead -->
<ul>
<li><a href="#overview">Overview</a></li>
<li><a href="#installation-and-use">Installation and use</a></li>
<li><a href="#fields">BibTeX fields</a></li>
<li><a href="#arguments">Command-line arguments</a>
<ul>
<li><a href="#output-formats">Output formats</a>
<ul>
<li><a href="#htmlabstract">htmlabstract</a></li>
<li><a href="#htmlsummary">htmlsummary</a></li>
<li><a href="#htmllist">htmllist</a></li>
</ul></li>
<li><a href="#templates">Webpage templates</a></li>
</ul></li>
<li><a href="#new-chars">Supporting new LaTeX commands</a></li>
<li><a href="#problems">Reporting problems</a>
<ul>
<li><a href="#credits">Credits</a></li>
</ul></li>
<li><a href="#implementation-details">Implementation details</a>
<ul>
<li><a href="#to-do">To do</a></li>
</ul></li>
</ul>
<!-- end toc -->
<hr />
<h2><a name="overview">Overview</a></h2>
<p>
It is convenient to produce webpages from BibTeX files, because you only
need to keep one set of (BibTeX) sources up to date, thus avoiding skew
between your webpages and bibliographies.
</p>
<p>
Given a collection of BibTeX files, bibtex2web creates
</p>
<ul>
<li>one webpage per article (giving the abstract and a BibTeX entry, and
linking to the article itself and to the authors and venue)</li>
<li>a webpage listing all articles by date</li>
<li>a webpage listing all articles by topic</li>
<li>one webpage per author, listing that author's articles</li>
<li>a webpage listing all authors</li>
</ul>
<p>
Each of these webpages is built from a template that you can customize to
your liking; see below.
</p>
<p>
Here are two examples of sets of webpages that were created by bibtex2web:
</p>
<ul>
<li><a href="http://pag.csail.mit.edu/pubs/">http://pag.csail.mit.edu/pubs/</a></li>
<li><a href="http://homes.cs.washington.edu/~mernst/pubs/">http://homes.cs.washington.edu/~mernst/pubs/</a>
</ul>
<p>
The bibtex2web package consists of three programs:
</p>
<ul>
<li>bwconv.pl does most of the work</li>
<li>htmlabstract-split.pl assists with the creation of one webpage per article</li>
<li>make-author-pages.pl makes the author webpages (by calling bwconv.pl)</li>
</ul>
<p>
For examples of how to call these programs, see file examples/README in
this distribution.
</p>
<p>
Many
<a
href="http://www-sop.inria.fr/members/Gregoire.Malandain/codes/bibtex2html.html#htoc57">other
BibTeX to HTML translators</a> exist.
<!-- That list is out of date. For example, it does not contain
http://www.authopilot.com/xml/home.htm
-->
</p>
<hr />
<h2><a name="installation-and-use">Installation and use</a></h2>
<p>
To install bibtex2web, obtain the distribution (linked from <a href="http://homes.cs.washington.edu/~mernst/software/#bibtex2web">http://homes.cs.washington.edu/~mernst/software/#bibtex2web</a>),
unpack it, and then set your BPHOME
environment variable to point to its lib/ directory. For example, in csh,
add something like
</p>
<pre>
setenv BPHOME ${HOME}/bibtex2web/lib
</pre>
<p>
to your <tt>.cshrc</tt> file. You may need to log out and log back in for
this to take effect.
</p>
<p>
Then, you can run the programs in bin/. (You may add that directory to
your path if you wish, but it is not required.)
</p>
<p>
Files examples/README and examples/Makefile in this distribution for
examples of how to run bibtex2web and examples of the various command-line
arguments that bibtex2web's program accept. The easiest way to use
bibtex2web is to follow the instructions in examples/README and modify
examples/Makefile to fit your goals. More details will be added to this
manual later.
</p>
<hr />
<h2><a name="fields">BibTeX fields</a></h2>
<p>
bibtex2web works with ordinary BibTeX files, but it can take advantage of
several additional BibTeX fields:
</p>
<dl>
<dt>
abstract
</dt>
<dd>
The abstract, in LaTeX format.
Do not include blank lines to separate paragraphs; use
“\par” instead.
</dd>
<dt>
basefilename
</dt>
<dd>
The file name for the article itself, without the
extension. Automatically recognized extensions are
“.pdf”, “.doc”, “.docx”,
“.key”,
“.ppt”, “.pptx”,
“.odp”,
“.mov”,
“.mp4”,
and also
“-slides.*”,
“-talk.*”, or
“-poster.*”
with any of the preceding extensions.
You must put these files in the destination directory before
running the programs. The basefilename is also used for
the per-article webpage (which includes the abstract). If
the basefilename is not specified, then the entry's cite
key is used instead.
</dd>
<dt>
downloads
</dt>
<dd>
A list of other downloads, in addition to those automatically
detected by virtue of matching the basefilename. The list
is semicolon-separated, and each entry consists of a URL
(which may not contain whitespace) and anchor text (which
may contain whitespace), separated by whitespace.
</dd>
<dt>
downloadsnonlocal
</dt>
<dd>
A list of other downloads, used (in addition to the
“downloads” field) only if no local files are
found via the “basefilename” mechanism.
In other words, if you have a “basefilename”
attribute, and bibtex2web finds at least one of the files
it refers to, then bibtex2web skips processing the
“downloadsnonlocal” attribute.
</dd>
<dt>
nodownloads
</dt>
<dd>
If present, this field suppresses a warning that there are
no downloads for a given paper.
</dd>
<dt>
supersededby
</dt>
<dd>
A comma-separated list of keys of articles that supersede
this one. A superseded article does not get its own
per-article webpage, but is briefly noted on the webpage of
each article that supersedes it.
<br /><br />
Optionally, in the
comma-separated list, the key may be followed by whitespace
and (comma-free) text; when bibtex2web generates webpages,
that text is used instead of “A previous version”. For
instance, in a subsequent TR version, you could add the
field
<pre>
supersededby = "ConfVer An extended version",
</pre>
to ensure that the BibTeX entry with key “ConfVer” remains
the canonical version.
</dd>
<dt>
category
</dt>
<dd>
The name of the topic under which this article should be
listed in the by-topic webpage.
May contain multiple categories separated by commas.
<br /><br />
In general, when adding a
new entry, one should choose an existing category rather
than making up a new one (lest you end up with few papers
per category, defeating the purpose of this field).
</dd>
<dt>
summary
</dt>
<dd>
A brief description of the article that appears in the
by-topic webpage. To include the full abstracts of all the
papers would make that webpage too long.
For example, see
<a
href="http://pag.csail.mit.edu/pubs/bytopic.html">http://pag.csail.mit.edu/pubs/bytopic.html</a>
(where the standard is a 3-line description in the BibTeX file).
</dd>
<dt>
alsosee
</dt>
<dd>
This field is not currently processed.
</dd>
</dl>
<p>
You can also define your own additional fields. For instance, the example
Makefile that is distributed with bibtex2web uses the “-filter” argument
to the programs to make them ignore any article containing an “omitfromcv”
field. Additionally, it ignores any entry containing an “onlycrossref”
field (unless that field was inherited via a crossref); this permits info
about just the conferences from appearing. Another use of the “-filter”
argument is to create a separate webpage for any article containing an
“underreview” field.
</p>
<hr />
<h2><a name="arguments">Command-line arguments</a></h2>
<p>
The main program of the bibtex2web package is bwconv.pl. You can supply it
a variety of command-line arguments.
</p>
<dl>
<dt>
-format=<em>informat</em>[,<em>outformat</em>]<br />
-outformat=<em>outformat</em>
</dt>
<dd>
Required. -outformat need not be supplied if the optional
<em>outformat</em> part of the -format argument is supplied. For
instance, legal invocations include:
<pre>
-format=bibtex,htmlpubs
-format=bibtex,htmlsummary
-format=bibtex -outformat=htmlabstract
</pre>
</dd>
<dt>
-outopts
</dt>
<dd>
Additional arguments for the output format.
</dd>
<dt>
-to <em>file</em>
</dt>
<dd>
Places output in <em>file</em>.
</dd>
</dl>
<h3><a name="output-formats">Output formats</a></h3>
<p>
The output formats supported by bibtex2web are as follows.
</p>
<h4><a name="htmlabstract">htmlabstract</a></h4>
<p>
Creates one page per publication, giving the abstract and other details and
links to the paper itself.
</p>
<p>
If the “-linknames <em>link-names-file</em>” command-line option is also
given, then each author name (or conference name, etc.) becomes the anchor
text for a link to that author's homepage. It is recommended that you use,
as the argument to -linknames, the file
<a href="https://raw.githubusercontent.com/plume-lib/html-tools/master/html-canonical-urls"><code>plume-lib/bin/html-canonical-urls</code></a>,
from the <a href="https://github.com/plume-lib/html-tools">html-tools</a> project.
You can supply the -linknames option multiple times, so you can use the
html-canonical-urls file and then also your own augmentations. Feel free
to contribute improvements to the plume-lib version of the file.
</p>
<p>
By contrast, if the linkauthors option is given, then author names
on abstract pages are linked to the authors' publications lists. Here is
how to customize that behavior:
</p>
<dl>
<dt>
-outopts=linkauthors
</dt>
<dd>
Link author names to authors' (bibtex2web-generated) publications lists.
</dd>
<dt>
-outopts=linkauthors:myauthorslist
</dt>
<dd>
Override the default “authors” filename.
</dd>
<dt>
-outopts=withbibtex
</dt>
<dd>
Place a BibTeX entry on the summary page, ready for readers to cut and
paste into their own bibliographies.
</dd>
<dt>
-outopts=linkauthors\ withbibtex
</dt>
<dd>
Separate multiple options with spaces.
</dd>
</dl>
<p>
If the “-validurls <em>urls-file</em>” command-line argument is
given, then each URL in the file (one per line) is considered to be valid
and is not checked for validity.
</p>
<h4><a name="htmlsummary">htmlsummary</a></h4>
<p>
(The htmlsummary format needs to be documented here.)
</p>
<h4><a name="htmllist">htmllist</a></h4>
<p>
The htmllist output format generates a list of entry titles, each of which
links to the abstract page for that entry, separated by <code><br /></code> line
breaks. This is useful to generate a list of “recent publications” on a
home page. For example, see “Selected Publications” list on
<a href="http://pmg.csail.mit.edu/">http://pmg.csail.mit.edu/</a>.
</p>
<p>
Example make rule:
</p>
<pre>
index.html:
${BWBIN}/bwconv.pl -format=bibtex,htmllist -outopts=limit:5\ abstract_dir:pubs -headfoot index-headfoot.html -copyright ../copyright -to $@ $(FILTER) ${BIBFILES}
</pre>
<p>
The “limit” output option limits the list to the specified number of
entries (without this option, list is unlimited). The “abstract_dir”
option specifies the relative directory containing the per-entry
abstract files (default “../pubs”).
</p>
<h3><a name="templates">Webpage templates</a></h3>
<p>
You can specify how the generated webpages look by supplying templates.
The most common of these is supplied by the -headfoot argument to the
bwconv.pl program.
</p>
<p>
A template turns into the final webpage, but certain special strings are
replaced replaced first:
</p>
<dl>
<dt>
BODY
</dt>
<dd>
contains the actual content produced by bibtex2web
</dd>
<dt>
BIBTEX2WEB_NOTICE
</dt>
<dd>
is replaced by
<blockquote><p>This page was generated $timestamp by <a
href="http://homes.cs.washington.edu/~mernst/software/#bibtex2web">bibtex2web</a>
</p></blockquote>
where $timestamp is the local time in ctime(3) format.
</dd>
<dt>
COPYRIGHT_NOTICE
</dt>
<dd>
is replaced by the contents of the file specified by
the -copyright parameter.
Bug: this only works for files generated by bwconv directly, so it
doesn't work yet for the author index page (which uses
make-author-pages.pl) or the per-paper pages (which uses
htmlabstract-split.pl).
</dd>
</dl>
<h2><a name="new-chars">Supporting new LaTeX commands</a></h2>
<p>
bibtex2web has built-in support for many LaTeX commands, but you may find
additional commands that are not supported. A common symptom of an
unsupported command in an abstract is the warning
</p>
<pre>
bp warning (main): Unknown TeX characters (backslashes) in ...
</pre>
<p>
To support a new LaTeX command, you need to add information about how to
convert it to bibtex2web's internal representation (based on Unicode) and
from that representation to HTML and other formats. A good way to find the
places you need to change is to grep for “017C”, which is the Unicode code
for a z with a dot above it (ż), or for “21D2”, which is a right
arrow (⇒), and then mimic one or the other of them.
</p>
<p>
You can find Unicode character codes (and HTML equivalents) at one of these URLs:
<a
href="http://www.w3.org/TR/REC-html40/sgml/entities.html">http://www.w3.org/TR/REC-html40/sgml/entities.html</a>,
<a href="http://www.alanwood.net/unicode/arrows.html">http://www.alanwood.net/unicode/arrows.html</a>,
<a href="http://www.alanwood.net/demos/ansi.html">http://www.alanwood.net/demos/ansi.html</a>.
<!-- broken as of 2/5/2014:
<a
href="http://www.fileformat.info/info/unicode/char/search.htm">http://www.fileformat.info/info/unicode/char/search.htm</a>
-->
</p>
<hr />
<h2><a name="problems">Reporting problems</a></h2>
<p>
If you have any problems or questions, please contact Michael Ernst (<a
href="mailto:[email protected]">[email protected]</a>). I will do my
best to help, though I cannot make any guarantee.
</p>
<h3><a name="credits">Credits</a></h3>
<p>
bibtex2web was written by <a
href="http://homes.cs.washington.edu/~mernst/">Michael Ernst</a>, with
contributions by
<a href="http://www.pmg.csail.mit.edu/~ajmani/">Sameer Ajmani</a>.
</p>
<p>
bibtex2web builds on the bp library by Dana Jacobsen.
</p>
<p>
<a href="http://www.cs.cmu.edu/~dga/">David Andersen</a> contributed
patches and suggestions.
</p>
<!--
<p>
Patches and suggestions were contributed by a number of users, including
the following. (Please let us know if your name was inadvertently omitted
from this list.)
</p>
<ul>
<li><a href="http://www-2.cs.cmu.edu/~dga/">David Andersen</a></li>
</ul>
-->
<hr />
<h2><a name="implementation-details">Implementation details</a></h2>
<!-- bp is by Dana Jacobsen <[email protected]>, webpage http://www.ecst.csuchico.edu/~jacobsd/bib/bp/index.html was dated 2 January 1997 -->
<p>
bibtex2web is built on the bp Perl library. The bibtex2web
distribution is simply the bp distribution, with corrections and
enhancements. bp-README is the original README file for the bp Perl
library, and other files and directories have been similarly prefixed with
<code>bp-</code> to avoid confusion to users of bibtex2web. bp
documentation appeared at <a
href="http://web.archive.org/web/20071113143006/www.ecst.csuchico.edu/~jacobsd/bib/bp/index.html">http://www.ecst.csuchico.edu/~jacobsd/bib/bp/index.html</a>
(but wasn't packaged with bp itself). bp has not been supported
since December 1996, but it works well enough for me, particularly with my
enhancements. (Another library is btool, but bp is better.) Other systems
exist, but did not have the features I needed.
</p>
<p>
Under both Netscape and Internet Explorer, <br /> needs to be at the end of a
line rather than at the beginning of the next line, because otherwise there
can be two line breaks (i.e., a blank line) rather than just a single line
break.
</p>
<h3><a name="to-do">To do</a></h3>
<p>
Don't require an extra "/dl" close tag after BODY in webpage templates.
</p>
<p>
Change the behavior of "downloadsnonlocal" as follows:
</p>
<ul>
<li>
If the entry specifies "basefilename" but no local files are found,
emit a warning even if "downloadsnonlocal" is present. (Probably need
a way to override this.)
</li>
<li>
If both "basefilename" and "downloadsnonlocal" are present, use both
in some logical way: for instance, the tool could include just those
nonlocal downloads whose link names are different from any of the
local downloads.
</li>
</ul>
<p>
Permit multiple categories per entry, because some entries span categories.
I'm not sure how to do this without overhauling bwconv.pl.
</p>
<p>
Add additional cross-reference types (beyond supersededby), such as
permitting a later technical report that is linked from the page.
Examples: <a
href="http://homes.cs.washington.edu/~mernst/pubs/instantiating-generics-oopsla2004-abstract.html">http://homes.cs.washington.edu/~mernst/pubs/instantiating-generics-oopsla2004-abstract.html</a>,
<a href="http://pag.csail.mit.edu/pubs/deadlock-library-ecoop2005-abstract.html">http://pag.csail.mit.edu/pubs/deadlock-library-ecoop2005-abstract.html</a>.
(I think this may already be supported...)
</p>
<p>
Create a shared utility package for duplicated subroutines like
read_link_names.
Also, some code for the linkauthors option was copied from make-author-pages.pl;
this should be consolidated.
</p>
<p>
Permit printing superseded articles rather than suppressing them (but do
add links to the subsequent version); this gives a list of all
publications, including duplicates.
</p>
<p>
The Perl expressions in -filter arguments can get long;
permit simplifying them. For examples, add a -omitiffieldexists and/or
an -includeiffieldexists?
</p>
<p>
Add a noabstractpage field, to replace the old nobasefilename field.
<!--
(Then get rid of files Ernst89a-abstract.html and Ernst89c-abstract.html.)
-->
</p>
<!-- Such a trivial non-problem that I've commented it out. -->
<!--
<p>
htmllist output format : generates a newline (in the HTML source)
is generated for each entry, even if it's omitted! Is there a way to tell
the system to stop processing entries?
</p>
-->
<p>
When the <code>-q</code> flag is supplied, this warning message
</p>
<pre>
Parsing of undecoded UTF-8 will give garbage when decoding entities at checklink.pl line 1075.
</pre>
<p>
appears to be referring to the last page whose URL is printed (the last
page for which there was a problem). The warning message is coming from
HTML::Parser, but I can't find the exact place in the code (maybe it's in
C, not Perl?), and the parse method doesn't return an error status. The
workaround is to run without the <code>-q</code> command-line option,
determine where the problem is, and fix it.
Alternately, follow these suggestsions from HTML::Parser:
The solution is to use the Encode::encode_utf8() on the data before
feeding it to the $p->parse(). For $p->parse_file() pass a file that
has been opened in ":utf8" mode.
The parser can process raw undecoded UTF-8 sanely if the C<utf8_mode>
is enabled or if the "attr", "@attr" or "dtext" argspecs is avoided.
</p>
</body>
</html>
<!-- LocalWords: bibtex webpages htmlabstract htmlsummary htmllist bwconv pl
-->
<!-- LocalWords: README BPHOME csh setenv basefilename ps pdf ppt alsosee dir
-->
<!-- LocalWords: downloadsnonlocal supersededby omitfromcv onlycrossref html
-->
<!-- LocalWords: crossref underreview informat outformat htmlpubs outopts bp
-->
<!-- LocalWords: linknames linkauthors myauthorslist withbibtex BWBIN BibTeX
-->
<!-- LocalWords: headfoot BIBFILES timestamp ctime Sameer Ajmani btool br dl
-->
<!-- LocalWords: noabstractpage nobasefilename Webpage webpage ConfVer grep
-->
<!-- LocalWords: omitiffield includeiffield nodownloads validurls urls LNCS
-->
<!-- LocalWords: STDERR url
-->