bibtex2html-1.99/0000755000246300004300000000000013255132747013242 5ustar filliatrvalsbibtex2html-1.99/bbl_lexer.mll0000644000246300004300000000604313255132746015710 0ustar filliatrvals(**************************************************************************) (* bibtex2html - A BibTeX to HTML translator *) (* Copyright (C) 1997-2014 Jean-Christophe Filliâtre and Claude Marché *) (* *) (* This software is free software; you can redistribute it and/or *) (* modify it under the terms of the GNU General Public *) (* License version 2, as published by the Free Software Foundation. *) (* *) (* This software is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *) (* *) (* See the GNU General Public License version 2 for more details *) (* (enclosed in the file GPL). *) (**************************************************************************) (*i $Id: bbl_lexer.mll,v 1.9 2010-02-22 07:38:19 filliatr Exp $ i*) (*s Lexer to analyze \verb!.bbl! files. *) { open Lexing exception End_of_biblio let opt_ref = ref None let key = ref "" let brace_depth = ref 0 let buf = Buffer.create 1024 } rule biblio_header = parse | "\\begin{thebibliography}" '{' [^ '}']* '}' { biblio_name lexbuf } | eof { raise End_of_file } | _ { biblio_header lexbuf } and biblio_name = parse | '[' [^ ']']* ']' { let l = lexeme lexbuf in let s = String.sub l 1 (String.length l - 2) in Some s } | _ { None } and bibitem = parse | "\\end{thebibliography}" { raise End_of_biblio } | '\\' ['a'-'z']* "bibitem" { brace_depth := 0; begin try bibitem1 lexbuf with Failure _ -> opt_ref := None end; bibitem2 lexbuf } | _ { bibitem lexbuf } and bibitem1 = parse | '[' { Buffer.reset buf; opt_ref := Some (bibitem1_body lexbuf) } and bibitem1_body = parse | ']' { Buffer.contents buf } | "%\n" { bibitem1_body lexbuf } | _ { Buffer.add_char buf (lexeme_char lexbuf 0); bibitem1_body lexbuf } | eof { raise End_of_file } and bibitem2 = parse | '{' { Buffer.reset buf; key := bibitem2_body lexbuf; skip_end_of_line lexbuf; Buffer.reset buf; bibitem_body lexbuf } and bibitem2_body = parse | '}' { Buffer.contents buf } | "%\n" { bibitem2_body lexbuf } | _ { Buffer.add_char buf (lexeme_char lexbuf 0); bibitem2_body lexbuf } | eof { raise End_of_file } and bibitem_body = parse | "\n\n" { let s = Buffer.contents buf in (!opt_ref, !key, s) } | eof { raise End_of_file } | "\\%" { Buffer.add_string buf "\\%"; bibitem_body lexbuf } | "%\n" { bibitem_body lexbuf } | _ { Buffer.add_char buf (lexeme_char lexbuf 0); bibitem_body lexbuf } and skip_end_of_line = parse | [' ' '\n' '\010' '\013' '\009' '\012'] + { () } | _ { skip_end_of_line lexbuf } bibtex2html-1.99/bib2bib.ml0000644000246300004300000002142313255132746015070 0ustar filliatrvals(**************************************************************************) (* bibtex2html - A BibTeX to HTML translator *) (* Copyright (C) 1997-2014 Jean-Christophe Filliâtre and Claude Marché *) (* *) (* This software is free software; you can redistribute it and/or *) (* modify it under the terms of the GNU General Public *) (* License version 2, as published by the Free Software Foundation. *) (* *) (* This software is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *) (* *) (* See the GNU General Public License version 2 for more details *) (* (enclosed in the file GPL). *) (**************************************************************************) open Printf open Bibtex (* command-line arguments *) let input_file_names = ref ([] : string list) let bib_output_file_name = ref "" let php_output_file_name = ref "" let cite_output_file_name = ref "" let get_input_file_name f = input_file_names := f :: !input_file_names let condition = ref Condition.True let add_condition c = try let c = Parse_condition.condition c in condition := if !condition = Condition.True then c else Condition.And(!condition,c) with Condition_lexer.Lex_error msg -> prerr_endline ("Lexical error in condition: "^msg); exit 1 | Parsing.Parse_error -> prerr_endline "Syntax error in condition"; exit 1 let expand_abbrevs = ref false let expand_xrefs = ref false let no_comment = ref false let sort_criteria = ref [] let reverse_sort = ref false let remove_fields = ref [] let rename_field = ref "" let rename_fields = ref [] let args_spec = [ ("-ob", Arg.String (fun f -> bib_output_file_name := f), " uses as name for output bibliography file"); ("-oc", Arg.String (fun f -> cite_output_file_name := f), " uses as name for output citations file"); ("--php-output", Arg.String (fun f -> php_output_file_name := f), " outputs resulting bibliography in PHP syntax in file "); ("-c", Arg.String (add_condition)," adds as a filter condition"); ("-w", Arg.Set Options.warn_error, "stop on warning"); ("--warn-error", Arg.Set Options.warn_error, "stop on warning"); ("-d", Arg.Set Options.debug, "debug flag"); ("-q", Arg.Set Options.quiet, "quiet flag"); ("--quiet", Arg.Set Options.quiet, "quiet flag"); ("-s", Arg.String (fun s -> sort_criteria := (String.lowercase_ascii s):: !sort_criteria), " sort with respect to keys (if c=$key) or a given field "); ("-r", Arg.Set reverse_sort, "reverse the sort order"); ("--no-comment", Arg.Unit (fun () -> no_comment := true), "do not add extra comments at beginning"); ("--remove", Arg.String (fun s -> remove_fields := (String.lowercase_ascii s):: !remove_fields), " removes the field "); ("--rename", Arg.Tuple [ Arg.Set_string rename_field ; Arg.String (fun s -> rename_fields := (String.lowercase_ascii !rename_field, String.lowercase_ascii s):: !rename_fields)], " rename field into "); ("--expand", Arg.Unit (fun () -> expand_abbrevs := true), "expand the abbreviations"); ("--expand-xrefs", Arg.Unit (fun () -> expand_xrefs := true), "expand the cross-references"); ("--version", Arg.Unit (fun () -> Copying.banner "bib2bib"; exit 0), "print version and exit"); ("--warranty", Arg.Unit (fun () -> Copying.banner "bib2bib"; Copying.copying(); exit 0), "display software warranty") ] let output_cite_file keys = if !cite_output_file_name = "" then prerr_endline "No citation file output (no file name specified)" else try let ch = open_out !cite_output_file_name in KeySet.iter (fun k -> output_string ch (k ^ "\n")) keys; close_out ch with Sys_error msg -> prerr_endline ("Cannot write output citations file (" ^ msg ^ ")"); exit 1 let output_bib_file remove rename biblio keys = try let ch = if !bib_output_file_name = "" then stdout else open_out !bib_output_file_name in let cmd = List.fold_right (fun s t -> if String.contains s ' ' then if String.contains s '\'' then " \"" ^ s ^ "\"" ^ t else " '" ^ s ^ "'" ^ t else " " ^ s ^ t) (Array.to_list Sys.argv) "" in let comments = if !no_comment then empty_biblio else add_new_entry (Comment ("Command line:" ^ cmd)) (add_new_entry (Comment ("This file has been generated by bib2bib " ^ Version.version)) empty_biblio) in let biblio = merge_biblios comments biblio in Biboutput.output_bib ~remove ~rename ~html:false ch biblio keys; if !bib_output_file_name <> "" then close_out ch with Sys_error msg -> prerr_endline ("Cannot write output bib file (" ^ msg ^ ")"); exit 1 let output_php_file remove rename biblio keys = if !php_output_file_name <> "" then try let ch = open_out !php_output_file_name in output_string ch " "; close_out ch with Biboutput.Bad_input_for_php msg -> eprintf "error while producing PHP output: %s\n" msg; exit 2 let rec make_compare_fun db criteria c1 c2 = match criteria with | [] -> 0 | field :: rem -> let comp = match field with | "$key" -> begin match (c1,c2) with | (Abbrev(s1,_),Abbrev(s2,_)) | (Entry(_,s1,_),Entry(_,s2,_)) -> compare s1 s2 | _ -> 0 end | "$type" -> begin match (c1,c2) with | (Entry(s1,_,_),Entry(s2,_,_)) -> compare s1 s2 | _ -> 0 end | "$date" -> begin match (c1,c2) with | (Entry(s1,t1,l1),Entry(s2,t2,l2)) -> Expand.date_compare db (s1,t1,Expand.expand_fields l1) (s2,t2,Expand.expand_fields l2) | _ -> 0 end | f -> begin match (c1,c2) with | (Entry(_,_,l1),Entry(_,_,l2)) -> let s1 = try match List.assoc field l1 with | [Bibtex.String(s)] -> s | [Bibtex.Id(s)] -> s | _ -> "" with Not_found -> "" and s2 = try match List.assoc field l2 with | [Bibtex.String(s)] -> s | [Bibtex.Id(s)] -> s | _ -> "" with Not_found -> "" in compare s1 s2 | _ -> 0 end in if comp = 0 then make_compare_fun db rem c1 c2 else if !reverse_sort then -comp else comp ;; let usage = "Usage: bib2bib [options] \nOptions are:" let main () = Arg.parse args_spec get_input_file_name usage; Copying.banner "bib2bib"; if !Options.debug then begin eprintf "command line:\n"; for i = 0 to pred (Array.length Sys.argv) do eprintf "%s\n" Sys.argv.(i) done; end; if !input_file_names = [] then input_file_names := [""]; if !Options.debug then begin Condition.print !condition; printf "\n" end; let all_entries = List.fold_right (fun file accu -> merge_biblios accu (Readbib.read_entries_from_file file)) !input_file_names empty_biblio in let abbrv_expanded = Bibtex.expand_abbrevs all_entries in let xref_expanded = Bibtex.expand_crossrefs abbrv_expanded in let matching_keys = Bibfilter.filter xref_expanded (fun e k f -> Condition.evaluate_cond e k f !condition) in if KeySet.cardinal matching_keys = 0 then begin eprintf "Warning: no matching reference found.\n"; if !Options.warn_error then exit 2; end; let user_expanded = if !expand_abbrevs then if !expand_xrefs then xref_expanded else abbrv_expanded else if !expand_xrefs then Bibtex.expand_crossrefs all_entries else all_entries in let needed_keys = Bibfilter.saturate user_expanded matching_keys in (* this should be to right place to sort the output bibliography *) let final_bib = if !sort_criteria = [] then user_expanded else let comp = make_compare_fun (Expand.expand user_expanded) (List.rev !sort_criteria) in eprintf "Sorting..."; let b = Bibtex.sort comp user_expanded in eprintf "done.\n"; b in output_cite_file matching_keys; output_bib_file !remove_fields !rename_fields final_bib (Some needed_keys); output_php_file !remove_fields !rename_fields final_bib (Some needed_keys) let _ = Printexc.catch main () bibtex2html-1.99/bibfilter.ml0000644000246300004300000001000013255132746015524 0ustar filliatrvals(**************************************************************************) (* bibtex2html - A BibTeX to HTML translator *) (* Copyright (C) 1997-2014 Jean-Christophe Filliâtre and Claude Marché *) (* *) (* This software is free software; you can redistribute it and/or *) (* modify it under the terms of the GNU General Public *) (* License version 2, as published by the Free Software Foundation. *) (* *) (* This software is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *) (* *) (* See the GNU General Public License version 2 for more details *) (* (enclosed in the file GPL). *) (**************************************************************************) (*s Filtering and saturating BibTeX files. *) open Printf open Bibtex let debug = false (*s [filter bib f] returns the list of keys of [bib] whose fields satisfy the filter criterion [f] *) let filter biblio criterion = Bibtex.fold (fun entry keys -> match entry with Entry(entry_type,key,fields) when criterion entry_type key fields -> KeySet.add key keys | _ -> keys) biblio KeySet.empty (*s [needed_keys biblio field value keys] returns the set of keys [keys] augmented with the needed keys for [value] *) let rec needed_keys_for_field biblio field value keys abbrevs = if field = "crossref" then match value with [String(s)] -> if not (KeySet.mem s keys) then begin try let e = find_entry s biblio in if debug then begin eprintf "We need additional crossref %s\n" s end; needed_keys_for_entry biblio (KeySet.add s keys) abbrevs e with Not_found -> if not !Options.quiet then eprintf "Warning: cross-reference \"%s\" not found.\n" s; if !Options.warn_error then exit 2; (keys,abbrevs) end else (keys,abbrevs) | _ -> if not !Options.quiet then eprintf "Warning: cross-references must be constant strings\n"; if !Options.warn_error then exit 2; (keys,abbrevs) else List.fold_right (fun a (keys,abbrevs) -> match a with Id(id) -> let id = String.lowercase_ascii id in if not (KeySet.mem id abbrevs) then try let e = find_abbrev id biblio in if debug then begin eprintf "We need additional abbrev %s\n" id end; needed_keys_for_entry biblio keys (KeySet.add id abbrevs) e with Not_found -> if abbrev_is_implicit id then (keys,abbrevs) else begin if not !Options.quiet then eprintf "Warning: string \"%s\" not found.\n" id; if !Options.warn_error then exit 2; (keys,abbrevs) end else (keys,abbrevs) | _ -> (keys,abbrevs)) value (keys,abbrevs) and needed_keys_for_entry biblio keys abbrevs = function Entry(entry_type,key,fields) -> List.fold_right (fun (field,value) (keys,abbrevs) -> (*i eprintf "Field : %s\n" field; i*) needed_keys_for_field biblio field value keys abbrevs) fields (keys,abbrevs) | Abbrev(field,value) -> needed_keys_for_field biblio field value keys abbrevs | _ -> (keys,abbrevs) (*s [saturate bib l] returns the smallest part of the bibliography [bib] containing all the keys in l together with all the necessary abbreviation strings and cross-references *) let saturate biblio s = let (keys,abbrevs) = Bibtex.fold (fun entry (keys,abbrevs) -> match entry with | Entry(_,key,_) as e when KeySet.mem key s -> needed_keys_for_entry biblio keys abbrevs e | _ -> (keys,abbrevs)) biblio (s,KeySet.empty) in KeySet.union keys abbrevs bibtex2html-1.99/bibfilter.mli0000644000246300004300000000320613255132746015707 0ustar filliatrvals(**************************************************************************) (* bibtex2html - A BibTeX to HTML translator *) (* Copyright (C) 1997-2014 Jean-Christophe Filliâtre and Claude Marché *) (* *) (* This software is free software; you can redistribute it and/or *) (* modify it under the terms of the GNU General Public *) (* License version 2, as published by the Free Software Foundation. *) (* *) (* This software is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *) (* *) (* See the GNU General Public License version 2 for more details *) (* (enclosed in the file GPL). *) (**************************************************************************) (*s Filtering and saturating BibTeX files. *) open Bibtex (*s [filter bib f] returns the set of keys of [bib] whose fields satisfy the filter criterion [f]. *) val filter : biblio -> (entry_type -> key -> ((string * atom list) list) -> bool) -> KeySet.t (*s [saturate bib s] returns the smallest part of the bibliography [bib] containing all the keys in s together with all the necessary abbreviation strings and cross-references. *) val saturate : biblio -> KeySet.t -> KeySet.t bibtex2html-1.99/biboutput.ml0000644000246300004300000001662313255132746015620 0ustar filliatrvals(**************************************************************************) (* bibtex2html - A BibTeX to HTML translator *) (* Copyright (C) 1997-2014 Jean-Christophe Filliâtre and Claude Marché *) (* *) (* This software is free software; you can redistribute it and/or *) (* modify it under the terms of the GNU General Public *) (* License version 2, as published by the Free Software Foundation. *) (* *) (* This software is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *) (* *) (* See the GNU General Public License version 2 for more details *) (* (enclosed in the file GPL). *) (**************************************************************************) (*s Output a BibTeX bibliography. *) open Printf open Bibtex let link_fields = ref [] let add_link_field f = link_fields := f :: !link_fields let is_link_field f = List.mem f !link_fields let needs_output k = function | None -> true | Some s -> KeySet.mem k s let url_re = Str.regexp "\\(ftp\\|http\\)://.*" let is_url s = Str.string_match url_re s 0 let print_atom html ch = function | Id s -> if html && not (abbrev_is_implicit s) then begin Html.open_href ch ("#" ^ s); output_string ch s; Html.close_href ch end else output_string ch s | String s when html && is_url s -> output_string ch "{"; Html.open_href ch s; output_string ch s; Html.close_href ch; output_string ch "}" | String s -> output_string ch ("{"^s^"}") let print_atom_list html ch = function | [] -> () | a::l -> print_atom html ch a; List.iter (fun a -> output_string ch " # "; print_atom html ch a) l let print_crossref html ch = function | [String s] -> output_string ch "{"; if html then Html.open_href ch ("#" ^ s); output_string ch s; if html then Html.close_href ch; output_string ch "}" | l -> if not !Options.quiet then eprintf "Warning: cross-references must be constant strings\n"; if !Options.warn_error then exit 2; print_atom_list html ch l let print_link_field ch = function | [String s] -> output_string ch "{"; Html.open_href ch s; output_string ch s; Html.close_href ch; output_string ch "}" | l -> if not !Options.quiet then eprintf "Warning: web links must be constant strings\n"; if !Options.warn_error then exit 2; print_atom_list true ch l let print_command remove rename html html_file ch keys = function | Comment s -> if html then output_string ch "
\n";
      output_string ch ("@comment{{" ^ s ^ "}}\n");
      if html then output_string ch "
\n"; output_string ch "\n" | Preamble l -> if html then output_string ch "
\n";
      output_string ch "@preamble{";
      print_atom_list html ch l;
      output_string ch "}\n";
      if html then output_string ch "
\n"; output_string ch "\n" | Abbrev(s,l) -> if needs_output s keys then begin if html then begin Html.open_anchor ch s; Html.close_anchor ch end; if html then output_string ch "
\n";
	  output_string ch ("@string{" ^ s ^ " = ");
	  print_atom_list html ch l;
	  output_string ch "}\n";
	  if html then output_string ch "
\n"; output_string ch "\n" end | Entry (entry_type,key,fields) -> if needs_output key keys then begin (*if html then Html.open_balise ch "p";*) if html then begin Html.open_anchor ch key; Html.close_anchor ch end; if html then output_string ch "
\n";
	  output_string ch ("@" ^ entry_type ^ "{");
	  begin match html_file with
	    | Some f ->
		Html.open_href ch (f ^ "#" ^ key);
		output_string ch key;
		Html.close_href ch
	    | None ->
		output_string ch key
	  end;
	  List.iter
	    (fun (field,l) ->
               if not (List.mem field remove) then
                 begin
                   let ofield =
                     try List.assoc field rename
                     with Not_found -> field
                   in
	           output_string ch (",\n  " ^ ofield ^ " = ");
	           if html && field = "crossref" then
		     print_crossref html ch l
	           else if html && is_link_field field then
		     print_link_field ch l
	           else
		     print_atom_list html ch l
                 end)
	    fields;
	  output_string ch "\n}\n";
	  if html then output_string ch "
\n"; (*if html then Html.close_balise ch "p";*) output_string ch "\n" end (*s PHP output *) open Printf exception Bad_input_for_php of string (* inspired from String.escaped *) let add_backslashes s = let n = String.length s in let b = Buffer.create (2 * n) in for i = 0 to n - 1 do let c = String.unsafe_get s i in begin match c with | '\'' | '\\' -> Buffer.add_char b '\\' | _ -> () end; Buffer.add_char b c done; Buffer.contents b let php_print_atom ch = function | Id s -> fprintf ch "\'%s\'" s | String s -> fprintf ch "'%s'" (add_backslashes s) let php_print_atom_list ch = function | [] -> () | [a] -> php_print_atom ch a | a::l -> php_print_atom ch a; List.iter (fun a -> fprintf ch "."; php_print_atom ch a) l let php_print_command index remove rename ch keys = function | Comment s -> raise (Bad_input_for_php "comments not supported, use option --no-comment") (* output_string ch "
\n";
      output_string ch ("@comment{{" ^ s ^ "}}\n");
      output_string ch "
\n"; output_string ch "\n" *) | Preamble l -> raise (Bad_input_for_php "preamble not supported") (* output_string ch "
\n";
      output_string ch "@preamble{";
      php_print_atom_list ch l;
      output_string ch "}\n";
      output_string ch "
\n"; output_string ch "\n" *) | Abbrev(s,l) -> raise (Bad_input_for_php "string not supported, use option --expand") (* if needs_output s keys then begin Html.open_anchor ch s; Html.close_anchor ch; output_string ch "
\n";
	  output_string ch ("@string{" ^ s ^ " = ");
	  php_print_atom_list ch l;
	  output_string ch "}\n";
	  output_string ch "
