1414 * (enclosed in the file GPL).
1515 *)
1616
17- (* i $Id: translate.ml,v 1.70 2005-01-19 13:52 :02 filliatr Exp $ i*)
17+ (* i $Id: translate.ml,v 1.71 2006-05-12 16:05 :02 filliatr Exp $ i*)
1818
1919(* s Production of the HTML documents from the BibTeX bibliographies. *)
2020
@@ -45,10 +45,12 @@ let bibentries_file = ref ""
4545let title_url = ref false
4646let use_label_name = ref false
4747let use_keys = ref false
48- let table = ref true
4948let note_fields = ref ([] : string list )
5049let abstract_name = ref " Abstract"
5150
51+ type table_kind = Table | DL | NoTable
52+ let table = ref Table
53+
5254(* internal name, plus optional external name *)
5355type field_info = string * (string option )
5456
@@ -156,7 +158,7 @@ let footer ch =
156158 Html. open_href ch own_address;
157159 output_string ch " bibtex2html" ;
158160 Html. close_href ch;
159- output_string ch " " ; output_string ch Version. version;
161+ output_string ch " " ; output_string ch Version. version; output_string ch " . " ;
160162 Html. close_balise ch " em" ;
161163 Html. close_balise ch " p" ;
162164 output_string ch " \n " ;
@@ -335,37 +337,44 @@ let separate_file (b,((_,k,f) as e)) =
335337 close_out ch;
336338 in_summary := true
337339
338- let open_table ch =
339- Html. open_balise ch (if ! table then " table" else " dl" )
340-
341- let close_table ch =
342- Html. close_balise ch (if ! table then " table" else " dl" )
343-
344- let open_row ch =
345- if ! table then begin
346- Html. open_balise ch " tr valign=\" top\" " ; output_string ch " \n " ;
347- Html. open_balise ch " td align=\" right\" " ; output_string ch " \n "
348- end else begin
349- Html. open_balise ch " dt" ; output_string ch " \n "
350- end
351-
352- let new_column ch =
353- if ! table then begin
354- Html. close_balise ch " td" ; output_string ch " \n " ;
355- Html. open_balise ch " td" ; output_string ch " \n "
356- end else begin
357- Html. close_balise ch " dt" ; output_string ch " \n " ;
358- Html. open_balise ch " dd" ; output_string ch " \n "
359- end
360-
361- let close_row ch =
362- if ! table then begin
363- Html. close_balise ch " td" ; output_string ch " \n " ;
364- Html. close_balise ch " tr" ; output_string ch " \n "
365- end else begin
366- (* JK Html.paragraph ch; output_string ch "\n"; *)
367- Html. close_balise ch " dd" ; output_string ch " \n "
368- end
340+ let open_table ch = match ! table with
341+ | Table -> Html. open_balise ch " table"
342+ | DL -> Html. open_balise ch " dl"
343+ | NoTable -> ()
344+
345+ let close_table ch = match ! table with
346+ | Table -> Html. close_balise ch " table"
347+ | DL -> Html. close_balise ch " dl"
348+ | NoTable -> ()
349+
350+ let open_row ch = match ! table with
351+ | Table ->
352+ Html. open_balise ch " tr valign=\" top\" " ; output_string ch " \n " ;
353+ Html. open_balise ch " td align=\" right\" " ; output_string ch " \n "
354+ | DL ->
355+ Html. open_balise ch " dt" ; output_string ch " \n "
356+ | NoTable ->
357+ Html. open_balise ch " p"
358+
359+ let new_column ch = match ! table with
360+ | Table ->
361+ Html. close_balise ch " td" ; output_string ch " \n " ;
362+ Html. open_balise ch " td" ; output_string ch " \n "
363+ | DL ->
364+ Html. close_balise ch " dt" ; output_string ch " \n " ;
365+ Html. open_balise ch " dd" ; output_string ch " \n "
366+ | NoTable ->
367+ output_string ch " \n "
368+
369+ let close_row ch = match ! table with
370+ | Table ->
371+ Html. close_balise ch " td" ; output_string ch " \n " ;
372+ Html. close_balise ch " tr" ; output_string ch " \n "
373+ | DL ->
374+ (* JK Html.paragraph ch; output_string ch "\n"; *)
375+ Html. close_balise ch " dd" ; output_string ch " \n "
376+ | NoTable ->
377+ Html. close_balise ch " p"
369378
370379let one_entry_summary ch biblio (_ ,b ,((_ ,k ,f ) as e )) =
371380 if ! Options. debug then begin
@@ -380,9 +389,8 @@ let one_entry_summary ch biblio (_,b,((_,k,f) as e)) =
380389 if ! multiple then Html. open_href ch (k ^ ! link_suffix);
381390 latex2html ch (if ! use_keys then k else Hashtbl. find cite_tab k);
382391 if ! multiple then Html. close_href ch;
383- end
384- else
385- output_string ch " " ;
392+ end else
393+ if ! table <> NoTable then output_string ch " " ;
386394 Html. close_anchor ch;
387395 if (not ! nokeys) or ! multiple then output_string ch " ]" ;
388396 (* end of JK changes *)
@@ -493,13 +501,14 @@ let format_list biblio sorted_bl keys =
493501 first_pass sorted_bl;
494502 bibentries_file := ! output_file ^ " _bib" ;
495503 if ! both then begin
504+ let old_print_keywords = ! print_keywords in
496505 (* short version *)
497506 print_abstract := false ;
498507 print_keywords := false ;
499508 summary biblio sorted_bl;
500509 (* long version with abstracts and keywords *)
501510 print_abstract := true ;
502- print_keywords := true ;
511+ print_keywords := old_print_keywords ;
503512 let old_output = ! output_file in
504513 output_file := ! output_file ^ " _abstracts" ;
505514 summary biblio sorted_bl;
0 commit comments