\n"; output_string ch "\n" end *) | Entry (entry_type,key,fields) -> if needs_output key keys then begin if index > 0 then fprintf ch ",\n\n"; fprintf ch "%-5d => Array (\n" index; fprintf ch " \'entrytype\' => \'%s\',\n" entry_type; fprintf ch " \'cite\' => \'%s\'" key; List.iter (fun (field,l) -> if not (List.mem field remove) then begin let ofield = try List.assoc field rename with Not_found -> field in fprintf ch ",\n \'%s\' => " ofield; php_print_atom_list ch l end) fields; fprintf ch ")"; succ index end else index let output_bib ?(remove=[]) ?(rename=[]) ?(php=false) ~html ?html_file ch bib keys = let _ = Bibtex.fold (fun entry i -> if php then php_print_command i remove rename ch keys entry else (print_command remove rename html html_file ch keys entry; succ i)) bib 0 in () bibtex2html-1.99/biboutput.mli0000644000246300004300000000420213255132746015757 0ustar filliatrvals(**************************************************************************) (* bibtex2html - A BibTeX to HTML translator *) (* Copyright (C) 1997-2014 Jean-Christophe Filliâtre and Claude Marché *) (* *) (* This software is free software; you can redistribute it and/or *) (* modify it under the terms of the GNU General Public *) (* License version 2, as published by the Free Software Foundation. *) (* *) (* This software is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *) (* *) (* See the GNU General Public License version 2 for more details *) (* (enclosed in the file GPL). *) (**************************************************************************) (*s [output_bib html ch bib keys] outputs to the channel [ch] the fields of the bibliography [bib] whose key belong to [keys]. [html] is a flag that tells whether html anchors must be added: if [html] is false, the output is a regular bibtex file, if [html] is true, anchors are added on crossrefs, abbreviations, and URLs in fields. Notice that to guarantee that the generated part of the bibliography is coherent, that is all needed abbreviations and cross-references are included, one as to call Bibfilter.saturate before. Notice finally that the channel [ch] is NOT closed by this function *) open Bibtex exception Bad_input_for_php of string val output_bib : ?remove:string list -> ?rename:(string * string) list -> ?php:bool -> html:bool -> ?html_file:string -> out_channel -> biblio -> KeySet.t option -> unit (*s [add_link_field f] declares a new field [f] to be displayed as a web link (when HTML option of [output_bib] is set) *) val add_link_field : string -> unit bibtex2html-1.99/bibtex.ml0000644000246300004300000002002613255132746015050 0ustar filliatrvals(**************************************************************************) (* bibtex2html - A BibTeX to HTML translator *) (* Copyright (C) 1997-2014 Jean-Christophe Filliâtre and Claude Marché *) (* *) (* This software is free software; you can redistribute it and/or *) (* modify it under the terms of the GNU General Public *) (* License version 2, as published by the Free Software Foundation. *) (* *) (* This software is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *) (* *) (* See the GNU General Public License version 2 for more details *) (* (enclosed in the file GPL). *) (**************************************************************************) (*s Datatype for BibTeX bibliographies. *) type entry_type = string type key = string module KeySet = Set.Make(struct type t = key let compare = compare end) type atom = | Id of string | String of string type command = | Comment of string | Preamble of atom list | Abbrev of string * atom list | Entry of entry_type * key * (string * atom list) list (*s biblio is stored as a list. Beware, this in reverse order: the first entry is at the end of the list. This is intentional! *) type biblio = command list let empty_biblio = [] let size b = List.length b (*s the natural iterator on biblio must start at the first entry, so it is the [fold_right] function on lists, NOT the [fold_left]! *) let fold = List.fold_right let find_entry key biblio = let rec find key b = match b with | [] -> raise Not_found | (Entry (_,s,_) as e) :: b -> if String.lowercase_ascii s = key then e else find key b | _ :: b -> find key b in find (String.lowercase_ascii key) biblio let add_new_entry command biblio = command :: biblio let rec remove_entry key biblio = match biblio with | [] -> raise Not_found | (Entry(_,s,_) as e) :: b -> if s = key then b else e :: (remove_entry key b) | e :: b -> e :: (remove_entry key b) (*s [add_entry k c b] adds an entry of key [k] and command [c] in biblio [b] and returns the new biblio. If an entry of key [k] already exists in [b], it is replaced by the new one. *) let add_entry command biblio = match command with | Entry(_,key,_) -> begin try let new_bib = remove_entry key biblio in command :: new_bib with Not_found -> command :: biblio end | _ -> command::biblio let merge_biblios b1 b2 = let b2keys = fold (fun entry accu -> match entry with | Entry (_,key,_) -> KeySet.add key accu | _ -> accu) b2 KeySet.empty and b1abbrevs = fold (fun entry accu -> match entry with | Abbrev (key,_) -> KeySet.add key accu | _ -> accu) b1 KeySet.empty in let new_b1 = fold (fun entry accu -> match entry with | Entry (_,key,_) -> if KeySet.mem key b2keys then begin Format.eprintf "Warning, key '%s' duplicated@." key; if !Options.warn_error then exit 2; accu end else entry :: accu | _ -> entry :: accu) b1 empty_biblio in let new_bib = fold (fun entry accu -> match entry with | Abbrev (key,_) -> if KeySet.mem key b1abbrevs then begin Format.eprintf "Warning, key '%s' duplicated@." key; if !Options.warn_error then exit 2; accu end else entry :: accu | _ -> entry :: accu) b2 new_b1 in new_bib let month_env = List.map (fun s -> (s,[Id s])) [ "jan" ; "feb" ; "mar" ; "apr" ; "may" ; "jun" ; "jul" ; "aug" ; "sep" ; "oct" ; "nov" ; "dec" ] let abbrev_is_implicit key = try let _ = int_of_string key in true with Failure _ -> try let _ = List.assoc key month_env in true with Not_found -> false (*i let rec abbrev_exists key biblio = match biblio with | [] -> false | (Abbrev (s,_)) :: b -> s = key || abbrev_exists key b | _ :: b -> abbrev_exists key b i*) let rec find_abbrev key biblio = match biblio with | [] -> raise Not_found | (Abbrev (s,_) as e) :: b -> if s = key then e else find_abbrev key b | _ :: b -> find_abbrev key b let concat_atom_lists a1 a2 = match (a1,a2) with | ([String s1], [String s2]) -> [String (s1 ^ s2)] | _ -> a1 @ a2 let abbrev_table = Hashtbl.create 97 let add_abbrev a l = Hashtbl.add abbrev_table a l let _ = List.iter (fun (a,l) -> add_abbrev a l) month_env let find_abbrev_in_table a = Hashtbl.find abbrev_table a let rec expand_list = function | [] -> [] | ((Id s) as a) :: rem -> begin try let v = find_abbrev_in_table s in concat_atom_lists v (expand_list rem) with Not_found -> concat_atom_lists [a] (expand_list rem) end | ((String _) as a) :: rem -> concat_atom_lists [a] (expand_list rem) let rec expand_fields = function | [] -> [] | (n,l) :: rem -> (n, expand_list l) :: (expand_fields rem) let rec expand_abbrevs biblio = fold (fun command accu -> match command with | Abbrev (a,l) -> let s = expand_list l in add_abbrev a s; accu | Entry (t,k,f) -> Entry (t,k,expand_fields f) :: accu | e -> e :: accu) biblio [] let add_crossref_fields = List.fold_left (fun acc ((x,_) as d) -> if List.mem_assoc x acc then acc else d::acc) let rec expand_crossrefs biblio = let crossref_table = Hashtbl.create 97 in let add_crossref a l = Hashtbl.add crossref_table (String.lowercase_ascii a) l in let find_crossref a = Hashtbl.find crossref_table (String.lowercase_ascii a) in let replace_crossref a l = Hashtbl.replace crossref_table (String.lowercase_ascii a) l in (* first phase: record needed crossrefs in table *) List.iter (fun command -> match command with | Entry (t,k,f) -> begin try match List.assoc "crossref" f with | [String(s)] -> add_crossref s [] | _ -> begin Format.eprintf "Warning: invalid cross-reference in entry '%s'.@." k; if !Options.warn_error then exit 2; end with Not_found -> (); end | _ -> ()) biblio; (* second phase: record crossrefs data in table *) List.iter (fun command -> match command with | Entry (t,k,f) -> begin try let _ = find_crossref k in if !Options.debug then Format.eprintf "recording cross-reference '%s'.@." k; replace_crossref k f with Not_found -> () end | _ -> ()) biblio; (* third phase: expand crossrefs *) fold (fun command accu -> match command with | Entry (t,k,f) -> begin try match List.assoc "crossref" f with | [String(s)] -> begin try let f = List.remove_assoc "crossref" f in let f' = find_crossref s in if f' = [] then begin Format.eprintf "Warning: cross-reference '%s' not found.@." s; if !Options.warn_error then exit 2; end; Entry (t,k,add_crossref_fields f f') :: accu with Not_found -> assert false end | _ -> command :: accu with Not_found -> command :: accu end | e -> e :: accu) biblio [] let sort comp bib = let comments,preambles,abbrevs,entries = List.fold_left (fun (c,p,a,e) command -> match command with | Comment _ -> (command::c,p,a,e) | Preamble _ -> (c,command::p,a,e) | Abbrev _ -> (c,p,command::a,e) | Entry _ -> (c,p,a,command::e)) ([],[],[],[]) bib in let sort_abbrevs = List.sort comp abbrevs and sort_entries = List.sort comp entries in List.rev_append sort_entries (List.rev_append sort_abbrevs (List.rev_append preambles (List.rev comments))) let current_key = ref "" bibtex2html-1.99/bibtex.mli0000644000246300004300000000772713255132746015236 0ustar filliatrvals(**************************************************************************) (* bibtex2html - A BibTeX to HTML translator *) (* Copyright (C) 1997-2014 Jean-Christophe Filliâtre and Claude Marché *) (* *) (* This software is free software; you can redistribute it and/or *) (* modify it under the terms of the GNU General Public *) (* License version 2, as published by the Free Software Foundation. *) (* *) (* This software is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *) (* *) (* See the GNU General Public License version 2 for more details *) (* (enclosed in the file GPL). *) (**************************************************************************) (*s A datatype for BibTeX bibliographies. *) type entry_type = string type key = string module KeySet : Set.S with type elt = key type atom = | Id of string | String of string type command = | Comment of string | Preamble of atom list | Abbrev of string * atom list | Entry of entry_type * key * (string * atom list) list type biblio (*s [empty_biblio] is an empty bibliography *) val empty_biblio : biblio (*s [add_new_entry k c b] adds an entry of key [k] and command [c] in biblio [b] and returns the new biblio. The entry [k] is supposed not to exists yet in [b]. *) val add_new_entry : command -> biblio -> biblio (*s [merge_biblios b1 b2] merges biblios [b1] and [b2]. Commands in the resulting biblio are the commands of b1, then the commands of b2, except for duplicates: any abbrev in [b2] that already exists in [b1] is ignored, and conversely every regular entries of [b1] which key exists also in [b2] is ignored. This behaviour is because abbrevs are supposed to be used by entries AFTER the definition of abbrevs, whereas regular entries are supposed to be used as crossrefs by entries BEFORE the definition of this entry. *) val merge_biblios : biblio -> biblio -> biblio (*s [find_entry k b] returns the first entry of key [k] in biblio [b]. Raises [Not_found] if no entry of this key exist. *) val find_entry : key -> biblio -> command (*s [size b] is the number of commands in [b] *) val size : biblio -> int (*s [fold f b accu] iterates [f] on the commands of [b], starting from [a]. If the commands of [b] are $c_1,\ldots,c_n$ in this order, then it computes $f ~ c_n ~ (f ~ c_{n-1} ~ \cdots ~ (f ~ c_1 ~ a)\cdots)$. *) val fold : (command -> 'a -> 'a) -> biblio -> 'a -> 'a (*s [abbrev_is_implicit k] is true when [k] is an integer or a month name. [abbrev_search k b] returns the first abbrev of key [k] in biblio [b], Raises [Not_found] if no abbrev of this key exist. *) val abbrev_is_implicit : key -> bool val find_abbrev : key -> biblio -> command (*s expansion of abbreviations. [expand_abbrevs bib] returns a new bibliography where all strings have been expanded *) val expand_abbrevs : biblio -> biblio val expand_crossrefs : biblio -> biblio (*s sorting bibliography As with the \texttt{bibsort} command of Nelson H. F. Beebe, comments are placed first, then preamble, then abbrevs, then regular entries. Within the last two categories, entries are sorted with respect to the comparison function given in argument. This function may be assumed called only on pairs of the form (Abbrev _,Abbrev _) or (Entry _, Entry _) Warning! it is up to you to provide a comparison function that will not place crossrefs before regular entries! *) val sort : (command -> command -> int) -> biblio -> biblio (* for parsing *) val current_key : string ref bibtex2html-1.99/bibtex_lexer.mll0000644000246300004300000001016313255132746016424 0ustar filliatrvals(**************************************************************************) (* bibtex2html - A BibTeX to HTML translator *) (* Copyright (C) 1997-2014 Jean-Christophe Filliâtre and Claude Marché *) (* *) (* This software is free software; you can redistribute it and/or *) (* modify it under the terms of the GNU General Public *) (* License version 2, as published by the Free Software Foundation. *) (* *) (* This software is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *) (* *) (* See the GNU General Public License version 2 for more details *) (* (enclosed in the file GPL). *) (**************************************************************************) (*i $Id: bibtex_lexer.mll,v 1.19 2010-02-22 07:38:19 filliatr Exp $ i*) (*s Lexer for BibTeX files. *) { open Lexing open Bibtex_parser let serious = ref false (* if we are inside a command or not *) let brace_depth = ref 0 (*s To buffer string literals *) let buffer = Buffer.create 8192 let reset_string_buffer () = Buffer.reset buffer let store_string_char c = Buffer.add_char buffer c let get_stored_string () = let s = Buffer.contents buffer in Buffer.reset buffer; s let start_delim = ref ' ' let check_delim d = match !start_delim, d with | '{', '}' | '(', ')' -> () | _ -> failwith "closing character does not match opening" } let space = [' ' '\t' '\r' '\n'] rule token = parse | space + { token lexbuf } | '@' space* ([^ ' ' '\t' '\n' '\r' '{' '(']+ as entry_type) space* (('{' | '(') as delim) space* { serious := true; start_delim := delim; match String.lowercase_ascii entry_type with | "string" -> Tabbrev | "comment" -> reset_string_buffer (); comment lexbuf; serious := false; Tcomment (get_stored_string ()) | "preamble" -> Tpreamble | et -> Tentry (entry_type, key lexbuf) } | '=' { if !serious then Tequal else token lexbuf } | '#' { if !serious then Tsharp else token lexbuf } | ',' { if !serious then Tcomma else token lexbuf } | '{' { if !serious then begin reset_string_buffer (); brace lexbuf; Tstring (get_stored_string ()) end else token lexbuf } | ('}' | ')') as d { if !serious then begin check_delim d; serious := false; Trbrace end else token lexbuf } | [^ ' ' '\t' '\n' '\r' '{' '}' '(' ')' '=' '#' ',' '"' '@']+ { if !serious then Tident (Lexing.lexeme lexbuf) else token lexbuf } | "\"" { if !serious then begin reset_string_buffer (); string lexbuf; Tstring (get_stored_string ()) end else token lexbuf } | eof { EOF } | _ { token lexbuf } and string = parse | '{' { store_string_char '{'; brace lexbuf; store_string_char '}'; string lexbuf } | '"' { () } | "\\\"" { store_string_char '\\'; store_string_char '"'; string lexbuf} | eof { failwith "unterminated string" } | _ { let c = Lexing.lexeme_char lexbuf 0 in store_string_char c; string lexbuf } and brace = parse | '{' { store_string_char '{'; brace lexbuf; store_string_char '}'; brace lexbuf } | '}' { () } | eof { failwith "unterminated string" } | _ { let c = Lexing.lexeme_char lexbuf 0 in store_string_char c; brace lexbuf } and key = parse | [^ ' ' '\t' '\n' '\r' ',']+ { lexeme lexbuf } | eof | _ { raise Parsing.Parse_error } and comment = parse | '{' { comment lexbuf; comment lexbuf } | [^ '}' '@'] as c { store_string_char c; comment lexbuf } | eof { () } | _ { () } bibtex2html-1.99/bibtex_parser.mly0000644000246300004300000000612213255132746016616 0ustar filliatrvals/**************************************************************************/ /* bibtex2html - A BibTeX to HTML translator */ /* Copyright (C) 1997-2014 Jean-Christophe Filliâtre and Claude Marché */ /* */ /* This software is free software; you can redistribute it and/or */ /* modify it under the terms of the GNU General Public */ /* License version 2, as published by the Free Software Foundation. */ /* */ /* This software is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. */ /* */ /* See the GNU General Public License version 2 for more details */ /* (enclosed in the file GPL). */ /**************************************************************************/ /* * bibtex2html - A BibTeX to HTML translator * Copyright (C) 1997 Jean-Christophe FILLIATRE * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public * License version 2, as published by the Free Software Foundation. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * * See the GNU General Public License version 2 for more details * (enclosed in the file GPL). */ /*i $Id: bibtex_parser.mly,v 1.15 2010-02-22 07:38:19 filliatr Exp $ i*/ /*s Parser for BibTeX files. */ %{ open Bibtex %} %token Tident Tstring Tcomment %token Tentry %token Tabbrev Tpreamble Tlbrace Trbrace Tcomma Tequal EOF Tsharp %start command_list %type command_list %start command %type command %% command_list: commands EOF { $1 } ; commands: commands command { add_new_entry $2 $1 } | /* epsilon */ { empty_biblio } ; command: Tcomment { Comment $1 } | Tpreamble sharp_string_list Trbrace { Preamble $2 } | Tabbrev Tident Tequal sharp_string_list Trbrace { Abbrev (String.lowercase_ascii $2,$4) } | entry Tcomma comma_field_list Trbrace { let et,key = $1 in Entry (String.lowercase_ascii et, key, $3) } ; entry: | Tentry { let et,key = $1 in Bibtex.current_key := key; (et,key) } comma_field_list: field Tcomma comma_field_list { $1::$3 } | field { [$1] } | field Tcomma { [$1] } ; field: field_name Tequal sharp_string_list { ($1,$3) } | field_name Tequal { ($1,[String ""]) } ; field_name: Tident { String.lowercase_ascii $1 } | Tcomment { "comment" } ; sharp_string_list: atom Tsharp sharp_string_list { $1::$3 } | atom { [$1] } ; atom: Tident { Id (String.lowercase_ascii $1) } | Tstring { String $1 } ; %% bibtex2html-1.99/condition.ml0000644000246300004300000001022313255132746015557 0ustar filliatrvals(**************************************************************************) (* bibtex2html - A BibTeX to HTML translator *) (* Copyright (C) 1997-2014 Jean-Christophe Filliâtre and Claude Marché *) (* *) (* This software is free software; you can redistribute it and/or *) (* modify it under the terms of the GNU General Public *) (* License version 2, as published by the Free Software Foundation. *) (* *) (* This software is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *) (* *) (* See the GNU General Public License version 2 for more details *) (* (enclosed in the file GPL). *) (**************************************************************************) open Printf;; type constante = | Key | Entrytype | Field of string | Cte of string ;; type condition = | True | False | And of condition * condition | Or of condition * condition | Not of condition | Comp of constante * string * constante | Match of constante * Str.regexp | Exists of string ;; exception Unavailable;; let evaluate_constante entrytype key fields = function Key -> key | Entrytype -> entrytype | Field(f) -> begin try match List.assoc f fields with | [Bibtex.String(v)] -> Latex_accents.normalize false v | [Bibtex.Id(v)] -> v | _ -> raise Unavailable with Not_found -> raise Unavailable end | Cte(x) -> Latex_accents.normalize false x ;; let eval_comp v1 op v2 = match op with | "=" -> String.lowercase_ascii v1 = String.lowercase_ascii v2 | "<>" -> String.lowercase_ascii v1 <> String.lowercase_ascii v2 | "==" -> v1 = v2 | "!=" -> v1 <> v2 | _ -> let n1 = int_of_string v1 and n2 = int_of_string v2 in match op with | ">" -> n1 > n2 | "<" -> n1 < n2 | ">=" -> n1 >= n2 | "<=" -> n1 <= n2 | _ -> assert false ;; let rec evaluate_rec entrytype key fields = function | True -> true | False -> false | And(c1,c2) -> if evaluate_rec entrytype key fields c1 then evaluate_rec entrytype key fields c2 else false | Or(c1,c2) -> if evaluate_rec entrytype key fields c1 then true else evaluate_rec entrytype key fields c2 | Not(c) -> not (evaluate_rec entrytype key fields c) | Comp(c1,op,c2) -> begin try let v1 = evaluate_constante entrytype key fields c1 and v2 = evaluate_constante entrytype key fields c2 in try eval_comp v1 op v2 with Failure _ -> if not !Options.quiet then begin eprintf "Warning: cannot compare non-numeric values "; eprintf "%s and %s in entry %s\n" v1 v2 key end; if !Options.warn_error then exit 2; false with Unavailable -> false end | Match(c,r) -> begin try let v = evaluate_constante entrytype key fields c in let _ = Str.search_forward r v 0 in true with Not_found -> false | Unavailable -> false end | Exists(f) -> begin try let _ = List.assoc f fields in true with Not_found -> false end ;; let evaluate_cond entrytype key fields c = try evaluate_rec entrytype key fields c with Not_found -> assert false ;; let string_of_constante = function Key -> "(key)" | Entrytype -> "(entrytype)" | Field(f) -> f | Cte(x) -> "\"" ^ x ^ "\"" ;; let rec print = function | True -> printf "true" | False -> printf "false" | And(c1,c2) -> printf "("; print c1; printf " and "; print c2; printf ")" | Or(c1,c2) -> printf "("; print c1; printf " or "; print c2; printf ")" | Not(c) -> printf "(not "; print c; printf ")" | Comp(c1,op,c2) -> printf "%s %s %s" (string_of_constante c1) op (string_of_constante c2) | Match(c,s) -> printf "%s : (regexp)" (string_of_constante c) | Exists(f) -> printf "exists %s" f ;; bibtex2html-1.99/condition.mli0000644000246300004300000000332313255132746015733 0ustar filliatrvals(**************************************************************************) (* bibtex2html - A BibTeX to HTML translator *) (* Copyright (C) 1997-2014 Jean-Christophe Filliâtre and Claude Marché *) (* *) (* This software is free software; you can redistribute it and/or *) (* modify it under the terms of the GNU General Public *) (* License version 2, as published by the Free Software Foundation. *) (* *) (* This software is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *) (* *) (* See the GNU General Public License version 2 for more details *) (* (enclosed in the file GPL). *) (**************************************************************************) type constante = | Key | Entrytype | Field of string | Cte of string type condition = | True | False | And of condition * condition | Or of condition * condition | Not of condition | Comp of constante * string * constante | Match of constante * Str.regexp | Exists of string (* [(evaluate_cond e k fields cond)] returns the boolean value of [cond] with respect to the entry of type [e], of key [k], and fields [fields]. *) val evaluate_cond : string -> string -> (string * Bibtex.atom list) list -> condition -> bool val print : condition -> unit bibtex2html-1.99/condition_lexer.mli0000644000246300004300000000233213255132746017131 0ustar filliatrvals(**************************************************************************) (* bibtex2html - A BibTeX to HTML translator *) (* Copyright (C) 1997-2014 Jean-Christophe Filliâtre and Claude Marché *) (* *) (* This software is free software; you can redistribute it and/or *) (* modify it under the terms of the GNU General Public *) (* License version 2, as published by the Free Software Foundation. *) (* *) (* This software is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *) (* *) (* See the GNU General Public License version 2 for more details *) (* (enclosed in the file GPL). *) (**************************************************************************) exception Lex_error of string val token : Lexing.lexbuf -> Condition_parser.token bibtex2html-1.99/condition_lexer.mll0000644000246300004300000001055513255132746017142 0ustar filliatrvals(**************************************************************************) (* bibtex2html - A BibTeX to HTML translator *) (* Copyright (C) 1997-2014 Jean-Christophe Filliâtre and Claude Marché *) (* *) (* This software is free software; you can redistribute it and/or *) (* modify it under the terms of the GNU General Public *) (* License version 2, as published by the Free Software Foundation. *) (* *) (* This software is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *) (* *) (* See the GNU General Public License version 2 for more details *) (* (enclosed in the file GPL). *) (**************************************************************************) { open Condition_parser exception Lex_error of string;; let string_buf = Buffer.create 79 let char_of_string s = try char_of_int (int_of_string s) with _ -> raise (Lex_error ("invalid character code")) } let digit = ['0' - '9'] let special_char = ['$' '^' '.' '*' '+' '?' '[' ']' 'b' '|' '(' ')' '\\'] let letter = [ 'A'-'Z' 'a'-'z' ] rule token = parse [' ' '\t' '\n'] + { token lexbuf } | "and" { AND } | "or" { OR } | "not" { NOT } | "exists" { EXISTS } | "&" { AND } | "|" { OR } | "!" { NOT } | "?" { EXISTS } | ':' { COLON } | '(' { LPAR } | ')' { RPAR } | "$key" { DOLLAR_KEY } | "$type" { DOLLAR_TYPE } | (">" | "<" | ">=" | "<=" | "=" | "<>" | "==" | "!=") { COMP(Lexing.lexeme lexbuf) } | digit + { INT(Lexing.lexeme lexbuf) } | (letter | '_') (letter | digit | '_' | '-') * { IDENT(Lexing.lexeme lexbuf) } | '"' { Buffer.clear string_buf; STRING(string lexbuf) } | '\'' { Buffer.clear string_buf; STRING(string2 lexbuf) } | eof { EOF } | _ { raise (Lex_error ("Invalid character " ^ (Lexing.lexeme lexbuf))) } and string = parse '"' { Buffer.contents string_buf } | eof { raise (Lex_error ("Unterminated string")) } | '\\' '"' { Buffer.add_char string_buf '"'; string lexbuf } | '\\' 'r' { Buffer.add_char string_buf '\r'; string lexbuf } | '\\' 'n' { Buffer.add_char string_buf '\n'; string lexbuf } | '\\' 't' { Buffer.add_char string_buf '\t'; string lexbuf } | '\\' special_char { Buffer.add_string string_buf (Lexing.lexeme lexbuf); string lexbuf } | '\\' (digit digit digit as s) { Buffer.add_char string_buf (char_of_string s); string lexbuf } | '\\' _ { raise (Lex_error ("Invalid escape character " ^ (Lexing.lexeme lexbuf))) } | _ { Buffer.add_char string_buf (Lexing.lexeme_char lexbuf 0); string lexbuf } and string2 = parse | '\'' { Buffer.contents string_buf } | eof { raise (Lex_error ("Unterminated string")) } | '\\' '\'' { Buffer.add_char string_buf '\''; string2 lexbuf } | '\\' 'r' { Buffer.add_char string_buf '\r'; string2 lexbuf } | '\\' 'n' { Buffer.add_char string_buf '\n'; string2 lexbuf } | '\\' 't' { Buffer.add_char string_buf '\t'; string2 lexbuf } | '\\' special_char { Buffer.add_string string_buf (Lexing.lexeme lexbuf); string2 lexbuf } | '\\' (digit digit digit as s) { Buffer.add_char string_buf (char_of_string s); string2 lexbuf } | '\\' _ { raise (Lex_error ("Invalid escape character " ^ (Lexing.lexeme lexbuf))) } | _ { Buffer.add_char string_buf (Lexing.lexeme_char lexbuf 0); string2 lexbuf } bibtex2html-1.99/condition_parser.mly0000644000246300004300000000527513255132746017337 0ustar filliatrvals/**************************************************************************/ /* bibtex2html - A BibTeX to HTML translator */ /* Copyright (C) 1997-2014 Jean-Christophe Filliâtre and Claude Marché */ /* */ /* This software is free software; you can redistribute it and/or */ /* modify it under the terms of the GNU General Public */ /* License version 2, as published by the Free Software Foundation. */ /* */ /* This software is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. */ /* */ /* See the GNU General Public License version 2 for more details */ /* (enclosed in the file GPL). */ /**************************************************************************/ /* * bibtex2html - A BibTeX to HTML translator * Copyright (C) 1997 Jean-Christophe FILLIATRE * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public * License version 2, as published by the Free Software Foundation. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * * See the GNU General Public License version 2 for more details * (enclosed in the file GPL). */ /*i $Id: condition_parser.mly,v 1.9 2010-02-22 07:38:19 filliatr Exp $ i*/ %{ open Condition %} %token IDENT STRING COMP %token INT %token COLON AND OR NOT LPAR RPAR DOLLAR_KEY DOLLAR_TYPE EXISTS EOF %start condition_start %type condition_start %left OR %left AND %left NOT %% condition_start: condition EOF { $1 } ; condition: condition OR condition { Or($1,$3) } | condition AND condition { And($1,$3) } | NOT condition { Not($2) } | LPAR condition RPAR { $2 } | atom { $1 } ; atom: | cte COLON STRING { let s = Latex_accents.normalize true $3 in (*i Printf.printf "regexp = %s\n" s; i*) Match($1, Str.regexp_case_fold s) } | cte COMP cte { Comp($1,$2,$3) } | EXISTS IDENT { Exists(String.lowercase_ascii $2) } ; cte: IDENT { Field(String.lowercase_ascii $1) } | INT { Cte($1) } | STRING { Cte($1) } | DOLLAR_KEY { Key } | DOLLAR_TYPE { Entrytype } ; bibtex2html-1.99/copying.ml0000644000246300004300000000403713255132746015247 0ustar filliatrvals(**************************************************************************) (* bibtex2html - A BibTeX to HTML translator *) (* Copyright (C) 1997-2014 Jean-Christophe Filliâtre and Claude Marché *) (* *) (* This software is free software; you can redistribute it and/or *) (* modify it under the terms of the GNU General Public *) (* License version 2, as published by the Free Software Foundation. *) (* *) (* This software is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *) (* *) (* See the GNU General Public License version 2 for more details *) (* (enclosed in the file GPL). *) (**************************************************************************) (*s Copyright and licence information. *) open Printf let copying () = prerr_endline " This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2, as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License version 2 for more details (enclosed in the file GPL)."; flush stderr let banner softname = if not !Options.quiet then begin eprintf "This is %s version %s, compiled on %s\n" softname Version.version Version.date; eprintf "Copyright (c) 1997-2010 Jean-Christophe Filliâtre and Claude Marché\n"; eprintf "This is free software with ABSOLUTELY NO WARRANTY (use option --warranty)\n\n"; flush stderr end bibtex2html-1.99/copying.mli0000644000246300004300000000235013255132746015414 0ustar filliatrvals(**************************************************************************) (* bibtex2html - A BibTeX to HTML translator *) (* Copyright (C) 1997-2014 Jean-Christophe Filliâtre and Claude Marché *) (* *) (* This software is free software; you can redistribute it and/or *) (* modify it under the terms of the GNU General Public *) (* License version 2, as published by the Free Software Foundation. *) (* *) (* This software is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *) (* *) (* See the GNU General Public License version 2 for more details *) (* (enclosed in the file GPL). *) (**************************************************************************) (*s Copyright and licence information. *) val copying : unit -> unit val banner : string -> unit bibtex2html-1.99/expand.ml0000644000246300004300000001300213255132746015046 0ustar filliatrvals(**************************************************************************) (* bibtex2html - A BibTeX to HTML translator *) (* Copyright (C) 1997-2014 Jean-Christophe Filliâtre and Claude Marché *) (* *) (* This software is free software; you can redistribute it and/or *) (* modify it under the terms of the GNU General Public *) (* License version 2, as published by the Free Software Foundation. *) (* *) (* This software is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *) (* *) (* See the GNU General Public License version 2 for more details *) (* (enclosed in the file GPL). *) (**************************************************************************) (*s Expansion of abbreviations in BibTeX databases. *) open Format open Bibtex type fields = (string * string) list type entry = entry_type * key * fields let abbrev_table = Hashtbl.create 97 let add_abbrev a s = Hashtbl.add abbrev_table a s let find_abbrev s = Hashtbl.find abbrev_table s (* months are predefined abbreviations *) let () = List.iter (fun (id,m) -> add_abbrev id m) [ "jan", "January" ; "feb", "February" ; "mar", "March" ; "apr", "April" ; "may", "May" ; "jun", "June" ; "jul", "July" ; "aug", "August" ; "sep", "September" ; "oct", "October" ; "nov", "November" ; "dec", "December" ] let rec expand_list = function | [] -> "" | (Id s) :: rem -> (try find_abbrev s with Not_found -> s) ^ (expand_list rem) | (String s) :: rem -> s ^ (expand_list rem) let rec expand_fields = function | [] -> [] | (n,l) :: rem -> (n,expand_list l) :: (expand_fields rem) let macros_in_preamble s = try let lb = Lexing.from_string s in Latexscan.read_macros lb with _ -> () let rec expand biblio = Bibtex.fold (fun command accu -> match command with | Abbrev (a,l) -> let s = expand_list l in add_abbrev a s; accu | Entry (t,k,f) -> (t,k,expand_fields f) :: accu | Preamble l -> let s = expand_list l in macros_in_preamble s; accu | Comment _ -> accu) biblio [] (*s Sort BibTeX entries by decreasing dates. *) let int_of_month = function | "Janvier" | "January" -> 0 | "Février" | "February" -> 1 | "Mars" | "March" -> 2 | "Avril" | "April" -> 3 | "Mai" | "May" -> 4 | "Juin" | "June" -> 5 | "Juillet" | "July" -> 6 | "Août" | "August" -> 7 | "Septembre" | "September" -> 8 | "Octobre" | "October" -> 9 | "Novembre" | "November" -> 10 | "Décembre" | "December" -> 11 | _ -> invalid_arg "int_of_month" let month_day_re1 = Str.regexp "\\([a-zA-Z]+\\)\\( \\|~\\)\\([0-9]+\\)" let month_day_re2 = Str.regexp "\\([0-9]+\\)\\( \\|~\\)\\([a-zA-Z]+\\)" let month_anything = Str.regexp "\\([a-zA-Z]+\\)" let parse_month m = if Str.string_match month_day_re1 m 0 then int_of_month (Str.matched_group 1 m), int_of_string (Str.matched_group 3 m) else if Str.string_match month_day_re2 m 0 then int_of_month (Str.matched_group 3 m), int_of_string (Str.matched_group 1 m) else if Str.string_match month_anything m 0 then try int_of_month (find_abbrev (Str.matched_group 1 m)), 1 with Not_found -> (* be Mendeley-friendly *) int_of_month (Str.matched_group 1 m), 1 else int_of_month m, 1 type date = { year : int; month : int; day : int } let dummy_date = { year = 0; month = 0; day = 0 } let extract_year k f = try int_of_string (List.assoc "year" f) with Failure _ -> if not !Options.quiet then eprintf "Warning: incorrect year in entry %s@." k; if !Options.warn_error then exit 2; 0 let extract_month k f = try parse_month (List.assoc "month" f) with | Not_found -> 0,1 | _ -> if not !Options.quiet then eprintf "Warning: incorrect month in entry %s\n" k; if !Options.warn_error then exit 2; 0,1 let rec find_entry k = function | [] -> raise Not_found | (_,k',_) as e :: r -> if k = k' then e else find_entry k r let rec extract_date el (_,k,f) = try let y = extract_year k f in let m,d = extract_month k f in (* eprintf "extract_date: year = %d month = %d day = %d@." y m d; *) { year = y; month = m; day = d } with Not_found -> try extract_date el (find_entry (List.assoc "crossref" f) el) with Not_found -> dummy_date let date_order el e1 e2 = let d1 = extract_date el e1 in let d2 = extract_date el e2 in (d1.year < d2.year) || (d1.year == d2.year && d1.month < d2.month) || (d1.year == d2.year && d1.month == d2.month && d1.day < d2.day) let combine_comp c d = if c=0 then d else c let date_compare el e1 e2 = let d1 = extract_date el e1 in let d2 = extract_date el e2 in combine_comp (d1.year - d2.year) (combine_comp (d1.month - d2.month) (d1.day - d2.day)) (*s Access to the fields. *) let get_field (_,_,f) s = List.assoc (String.lowercase_ascii s) f let get_lowercase_field (_,_,f) s = List.assoc s f let get_title e = get_lowercase_field e "title" let get_year e = get_lowercase_field e "year" let get_month e = get_lowercase_field e "month" let get_author e = get_lowercase_field e "author" bibtex2html-1.99/expand.mli0000644000246300004300000000347713255132746015236 0ustar filliatrvals(**************************************************************************) (* bibtex2html - A BibTeX to HTML translator *) (* Copyright (C) 1997-2014 Jean-Christophe Filliâtre and Claude Marché *) (* *) (* This software is free software; you can redistribute it and/or *) (* modify it under the terms of the GNU General Public *) (* License version 2, as published by the Free Software Foundation. *) (* *) (* This software is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *) (* *) (* See the GNU General Public License version 2 for more details *) (* (enclosed in the file GPL). *) (**************************************************************************) (*s Expansion of abbreviations in BibTeX databases. *) type fields = (string * string) list type entry = Bibtex.entry_type * Bibtex.key * fields val expand : Bibtex.biblio -> entry list val expand_fields : (string * Bibtex.atom list) list -> (string * string) list (*s Compare the dates of two entries. *) val date_order : entry list -> entry -> entry -> bool val date_compare : entry list -> entry -> entry -> int (*s Access to the fields of a given entry. *) val get_field : entry -> string -> string val get_lowercase_field : entry -> string -> string val get_title : entry -> string val get_year : entry -> string val get_month : entry -> string val get_author : entry -> string bibtex2html-1.99/html.ml0000644000246300004300000000574613255132746014553 0ustar filliatrvals(**************************************************************************) (* bibtex2html - A BibTeX to HTML translator *) (* Copyright (C) 1997-2014 Jean-Christophe Filliâtre and Claude Marché *) (* *) (* This software is free software; you can redistribute it and/or *) (* modify it under the terms of the GNU General Public *) (* License version 2, as published by the Free Software Foundation. *) (* *) (* This software is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *) (* *) (* See the GNU General Public License version 2 for more details *) (* (enclosed in the file GPL). *) (**************************************************************************) (*s Production of HTML syntax. *) open Printf let bgcolor = ref None let css = ref None let open_document ch ftitle = output_string ch "\n\n"; output_string ch "\n\n\n"; output_string ch ""; ftitle(); output_string ch "\n"; begin match !css with | None -> () | Some f -> fprintf ch "\n" f end; output_string ch "\n\n"; begin match !bgcolor with | None -> output_string ch "\n" | Some color -> fprintf ch "\n" color end; flush ch let close_document ch = output_string ch "\n\n"; flush ch let open_balise ch s = output_string ch ("<" ^ s ^ ">"); flush ch let close_balise ch s = output_string ch (""); flush ch let open_anchor ch s = open_balise ch ("a name=\"" ^ s ^ "\"") let close_anchor ch = close_balise ch "a" let absolute_url_regexp = Str.regexp "\\(.+://\\)\\|#\\|mailto:" let is_absolute_url u = try Str.search_forward absolute_url_regexp u 0 = 0 with Not_found -> false let is_relative_url u = not (is_absolute_url u) let amp = Str.regexp_string "&" let open_href ch s = let s = Str.global_replace amp "&" s in open_balise ch ("a href=\"" ^ s ^ "\"") let close_href ch = close_balise ch "a" let open_h ch i = open_balise ch (sprintf "h%d" i) let close_h ch i = close_balise ch (sprintf "h%d" i) let open_em ch = open_balise ch "em" let close_em ch = close_balise ch "em" let open_b ch = open_balise ch "b" let close_b ch = close_balise ch "b" let paragraph ch = open_balise ch "p" let h_title ch n title = let s = sprintf "h%d" n in open_balise ch s; output_string ch title; close_balise ch s let h1_title ch s = h_title ch 1 s let h2_title ch s = h_title ch 2 s bibtex2html-1.99/latex_accents.mli0000644000246300004300000000251713255132746016566 0ustar filliatrvals(**************************************************************************) (* bibtex2html - A BibTeX to HTML translator *) (* Copyright (C) 1997-2014 Jean-Christophe Filliâtre and Claude Marché *) (* *) (* This software is free software; you can redistribute it and/or *) (* modify it under the terms of the GNU General Public *) (* License version 2, as published by the Free Software Foundation. *) (* *) (* This software is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *) (* *) (* See the GNU General Public License version 2 for more details *) (* (enclosed in the file GPL). *) (**************************************************************************) (* replace LaTeX control sequences for special characters. first arg is a boolean to tell if result should be a regexp, i.e escaping some characters *) val normalize : bool-> string -> string bibtex2html-1.99/latex_accents.mll0000644000246300004300000002443313255132746016572 0ustar filliatrvals(**************************************************************************) (* bibtex2html - A BibTeX to HTML translator *) (* Copyright (C) 1997-2014 Jean-Christophe Filliâtre and Claude Marché *) (* *) (* This software is free software; you can redistribute it and/or *) (* modify it under the terms of the GNU General Public *) (* License version 2, as published by the Free Software Foundation. *) (* *) (* This software is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *) (* *) (* See the GNU General Public License version 2 for more details *) (* (enclosed in the file GPL). *) (**************************************************************************) (* Normalize both ISO-latin characters and LaTeX accents to HTML entities *) { let string_buf = Buffer.create 79 let add_string s = Buffer.add_string string_buf s let add lexbuf = Buffer.add_string string_buf (Lexing.lexeme lexbuf) let produce_regexp = ref false } let space = [ '\t'] rule next_char = parse '\\'{ control lexbuf } | '{' { next_char lexbuf } | '}' { next_char lexbuf } | 'ç' { add_string "ç" ; next_char lexbuf } | 'Ç' { add_string "Ç" ; next_char lexbuf } | 'ñ' { add_string "ñ"; next_char lexbuf } | 'Ñ' { add_string "Ñ"; next_char lexbuf } | 'ã' { add_string "ã"; next_char lexbuf } | 'Ã' { add_string "Ã"; next_char lexbuf } | 'õ' { add_string "õ"; next_char lexbuf } | 'Õ' { add_string "Õ"; next_char lexbuf } | 'ä' { add_string "ä"; next_char lexbuf } | 'ö' { add_string "ö"; next_char lexbuf } | 'ü' { add_string "ü"; next_char lexbuf } | 'ë' { add_string "ë"; next_char lexbuf } | 'Ä' { add_string "Ä"; next_char lexbuf } | 'Ö' { add_string "Ö"; next_char lexbuf } | 'Ü' { add_string "Ü"; next_char lexbuf } | 'Ë' { add_string "Ë"; next_char lexbuf } | 'ï' { add_string "ï"; next_char lexbuf } | 'Ï' { add_string "Ï"; next_char lexbuf } | 'á' { add_string "á"; next_char lexbuf } | 'ó' { add_string "ó"; next_char lexbuf } | 'ú' { add_string "ú"; next_char lexbuf } | 'é' { add_string "é"; next_char lexbuf } | 'Á' { add_string "Á"; next_char lexbuf } | 'Ó' { add_string "Ó"; next_char lexbuf } | 'Ú' { add_string "Ú"; next_char lexbuf } | 'É' { add_string "É"; next_char lexbuf } | 'í' { add_string "í"; next_char lexbuf } | 'Í' { add_string "Í"; next_char lexbuf } | 'à' { add_string "à"; next_char lexbuf } | 'ò' { add_string "ò"; next_char lexbuf } | 'ù' { add_string "ù"; next_char lexbuf } | 'è' { add_string "è"; next_char lexbuf } | 'À' { add_string "À"; next_char lexbuf } | 'Ò' { add_string "Ò"; next_char lexbuf } | 'Ù' { add_string "Ù"; next_char lexbuf } | 'È' { add_string "È"; next_char lexbuf } | 'ì' { add_string "ì"; next_char lexbuf } | 'Ì' { add_string "Ì"; next_char lexbuf } | 'â' { add_string "â"; next_char lexbuf } | 'ô' { add_string "ô"; next_char lexbuf } | 'û' { add_string "û"; next_char lexbuf } | 'ê' { add_string "ê"; next_char lexbuf } | 'î' { add_string "î"; next_char lexbuf } | 'Â' { add_string "Â"; next_char lexbuf } | 'Ô' { add_string "Ô"; next_char lexbuf } | 'Û' { add_string "Û"; next_char lexbuf } | 'Ê' { add_string "Ê"; next_char lexbuf } | 'Î' { add_string "Î"; next_char lexbuf } | _ { add lexbuf ; next_char lexbuf } | eof { () } (* called when we have seen "\\" *) and control = parse '"' { quote_char lexbuf } | '\'' { right_accent lexbuf } | '`' { left_accent lexbuf } | '^' { hat lexbuf } | "c{c}" { add_string "ç" ; next_char lexbuf } | "c{C}" { add_string "Ç" ; next_char lexbuf } | 'v' { czech lexbuf } | 'u' { breve lexbuf } | 'H' { hungarian lexbuf } | '~' { tilde lexbuf } | _ { add_string "\\" ; add lexbuf ; next_char lexbuf } | eof { add_string "\\" } (* called when we have seen "\\\"" *) and quote_char = parse ('a'|"{a}") { add_string "ä" ; next_char lexbuf } | ('o'|"{o}") { add_string "ö" ; next_char lexbuf } | ('u'|"{u}") { add_string "ü" ; next_char lexbuf } | ('e'|"{e}") { add_string "ë" ; next_char lexbuf } | ('A'|"{A}") { add_string "Ä" ; next_char lexbuf } | ('O'|"{O}") { add_string "Ö" ; next_char lexbuf } | ('U'|"{U}") { add_string "Ü" ; next_char lexbuf } | ('E'|"{E}") { add_string "Ë" ; next_char lexbuf } | ('i'|"{i}"|"\\i" space*|"{\\i}") { add_string "ï" ; next_char lexbuf } | ('I'|"{I}") { add_string "Ï" ; next_char lexbuf } | _ { add_string "\\\"" ; add lexbuf } | eof { add_string "\\\"" } (* called when we have seen "\\'" *) and right_accent = parse | ('a'|"{a}") { add_string "á" ; next_char lexbuf } | ('o'|"{o}") { add_string "ó" ; next_char lexbuf } | ('u'|"{u}") { add_string "ú" ; next_char lexbuf } | ('e'|"{e}") { add_string "é" ; next_char lexbuf } | ('A'|"{A}") { add_string "Á" ; next_char lexbuf } | ('O'|"{O}") { add_string "Ó" ; next_char lexbuf } | ('U'|"{U}") { add_string "Ú" ; next_char lexbuf } | ('E'|"{E}") { add_string "É" ; next_char lexbuf } | ('\'') { add_string "”" ; next_char lexbuf } | ('i'|"{i}"|"\\i" space*|"{\\i}") { add_string "í" ; next_char lexbuf } | ('I'|"{I}") { add_string "Í" ; next_char lexbuf } | _ { add_string "\\'" ; add lexbuf ; next_char lexbuf } | eof { add_string "\\'" } (* called when we have seen "\\`" *) and left_accent = parse ('a'|"{a}") { add_string "à" ; next_char lexbuf } | ('o'|"{o}") { add_string "ò" ; next_char lexbuf } | ('u'|"{u}") { add_string "ù" ; next_char lexbuf } | ('e'|"{e}") { add_string "è" ; next_char lexbuf } | ('A'|"{A}") { add_string "À" ; next_char lexbuf } | ('O'|"{O}") { add_string "Ò" ; next_char lexbuf } | ('U'|"{U}") { add_string "Ù" ; next_char lexbuf } | ('E'|"{E}") { add_string "È" ; next_char lexbuf } | ('`') { add_string "“" ; next_char lexbuf } | ('i'|"{i}"|"\\i" space* |"{\\i}") { add_string "ì" ; next_char lexbuf } | ('I'|"{I}") { add_string "Ì" ; next_char lexbuf } | _ { add_string "\\`" ; add lexbuf ; next_char lexbuf } | eof { add_string "\\`" } (* called when we have seen "\\^" *) and hat = parse ('a'|"{a}") { add_string "â" ; next_char lexbuf } | ('o'|"{o}") { add_string "ô" ; next_char lexbuf } | ('u'|"{u}") { add_string "û" ; next_char lexbuf } | ('e'|"{e}") { add_string "ê" ; next_char lexbuf } | ('A'|"{A}") { add_string "Â" ; next_char lexbuf } | ('O'|"{O}") { add_string "Ô" ; next_char lexbuf } | ('U'|"{U}") { add_string "Û" ; next_char lexbuf } | ('E'|"{E}") { add_string "Ê" ; next_char lexbuf } | ('i'|"{i}"|"\\i" space* |"{\\i}") { add_string "î" ; next_char lexbuf } | ('I'|"{I}") { add_string "Î" ; next_char lexbuf } | _ { add_string "\\^" ; add lexbuf ; next_char lexbuf } | eof { add_string "\\^" } (* called when we have seen "\\~" *) and tilde = parse ('a'|"{a}") { add_string "ã" ; next_char lexbuf } | ('o'|"{o}") { add_string "õ" ; next_char lexbuf } | ('A'|"{A}") { add_string "Ã" ; next_char lexbuf } | ('O'|"{O}") { add_string "Õ" ; next_char lexbuf } | ('n'|"{n}") { add_string "ñ" ; next_char lexbuf } | ('N'|"{N}") { add_string "Ñ" ; next_char lexbuf } | _ { add_string "\\~" ; add lexbuf ; next_char lexbuf } | eof { add_string "\\~" } (* called when we have seen "\\v" *) and czech = parse ('r'|"{r}") { add_string "ř" ; next_char lexbuf } | ('R'|"{R}") { add_string "Ř" ; next_char lexbuf } | ('s'|"{s}") { add_string "š" ; next_char lexbuf } | ('S'|"{S}") { add_string "Š" ; next_char lexbuf } | ('i'|"{i}"|"\\i" space* |"{\\i}") { add_string "ĭ" ; next_char lexbuf } | ('I'|"{I}") { add_string "Ĭ" ; next_char lexbuf } | _ { add_string "\\^" ; add lexbuf ; next_char lexbuf } | eof { add_string "\\^" } (* called when we have seen "\\u" *) and breve = parse ('a'|"{a}") { add_string "ă" ; next_char lexbuf } | ('o'|"{o}") { add_string "ŏ" ; next_char lexbuf } | ('u'|"{u}") { add_string "ŭ" ; next_char lexbuf } | ('e'|"{e}") { add_string "ĕ" ; next_char lexbuf } | ('A'|"{A}") { add_string "Ă" ; next_char lexbuf } | ('O'|"{O}") { add_string "Ŏ" ; next_char lexbuf } | ('U'|"{U}") { add_string "Ŭ" ; next_char lexbuf } | ('E'|"{E}") { add_string "Ĕ" ; next_char lexbuf } | ('i'|"{i}"|"\\i" space* |"{\\i}") { add_string "ĭ" ; next_char lexbuf } | ('I'|"{I}") { add_string "Ĭ" ; next_char lexbuf } | _ { add_string "\\u" ; add lexbuf ; next_char lexbuf } | eof { add_string "\\u" } (* called when we have seen "\\H" *) and hungarian = parse ('o'|"{o}") { add_string "ő" ; next_char lexbuf } | ('u'|"{u}") { add_string "ű" ; next_char lexbuf } | ('O'|"{O}") { add_string "Ő" ; next_char lexbuf } | ('U'|"{U}") { add_string "Ű" ; next_char lexbuf } | _ { add_string "\\H" ; add lexbuf ; next_char lexbuf } | eof { add_string "\\H" } { let normalize to_regexp s = Buffer.clear string_buf; produce_regexp := to_regexp; next_char (Lexing.from_string s); Buffer.contents string_buf ;; } bibtex2html-1.99/latexmacros.ml0000644000246300004300000006140313255132746016121 0ustar filliatrvals(**************************************************************************) (* bibtex2html - A BibTeX to HTML translator *) (* Copyright (C) 1997-2014 Jean-Christophe Filliâtre and Claude Marché *) (* *) (* This software is free software; you can redistribute it and/or *) (* modify it under the terms of the GNU General Public *) (* License version 2, as published by the Free Software Foundation. *) (* *) (* This software is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *) (* *) (* See the GNU General Public License version 2 for more details *) (* (enclosed in the file GPL). *) (**************************************************************************) (* This code is an adaptation of a code written by Xavier Leroy in 1995-1997, in his own made latex2html translator. See @inproceedings{Leroy-latex2html, author = "Xavier Leroy", title = "Lessons learned from the translation of documentation from \LaTeX\ to {HTML}", booktitle = "ERCIM/W4G Int. Workshop on WWW Authoring and Integration Tools", year = 1995, month = feb} *) open Printf open Options (*s Output functions. *) let out_channel = ref stdout let print_s s = output_string !out_channel s let print_c c = output_char !out_channel c (*s Actions and translations table. *) type action = | Print of string | Print_arg | Skip_arg | Raw_arg of (string -> unit) | Parameterized of (string -> action list) | Recursive of string (*r piece of LaTeX to analyze recursively *) let cmdtable = (Hashtbl.create 19 : (string, action list) Hashtbl.t) let def name action = Hashtbl.add cmdtable name action let find_macro name = try Hashtbl.find cmdtable name with Not_found -> if not !quiet then eprintf "Unknown macro: %s\n" name; [] ;; (*s Translations of general LaTeX macros. *) (* Sectioning *) def "\\part" [Print ""; Print_arg; Print "\n"]; def "\\chapter" [Print "

"; Print_arg; Print "

\n"]; def "\\chapter*" [Print "

"; Print_arg; Print "

\n"]; def "\\section" [Print "

"; Print_arg; Print "

\n"]; def "\\section*" [Print "

"; Print_arg; Print "

\n"]; def "\\subsection" [Print "

"; Print_arg; Print "

\n"]; def "\\subsection*" [Print "

"; Print_arg; Print "

\n"]; def "\\subsubsection" [Print "

"; Print_arg; Print "

\n"]; def "\\subsubsection*" [Print "

"; Print_arg; Print "

\n"]; def "\\paragraph" [Print "
"; Print_arg; Print "
\n"]; (* Text formatting *) def "\\begin{alltt}" [Print "
"];
def "\\end{alltt}" [Print "
"]; def "\\textbf" [Print "" ; Print_arg ; Print ""]; def "\\mathbf" [Print "" ; Print_arg ; Print ""]; def "\\texttt" [Print "" ; Print_arg ; Print ""]; def "\\mathtt" [Print "" ; Print_arg ; Print ""]; def "\\textit" [Print "" ; Print_arg ; Print ""]; def "\\mathit" [Print "" ; Print_arg ; Print ""]; def "\\textsl" [Print "" ; Print_arg ; Print ""]; def "\\textem" [Print "" ; Print_arg ; Print ""]; def "\\textrm" [Print_arg]; def "\\mathrm" [Print_arg]; def "\\textmd" [Print_arg]; def "\\textup" [Print_arg]; def "\\textnormal" [Print_arg]; def "\\mathnormal" [Print "" ; Print_arg ; Print ""]; def "\\mathcal" [Print_arg]; def "\\mathbb" [Print_arg]; def "\\mathfrak" [Print_arg]; def "\\textin" [Print ""; Print_arg; Print ""]; def "\\textsu" [Print ""; Print_arg; Print ""]; def "\\textsuperscript" [Print ""; Print_arg; Print ""]; def "\\textsi" [Print "" ; Print_arg ; Print ""]; (* Basic color support. *) def "\\textcolor" [ Parameterized (function name -> match String.lowercase_ascii name with (* At the moment, we support only the 16 named colors defined in HTML 4.01. *) | "black" | "silver" | "gray" | "white" | "maroon" | "red" | "purple" | "fuchsia" | "green" | "lime" | "olive" | "yellow" | "navy" | "blue" | "teal" | "aqua" -> [ Print (Printf.sprintf "" name); Print_arg ; Print "" ] (* Other, unknown colors have no effect. *) | _ -> [ Print_arg ] )]; (* Fonts without HTML equivalent *) def "\\textsf" [Print "" ; Print_arg ; Print ""]; def "\\mathsf" [Print "" ; Print_arg ; Print ""]; def "\\textsc" [Print_arg]; def "\\textln" [Print_arg]; def "\\textos" [Print_arg]; def "\\textdf" [Print_arg]; def "\\textsw" [Print_arg]; def "\\rm" []; def "\\cal" []; def "\\emph" [Print "" ; Print_arg ; Print ""]; def "\\mbox" [Print_arg]; def "\\footnotesize" []; def "\\etalchar" [ Print "" ; Raw_arg print_s ; Print "" ]; def "\\newblock" [Print " "]; (* Environments *) def "\\begin{itemize}" [Print "

    "]; def "\\end{itemize}" [Print "
"]; def "\\begin{enumerate}" [Print "

    "]; def "\\end{enumerate}" [Print "
"]; def "\\begin{description}" [Print "

"]; def "\\end{description}" [Print "
"]; def "\\begin{center}" [Print "
"]; def "\\end{center}" [Print "
"]; def "\\begin{htmlonly}" []; def "\\end{htmlonly}" []; def "\\begin{flushleft}" [Print "
"]; def "\\end{flushleft}" [Print "
"]; (* Special characters *) def "\\ " [Print " "]; def "\\\n" [Print " "]; def "\\{" [Print "{"]; def "\\}" [Print "}"]; def "\\l" [Print "l"]; def "\\L" [Print "L"]; def "\\oe" [Print "œ"]; def "\\OE" [Print "Œ"]; def "\\o" [Print "ø"]; def "\\O" [Print "Ø"]; def "\\ae" [Print "æ"]; def "\\AE" [Print "Æ"]; def "\\aa" [Print "å"]; def "\\AA" [Print "Å"]; def "\\i" [Print "i"]; def "\\j" [Print "j"]; def "\\&" [Print "&"]; def "\\$" [Print "$"]; def "\\%" [Print "%"]; def "\\_" [Print "_"]; def "\\slash" [Print "/"]; def "\\copyright" [Print "(c)"]; def "\\th" [Print "þ"]; def "\\TH" [Print "Þ"]; def "\\dh" [Print "ð"]; def "\\DH" [Print "Ð"]; def "\\dj" [Print "đ"]; def "\\DJ" [Print "Đ"]; def "\\ss" [Print "ß"]; def "\\rq" [Print "’"]; def "\\'" [Raw_arg(function "e" -> print_s "é" | "E" -> print_s "É" | "a" -> print_s "á" | "A" -> print_s "Á" | "o" -> print_s "ó" | "O" -> print_s "Ó" | "i" -> print_s "í" | "\\i" -> print_s "í" | "I" -> print_s "Í" | "u" -> print_s "ú" | "U" -> print_s "Ú" | "'" -> print_s "”" | "c" -> print_s "ć" | "C" -> print_s "Ć" | "g" -> print_s "ǵ" | "G" -> print_s "G" | "l" -> print_s "ĺ" | "L" -> print_s "Ĺ" | "n" -> print_s "ń" | "N" -> print_s "Ń" | "r" -> print_s "ŕ" | "R" -> print_s "Ŕ" | "s" -> print_s "ś" | "S" -> print_s "Ś" | "y" -> print_s "ý" | "Y" -> print_s "Ý" | "z" -> print_s "Ź" | "Z" -> print_s "ź" | "" -> print_c '\'' | s -> print_s s)]; def "\\`" [Raw_arg(function "e" -> print_s "è" | "E" -> print_s "È" | "a" -> print_s "à" | "A" -> print_s "À" | "o" -> print_s "ò" | "O" -> print_s "Ò" | "i" -> print_s "ì" | "\\i" -> print_s "ì" | "I" -> print_s "Ì" | "u" -> print_s "ù" | "U" -> print_s "Ù" | "`" -> print_s "“" | "" -> print_s "‘" | s -> print_s s)]; def "\\~" [Raw_arg(function "n" -> print_s "ñ" | "N" -> print_s "Ñ" | "o" -> print_s "õ" | "O" -> print_s "Õ" | "i" -> print_s "ĩ" | "\\i" -> print_s "ĩ" | "I" -> print_s "Ĩ" | "a" -> print_s "ã" | "A" -> print_s "Ã" | "u" -> print_s "©" | "U" -> print_s "¨" | "" -> print_s "˜" | s -> print_s s)]; def "\\k" [Raw_arg(function "A" -> print_s "Ą" | "a" -> print_s "ą" | "i" -> print_s "Į" | "I" -> print_s "į" | s -> print_s s)]; def "\\c" [Raw_arg(function "c" -> print_s "ç" | "C" -> print_s "Ç" | s -> print_s s)]; def "\\^" [Raw_arg(function "a" -> print_s "â" | "A" -> print_s "Â" | "e" -> print_s "ê" | "E" -> print_s "Ê" | "i" -> print_s "î" | "\\i" -> print_s "î" | "I" -> print_s "Î" | "o" -> print_s "ô" | "O" -> print_s "Ô" | "u" -> print_s "û" | "U" -> print_s "Û" | "w" -> print_s "ŵ" | "W" -> print_s "Ŵ" | "y" -> print_s "ŷ" | "Y" -> print_s "Ŷ" | "" -> print_c '^' | s -> print_s s)]; def "\\hat" [Raw_arg(function "a" -> print_s "â" | "A" -> print_s "Â" | "e" -> print_s "ê" | "E" -> print_s "Ê" | "i" -> print_s "î" | "\\i" -> print_s "î" | "I" -> print_s "Î" | "o" -> print_s "ô" | "O" -> print_s "Ô" | "u" -> print_s "û" | "U" -> print_s "Û" | "" -> print_c '^' | s -> print_s s)]; def "\\\"" [Raw_arg(function "e" -> print_s "ë" | "E" -> print_s "Ë" | "a" -> print_s "ä" | "A" -> print_s "Ä" | "\\i" -> print_s "ï" | "i" -> print_s "ï" | "I" -> print_s "Ï" | "o" -> print_s "ö" | "O" -> print_s "Ö" | "u" -> print_s "ü" | "U" -> print_s "Ü" | "y" -> print_s "ÿ" | "Y" -> print_s "Ÿ" | s -> print_s s)]; def "\\d" [Raw_arg print_s ]; def "\\." [Raw_arg (function "a" -> print_s "ȧ" | "A" -> print_s "Ȧ" | "c" -> print_s "ċ" | "C" -> print_s "Ċ" | "e" -> print_s "ė" | "E" -> print_s "Ė" | "g" -> print_s "ġ" | "G" -> print_s "Ġ" | "i" -> print_s "i" | "\\i" -> print_s "i" | "I" -> print_s "İ" | "o" -> print_s "ȯ" | "O" -> print_s "Ȯ" | "z" -> print_s "ż" | "Z" -> print_s "Ż" | s -> print_s s)]; def "\\u" [Raw_arg(function "a" -> print_s "ă" | "A" -> print_s "Ă" | "e" -> print_s "ĕ" | "E" -> print_s "Ĕ" | "i" -> print_s "Ĭ" | "\\i" -> print_s "Ĭ" | "I" -> print_s "ĭ" | "g" -> print_s "ğ" | "G" -> print_s "Ğ" | "o" -> print_s "ŏ" | "O" -> print_s "Ŏ" | "u" -> print_s "ŭ" | "U" -> print_s "Ŭ" | s -> print_s s)]; def "\\v" [Raw_arg(function | "C" -> print_s "Č" | "c" -> print_s "č" | "D" -> print_s "Ď" | "d" -> print_s "ď" | "E" -> print_s "Ě" | "e" -> print_s "ě" | "N" -> print_s "Ň" | "n" -> print_s "ň" | "r" -> print_s "ř" | "R" -> print_s "Ř" | "s" -> print_s "š" (*"š"*) | "S" -> print_s "Š" (*"Š"*) | "T" -> print_s "Ť" | "t" -> print_s "ť" | "\\i" -> print_s "ĭ" | "i" -> print_s "ĭ" | "I" -> print_s "Ĭ" | "Z" -> print_s "Ž" | "z" -> print_s "ž" | s -> print_s s)]; def "\\H" [Raw_arg (function | "O" -> print_s "Ő" | "o" -> print_s "ő" | "U" -> print_s "Ű" | "u" -> print_s "ű" | s -> print_s s)]; def "\\r" [Raw_arg (function | "U" -> print_s "Ů" | "u" -> print_s "ů" | s -> print_s s)]; (* Math macros *) def "\\[" [Print "
"]; def "\\]" [Print "\n
"]; def "\\le" [Print "<="]; def "\\leq" [Print "<="]; def "\\log" [Print "log"]; def "\\ge" [Print ">="]; def "\\geq" [Print ">="]; def "\\neq" [Print "<>"]; def "\\circ" [Print "o"]; def "\\bigcirc" [Print "O"]; def "\\sim" [Print "~"]; def "\\(" [Print ""]; def "\\)" [Print ""]; def "\\mapsto" [Print "|->"]; def "\\times" [Print "×"]; def "\\neg" [Print "¬"]; def "\\frac" [Print "("; Print_arg; Print ")/("; Print_arg; Print ")"]; def "\\not" [Print "not "]; (* Math symbols printed as texts (could we do better?) *) def "\\ne" [Print "=/="]; def "\\in" [Print "in"]; def "\\forall" [Print "for all"]; def "\\exists" [Print "there exists"]; def "\\vdash" [Print "|-"]; def "\\ln" [Print "ln"]; def "\\gcd" [Print "gcd"]; def "\\min" [Print "min"]; def "\\max" [Print "max"]; def "\\exp" [Print "exp"]; def "\\rightarrow" [Print "->"]; def "\\to" [Print "->"]; def "\\longrightarrow" [Print "-->"]; def "\\Rightarrow" [Print "=>"]; def "\\leftarrow" [Print "<-"]; def "\\longleftarrow" [Print "<--"]; def "\\Leftarrow" [Print "<="]; def "\\leftrightarrow" [Print "<->"]; def "\\sqrt" [Print "sqrt("; Print_arg; Print ")"]; def "\\vee" [Print "V"]; def "\\lor" [Print "V"]; def "\\wedge" [Print "/\\"]; def "\\land" [Print "/\\"]; def "\\Vert" [Print "||"]; def "\\parallel" [Print "||"]; def "\\mid" [Print "|"]; def "\\cup" [Print "U"]; def "\\inf" [Print "inf"]; (* Misc. macros. *) def "\\TeX" [Print "TEX"]; def "\\LaTeX" [Print "LATEX"]; def "\\LaTeXe" [Print "LATEX 2e"]; def "\\tm" [Print "TM"]; def "\\par" [Print "

"]; def "\\@" [Print " "]; def "\\#" [Print "#"]; def "\\/" []; def "\\-" []; def "\\left" []; def "\\right" []; def "\\smallskip" []; def "\\medskip" []; def "\\bigskip" []; def "\\relax" []; def "\\markboth" [Skip_arg; Skip_arg]; def "\\dots" [Print "..."]; def "\\dot" [Print "."]; def "\\simeq" [Print "˜="]; def "\\approx" [Print "˜"]; def "\\^circ" [Print "°"]; def "\\ldots" [Print "..."]; def "\\cdot" [Print "·"]; def "\\cdots" [Print "..."]; def "\\newpage" []; def "\\hbox" [Print_arg]; def "\\noindent" []; def "\\label" [Print ""]; def "\\ref" [Print "(ref)"]; def "\\index" [Skip_arg]; def "\\\\" [Print "
"]; def "\\," []; def "\\;" []; def "\\!" []; def "\\hspace" [Skip_arg; Print " "]; def "\\symbol" [Raw_arg (function s -> try let n = int_of_string s in print_c (Char.chr n) with _ -> ())]; def "\\html" [Raw_arg print_s]; def "\\textcopyright" [Print "©"]; def "\\textordfeminine" [Print "ª"]; def "\\textordmasculine" [Print "º"]; def "\\backslash" [Print "\"]; (* hyperref *) def "\\href" [Print ""; Print_arg; Print ""]; (* Bibliography *) def "\\begin{thebibliography}" [Print "

References

\n
\n"; Skip_arg]; def "\\end{thebibliography}" [Print "
"]; def "\\bibitem" [Raw_arg (function r -> print_s "
["; print_s r; print_s "]\n"; print_s "
")]; (* Greek letters *) (*** List.iter (fun symbol -> def ("\\" ^ symbol) [Print ("" ^ symbol ^ "")]) ["alpha";"beta";"gamma";"delta";"epsilon";"varepsilon";"zeta";"eta"; "theta";"vartheta";"iota";"kappa";"lambda";"mu";"nu";"xi";"pi";"varpi"; "rho";"varrho";"sigma";"varsigma";"tau";"upsilon";"phi";"varphi"; "chi";"psi";"omega";"Gamma";"Delta";"Theta";"Lambda";"Xi";"Pi"; "Sigma";"Upsilon";"Phi";"Psi";"Omega"]; ***) def "\\alpha" [Print "α"]; def "\\beta" [Print "β"]; def "\\gamma" [Print "γ"]; def "\\delta" [Print "δ"]; def "\\epsilon" [Print "ε"]; def "\\varepsilon" [Print "ε"]; def "\\zeta" [Print "ζ"]; def "\\eta" [Print "η"]; def "\\theta" [Print "θ"]; def "\\vartheta" [Print "θ"]; def "\\iota" [Print "ι"]; def "\\kappa" [Print "κ"]; def "\\lambda" [Print "λ"]; def "\\mu" [Print "μ"]; def "\\nu" [Print "ν"]; def "\\xi" [Print "ξ"]; def "\\pi" [Print "π"]; def "\\varpi" [Print "ϖ"]; def "\\rho" [Print "ρ"]; def "\\varrho" [Print "ρ"]; def "\\sigma" [Print "σ"]; def "\\varsigma" [Print "ς"]; def "\\tau" [Print "τ"]; def "\\upsilon" [Print "υ"]; def "\\phi" [Print "φ"]; def "\\varphi" [Print "φ"]; def "\\chi" [Print "χ"]; def "\\psi" [Print "ψ"]; def "\\omega" [Print "ω"]; def "\\Gamma" [Print "Γ"]; def "\\Delta" [Print "Δ"]; def "\\Theta" [Print "Θ"]; def "\\Lambda" [Print "Λ"]; def "\\Xi" [Print "Ξ"]; def "\\Pi" [Print "Π"]; def "\\Sigma" [Print "Σ"]; def "\\Upsilon" [Print "Υ"]; def "\\Phi" [Print "Φ"]; def "\\Psi" [Print "Ψ"]; def "\\Omega" [Print "Ω"]; (* macros for the AMS styles *) def "\\bysame" [Print "           "]; def "\\MR" [Raw_arg (fun s -> let mr = try let i = String.index s ' ' in if i=0 then raise Not_found; String.sub s 0 i with Not_found -> s in print_s "MR "; print_s s; print_s "")]; def "\\MRhref" [Print ""; Print_arg; Print ""]; (* macros for the aaai-named style *) def "\\em" []; def "\\protect" []; def "\\bgroup" []; (* should go into latexscan? *) def "\\egroup" []; (* should go into latexscan? *) def "\\citename" []; (* dashes *) def "--" [Print "--"]; def "---" [Print "---"]; () (* Unicode entities *) let unicode_entities () = def "\\models" [Print "⊨"]; def "\\curlyvee" [Print "⋎"]; def "\\curlywedge" [Print "⋏"]; def "\\bigcirc" [Print "◯"]; def "\\varepsilon" [Print "ɛ"]; def "\\not" [Raw_arg (function | "\\models" -> print_s "⊭" | s -> print_s "not "; print_s s)]; def "--" [Print "–"]; def "---" [Print "—"]; () let html_entities () = def "\\sqrt" [Print "√("; Print_arg; Print ")"]; def "\\copyright" [Print "©"]; def "\\tm" [Print "™"]; def "\\lang" [Print "⟨"]; def "\\rang" [Print "⟩"]; def "\\lceil" [Print "⌈"]; def "\\rceil" [Print "⌉"]; def "\\lfloor" [Print "⌊"]; def "\\rfloor" [Print "⌋"]; def "\\le" [Print "≤"]; def "\\leq" [Print "≤"]; def "\\ge" [Print "≥"]; def "\\geq" [Print "≥"]; def "\\neq" [Print "≠"]; def "\\approx" [Print "≈"]; def "\\cong" [Print "≅"]; def "\\equiv" [Print "≡"]; def "\\propto" [Print "∝"]; def "\\subset" [Print "⊂"]; def "\\subseteq" [Print "⊆"]; def "\\supset" [Print "⊃"]; def "\\supseteq" [Print "⊇"]; def "\\ang" [Print "∠"]; def "\\perp" [Print "⊥"]; def "\\therefore" [Print "∴"]; def "\\sim" [Print "∼"]; def "\\times" [Print "×"]; def "\\ast" [Print "∗"]; def "\\otimes" [Print "⊗"]; def "\\oplus" [Print "⊕"]; def "\\lozenge" [Print "◊"]; def "\\diamond" [Print "◊"]; def "\\neg" [Print "¬"]; def "\\pm" [Print "±"]; def "\\dagger" [Print "†"]; def "\\ne" [Print "≠"]; def "\\in" [Print "∈"]; def "\\notin" [Print "∉"]; def "\\ni" [Print "∋"]; def "\\forall" [Print "∀"]; def "\\exists" [Print "∃"]; def "\\Re" [Print "ℜ"]; def "\\Im" [Print "ℑ"]; def "\\aleph" [Print "ℵ"]; def "\\wp" [Print "℘"]; def "\\emptyset" [Print "∅"]; def "\\nabla" [Print "∇"]; def "\\rightarrow" [Print "→"]; def "\\to" [Print "→"]; def "\\longrightarrow" [Print "→"]; def "\\Rightarrow" [Print "⇒"]; def "\\leftarrow" [Print "←"]; def "\\longleftarrow" [Print "←"]; def "\\Leftarrow" [Print "⇐"]; def "\\leftrightarrow" [Print "↔"]; def "\\sum" [Print "∑"]; def "\\prod" [Print "∏"]; def "\\int" [Print "∫"]; def "\\partial" [Print "∂"]; def "\\vee" [Print "∨"]; def "\\lor" [Print "∨"]; def "\\wedge" [Print "∧"]; def "\\land" [Print "∧"]; def "\\cup" [Print "∪"]; def "\\infty" [Print "∞"]; def "\\simeq" [Print "≅"]; def "\\cdot" [Print "⋅"]; def "\\cdots" [Print "⋅⋅⋅"]; def "\\vartheta" [Print "ϑ"]; def "\\angle" [Print "∠"]; def "\\=" [Raw_arg(function | "a" -> print_s "&abar;" | "A" -> print_s "&Abar;" | s -> print_s s)]; def "--" [Print "–"]; def "---" [Print "—"]; () (*s Macros for German BibTeX style. *) let is_german_style = function | "gerabbrv" | "geralpha" | "gerapali" | "gerplain" | "gerunsrt" -> true | _ -> false let init_style_macros st = if is_german_style st then begin List.iter (fun (m,s) -> def m [ Print s; Print_arg ]) [ "\\btxetalshort", "et al" ; "\\btxeditorshort", "Hrsg"; "\\Btxeditorshort", "Hrsg"; "\\btxeditorsshort", "Hrsg"; "\\Btxeditorsshort", "Hrsg"; "\\btxvolumeshort", "Bd"; "\\Btxvolumeshort", "Bd"; "\\btxnumbershort", "Nr"; "\\Btxnumbershort", "Nr"; "\\btxeditionshort", "Aufl"; "\\Btxeditionshort", "Aufl"; "\\btxchaptershort", "Kap"; "\\Btxchaptershort", "Kap"; "\\btxpageshort", "S"; "\\Btxpageshort", "S"; "\\btxpagesshort", "S"; "\\Btxpagesshort", "S"; "\\btxtechrepshort", "Techn. Ber"; "\\Btxtechrepshort", "Techn. Ber"; "\\btxmonjanshort", "Jan"; "\\btxmonfebshort", "Feb"; "\\btxmonaprshort", "Apr"; "\\btxmonaugshort", "Aug"; "\\btxmonsepshort", "Sep"; "\\btxmonoctshort", "Okt"; "\\btxmonnovshort", "Nov"; "\\btxmondecshort", "Dez"; ]; List.iter (fun (m,s) -> def m [ Skip_arg; Print s]) [ "\\btxetallong", "et alii"; "\\btxandshort", "und"; "\\btxandlong", "und"; "\\btxinlong", "in:"; "\\btxinshort", "in:"; "\\btxofseriesshort", "d. Reihe"; "\\btxinseriesshort", "in"; "\\btxofserieslong", "der Reihe"; "\\btxinserieslong", "in"; "\\btxeditorlong", "Herausgeber"; "\\Btxeditorlong", "Herausgeber"; "\\btxeditorslong", "Herausgeber"; "\\Btxeditorslong", "Herausgeber"; "\\btxvolumelong", "Band"; "\\Btxvolumelong", "Band"; "\\btxnumberlong", "Nummer"; "\\Btxnumberlong", "Nummer"; "\\btxeditionlong", "Auflage"; "\\Btxeditionlong", "Auflage"; "\\btxchapterlong", "Kapitel"; "\\Btxchapterlong", "Kapitel"; "\\btxpagelong", "Seite"; "\\Btxpagelong", "Seite"; "\\btxpageslong", "Seiten"; "\\Btxpageslong", "Seiten"; "\\btxmastthesis", "Diplomarbeit"; "\\btxphdthesis", "Doktorarbeit"; "\\btxtechreplong", "Technischer Bericht"; "\\Btxtechreplong", "Technischer Bericht"; "\\btxmonjanlong", "Januar"; "\\btxmonfeblong", "Februar"; "\\btxmonmarlong", "März"; "\\btxmonaprlong", "April"; "\\btxmonmaylong", "Mai"; "\\btxmonjunlong", "Juni"; "\\btxmonjullong", "Juli"; "\\btxmonauglong", "August"; "\\btxmonseplong", "September"; "\\btxmonoctlong", "Oktober"; "\\btxmonnovlong", "November"; "\\btxmondeclong", "Dezember"; "\\btxmonmarshort", "März"; "\\btxmonmayshort", "Mai"; "\\btxmonjunshort", "Juni"; "\\btxmonjulshort", "Juli"; "\\Btxinlong", "In:"; "\\Btxinshort", "In:"; ] end bibtex2html-1.99/latexmacros.mli0000644000246300004300000000452413255132746016273 0ustar filliatrvals(**************************************************************************) (* bibtex2html - A BibTeX to HTML translator *) (* Copyright (C) 1997-2014 Jean-Christophe Filliâtre and Claude Marché *) (* *) (* This software is free software; you can redistribute it and/or *) (* modify it under the terms of the GNU General Public *) (* License version 2, as published by the Free Software Foundation. *) (* *) (* This software is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *) (* *) (* See the GNU General Public License version 2 for more details *) (* (enclosed in the file GPL). *) (**************************************************************************) (*s This module provides a table to store the translations of LaTeX macros. A translation is a list of actions of the following type [action]. *) (* This code is an adaptation of a code written by Xavier Leroy in 1995-1997, in his own home-made latex2html translator. See @inproceedings{Leroy-latex2html, author = "Xavier Leroy", title = "Lessons learned from the translation of documentation from \LaTeX\ to {HTML}", booktitle = "ERCIM/W4G Int. Workshop on WWW Authoring and Integration Tools", year = 1995, month = feb} *) type action = | Print of string | Print_arg | Skip_arg | Raw_arg of (string -> unit) | Parameterized of (string -> action list) | Recursive of string val def : string -> action list -> unit val find_macro: string -> action list val init_style_macros : string -> unit (*s HTML entities *) val html_entities : unit -> unit val unicode_entities : unit -> unit (*s Utility functions used in the definition of translations. *) val out_channel : out_channel ref val print_s : string -> unit val print_c : char -> unit bibtex2html-1.99/latexscan.mll0000644000246300004300000003135113255132746015734 0ustar filliatrvals(**************************************************************************) (* bibtex2html - A BibTeX to HTML translator *) (* Copyright (C) 1997-2014 Jean-Christophe Filliâtre and Claude Marché *) (* *) (* This software is free software; you can redistribute it and/or *) (* modify it under the terms of the GNU General Public *) (* License version 2, as published by the Free Software Foundation. *) (* *) (* This software is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *) (* *) (* See the GNU General Public License version 2 for more details *) (* (enclosed in the file GPL). *) (**************************************************************************) (* * bibtex2html - A BibTeX to HTML translator * Copyright (C) 1997 Jean-Christophe FILLIATRE * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public * License version 2, as published by the Free Software Foundation. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * * See the GNU General Public License version 2 for more details * (enclosed in the file GPL). *) (*i $Id: latexscan.mll,v 1.40 2010-02-22 07:38:19 filliatr Exp $ i*) (*s This code is Copyright (C) 1997 Xavier Leroy. *) { open Printf open Latexmacros type math_mode = MathNone | MathDisplay | MathNoDisplay let brace_nesting = ref 0 let math_mode = ref MathNone let is_math_mode () = match !math_mode with | MathNone -> false | MathDisplay | MathNoDisplay -> true let hevea_url = ref false let html_entities = ref false let save_nesting f arg = let n = !brace_nesting in brace_nesting := 0; f arg; brace_nesting := n let save_state f arg = let n = !brace_nesting and m = !math_mode in brace_nesting := 0; math_mode := MathNone; f arg; brace_nesting := n; math_mode := m let verb_delim = ref (Char.chr 0) let r = Str.regexp "[ \t\n]+" let remove_whitespace u = Str.global_replace r "" u let amp = Str.regexp_string "&" let url s = Str.global_replace amp "&" s let print_latex_url u = let u = url (remove_whitespace u) in print_s (sprintf "%s" u u) let print_hevea_url u t = let u = url (remove_whitespace u) in print_s (sprintf "%s" u t) let chop_last_space s = let n = String.length s in if s.[n-1] = ' ' then String.sub s 0 (n-1) else s let def_macro s n b = if not !Options.quiet then begin eprintf "macro: %s = %s\n" s b; flush stderr end; let n = match n with None -> 0 | Some n -> int_of_string n in let rec code i subst = if i <= n then let r = Str.regexp ("#" ^ string_of_int i) in [Parameterized (fun arg -> let subst s = Str.global_replace r (subst s) arg in code (i+1) subst)] else begin let _s = subst b in (* eprintf "subst b = %s\n" s; flush stderr; *) [Recursive (subst b)] end in def s (code 1 (fun s -> s)) let exec_macro ~main ~print_arg ~raw_arg ~skip_arg lexbuf m = let rec exec = function | Print str -> print_s str | Print_arg -> print_arg lexbuf | Raw_arg f -> let s = raw_arg lexbuf in f s | Skip_arg -> save_nesting skip_arg lexbuf | Recursive s -> main (Lexing.from_string s) | Parameterized f -> List.iter exec (f (raw_arg lexbuf)) in List.iter exec (find_macro m) } let space = [' ' '\t' '\n' '\r'] let float = '-'? (['0'-'9']+ | ['0'-'9']* '.' ['0'-'9']*) let dimension = float ("sp" | "pt" | "bp" | "dd" | "mm" | "pc" | "cc" | "cm" | "in" | "ex" | "em" | "mu") rule main = parse (* Comments *) '%' [^ '\n'] * '\n' { main lexbuf } (* Paragraphs *) | "\n\n" '\n' * { print_s "

\n"; main lexbuf } (* Font changes *) | "{\\it" " "* | "{\\itshape" " "* { print_s ""; save_state main lexbuf; print_s ""; main lexbuf } | "{\\em" " "* | "{\\sl" " "* | "{\\slshape" " "* { print_s ""; save_state main lexbuf; print_s ""; main lexbuf } | "{\\bf" " "* | "{\\sf" " "* | "{\\bfseries" " "* | "{\\sffamily" " "* { print_s ""; save_state main lexbuf; print_s ""; main lexbuf } | "{\\sc" " "* | "{\\scshape" " "* | "{\\normalfont" " "* | "{\\upshape" " "* | "{\\mdseries" " "* | "{\\rmfamily" " "* { save_state main lexbuf; main lexbuf } | "{\\tt" " "* | "{\\ttfamily" " "* { print_s ""; save_state main lexbuf; print_s ""; main lexbuf } | "{\\small" " "* { print_s ""; save_state main lexbuf; print_s ""; main lexbuf } | "{\\rm" " "* { print_s ""; save_state main lexbuf; print_s ""; main lexbuf } | "{\\cal" " "* { save_state main lexbuf; main lexbuf } | "\\cal" " "* { main lexbuf } (* Double quotes *) (*** | '"' { print_s ""; indoublequote lexbuf; print_s ""; main lexbuf } ***) (* Verb, verbatim *) | ("\\verb" | "\\path") _ { verb_delim := Lexing.lexeme_char lexbuf 5; print_s ""; inverb lexbuf; print_s ""; main lexbuf } | "\\begin{verbatim}" { print_s "

"; inverbatim lexbuf;
                  print_s "
"; main lexbuf } (* Raw html, latex only *) | "\\begin{rawhtml}" { rawhtml lexbuf; main lexbuf } | "\\begin{latexonly}" { latexonly lexbuf; main lexbuf } (* Itemize and similar environments *) | "\\item[" [^ ']']* "]" { print_s "
"; let s = Lexing.lexeme lexbuf in print_s (String.sub s 6 (String.length s - 7)); print_s "
"; main lexbuf } | "\\item" { print_s "
  • "; main lexbuf } (* Math mode (hmph) *) | "$" { math_mode := begin match !math_mode with | MathNone -> MathNoDisplay | MathNoDisplay -> MathNone | MathDisplay -> (* syntax error *) MathNone end; main lexbuf } | "$$" { math_mode := begin match !math_mode with | MathNone -> print_s "
    "; MathDisplay | MathNoDisplay -> MathNoDisplay | MathDisplay -> print_s "\n
    "; MathNone end; main lexbuf } (* \hkip *) | "\\hskip" space* dimension (space* "plus" space* dimension)? (space* "minus" space* dimension)? { print_s " "; main lexbuf } (* Special characters *) | "\\char" ['0'-'9']+ { let lxm = Lexing.lexeme lexbuf in let code = String.sub lxm 5 (String.length lxm - 5) in print_c(Char.chr(int_of_string code)); main lexbuf } | "<" { print_s "<"; main lexbuf } | ">" { print_s ">"; main lexbuf } | "~" { print_s " "; main lexbuf } | "``" { print_s "“"; main lexbuf } | "''" { print_s "”"; main lexbuf } | "--" { exec_macro ~main ~print_arg ~raw_arg ~skip_arg lexbuf "--"; main lexbuf } | "---" { exec_macro ~main ~print_arg ~raw_arg ~skip_arg lexbuf "---"; main lexbuf } | "^" { if is_math_mode() then begin let buf = Lexing.from_string (raw_arg lexbuf) in print_s ""; save_state main buf; print_s"" end else print_s "^"; main lexbuf } | "_" { if is_math_mode() then begin let buf = Lexing.from_string (raw_arg lexbuf) in print_s ""; save_state main buf; print_s"" end else print_s "_"; main lexbuf } (* URLs *) | "\\url" { let url = raw_arg lexbuf in if !hevea_url then let text = raw_arg lexbuf in print_hevea_url url text else print_latex_url url; main lexbuf } | "\\" " " { print_s " "; main lexbuf } (* General case for environments and commands *) | ("\\begin{" | "\\end{") ['A'-'Z' 'a'-'z' '@']+ "}" | "\\" (['A'-'Z' 'a'-'z' '@']+ '*'? " "? | [^ 'A'-'Z' 'a'-'z']) { let m = chop_last_space (Lexing.lexeme lexbuf) in exec_macro ~main ~print_arg ~raw_arg ~skip_arg lexbuf m; main lexbuf } (* Nesting of braces *) | '{' { incr brace_nesting; main lexbuf } | '}' { if !brace_nesting <= 0 then () else begin decr brace_nesting; main lexbuf end } (* Default rule for other characters *) | eof { () } | ['A'-'Z' 'a'-'z']+ { if is_math_mode() then print_s ""; print_s(Lexing.lexeme lexbuf); if is_math_mode() then print_s ""; main lexbuf } | _ { print_c(Lexing.lexeme_char lexbuf 0); main lexbuf } and indoublequote = parse '"' { () } | "<" { print_s "<"; indoublequote lexbuf } | ">" { print_s ">"; indoublequote lexbuf } | "&" { print_s "&"; indoublequote lexbuf } | "\\\"" { print_s "\""; indoublequote lexbuf } | "\\\\" { print_s "\\"; indoublequote lexbuf } | eof { () } | _ { print_c(Lexing.lexeme_char lexbuf 0); indoublequote lexbuf } and inverb = parse "<" { print_s "<"; inverb lexbuf } | ">" { print_s ">"; inverb lexbuf } | "&" { print_s "&"; inverb lexbuf } | eof { () } | _ { let c = Lexing.lexeme_char lexbuf 0 in if c == !verb_delim then () else (print_c c; inverb lexbuf) } and inverbatim = parse "<" { print_s "<"; inverbatim lexbuf } | ">" { print_s ">"; inverbatim lexbuf } | "&" { print_s "&"; inverbatim lexbuf } | "\\end{verbatim}" { () } | eof { () } | _ { print_c(Lexing.lexeme_char lexbuf 0); inverbatim lexbuf } and rawhtml = parse "\\end{rawhtml}" { () } | eof { () } | _ { print_c(Lexing.lexeme_char lexbuf 0); rawhtml lexbuf } and latexonly = parse "\\end{latexonly}" { () } | eof { () } | _ { latexonly lexbuf } and print_arg = parse "{" { save_nesting main lexbuf } | "[" { skip_optional_arg lexbuf; print_arg lexbuf } | " " { print_arg lexbuf } | eof { () } | _ { print_c(Lexing.lexeme_char lexbuf 0); main lexbuf } and skip_arg = parse "{" { incr brace_nesting; skip_arg lexbuf } | "}" { decr brace_nesting; if !brace_nesting > 0 then skip_arg lexbuf } | "[" { if !brace_nesting = 0 then skip_optional_arg lexbuf; skip_arg lexbuf } | " " { skip_arg lexbuf } | eof { () } | _ { if !brace_nesting > 0 then skip_arg lexbuf } and raw_arg = parse | " " | "\n" { raw_arg lexbuf } | '{' { nested_arg lexbuf } | "[" { skip_optional_arg lexbuf; raw_arg lexbuf } | '\\' ['A'-'Z' 'a'-'z']+ { Lexing.lexeme lexbuf } | eof { "" } | _ { Lexing.lexeme lexbuf } and nested_arg = parse '}' { "" } | '{' { let l = nested_arg lexbuf in "{" ^ l ^ "}" ^ (nested_arg lexbuf) } | eof { "" } | [^ '{' '}']+{ let x = Lexing.lexeme lexbuf in x ^ (nested_arg lexbuf) } and skip_optional_arg = parse "]" { () } | eof { () } | _ { skip_optional_arg lexbuf } (* ajout personnel: [read_macros] pour lire les macros (La)TeX *) and read_macros = parse | "\\def" ('\\' ['a'-'z' 'A'-'Z' '@']+ as s) ("#" (['0'-'9']+ as n))? { let b = raw_arg lexbuf in def_macro s n b; read_macros lexbuf } | "\\newcommand" space* "{" ("\\" ['a'-'z' 'A'-'Z']+ as s) "}" ("[" (['0'-'9']+ as n) "]")? { let b = raw_arg lexbuf in def_macro s n b; read_macros lexbuf } | "\\let" ('\\' ['a'-'z' 'A'-'Z' '@']+ as s) '=' { let b = raw_arg lexbuf in def_macro s None b; read_macros lexbuf } | eof { () } | _ { read_macros lexbuf } bibtex2html-1.99/main.ml0000644000246300004300000004746713255132746014541 0ustar filliatrvals(**************************************************************************) (* bibtex2html - A BibTeX to HTML translator *) (* Copyright (C) 1997-2014 Jean-Christophe Filliâtre and Claude Marché *) (* *) (* This software is free software; you can redistribute it and/or *) (* modify it under the terms of the GNU General Public *) (* License version 2, as published by the Free Software Foundation. *) (* *) (* This software is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *) (* *) (* See the GNU General Public License version 2 for more details *) (* (enclosed in the file GPL). *) (**************************************************************************) (*s Main module of bibtex2html. *) open Printf open Translate (* Options. *) let excluded = ref ([] : string list) let add_exclude k = excluded := k :: !excluded let style = ref "plain" let command = ref "bibtex -min-crossrefs=1000" type sort = Unsorted | By_date | By_author let sort = ref Unsorted let reverse_sort = ref false let ignore_bibtex_errors = ref false let expand_abbrev_in_bib_output = ref true (* Optional citation file. *) let use_cite_file = ref false let citations = ref ([] : string list) let add_citations file = try let chan = open_in file and buf = Buffer.create 1024 in try while true do Buffer.add_char buf (input_char chan) done with End_of_file -> close_in chan; citations := (Str.split (Str.regexp "[ \t\n]+") (Buffer.contents buf)) @ !citations with Sys_error msg -> prerr_endline ("Cannot open citation file (" ^ msg ^ ")"); exit 1 (*s Sorting the entries. *) module KeyMap = Map.Make(struct type t = string let compare = compare end) let keep_combine combine l1 l2 = let map = List.fold_left (fun m ((_,k,_) as e) -> KeyMap.add k e m) KeyMap.empty l2 in let rec keep_rec = function | [] -> [] | ((_,k,_) as x)::rem -> if not (List.mem k !excluded) then try let y = KeyMap.find k map in (combine x y) :: (keep_rec rem) with Not_found -> keep_rec rem else keep_rec rem in keep_rec l1 let combine_f (c,_,b) e = c,b,e let rev_combine_f x y = combine_f y x let sort_entries entries bibitems = if not !Options.quiet then begin eprintf "Sorting..."; flush stderr end; let el = if !sort = By_author then keep_combine combine_f bibitems entries else keep_combine rev_combine_f entries bibitems in let sl = if !sort = By_date then List.sort (fun (_,_,e1) (_,_,e2) -> Expand.date_compare entries e1 e2) el else el in if not !Options.quiet then begin eprintf "ok.\n"; flush stderr end; if !reverse_sort then List.rev sl else sl (* We use BibTeX itself to format the entries. Operations: \begin{enumerate} \item create an auxiliary file tmp.aux \item call bibtex on it \item read the resulting tmp.bbl file to get the formatted entries \end{enumerate} *) let create_aux_file fbib tmp = let ch = open_out (tmp ^ ".aux") in output_string ch "\\relax\n\\bibstyle{"; output_string ch !style; output_string ch "}\n"; if !use_cite_file then List.iter (fun k -> output_string ch ("\\citation{" ^ k ^ "}\n")) !citations else output_string ch "\\citation{*}\n"; output_string ch "\\bibdata{"; output_string ch (Filename.chop_suffix fbib ".bib"); output_string ch "}\n"; close_out ch let rm f = try Sys.remove f with _ -> () let clean tmp = if not !Options.debug then begin rm (tmp ^ ".aux"); rm (tmp ^ ".blg"); rm (tmp ^ ".bbl"); rm tmp end let call_bibtex tmp = if not !Options.quiet then begin eprintf "calling BibTeX..."; flush stderr end; match let redir = if !output_file = "" || !Options.quiet then match Sys.os_type with | "Win32" -> "> nul 2>&1" | _ -> "> /dev/null 2>&1" else "" in let cmd = sprintf "%s %s %s" !command tmp redir in if !Options.debug then begin eprintf "\nbibtex command: %s\n" cmd; flush stderr end; Sys.command cmd with | 0 -> if not !Options.quiet then begin eprintf "\n"; flush stderr end | n -> if !ignore_bibtex_errors then begin if not !Options.quiet then begin eprintf "error %d (ignored)\n" n; flush stderr end end else begin eprintf "error %d while running bibtex\n" n; exit n end let read_one_biblio lb = let rec read_items acc lb = try let (_,k,_) as item = Bbl_lexer.bibitem lb in if !Options.debug then begin eprintf "[%s]" k; flush stderr end; read_items (item::acc) lb with Bbl_lexer.End_of_biblio -> List.rev acc in let name = Bbl_lexer.biblio_header lb in let items = read_items [] lb in (name,items) let read_biblios lb = let rec read acc lb = try let b = read_one_biblio lb in read (b::acc) lb with End_of_file -> List.rev acc in read [] lb let read_bbl tmp = let fbbl = tmp ^ ".bbl" in if not !Options.quiet then begin eprintf "Reading %s..." fbbl; flush stderr end; let ch = open_in fbbl in let lexbuf = Lexing.from_channel ch in let biblios = read_biblios lexbuf in close_in ch; clean tmp; if not !Options.quiet then begin eprintf "ok "; List.iter (fun (_,items) -> eprintf "(%d entries)" (List.length items)) biblios; eprintf "\n"; flush stderr end; biblios (* temporary files in current directory (from OCaml's standard library) *) module Tmp = struct external open_desc: string -> open_flag list -> int -> int = "caml_sys_open" external close_desc: int -> unit = "caml_sys_close" let prng = Random.State.make_self_init () let temp_file prefix suffix = let rec try_name counter = let rnd = (Random.State.bits prng) land 0xFFFFFF in let name = Printf.sprintf "%s%06x%s" prefix rnd suffix in try close_desc (open_desc name [Open_wronly; Open_creat; Open_excl] 0o600); name with Sys_error _ as e -> if counter >= 1000 then raise e else try_name (counter + 1) in try_name 0 end let get_biblios fbib = let tmp = Tmp.temp_file "bib2html" "" in try create_aux_file fbib tmp; call_bibtex tmp; read_bbl tmp with e -> clean tmp; raise e (*i let insert_title_url bib = let rec remove_assoc x = function | [] -> raise Not_found | ((y,v) as p) :: l -> if x = y then (v,l) else let (v',l') = remove_assoc x l in (v', p :: l') in let url_value = function | [Bibtex.Id u] -> u | [Bibtex.String u] -> u | _ -> raise Not_found in let modify_entry f = try let t,f' = remove_assoc "title" f in let u,f'' = remove_assoc "url" f' in let u' = Html.normalize_url (url_value u) in let nt = (Bibtex.String (sprintf "\\begin{rawhtml}\\end{rawhtml}" u')) :: t @ [Bibtex.String "\\begin{rawhtml}\\end{rawhtml}"] in ("TITLE",nt) :: f'' with Not_found -> f in Bibtex.fold (fun com bib' -> match com with | Bibtex.Entry (ty,k,f) -> Bibtex.add_new_entry (Bibtex.Entry (ty,k,modify_entry f)) bib' | _ -> Bibtex.add_new_entry com bib') bib Bibtex.empty_biblio i*) let parse_only = ref false let print_keys = ref false let translate fullname = let input_bib = Readbib.read_entries_from_file fullname in if !parse_only then exit 0; let entries = List.rev (Expand.expand input_bib) in let biblios = if fullname = "" then begin let tmp = Tmp.temp_file "bibtex2htmlinput" ".bib" in let ch = open_out tmp in Biboutput.output_bib ~html:false ch input_bib None; close_out ch; let bbl = get_biblios tmp in Sys.remove tmp; bbl end else get_biblios fullname in let sb = List.map (fun (name,bibitems) -> (name,sort_entries entries bibitems)) biblios in if !print_keys then begin List.iter (fun (_,bibitems) -> List.iter (fun (_,_,(_,k,_)) -> printf "%s\n" k) bibitems) sb; flush stdout; exit 0 end; format_list (if !expand_abbrev_in_bib_output then Bibtex.expand_abbrevs input_bib else input_bib) sb (if !use_cite_file then let keys = List.fold_right (fun s e -> Bibtex.KeySet.add s e) !citations Bibtex.KeySet.empty in let keys = List.fold_right (fun s e -> Bibtex.KeySet.remove s e) !excluded keys in Some (Bibfilter.saturate input_bib keys) else None) (*s Reading macros in a file. *) let read_macros f = let chan = open_in f in let lb = Lexing.from_channel chan in Latexscan.read_macros lb; close_in chan (*s Command line parsing. *) let usage ?(error=true) () = if error then prerr_endline "bibtex2html: bad command line syntax"; (if error then prerr_endline else print_endline) " Usage: bibtex2html [filename] -s style BibTeX style (plain, alpha, ...) -c command BibTeX command (otherwise bibtex is searched in your path) -d sort by date -a sort as BibTeX (usually by author) -u unsorted i.e. same order as in .bib file (default) -r reverse the sort -revkeys entries numbered in reverse order -t title title of the HTML file (default is the filename) -bg color background color of the HTML file (default is none) -css file specify a style sheet file -o file redirect the output -header additional header in the HTML file -footer additional footer in the HTML file -i ignore BibTeX errors -both produce versions with and without abstracts -multiple produce one file per entry -single produce a single page (with BibTeX input and output) -nodoc only produces the body of the HTML documents -nokeys do not print the BibTeX keys -nolinks do not print any web link -nobiblinks do not add web links in the BibTeX output -rawurl print URL instead of file type -heveaurl use HeVeA's \\url macro -noabstract do not print the abstracts (if any) -nokeywords do not print the keywords (if any) -nodoi do not insert the DOI links -doi-prefix url set the DOI links prefix (default is http://dx.doi.org/) -noeprint do not insert the eprint links -eprint-prefix url set the eprint links prefix (default is http://arxiv.org/abs/) -linebreak add a linebreak between an entry and its links -use-table enforce the use of HTML tables (to be used after -nokeys) -noheader do not print the header (bibtex2html command) -nofooter do not print the footer (bibtex2html web link) -noexpand do not expand abbreviations in the BibTeX output -nobibsource do not produce the BibTeX entries file -fsuffix give an alternate suffix for HTML files -lsuffix give an alternate suffix for HTML links -suffix s give an alternate suffix for HTML files and links -citefile f read keys to include from file f -e key exclude an entry -m file read (La)TeX macros in file -f field add a web link for that BibTeX field -nf field name add a web link for that BibTeX field, with the supplied name -note field declare a note field -dl use DL lists instead of TABLEs -unicode use Unicode characters for some LaTeX macros (as HTML entities) -html-entities use HTML entities for some LaTeX macros -labelname use the label name when inserting a link --print-keys print the sorted bibtex keys and exit -debug verbose mode (to find incorrect BibTeX entries) -q quiet mode -w stop on warning -v print version and exit On-line documentation at http://www.lri.fr/~filliatr/bibtex2html/ "; exit (if error then 1 else 0) let parse () = let rec parse_rec = function (* General aspect of the web page *) | ("-t" | "-title" | "--title") :: s :: rem -> title := s; title_spec := true; parse_rec rem | ("-t" | "-title" | "--title") :: [] -> usage() | ("-bg" | "-background" | "--background") :: s :: rem -> Html.bgcolor := Some s; parse_rec rem | ("-bg" | "-background" | "--background") :: [] -> usage() | ("-css" | "-style-sheet" | "--style-sheet") :: f :: rem -> Html.css := Some f; parse_rec rem | ("-css" | "-style-sheet" | "--style-sheet") :: [] -> usage() | ("-header" | "--header") :: s :: rem -> user_header := s; parse_rec rem | ("-header" | "--header") :: [] -> usage() | ("-footer" | "--footer") :: s :: rem -> user_footer := s; parse_rec rem | ("-footer" | "--footer") :: [] -> usage() | ("-s" | "-style" | "--style") :: s :: rem -> style := s; parse_rec rem | ("-s" | "-style" | "--style") :: [] -> usage() | ("-noabstract" | "-no-abstract" | "--no-abstract") :: rem -> print_abstract := false; parse_rec rem | ("-nodoi" | "-no-doi" | "--no-doi") :: rem -> doi := false; parse_rec rem | ("-doi-prefix" | "--doi-prefix") :: s :: rem -> doi_prefix := s; parse_rec rem | ("-doi-prefix" | "--doi-prefix") :: [] -> usage () | ("-noeprint" | "-no-eprint" | "--no-eprint") :: rem -> eprint := false; parse_rec rem | ("-eprint-prefix" | "--eprint-prefix") :: s :: rem -> eprint_prefix := s; parse_rec rem | ("-eprint-prefix" | "--eprint-prefix") :: [] -> usage () | ("-nokeywords" | "-no-keywords" | "--no-keywords") :: rem -> print_keywords := false; parse_rec rem | ("-nolinks" | "-no-links" | "--no-links") :: rem -> print_links := false; parse_rec rem | ("-nobiblinks" | "-no-bib-links" | "--no-bib-links") :: rem -> links_in_bib_file := false; parse_rec rem | ("-nokeys" | "-no-keys" | "--no-keys") :: rem -> nokeys := true; table := NoTable; parse_rec rem | ("-use-table" | "--use-table") :: rem -> table := Table; parse_rec rem | ("-usekeys" | "-use-keys" | "--use-keys") :: rem -> use_keys := true; parse_rec rem | ("-rawurl" | "-raw-url" | "--raw-url") :: rem -> raw_url := true; parse_rec rem (*i | ("-tu" | "-titleurl" | "--title-url") :: rem -> title_url := true; parse_rec rem i*) | ("-heveaurl" | "-hevea-url" | "--hevea-url") :: rem -> Latexscan.hevea_url := true; parse_rec rem | ("-linebreak" | "--linebreak") :: rem -> linebreak := true; parse_rec rem | ("-noheader" | "-no-header" | "--no-header") :: rem -> print_header := false; parse_rec rem | ("-nofooter" | "-no-footer" | "--no-footer") :: rem -> print_footer := false; parse_rec rem | ("-f" | "-field" | "--field") :: s :: rem -> add_field s; parse_rec rem | ("-f" | "-field" | "--field") :: [] -> usage() | ("-nf" | "-named-field" | "--named-field") :: s :: name :: rem -> add_named_field s name; parse_rec rem | ("-nf" | "-named-field" | "--named-field") :: ([_] | []) -> usage() | ("-note" | "--note") :: s :: rem -> add_note_field s; parse_rec rem | ("-note" | "--note") :: [] -> usage() | ("-note-html" | "--note-html") :: s :: rem -> add_note_html_field s; parse_rec rem | ("-note-html" | "--note-html") :: [] -> usage() | ("-ln" | "-labelname" | "--labelname" | "--label-name") :: rem -> use_label_name := true; parse_rec rem | ("-multiple" | "--multiple") :: rem -> multiple := true; parse_rec rem | ("-single" | "--single") :: rem -> multiple := false; both := false; print_keywords := false; bib_entries := false; single := true; parse_rec rem | ("-both" | "--both") :: rem -> both := true; parse_rec rem | ("-dl" | "--dl") :: rem -> table := DL; parse_rec rem | ("-unicode" | "--unicode") :: rem -> Latexmacros.unicode_entities (); parse_rec rem | ("-html-entities" | "--html-entities") :: rem -> Latexscan.html_entities := true; Latexmacros.html_entities (); parse_rec rem (* Controlling the translation *) | ("-m" | "-macros-from" | "--macros-from") :: f :: rem -> read_macros f; parse_rec rem | ("-m" | "-macros-from" | "--macros-from") :: [] -> usage() (* Sorting the entries *) | ("-d" | "-sort-by-date" | "--sort-by-date") :: rem -> sort := By_date; parse_rec rem | ("-a" | "-sort-as-bibtex" | "--sort-as-bibtex") :: rem -> sort := By_author; parse_rec rem | ("-u" | "-unsorted" | "--unsorted") :: rem -> sort := Unsorted; parse_rec rem | ("-r" | "-reverse-sort" | "--reverse-sort") :: rem -> reverse_sort := not !reverse_sort; parse_rec rem | ("-revkeys" | "--revkeys") :: rem -> reverse_sort := not !reverse_sort; revkeys := true; parse_rec rem (* Options for selecting keys *) | ("-citefile" | "--citefile") :: f :: rem -> use_cite_file := true; add_citations f; parse_rec rem | ("-citefile" | "--citefile") :: [] -> usage() | ("-e" | "-exclude" | "--exclude") :: k :: rem -> add_exclude k; parse_rec rem | ("-e" | "-exclude" | "--exclude") :: [] -> usage() (* Miscellaneous options *) | ("-o" | "-output" | "--output") :: f :: rem -> output_file := f; parse_rec rem | ("-o" | "-output" | "--output") :: [] -> usage() | ("-nobibsource" | "--nobibsource") :: rem -> bib_entries := false; parse_rec rem | ("-nodoc" | "--nodoc" | "-no-doc" | "--no-doc") :: rem -> nodoc := true; parse_rec rem | ("-noexpand" | "-no-expand" | "--no-expand") :: rem -> expand_abbrev_in_bib_output := false; parse_rec rem | ("-i" | "-ignore-errors" | "--ignore-errors") :: rem -> ignore_bibtex_errors := true; parse_rec rem | ("-suffix" | "--suffix") :: s :: rem -> file_suffix := s; link_suffix := s; parse_rec rem | ("-fsuffix" | "-file-suffix" | "--file-suffix") :: s :: rem -> file_suffix := s; parse_rec rem | ("-lsuffix" | "-link-suffix" | "--link-suffix") :: s :: rem -> link_suffix := s; parse_rec rem | ("-suffix" | "--suffix" | "-fsuffix" | "--file-suffix" | "-file-suffix" | "-lsuffix" | "-link-suffix" | "--link-suffix") :: [] -> usage() | ("-c" | "-command" | "--command") :: s :: rem -> command := s; parse_rec rem | ("-c" | "-command" | "--command") :: [] -> usage() | ("-h" | "-help" | "-?" | "--help") :: rem -> usage ~error:false () | ("-v" | "-version" | "--version") :: _ -> Copying.banner "bibtex2html"; exit 0 | ("-warranty" | "--warranty") :: _ -> Copying.banner "bibtex2html"; Copying.copying(); exit 0 | ("-w" | "-warn-error" | "--warn-error") :: rem -> Options.warn_error := true; parse_rec rem | ("-q" | "-quiet" | "--quiet") :: rem -> Options.quiet := true; parse_rec rem | ("-debug" | "--debug") :: rem -> Options.debug := true; parse_rec rem | "-parse-only" :: rem -> parse_only := true; parse_rec rem | ("-print-keys" | "--print-keys") :: rem -> print_keys := true; parse_rec rem | [fbib] -> if not (Sys.file_exists fbib) then begin eprintf "%s: no such file\n" fbib; exit 1 end; let basename = Filename.basename fbib in if Filename.check_suffix basename ".bib" then (fbib, Filename.chop_suffix basename ".bib") else begin prerr_endline "bibtex2html: BibTeX file must have suffix .bib"; exit 1 end | [] -> ("","") | _ -> usage () in parse_rec (List.tl (Array.to_list Sys.argv)) (*s Main function. *) let main () = let (fbib,f) = parse () in Copying.banner "bibtex2html"; if fbib = "" then begin if not !title_spec then title := "bibtex2html output"; begin match !output_file with | "" -> bib_entries := false | "-" -> output_file := ""; bib_entries := false | _ -> () end end else begin input_file := f ^ ".bib"; begin match !output_file with | "" -> output_file := f; | "-" -> output_file := ""; bib_entries := false | _ -> () end; if not !title_spec then title := f end; Latexmacros.init_style_macros !style; (* producing the documents *) translate fbib let _ = Printexc.catch main () bibtex2html-1.99/options.ml0000644000246300004300000000240113255132746015263 0ustar filliatrvals(**************************************************************************) (* bibtex2html - A BibTeX to HTML translator *) (* Copyright (C) 1997-2014 Jean-Christophe Filliâtre and Claude Marché *) (* *) (* This software is free software; you can redistribute it and/or *) (* modify it under the terms of the GNU General Public *) (* License version 2, as published by the Free Software Foundation. *) (* *) (* This software is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *) (* *) (* See the GNU General Public License version 2 for more details *) (* (enclosed in the file GPL). *) (**************************************************************************) (*s Default is no debugging and verbose mode. *) let debug = ref false let quiet = ref false let warn_error = ref false bibtex2html-1.99/options.mli0000644000246300004300000000240013255132746015433 0ustar filliatrvals(**************************************************************************) (* bibtex2html - A BibTeX to HTML translator *) (* Copyright (C) 1997-2014 Jean-Christophe Filliâtre and Claude Marché *) (* *) (* This software is free software; you can redistribute it and/or *) (* modify it under the terms of the GNU General Public *) (* License version 2, as published by the Free Software Foundation. *) (* *) (* This software is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *) (* *) (* See the GNU General Public License version 2 for more details *) (* (enclosed in the file GPL). *) (**************************************************************************) (*s Common options to bib2bib and bibtex2html. *) val debug : bool ref val quiet : bool ref val warn_error : bool ref bibtex2html-1.99/parse_condition.ml0000644000246300004300000000240513255132746016754 0ustar filliatrvals(**************************************************************************) (* bibtex2html - A BibTeX to HTML translator *) (* Copyright (C) 1997-2014 Jean-Christophe Filliâtre and Claude Marché *) (* *) (* This software is free software; you can redistribute it and/or *) (* modify it under the terms of the GNU General Public *) (* License version 2, as published by the Free Software Foundation. *) (* *) (* This software is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *) (* *) (* See the GNU General Public License version 2 for more details *) (* (enclosed in the file GPL). *) (**************************************************************************) open Condition let condition s = let b = Lexing.from_string s in Condition_parser.condition_start Condition_lexer.token b bibtex2html-1.99/parse_condition.mli0000644000246300004300000000226513255132746017131 0ustar filliatrvals(**************************************************************************) (* bibtex2html - A BibTeX to HTML translator *) (* Copyright (C) 1997-2014 Jean-Christophe Filliâtre and Claude Marché *) (* *) (* This software is free software; you can redistribute it and/or *) (* modify it under the terms of the GNU General Public *) (* License version 2, as published by the Free Software Foundation. *) (* *) (* This software is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *) (* *) (* See the GNU General Public License version 2 for more details *) (* (enclosed in the file GPL). *) (**************************************************************************) val condition : string -> Condition.condition bibtex2html-1.99/readbib.ml0000644000246300004300000000372313255132746015170 0ustar filliatrvals(**************************************************************************) (* bibtex2html - A BibTeX to HTML translator *) (* Copyright (C) 1997-2014 Jean-Christophe Filliâtre and Claude Marché *) (* *) (* This software is free software; you can redistribute it and/or *) (* modify it under the terms of the GNU General Public *) (* License version 2, as published by the Free Software Foundation. *) (* *) (* This software is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *) (* *) (* See the GNU General Public License version 2 for more details *) (* (enclosed in the file GPL). *) (**************************************************************************) (*s [(read_entries_from_file f)] returns the BibTeX entries of the BibTeX file [f]. *) open Printf let read_entries_from_file f = if not !Options.quiet then begin if f = "" then eprintf "Reading from standard input...\n" else eprintf "Reading %s..." f; flush stderr end; let chan = if f = "" then stdin else open_in f in let lb = Lexing.from_channel chan in try let el = Bibtex_parser.command_list Bibtex_lexer.token lb in if f <> "" then close_in chan; if not !Options.quiet then begin eprintf "ok (%d entries).\n" (Bibtex.size el); flush stderr end; el with Parsing.Parse_error | Failure _ -> if f <> "" then close_in chan; eprintf "Parse error character %d, in or after entry '%s'.\n" (Lexing.lexeme_start lb) !Bibtex.current_key; flush stderr; exit 1 bibtex2html-1.99/readbib.mli0000644000246300004300000000247213255132746015341 0ustar filliatrvals(**************************************************************************) (* bibtex2html - A BibTeX to HTML translator *) (* Copyright (C) 1997-2014 Jean-Christophe Filliâtre and Claude Marché *) (* *) (* This software is free software; you can redistribute it and/or *) (* modify it under the terms of the GNU General Public *) (* License version 2, as published by the Free Software Foundation. *) (* *) (* This software is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *) (* *) (* See the GNU General Public License version 2 for more details *) (* (enclosed in the file GPL). *) (**************************************************************************) (*s [(read_entries_from_file f)] returns the BibTeX entries of the BibTeX file [f] (from standard input if [f=""]). *) val read_entries_from_file : string -> Bibtex.biblio bibtex2html-1.99/translate.ml0000644000246300004300000004016213255132746015573 0ustar filliatrvals(**************************************************************************) (* bibtex2html - A BibTeX to HTML translator *) (* Copyright (C) 1997-2014 Jean-Christophe Filliâtre and Claude Marché *) (* *) (* This software is free software; you can redistribute it and/or *) (* modify it under the terms of the GNU General Public *) (* License version 2, as published by the Free Software Foundation. *) (* *) (* This software is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *) (* *) (* See the GNU General Public License version 2 for more details *) (* (enclosed in the file GPL). *) (**************************************************************************) (*s Production of the HTML documents from the BibTeX bibliographies. *) open Printf (*s Options. *) let nodoc = ref false let nokeys = ref false let file_suffix = ref ".html" let link_suffix = ref ".html" let raw_url = ref false let title = ref "" let title_spec = ref false let print_abstract = ref true let print_keywords = ref true let print_links = ref true let print_header = ref true let print_footer = ref true let multiple = ref false let single = ref false let both = ref false let user_header = ref "" let user_footer = ref "" let bib_entries = ref true let links_in_bib_file = ref true let input_file = ref "" let output_file = ref "" let bibentries_file = ref "" let title_url = ref false let use_label_name = ref false let use_keys = ref false let linebreak = ref false type note_kind = NKlatex | NKhtml let note_fields = ref ([] : (string * note_kind) list) let abstract_name = ref "Abstract" let doi = ref true let doi_prefix = ref "http://dx.doi.org/" let eprint = ref true let eprint_prefix = ref "http://arxiv.org/abs/" let revkeys = ref false type table_kind = Table | DL | NoTable let table = ref Table (* internal name, plus optional external name *) type field_info = string * (string option) let default_fields = List.map (fun x -> x, None) ["ftp"; "http"; "url"; "dvi"; "ps"; "postscript"; "pdf"; "documenturl"; "urlps"; "urldvi"; "urlpdf"] let (fields : field_info list ref) = ref default_fields let add_field s = let u = String.lowercase_ascii s in Biboutput.add_link_field u; fields := (u, None) :: (List.remove_assoc u !fields) let add_named_field s name = let u = String.lowercase_ascii s in Biboutput.add_link_field u; if u = "abstract" then abstract_name := name; if not !both || u <> "abstract" then fields := (u, Some name) :: (List.remove_assoc u !fields) let add_note_field s = let u = String.lowercase_ascii s in note_fields := !note_fields @ [u, NKlatex] let add_note_html_field s = let u = String.lowercase_ascii s in note_fields := !note_fields @ [u, NKhtml] (* first pass to get the crossrefs *) let (cite_tab : (string,string) Hashtbl.t) = Hashtbl.create 17 let cpt = ref 0 let first_pass bl = let rec pass = function | [] -> () | (None,_,(_,k,_)) :: rem -> incr cpt; Hashtbl.add cite_tab k (string_of_int !cpt); pass rem | (Some c,_,(_,k,_)) :: rem -> Hashtbl.add cite_tab k c; pass rem in cpt := 0; Hashtbl.clear cite_tab; List.iter (fun (_,items) -> pass items) bl (* latex2html : to print LaTeX strings in HTML format *) let latex2html ch s = Latexmacros.out_channel := ch; Latexscan.brace_nesting := 0; Latexscan.main (Lexing.from_string s) open Latexmacros let in_summary = ref false let cite k = try let url = if !in_summary then sprintf "#%s" k else sprintf "%s%s#%s" !output_file !link_suffix k in let c = if !use_keys then k else Hashtbl.find cite_tab k in print_s (sprintf "[" url); latex2html !out_channel c; print_s "]" with Not_found -> print_s "[?]" let _ = def "\\cite" [ Raw_arg cite ] let safe_title e = try Expand.get_title e with Not_found -> "No title" (* header and footer of HTML files *) let own_address = "http://www.lri.fr/~filliatr/bibtex2html/" let header ch = let print_arg s = if String.contains s ' ' then fprintf ch "\"%s\" " s else fprintf ch "%s " s in fprintf ch " \n\n" let footer ch = Html.open_balise ch "hr"; Html.open_balise ch "p"; Html.open_balise ch "em"; output_string ch "This file was generated by\n"; Html.open_href ch own_address; output_string ch "bibtex2html"; Html.close_href ch; output_string ch " "; output_string ch Version.version; output_string ch "."; Html.close_balise ch "em"; Html.close_balise ch "p"; output_string ch "\n"; output_string ch !user_footer (* links (other than BibTeX entry, when available) *) let compression_suffixes = [ ".gz"; ".Z"; ".zip" ] let file_suffixes = List.flatten (List.map (fun s -> s :: List.map ((^) s) compression_suffixes) [ ".dvi"; ".DVI"; ".ps"; ".PS"; ".pdf"; ".PDF"; ".rtf"; ".RTF"; ".txt"; ".TXT"; ".html"; ".HTML" ]) let is_http s = String.length s > 3 && String.lowercase_ascii (String.sub s 0 4) = "http" let is_ftp s = String.length s > 2 && String.lowercase_ascii (String.sub s 0 3) = "ftp" let is_www s = String.length s > 3 && String.lowercase_ascii (String.sub s 0 4) = "www:" let is_url s = is_http s || is_ftp s || is_www s let file_type f = try List.find (Filename.check_suffix f) file_suffixes with Not_found -> if is_http f then "http" else if is_ftp f then "ftp" else "www:" let get_url s = if String.length s > 3 && String.lowercase_ascii (String.sub s 0 3) = "www" then String.sub s 4 (String.length s - 4) else s let link_name (u, name) url s = match name with | Some name -> name | None -> if !raw_url then url else if !use_label_name then String.capitalize_ascii (String.lowercase_ascii u) else s type link = { l_url : string; l_name : string } let display_links ch links = let rec display = function | [] -> output_string ch " ]\n" | l :: r -> Html.open_href ch l.l_url; output_string ch l.l_name; Html.close_href ch; if r <> [] then output_string ch " | \n"; display r in if !print_links && links <> [] then begin output_string ch "[ "; display links end exception Caught let rec map_succeed f = function | [] -> [] | x :: l -> try let y = f x in y :: map_succeed f l with Caught -> map_succeed f l let make_links ((t,k,_) as e) = (* URL's *) map_succeed (fun ((f, _) as info) -> try let u = Expand.get_lowercase_field e f in let s = file_type u in let url = get_url u in { l_url = url; l_name = link_name info url s } with Not_found -> raise Caught) !fields type abstract = | Alink of link | Atext of string | No_abstract let make_abstract ((t,k,_) as e) = try let a = Expand.get_lowercase_field e "abstract" in if is_url a then begin (* 1. it is an URL *) Alink { l_url = get_url a; l_name = !abstract_name } end else if !print_abstract then begin (* 2. we have to print it right here *) Atext a end else if !both then begin (* 3. we have to insert a link to the file f-abstracts *) let url = sprintf "%s_abstracts%s#%s" !output_file !link_suffix k in Alink { l_url = url; l_name = !abstract_name } end else No_abstract with Not_found -> No_abstract let blockquote ch f = (* JK Html.paragraph ch; output_string ch "\n"; *) Html.open_balise ch "blockquote"; let font_size = not !multiple && !Html.css = None in if font_size then Html.open_balise ch "font size=\"-1\""; output_string ch "\n"; f (); output_string ch "\n"; if font_size then Html.close_balise ch "font"; Html.close_balise ch "blockquote"; output_string ch "\n" let display_abstract ch a = blockquote ch (fun () -> latex2html ch a) let display_notes ch e = List.iter (fun (f, k) -> try let a = Expand.get_lowercase_field e f in match k with | NKlatex -> display_abstract ch a (* JK Html.paragraph ch *) | NKhtml -> output_string ch a with Not_found -> ()) !note_fields let display_keywords ch e = try let k = Expand.get_lowercase_field e "keywords" in blockquote ch (fun () -> output_string ch "Keywords: "; latex2html ch k) with Not_found -> () let doi_link e = if !doi then begin try let k = Expand.get_lowercase_field e "doi" in let url = if is_url k then k else !doi_prefix ^ k in [{ l_url = url; l_name = "DOI" }] with Not_found -> [] end else [] let eprint_link e = if !eprint then begin try let k = Expand.get_lowercase_field e "eprint" in [{ l_url = !eprint_prefix ^ k; l_name = "arXiv" }] with Not_found -> [] end else [] (* Printing of one entry *) let bibtex_entry k = { l_url = sprintf "%s%s#%s" !bibentries_file !link_suffix k; l_name = "bib" } let separate_file (b,((_,k,f) as e)) = in_summary := false; let file = k ^ !file_suffix in let ch = open_out file in if not !nodoc then begin let f = if !title_spec then !title else !output_file in let title = sprintf "%s : %s" f k in Html.open_document ch (fun () -> output_string ch title) end; if !print_header then header ch; Html.open_balise ch "h2"; latex2html ch b; Html.close_balise ch "h2"; if !print_header then output_string ch !user_header; (* JK Html.paragraph ch; *) let labs = match make_abstract e with | Atext a -> display_abstract ch a; [] | Alink l -> [l] | No_abstract -> [] in Html.paragraph ch; display_notes ch e; if !print_keywords then display_keywords ch e; display_links ch (labs @ (if !bib_entries then [bibtex_entry k] else []) @ doi_link e @ eprint_link e @ make_links e); (* JK Html.paragraph ch; *) Html.open_href ch (!output_file ^ !link_suffix); output_string ch "Back"; Html.close_href ch; if !print_footer then footer ch; if not !nodoc then Html.close_document ch; close_out ch; in_summary := true let open_table ch = match !table with | Table -> Html.open_balise ch "table" | DL -> Html.open_balise ch "dl" | NoTable -> () let close_table ch = match !table with | Table -> Html.close_balise ch "table" | DL -> Html.close_balise ch "dl" | NoTable -> () let open_row ch = match !table with | Table -> Html.open_balise ch "tr valign=\"top\""; output_string ch "\n"; Html.open_balise ch "td align=\"right\" class=\"bibtexnumber\""; output_string ch "\n" | DL -> Html.open_balise ch "dt"; output_string ch "\n" | NoTable -> Html.open_balise ch "p" let new_column ch = match !table with | Table -> Html.close_balise ch "td"; output_string ch "\n"; Html.open_balise ch "td class=\"bibtexitem\""; output_string ch "\n" | DL -> Html.close_balise ch "dt"; output_string ch "\n"; Html.open_balise ch "dd"; output_string ch "\n" | NoTable -> output_string ch "\n" let close_row ch = match !table with | Table -> Html.close_balise ch "td"; output_string ch "\n"; Html.close_balise ch "tr"; output_string ch "\n" | DL -> (* JK Html.paragraph ch; output_string ch "\n"; *) Html.close_balise ch "dd"; output_string ch "\n" | NoTable -> Html.close_balise ch "p" let one_entry_summary ch biblio (_,b,((_,k,f) as e)) = if !Options.debug then begin eprintf "[%s]" k; flush stderr end; output_string ch "\n\n"; open_row ch; (* JK changes *) if (not !nokeys) || !multiple then output_string ch "["; Html.open_anchor ch k; if (not !nokeys) || !multiple then begin if !multiple then Html.open_href ch (k ^ !link_suffix); latex2html ch (if !use_keys then k else Hashtbl.find cite_tab k); if !multiple then Html.close_href ch; end else if !table <> NoTable then output_string ch " "; Html.close_anchor ch; if (not !nokeys) || !multiple then output_string ch "]"; (* end of JK changes *) output_string ch "\n"; new_column ch; latex2html ch b; if !linebreak then Html.open_balise ch "br /"; output_string ch "\n"; if !multiple then separate_file (b,e) else if !single then begin let ks = Bibtex.KeySet.singleton k in let ks = Bibfilter.saturate biblio ks in Biboutput.output_bib ~html:true ch biblio (Some ks); end else begin let links = doi_link e @ eprint_link e @ make_links e in let links = if !bib_entries then bibtex_entry k :: links else links in match make_abstract e with | Atext a -> display_links ch links; display_abstract ch a (*; Html.paragraph ch*) | Alink l -> display_links ch (links @ [l]) | No_abstract -> display_links ch links end; display_notes ch e; if !print_keywords then display_keywords ch e; output_string ch "\n"; close_row ch (* summary file f.html *) let summary biblio bl = let (ch,filename) = if !output_file = "" then (stdout, "standard output") else let filename = !output_file ^ !file_suffix in (open_out filename, filename) in if not !Options.quiet then begin eprintf "Making HTML document (%s)..." filename; flush stderr end; if not !nodoc then Html.open_document ch (fun () -> output_string ch !title); if !print_header then header ch; if !title_spec then Html.h1_title ch !title; output_string ch "\n"; if !print_header then output_string ch !user_header; in_summary := true; List.iter (fun (name,el) -> begin match name with | None -> () | Some s -> Html.open_balise ch "h2"; latex2html ch s; Html.close_balise ch "h2"; output_string ch "\n" end; open_table ch; let el = if !revkeys then List.rev el else el in List.iter (one_entry_summary ch biblio) el; close_table ch) bl; in_summary := false; if !print_footer then footer ch; if not !nodoc then Html.close_document ch; close_out ch; if not !Options.quiet then begin eprintf "ok\n"; flush stderr end (* HTML file with BibTeX entries f_bib.html *) let print_list print sep l = let rec print_rec = function | [] -> () | [x] -> print x | x::r -> print x; sep(); print_rec r in print_rec l let bib_file bl keys = let fn = !bibentries_file ^ !file_suffix in if not !Options.quiet then begin eprintf "Making HTML list of BibTeX entries (%s)..." fn; flush stderr end; let ch = open_out fn in if not !nodoc then begin let t = if !title_spec then !title else !input_file in Html.open_document ch (fun _ -> output_string ch t) end; Html.open_balise ch "h1"; output_string ch !input_file; Html.close_balise ch "h1"; let output_bib = if !links_in_bib_file then let html_file = !output_file ^ !link_suffix in Biboutput.output_bib ~html:true ~html_file ch else Biboutput.output_bib ~html:true ch in output_bib bl keys; if !print_footer then footer ch; if not !nodoc then Html.close_document ch; flush ch; close_out ch; if not !Options.quiet then begin eprintf "ok\n"; flush stderr end (* main function *) let format_list biblio sorted_bl keys = first_pass sorted_bl; bibentries_file := !output_file ^ "_bib"; if !both then begin let old_print_keywords = !print_keywords in (* short version *) print_abstract := false; print_keywords := false; summary biblio sorted_bl; (* long version with abstracts and keywords *) print_abstract := true; print_keywords := old_print_keywords; let old_output = !output_file in output_file := !output_file ^ "_abstracts"; summary biblio sorted_bl; output_file := old_output end else summary biblio sorted_bl; (* BibTeX entries file *) if !bib_entries then bib_file biblio keys bibtex2html-1.99/translate.mli0000644000246300004300000000465013255132746015746 0ustar filliatrvals(**************************************************************************) (* bibtex2html - A BibTeX to HTML translator *) (* Copyright (C) 1997-2014 Jean-Christophe Filliâtre and Claude Marché *) (* *) (* This software is free software; you can redistribute it and/or *) (* modify it under the terms of the GNU General Public *) (* License version 2, as published by the Free Software Foundation. *) (* *) (* This software is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *) (* *) (* See the GNU General Public License version 2 for more details *) (* (enclosed in the file GPL). *) (**************************************************************************) (*s Production of the HTML documents from the BibTeX bibliographies. *) open Bibtex (*s Translation options. *) val nodoc : bool ref val nokeys : bool ref val use_keys : bool ref val file_suffix : string ref val link_suffix : string ref val raw_url : bool ref val title : string ref val title_spec : bool ref val print_abstract : bool ref val print_keywords : bool ref val print_links : bool ref val print_header : bool ref val print_footer : bool ref val multiple : bool ref val single : bool ref val both : bool ref val user_header : string ref val user_footer : string ref val bib_entries : bool ref val input_file : string ref val output_file : string ref val use_label_name : bool ref val linebreak : bool ref val doi : bool ref val doi_prefix : string ref val eprint : bool ref val eprint_prefix : string ref val links_in_bib_file : bool ref val revkeys : bool ref type table_kind = Table | DL | NoTable val table : table_kind ref (*s Inserting links for some BibTeX fields. *) val add_field : string -> unit val add_named_field : string -> string -> unit val add_note_field : string -> unit val add_note_html_field : string -> unit (*s Production of the HTML output. *) val format_list : biblio -> (string option * (string option * string * Expand.entry) list) list -> KeySet.t option -> unit bibtex2html-1.99/version.mli0000644000246300004300000000246113255132746015434 0ustar filliatrvals(**************************************************************************) (* bibtex2html - A BibTeX to HTML translator *) (* Copyright (C) 1997-2014 Jean-Christophe Filliâtre and Claude Marché *) (* *) (* This software is free software; you can redistribute it and/or *) (* modify it under the terms of the GNU General Public *) (* License version 2, as published by the Free Software Foundation. *) (* *) (* This software is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *) (* *) (* See the GNU General Public License version 2 for more details *) (* (enclosed in the file GPL). *) (**************************************************************************) (*s Version and compilation date of bibtex2html and bib2bib. The implementation is automatically generated at compilation. *) val version : string val date : string bibtex2html-1.99/aux2bib.in0000644000246300004300000000377313255132746015137 0ustar filliatrvals#!@PERL@ # auxtobib takes the name of a main .aux file (as generated by LaTeX) # as argument. It extracts all the citations contained in the aux # file, recursively descending into included aux files (as generated # by the LaTeX \include directive), and uses this list to extract a # BibTeX file containing only the cited references, including the # needed string abbreviations and crossreferences. The names of the # BibTeX files are taken from the main aux file, and are searched in # exactly the same way as done by bibtex. # # Needs bib2bib (see http://www.lri.fr/~filliatr/bibtex2html) # and kpsewhich (comes with the kpathsea library). # # Ralf Treinen . # Published under the Gnu General Public Licence, version 2. # process arguments if ( $#ARGV != 0 ) {&errorexit("Usage: aux2bib ");} $mainauxfile = $ARGV[0]; sub errorexit { print STDERR "aux2bib: @_[0]\n"; exit; } # process the aux files sub dofile { local($filename, $handle) = @_; $handle++; open($handle,$filename) || &errorexit("Cannot open file $filename"); while (<$handle>){ if (/\\\@input\{(.*)\}/) { &dofile($1,$handle); next; } if (/\\citation\{(.*)\}/) { foreach $subkey (split(/,/,$1)) { $keys{$subkey} = 0; } next; } if (/\\bibdata\{(.*)\}/) { @bibfiles = split(/,/,$1); } } close $handle; } &dofile($mainauxfile,'handle00'); # build the expression for the search condition $condfile="/tmp/aux2bib$$"; open(COND,"> $condfile") || &errorexit("Cannot open temp file $condfile"); foreach $key (keys %keys){ print COND "\$key=\"$key\" or "; } print COND "1=2\n"; close COND; # get the string of path names of the bib files $bibfilesbib = ""; foreach $bibfile (@bibfiles) { $bibfilesbib .= "$bibfile.bib " } $bibfilestring = ""; open(CMD,"kpsewhich $bibfilesbib|"); while (){ chop; $bibfilestring .= "$_ "; } close(CMD); # call bib2bib open(CMD,"bib2bib -c \"`cat $condfile`\" $bibfilestring|"); while (){print;} close(CMD); # cleanup unlink($condfile); bibtex2html-1.99/Makefile.in0000644000246300004300000002351313255132746015312 0ustar filliatrvals########################################################################## # bibtex2html - A BibTeX to HTML translator # # Copyright (C) 1997-2014 Jean-Christophe Filliâtre and Claude Marché # # # # This software is free software; you can redistribute it and/or # # modify it under the terms of the GNU General Public # # License version 2, as published by the Free Software Foundation. # # # # This software is distributed in the hope that it will be useful, # # but WITHOUT ANY WARRANTY; without even the implied warranty of # # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # # # # See the GNU General Public License version 2 for more details # # (enclosed in the file GPL). # ########################################################################## ######################################### # Configuration part ######################################### # where to put executable files prefix=@prefix@ exec_prefix=@exec_prefix@ BINDIR=@bindir@ EXE=@EXE@ # where to install the man pages MANDIR = @mandir@ # where to install the doc DOCDIR = $(prefix)/doc/bibtex2html # only used in target 'binary', only on Linux machines these days OSTYPE=linux ######################################### # End of configuration part ######################################### VERSION=1.99 OCAMLC = @OCAMLC@ OCAMLOPT = @OCAMLOPT@ CAMLDEP = @OCAMLDEP@ OCAMLLEX = @OCAMLLEX@ ZLIBS = DEBUG = FLAGS = $(ZLIBS) $(DEBUG) PROFILE = STRLIB = OBJS = options.cmx html.cmx latexmacros.cmx latexscan.cmx bbl_lexer.cmx \ bibtex.cmx bibtex_parser.cmx bibtex_lexer.cmx \ readbib.cmx expand.cmx bibfilter.cmx \ biboutput.cmx version.cmx translate.cmx \ copying.cmx main.cmx BIB2BIBOBJS = options.cmx bibtex.cmx bibtex_lexer.cmx \ bibtex_parser.cmx readbib.cmx \ latex_accents.cmx condition.cmx \ condition_parser.cmx condition_lexer.cmx parse_condition.cmx \ bibfilter.cmx latexmacros.cmx latexscan.cmx expand.cmx \ html.cmx biboutput.cmx version.cmx copying.cmx bib2bib.cmx all: @OCAMLBEST@ doc-@enable_doc@ opt: bibtex2html$(EXE) bib2bib$(EXE) byte: bibtex2html.byte bib2bib.byte .PHONY: bench bench: bibtex2html cd bench; sh bench test: bibtex2html bib2bib ./bib2bib$(EXE) test.bib ./bibtex2html$(EXE) test.bib @echo "test passed successfully" install-indep: mkdir -p $(BINDIR) cp aux2bib $(BINDIR)/aux2bib mkdir -p $(MANDIR)/man1 cp bibtex2html.1 $(MANDIR)/man1/bibtex2html.1 cp bibtex2html.1 $(MANDIR)/man1/bib2bib.1 cp aux2bib.1 $(MANDIR)/man1/aux2bib.1 install: install-indep if test @OCAMLBEST@ = opt ; then \ cp bibtex2html bib2bib $(BINDIR) ; \ else \ cp bibtex2html.byte $(BINDIR)/bibtex2html ; \ cp bib2bib.byte $(BINDIR)/bib2bib ; \ fi install-byte: install-indep cp bibtex2html.byte $(BINDIR)/bibtex2html cp bib2bib.byte $(BINDIR)/bib2bib win: bibtex2html$(EXE) bib2bib$(EXE) bibtex2html.nsi "/cygdrive/c/Program Files (x86)/NSIS/makensis" /DVERSION=$(VERSION) bibtex2html.nsi local: bibtex2html bib2bib cp bibtex2html bib2bib aux2bib $$HOME/bin/$(OSTYPE) cp *.1 $$HOME/man/man1 demons: bibtex2html bib2bib cp bibtex2html bib2bib aux2bib /users/demons/demons/bin/$(OSTYPE) cp *.1 $$HOME/man/man1 bibtex2html$(EXE): $(OBJS) $(OCAMLOPT) $(PROFILE) $(FLAGS) -o bibtex2html$(EXE) str.cmxa $(OBJS) $(STRLIB) strip bibtex2html$(EXE) bibtex2html.byte: $(OBJS:.cmx=.cmo) $(OCAMLC) $(PROFILE) $(FLAGS)-o bibtex2html.byte str.cma $(OBJS:.cmx=.cmo) $(STRLIB) bibtex2html.pbyte: $(OBJS:.cmx=.cmo) $(OCAMLC) -use-runtime ~demons/bin/$(OSTYPE)/ocamlcustomrun \ -o bibtex2html.pbyte str.cma $(OBJS:.cmx=.cmo) bibtex2html.static: $(OBJS) $(OCAMLOPT) $(PROFILE) $(FLAGS) -o $@ str.cmxa $(OBJS) $(STRLIB) -cclib "-L. -static" strip $@ SRC=$(OBJS:.cmx=.ml) bibtex2html.dfc: $(SRC) ocamldefun -d defun `ocamldefun-args $(SRC)` cd defun; $(OCAMLOPT) $(FLAGS) -o ../$@ str.cmxa $(SRC) bib2bib$(EXE): $(BIB2BIBOBJS) $(OCAMLOPT) $(PROFILE) $(FLAGS) -o bib2bib$(EXE) str.cmxa $(BIB2BIBOBJS) $(STRLIB) strip bib2bib$(EXE) bib2bib.byte: $(BIB2BIBOBJS:.cmx=.cmo) $(OCAMLC) $(PROFILE) $(FLAGS) -o bib2bib.byte str.cma $(BIB2BIBOBJS:.cmx=.cmo) $(STRLIB) bib2bib.pbyte: $(BIB2BIBOBJS:.cmx=.cmo) $(OCAMLC) -use-runtime ~demons/bin/$(OSTYPE)/ocamlcustomrun \ -o bib2bib.pbyte str.cma $(BIB2BIBOBJS:.cmx=.cmo) bib2bib.static: $(BIB2BIBOBJS) $(OCAMLOPT) $(PROFILE) $(FLAGS) -o $@ str.cmxa $(BIB2BIBOBJS) $(STRLIB) -cclib "-L. -static" strip $@ static: bibtex2html.static bib2bib.static cp bibtex2html.static $$HOME/bin/$(OSTYPE)/bibtex2html cp bib2bib.static $$HOME/bin/$(OSTYPE)/bib2bib bibtex_parser.mli bibtex_parser.ml: bibtex_parser.mly ocamlyacc bibtex_parser.mly condition_parser.mli condition_parser.ml: condition_parser.mly ocamlyacc condition_parser.mly ifdef SOURCE_DATE_EPOCH BUILD_DATE=$(shell date -u -d "@$(SOURCE_DATE_EPOCH)" 2>/dev/null || date -u -r "$(SOURCE_DATE_EPOCH)" 2>/dev/null || date) else BUILD_DATE=$(shell date) endif version.ml: Makefile echo "let version = \""$(VERSION)"\"" > $@ echo 'let date = "'"$(BUILD_DATE)"'"' >> $@ version.tex: Makefile printf "\\\newcommand{\\\version}{$(VERSION)}" > version.tex latexscan.ml: latexscan.mll $(OCAMLLEX) latexscan.mll bibtex_lexer.ml: bibtex_lexer.mll $(OCAMLLEX) bibtex_lexer.mll # file headers ############## headers: headache -c header_config.txt -h common_header.txt \ Makefile.in configure.in README \ *.ml *.ml[ily4] manual.tex \ bibtex2html.nsi # aux2bib.in ? # literate programming ###################### lp: bibtex2html.dvi WEBFILES=options.mli options.ml latexmacros.mli latexmacros.ml \ latexscan.mll bbl_lexer.mll \ bibtex.mli bibtex.ml bibtex_lexer.mll bibtex_parser.mly \ readbib.mli readbib.ml expand.mli expand.ml \ bibfilter.mli bibfilter.ml \ html.ml biboutput.mli biboutput.ml version.mli \ translate.mli translate.ml copying.mli copying.ml main.ml bibtex2html.tex: $(WEBFILES) ocamlweb -o $@ $(WEBFILES) .SUFFIXES: .tex .dvi .pdf .tex.dvi: latex $< && latex $< .tex.pdf: pdflatex $< && pdflatex $< # export ######## NAME=bibtex2html-$(VERSION) FTP = /users/demons/filliatr/ftp/ocaml/bibtex2html WWWSRC = /users/demons/filliatr/www/bibtex2html SOURCEFILES = *.ml* aux2bib.in Makefile.in configure.in configure .depend README COPYING GPL CHANGES manual.tex *.1 test.bib export: source export-doc linux echo "<#def version>$(VERSION)" > $(WWWSRC)/version.prehtml make -C $(WWWSRC) install mail -s "nouvelle release de bibtex2html" treinen@debian.org < /dev/null mail -s "new release of bibtex2html" guido.grazioli@gmail.com < /dev/null echo "*** prevenir Gerald Pfeifer ***" move-olds: cp $(FTP)/bibtex2html* $(FTP)/olds source: clean mkdir -p export/$(NAME) cp $(SOURCEFILES) export/$(NAME) (cd export ; tar cf $(NAME).tar $(NAME) ; \ gzip -f --best $(NAME).tar) if test -f $(FTP)/$(NAME).tar.gz && \ ! cmp -s export/$(NAME).tar.gz $(FTP)/$(NAME).tar.gz; then \ echo "IL FAUT CHANGER DE NUMÉRO DE VERSION"; exit 1; \ fi cp README COPYING GPL CHANGES export/$(NAME).tar.gz $(FTP) BINARY = bibtex2html-$(VERSION)-$(OSTYPE) linux: clean binary solaris: ssh sun-graphe make -C $(HOME)/soft/ocaml/bibtex clean binary sunos4: rmake ??? $(HOME)/soft/ocaml/bibtex clean binary BINARYFILES = README COPYING GPL bibtex2html bib2bib aux2bib \ bibtex2html.1 bib2bib.1 aux2bib.1 binary: bibtex2html bib2bib mkdir -p export/$(BINARY) cp $(BINARYFILES) export/$(BINARY) (cd export; tar czf $(BINARY).tar.gz $(BINARY)) cp export/$(BINARY).tar.gz $(FTP) AIX=bibtex2html-$(VERSION)-AIX aix: mkdir -p export/$(AIX) cp $(BINARYFILES) export/$(AIX) (cd export; tar cf $(AIX).tar $(AIX); gzip --best $(AIX).tar) # documentation ############### WWW=/users/demons/filliatr/WWW/bibtex2html doc-yes: doc doc-no: doc: manual.pdf manual.html install-doc: manual.pdf manual.html mkdir -p $(DOCDIR) cp -f manual.pdf $(DOCDIR) cp -f manual.html $(DOCDIR) export-doc: manual.pdf manual.html cp -f manual.pdf $(WWW)/doc cp -f manual.html $(WWW)/doc manual.pdf: version.tex manual.tex pdflatex manual.tex pdflatex manual.tex manual.html: version.tex manual.tex hevea -exec xxdate.exe -fix manual.tex # generic rules : ################# .SUFFIXES: .mli .ml .mll .cmi .cmo .cmx .mli.cmi: $(OCAMLC) -c $(FLAGS) $< .ml.cmo: $(OCAMLC) -c $(FLAGS) $< .ml.o: $(OCAMLOPT) -c $(FLAGS) $< .ml.cmx: $(OCAMLOPT) -c $(PROFILE) $(FLAGS) $< .mll.ml: $(OCAMLLEX) $< # Emacs tags ############ tags: find . -name "*.ml*" | sort -r | xargs \ etags "--regex=/let[ \t]+\([^ \t]+\)/\1/" \ "--regex=/let[ \t]+rec[ \t]+\([^ \t]+\)/\1/" \ "--regex=/and[ \t]+\([^ \t]+\)/\1/" \ "--regex=/type[ \t]+\([^ \t]+\)/\1/" \ "--regex=/exception[ \t]+\([^ \t]+\)/\1/" \ "--regex=/val[ \t]+\([^ \t]+\)/\1/" \ "--regex=/module[ \t]+\([^ \t]+\)/\1/" # myself Makefile: Makefile.in config.status ./config.status config.status: configure ./config.status --recheck configure: configure.in autoconf # clean and depend ################## GENERATED = bibtex_lexer.ml bbl_lexer.ml \ latexscan.ml latex_accents.ml condition_lexer.ml \ bibtex_parser.mli bibtex_parser.ml \ condition_parser.mli condition_parser.ml version.ml version.tex clean:: rm -f *~ *.cm[iox] *.o rm -f $(GENERATED) rm -f bibtex2html bib2bib rm -f manual.aux manual.log manual.dvi manual.pdf rm -f manual.toc manual.haux manual.html manual.htoc rm -f bibtex2html.static bib2bib.static rm -f bibtex2html.byte bib2bib.byte distclean:: clean rm -f Makefile aux2bib depend:: $(GENERATED) rm -f .depend ocamldep $(ZLIBS) *.mli *.ml > .depend include .depend bibtex2html-1.99/configure.in0000644000246300004300000001106513255132746015555 0ustar filliatrvals########################################################################## # bibtex2html - A BibTeX to HTML translator # # Copyright (C) 1997-2014 Jean-Christophe Filliâtre and Claude Marché # # # # This software is free software; you can redistribute it and/or # # modify it under the terms of the GNU General Public # # License version 2, as published by the Free Software Foundation. # # # # This software is distributed in the hope that it will be useful, # # but WITHOUT ANY WARRANTY; without even the implied warranty of # # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # # # # See the GNU General Public License version 2 for more details # # (enclosed in the file GPL). # ########################################################################## # bibtex2html autoconf input # check for one particular file of the sources AC_INIT(bibtex.mli) # options AC_ARG_ENABLE(doc, [ --enable-doc build the PDF documentation],, enable_doc=yes) # Check for Ocaml compilers # we first look for ocamlc in the path; if not present, we abort AC_CHECK_PROG(OCAMLC,ocamlc,ocamlc,no) if test "$OCAMLC" = no ; then AC_MSG_ERROR(Cannot find ocamlc.) fi # we extract Ocaml version number and library path OCAMLVERSION=`$OCAMLC -v | sed -n -e 's|.*version *\(.*\)$|\1|p' ` echo "ocaml version is $OCAMLVERSION" # IMPORTANT! do not use OCAMLLIB, because it is already set under Windows CAMLLIB=`ocamlc -where` echo "ocaml library path is $CAMLLIB" case $OCAMLVERSION in 0.*|1.*|2.*|3.*|4.00*|4.01*|4.02*) AC_MSG_ERROR(You need OCaml 4.03 or later);; esac # then we look for ocamlopt; if not present, we issue a warning # if the version is not the same, we also discard it # we set OCAMLBEST to "opt" or "byte", whether ocamlopt is available or not AC_CHECK_PROG(OCAMLOPT,ocamlopt,ocamlopt,no) OCAMLBEST=byte if test "$OCAMLOPT" = no ; then AC_MSG_WARN(Cannot find ocamlopt; bytecode compilation only.) else AC_MSG_CHECKING(ocamlopt version) TMPVERSION=`$OCAMLOPT -v | sed -n -e 's|.*version *\(.*\)$|\1|p' ` if test "$TMPVERSION" != "$OCAMLVERSION" ; then AC_MSG_RESULT(differs from ocamlc; ocamlopt discarded.) OCAMLOPT=no else AC_MSG_RESULT(ok) OCAMLBEST=opt fi fi # checking for ocamlc.opt AC_CHECK_PROG(OCAMLCDOTOPT,ocamlc.opt,ocamlc.opt,no) if test "$OCAMLCDOTOPT" != no ; then AC_MSG_CHECKING(ocamlc.opt version) TMPVERSION=`$OCAMLCDOTOPT -v | sed -n -e 's|.*version *\(.*\)$|\1|p' ` if test "$TMPVERSION" != "$OCAMLVERSION" ; then AC_MSG_RESULT(differs from ocamlc; ocamlc.opt discarded.) else AC_MSG_RESULT(ok) OCAMLC=$OCAMLCDOTOPT fi fi # checking for ocamlopt.opt if test "$OCAMLOPT" != no ; then AC_CHECK_PROG(OCAMLOPTDOTOPT,ocamlopt.opt,ocamlopt.opt,no) if test "$OCAMLOPTDOTOPT" != no ; then AC_MSG_CHECKING(ocamlc.opt version) TMPVER=`$OCAMLOPTDOTOPT -v | sed -n -e 's|.*version *\(.*\)$|\1|p' ` if test "$TMPVER" != "$OCAMLVERSION" ; then AC_MSG_RESULT(differs from ocamlc; ocamlopt.opt discarded.) else AC_MSG_RESULT(ok) OCAMLOPT=$OCAMLOPTDOTOPT fi fi fi AC_CHECK_PROG(OCAMLLEX,ocamllex,ocamllex,no) if test "$OCAMLLEX" = no ; then AC_MSG_ERROR(Cannot find ocamllex.) else AC_CHECK_PROG(OCAMLLEXDOTOPT,ocamllex.opt,ocamllex.opt,no) if test "$OCAMLLEXDOTOPT" != no ; then OCAMLLEX=$OCAMLLEXDOTOPT fi fi # ocamldep should also be present in the path AC_CHECK_PROG(OCAMLDEP,ocamldep,ocamldep,no) if test "$OCAMLC" = no ; then AC_MSG_ERROR(Cannot find ocamldep.) fi # where is perl AC_PATH_PROG(PERL,perl,/usr/bin/perl) # platform AC_MSG_CHECKING(platform) if echo "Sys.os_type;;" | ocaml | grep -q Win32; then AC_MSG_RESULT(win32) OCAMLWIN32=yes EXE=.exe else AC_MSG_RESULT(not win32) OCAMLWIN32=no EXE= fi if test "$enable_doc" = yes ; then AC_CHECK_PROG(PDFLATEX,pdflatex,pdflatex,no) if test "$PDFLATEX" = no ; then AC_MSG_WARN(Cannot find pdflatex; documentation disabled.) enable_doc=no fi fi # substitutions to perform AC_SUBST(OCAMLC) AC_SUBST(OCAMLOPT) AC_SUBST(OCAMLDEP) AC_SUBST(OCAMLLEX) AC_SUBST(OCAMLBEST) AC_SUBST(OCAMLVERSION) AC_SUBST(CAMLLIB) AC_SUBST(PERL) AC_SUBST(EXE) AC_SUBST(enable_doc) # Finally create all the generated files AC_OUTPUT(Makefile aux2bib) chmod a+x aux2bib chmod a-w Makefile bibtex2html-1.99/configure0000755000246300004300000030006513255132746015154 0ustar filliatrvals#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69. # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. # # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then _as_can_reexec=no; export _as_can_reexec; # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 as_fn_exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : else exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1" if (eval "$as_required") 2>/dev/null; then : as_have_required=yes else as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir/$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : CONFIG_SHELL=$as_shell as_have_required=yes if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : break 2 fi fi done;; esac as_found=false done $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : CONFIG_SHELL=$SHELL as_have_required=yes fi; } IFS=$as_save_IFS if test "x$CONFIG_SHELL" != x; then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi if test x$as_have_required = xno; then : $as_echo "$0: This script requires a shell more modern than all" $as_echo "$0: the shells that I found on your system." if test x${ZSH_VERSION+set} = xset ; then $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, $0: including any error possibly output before this $0: message. Then install a modern shell, or manually run $0: the script under such a shell if you do have one." fi exit 1 fi fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall # in an infinite loop. This has already happened in practice. _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME= PACKAGE_TARNAME= PACKAGE_VERSION= PACKAGE_STRING= PACKAGE_BUGREPORT= PACKAGE_URL= ac_unique_file="bibtex.mli" ac_subst_vars='LTLIBOBJS LIBOBJS enable_doc EXE CAMLLIB OCAMLVERSION OCAMLBEST PDFLATEX PERL OCAMLDEP OCAMLLEXDOTOPT OCAMLLEX OCAMLOPTDOTOPT OCAMLCDOTOPT OCAMLOPT OCAMLC target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir runstatedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking enable_doc ' ac_precious_vars='build_alias host_alias target_alias' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' runstatedir='${localstatedir}/run' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -runstatedir | --runstatedir | --runstatedi | --runstated \ | --runstate | --runstat | --runsta | --runst | --runs \ | --run | --ru | --r) ac_prev=runstatedir ;; -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ | --run=* | --ru=* | --r=*) runstatedir=$ac_optarg ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) as_fn_error $? "unrecognized option: \`$ac_option' Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir runstatedir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures this package to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF _ACEOF fi if test -n "$ac_init_help"; then cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-doc build the PDF documentation Report bugs to the package provider. _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF configure generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. $as_echo "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset ac_configure_args1;} # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo $as_echo "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo $as_echo "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then $as_echo "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then $as_echo "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && $as_echo "$as_me: caught signal $ac_signal" $as_echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h $as_echo "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_URL "$PACKAGE_URL" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then # We do not want a PATH search for config.site. case $CONFIG_SITE in #(( -*) ac_site_file1=./$CONFIG_SITE;; */*) ac_site_file1=$CONFIG_SITE;; *) ac_site_file1=./$CONFIG_SITE;; esac elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site else ac_site_file1=$ac_default_prefix/share/config.site ac_site_file2=$ac_default_prefix/etc/config.site fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5; } fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 $as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # options # Check whether --enable-doc was given. if test "${enable_doc+set}" = set; then : enableval=$enable_doc; else enable_doc=yes fi # Check for Ocaml compilers # we first look for ocamlc in the path; if not present, we abort # Extract the first word of "ocamlc", so it can be a program name with args. set dummy ocamlc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OCAMLC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OCAMLC"; then ac_cv_prog_OCAMLC="$OCAMLC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OCAMLC="ocamlc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_OCAMLC" && ac_cv_prog_OCAMLC="no" fi fi OCAMLC=$ac_cv_prog_OCAMLC if test -n "$OCAMLC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLC" >&5 $as_echo "$OCAMLC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "$OCAMLC" = no ; then as_fn_error $? "Cannot find ocamlc." "$LINENO" 5 fi # we extract Ocaml version number and library path OCAMLVERSION=`$OCAMLC -v | sed -n -e 's|.*version *\(.*\)$|\1|p' ` echo "ocaml version is $OCAMLVERSION" # IMPORTANT! do not use OCAMLLIB, because it is already set under Windows CAMLLIB=`ocamlc -where` echo "ocaml library path is $CAMLLIB" case $OCAMLVERSION in 0.*|1.*|2.*|3.*|4.00*|4.01*|4.02*) as_fn_error $? "You need OCaml 4.03 or later" "$LINENO" 5;; esac # then we look for ocamlopt; if not present, we issue a warning # if the version is not the same, we also discard it # we set OCAMLBEST to "opt" or "byte", whether ocamlopt is available or not # Extract the first word of "ocamlopt", so it can be a program name with args. set dummy ocamlopt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OCAMLOPT+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OCAMLOPT"; then ac_cv_prog_OCAMLOPT="$OCAMLOPT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OCAMLOPT="ocamlopt" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_OCAMLOPT" && ac_cv_prog_OCAMLOPT="no" fi fi OCAMLOPT=$ac_cv_prog_OCAMLOPT if test -n "$OCAMLOPT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLOPT" >&5 $as_echo "$OCAMLOPT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi OCAMLBEST=byte if test "$OCAMLOPT" = no ; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Cannot find ocamlopt; bytecode compilation only." >&5 $as_echo "$as_me: WARNING: Cannot find ocamlopt; bytecode compilation only." >&2;} else { $as_echo "$as_me:${as_lineno-$LINENO}: checking ocamlopt version" >&5 $as_echo_n "checking ocamlopt version... " >&6; } TMPVERSION=`$OCAMLOPT -v | sed -n -e 's|.*version *\(.*\)$|\1|p' ` if test "$TMPVERSION" != "$OCAMLVERSION" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: differs from ocamlc; ocamlopt discarded." >&5 $as_echo "differs from ocamlc; ocamlopt discarded." >&6; } OCAMLOPT=no else { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 $as_echo "ok" >&6; } OCAMLBEST=opt fi fi # checking for ocamlc.opt # Extract the first word of "ocamlc.opt", so it can be a program name with args. set dummy ocamlc.opt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OCAMLCDOTOPT+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OCAMLCDOTOPT"; then ac_cv_prog_OCAMLCDOTOPT="$OCAMLCDOTOPT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OCAMLCDOTOPT="ocamlc.opt" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_OCAMLCDOTOPT" && ac_cv_prog_OCAMLCDOTOPT="no" fi fi OCAMLCDOTOPT=$ac_cv_prog_OCAMLCDOTOPT if test -n "$OCAMLCDOTOPT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLCDOTOPT" >&5 $as_echo "$OCAMLCDOTOPT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "$OCAMLCDOTOPT" != no ; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking ocamlc.opt version" >&5 $as_echo_n "checking ocamlc.opt version... " >&6; } TMPVERSION=`$OCAMLCDOTOPT -v | sed -n -e 's|.*version *\(.*\)$|\1|p' ` if test "$TMPVERSION" != "$OCAMLVERSION" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: differs from ocamlc; ocamlc.opt discarded." >&5 $as_echo "differs from ocamlc; ocamlc.opt discarded." >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 $as_echo "ok" >&6; } OCAMLC=$OCAMLCDOTOPT fi fi # checking for ocamlopt.opt if test "$OCAMLOPT" != no ; then # Extract the first word of "ocamlopt.opt", so it can be a program name with args. set dummy ocamlopt.opt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OCAMLOPTDOTOPT+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OCAMLOPTDOTOPT"; then ac_cv_prog_OCAMLOPTDOTOPT="$OCAMLOPTDOTOPT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OCAMLOPTDOTOPT="ocamlopt.opt" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_OCAMLOPTDOTOPT" && ac_cv_prog_OCAMLOPTDOTOPT="no" fi fi OCAMLOPTDOTOPT=$ac_cv_prog_OCAMLOPTDOTOPT if test -n "$OCAMLOPTDOTOPT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLOPTDOTOPT" >&5 $as_echo "$OCAMLOPTDOTOPT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "$OCAMLOPTDOTOPT" != no ; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking ocamlc.opt version" >&5 $as_echo_n "checking ocamlc.opt version... " >&6; } TMPVER=`$OCAMLOPTDOTOPT -v | sed -n -e 's|.*version *\(.*\)$|\1|p' ` if test "$TMPVER" != "$OCAMLVERSION" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: differs from ocamlc; ocamlopt.opt discarded." >&5 $as_echo "differs from ocamlc; ocamlopt.opt discarded." >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 $as_echo "ok" >&6; } OCAMLOPT=$OCAMLOPTDOTOPT fi fi fi # Extract the first word of "ocamllex", so it can be a program name with args. set dummy ocamllex; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OCAMLLEX+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OCAMLLEX"; then ac_cv_prog_OCAMLLEX="$OCAMLLEX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OCAMLLEX="ocamllex" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_OCAMLLEX" && ac_cv_prog_OCAMLLEX="no" fi fi OCAMLLEX=$ac_cv_prog_OCAMLLEX if test -n "$OCAMLLEX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLLEX" >&5 $as_echo "$OCAMLLEX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "$OCAMLLEX" = no ; then as_fn_error $? "Cannot find ocamllex." "$LINENO" 5 else # Extract the first word of "ocamllex.opt", so it can be a program name with args. set dummy ocamllex.opt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OCAMLLEXDOTOPT+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OCAMLLEXDOTOPT"; then ac_cv_prog_OCAMLLEXDOTOPT="$OCAMLLEXDOTOPT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OCAMLLEXDOTOPT="ocamllex.opt" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_OCAMLLEXDOTOPT" && ac_cv_prog_OCAMLLEXDOTOPT="no" fi fi OCAMLLEXDOTOPT=$ac_cv_prog_OCAMLLEXDOTOPT if test -n "$OCAMLLEXDOTOPT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLLEXDOTOPT" >&5 $as_echo "$OCAMLLEXDOTOPT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "$OCAMLLEXDOTOPT" != no ; then OCAMLLEX=$OCAMLLEXDOTOPT fi fi # ocamldep should also be present in the path # Extract the first word of "ocamldep", so it can be a program name with args. set dummy ocamldep; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OCAMLDEP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OCAMLDEP"; then ac_cv_prog_OCAMLDEP="$OCAMLDEP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OCAMLDEP="ocamldep" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_OCAMLDEP" && ac_cv_prog_OCAMLDEP="no" fi fi OCAMLDEP=$ac_cv_prog_OCAMLDEP if test -n "$OCAMLDEP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLDEP" >&5 $as_echo "$OCAMLDEP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "$OCAMLC" = no ; then as_fn_error $? "Cannot find ocamldep." "$LINENO" 5 fi # where is perl # Extract the first word of "perl", so it can be a program name with args. set dummy perl; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_PERL+:} false; then : $as_echo_n "(cached) " >&6 else case $PERL in [\\/]* | ?:[\\/]*) ac_cv_path_PERL="$PERL" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_PERL="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_PERL" && ac_cv_path_PERL="/usr/bin/perl" ;; esac fi PERL=$ac_cv_path_PERL if test -n "$PERL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PERL" >&5 $as_echo "$PERL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # platform { $as_echo "$as_me:${as_lineno-$LINENO}: checking platform" >&5 $as_echo_n "checking platform... " >&6; } if echo "Sys.os_type;;" | ocaml | grep -q Win32; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: win32" >&5 $as_echo "win32" >&6; } OCAMLWIN32=yes EXE=.exe else { $as_echo "$as_me:${as_lineno-$LINENO}: result: not win32" >&5 $as_echo "not win32" >&6; } OCAMLWIN32=no EXE= fi if test "$enable_doc" = yes ; then # Extract the first word of "pdflatex", so it can be a program name with args. set dummy pdflatex; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_PDFLATEX+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$PDFLATEX"; then ac_cv_prog_PDFLATEX="$PDFLATEX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_PDFLATEX="pdflatex" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_PDFLATEX" && ac_cv_prog_PDFLATEX="no" fi fi PDFLATEX=$ac_cv_prog_PDFLATEX if test -n "$PDFLATEX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PDFLATEX" >&5 $as_echo "$PDFLATEX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "$PDFLATEX" = no ; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Cannot find pdflatex; documentation disabled." >&5 $as_echo "$as_me: WARNING: Cannot find pdflatex; documentation disabled." >&2;} enable_doc=no fi fi # substitutions to perform # Finally create all the generated files ac_config_files="$ac_config_files Makefile aux2bib" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else case $cache_file in #( */* | ?:*) mv -f confcache "$cache_file"$$ && mv -f "$cache_file"$$ "$cache_file" ;; #( *) mv -f confcache "$cache_file" ;; esac fi fi else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' # Transform confdefs.h into DEFS. # Protect against shell expansion while executing Makefile rules. # Protect against Makefile macro expansion. # # If the first sed substitution is executed (which looks for macros that # take arguments), then branch to the quote section. Otherwise, # look for a macro that doesn't take arguments. ac_script=' :mline /\\$/{ N s,\\\n,, b mline } t clear :clear s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g t quote s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g t quote b any :quote s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g s/\[/\\&/g s/\]/\\&/g s/\$/$$/g H :any ${ g s/^\n// s/\n/ /g p } ' DEFS=`sed -n "$ac_script" confdefs.h` ac_libobjs= ac_ltlibobjs= U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by $as_me, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE Configuration files: $config_files Report bugs to the package provider." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ config.status configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Copyright (C) 2012 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; --*=) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --he | --h | --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "aux2bib") CONFIG_FILES="$CONFIG_FILES aux2bib" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" eval set X " :F $CONFIG_FILES " shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$ac_tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" case $ac_file in -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi chmod a+x aux2bib chmod a-w Makefile bibtex2html-1.99/.depend0000644000246300004300000000640213255132746014503 0ustar filliatrvalsbbl_lexer.cmo : bbl_lexer.cmx : bib2bib.cmo : version.cmi readbib.cmi parse_condition.cmi options.cmi \ expand.cmi copying.cmi condition_lexer.cmi condition.cmi bibtex.cmi \ biboutput.cmi bibfilter.cmi bib2bib.cmx : version.cmx readbib.cmx parse_condition.cmx options.cmx \ expand.cmx copying.cmx condition_lexer.cmx condition.cmx bibtex.cmx \ biboutput.cmx bibfilter.cmx bibfilter.cmo : options.cmi bibtex.cmi bibfilter.cmi bibfilter.cmx : options.cmx bibtex.cmx bibfilter.cmi bibfilter.cmi : bibtex.cmi biboutput.cmo : options.cmi html.cmo bibtex.cmi biboutput.cmi biboutput.cmx : options.cmx html.cmx bibtex.cmx biboutput.cmi biboutput.cmi : bibtex.cmi bibtex.cmo : options.cmi bibtex.cmi bibtex.cmx : options.cmx bibtex.cmi bibtex.cmi : bibtex_lexer.cmo : bibtex_parser.cmi bibtex_lexer.cmx : bibtex_parser.cmx bibtex_parser.cmo : bibtex.cmi bibtex_parser.cmi bibtex_parser.cmx : bibtex.cmx bibtex_parser.cmi bibtex_parser.cmi : bibtex.cmi condition.cmo : options.cmi latex_accents.cmi bibtex.cmi condition.cmi condition.cmx : options.cmx latex_accents.cmx bibtex.cmx condition.cmi condition.cmi : bibtex.cmi condition_lexer.cmo : condition_parser.cmi condition_lexer.cmi condition_lexer.cmx : condition_parser.cmx condition_lexer.cmi condition_lexer.cmi : condition_parser.cmi condition_parser.cmo : latex_accents.cmi condition.cmi condition_parser.cmi condition_parser.cmx : latex_accents.cmx condition.cmx condition_parser.cmi condition_parser.cmi : condition.cmi copying.cmo : version.cmi options.cmi copying.cmi copying.cmx : version.cmx options.cmx copying.cmi copying.cmi : expand.cmo : options.cmi latexscan.cmo bibtex.cmi expand.cmi expand.cmx : options.cmx latexscan.cmx bibtex.cmx expand.cmi expand.cmi : bibtex.cmi html.cmo : html.cmx : latex_accents.cmo : latex_accents.cmi latex_accents.cmx : latex_accents.cmi latex_accents.cmi : latexmacros.cmo : options.cmi latexmacros.cmi latexmacros.cmx : options.cmx latexmacros.cmi latexmacros.cmi : latexscan.cmo : options.cmi latexmacros.cmi latexscan.cmx : options.cmx latexmacros.cmx main.cmo : translate.cmi readbib.cmi options.cmi latexscan.cmo \ latexmacros.cmi html.cmo expand.cmi copying.cmi bibtex.cmi biboutput.cmi \ bibfilter.cmi bbl_lexer.cmo main.cmx : translate.cmx readbib.cmx options.cmx latexscan.cmx \ latexmacros.cmx html.cmx expand.cmx copying.cmx bibtex.cmx biboutput.cmx \ bibfilter.cmx bbl_lexer.cmx options.cmo : options.cmi options.cmx : options.cmi options.cmi : parse_condition.cmo : condition_parser.cmi condition_lexer.cmi condition.cmi \ parse_condition.cmi parse_condition.cmx : condition_parser.cmx condition_lexer.cmx condition.cmx \ parse_condition.cmi parse_condition.cmi : condition.cmi readbib.cmo : options.cmi bibtex_parser.cmi bibtex_lexer.cmo bibtex.cmi \ readbib.cmi readbib.cmx : options.cmx bibtex_parser.cmx bibtex_lexer.cmx bibtex.cmx \ readbib.cmi readbib.cmi : bibtex.cmi translate.cmo : version.cmi options.cmi latexscan.cmo latexmacros.cmi \ html.cmo expand.cmi bibtex.cmi biboutput.cmi bibfilter.cmi translate.cmi translate.cmx : version.cmx options.cmx latexscan.cmx latexmacros.cmx \ html.cmx expand.cmx bibtex.cmx biboutput.cmx bibfilter.cmx translate.cmi translate.cmi : expand.cmi bibtex.cmi version.cmo : version.cmi version.cmx : version.cmi version.cmi : bibtex2html-1.99/README0000644000246300004300000000521213255132746014121 0ustar filliatrvals************************************************************************** * bibtex2html - A BibTeX to HTML translator * * Copyright (C) 1997-2014 Jean-Christophe Filliâtre and Claude Marché * * * * This software is free software; you can redistribute it and/or * * modify it under the terms of the GNU General Public * * License version 2, as published by the Free Software Foundation. * * * * This software is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * * * * See the GNU General Public License version 2 for more details * * (enclosed in the file GPL). * ************************************************************************** BibTeX2HTML is a collection of tools for producing automatically HTML documents from bibliographies written in the BibTeX format. It consists in three command line tools: - bib2bib is a filter tool that reads one or several bibliography files, filters the entries with respect to a given criterion, and outputs the list of selected keys together with a new bibliography file containing only the selected entries; - bibtex2html is a translator that reads a bibliography file and outputs two HTML documents that respectively the cited bibliography in a nice presentation, and the original BibTeX file augmented with several transparent HTML links to allow easy navigation. - aux2bib reads a .aux file as produced by LaTeX and writes to standard output a BibTeX file containing exactly the BibTeX entries refereed in the .aux file. COPYRIGHT ========= This program is distributed under the GNU GPL. See the enclosed file COPYING. INSTALLATION ============ You need Objective Caml >= 3.07 to compile the sources. 1. Create the configure script with `autoconf` 2. Configure with "./configure" 3. Compile with "make". It creates two binary files, "bibtex2html" and "bib2bib" . If you want to build the documentation, do "make doc" (You need both LaTeX and Hevea). 4. Install with "make install". You may need superuser permissions. (Note: you can also just copy the two executables in any directory of your choice) To install the doc, do "make install-doc". bibtex2html-1.99/COPYING0000644000246300004300000000104513255132746014274 0ustar filliatrvalsbibtex2html - BibTeX bibliography to HTML converter Copyright (C) 1997 Jean-Christophe FILLIATRE This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2, as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License version 2 for more details (enclosed in the file GPL). bibtex2html-1.99/GPL0000644000246300004300000004312713255132747013616 0ustar filliatrvals GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 19yy This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) 19yy name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. bibtex2html-1.99/CHANGES0000644000246300004300000004526113255132747014245 0ustar filliatrvals Version 1.99, March 23, 2018 ============================ * fixed unsafe use of strings; now requires OCaml >= 4.03 o removed many warnings o added translation of \rq o fixed scanning of macro arguments (with long BibTeX fields) o fixed translation of \@ (to print a space) Version 1.98, July 4, 2014 ========================== o fixed escaping of character & in URLs o fixed translation of -- and --- (contributed by Gabriel Scherer) o more macros: \dj \DJ (contributed by Domenico Bianculli) o \textsuperscript o temporary files are now created in the current directory to avoid bibtex error "Not writing to ... (openout_any = p)." o fixed a bug with non-ascii characters in php-output Version 1.97, February 6, 2012 ============================== o fixed compilation (no more -cclib -lstr) o fixed translation of \u{a}, removed incorrect translations of \u{n} and \u{N} (contributed by Domenico Bianculli) o bib2bib conditions: support for \u (contributed by Domenico Bianculli) o configure: option --disable-doc to avoid compiling the PDF documentation o configure: pdflatex is searched for; if not found, documentation is disabled Version 1.96, September 29, 2010 ================================ o PDF documentation (manual.pdf) is compiled by default o option -debug now prints the exact BibTeX commmand which is run o new option --note-html similar to --note but assuming a bibtex field already in HTML format o various little changes in the Makefile requested by the Debian maintainer Version 1.95, March 23, 2010 ============================ o bib2bib: option "--php-output" to produce output as a PHP 2D array o bib2bib: options "--remove" and "--rename", to remove or rename fields o new headers with proper copyright o bib2bib: option "--no-comment", to prevent generation of extra comments o fixed support for DOI links: when field "doi" is already an URL, the DOI prefix is not prepended o tags "bibtexnumber" and "bibtexitem" are now inserted to ease the customization using CSS Version 1.94, 07/05/09 ====================== o support for arXiv preprints links: a field "eprint = {xxx}" will be recognized, if any, and a link to http://arxiv.org/abs/ will be displayed; option -noeprint turns it off and option -eprintf-prefix sets a different prefix for the urls (contributed by Ari Stern) Version 1.93, 12/12/08 ====================== o bib2bib: giving '$date' as argument of option -s allows to sort from oldest to newest entry o bib2bib: field names in conditions may contain digits and '-' (useful for custom fields) Version 1.92, 08/07/08 ====================== o Windows installer (using NSIS nsis.sourceforge.net) o new bib2bib option --expand-xrefs to perform crossrefs expansion o option -m (reading macros from a file): - fixed macro definition with \def - macros with arguments are now supported o added accents conversion for tilda, and fixed accents conversion for \"i, \"\i and such (patch by Samuel Colin) o fixed bib2bib command line options to accept --warn-error and --quiet (as described in the manual) Version 1.91, 20/02/2008 ======================== o fixed bug in bib2bib and bibtex2html when quotes (") are used in fields o fixed bug with -nobibsource and -multiple (bib links on the separate pages) Version 1.90, 01/02/2008 ======================== o bib2bib: = and <> are now case insensitive; use == and != instead to perform case sensitive comparison o correctly support $x$$y$ where the central $$ is not passing into display math mode o more cases for accent macros \' \~ \. \u \v (patch by John Kewley) Version 1.89, 08/01/2008 ======================== o entry types and field names now typeset in lowercase in f_bib.html o new option -unicode to use Unicode entities for some macros (such as ◯ for \bigcirc, etc.) o new option -html-entities to use HTML entities for some macros such as \le, \approx, etc. (patch by Steven G. Johnson) o new option -header to insert a header (similar to -footer) (patch by Steven G. Johnson) Version 1.88, 20/11/2007 ======================== o new option -revkeys to number entries in reverse order (patch by Walter Guttmann) o fixed bug with '\ ' (backslash space) introduced in version 1.82 (shows up with -s gerplain) o \c{C}, \"y, \"Y (patch by John Kewley) o \k (using unicode entities, patch by John Kewley) Version 1.87, 16/07/2007 ======================== o \hat o \mathfrak (supported but no font change, as for \mathcal ad \mathbb) o \~a, \~A, \~o, and \~O o -- translated to – and --- to — Version 1.86, 21/03/2007 ======================== o more accents macros: \oe \OE \~ \v \' \r Version 1.85, 2/11/2006 ======================= o fixed HTML output in f_bib.html:
     no more enclosed in 

    ; bibtex fields now typeset in lowercase; added links back to f.html o macros \textin (), \textsu (), \textsi (), and macros \textln, \textos, \textdf, \textsw without translation o fixed bug in --quiet under Windows o option -t now sets the title of f_bib.html too (and of entries files when used with -multiple) Version 1.84, 19/10/2006 ======================== o improved support for MRNUMBER of AMS styles: only first word used in URL link Version 1.83, 13/09/2006 ======================== o support for DOI links: a field "DOI = {xxx}" will be recognized, if any, and a link to http://dx.doi.org/xxx will be displayed; option -no-doi turns it off and option -doi-prefix sets a different prefix for the DOI urls o macro \H (Hungarian umlauts) o new option -linebreak to insert a linebreak between an entry and its links o new option -use-table to enforce the use of a table (to be used _after_ -no-keys if needed) Version 1.82, 07/06/2006 ======================== o `` and '' translated to “ and ” o aesthetic changes: - no more line break between the entry and the links; - more space between an abstract and the next entry o improving date parsing: month field such as "2~" # dec is now parsed o fixed bug: a space after a macro is now discarded Version 1.81, 12/05/2006 ======================== o new option --print-keys to display the sorted keys (and exit) o improved date sorting to handle months such as mar # "\slash " # apr o no table anymore with -nokeys (only HTML paragraphs) Version 1.80, 15/3/2006 ======================= o remove leading ./ in front of relative URLs (was introduced a long time ago to circumvent an Internet Explorer bug; see below) o no more escaping of the character & in URLs Version 1.79, 22/2/2006 ======================= o fixed bug with ISO-latin characters in bib2bib conditions o fixed bug with implicit abbrevs (jan, feb, etc.) Version 1.78, 16/12/2005 Version 1.77, 18/11/2005 ======================== o fixed bug with unbalanced brackets in bib2bib/bibtex2html output Version 1.76, 22/9/2005 ======================= o translation of \'c o replaced ISO latin 1 characters with their entity codes o support for Czech characters (both contributed by Danny Chrastina) Version 1.75, 2/2/2005 ====================== o updated manual (the manual was not reflecting the change of f-bib into f_bib in version 1.74; see below) Version 1.74, 22/10/2004 ======================== o bib2bib: special characters \n \r \t and \ddd in regular expressions o fix minor bug: when looking for cross-references, comparison of keys is now case-insensitive o footer and bibtex entries now enclosed in HTML paragraphs (

    ...

    ) o in case of syntax error, the key of the entry where the error occurred is shown o new option -no-links to disable weblinks o fix bug in bib2bib: preamble now enclosed with a single pair of braces o bibtex entries now in f_bib.html (instead of f-bib.html) Version 1.72, 3/9/2004 ====================== o --help now prints on standard output and exits successfully o fixed bug with very long keys (when bibtex inserts % to cut lines) o arguments to macros read from a file (option -m) are discarded Version 1.71, 24/8/2004 ======================= o improved date sorting algorithm to handle days (e.g. month = "June 29") o bib2bib: crossrefs are expanded before conditions are checked o bib2bib: '_' allowed in field identifiers o added option -w (--warn-error) to stop immediately when a warning is issued. Version 1.70, 30/6/2004 ======================= o fixed bug with crossrefs not translated from LaTeX to HTML o macros for Greek letters now translated to HTML entities Version 1.69, 6/4/2004 ====================== o macros \bysame, \MR and \MRhref for AMS* stylew o modified -bib.html output to circumvent a Konqueror bug Version 1.68, 16/03/2004 ======================== o fixed bug with parentheses-enclosed entries o macros \relax, \hskip Version 1.66, 18/02/2004 ======================== o characters ( and ) in keys o New FAQ: pb with quotes under MS Windows Version 1.65, 3/10/2003 ======================== o better handling of accented letters, in particular LaTeX commands for accents are taken into account in regular expressions. o fixed bug: keywords were duplicated with -single o web links automatically inserted for -f and -nf fields in the .bib file o new option -use-keys to use the original keys from the .bib file o new option -single to put everything into a single page o HTML links inserted in the BibTeX entries page Version 1.61, 15/7/2003 ======================= o quoted & in URLS (&) o macro \href o bib2bib does not stop anymore when no matching citation is found, and in such a case an empty file is generated. Version 1.60, 19/6/2003 ======================= o new bib2bib option -s to sort the bibliography (and -r to reverse the sort) o macros \cal, \small Version 1.59, 16/6/2003 ======================= o LaTeX '~' translated into   o field "postscript" treated as "ps" o fixed links when -o used with a full path o fixed behavior with -nf abstract ... o macro \$ Version 1.57, 9/4/2003 ====================== o option --note f to declare field f as an annotation (and then displayed like an "abstract" field) Version 1.56 12/11/2002 ======================= o bib2bib: fixed bug in conditions lexer o fixed parser error in @preamble o ./configure updated Version 1.54 10/7/2002 ====================== o option --no-header to suppress bibtex2html command in the HTML output o HTML output: tags in lowercase, quoted attributes,
    ->
    o fixed bug in Makefile.in (man pages installation) Version 1.53 18/6/2002 ====================== o keywords displayed if a field "keywords" is present; option --no-keywords o aux2bib now handles multiple citations (\citation{foo,bar,gee}) (patch by Jose Ramon Alvarez Sanchez) Version 1.52 15/01/2002 ======================= o fixed bug in evaluation of <> operator in bib2bib conditions o fixed bugs in URLs display o new tool aux2bib by Ralf Treinen o removed when option -css is used o added macro \frac o added .txt and .html as recognized file extensions Version 1.51 15/10/2001 ======================= o fixed bug in links to not compressed documents; nicer names for links o fixed bug in --quiet o option -dl to format entries with
    instead of o spaces quoted in HTML comment giving the bibtex2html command o macro \path (treated like \verb) Version 1.5 10/10/2001 ====================== o less invasive links (to BibTeX entries and files) o option -css to specify a style sheet o macro \textcolor now translated (patch by François Pottier) o option -bg to set background color (patch by François Pottier) o fixed HTML errors (unclosed tags) Version 1.46 21/2/2001 ====================== o code documented with ocamlweb (but still poor comments) o fixed bug for links' names o fixed a minor HTML error (inversion of
    and ) Version 1.45 31/1/2001 ====================== o option -nf to specify how to display the link (patch by François Pottier) Version 1.44 11/1/2001 ====================== o bibtex2html: href bugfix for generation in output dir (Jan Nieuwenhuizen) o macros \lor and \land (translation of raw ASCII) o brackets { } are now ignored when comparing or matching strings in bib2bib conditions Version 1.41 30/6/2000 ====================== o configured by GNU autoconf o option -labelname to use the label name when inserting a link o fixed bug in option -t when bibtex file read on standard input o relative URL not prefixed with ./ when email addresses o macro \par translated to

    not
    o added symbols '&', '|', '!' and '?' resp. for synonyms of 'and', 'or', 'not' and 'exists' o replaced notations '$' and '#' resp. by '$key' and '$type' in bib2bib conditions o all macros \xxfamily, \xxseries and \xxshape o fixed bug in translating unbalanced quotes to HTML o bib2bib: predicate "exists" added in conditions to check existence of a field o bib2bib: new semantics for non-existent fields in conditions o bib2bib: added # in conditions to refer to the entry type o bib2bib: strings may now be written between single quotes o macros \mathsf, \mathtt, \mathnormal, \TeX, \LaTeXe o option -q, --quiet: do not write anything to stderr except errors Version 1.4, 19/6/2000 ====================== o fixed 2 bugs in bib2bib: it is now allowed to have the same key for an abbrev and for a regular entry. An abbrev that refer itself to other abbrevs is now correctly handled. o fixed bug: abbreviations were not correctly expansed in the -bib file o relative URL now prefixed by ./ (otherwise Internet Explorer can't resolve them correctly) o arguments to option -f are now turned into uppercase o added options -fsuffix / -lsuffix to specify different suffixes for HTML files and links (-suffix s is equivalent to -fsuffix s -lsuffix s) o fixed bug: entries were sorted in reverse order when no order specified o remove nested tags (incorrect HTML) o closed tags

    o added macro \html (raw HTML) o fixed bug with both -nodoc and -multiple Version 1.3, 2/6/2000 ===================== o sorting according to dates: bibtex2html no more fails on incorrect dates but issues a warning; if no date is present, the date of the crossref is used, if any. o macros: \LaTeX, \v, \tm, \sl o character / in keys o option --hevea-url to translate macro \url as HeVeA's instead of LaTeX's o bib2bib now takes care of repeated entries (See the manual) o \textsf now translated as \textbf (i.e. to bold face) o production of valid HTML (Thanks to John Kewley) Version 1.2, 1999/02/10 ======================= o manual.tex does not require hevea.sty anymore o fixed wrong link to bibtex entries in the page with abstracts o implementation: use of the ocaml module Buffer o fixed bug: authorize & in keys o bib2bib conditions now take LaTeX accents into account. For example \'e, \'{e} and é are all considered identical. Some accents still have to be considered. A new module Latex_accents has been added for that purpose. o much more LaTeX macros translated o macro \u (a romanian accent) recognized (but \u{s} simply outputs s) o option --raw-url to print URL instead of files's types. Version 1.1, 1999/11/05 ======================= o bibtex2html version is written at the end of the document and inside the HTML source o options --output and --nobibsource for bibtex2html o bibtex2html now reads on standard input if no input file is given, and writes on standard output (if no output file is specified). o new option of bib2bib: --expand expands the abbreviations o macro \neq -> <> o Readbib now outputs messages on standard error, not standard output o in bib2bib conditions, $ means the key of an entry o changed behaviour of bib2bib, in order to be used as a filter : . if no input files, input is taken from standard input . if no -ob option, output is done on standard output . if no -oc option, no citation file created at all o bib2bib now supports options --version and --warranty o macro \% -> % o macro \ss -> ß o authorize + in keys Version 1.0, 1999/07/15 ======================= o option --footer o condition are now arbitrary boolean expressions over comparaisons and matchings o macro \mathcal o bib2bib is able to parse conditions of the form field:regexp (but only one condition at a time) o the bib output : . is in the same order as the original one . option -noexpand produces an bib output still containing @STRINGs (but notice that crossrefs are never expanded) o the default bibtex command is "bibtex -min-crossrefs=1000" in order to avoid citation to the crossrefs. (This behaviour is obtained only when using a -citefile where the crossrefs are not included.) o macros with nested braces now recognized correctly o macros \textrm and \textsl o option -citefile to read keys to cite from a file o macros \sim, \symbol; macros for accents without argument (\~{}, \'{}, etc.) Version 0.95, 1999/06/02 ======================== o german macros when using a german BibTeX style o comma suppressed after last field in BibTeX entries file o macro \textit o comma after "BibTeX entry" suppressed when not needed Version 0.91, 1999/04/19 ======================== o bug fix in links to BibTeX entries in the page with abstracts o code optimization Version 0.9, 1999/02/12 ======================= o option -both to make both versions with and without abstracts o suffix .zip added for compressed files Version 0.8, 1999/02/08 ======================= o option -multiple (one file per entry) o bug fixed in syntax error line report o translation for macros \DH, \th o file types prefixed by "Compressed" when it is the case o file suffixes PDF and RTF recognized o abstracts printed in a smaller font () Version 0.72, 1999/01/21 ======================== o option -warranty to get the warranty conditions o translation of various LaTeX accents Version 0.71, 1999/01/11 ======================== o translation for macros \o, \O, \ae, \AE, \aa, \AA Version 0.7, 1998/11/18 ======================= o on-line documentation o option -f, --field o long names for all options o more math macros, better handling of {sub,sup}scripts o option -noabstract o option -nofooter Version 0.61, 1998/10/19 ======================== o option -nokeys Version 0.6, 1998/02/17 ======================= o spaces in URL are removed o compilation in native code Version 0.4, 1998/01/28 ======================= o multiple bibliographies o read macros in a file Version 0.3, 1997/11/06 ======================= o option -c to specify a command o quick sort of entries o macro \url is translated into a HTML link Version 0.2, 1997/10/24 ======================= o new presentation with only 2 files (F.html and F-bib.html) Version 0.1, 1997/07/17 ======================= o first public release Local Variables: mode: text End: bibtex2html-1.99/manual.tex0000644000246300004300000007661013255132747015253 0ustar filliatrvals%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % bibtex2html - A BibTeX to HTML translator % % Copyright (C) 1997-2014 Jean-Christophe Filliâtre and Claude Marché % % % % This software is free software; you can redistribute it and/or % % modify it under the terms of the GNU General Public % % License version 2, as published by the Free Software Foundation. % % % % This software is distributed in the hope that it will be useful, % % but WITHOUT ANY WARRANTY; without even the implied warranty of % % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. % % % % See the GNU General Public License version 2 for more details % % (enclosed in the file GPL). % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \documentclass[11pt,a4paper]{article} \usepackage[T1]{fontenc} \usepackage[latin1]{inputenc} \usepackage{fullpage} \usepackage{hyperref} %BEGIN LATEX \newcommand{\link}[2]{#2} %END LATEX %HEVEA\newcommand{\link}[2]{\ahref{#1}{#2}} \newcommand{\monurl}[1]{\link{#1}{#1}} \newcommand{\mm}{\symbol{45}\symbol{45}} \input{version.tex} \title{{\Huge\bfseries BibTeX2HTML} \\ A translator of BibTeX bibliographies into HTML\\ ~\\ Version \version{} --- \today} \author{Jean-Christophe Filli\^{a}tre and Claude March\'e \\ \normalsize\monurl{\url{http://www.lri.fr/~filliatr/bibtex2html}}} \date{} \begin{document} \sloppy \maketitle \tableofcontents \section{Introduction} BibTeX2HTML is a collection of tools for producing automatically HTML documents from bibliographies written in the BibTeX format. It consists in three command line tools: \begin{itemize} \item \texttt{bib2bib} is a filter tool that reads one or several bibliography files, filters the entries with respect to a given criterion, and outputs the list of selected keys together with a new bibliography file containing only the selected entries; \item \texttt{bibtex2html} is a translator that reads a bibliography file and outputs two HTML documents that contains respectively the cited bibliography in a nice presentation, and the original BibTeX file augmented with several transparent HTML links to allow easy navigation. \texttt{bibtex2html} can handle \emph{any} BibTeX style file, including those producing multiple bibliographies. \item \texttt{aux2bib} reads a \texttt{.aux} file as produced by \LaTeX\ and writes to standard output a BibTeX file containing exactly the BibTeX entries refereed in the \texttt{.aux} file. \end{itemize} \section{The \texttt{bibtex2html} command tool} bibtex2html is a BibTeX to HTML translator. It is invocated as \begin{flushleft} \texttt{bibtex2html} [options] [\textit{file.bib}] \end{flushleft} where the possible \link{\#options}{options} are described below and where \textit{file.bib} is the name of the BibTeX file, which must have a \textit{.bib} suffix. If this file is not given, then entries are input from standard input. Then two HTML documents are created (unless option \verb|-nobibsource| is selected or input is standard input, see below) : \begin{itemize} \item \textit{file.html} which is the bibliography in HTML format %HEVEA, like \link{examples/biblio-these.html}{this} ; \item \textit{file\_bib.html} which contains all the entries in ASCII format. %HEVEA ,like \link{examples/biblio-these_bib.html}{this} \end{itemize} \texttt{bibtex} is called on \textit{file.bib} in order to produce the a LaTeX document, and then this LaTeX document is translated into an HTML document. The BibTeX file \textit{file.bib} is also parsed in order to collect additional fields (abstract, url, ps, http, etc.) that will be used in the translation. If input is standard input and option \verb|--output| is not given, the first file is output to standard output, and the second is not created. %HEVEA\begin{rawhtml}\end{rawhtml} \subsection{Additional fields and automatic web links} The main interest of \texttt{bibtex2html} with respect to a traditional LaTeX to HTML translator is the use of additional fields in the BibTeX database and the automatic insertion of web links. A link is inserted: \begin{itemize} \item at each cross-reference inside the bibliography entries; \item when the \verb|\url| LaTeX macro is used in the text; \item for each BibTeX field whose name is "ftp", "http", "url", "ps" ,"dvi", "rtf", "pdf", "documenturl", "urlps" or "urldvi". The name of this link depends on the nature of the link: \begin{itemize} \item it is the file suffix, whenever this suffix is \texttt{.dvi}, \texttt{.ps}, \texttt{.pdf}, \texttt{.rtf}, \texttt{.txt} or \texttt{.html}, possibly followed by a compression sufix, \texttt{.gz}, \texttt{.Z} or \texttt{.zip}; \item otherwise the name of the link is either \texttt{http} or \texttt{ftp} depending on the protocol. \end{itemize} You can insert web link for other fields and/or specify alternative names for the links using the options \texttt{-f} and \texttt{-nf} (see below). \end{itemize} %HEVEA See the result on \link{examples/biblio-these.html}{this example}. \subsubsection{Abstracts} If a BibTeX entry contains a field \texttt{abstract} then its contents is quoted right after the bibliography entry %HEVEA , like \link{examples/publis-abstracts.html}{this} . This behavior may be suppressed with the option \texttt{\mm{}no-abstract}. If you want both versions with and without abstracts, use the option \texttt{\mm{}both}. In that case, links named "Abstract" will be inserted from the page without abstracts to the page with abstracts, %HEVEA like \link{examples/publis.html}{this}. \subsubsection{Keywords} If a BibTeX entry contains a field \texttt{keywords} then its contents is displayed after the bibliography entry (and after the abstract if any). This behavior may be suppressed with the option \texttt{\mm{}no-keywords}. %HEVEA\begin{rawhtml}\end{rawhtml} \subsection{Command line options} Most of the command line options have a short version of one character (e.g. \texttt{-r}) and an easy-to-remember/understand long version (e.g. \texttt{\mm{}reverse-sort}). \subsubsection{General aspect of the HTML document} \begin{description} \item[\texttt{-t} \textit{string}, \texttt{\mm{}title} \textit{string}] ~ specify the title of the HTML file (default is the file name). \item[\texttt{\mm{}header} \textit{string}] ~ give an additional header for the HTML document. \item[\texttt{\mm{}footer} \textit{string}] ~ give an additional footer for the HTML document. \item[\texttt{-s} \textit{string}, \texttt{\mm{}style} \textit{string}] ~ use BibTeX style \textit{string} (plain, alpha, etc.). Default style is plain. \item[\texttt{-noabstract}, \texttt{\mm{}no-abstract}] ~ do not print the abstracts (if any). \item[\texttt{-nokeywords}, \texttt{\mm{}no-keywords}] ~ do not print the keywords (if any). \item[\texttt{-both}, \texttt{\mm{}both}] ~ produce both pages with and without abstracts. If the BibTeX file is foo.bib then the two pages will be respectively foo.html and foo\_abstracts.html (The suffix may be different, see option \texttt{\mm{}suffix}). Links are inserted from the page without abstracts to the page with abstracts. \item[\texttt{-nokeys}, \texttt{\mm{}no-keys}] ~ do not print the cite keys. Note: this option implicitly suppresses the use of HTML tables to format the entries; to enforce the use of tables, use option \texttt{-use-table} (passing it \emph{after} option \texttt{-nokeys} on the command line). \item[\texttt{-use-keys}, \texttt{\mm{}use-keys}] ~ use the cite keys from the BibTeX input file (and not the ones generated by the BibTeX style file). \item[\texttt{-rawurl}, \texttt{\mm{}raw-url}] ~ print URLs instead of files' types. \item[\texttt{-heveaurl}, \texttt{\mm{}hevea-url}] ~ interpret the macro \verb!\url! as HeVeA's one, i.e. with two arguments, the first one being the url and the second one the text to print. The default behavior is to interpret the macro \verb!\url! as the one from the package \texttt{url}, which has only one argument (the url itself). \item[\texttt{-f} \textit{field}, \texttt{\mm{}field} \textit{field}] ~ add a web link for that BibTeX field. \item[\texttt{-nf} \textit{field} \textit{string}, \texttt{\mm{}named-field} \textit{field} \textit{string}] ~ similar to \texttt{-f} but specifies the way to display the link (e.g. \texttt{-nf springer "At Springer's"}). \item[\texttt{-note} \textit{field}, \texttt{\mm{}note} \textit{field}] ~ declare that a field must be treated like the \texttt{abstract} field, i.e. is an annotation to be displayed as a text paragraph below the entry. \item[\texttt{-multiple}, \texttt{\mm{}multiple}] ~ make a separate web page for each entry. \textit{Beware: this option produces as many HTML files as BibTeX entries!} \item[\texttt{-single}, \texttt{\mm{}single}] ~ produce a single document, inserting each BibTeX entry (the input) right after its BibTeX output \item[\texttt{-bg} \textit{color}, \texttt{\mm{}background} \textit{color}] ~ set the background color of the HTML file (default is none). \item[\texttt{-css} \textit{file}, \texttt{\mm{}style-sheet} \textit{file}] ~ set a style sheet file for the HTML document (default is none). \item[\texttt{-dl}, \texttt{\mm{}dl}] ~ use HTML \texttt{DL} lists instead of HTML tables to format entries. \item[\texttt{-unicode}, \texttt{\mm{}unicode}] ~ use Unicode entities for the following macros : \begin{verbatim} \models \curlyvee \curlywedge \bigcirc \varepsilon \not{\models} \end{verbatim} \item[\texttt{-html-entities}, \texttt{\mm{}html-entities}] ~ use HTML entities for the following macros : \begin{verbatim} \= \Im \Leftarrow \Re \Rightarrow \aleph \ang \angle \approx \ast \cdot \cdots \cong \copyright \cup \dagger \diamond \emptyset \equiv \exists \forall \ge \geq \in \infty \int \land \lang \lceil \le \leftarrow \leftrightarrow \leq \lfloor \longleftarrow \longrightarrow \lor \lozenge \nabla \ne \neg \neq \ni \notin \oplus \otimes \partial \perp \pm \prod \propto \rang \rceil \rfloor \rightarrow \sim \simeq \sqrt \subset \subseteq \sum \supset \supseteq \therefore \times \tm \to \vartheta \vee \wedge \wp \end{verbatim} \end{description} \subsubsection{Controlling the translation} \begin{description} \item[\texttt{-m} \textit{file}, \texttt{\mm{}macros-from} \textit{file}] ~ read the \LaTeX\ macros in the given file. Note: \texttt{bibtex2html} does not handle macros arguments; arguments are simply discarded. \item[\texttt{-noexpand} \texttt{\mm{}no-expand}] ~ do not expand the abbreviation strings, leave them in the output file. \end{description} \subsubsection{Selecting the entries} \begin{description} \item[\texttt{-citefile} \textit{filename}, \texttt{\mm{}citefile} \textit{filename}] ~ Select only keys appearing in \textit{filename}. To be used manually or in conjonction with \verb|bib2bib|. \item[\texttt{-e} \textit{key}, \texttt{\mm{}exclude} \textit{key}] ~ exclude an particular entry. \end{description} \subsubsection{Sorting the entries} \begin{description} \item[\texttt{-d}, \texttt{\mm{}sort-by-date}] ~ sort by date. \item[\texttt{-a}, \texttt{\mm{}sort-as-bibtex}] ~ sort as BibTeX (usually by author). \item[\texttt{-u}, \texttt{\mm{}unsorted}] ~ unsorted i.e. same order as in .bib file (default). \item[\texttt{-r}, \texttt{\mm{}reverse-sort}] ~ reverse the sort. \item[\texttt{\mm{}revkeys}] ~ number entries in reverse order (i.e. from $n$ to 1 in plain style). \end{description} \subsubsection{Miscellaneous options} \begin{description} \item[\texttt{-nodoc}, \texttt{\mm{}nodoc}] ~ do not produce a full HTML document but only its body (useful to merge the HTML bibliography in a bigger HTML document). \item[\texttt{-nobibsource}, \texttt{\mm{}nobibsource}] ~ do not produce the \verb|_bib.html| file. In that case, no ``BibTeX entry'' link are inserted in the HTML file. \item[\texttt{-suffix} \textit{string}, \texttt{\mm{}suffix} \textit{string}] ~ give an alternate suffix \textit{string} for both HTML files and links (default is \texttt{.html}). \item[\texttt{-fsuffix} \textit{string}, \texttt{\mm{}file-suffix} \textit{string}] ~ give an alternate suffix \textit{string} for HTML files (default is \texttt{.html}). \item[\texttt{-lsuffix} \textit{string}, \texttt{\mm{}link-suffix} \textit{string}] ~ give an alternate suffix \textit{string} for HTML links (default is \texttt{.html}). \item[\texttt{-o} \textit{file}, \texttt{\mm{}output} \textit{file}] ~ specifies the output file. If \textit{file} is \verb!-!, then the standard output is selected. \item[\texttt{-c} \textit{command}, \texttt{\mm{}command} \textit{command}] ~ specify the BibTeX command (default is \texttt{bibtex -min-crossrefs=1000}). May be useful for example if you need to specify the full path of the \texttt{bibtex} command. \item[\texttt{\mm{}print-keys}] ~ print the BibTeX entries on the standard output (one per line), as selected and sorted by \texttt{bibtex2html}. This is useful if you want to use the selection and sorting facilities of \texttt{bibtex2html} in another program. Note: you may need to set also the \texttt{-q} option (quiet) to suppress the usual output. \item[\texttt{-i}, \texttt{\mm{}ignore-errors}] ~ ignore BibTeX errors. \item[\texttt{-q}, \texttt{\mm{}quiet}] ~ be quiet. \item[\texttt{-w}, \texttt{\mm{}warn-error}] ~ stop at the first warning. \item[\texttt{-h}, \texttt{\mm{}help}] ~ print a short usage and exit. \item[\texttt{-v}, \texttt{\mm{}version}] ~ print the version and exit. \item[\texttt{-noheader}, \texttt{\mm{}no-header}] ~ do not insert the \texttt{bibtex2html} command in the HTML document (default is to insert it as a comment at the beginning). \end{description} \section{The \texttt{bib2bib} command line tool} \texttt{bib2bib} is a tool for extracting some entries from a list of bibliography files. It is invocated as \begin{flushleft} \texttt{bib2bib} [options] \textit{file1.bib} $\cdots$ \textit{filen.bib} \end{flushleft} where the possible options are described below and where \textit{file1.bib} $\cdots$ \textit{filen.bib} are the names of the BibTeX files, which must have a \textit{.bib} suffix. If no files at all are given on the command line, then input is taken from standard input. The options allow to specify a filter condition to test against each references read from bib files. The result will be a new BibTeX file containing all the entries of the input files that satisfy the condition. Notice that this output file contains all the necessary informations: each string and each cross-reference needed will be also in that file. Additionally, \textit{bib2bib} may output a file containing all the keys of entries that satisfy the condition. This second file is suitable for input as option \verb|-citefile| to \verb|bibtex2html|. \subsection{Command line options} \begin{description} \item[\texttt{-c} \textit{condition}] ~ specify a condition for selecting the entries. The output will retain only the entries that satisfy this condition. If several such condition are given, then only the entries that satisfy all the conditions are selected. The syntax of conditions is given below, notice that it is better to escape shell expansions in that conditions, in other words, you should write conditions between quotes. \item[\texttt{-ob} \textit{filename}] ~ specify the filename where the selected entries are output. If not given, it defaults to standard output. \item[\texttt{-oc} \textit{filename}] ~ specify the filename where the list of selected keys is output. If not given, this file is not created. Notice that the two output files above are suitable for use with bibtex2html. A typical use would be \begin{flushleft} \texttt{bib2bib -oc $citefile$ -ob $bibfile.bib$ -c $condition$ file1.bib file2.bib ... } \\ \texttt{bibtex2html -citefile $citefile$ bibfile.bib} \end{flushleft} which will produce exactly the HTML file for the selected references. \item[\texttt{\mm{}expand}] ~ expand all abbreviations in the output file. \item[\texttt{\mm{}expand-xrefs}] ~ expand all crossrefs in the output file. Notice that the meaning of such an expansion is not completely obvious: it's better to let bibtex (via bibtex2html) handle the cross-references itself, depending on the style considered. Notice that \texttt{bibtex2html} itself will expand the strings (by default, unless you specify the \verb|-noexpand| option) but not the cross-references. \item[\texttt{\mm{}no-comment}] ~ prevent generation of extra comments at beginning of output bib file. \item[\texttt{\mm{}remove} \textit{f}] ~ remove all occurrences of field \textit{f}. This option can be used several times to remove several fields. \item[\texttt{\mm{}rename} \textit{f1} \textit{f2}] ~ rename all occurrences of field \textit{f1} into \texttt{f2}. This option can be used several times to rename several fields. Beware that if an entry already has both fields \texttt{f1} and \texttt{f2}, this will result in two fields \textit{f2}, and BibTeX styles usually take only the first occurrence into account. Example: \begin{flushleft} \texttt{bib2bib \mm{}remove abstract \mm{}remove copyright \mm{}rename x-pdf url $bibfile.bib$} \end{flushleft} removes all \texttt{abstract} and \texttt{copyright} fields and rename all \texttt{x-pdf} fields into name \texttt{url}. \item[\texttt{-s} \textit{f}] ~ sorts the entries of the bibliography with respect to the given field \textit{f}, which may also be \texttt{\$key} or \texttt{\$type} to refer to the key or to the entry type, as for filter conditions. It may also be \texttt{\$date}, to ask for sorting from oldest to newest, as for option \texttt{-d} of bibtex2html. This option may be used several times to specify a lexicographic order, such as by author, then by type, then by date: \begin{flushleft} \texttt{bib2bib -s 'author' -s '\$type' -s '\$date' $bibfile.bib$} \end{flushleft} When sorting, the resulting bibliography will always contains the comments first, then the preambles, then the abbreviations, and finally the regular entries. Be warned that such a sort may put cross-references before entries that refer to them, so be cautious. \item[\texttt{-r}] ~ reverses the sort order. \item[\texttt{-q}, \texttt{\mm{}quiet}] ~ be quiet. \item[\texttt{-w}, \texttt{\mm{}warn-error}] ~ stop at the first warning. \item[\texttt{\mm{}php-output} \textit{file}] ~ outputs the bib file as a two-dimensional array in PHP syntax, in \textit{file}. \end{description} \subsection{Filter conditions} \label{sec:conditions} A filter condition is a boolean expression that is evaluated against a BibTeX entry to decide whether this entry should be selected. A condition is either: \begin{itemize} \item a \emph{comparison} between two \emph{expressions}, written as $e_1~op~e_2$ ; \item a matching of a field name with respect to a \emph{regular expression}, written as $field : regexp$ ; \item a conjunction of two conditions, written as $c_1 \verb| and | c_2$ (or $c_1 \verb| & | c_2$) ; \item a disjunction of two conditions, written as $c_1 \verb| or | c_2$ (or $c_1 \verb+ | + c_2$); \item a negation of a condition, written as $\verb|not | c$ (or $\verb|! | c$) ; \item a test of existence of a field, written as $\verb|exists | f$ (or $\verb|? | f$) where $f$ is a field name ; \end{itemize} where an expression is either: \begin{itemize} \item a string constant, written either between double quotes or single quotes ; \item an integer constant ; \item a field name ; \item the special ident \verb|$key| which corresponds to the key of an entry. \item the special ident \verb|$type| which corresponds to the type of an entry (ARTICLE, INPROCEEDINGS, etc.). Notice that an entry type is always written in uppercase letters. \end{itemize} Comparison operators are the usual ones: \texttt{=}, \texttt{<}, \texttt{>}, \texttt{<=}, \texttt{>=} and \texttt{<>}. The field names are any sequences of lowercase or uppercase letters (but no distinction is made between lowercase and uppercase letters). Be careful when writing conditions in a shell command: the shell must not interpret anything in a condition, such as \verb|$key|. So usually you need to put conditions inside quote characters that forbid shell interpretation: single quotes under Unix shell, or double quotes under Microsoft Windows shell. This is why strings in conditions may be put indifferently between single or double quotes: you will use the ones which are not the ones you use to forbid shell interpretation. In examples below, we will use Unix convention, so under Windows you have to permute the use of single and double quotes. Note that within \texttt{Makefile}s you have to escape the \verb|$| character in \verb|$key| or \verb|$type| (using \verb|$$key| and \verb|$$type| instead, at least with GNU make). Regular expressions must be put between single or double quotes, and must follow the GNU syntax of regular expressions, as for example in GNU Emacs. Any character other than \verb|$^.*+?[]| matches itself, see Table~\ref{table:regexp} for the meaning of the special characters. \begin{table}[t] \begin{center} \begin{tabular}{|l|p{100mm}|} \hline \verb|.| & matches any character except newline \\\hline \verb|[..]| & character set; ranges are denoted with \verb|-|, as in \verb|[a-z]|; an initial \verb|^|, as in \verb|[^0-9]|, complements the set \\\hline \verb|^| & matches the beginning of the string matched \\\hline \verb|$| & matches the end of the string matched \\\hline \verb|\r| & matches a carriage return \\\hline \verb|\n| & matches a linefeed \\\hline \verb|\t| & matches a tabulation \\\hline \verb|\b| & matches word boundaries \\\hline \verb|\|\textsl{ddd} & matches character with ASCII code \textsl{ddd} in decimal \\\hline \verb|\|\textsl{char} & quotes special character \textsl{char} among \verb#$^.*+?[]\# \\\hline \textsl{regexp}\verb|*| & matches \textsl{regexp} zero, one or several times \\\hline \textsl{regexp}\verb|+| & matches \textsl{regexp} one or several times \\\hline \textsl{regexp}\verb|?| & matches \textsl{regexp} once or not at all \\\hline \textsl{regexp1} \verb+\|+ \textsl{regexp2} & alternative between two regular expressions, this operator has low priority against \verb|*|, \verb|+| and \verb|?| \\\hline \verb|\(| \textsl{regexp} \verb|\)| & grouping regular expression \\\hline \end{tabular} \end{center} \caption{Syntax of regular expressions} \label{table:regexp} \end{table} Notice that if several conditions are given with option \verb|-c| on the command line, then they are understood as the conjunction of them, in other words \begin{flushleft} \texttt{bib2bib -c '$c_1$' $\cdots$ -c '$c_n$'} \end{flushleft} is equivalent to \begin{flushleft} \texttt{bib2bib -c '$c_1$ and $\cdots$ and $c_n$'} \end{flushleft} Table~\ref{table:syntax} shows a formal grammar for conditions. \begin{table}[t] \begin{eqnarray*} Cond & \rightarrow & Cond \verb| and | Cond \mid Cond \verb| or | Cond \mid \verb|not | Cond \mid \verb|exists | Id \\ Cond & \rightarrow & Cond \verb| & | Cond \mid Cond \verb+ | + Cond \mid \verb|! | Cond \mid \verb|? | Id\\ && \mid Expr ~ Comp ~ Expr \mid Expr \verb|:| String \mid \verb|( | Cond \verb| )|\\ Comp & \rightarrow & \verb|=| \mid \verb|>| \mid \verb|<| \mid \verb|>=| \mid \verb|<=| \mid \verb|<>| \\ Expr & \rightarrow & Id \mid String \mid Int \mid \verb|$key| \mid \verb|$type| \\ Id & \rightarrow & [\verb|a|-\verb|z|\verb|A|-\verb|Z|]^+ \\ String & \rightarrow & \verb|"| ([\verb|^"\|] \mid \verb|\"| \mid \verb|\\| )^* \verb|"| \mid \verb|'| ([\verb|^'\|] \mid \verb|\'| \mid \verb|\\| )^* \verb|'| \\ Integer & \rightarrow & [\verb|0|-\verb|9|]^+ \end{eqnarray*} \caption{Syntax of conditions} \label{table:syntax} \end{table} \subsubsection*{Remarks on evaluation of conditions} \begin{itemize} \item According to BibTeX conventions, entry types, keys and field names have to be considered case insensitive, that is no distinction is made between uppercase and lowercase letters. Inside \verb|bib2bib|, these are always converted to uppercase, so you may take this into account when writting conditions (see below). \item On the other hand, case matters when comparing strings, or matching them against regular expressions. For example, \verb|title : "Computer"| may return \verb|true| if the title contains the word \verb|Computer| with a capital letter, whereas \verb|title : "computer"| would return \verb|false|. \item A consequence of the two previous remarks, is that if you want for example to check equality of the entry type and a string value, put the value in uppercase, as for example \verb|$type = "INPROCEEDINGS"|, otherwise the condition would be always false. \item When performing a comparison with an non-existent field, the result is always false ; beware that this means that for example \verb|not (f = "value")| and \verb|f <> "value"| are not equivalent: for an entry that does not have a field \verb|f|, the first condition is true whereas the second is false. \item As usual, \verb|not| has higher priority than \verb|and|, which itself has higher priority than \verb|or|. \verb|and| and \verb|or| associate to the left. \item Comparison using \verb|>|, \verb|<|, \verb|>=| and \verb|<=| may only be used between integer values. In any other case, a warning is displayed and the result is false. \item There is a special handling for strings containing LaTeX accented letters (or for backward compatibility, ISO-Latin1 accented characters): each variant of writing such letters are considered the same, and equivalent to their HTML entity form, for example strings \verb|"Filli\^atre"|, \verb|"Filli{\^a}tre"|, \verb|"Filli\^{a}tre"| and \verb|"Filliâtre"| are considered identical and indeed equal to \verb|"Filliâtre"|. Note that when using such a string as a regular expression, there is no need to escape the backslash, since interpretation of LaTeX accenting commands is made before interpretation into a regexp. Using HTML entities for matching accented names is thus considered as the safest method. \end{itemize} \subsection{Examples} Here are some examples to help you writing the filter conditions you are interested in. \subsubsection{Selecting entries of a given year} The following command reads input files \verb|biblio1.bib| and \verb|biblio2.bib|, and select only entries that appeared in 1999 : \begin{verbatim} bib2bib -oc cite1999 -ob 1999.bib -c 'year=1999' biblio1.bib biblio2.bib \end{verbatim} The resulting file \verb|cite1999| contains the list of keys selected. You can then produce the HTML file by \begin{verbatim} bibtex2html -citefile cite1999 1999.bib \end{verbatim} You may also select references appeared after and/or before a given year. For example, references after 1997: \begin{verbatim} bib2bib -oc citeaft1997 -ob aft1997.bib -c 'year>1997' biblio.bib \end{verbatim} or between 1990 and 1995: \begin{verbatim} bib2bib -oc cite90-95 -ob 90-95.bib -c 'year>=1990 and year<=1995' biblio.bib \end{verbatim} \subsubsection{Selecting references of a given author} The following command reads input files \verb|biblio.bib| and select only entries whose (co)author is Donald Knuth: \begin{verbatim} bib2bib -oc knuth-citations -ob knuth.bib -c 'author : "Knuth"' biblio.bib \end{verbatim} More complicated, if you would like to have only the references whose author is Knuth only, you may try \begin{verbatim} bib2bib -oc knuth-citations -ob knuth.bib \ -c 'author : "^\(Donald \(E. \)?Knuth\|Knuth, Donald \(E.\)?\)$"' biblio.bib \end{verbatim} or equivalently but missing the possible ``\verb|E.|'': \begin{verbatim} bib2bib -oc knuth-citations -ob knuth.bib -c 'author = "Donald Knuth" or author = "Knuth, Donald"' biblio.bib \end{verbatim} \subsubsection{Other examples} Any boolean combination of comparison and/or matching are possible. For example, the following command extract the references that appeared since 1995 and have lambda-calculus in their title, with anything between ``lambda'' and ``calculus'': \begin{verbatim} bib2bib -oc lambda -c 'year >= 1995 and title : "lambda.*calculus"' biblio.bib \end{verbatim} for example, it will select a title containing \verb|$\lambda$-calculus|. \subsection{Note on duplicates entries} \verb|bib2bib| has the effect of merging several bib files into a single one. This process may result in duplicate entries in the resulting files, which is considered as erroneous by \verb|bibtex|. Of course, this is not really a bug of \verb|bib2bib| since it is of your own to take care not having entries with the same key. However, there are two particular cases when this occurs naturally: when two bib files share common abbreviations, or when they share common cross-references. In order to make \verb|bib2bib| behaves correctly in such a case, it is designed as follows: for repeated abbrevs, the first abbrev is kept and the others are ignored, and for repeated regular entries, the last entry is kept and the others are ignored. With this behaviour, everything works well as soon as repeated abbrevs are really duplicate abbrevs of the same sentence, and repeated keys are really duplicate entries. \section{The \texttt{aux2bib} command line tool} \texttt{aux2bib} is a tool extracting the BibTeX references from a \texttt{.aux} file (as produced by \LaTeX) and building the corresponding BibTeX file. It is invocated as \begin{flushleft} \texttt{aux2bib} \textit{file.aux} \end{flushleft} The BibTeX file is written on the standard output. \section{Frequently Asked Questions} \begin{enumerate} \item \textbf{How may I tell bibtex2html to expand cross-references?} ~ By default, all entries of the input BibTeX file are translated into HTML, including cross-references. Since the latter are there, bibtex will never expand them. If you want them to be expanded, you have to tell bibtex2html that crossref entries need not be in the resulting file. To do that you have to use the option \verb|-citefile| to give the exact list of entries you want to see. If a cross-reference is not in that list, then its fields will be expanded into all entries that cross-refers to it. (Technically, this work because bibtex2html calls bibtex with option \verb|-min-crossrefs=1000| by default.) \item \textbf{When running} \begin{verbatim} bib2bib -oc knuth-citations -ob knuth.bib -c 'author : "Knuth"' biblio.bib \end{verbatim} \textbf{I get "Lexical error in condition: Unterminated string". What's going wrong?} You are probably running \verb|bib2bib| under Microsoft Windows, hence you should permute the use of single quotes and double quotes, as explained in Section~\ref{sec:conditions}: \begin{verbatim} bib2bib -oc knuth-citations -ob knuth.bib -c "author : 'Knuth'" biblio.bib \end{verbatim} \end{enumerate} %HEVEA\begin{rawhtml}
    mail to authors , Fri Feb 12 17:46:23 1999\end{rawhtml} \end{document} %%% Local Variables: %%% mode: latex %%% TeX-master: t %%% End: bibtex2html-1.99/aux2bib.10000644000246300004300000000074313255132747014664 0ustar filliatrvals.TH AUX2BIB 1 .SH NAME AUX2BIB \- Extracts a BibTeX database according to an aux file. .SH SYNOPSIS .B aux2bib .SH DESCRIPTION Aux2bib reads a \fI.aux\fR file as produced by \fBLaTeX\fR and writes to standard output a bibtex file containing exactly the bibtex entries refereed in the aux file. .SH SEE ALSO .BR bibtex (1), .BR latex (1), .br .I http://www.lri.fr/~filliatr/bibtex2html/ .br .I /usr/share/doc/bibtex2html .SH AUTHOR Ralf Treinen bibtex2html-1.99/bib2bib.10000644000246300004300000000230013255132747014612 0ustar filliatrvals.TH BIBTEX2HTML BIB2BIB 1 .SH NAME BibTeX2HTML \- A translator of bibliography databases into HTML .SH SYNOPSIS .B bibtex2html [filename] .B bib2bib [options] .SH DESCRIPTION BibTeX2HTML is a collection of tools for automatically producing HTML documents from bibliography databases written in the BibTeX format. It consists in two command line tools: .B bib2bib is a filter tool that reads one or several bibliography files, filters the entries with respect to a given criterion, and outputs the list of selected keys together with a new bibliography file containing only the selected entries; .B bibtex2html is a translator that reads a bibliography file and outputs two HTML documents that contains respectively the cited bibliography in a nice presentation, and the original BibTeX file augmented with several transparent HTML links to allow easy navigation. .SH OPTIONS A short description of available options is displayed when programs are run with option -help. For detailed explanations, please look at the HTML documentation at the URL .I http://www.lri.fr/~filliatr/bibtex2html/doc/ .SH SEE ALSO .BR bibtex (1), .br .I http://www.lri.fr/~filliatr/bibtex2html/ bibtex2html-1.99/bibtex2html.10000644000246300004300000000230013255132747015543 0ustar filliatrvals.TH BIBTEX2HTML BIB2BIB 1 .SH NAME BibTeX2HTML \- A translator of bibliography databases into HTML .SH SYNOPSIS .B bibtex2html [filename] .B bib2bib [options] .SH DESCRIPTION BibTeX2HTML is a collection of tools for automatically producing HTML documents from bibliography databases written in the BibTeX format. It consists in two command line tools: .B bib2bib is a filter tool that reads one or several bibliography files, filters the entries with respect to a given criterion, and outputs the list of selected keys together with a new bibliography file containing only the selected entries; .B bibtex2html is a translator that reads a bibliography file and outputs two HTML documents that contains respectively the cited bibliography in a nice presentation, and the original BibTeX file augmented with several transparent HTML links to allow easy navigation. .SH OPTIONS A short description of available options is displayed when programs are run with option -help. For detailed explanations, please look at the HTML documentation at the URL .I http://www.lri.fr/~filliatr/bibtex2html/doc/ .SH SEE ALSO .BR bibtex (1), .br .I http://www.lri.fr/~filliatr/bibtex2html/ bibtex2html-1.99/test.bib0000644000246300004300000000501713255132747014702 0ustar filliatrvals@string{cogsci = "Cognitive Science Society"} @InProceedings{LongTitle, author = {test}, title = "Du Th{\'e}or{\`e}me de {R}amsey {\`a} la Conjecture d'{E}rd{\H o}s--{H}ajnal", booktitle = {booktitle}, year = 2017} @InProceedings{keywordhere:2005a, author = {Kreowski, Hans-Jörg and M. Abramson}, title = "A cognitive {"} architecture", OPTcrossref = {}, OPTkey = {}, booktitle = {}, OPTpages = {}, year = {2005}, OPTeditor = {}, OPTvolume = {}, OPTnumber = {}, OPTseries = {}, OPTaddress = {}, OPTmonth = {}, organization = cogsci, OPTpublisher = {}, OPTnote = {}, OPTannote = {} } @InProceedings{somekey, author = "Samuel Colin", title = "A title that {"}confuses{"} bib2bib", note = "A space\@ or no space?" } @Book{R:Pekar+Brabec:2009, author = {Stano Pekar and Marek Brabec}, title = {Moderni analyza biologickych dat. 1. Zobecnene linearni modely v prostredi {R} [Modern Analysis of Biological Data. 1. Generalised Linear Models in {R}]}, year = 2009, publisher = {Scientia}, address = {Praha}, series = {Biologie dnes}, publisherurl = {http://www.scientia.cz/katalog.asp?nav=&id=1931}, isbn = {978-80-86960-44-9}, note = {In Czech}, abstract = {Kniha je zamerena na regresni modely, konkretne jednorozmerne zobecnene linearni modely (GLM). Je urcena predevsim studentum a kolegum z biologickych oboru a vyzaduje pouze zakladni statisticke vzdelani, jakym je napr. jednosemestrovy kurz biostatistiky. Text knihy obsahuje nezbytne minimum statisticke teorie, predevsim vsak reseni 18 realnych prikladu z oblasti biologie. Kazdy priklad je rozpracovan od popisu a stanoveni cile pres vyvoj statistickeho modelu az po zaver. K analyze dat je pouzit popularni a volne dostupny statisticky software R. Priklady byly zamerne vybrany tak, aby upozornily na lecktere problemy a chyby, ktere se mohou v prubehu analyzy dat vyskytnout. Zaroven maji ctenare motivovat k tomu, jak o statistickych modelech premyslet a jak je pouzivat. Reseni prikladu si muse ctenar vyzkouset sam na datech, jez jsou dodavana spolu s knihou.}, language = {cz}, }
    with