hevea-2.23/0000755004317100512160000000000012477067103012565 5ustar marangetcristalhevea-2.23/color.ml0000644004317100512160000001062212017660721014231 0ustar marangetcristal(***********************************************************************) (* *) (* HEVEA *) (* *) (* Luc Maranget, projet PARA, INRIA Rocquencourt *) (* *) (* Copyright 1998 Institut National de Recherche en Informatique et *) (* Automatique. Distributed only by permission. *) (* *) (***********************************************************************) type t = Name of string | Hex of string let default_color = Name "black" ;; let table = (Hashtbl.create 17 : (string, t) Hashtbl.t) ;; type saved = (string, t) Hashtbl.t let checkpoint () = let ctable = Hashtbl.create 17 in Misc.copy_hashtbl table ctable ; ctable and hot_start ctable = Misc.copy_hashtbl ctable table let to_hex x = Printf.sprintf "%02X" (truncate (255.0 *. x)) ;; let cmyk_to_rgb c m y k = 1.0 -. min 1.0 (c *. (1.0 -. k) +. k), 1.0 -. min 1.0 (m *. (1.0 -. k) +. k), 1.0 -. min 1.0 (y *. (1.0 -. k) +. k) ;; let hls_to_rgb h l s = let rgb q1 q2 hue = let hue = if hue > 360.0 then hue -. 360.0 else if hue < 0.0 then hue +. 360.0 else hue in if hue < 60.0 then q1 +. (q2 -. q1) /. 60.0 else if hue < 180.0 then q2 else if hue < 240.0 then q1 +. (q2 -. q1) *. (240.0 -. hue) /. 60.0 else q1 in let p2 = if l <= 0.5 then l *. (1.0 +. s) else l +. s -. (l *. s) in let p1 = 2.0 *. l -. p2 in if s = 0.0 then l,l,l else rgb p1 p2 (h +. 100.0), rgb p1 p2 h, rgb p1 p2 (h -. 120.0) ;; let hsv_to_rgb h s v = if s = 0.0 then v,v,v else let h = h /. 60.0 in let i = truncate h in let f = h -. float i in let p = v *. (1.0 -. s) in let q = v *. (1.0 -. (s *. f)) in let t = v *. (1.0 -. (s *. (1.0 -. f))) in match i with | 0 -> v,t,p | 1 -> q,v,p | 2 -> p,v,t | 3 -> p,q,v | 4 -> t,p,v | 5 -> v,p,q | _ -> Misc.fatal ("Bad HSV color specification") ;; exception Failed ;; let names = Hashtbl.create 17 let _ = List.iter (fun (xx,name) -> Hashtbl.add names xx name) [ "000000", "black" ; "C0C0C0", "silver" ; "808080", "gray" ; "FFFFFF", "white" ; "800000", "maroon" ; "FF0000", "red" ; "800080", "purple" ; "FF00FF", "fuchsia" ; "008000", "green" ; "00FF00", "lime" ; "808000", "olive" ; "FFFF00", "yellow" ; "000080", "navy" ; "0000FF", "blue" ; "008080", "teal" ; "00FFFF", "aqua" ; ] let do_compute mdl value = match mdl with | "named" -> begin try Hashtbl.find table ("named@"^value) with | Not_found -> begin Misc.warning ("Unkown name in the named color model: "^value) ; raise Failed end end | _ -> let res = match mdl with | "gray" -> let x = Colscan.one (MyLexing.from_string value) in let xx = to_hex x in xx^xx^xx | "rgb" -> let r,g,b = Colscan.three(MyLexing.from_string value) in to_hex r^to_hex g^to_hex b | "cmyk" -> let c,m,y,k = Colscan.four (MyLexing.from_string value) in let r,g,b = cmyk_to_rgb c m y k in to_hex r^to_hex g^to_hex b | "hsv" -> let h,s,v = Colscan.three (MyLexing.from_string value) in let r,g,b = hsv_to_rgb h s v in to_hex r^to_hex g^to_hex b | "hls" -> let h,l,s = Colscan.three (MyLexing.from_string value) in let r,g,b = hls_to_rgb h l s in to_hex r^to_hex g^to_hex b | _ -> Misc.warning ("Color.compute, unknown color model: "^mdl); raise Failed in try Name (Hashtbl.find names res) with Not_found -> Hex res let compute mdl value = try do_compute mdl value with Failed -> default_color let define clr mdl value = try Hashtbl.add table clr (do_compute mdl value) with Failed -> () ;; let retrieve clr = try Hashtbl.find table clr with Not_found -> Misc.warning ("Color.retrieve, unknown color: "^clr); default_color ;; let define_named name mdl value = define ("named@"^name) mdl value ;; let remove clr = Hashtbl.remove table clr hevea-2.23/inputenc.hva0000644004317100512160000000502711670416714015116 0ustar marangetcristal%% Inputencodings are simple minded, and also impacts on the output %% document charset %% - The 'input' translator is changed to accept chars on 8-bits %% and to translate them to the appropriate unicode chars. %% - Numerical entities given by \@print@u{NUM} are translated %% to chars when possible (through 'output' translator) %% output translator and document charset must of course agree, %% - \usepackage[enc]{inputenc} affects both input and %% output translators and doc charset. %% - Later, one can desynchronize the translators %% For instance, to interpret input as latin1 and to output %% ascii only, one should perform: %% \usepackage[latin1]{inputenc} %% \@def@charset{US-ASCII} %% %% Or, to change input translator alone : \inputencoding{enc} \ProvidesPackage{inputenc} \def\ic@mk@map#1{ic@#1@map} \def\def@ic@map#1#2{\def\csname\ic@mk@map{#1}\endcsname{#2}} %%%Direct setting of inputencoding \newcommand{\ic@restore} {\@set@in@translator {mappings/\csname\ic@mk@map{\inputencodingname}\endcsname.map}}% %% \newcommand{\inputencoding}[1] {\@ifundefined{\ic@mk@map{#1}} {\hva@warn{Unknown input encoding: '#1'}} {\def\inputencodingname{#1}% \@set@in@translator{mappings/\csname\ic@mk@map{#1}\endcsname.map}% \@funregister{\ic@restore}}} %%%Setting inputencoding as package option also sets output encoding \newcommand{\ic@set}[1] {\def\inputencodingname{#1}% \def\@charset{\csname\ic@mk@map{#1}\endcsname}% \@set@translators{mappings/\csname\ic@mk@map{#1}\endcsname.map}} \newcommand{\ic@set@bis}[1] {\def\inputencodingname{#1}% \@set@in@translator{mappings/\csname\ic@mk@map{#1}\endcsname.map}} \newcommand{\ic@option}[2] {\def@ic@map{#1}{#2}% \DeclareOption{#1}{\ic@set{#1}}}% \newcommand{\ic@option@bis}[2] {\def@ic@map{#1}{#2}% \DeclareOption{#1}{\ic@set@bis{#1}}}% %%% \ic@option{ascii}{US-ASCII}% %%% \ic@option{latin1}{ISO-8859-1}% \ic@option{latin2}{ISO-8859-2}% \ic@option{latin3}{ISO-8859-3}% \ic@option{latin4}{ISO-8859-4}% \ic@option{latin5}{ISO-8859-9}% \ic@option{latin6}{ISO-8859-10}% \ic@option{latin7}{ISO-8859-13}% \ic@option{latin8}{ISO-8859-14}% \ic@option{latin9}{ISO-8859-15}% \ic@option{latin10}{ISO-8859-16}% \ic@option{tis-620}{ISO-8859-11}% \ic@option@bis{thai}{ISO-8859-11}% %%% \ic@option{cp1250}{windows-1250}% \ic@option{cp1251}{windows-1251}% \ic@option{cp1252}{windows-1252}% \ic@option{cp1257}{windows-1257}% \ic@option{ansinew}{windows-1252}% %%% \ic@option{applemac}{macintosh}% %%% \ic@option{koi8-r}{KOI8-R}% \ic@option{utf8}{UTF-8}% \ic@option{utf8x}{UTF-8}% %%% \ProcessOptions*% hevea-2.23/info.ml0000644004317100512160000001046212017700472014046 0ustar marangetcristal(***********************************************************************) (* *) (* HEVEA *) (* *) (* Luc Maranget, projet PARA, INRIA Rocquencourt *) (* *) (* Copyright 1998 Institut National de Recherche en Informatique et *) (* Automatique. Distributed only by permission. *) (* *) (***********************************************************************) open Misc open Text exception Error of string let set_out=Text.set_out;; let stop = Text.stop;; let restart = Text.restart;; let is_empty=Text.is_empty;; let get_fontsize=Text.get_fontsize;; let nostyle=Text.nostyle;; let clearstyle=Text.clearstyle;; let open_mod=open_mod;; let erase_mods=Text.erase_mods;; let has_mod = Text.has_mod;; let forget_par = Text.forget_par;; let open_par = Text.open_par;; let close_par = Text.close_par;; let par=Text.par;; let open_block =Text.open_block;; let close_block =Text.close_block;; let force_block =Text.force_block;; let close_flow =Text.close_flow;; let insert_block =Text.insert_block;; let insert_attr =Text.insert_attr;; let open_maths = Text.open_maths and close_maths = Text.close_maths ;; let open_display_varg =Text.open_display_varg;; let open_display =Text.open_display;; let close_display =Text.close_display;; let item_display =Text.item_display;; let force_item_display =Text.force_item_display;; let erase_display =Text.erase_display and standard_sup_sub = Text.standard_sup_sub and limit_sup_sub = Text.limit_sup_sub and int_sup_sub = Text.int_sup_sub and addvsize = Text.addvsize and over = Text.over and left = Text.left and right = Text.right ;; let set_dcount =Text.set_dcount;; let item = Text.item;; let nitem = Text.nitem;; let ditem = Text.ditem;; let erase_block =Text.erase_block;; let open_group =Text.open_group;; let open_aftergroup =Text.open_aftergroup;; let close_group =Text.close_group;; let put s = Text.put s and put_char c = Text.put_char c and put_unicode i = Text.put_unicode i let flush_out =Text.flush_out;; let skip_line =Text.skip_line;; (* Gestion des references *) let loc_name=InfoRef.loc_name;; let open_chan=Text.open_chan;; let close_chan=Text.close_chan;; let to_string=Text.to_string;; let to_style=Text.to_style;; let get_current_output =Text.get_current_output;; (* Finalisation du fichier info *) let finalize check = if check then begin if !verbose>1 then prerr_endline "Beginning of second phase."; InfoRef.finalize_nodes (); Text.finalize check ; let name,buf = if Parse_opts.filter then let texte = get_current_output () in "",MyLexing.from_string texte else (* changer de nom de fichier (renommer ?) *) try let f = Parse_opts.name_out^".tmp" in f,Lexing.from_channel (open_in f) with Sys_error msg -> Misc.fatal ("Cannot re-open info output file "^msg) in InfoRef.dump buf ; if not Parse_opts.filter && !verbose <= 0 then Mysys.remove name end else Text.finalize false ;; let horizontal_line =Text.horizontal_line;; let put_separator =Text.put_separator;; let unskip = Text.unskip;; let put_tag =Text.put_tag;; let put_nbsp =Text.put_nbsp;; let put_open_group =Text.put_open_group;; let put_close_group =Text.put_close_group;; let put_in_math =Text.put_in_math;; let open_table =Text.open_table;; let new_row =Text.new_row;; let open_cell =Text.open_cell;; let erase_cell =Text.erase_cell;; let close_cell =Text.close_cell;; let do_close_cell = Text.do_close_cell;; let open_cell_group = Text.open_cell_group;; let close_cell_group = Text.close_cell_group;; let erase_cell_group = Text.erase_cell_group;; let close_row =Text.close_row;; let erase_row =Text.erase_row;; let close_table =Text.close_table;; let make_border = Text.make_border;; let make_inside = Text.make_inside;; let make_hline = Text.make_hline;; let infonode = InfoRef.infonode;; let infoextranode = InfoRef.infoextranode;; let infomenu = InfoRef.infomenu;; let image = Text.image;; type saved = Text.saved let check = Text.check and hot = Text.hot hevea-2.23/hevea.sty0000644004317100512160000000576210504772141014422 0ustar marangetcristal% hevea : hevea.sty % This is a very basic style file for latex document to be processed % with hevea. It contains definitions of LaTeX environment which are % processed in a special way by the translator. % Mostly : % - latexonly, not processed by hevea, processed by latex. % - htmlonly , the reverse. % - rawhtml, to include raw HTML in hevea output. % - toimage, to send text to the image file. % The package also provides hevea logos, html related commands (ahref % etc.), void cutting and image commands. \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{hevea}[2002/01/11] \RequirePackage{comment} \newif\ifhevea\heveafalse \@ifundefined{ifimagen}{\newif\ifimagen\imagenfalse} \makeatletter% \newcommand{\heveasmup}[2]{% \raise #1\hbox{$\m@th$% \csname S@\f@size\endcsname \fontsize\sf@size 0% \math@fontsfalse\selectfont #2% }}% \DeclareRobustCommand{\hevea}{H\kern-.15em\heveasmup{.2ex}{E}\kern-.15emV\kern-.15em\heveasmup{.2ex}{E}\kern-.15emA}% \DeclareRobustCommand{\hacha}{H\kern-.15em\heveasmup{.2ex}{A}\kern-.15emC\kern-.1em\heveasmup{.2ex}{H}\kern-.15emA}% \DeclareRobustCommand{\html}{\protect\heveasmup{0.ex}{HTML}} %%%%%%%%% Hyperlinks hevea style \newcommand{\ahref}[2]{{#2}} \newcommand{\ahrefloc}[2]{{#2}} \newcommand{\aname}[2]{{#2}} \newcommand{\ahrefurl}[1]{\texttt{#1}} \newcommand{\footahref}[2]{#2\footnote{\texttt{#1}}} \newcommand{\mailto}[1]{\texttt{#1}} \newcommand{\imgsrc}[2][]{} \newcommand{\home}[1]{\protect\raisebox{-.75ex}{\char126}#1} \AtBeginDocument {\@ifundefined{url} {%url package is not loaded \let\url\ahref\let\oneurl\ahrefurl\let\footurl\footahref} {}} %% Void cutting instructions \newcounter{cuttingdepth} \newcommand{\tocnumber}{} \newcommand{\notocnumber}{} \newcommand{\cuttingunit}{} \newcommand{\cutdef}[2][]{} \newcommand{\cuthere}[2]{} \newcommand{\cutend}{} \newcommand{\htmlhead}[1]{} \newcommand{\htmlfoot}[1]{} \newcommand{\htmlprefix}[1]{} \newenvironment{cutflow}[1]{}{} \newcommand{\cutname}[1]{} \newcommand{\toplinks}[3]{} \newcommand{\setlinkstext}[3]{} \newcommand{\flushdef}[1]{} \newcommand{\footnoteflush}[1]{} %%%% Html only \excludecomment{rawhtml} \newcommand{\rawhtmlinput}[1]{} \excludecomment{htmlonly} %%%% Latex only \newenvironment{latexonly}{}{} \newenvironment{verblatex}{}{} %%%% Image file stuff \def\toimage{\endgroup} \def\endtoimage{\begingroup\def\@currenvir{toimage}} \def\verbimage{\endgroup} \def\endverbimage{\begingroup\def\@currenvir{verbimage}} \newcommand{\imageflush}[1][]{} %%% Bgcolor definition \newsavebox{\@bgcolorbin} \newenvironment{bgcolor}[2][] {\newcommand{\@mycolor}{#2}\begin{lrbox}{\@bgcolorbin}\vbox\bgroup} {\egroup\end{lrbox}% \begin{flushleft}% \colorbox{\@mycolor}{\usebox{\@bgcolorbin}}% \end{flushleft}} %%% Style sheets macros, defined as no-ops \newcommand{\newstyle}[2]{} \newcommand{\addstyle}[1]{} \newcommand{\setenvclass}[2]{} \newcommand{\getenvclass}[1]{} \newcommand{\loadcssfile}[1]{} \newenvironment{divstyle}[1]{}{} \newenvironment{cellstyle}[2]{}{} \newif\ifexternalcss %%% Postlude \makeatother hevea-2.23/htmllex.mli0000644004317100512160000000203312323450432014732 0ustar marangetcristal(***********************************************************************) (* *) (* HEVEA *) (* *) (* Luc Maranget, projet Moscova, INRIA Rocquencourt *) (* *) (* Copyright 2001 Institut National de Recherche en Informatique et *) (* Automatique. Distributed only by permission. *) (* *) (***********************************************************************) val to_string : Lexeme.token -> string val cost : Lexeme.style -> int * int module Make(C:DoOut.Config) : sig val ptop : unit -> unit val reset : unit -> unit val next_token : Lexing.lexbuf -> Lexeme.token val styles : Lexing.lexbuf -> Css.id list val classes : Lexing.lexbuf -> Emisc.Strings.t end hevea-2.23/ifpdf.hva0000644004317100512160000000010510500032547014336 0ustar marangetcristal\newif\ifpdf\pdftrue \AtBeginDocument{\ifpdf\@addimagenopt{-pdf}\fi} hevea-2.23/auxx.ml0000644004317100512160000001462512113135426014103 0ustar marangetcristal(***********************************************************************) (* *) (* HEVEA *) (* *) (* Luc Maranget, projet PARA, INRIA Rocquencourt *) (* *) (* Copyright 1998 Institut National de Recherche en Informatique et *) (* Automatique. Distributed only by permission. *) (* *) (***********************************************************************) open Misc let rtable = Hashtbl.create 17 ;; let rset name value = Hashtbl.add rtable name value ;; let rget name = try Hashtbl.find rtable name with Not_found -> begin warning ("Undefined label: '"^name^"'") ; "??" end ;; let btable = Hashtbl.create 17 ;; let bset name value = Hashtbl.add btable name value ;; let bget warn name = let r = try Some (Hashtbl.find btable name) with Not_found -> begin if warn then warning ("Undefined citation: '"^name^"'") ; None end in r ;; let auxfile = ref None and auxname = ref "" and something = ref false and digest = ref None ;; let read_digest name = try Some (Digest.file name) with | Sys_error _ -> None let labelcount = ref 0 let rseen = Hashtbl.create 17 and bseen = Hashtbl.create 17 ;; (* result is true when another run is needed *) let finalize check = match !auxfile with | None -> false | Some file -> close_out file ; if not !something then Mysys.remove !auxname; if check then begin let changed = !digest <> read_digest !auxname in if changed then Misc.message "HeVeA Warning: Label(s) may have changed. Rerun me to get cross-references right." ; changed end else false ;; let write output_fun = match !auxfile with | None -> () | Some file -> something := true ; output_fun file ;; let bcheck key = try let _ = Hashtbl.find bseen key in warning ("Multiple definitions for citation: "^key) ; false with | Not_found -> Hashtbl.add bseen key () ; true let rcheck key = try let _ = Hashtbl.find rseen key in warning ("Multiple definitions for label: "^key) ; -1 with | Not_found -> let x = !labelcount in incr labelcount ; Hashtbl.add rseen key x ; x let swrite msg = match !auxfile with | None -> () | Some file -> something := true ; output_string file msg let bwrite key pretty = if bcheck key then write (fun file -> output_string file "\\bibcite{" ; output_string file key ; output_string file "}{" ; output_string file pretty ; output_string file "}\n") and rwrite key pretty = let idx = rcheck key in if idx >= 0 then write (fun file -> output_string file "\\newlabel{" ; output_string file key ; output_string file "}{{" ; output_string file pretty ; output_string file "}{X}}\n") and rwrite2 anchor key pretty = let idx = rcheck key in if idx >= 0 then write (fun file -> output_string file "\\new@anchor@label{" ; output_string file anchor ; output_string file "}{" ; output_string file key ; output_string file "}{{" ; output_string file pretty ; output_string file "}{X}}\n") ;; type toc_t = {mutable level : int ; mutable depth : int ; chan : out_channel } let toctable = Hashtbl.create 5 ;; let tocfilename suf = Parse_opts.base_out^"."^suf let do_addtoc toc level what = (* First adjust nesting of tocenv *) if level > toc.level then begin for _i = toc.level to level-1 do output_string toc.chan "\\begin{tocenv}\n" done ; toc.depth <- toc.depth + level - toc.level ; toc.level <- level end else if level < toc.level then begin let nclose = min toc.depth (toc.level - level) in for _i = 1 to nclose do output_string toc.chan "\\end{tocenv}\n" done ; toc.depth <- toc.depth - nclose ; if toc.depth=0 then begin output_string toc.chan "\\begin{tocenv}\n" ; toc.depth <- 1 ; end ; toc.level <- level end ; (* Then ouput toc item *) Printf.fprintf toc.chan "\\tocitem %s\n" what let addtoc suf level what = try try let toc = Hashtbl.find toctable suf in do_addtoc toc level what with | Not_found -> let name = Parse_opts.base_out^"."^suf in let chan = open_out name in output_string chan "\\begin{tocenv}\n" ; let toc = {level=level ; depth=1 ; chan=chan } in Hashtbl.add toctable suf toc ; do_addtoc toc level what with | Sys_error msg -> Misc.warning ("Problem with toc file "^tocfilename suf^": "^msg) (* To be performed aroound haux file reading *) let init base = digest := read_digest (base^".haux") let final base = Hashtbl.iter (fun _ toc -> for _i=1 to toc.depth do output_string toc.chan "\\end{tocenv}\n" ; done ; close_out toc.chan) toctable ; Hashtbl.clear toctable ; let filename = base^".haux" in try let file = open_out filename in auxname := filename ; auxfile := Some file with Sys_error s -> warning ("Cannot open out file: "^filename^" : "^s) type saved = (string, string) Hashtbl.t * int * (string, int) Hashtbl.t * (string, string) Hashtbl.t * (string, unit) Hashtbl.t * out_channel option * string * bool * Digest.t option let check () = Hashtbl.copy rtable, !labelcount, Hashtbl.copy rseen, Hashtbl.copy btable, Hashtbl.copy bseen, !auxfile, !auxname, !something, !digest let hot (srtable, slabelcount, srseen, sbtable, sbseen, sauxfile, sauxname, ssomething, sdigest) = Misc.copy_hashtbl srtable rtable ; labelcount := slabelcount ; Misc.copy_hashtbl srseen rseen ; Misc.copy_hashtbl sbtable btable ; Misc.copy_hashtbl sbseen bseen ; auxfile := sauxfile ; auxname := sauxname ; something := ssomething ; digest := sdigest (* Valid only juste before reading main input file *) let hot_start () = Hashtbl.clear rtable ; labelcount := 0 ; Hashtbl.clear rseen ; Hashtbl.clear btable ; Hashtbl.clear bseen ; auxfile := None ; auxname := "" ; something := false ; digest := None hevea-2.23/explode.ml0000644004317100512160000000335512017660721014560 0ustar marangetcristal(***********************************************************************) (* *) (* HEVEA *) (* *) (* Luc Maranget, projet Moscova, INRIA Rocquencourt *) (* *) (* Copyright 2001 Institut National de Recherche en Informatique et *) (* Automatique. Distributed only by permission. *) (* *) (* $Id: explode.ml,v 1.7 2012-06-05 14:55:39 maranget Exp $ *) (***********************************************************************) open Htmltext open Tree let of_styles env r = match env with | [] -> r | _ -> Node (env,[r]) let rec tree env t k = match t with | Text s -> of_styles env (Text s)::k | Blanks s -> of_styles (List.filter (fun s -> not (Htmltext.blanksNeutral s)) env) (Blanks s):: k | Node (s,ts) -> begin try let new_env = Htmltext.add_style s env in List.fold_right (tree new_env) ts k with | Split (s,env) -> let ts = List.fold_right (tree []) ts [] in let now = if Util.is_blanks ts then (List.filter (fun s -> not (Htmltext.blanksNeutral s)) env) else env in match ts with | [] -> k | _ -> of_styles now (Node ([s],ts))::k end | ONode (so,sc,ts) -> of_styles env (ONode (so,sc, List.fold_right (tree []) ts []))::k let trees ts = List.fold_right (tree []) ts [] hevea-2.23/text.mli0000644004317100512160000000137111774606345014264 0ustar marangetcristal(***********************************************************************) (* *) (* HEVEA *) (* *) (* Luc Maranget, projet PARA, INRIA Rocquencourt *) (* *) (* Copyright 1998 Institut National de Recherche en Informatique et *) (* Automatique. Distributed only by permission. *) (* *) (***********************************************************************) include OutManager.S hevea-2.23/ultra.mli0000644004317100512160000000155210512403554014412 0ustar marangetcristal(***********************************************************************) (* *) (* HEVEA *) (* *) (* Luc Maranget, projet Moscova, INRIA Rocquencourt *) (* *) (* Copyright 2001 Institut National de Recherche en Informatique et *) (* Automatique. Distributed only by permission. *) (* *) (* $Id: ultra.mli,v 1.5 2006-10-09 08:25:16 maranget Exp $ *) (***********************************************************************) val main : out_channel -> Lexeme.style Tree.t list -> unit hevea-2.23/htmlparse.ml0000644004317100512160000001001212323450432015077 0ustar marangetcristal(***********************************************************************) (* *) (* HEVEA *) (* *) (* Luc Maranget, projet Moscova, INRIA Rocquencourt *) (* *) (* Copyright 2001 Institut National de Recherche en Informatique et *) (* Automatique. Distributed only by permission. *) (* *) (* $Id: htmlparse.ml,v 1.11 2008-01-22 18:08:37 maranget Exp $ *) (***********************************************************************) open Lexeme open Tree exception Error of string module Make(C:DoOut.Config) = struct let error msg _lb = raise (Error msg) ;; module Out = DoOut.Make(C) module Lex = Htmllex.Make(C) let buff = ref None let next_token lexbuf = match !buff with | Some tok -> buff := None ; tok | None -> Lex.next_token lexbuf and put_back lexbuf tok = match !buff with | None -> buff := Some tok | _ -> error "Put back" lexbuf let txt_buff = Out.create_buff () let rec to_close tag lb = match next_token lb with | Close (t,_) as tok when t=tag -> tok | Open (t,_,txt) when t=tag -> Out.put txt_buff txt ; Out.put txt_buff (Htmllex.to_string (to_close tag lb)) ; to_close tag lb | Eof -> error ("Eof in to_close") lb | tok -> Out.put txt_buff (Htmllex.to_string tok); to_close tag lb let rec tree cls lexbuf = match next_token lexbuf with | (Eof|Close (_,_)) as tok-> put_back lexbuf tok ; None | Open (STYLE,_,txt) -> let otxt = txt and ctxt = Htmllex.to_string (to_close STYLE lexbuf) in let txt = Out.to_string txt_buff in let txt = match cls with | None -> txt | Some cls -> let css = Lex.styles (MyLexing.from_string txt) in let buff = Out.create_buff () in Out.put_char buff '\n' ; List.iter (fun cl -> match cl with | Css.Other txt -> Out.put buff txt ; Out.put_char buff '\n' | Css.Class (name, addname, txt) -> if Emisc.Strings.mem name cls then begin Out.put_char buff '.' ; Out.put buff name ; begin match addname with | None -> () | Some n -> Out.put_char buff ' ' ; Out.put buff n end ; Out.put buff txt ; Out.put_char buff '\n' end) css ; Out.to_string buff in Some (Text (otxt^txt^ctxt)) | Open (SCRIPT,_,txt) -> Out.put txt_buff txt ; Out.put txt_buff (Htmllex.to_string (to_close SCRIPT lexbuf)) ; Some (Text (Out.to_string txt_buff)) | Open (tag,attrs,txt) -> let fils = trees cls lexbuf in begin match next_token lexbuf with | Close (ctag,ctxt) when tag=ctag -> Some (match tag with | A|SUP|SUB -> ONode (txt,ctxt,fils) | _ -> Node ({tag=tag ; attrs=attrs ; txt=txt ; ctxt=ctxt},fils)) | tok -> error (Htmllex.to_string tok ^ " closes "^txt) lexbuf end | Lexeme.Text txt -> Some (Text txt) | Lexeme.Blanks txt -> Some (Blanks txt) and trees cls lexbuf = match tree cls lexbuf with | None -> [] | Some t -> t::trees cls lexbuf let rec do_main cls lexbuf = match tree cls lexbuf with | None -> begin match next_token lexbuf with | Eof -> [] | tok -> error ("Unexpected " ^ Htmllex.to_string tok) lexbuf end | Some (Text _ as last) -> [last] | Some t -> t :: do_main cls lexbuf let ptop () = Lex.ptop () let reset () = Lex.reset() ; Out.reset txt_buff let main cls lexbuf = try do_main cls lexbuf with | e -> reset () ; raise e let classes = Lex.classes end hevea-2.23/ultra.ml0000644004317100512160000003342012401623123014233 0ustar marangetcristal(***********************************************************************) (* *) (* HEVEA *) (* *) (* Luc Maranget, projet Moscova, INRIA Rocquencourt *) (* *) (* Copyright 2001 Institut National de Recherche en Informatique et *) (* Automatique. Distributed only by permission. *) (* *) (* $Id: ultra.ml,v 1.14 2012-06-05 14:55:39 maranget Exp $ *) (***********************************************************************) open Printf open Tree open Htmltext open Util let same_prop f s = try let p = Htmltext.get_prop f.nat in List.exists (fun s -> p s.nat) s with | NoProp -> false let rec part_factor some blanks i s keep leave = function | [] -> keep,leave | ((f,_) as x)::rem when there f s || same_prop f s || (blanks && Htmltext.blanksNeutral f)-> part_factor some blanks i s (x::keep) leave rem | (f,j)::rem -> part_factor some blanks i s keep (some f j (i-1) leave) rem let there_factor s fs = List.exists (fun (f,_) -> same_style s f) fs let rec start_factor i fs start = function | [] -> start | s::rem when there_factor s fs -> start_factor i fs start rem | s::rem -> start_factor i fs ((s,i)::start) rem let extend_factors some blanks i s r fs = let keep,leave = part_factor some blanks i s [] r fs in start_factor i fs keep s,leave let rec part_factor_neutral some i keep leave = function | [] -> keep,leave | ((f,_) as x)::rem when Htmltext.blanksNeutral f -> part_factor_neutral some i (x::keep) leave rem | (f,j)::rem -> part_factor_neutral some i keep (some f j (i-1) leave) rem let extend_factors_neutral some i r fs = part_factor_neutral some i [] r fs let finish_factors some i r fs = part_factor some false i [] [] r fs let pfactor chan fs = List.iter (fun ((i,j),f) -> Printf.fprintf chan " %d,%d:%s" i j f.txt) fs ; output_char chan '\n' let covers (i1:int) (j1:int) i2 j2 = (i1 <= i2 && j2 < j1) || (i1 < i2 && j2 <= j1) let rec all_blanks ts i j = if i <= j then is_blank ts.(i) && all_blanks ts (i+1) j else true let rec get_same ts i j f = function | [] -> ((i,j),f) | ((ii,jj),_)::_ when covers i j ii jj && all_blanks ts i (ii-1) && all_blanks ts (jj+1) j -> ((ii,jj),f) | _::rem -> get_same ts i j f rem let get_sames ts fs = let rec do_rec r = function | [] -> r | (((i,j),f) as x)::rem -> do_rec (if blanksNeutral f then get_same ts i j f fs::r else x::r) rem in do_rec [] fs let group_font ts fs = let fonts,no_fonts = List.partition (fun (_,f) -> is_font f.nat) fs in get_sames ts fonts@no_fonts let group_span ts fs = let span,no_span = List.partition (fun (_,f) -> is_span f.nat) fs in get_sames ts span@no_span let conflict_low i1 j1 i2 j2 = i1 < i2 && i2 <= j1 && j1 < j2 let correct_cfl_low ts i1 j1 i2 j2 = if conflict_low i1 j1 i2 j2 && all_blanks ts i1 (i2-1) then i1 else i2 and correct_cfl_high ts i1 j1 i2 j2 = if conflict_low i1 j1 i2 j2 && all_blanks ts (j1+1) j2 then j2 else j1 let rec mk_cover_one ts i j f = function | [] -> (i,j),f | ((ii,jj),_)::rem -> mk_cover_one ts (correct_cfl_low ts ii jj i j) (correct_cfl_high ts i j ii jj) f rem let rec mk_cover ts fs = function | [] -> [] | ((i,j),f)::rem -> mk_cover_one ts i j f fs :: mk_cover ts fs rem let extend_neutrals ts fs = let neutral,not_neutral = List.partition (fun (_,f) -> blanksNeutral f) fs in mk_cover ts fs neutral @ not_neutral let factorize low high ts = if low >= high then [] else let limit_blanks_right i = let rec do_rec i = if i <= low then low else begin if is_blank ts.(i) then do_rec (i-1) else i end in do_rec i in let correct_prop f i j env = try let _ = Htmltext.get_prop f.nat in let rec find_same k = match ts.(k) with | Node (s,_) when there f s -> k | _ -> find_same (k-1) in let j = find_same j in if j=i || (blanksNeutral f && all_blanks ts i (j-1)) then env else ((i,j),f)::env with | NoProp -> ((i,j),f)::env in let some f i j env = if not (Htmltext.blanksNeutral f) then begin if j-i > 0 then correct_prop f i j env else env end else begin let r = ref 0 in for k = i to j do if not (is_blank ts.(k)) then incr r done ; if !r > 1 then correct_prop f i (limit_blanks_right j) env else env end in let rec do_rec i r fs = if i <= high then begin let fs,r = match ts.(i) with | Node (s,ts) -> extend_factors some (is_blanks ts) i s r fs | t -> if is_blank t then extend_factors_neutral some i r fs else finish_factors some i r fs in do_rec (i+1) r fs end else let _,r = finish_factors some i r fs in r in let r = do_rec low [] [] in let r = group_font ts r in let r = group_span ts r in let r = extend_neutrals ts r in if r <> [] && !Emisc.verbose > 1 then begin Printf.fprintf stderr "Factors in %d %d\n" low high ; for i=low to high do Pp.tree stderr ts.(i) done ; prerr_endline "\n*********" ; pfactor stderr r end ; r let same ((i1,j1),_) ((i2,j2),_) = i1=i2 && j1=j2 let covers_cost ((((i1:int),(j1:int)),_),_) (((i2,j2),_),_) = covers i1 j1 i2 j2 let biggest fs = let rec through r = function | [] -> r | x::rem -> if List.exists (fun y -> covers_cost y x) rem then through r rem else through (x::r) rem in through [] (through [] fs) let conflicts ((i1,j1),_) ((i2,j2),_) = (i1 < i2 && i2 <= j1 && j1 < j2) || (i2 < i1 && i1 <= j2 && j2 < j1) let num_conflicts f fs = List.fold_left (fun r g -> if conflicts f g then 1+r else r) 0 fs let put_conflicts fs = List.fold_left (fun r g -> (g,num_conflicts g fs)::r) [] fs let rec add f = function | [] -> let i,f = f in [i,[f]] | x::rem as r -> if same f x then let _,f = f and i,r = x in (i,(f::r))::rem else if conflicts f x then r else x::add f rem let get_them fs = List.fold_left (fun r (f,_) -> add f r) [] fs let pfactorc chan fs = List.iter (fun (((i,j),f),c) -> Printf.fprintf chan " %d,%d:%s(%d)" i j f.txt c) fs ; output_char chan '\n' let slen f = (if is_font f.nat then 5 else 0) + String.length f.txt + String.length f.ctxt let order_factors (((_i1,_j1),f1),(c1:int)) (((_i2,_j2),f2),c2) = match compare c1 c2 with | 0 -> compare (slen f2) (slen f1) (* NB comparison reversed *) | r -> r let select_factors fs = let fs1 = put_conflicts fs in let fs2 = biggest fs1 in let fs3 = List.sort order_factors fs2 in if !Emisc.verbose > 1 then begin prerr_string "fs1:" ; pfactorc stderr fs1 ; prerr_string "fs2:" ; pfactorc stderr fs2 ; prerr_string "fs3:" ; pfactorc stderr fs3 end ; List.sort (fun ((_,j1),_) ((i2,_),_) -> Pervasives.compare (j1:int) i2) (get_them fs3) let some_font s = List.exists (fun s -> is_font s.nat) s let rec font_tree = function | Node (s,ts) -> some_font s || font_trees ts | Blanks _ -> true | _ -> false and font_trees ts = List.for_all font_tree ts let other_props s = let rec other r = function | [] -> r | s::rem when is_font s.nat -> other (List.fold_left (fun r p -> if p s.nat then r else p::r) [] r) rem | _::rem -> other r rem in other font_props s let rec all_props r ts = match r with | [] -> [] | _ -> match ts with | [] -> r | Node (s,_)::rem when some_font s -> all_props (List.filter (fun p -> List.exists (fun s -> is_font s.nat && p s.nat) s) r) rem | Node (_,ts)::rem -> all_props (all_props r ts) rem | Blanks _::rem -> all_props (List.filter neutral_prop r) rem | _ -> assert false let extract_props ps s = List.partition (fun s -> is_font s.nat && List.exists (fun p -> p s.nat) ps) s let clean t k = match t with | Node ([],ts) -> ts@k | _ -> t::k let rec neutrals started r = function | [] -> r | Blanks _::rem -> neutrals started r rem | Node (s, _)::rem -> if started then neutrals true (inter r (List.filter blanksNeutral s)) rem else neutrals true (List.filter blanksNeutral s) rem | _ -> [] let rec remove_list fs ts = match ts with | [] -> [] | Node (gs,args)::rem -> begin match sub gs fs with | [] -> args @ remove_list fs rem | ks -> Node (ks,args) :: remove_list fs rem end | t::rem -> t::remove_list fs rem let lift_neutral fs ts k = match neutrals false [] ts with | [] -> Node (fs,ts)::k | lift -> Node (lift@fs, remove_list lift ts)::k let check_node fs ts k = match ts with | Node (si,args)::rem when some_font fs && font_trees ts -> begin match all_props (other_props fs) ts with | [] -> lift_neutral fs ts k | ps -> let lift,keep = extract_props ps si in lift_neutral (lift@fs) (clean (Node (keep,args)) rem) k end | _ -> lift_neutral fs ts k let rec as_list i j ts k = if i > j then k else (clean ts.(i)) (as_list (i+1) j ts k) let remove s = function | Node (os,ts) -> node (sub os s) ts | t -> t and is_text_blank = function | Text _ | Blanks _ -> true | _ -> false and is_node = function | Node (_::_,_) -> true | _ -> false let rec cut_begin p ts l i = if i >= l then l,[] else if p ts.(i) then let j,l = cut_begin p ts l (i+1) in j,ts.(i)::l else i,[] let cut_end p ts l = let rec do_rec r i = if i < 0 then i,r else if p ts.(i) then do_rec (ts.(i)::r) (i-1) else i,r in do_rec [] (l-1) let is_other s = match s.nat with | Other -> true | _ -> false let rec deeper i j ts k = let rec again r i = if i > j then r else match ts.(i) with | Node ([],args) -> let b1 = List.exists is_node args in again (b1 || r) (i+1) | Node (s,args) when List.exists is_other s -> let r = again r (i+1) in if not r then ts.(i) <- Node (s,opt true (Array.of_list args) []) ; r | _ -> again r (i+1) in if again false i then begin let ts = as_list i j ts [] in let rs = opt true (Array.of_list ts) k in rs end else as_list i j ts k and trees i j ts k = if i > j then k else match factorize i j ts with | [] -> deeper i j ts k | fs -> let rec zyva cur fs k = match fs with | [] -> deeper cur j ts k | ((ii,jj),gs)::rem -> for k=ii to jj do ts.(k) <- remove gs ts.(k) done ; deeper cur (ii-1) ts (check_node gs (trees ii jj ts []) (zyva (jj+1) rem k)) in let fs = select_factors fs in if !Emisc.verbose > 1 then begin prerr_endline "selected" ; List.iter (fun ((i,j),fs) -> Printf.fprintf stderr " %d,%d:" i j ; List.iter (fun f -> output_string stderr (" "^f.txt)) fs) fs ; prerr_endline "" end ; zyva i fs k and opt_onodes ts i = match ts.(i) with | ONode (o,c,args) -> begin match opt false (Array.of_list args) [] with | [Node (s,args)] when false -> let s1, s2 = partition_color s in ts.(i) <- begin match s1, s2 with | [],[] -> assert false | [],s -> ONode (o,c,[Node (s, args)]) | s,[] -> Node (s,[ONode (o,c,args)]) | _,_ -> Node (s1, [ONode (o,c,[Node (s2, args)])]) end | t -> ts.(i) <- ONode (o,c,t) end | _ -> () and opt top ts k = let l = Array.length ts in for i = 0 to l-1 do opt_onodes ts i done ; let p = is_text_blank in let start,pre = cut_begin p ts l 0 in if start >= l then pre@k else let fin,post = cut_end p ts l in if top then pre@trees start fin ts (post@k) else extend_blanks pre (trees start fin ts []) post k and extend_blanks pre ts post k = match ts with | [Node (s,args)] when pre <> [] && post <> [] && List.exists blanksNeutral s && is_blanks pre && is_blanks post -> let neutral,not_neutral = List.partition blanksNeutral s in [Node (neutral, (match not_neutral with | [] -> pre@args@post@k | _ -> pre@Node (not_neutral,args)::post@k))] | _ -> pre@ts@post@k let main chan ts = if !Emisc.verbose > 2 then begin eprintf "**Ultra input **\n" ; Pp.ptrees stderr ts ; eprintf "** Ultra end**\n%!" ; () end ; let ci = costs Htmllex.cost ts in let rs = opt true (Array.of_list (Explode.trees ts)) [] in let cf = costs Htmltext.cost rs in if compare ci cf < 0 then begin if !Emisc.verbose > 1 then begin prerr_endline "*********** Pessimization ***********" ; Pp.ptrees stderr ts ; prerr_endline "*********** Into ***********" ; Pp.trees stderr rs end ; Pp.ptrees chan ts end else begin if !Emisc.verbose > 2 then begin eprintf "** Ultra output **\n" ; Pp.trees stderr rs ; eprintf "** Ultra end**\n%!" ; () end ; Pp.trees chan rs end hevea-2.23/htmlCommon.ml0000644004317100512160000013441512330272101015224 0ustar marangetcristal(***********************************************************************) (* *) (* HEVEA *) (* *) (* Luc Maranget, projet PARA, INRIA Rocquencourt *) (* *) (* Copyright 1998 Institut National de Recherche en Informatique et *) (* Automatique. Distributed only by permission. *) (* *) (***********************************************************************) (* Output function for a strange html model : - Text elements can occur anywhere and are given as in latex - A new grouping construct is given (open_group () ; close_group ()) *) open Misc open Element open MyStack open Length open Printf type block = | H1 | H2 | H3 | H4 | H5 | H6 | PRE | TABLE | TR | TD | DISPLAY of bool | DFLOW | QUOTE | BLOCKQUOTE | DIV | UL | OL | DL | LI | DD | DT | GROUP | AFTER | DELAY | FORGET | INTERN | P | NADA | OTHER of string let string_of_block = function | H1 -> "h1" | H2 -> "h2" | H3 -> "h3" | H4 -> "h4" | H5 -> "h5" | H6 -> "h6" | PRE -> "pre" | TABLE -> "table" | TR -> "tr" | TD -> "td" | DISPLAY false -> "display" | DISPLAY true -> "display (center)" | DFLOW -> "dflow" | QUOTE -> "quote" | BLOCKQUOTE -> "blockquote" | DIV -> "div" | UL -> "ul" | OL -> "ol" | DL -> "dl" | GROUP -> "" | AFTER -> "after" | DELAY -> "delay" | FORGET -> "forget" | P -> "p" | NADA -> "nada" | INTERN -> "intern" | LI -> "li" | DD -> "dd" | DT -> "dt" | OTHER s -> s let block_t = Hashtbl.create 17 let no_opt = false let add b = Hashtbl.add block_t (string_of_block b) b and add_verb s b = Hashtbl.add block_t s b let () = add H1 ; add H2 ; add H3 ; add H4 ; add H5 ; add H6 ; add PRE ; add TABLE ; add TR ; add TD ; add (DISPLAY false) ; add QUOTE ; add BLOCKQUOTE ; add DIV ; add UL ; add OL ; add DL ; begin if no_opt then Hashtbl.add block_t "" INTERN else add GROUP end ; add AFTER ; add DELAY ; add FORGET ; add P ; add NADA let failclose s b1 b2= raise (Misc.Close (s^": '"^string_of_block b1^"' closes '"^ string_of_block b2^"'")) let find_block s = let s = String.lowercase s in try Hashtbl.find block_t s with | Not_found -> OTHER s let eq_tags t1 t2 = match t1, t2 with | DISPLAY _, DISPLAY _ -> true | _, _ -> t1=t2 let check_block_closed opentag closetag = if not (eq_tags opentag closetag) && not (opentag = AFTER && closetag = GROUP) then failclose "html" closetag opentag let display_arg centering _verbose = let cl = if !displayverb then "vdisplay" else "display" in let cl = if centering then cl^(if !displayverb then " vdcenter" else " dcenter") else cl in let arg = "class=\""^cl^"\"" in arg (* output globals *) type t_env = {here : bool ; env : text} type t_top = {top_pending : text list ; top_active : t_env list ;} type style_info = | Nothing of t_top | Activate of t_top | Closed of t_top * int | ActivateClosed of t_top | NotMe | Insert of bool * text list let get_top_lists = function | Nothing x -> x | Activate x -> x | _ -> raise Not_found let do_pretty_mods stderr f mods = let rec do_rec stderr = function [x] -> f stderr x | x::xs -> Printf.fprintf stderr "%a; %a" f x do_rec xs | [] -> () in Printf.fprintf stderr "[%a]" do_rec mods let tbool = function | true -> "+" | false -> "-" let pretty_mods stderr = do_pretty_mods stderr (fun stderr text -> Printf.fprintf stderr "%s" (pretty_text text)) and pretty_tmods stderr = do_pretty_mods stderr (fun stderr {here=here ; env = env} -> Printf.fprintf stderr "%s%s" (tbool here) (pretty_text env)) let pretty_top_styles stderr {top_pending = pending ; top_active = active} = Printf.fprintf stderr "{top_pending=%a, top_active=%a}" pretty_mods pending pretty_tmods active let tbool = function | true -> "+" | false -> "-" let pretty_top stderr = function | Nothing x -> Printf.fprintf stderr "Nothing %a" pretty_top_styles x | Activate x -> Printf.fprintf stderr "Activate %a" pretty_top_styles x | Closed _ -> Printf.fprintf stderr "Closed" | ActivateClosed _ -> Printf.fprintf stderr "ActivateClosed" | NotMe -> Printf.fprintf stderr "NotMe" | Insert (b,active) -> Printf.fprintf stderr "Insert %s %a" (tbool b) pretty_mods active type status = { mutable nostyle : bool ; mutable pending : text list ; mutable active : t_env list ; mutable top : style_info ; mutable out : Out.t} let as_env {env=env} = env let as_envs tenvs r = List.fold_right (fun x r -> as_env x::r) tenvs r let to_pending pending active = pending @ as_envs active [] let with_new_out out = {out with out = Out.create_buff ()} let cur_out = ref {nostyle=false ; pending = [] ; active = [] ; top = NotMe ; out = Out.create_null ()} type stack_item = Normal of block * string * status | Freeze of (unit -> unit) exception PopFreeze let push_out s (a,b,c) = push s (Normal (a,b,c)) let pretty_stack s = MyStack.pretty (function Normal (s,args,_) -> "["^string_of_block s^"]-{"^args^"}" | Freeze _ -> "Freeze") s let pop_out s = match pop s with | Normal (a,b,c) -> a,b,c | Freeze _ -> raise PopFreeze and top_out s = match top s with | Normal (a,b,c) -> a,b,c | Freeze _ -> raise PopFreeze let out_stack = MyStack.create_init "out_stack" (Normal (NADA,"",!cur_out)) type saved_out = status * stack_item MyStack.saved let save_out () = !cur_out, MyStack.save out_stack and restore_out (a,b) = if !cur_out != a then begin MyStack.finalize out_stack (function | Normal (_,_,x) -> x == a | _ -> false) (function | Normal (_,_,_out) -> () | _ -> ()) end ; cur_out := a ; MyStack.restore out_stack b let pblock () = match MyStack.top out_stack with | Normal (s,_,_) -> s | _ -> NADA and p2block () = MyStack.top2 out_stack let do_put_char c = if !verbose > 3 then prerr_endline ("put_char: |"^String.escaped (String.make 1 c)^"|"); Out.put_char !cur_out.out c and do_put s = if !verbose > 3 then prerr_endline ("put: |"^String.escaped s^"|"); Out.put !cur_out.out s ; () (* Flags section *) (* Style information for caller *) type flags_t = { mutable table_inside:bool; mutable in_math : bool; mutable ncols:int; mutable empty:bool; mutable blank:bool; mutable saw_par: bool ; mutable vsize:int; mutable nrows:int; mutable table_vsize:int; mutable nitems:int; mutable dt:string; mutable dcount:string; mutable in_pre:bool; mutable insert: (block * string) option; mutable insert_attr: (block * string) option; } let pretty_cur {pending = pending ; active = active ; top = top} = Printf.fprintf stderr "pending=%a, active=%a\n" pretty_mods pending pretty_tmods active ; Printf.fprintf stderr "top = %a" pretty_top top ; prerr_endline "" let activate_top out = match out.top with | Nothing x -> out.top <- Activate x | _ -> () and close_top n out = match out.top with | Nothing top -> out.top <- Closed (top, n+Out.get_pos out.out) | Activate top -> out.top <- ActivateClosed top | _ -> () let debug_attr stderr = function | None -> Printf.fprintf stderr "None" | Some (tag,attr) -> Printf.fprintf stderr "'%s' '%s'" (string_of_block tag) attr let debug_flags f = Printf.fprintf stderr "attr=%a\n" debug_attr f.insert_attr ; flush stderr let flags = { table_inside = false; ncols = 0; in_math = false; empty = true; blank = true; saw_par = false ; vsize = 0; nrows = 0; table_vsize = 0; nitems = 0; dt = ""; dcount = ""; in_pre = false; insert = None; insert_attr = None; } let copy_flags { table_inside = table_inside; ncols = ncols; in_math = in_math; empty = empty; blank = blank; saw_par = saw_par ; vsize = vsize; nrows = nrows; table_vsize = table_vsize; nitems = nitems; dt = dt; dcount = dcount; in_pre = in_pre; insert = insert; insert_attr = insert_attr; } = { table_inside = table_inside; ncols = ncols; in_math = in_math; empty = empty; blank = blank; saw_par = saw_par ; vsize = vsize; nrows = nrows; table_vsize = table_vsize; nitems = nitems; dt = dt; dcount = dcount; in_pre = in_pre; insert = insert; insert_attr = insert_attr; } and set_flags f { table_inside = table_inside ; ncols = ncols; in_math = in_math; empty = empty; blank = blank; saw_par = saw_par ; vsize = vsize; nrows = nrows; table_vsize = table_vsize; nitems = nitems; dt = dt; dcount = dcount; in_pre = in_pre; insert = insert; insert_attr = insert_attr; } = f.table_inside <- table_inside; f.ncols <- ncols; f.in_math <- in_math; f.empty <- empty; f.blank <- blank; f.saw_par <- saw_par ; f.vsize <- vsize; f.nrows <- nrows; f.table_vsize <- table_vsize; f.nitems <- nitems; f.dt <- dt; f.dcount <- dcount; f.in_pre <- in_pre; f.insert <- insert ; f.insert_attr <- insert_attr ; (* Independant stacks for flags *) type stack_t = { s_table_inside : bool MyStack.t ; s_saved_inside : bool MyStack.t ; s_in_math : bool MyStack.t ; s_ncols : int MyStack.t ; s_empty : bool MyStack.t ; s_blank : bool MyStack.t ; s_saw_par : bool MyStack.t ; s_vsize : int MyStack.t ; s_nrows : int MyStack.t ; s_table_vsize : int MyStack.t ; s_nitems : int MyStack.t ; s_dt : string MyStack.t ; s_dcount : string MyStack.t ; s_insert : (block * string) option MyStack.t ; s_insert_attr : (block * string) option MyStack.t ; (* Other stacks, not corresponding to flags *) s_active : Out.t MyStack.t ; s_after : (string -> string) MyStack.t } let stacks = { s_table_inside = MyStack.create "inside" ; s_saved_inside = MyStack.create "saved_inside" ; s_in_math = MyStack.create_init "in_math" false ; s_ncols = MyStack.create "ncols" ; s_empty = MyStack.create_init "empty" false; s_blank = MyStack.create_init "blank" false ; s_saw_par = MyStack.create "saw_par" ; s_vsize = MyStack.create "vsize" ; s_nrows = MyStack.create_init "nrows" 0 ; s_table_vsize = MyStack.create_init "table_vsize" 0 ; s_nitems = MyStack.create_init "nitems" 0 ; s_dt = MyStack.create_init "dt" "" ; s_dcount = MyStack.create_init "dcount" "" ; s_insert = MyStack.create_init "insert" None; s_insert_attr = MyStack.create_init "insert_attr" None; s_active = MyStack.create "Html.active" ; s_after = MyStack.create "Html.after" } type saved_stacks = { ss_table_inside : bool MyStack.saved ; ss_saved_inside : bool MyStack.saved ; ss_in_math : bool MyStack.saved ; ss_ncols : int MyStack.saved ; ss_empty : bool MyStack.saved ; ss_blank : bool MyStack.saved ; ss_saw_par : bool MyStack.saved ; ss_vsize : int MyStack.saved ; ss_nrows : int MyStack.saved ; ss_table_vsize : int MyStack.saved ; ss_nitems : int MyStack.saved ; ss_dt : string MyStack.saved ; ss_dcount : string MyStack.saved ; ss_insert : (block * string) option MyStack.saved ; ss_insert_attr : (block * string) option MyStack.saved ; (* Other stacks, not corresponding to flags *) ss_active : Out.t MyStack.saved ; ss_after : (string -> string) MyStack.saved } let save_stacks () = { ss_table_inside = MyStack.save stacks.s_table_inside ; ss_saved_inside = MyStack.save stacks.s_saved_inside ; ss_in_math = MyStack.save stacks.s_in_math ; ss_ncols = MyStack.save stacks.s_ncols ; ss_empty = MyStack.save stacks.s_empty ; ss_blank = MyStack.save stacks.s_blank ; ss_saw_par = MyStack.save stacks.s_saw_par ; ss_vsize = MyStack.save stacks.s_vsize ; ss_nrows = MyStack.save stacks.s_nrows ; ss_table_vsize = MyStack.save stacks.s_table_vsize ; ss_nitems = MyStack.save stacks.s_nitems ; ss_dt = MyStack.save stacks.s_dt ; ss_dcount = MyStack.save stacks.s_dcount ; ss_insert = MyStack.save stacks.s_insert ; ss_insert_attr = MyStack.save stacks.s_insert_attr ; ss_active = MyStack.save stacks.s_active ; ss_after = MyStack.save stacks.s_after } and restore_stacks { ss_table_inside = saved_table_inside ; ss_saved_inside = saved_saved_inside ; ss_in_math = saved_in_math ; ss_ncols = saved_ncols ; ss_empty = saved_empty ; ss_blank = saved_blank ; ss_saw_par = saved_saw_par ; ss_vsize = saved_vsize ; ss_nrows = saved_nrows ; ss_table_vsize = saved_table_vsize ; ss_nitems = saved_nitems ; ss_dt = saved_dt ; ss_dcount = saved_dcount ; ss_insert = saved_insert ; ss_insert_attr = saved_insert_attr ; ss_active = saved_active ; ss_after = saved_after } = MyStack.restore stacks.s_table_inside saved_table_inside ; MyStack.restore stacks.s_saved_inside saved_saved_inside ; MyStack.restore stacks.s_in_math saved_in_math ; MyStack.restore stacks.s_ncols saved_ncols ; MyStack.restore stacks.s_empty saved_empty ; MyStack.restore stacks.s_blank saved_blank ; MyStack.restore stacks.s_saw_par saved_saw_par ; MyStack.restore stacks.s_vsize saved_vsize ; MyStack.restore stacks.s_nrows saved_nrows ; MyStack.restore stacks.s_table_vsize saved_table_vsize ; MyStack.restore stacks.s_nitems saved_nitems ; MyStack.restore stacks.s_dt saved_dt ; MyStack.restore stacks.s_dcount saved_dcount ; MyStack.restore stacks.s_insert saved_insert ; MyStack.restore stacks.s_insert_attr saved_insert_attr ; MyStack.restore stacks.s_active saved_active ; MyStack.restore stacks.s_after saved_after let check_stack what = if not (MyStack.empty what) && not !silent then begin prerr_endline ("Warning: stack "^MyStack.name what^" is non-empty in Html.finalize") ; end let check_stacks () = match stacks with { s_table_inside = s_table_inside ; s_saved_inside = s_saved_inside ; s_in_math = s_in_math ; s_ncols = s_ncols ; s_empty = s_empty ; s_blank = s_blank ; s_saw_par = s_saw_par ; s_vsize = s_vsize ; s_nrows = s_nrows ; s_table_vsize = s_table_vsize ; s_nitems = s_nitems ; s_dt = s_dt ; s_dcount = s_dcount ; s_insert = s_insert ; s_insert_attr = s_insert_attr ; s_active = s_active ; s_after = s_after } -> check_stack s_table_inside ; check_stack s_saved_inside ; check_stack s_in_math ; check_stack s_ncols ; check_stack s_empty ; check_stack s_blank ; check_stack s_saw_par ; check_stack s_vsize ; check_stack s_nrows ; check_stack s_table_vsize ; check_stack s_nitems ; check_stack s_dt ; check_stack s_dcount ; check_stack s_insert ; check_stack s_insert_attr ; check_stack s_active ; check_stack s_after (* Full state saving *) type saved = flags_t * saved_stacks * saved_out let check () = let saved_flags = copy_flags flags and saved_stacks = save_stacks () and saved_out = save_out () in saved_flags, saved_stacks, saved_out and hot (f,s,o) = set_flags flags f ; restore_stacks s ; restore_out o let sbool = function true -> "true" | _ -> "false" let prerr_flags s = prerr_endline ("<"^string_of_int (MyStack.length stacks.s_empty)^"> "^s^ " empty="^sbool flags.empty^ " blank="^sbool flags.blank^ " table="^sbool flags.table_inside) let is_header = function | H1 | H2 | H3 | H4 | H5 | H6 -> true | _ -> false let is_list = function UL | DL | OL -> true | _ -> false let string_of_into = function | Some n -> "+"^string_of_int n | None -> "-" (* styles *) let trim_quotes s = (* used for ensuring colors are passed without "" *) let (i, l) = if s.[0] = '"' then (1, String.length s - 2) else (0, String.length s) in String.sub s i l (* '"' *) let size_html5 = function | 1 -> "xx-small" | 2 -> "small" | 3 -> "medium" | 4 -> "large" | 5 -> "x-large" | 6 -> "xx-large" | 7 -> "xx-large" | _ -> raise (Misc.fatal "size_html5") let do_close_mod = function | Style m -> if flags.in_math && !Parse_opts.mathml then if m="mtext" then do_put ("") else do_put "" else do_put ("") | StyleAttr (t,_) -> if flags.in_math && !Parse_opts.mathml then () else do_put ("") | (Color _ | Font _) -> if flags.in_math && !Parse_opts.mathml then do_put "" else do_put "" and do_open_mod e = if !verbose > 3 then prerr_endline ("do_open_mod: "^pretty_text e) ; match e with | Style m -> if flags.in_math && !Parse_opts.mathml then if m="mtext" then do_put ("<"^m^">") else do_put (" "font-weight: bold " | "i" -> "font-style: italic " | "tt" -> "font-family: monospace " | "em" -> "font-style: italic " | _ -> m)^ "\">") else do_put ("<"^m^">") | StyleAttr (t,a) -> if flags.in_math && !Parse_opts.mathml then () else do_put ("<"^t^" "^a^">") | Font i -> if flags.in_math && !Parse_opts.mathml then do_put ("") else (* Convert size from 1 to 7 in percentage, following standard *) do_put (sprintf "" (size_html5 i)) | Color s -> if flags.in_math && !Parse_opts.mathml then do_put ("") else do_put (sprintf "" (trim_quotes s)) let do_close_tmod = function | {here = true ; env = env} -> do_close_mod env | _ -> () let close_active_mods active = List.iter do_close_tmod active let do_close_mods () = close_active_mods !cur_out.active ; !cur_out.active <- [] ; !cur_out.pending <- [] let do_close_mods_pred pred same_constr = let tpred {env=env} = pred env in let rec split_again = function | [] -> [],None,[] | {here = false ; env=env} :: rest when same_constr env && not (pred env) -> [],Some env,rest | m :: rest -> let to_close,to_open,to_keep = split_again rest in match to_open with | Some _ -> m::to_close,to_open,to_keep | None -> to_close,to_open,m::to_keep in let rec split = function | [] -> [],None,[] | m :: rest -> let to_close,close,to_keep = split rest in match close with | None -> if tpred m then if m.here then [],Some m.env,to_keep else [],None,to_keep else [], None, m::to_keep | Some _ -> m::to_close,close,to_keep in let rec filter_pred = function | [] -> [] | x :: rest -> if pred x then filter_pred rest else x::filter_pred rest in let to_close,close,to_keep = split !cur_out.active in filter_pred (match close with | None -> [] | Some env -> List.iter do_close_tmod to_close ; do_close_mod env ; let (to_close_open,to_open,to_keep) = split_again to_keep in begin match to_open with | None -> !cur_out.active <- to_keep ; as_envs to_close [] | Some env -> !cur_out.active <- to_keep ; List.iter do_close_tmod to_close_open ; as_envs to_close (as_envs to_close_open [env]) end), close let close_mods () = do_close_mods () let is_style = function | Style _|StyleAttr (_,_) -> true | _ -> false and is_font = function Font _ -> true | _ -> false and is_color = function Color _ -> true | _ -> false let do_open_these_mods do_open_mod pending = let rec do_rec color size = function | [] -> [] | Color _ as e :: rest -> if color then let rest = do_rec true size rest in {here=false ; env=e}::rest else begin let rest = do_rec true size rest in do_open_mod e ; {here=true ; env=e}::rest end | Font _ as e :: rest -> if size then let rest = do_rec color true rest in {here=false ; env=e}::rest else let rest = do_rec color true rest in do_open_mod e ; {here=true ; env=e}::rest | e :: rest -> let rest = do_rec color size rest in do_open_mod e ; {here=true ; env=e} :: rest in do_rec false false pending let activate caller pending = let r = do_open_these_mods (fun _ -> ()) pending in if !verbose > 2 then begin prerr_string ("activate: ("^caller^")") ; pretty_mods stderr pending ; prerr_string " -> " ; pretty_tmods stderr r ; prerr_endline "" end ; r let get_top_active = function | Nothing {top_active = active} -> active | Activate {top_pending = pending ; top_active = active} -> activate "get_top_active" pending @ active | _ -> [] let all_to_pending out = try let top = get_top_lists out.top in to_pending out.pending out.active @ to_pending top.top_pending top.top_active with | Not_found -> to_pending out.pending out.active let all_to_active out = activate "all_to_active" (all_to_pending out) (* Clear styles *) let clearstyle () = close_active_mods !cur_out.active ; close_active_mods (get_top_active !cur_out.top) ; close_top 0 !cur_out ; !cur_out.pending <- [] ; !cur_out.active <- [] (* Avoid styles *) let nostyle () = clearstyle () ; !cur_out.nostyle <- true (* Create new statuses, with appropriate pending lists *) let create_status_from_top out = match out.top with | NotMe|Closed _|ActivateClosed _|Insert (_,_) -> {nostyle=out.nostyle ; pending = [] ; active = [] ; top = Nothing {top_pending = out.pending ; top_active = out.active} ; out = Out.create_buff ()} | Nothing {top_pending = top_pending ; top_active=top_active} -> assert (out.active=[]) ; {nostyle=out.nostyle ; pending = [] ; active = [] ; top = Nothing {top_pending = out.pending @ top_pending ; top_active = top_active} ; out = Out.create_buff ()} | Activate {top_pending = top_pending ; top_active=top_active} -> {nostyle=out.nostyle ; pending = [] ; active = [] ; top= Nothing {top_pending = out.pending ; top_active = out.active @ activate "top" top_pending @ top_active} ; out=Out.create_buff ()} let create_status_from_scratch nostyle pending = {nostyle=nostyle ; pending =pending ; active = [] ; top=NotMe ; out = Out.create_buff ()} let do_open_mods () = if !verbose > 2 then begin prerr_string "=> do_open_mods: " ; pretty_cur !cur_out end ; let now_active = do_open_these_mods do_open_mod !cur_out.pending in activate_top !cur_out ; !cur_out.active <- now_active @ !cur_out.active ; !cur_out.pending <- [] ; if !verbose > 2 then begin prerr_string "<= do_open_mods: " ; pretty_cur !cur_out end let do_pending () = do_open_mods () let one_cur_size pending active = let rec cur_size_active = function | [] -> raise Not_found | {here=true ; env=Font i}::_ -> i | _::rest -> cur_size_active rest in let rec cur_size_pending = function | [] -> cur_size_active active | Font i::_ -> i | _::rest -> cur_size_pending rest in cur_size_pending pending let cur_size out = try one_cur_size out.pending out.active with Not_found -> try let top_out = get_top_lists out.top in one_cur_size top_out.top_pending top_out.top_active with Not_found -> 3 let one_first_same x same_constr pending active = let rec same_active = function | {here=true ; env=y} :: rest -> if same_constr y then x=y else same_active rest | _::rest -> same_active rest | [] -> raise Not_found in let rec same_pending = function | [] -> same_active active | y::rest -> if same_constr y then x=y else same_pending rest in same_pending pending let first_same x same_constr out = try one_first_same x same_constr out.pending out.active with Not_found -> try let top_out = get_top_lists out.top in one_first_same x same_constr top_out.top_pending top_out.top_active with | Not_found -> false let already_here = function | Font i -> i = cur_size !cur_out | x -> first_same x (match x with Style _|StyleAttr (_,_) -> is_style | Font _ -> is_font | Color _ -> is_color) !cur_out let ok_pre x = match x with | Color _ | Font _ | Style "sub" | Style "sup" -> not !Parse_opts.pedantic | _ -> true let rec filter_pre = function [] -> [] | e::rest -> if ok_pre e then e::filter_pre rest else filter_pre rest let ok_mod e = (not flags.in_pre || ok_pre e) && (not (already_here e)) let get_fontsize () = cur_size !cur_out let rec erase_rec pred = function [] -> None | s::rest -> if pred s then Some rest else match erase_rec pred rest with | Some rest -> Some (s::rest) | None -> None let erase_mod_pred pred same_constr = if not !cur_out.nostyle then begin match erase_rec pred !cur_out.pending with | Some pending -> !cur_out.pending <- pending | None -> let re_open,closed = do_close_mods_pred pred same_constr in match closed with | Some _ -> !cur_out.pending <- !cur_out.pending @ re_open | None -> activate_top !cur_out ; try let tops = get_top_lists !cur_out.top in !cur_out.active <- !cur_out.active @ activate "erase" tops.top_pending @ tops.top_active ; close_top 0 !cur_out ; let re_open,_ = do_close_mods_pred pred same_constr in !cur_out.pending <- !cur_out.pending @ re_open with | Not_found -> () end let same_env = function | Style s1 -> (function | Style s2 -> s1 = s2 | _ -> false) | StyleAttr (t1,a1) -> (function | StyleAttr (t2,a2)-> t1 = t2 && a1=a2 | _ -> false) | Font i1 -> (function | Font i2 -> i1 = i2 | _ -> false) | Color s1 -> (function | Color s2 -> s1 = s2 | _ -> false) and same_constr = function | Color _ -> is_color | Font _ -> is_font | Style _|StyleAttr (_,_) -> is_style let erase_mods ms = let rec erase_rec = function | [] -> () | m :: ms -> erase_mod_pred (same_env m) (same_constr m) ; erase_rec ms in erase_rec ms let open_mod m = if not !cur_out.nostyle then begin if !verbose > 3 then begin prerr_endline ("=> open_mod: "^pretty_text m^" ok="^sbool (ok_mod m)) ; pretty_cur !cur_out end ; begin match m with | Style "em" -> if already_here m then erase_mods [m] else !cur_out.pending <- m :: !cur_out.pending | _ -> if ok_mod m then begin !cur_out.pending <- m :: !cur_out.pending end end ; if !verbose > 3 then begin prerr_endline ("<= open_mod: "^pretty_text m) ; pretty_cur !cur_out end ; end let rec open_mods = function m::rest -> open_mods rest ; open_mod m | [] -> () let has_mod m = already_here m (* Blocks *) let pstart = function | H1 | H2 | H3 | H4 | H5 | H6 | PRE | DIV | BLOCKQUOTE | UL | OL | DL | TABLE -> true | _ -> false let transmit_par s = match s with | GROUP|AFTER|INTERN|DFLOW|P|LI -> false | _ -> true let is_group = function | GROUP -> true | _ -> false and transmit_par_or_par = function | P -> true | s -> transmit_par s and is_pre = function | PRE -> true | _ -> false let rec do_try_open_block s = if !verbose > 2 then prerr_flags ("=> try open '"^string_of_block s^"'"); begin match s with | DISPLAY _ -> do_try_open_block TABLE ; do_try_open_block TR | _ -> push stacks.s_empty flags.empty ; push stacks.s_blank flags.blank ; push stacks.s_insert flags.insert ; push stacks.s_saw_par flags.saw_par ; flags.empty <- true ; flags.blank <- true ; flags.insert <- None ; flags.saw_par <- false ; begin match s with | PRE -> flags.in_pre <- true (* No stack, cannot nest *) | TABLE -> push stacks.s_table_vsize flags.table_vsize ; push stacks.s_vsize flags.vsize ; push stacks.s_nrows flags.nrows ; flags.table_vsize <- 0 ; flags.vsize <- 0 ; flags.nrows <- 0 | TR -> flags.vsize <- 1 | TD -> push stacks.s_vsize flags.vsize ; flags.vsize <- 1 | _ -> if is_list s then begin push stacks.s_nitems flags.nitems; flags.nitems <- 0 ; if s = DL then begin push stacks.s_dt flags.dt ; push stacks.s_dcount flags.dcount; flags.dt <- ""; flags.dcount <- "" end end end end ; if !verbose > 2 then prerr_flags ("<= try open '"^string_of_block s^"'") let try_open_block s _ = push stacks.s_insert_attr flags.insert_attr ; begin match flags.insert_attr with | Some (TR,_) when s <> TR -> () | _ -> flags.insert_attr <- None end ; do_try_open_block s let do_do_open_block s args = do_put_char '<' ; do_put (string_of_block s) ; if args <> "" then begin if args.[0] <> ' ' then do_put_char ' ' ; do_put args end ; do_put_char '>' let rec do_open_block insert s args = match s with | GROUP|DELAY|FORGET|AFTER|INTERN|DFLOW -> begin match insert with | Some (tag,iargs) -> do_do_open_block tag iargs | _ -> () end | DISPLAY centering -> do_open_block insert TABLE (display_arg centering !verbose) ; do_open_block None TR args | _ -> begin match insert with | Some (tag,iargs) -> if is_list s || s = TABLE || s = P then begin do_do_open_block tag iargs ; do_do_open_block s args end else begin do_do_open_block s args ; do_do_open_block tag iargs end | _ -> do_do_open_block s args end let rec do_try_close_block s = if !verbose > 2 then prerr_flags ("=> try close '"^string_of_block s^"'") ; begin match s with | DISPLAY _ -> do_try_close_block TR ; do_try_close_block TABLE | _ -> let ehere = flags.empty and ethere = pop stacks.s_empty in flags.empty <- (ehere && ethere) ; let bhere = flags.blank and bthere = pop stacks.s_blank in flags.blank <- (bhere && bthere) ; flags.insert <- pop stacks.s_insert ; flags.saw_par <- pop stacks.s_saw_par ; begin match s with | PRE -> flags.in_pre <- false (* PRE cannot nest *) | TABLE -> let p_vsize = pop stacks.s_vsize in flags.vsize <- max (flags.table_vsize + (flags.nrows+1)/3) p_vsize ; flags.nrows <- pop stacks.s_nrows ; flags.table_vsize <- pop stacks.s_table_vsize | TR -> if ehere then begin flags.vsize <- 0 end ; flags.table_vsize <- flags.table_vsize + flags.vsize; if not ehere then flags.nrows <- flags.nrows + 1 | TD -> let p_vsize = pop stacks.s_vsize in flags.vsize <- max p_vsize flags.vsize | _ -> if is_list s then begin flags.nitems <- pop stacks.s_nitems ; if s = DL then begin flags.dt <- pop stacks.s_dt ; flags.dcount <- pop stacks.s_dcount end end end end ; if !verbose > 2 then prerr_flags ("<= try close '"^string_of_block s^"'") let try_close_block s = begin match flags.insert_attr with | Some (tag,_) when tag = s -> flags.insert_attr <- pop stacks.s_insert_attr | _ -> match pop stacks.s_insert_attr with | None -> () | Some (_,_) as x -> flags.insert_attr <- x end ; do_try_close_block s let do_do_close_block s = do_put "' ; match s with TR -> do_put_char '\n' | _ -> () let rec do_close_block insert s = match s with | GROUP|DELAY|FORGET|AFTER|INTERN|DFLOW -> begin match insert with | Some (tag,_) -> do_do_close_block tag | _ -> () end | DISPLAY _ -> do_close_block None TR ; do_close_block insert TABLE | s -> begin match insert with | Some (tag,_) -> if is_list s || s = TABLE || s = P then begin do_do_close_block s; do_do_close_block tag end else begin do_do_close_block tag; do_do_close_block s end | _ -> do_do_close_block s end let check_empty () = flags.empty and make_empty () = flags.empty <- true ; flags.blank <- true ; flags.table_inside <- false ; !cur_out.top <- NotMe ; !cur_out.pending <- to_pending !cur_out.pending !cur_out.active ; !cur_out.active <- [] let check_blank () = flags.blank let no_check () = false let rec open_top_styles = function | NotMe|Insert (_,_) -> (* Real block, inserted block *) begin match !cur_out.top with | Nothing tops -> let mods = to_pending !cur_out.pending !cur_out.active @ to_pending tops.top_pending tops.top_active in assert (!cur_out.active=[]) ; close_active_mods tops.top_active ; !cur_out.top <- Closed (tops,Out.get_pos !cur_out.out); Some mods | Activate tops -> !cur_out.top <- ActivateClosed tops ; let mods = to_pending !cur_out.pending !cur_out.active @ to_pending tops.top_pending tops.top_active in close_active_mods !cur_out.active ; close_active_mods (activate "open_top_styles" tops.top_pending) ; close_active_mods tops.top_active ; Some mods | _ -> let mods = to_pending !cur_out.pending !cur_out.active in close_active_mods !cur_out.active ; Some mods end | Closed (_,n) -> (* Group that closed top_styles (all of them) *) let out = !cur_out in let mods = all_to_pending out in close_top n out ; Some mods | Nothing _ -> (* Group with nothing to do *) None | Activate _ -> (* Just activate styles *) do_open_mods () ; None | ActivateClosed tops -> do_open_mods () ; let r = open_top_styles (Closed (tops,Out.get_pos !cur_out.out)) in r let rec force_block s content = if !verbose > 2 then begin prerr_endline ("=> force_block: ["^string_of_block s^"]"); pretty_stack out_stack ; pretty_cur !cur_out ; Out.debug stderr !cur_out.out ; prerr_newline () end ; let pempty = top stacks.s_empty in if s = FORGET then begin make_empty () ; end else begin begin match s with | TABLE|DISPLAY _ -> flags.table_inside <- true | _ -> () end ; if flags.empty then begin flags.empty <- false; flags.blank <- false ; do_open_mods () ; do_put content end ; (* check pending display material in DFLOW More precisely * closed block s, has a table inside * previous block is DFLOW, with some pending material (pempty = false) A Freeze can be present, then the previous block is DFLOW Then, we need to flush the pending material... *) if not pempty && flags.table_inside then begin let p2 = p2block () in match p2 with | (Normal (DFLOW,_,_)) | Freeze _ -> let _,_,pout = top_out out_stack in if !verbose > 2 then begin Printf.eprintf "CLOSING: '%s': " (string_of_block s) ; Out.debug stderr pout.out ; pretty_stack out_stack ; prerr_endline "" end ; let saved_flags = copy_flags flags in try_close_block s ; let a,b,pout = pop_out out_stack in let saved_out = !cur_out in cur_out := pout ; let fo = match p2 with | Normal (_,_,_) -> force_block DFLOW "" ; None | Freeze f -> let _ = pop out_stack in force_block DFLOW "" ; Some (f) in let _,args,_ = top_out out_stack in force_block TD "" ; open_block TD args ; open_block DFLOW "" ; begin match fo with | Some f -> push out_stack (Freeze f) | None -> () end ; push_out out_stack (a,b,!cur_out) ; try_open_block s b ; cur_out := saved_out ; set_flags flags saved_flags ; flags.ncols <- flags.ncols + 1 | _ -> () end else if !verbose > 2 && not pempty && flags.table_inside then begin Printf.eprintf "NOT CLOSING: '%s': " (string_of_block s) ; pretty_stack out_stack ; let _,_,pout = top_out out_stack in Out.debug stderr pout.out ; prerr_newline () end end ; let true_s = if s = FORGET then pblock() else s in let insert = flags.insert and insert_attr = flags.insert_attr and was_top = !cur_out.top in do_close_mods () ; try_close_block true_s ; do_close_block insert true_s ; let ps,args,pout = pop_out out_stack in check_block_closed ps true_s ; let old_out = !cur_out in cur_out := pout ; if s = FORGET then () else if ps <> DELAY then begin let mods = open_top_styles was_top in do_open_block insert ps (match insert_attr with | Some (this_tag,attr) when this_tag = s -> args^" "^attr | _ -> args) ; begin match was_top with | Insert (_,mods) -> ignore (do_open_these_mods do_open_mod mods) | _ -> () end ; (* prerr_endline "****** NOW *******" ; pretty_cur !cur_out ; Out.debug stderr old_out.out ; prerr_endline "\n**********" ; *) if ps = AFTER then begin let f = pop stacks.s_after in Out.copy_fun f old_out.out !cur_out.out end else begin Out.copy old_out.out !cur_out.out end ; begin match mods with | Some mods -> !cur_out.active <- [] ; !cur_out.pending <- mods | _ -> () end end else begin (* ps = DELAY *) raise (Misc.Fatal ("html: unflushed DELAY")) end ; if !verbose > 2 then begin prerr_endline ("<= force_block: ["^string_of_block s^"]"); pretty_cur !cur_out end and close_block_loc pred s = if !verbose > 2 then prerr_string ("close_block_loc: '"^string_of_block s^"' = "); if not (pred ()) then begin if !verbose > 2 then prerr_endline "do it" ; force_block s ""; true end else begin if !verbose > 2 then prerr_endline "forget it" ; force_block FORGET ""; false end and open_block s args = if !verbose > 2 then begin prerr_endline ("=> open_block '"^string_of_block s^"'"^" arg="^args); pretty_cur !cur_out ; end ; push_out out_stack (s,args,!cur_out) ; cur_out := begin if false && is_group s then create_status_from_top !cur_out else create_status_from_scratch !cur_out.nostyle (let cur_mods = all_to_pending !cur_out in if flags.in_pre || is_pre s then filter_pre cur_mods else cur_mods) end ; try_open_block s args ; if !verbose > 2 then begin prerr_endline ("<= open_block '"^string_of_block s^"'"); pretty_cur !cur_out ; end and close_flow_loc check_empty s = if !verbose > 2 then prerr_endline ("close_flow_loc: "^string_of_block s) ; let active = !cur_out.active and pending = !cur_out.pending in if close_block_loc check_empty s then begin !cur_out.pending <- to_pending pending active ; true end else begin !cur_out.pending <- to_pending pending active ; false end let close_flow s = assert (s <> GROUP) ; if !verbose > 2 then prerr_flags ("=> close_flow '"^string_of_block s^"'"); let _ = close_flow_loc check_empty s in if !verbose > 2 then prerr_flags ("<= close_flow '"^string_of_block s^"'") let insert_block tag arg = begin match !cur_out.top with | Nothing {top_pending=pending ; top_active=active} -> !cur_out.pending <- !cur_out.pending @ to_pending pending active ; assert (!cur_out.active = []) ; !cur_out.top <- Insert (false,[]) | Activate {top_pending=pending ; top_active=active} -> let add_active = activate "insert_block" pending @ active in !cur_out.active <- !cur_out.active @ add_active ; !cur_out.top <- Insert (true,to_pending [] add_active) | Closed (_,n) -> Out.erase_start n !cur_out.out ; !cur_out.top <- Insert (false,[]) | ActivateClosed {top_active=active ; top_pending=pending}-> !cur_out.top <- Insert (false,to_pending pending active) | NotMe | Insert _ -> () end ; flags.insert <- Some (tag,arg) let insert_attr tag attr = match tag,flags.insert_attr with | TD, Some (TR,_) -> () | _, _ -> flags.insert_attr <- Some (tag,attr) let close_block s = let _ = close_block_loc check_empty s in () let erase_block s = if !verbose > 2 then begin Printf.fprintf stderr "erase_block: %s" (string_of_block s); prerr_newline () end ; try_close_block s ; let ts,_,tout = pop_out out_stack in if ts <> s then failclose "erase_block" s ts; cur_out := tout let open_group ss = let e = Style ss in if no_opt || (ss <> "" && (not flags.in_pre || (ok_pre e))) then begin open_block INTERN "" ; if ss <> "" then !cur_out.pending <- !cur_out.pending @ [e] end else open_block GROUP "" and open_aftergroup f = open_block AFTER "" ; flags.empty <- false ; push stacks.s_after f and close_group () = match pblock () with | INTERN -> close_block INTERN | DFLOW -> close_block DFLOW | AFTER -> force_block AFTER "" | _ -> close_block GROUP and erase_group () = match pblock () with | INTERN -> erase_block INTERN | DFLOW -> erase_block DFLOW | AFTER -> erase_block AFTER | _ -> erase_block GROUP (* output requests *) let is_blank = function | ' ' | '\n' -> true | _ -> false let put s = let block = pblock () in match block with | TABLE|TR -> () | _ -> let s_blank = let r = ref true in for i = 0 to String.length s - 1 do r := !r && is_blank (String.unsafe_get s i) done ; !r in do_pending () ; flags.empty <- false; flags.blank <- s_blank && flags.blank ; do_put s let put_char c = let s = pblock () in match s with | TABLE|TR -> () | _ -> let c_blank = is_blank c in do_pending () ; flags.empty <- false; flags.blank <- c_blank && flags.blank ; do_put_char c let flush_out () = Out.flush !cur_out.out let skip_line () = flags.vsize <- flags.vsize + 1 ; put "
\n" let put_length which = function | Pixel x -> put (which^string_of_int x) | Char x -> put (which^string_of_int (Length.font * x)) | Percent x -> put (which ^ string_of_int x ^ "%") | Default -> () | No s -> raise (Misc.Fatal ("No-length '"^s^"' in outManager")) let horizontal_line attr width height = open_block GROUP "" ; nostyle () ; put " () | _ -> put_char ' ' ; put attr end ; begin match width,height with | Default,Default -> put_char '>' | _,_ -> put " style=\""; put_length "width:" width; if width <> Default then put ";"; put_length "height:" height; put "\">" end ; close_block GROUP let line_in_table () = (* put "
" ; *) put "
" ; flags.vsize <- flags.vsize - 1 let freeze f = push out_stack (Freeze f) ; if !verbose > 2 then begin prerr_string "freeze: stack=" ; pretty_stack out_stack end let flush_freeze () = match top out_stack with Freeze f -> let _ = pop out_stack in if !verbose > 2 then begin prerr_string "flush_freeze" ; pretty_stack out_stack end ; f () ; true | _ -> false let pop_freeze () = match top out_stack with Freeze f -> let _ = pop out_stack in f,true | _ -> (fun () -> ()),false let try_open_display () = push stacks.s_ncols flags.ncols ; push stacks.s_table_inside flags.table_inside ; push stacks.s_saved_inside false ; flags.table_inside <- false ; flags.ncols <- 0 and try_close_display () = flags.ncols <- pop stacks.s_ncols ; flags.table_inside <- pop stacks.s_saved_inside || flags.table_inside ; flags.table_inside <- pop stacks.s_table_inside || flags.table_inside let get_block s args = if !verbose > 2 then begin prerr_flags "=> get_block"; end ; do_close_mods () ; let pempty = top stacks.s_empty and pblank = top stacks.s_blank and pinsert = top stacks.s_insert in try_close_block (pblock ()) ; flags.empty <- pempty ; flags.blank <- pblank ; flags.insert <- pinsert; do_close_block None s ; let _,_,pout = pop_out out_stack in let old_out = !cur_out in cur_out := with_new_out pout ; let mods = as_envs !cur_out.active !cur_out.pending in do_close_mods () ; do_open_block None s args ; Out.copy old_out.out !cur_out.out ; !cur_out.pending <- mods ; let r = !cur_out in cur_out := pout ; if !verbose > 2 then begin Out.debug stderr r.out ; prerr_endline ""; prerr_flags "<= get_block" end ; r let hidden_to_string f = (* prerr_string "to_string: " ; Out.debug stderr !cur_out.out ; prerr_endline "" ; *) let old_flags = copy_flags flags in open_block INTERN "" ; f () ; do_close_mods () ; let flags_now = copy_flags flags in let r = Out.to_string !cur_out.out in flags.empty <- true ; close_block INTERN ; set_flags flags old_flags ; r,flags_now let to_string f = let r,_ = hidden_to_string f in r hevea-2.23/.depend0000644004317100512160000002762110565402214014025 0ustar marangetcristalesp.cmi: ./emisc.cmi explode.cmi: ./tree.cmi ./lexeme.cmi ./htmltext.cmi get.cmi: ./lexstate.cmi ./length.cmi htmllex.cmi: ./lexeme.cmi ./emisc.cmi ./css.cmi html.cmi: ./tabular.cmi ./outUnicode.cmi ./out.cmi ./lexstate.cmi \ ./length.cmi ./element.cmi htmlparse.cmi: ./tree.cmi ./lexeme.cmi ./emisc.cmi htmltext.cmi: ./lexeme.cmi info.cmi: ./tabular.cmi ./outUnicode.cmi ./out.cmi ./lexstate.cmi \ ./length.cmi ./element.cmi latexmacros.cmi: ./lexstate.cmi latexscan.cmi: ./outManager.cmi ./lexstate.cmi ./imageManager.cmi lexstate.cmi: ./myStack.cmi ./misc.cmi outManager.cmi: ./tabular.cmi ./outUnicode.cmi ./out.cmi ./lexstate.cmi \ ./length.cmi ./element.cmi package.cmi: ./outManager.cmi ./latexscan.cmi ./imageManager.cmi pp.cmi: ./tree.cmi ./lexeme.cmi ./htmltext.cmi ./css.cmi save.cmi: ./misc.cmi subst.cmi: ./lexstate.cmi tabular.cmi: ./lexstate.cmi ./length.cmi text.cmi: ./tabular.cmi ./outUnicode.cmi ./out.cmi ./lexstate.cmi \ ./length.cmi ./element.cmi ultra.cmi: ./tree.cmi ./lexeme.cmi util.cmi: ./tree.cmi ./htmltext.cmi verb.cmi: ./outManager.cmi ./latexscan.cmi ./imageManager.cmi videoc.cmi: ./outManager.cmi ./latexscan.cmi ./imageManager.cmi zyva.cmi: ./outManager.cmi ./latexscan.cmi ./imageManager.cmi auxx.cmo: ./parse_opts.cmi ./mysys.cmi ./misc.cmi auxx.cmi auxx.cmx: ./parse_opts.cmx ./mysys.cmx ./misc.cmx auxx.cmi buff.cmo: buff.cmi buff.cmx: buff.cmi color.cmo: ./misc.cmi ./colscan.cmi color.cmi color.cmx: ./misc.cmx ./colscan.cmx color.cmi colscan.cmo: ./out.cmi colscan.cmi colscan.cmx: ./out.cmx colscan.cmi counter.cmo: ./misc.cmi ./latexmacros.cmi counter.cmi counter.cmx: ./misc.cmx ./latexmacros.cmx counter.cmi cross.cmo: ./location.cmi cross.cmi cross.cmx: ./location.cmx cross.cmi cut.cmo: ./thread.cmi ./section.cmi ./save.cmi ./myStack.cmi ./misc.cmi \ ./cutOut.cmi ./cross.cmi cut.cmi cut.cmx: ./thread.cmx ./section.cmx ./save.cmx ./myStack.cmx ./misc.cmx \ ./cutOut.cmx ./cross.cmx cut.cmi cutOut.cmo: ./out.cmi cutOut.cmi cutOut.cmx: ./out.cmx cutOut.cmi element.cmo: element.cmi element.cmx: element.cmi emisc.cmo: emisc.cmi emisc.cmx: emisc.cmi entry.cmo: ./save.cmi ./out.cmi entry.cmi entry.cmx: ./save.cmx ./out.cmx entry.cmi esp.cmo: ./ultra.cmi ./pp.cmi ./mysys.cmi ./location.cmi ./htmlparse.cmi \ ./htmllex.cmi ./explode.cmi ./emisc.cmi esp.cmi esp.cmx: ./ultra.cmx ./pp.cmx ./mysys.cmx ./location.cmx ./htmlparse.cmx \ ./htmllex.cmx ./explode.cmx ./emisc.cmx esp.cmi esponja.cmo: ./mysys.cmi ./esp.cmi ./emisc.cmi esponja.cmx: ./mysys.cmx ./esp.cmx ./emisc.cmx explode.cmo: ./util.cmi ./tree.cmi ./lexeme.cmi ./htmltext.cmi explode.cmi explode.cmx: ./util.cmx ./tree.cmi ./lexeme.cmi ./htmltext.cmx explode.cmi foot.cmo: ./section.cmi ./parse_opts.cmi ./myStack.cmi ./misc.cmi foot.cmi foot.cmx: ./section.cmx ./parse_opts.cmx ./myStack.cmx ./misc.cmx foot.cmi get.cmo: ./parse_opts.cmi ./myfiles.cmi ./myStack.cmi ./misc.cmi \ ./lexstate.cmi ./length.cmi ./latexmacros.cmi ./counter.cmi get.cmi get.cmx: ./parse_opts.cmx ./myfiles.cmx ./myStack.cmx ./misc.cmx \ ./lexstate.cmx ./length.cmx ./latexmacros.cmx ./counter.cmx get.cmi hacha.cmo: ./version.cmi ./mysys.cmi ./mylib.cmi ./misc.cmi ./location.cmi \ ./cut.cmi ./cross.cmi hacha.cmx: ./version.cmx ./mysys.cmx ./mylib.cmx ./misc.cmx ./location.cmx \ ./cut.cmx ./cross.cmx hevea.cmo: ./zyva.cmi ./videoc.cmi ./verb.cmi ./text.cmi ./tabular.cmi \ ./save.cmi ./parse_opts.cmi ./package.cmi ./noimage.cmi ./mysys.cmi \ ./mylib.cmi ./myfiles.cmi ./myStack.cmi ./misc.cmi ./location.cmi \ ./lexstate.cmi ./latexscan.cmi ./infoRef.cmo ./info.cmi ./index.cmi \ ./image.cmi ./html.cmi ./hot.cmi ./get.cmi ./esp.cmi ./emisc.cmi \ ./colscan.cmi ./auxx.cmi hevea.cmx: ./zyva.cmx ./videoc.cmx ./verb.cmx ./text.cmx ./tabular.cmx \ ./save.cmx ./parse_opts.cmx ./package.cmx ./noimage.cmx ./mysys.cmx \ ./mylib.cmx ./myfiles.cmx ./myStack.cmx ./misc.cmx ./location.cmx \ ./lexstate.cmx ./latexscan.cmx ./infoRef.cmx ./info.cmx ./index.cmx \ ./image.cmx ./html.cmx ./hot.cmx ./get.cmx ./esp.cmx ./emisc.cmx \ ./colscan.cmx ./auxx.cmx hot.cmo: ./parse_opts.cmi ./misc.cmi ./lexstate.cmi ./latexmacros.cmi \ ./infoRef.cmo ./foot.cmi ./counter.cmi ./color.cmi hot.cmi hot.cmx: ./parse_opts.cmx ./misc.cmx ./lexstate.cmx ./latexmacros.cmx \ ./infoRef.cmx ./foot.cmx ./counter.cmx ./color.cmx hot.cmi htmlCommon.cmo: ./parse_opts.cmi ./out.cmi ./myStack.cmi ./misc.cmi \ ./length.cmi ./latexmacros.cmi ./element.cmi htmlCommon.cmx: ./parse_opts.cmx ./out.cmx ./myStack.cmx ./misc.cmx \ ./length.cmx ./latexmacros.cmx ./element.cmx htmllex.cmo: ./myStack.cmi ./location.cmi ./lexeme.cmi ./emisc.cmi ./css.cmi \ ./buff.cmi htmllex.cmi htmllex.cmx: ./myStack.cmx ./location.cmx ./lexeme.cmi ./emisc.cmx ./css.cmi \ ./buff.cmx htmllex.cmi htmlMath.cmo: ./parse_opts.cmi ./out.cmi ./myStack.cmi ./misc.cmi \ ./lexstate.cmi ./htmlCommon.cmo ./element.cmi htmlMath.cmx: ./parse_opts.cmx ./out.cmx ./myStack.cmx ./misc.cmx \ ./lexstate.cmx ./htmlCommon.cmx ./element.cmx html.cmo: ./tabular.cmi ./parse_opts.cmi ./outUnicode.cmi ./out.cmi \ ./myStack.cmi ./misc.cmi ./mathML.cmo ./lexstate.cmi ./length.cmi \ ./latexmacros.cmi ./htmlMath.cmo ./htmlCommon.cmo html.cmi html.cmx: ./tabular.cmx ./parse_opts.cmx ./outUnicode.cmx ./out.cmx \ ./myStack.cmx ./misc.cmx ./mathML.cmx ./lexstate.cmx ./length.cmx \ ./latexmacros.cmx ./htmlMath.cmx ./htmlCommon.cmx html.cmi htmlparse.cmo: ./tree.cmi ./lexeme.cmi ./htmllex.cmi ./emisc.cmi ./css.cmi \ ./buff.cmi htmlparse.cmi htmlparse.cmx: ./tree.cmi ./lexeme.cmi ./htmllex.cmx ./emisc.cmx ./css.cmi \ ./buff.cmx htmlparse.cmi htmltext.cmo: ./lexeme.cmi ./emisc.cmi htmltext.cmi htmltext.cmx: ./lexeme.cmi ./emisc.cmx htmltext.cmi image.cmo: ./parse_opts.cmi ./out.cmi ./mysys.cmi ./myfiles.cmi ./myStack.cmi \ ./misc.cmi ./location.cmi image.cmi image.cmx: ./parse_opts.cmx ./out.cmx ./mysys.cmx ./myfiles.cmx ./myStack.cmx \ ./misc.cmx ./location.cmx image.cmi index.cmo: ./table.cmi ./parse_opts.cmi ./out.cmi ./mysys.cmi ./misc.cmi \ ./entry.cmi index.cmi index.cmx: ./table.cmx ./parse_opts.cmx ./out.cmx ./mysys.cmx ./misc.cmx \ ./entry.cmx index.cmi info.cmo: ./text.cmi ./parse_opts.cmi ./mysys.cmi ./misc.cmi ./infoRef.cmo \ info.cmi info.cmx: ./text.cmx ./parse_opts.cmx ./mysys.cmx ./misc.cmx ./infoRef.cmx \ info.cmi infoRef.cmo: ./text.cmi ./parse_opts.cmi ./out.cmi ./mysys.cmi ./misc.cmi infoRef.cmx: ./text.cmx ./parse_opts.cmx ./out.cmx ./mysys.cmx ./misc.cmx latexmacros.cmo: ./parse_opts.cmi ./myStack.cmi ./misc.cmi ./lexstate.cmi \ latexmacros.cmi latexmacros.cmx: ./parse_opts.cmx ./myStack.cmx ./misc.cmx ./lexstate.cmx \ latexmacros.cmi latexscan.cmo: ./tabular.cmi ./subst.cmi ./save.cmi ./parse_opts.cmi \ ./outUnicode.cmi ./outManager.cmi ./out.cmi ./mysys.cmi ./mylib.cmi \ ./myfiles.cmi ./myStack.cmi ./misc.cmi ./location.cmi ./lexstate.cmi \ ./length.cmi ./latexmacros.cmi ./imageManager.cmi ./hot.cmi ./get.cmi \ ./foot.cmi ./element.cmi ./counter.cmi ./auxx.cmi latexscan.cmi latexscan.cmx: ./tabular.cmx ./subst.cmx ./save.cmx ./parse_opts.cmx \ ./outUnicode.cmx ./outManager.cmi ./out.cmx ./mysys.cmx ./mylib.cmx \ ./myfiles.cmx ./myStack.cmx ./misc.cmx ./location.cmx ./lexstate.cmx \ ./length.cmx ./latexmacros.cmx ./imageManager.cmi ./hot.cmx ./get.cmx \ ./foot.cmx ./element.cmx ./counter.cmx ./auxx.cmx latexscan.cmi length.cmo: length.cmi length.cmx: length.cmi lexstate.cmo: ./save.cmi ./parse_opts.cmi ./myfiles.cmi ./myStack.cmi \ ./misc.cmi ./location.cmi lexstate.cmi lexstate.cmx: ./save.cmx ./parse_opts.cmx ./myfiles.cmx ./myStack.cmx \ ./misc.cmx ./location.cmx lexstate.cmi location.cmo: ./myStack.cmi location.cmi location.cmx: ./myStack.cmx location.cmi mathML.cmo: ./parse_opts.cmi ./out.cmi ./myStack.cmi ./misc.cmi \ ./lexstate.cmi ./latexmacros.cmi ./htmlCommon.cmo ./element.cmi mathML.cmx: ./parse_opts.cmx ./out.cmx ./myStack.cmx ./misc.cmx \ ./lexstate.cmx ./latexmacros.cmx ./htmlCommon.cmx ./element.cmx misc.cmo: ./location.cmi misc.cmi misc.cmx: ./location.cmx misc.cmi myfiles.cmo: ./parse_opts.cmi ./mylib.cmi ./misc.cmi myfiles.cmi myfiles.cmx: ./parse_opts.cmx ./mylib.cmx ./misc.cmx myfiles.cmi mylib.cmo: mylib.cmi mylib.cmx: mylib.cmi myStack.cmo: myStack.cmi myStack.cmx: myStack.cmi mysys.cmo: mysys.cmi mysys.cmx: mysys.cmi noimage.cmo: noimage.cmi noimage.cmx: noimage.cmi out.cmo: ./misc.cmi out.cmi out.cmx: ./misc.cmx out.cmi outUnicode.cmo: ./parse_opts.cmi ./myfiles.cmi ./misc.cmi outUnicode.cmi outUnicode.cmx: ./parse_opts.cmx ./myfiles.cmx ./misc.cmx outUnicode.cmi package.cmo: ./version.cmi ./subst.cmi ./save.cmi ./parse_opts.cmi \ ./outUnicode.cmi ./outManager.cmi ./mylib.cmi ./myStack.cmi ./misc.cmi \ ./lexstate.cmi ./latexscan.cmi ./latexmacros.cmi ./index.cmi \ ./imageManager.cmi ./get.cmi ./counter.cmi ./color.cmi ./auxx.cmi \ package.cmi package.cmx: ./version.cmx ./subst.cmx ./save.cmx ./parse_opts.cmx \ ./outUnicode.cmx ./outManager.cmi ./mylib.cmx ./myStack.cmx ./misc.cmx \ ./lexstate.cmx ./latexscan.cmx ./latexmacros.cmx ./index.cmx \ ./imageManager.cmi ./get.cmx ./counter.cmx ./color.cmx ./auxx.cmx \ package.cmi parse_opts.cmo: ./version.cmi ./mylib.cmi ./misc.cmi ./location.cmi \ parse_opts.cmi parse_opts.cmx: ./version.cmx ./mylib.cmx ./misc.cmx ./location.cmx \ parse_opts.cmi pp.cmo: ./tree.cmi ./lexeme.cmi ./htmltext.cmi ./css.cmi pp.cmi pp.cmx: ./tree.cmi ./lexeme.cmi ./htmltext.cmx ./css.cmi pp.cmi save.cmo: ./out.cmi ./misc.cmi save.cmi save.cmx: ./out.cmx ./misc.cmx save.cmi section.cmo: ./misc.cmi section.cmi section.cmx: ./misc.cmx section.cmi subst.cmo: ./save.cmi ./out.cmi ./misc.cmi ./lexstate.cmi subst.cmi subst.cmx: ./save.cmx ./out.cmx ./misc.cmx ./lexstate.cmx subst.cmi table.cmo: table.cmi table.cmx: table.cmi tabular.cmo: ./table.cmi ./subst.cmi ./parse_opts.cmi ./myStack.cmi \ ./misc.cmi ./lexstate.cmi ./length.cmi ./latexmacros.cmi ./get.cmi \ tabular.cmi tabular.cmx: ./table.cmx ./subst.cmx ./parse_opts.cmx ./myStack.cmx \ ./misc.cmx ./lexstate.cmx ./length.cmx ./latexmacros.cmx ./get.cmx \ tabular.cmi text.cmo: ./tabular.cmi ./table.cmi ./parse_opts.cmi ./outUnicode.cmi \ ./out.cmi ./myStack.cmi ./misc.cmi ./lexstate.cmi ./length.cmi \ ./latexmacros.cmi ./element.cmi text.cmi text.cmx: ./tabular.cmx ./table.cmx ./parse_opts.cmx ./outUnicode.cmx \ ./out.cmx ./myStack.cmx ./misc.cmx ./lexstate.cmx ./length.cmx \ ./latexmacros.cmx ./element.cmx text.cmi thread.cmo: thread.cmi thread.cmx: thread.cmi ultra.cmo: ./util.cmi ./tree.cmi ./pp.cmi ./htmltext.cmi ./htmllex.cmi \ ./explode.cmi ./emisc.cmi ultra.cmi ultra.cmx: ./util.cmx ./tree.cmi ./pp.cmx ./htmltext.cmx ./htmllex.cmx \ ./explode.cmx ./emisc.cmx ultra.cmi util.cmo: ./tree.cmi ./htmltext.cmi util.cmi util.cmx: ./tree.cmi ./htmltext.cmx util.cmi verb.cmo: ./subst.cmi ./save.cmi ./parse_opts.cmi ./outManager.cmi ./out.cmi \ ./myfiles.cmi ./myStack.cmi ./misc.cmi ./location.cmi ./lexstate.cmi \ ./latexscan.cmi ./latexmacros.cmi ./imageManager.cmi ./get.cmi \ ./counter.cmi verb.cmi verb.cmx: ./subst.cmx ./save.cmx ./parse_opts.cmx ./outManager.cmi ./out.cmx \ ./myfiles.cmx ./myStack.cmx ./misc.cmx ./location.cmx ./lexstate.cmx \ ./latexscan.cmx ./latexmacros.cmx ./imageManager.cmi ./get.cmx \ ./counter.cmx verb.cmi version.cmo: version.cmi version.cmx: version.cmi videoc.cmo: ./subst.cmi ./parse_opts.cmi ./outManager.cmi ./myfiles.cmi \ ./misc.cmi ./lexstate.cmi ./latexscan.cmi ./latexmacros.cmi \ ./imageManager.cmi videoc.cmi videoc.cmx: ./subst.cmx ./parse_opts.cmx ./outManager.cmi ./myfiles.cmx \ ./misc.cmx ./lexstate.cmx ./latexscan.cmx ./latexmacros.cmx \ ./imageManager.cmi videoc.cmi zyva.cmo: ./outManager.cmi ./latexscan.cmi ./imageManager.cmi zyva.cmi zyva.cmx: ./outManager.cmi ./latexscan.cmx ./imageManager.cmi zyva.cmi hevea-2.23/colscan.mli0000644004317100512160000000172607303451221014706 0ustar marangetcristal(***********************************************************************) (* *) (* HEVEA *) (* *) (* Luc Maranget, projet Moscova, INRIA Rocquencourt *) (* *) (* Copyright 2001 Institut National de Recherche en Informatique et *) (* Automatique. Distributed only by permission. *) (* *) (* $Id: colscan.mli,v 1.5 2001-05-25 12:37:20 maranget Exp $ *) (***********************************************************************) exception Error of string val one : Lexing.lexbuf -> float val three : Lexing.lexbuf -> float * float * float val four : Lexing.lexbuf -> float * float * float * float hevea-2.23/outUnicode.mli0000644004317100512160000000555410574257751015425 0ustar marangetcristal(***********************************************************************) (* *) (* HEVEA *) (* *) (* Luc Maranget, projet MOSCOVA, INRIA Rocquencourt *) (* *) (* Copyright 2006 Institut National de Recherche en Informatique et *) (* Automatique. Distributed only by permission. *) (* *) (***********************************************************************) type unichar val show : unichar -> string (* Parse unicode chars given the HTML way *) val parse : string -> unichar (* Set translators from table in subdir 'mappings' *) val set_output_translator : string -> unit val set_input_translator : string -> unit val set_translators : string -> unit (* Translate for output *) exception CannotTranslate val translate_in : char -> (unit -> int) -> unichar val translate_out : unichar -> (char -> unit) -> unit (* Diacritical marks *) val grave : char -> unichar val acute : char -> unichar val circumflex : char -> unichar val tilde : char -> unichar val diaeresis : char -> unichar val ring : char -> unichar val cedilla : char -> unichar val stroke : char -> unichar val macron : char -> unichar val caron : char -> unichar val doubleacute : char -> unichar val doublegrave : char -> unichar val breve : char -> unichar val dotabove : char -> unichar val dotbelow : char -> unichar val linebelow : char -> unichar val ringabove : char -> unichar val ogonek : char -> unichar val circled : char -> unichar val doublestruck : char -> unichar (* Default rendering *) val def_default : unichar -> string -> unit val get_default : unichar -> string (* may raise Not_found *) (* Output unicode char as html *) val html_put : (string -> unit) -> (char -> unit) -> unichar -> unit (* A few constants *) val null : unichar val space : unichar val nbsp : unichar val acute_alone : unichar val grave_alone : unichar val circum_alone : unichar val diaeresis_alone : unichar val cedilla_alone : unichar val tilde_alone : unichar val macron_alone : unichar val doubleacute_alone : unichar val breve_alone : unichar val dotabove_alone : unichar val dotbelow_alone : unichar val linebelow_alone : unichar val ogonek_alone : unichar val ring_alone : unichar val caron_alone : unichar val circled_alone : unichar val eszett : unichar val iques : unichar val iexcl : unichar val minus : unichar val endash : unichar val emdash : unichar val ldquot : unichar val rdquot : unichar val lsquot : unichar val rsquot : unichar val prime : unichar val dprime : unichar val tprime : unichar val rprime : unichar val rdprime : unichar val rtprime : unichar hevea-2.23/pub.txt0000644004317100512160000000066612021655445014121 0ustar marangetcristalIt is my pleasure to announce the new, 2.00 release of HEVEA. HEVEA is a LaTeX to HTML translator. The input language is a fairly complete subset of LaTeX2e and the output language is HTML that is (hopefully) correct with respect to version 4.0 (transitional) HEVEA web page is This release is a major one as hevea output has changed from HTML 4.01 transitional to HTML version 5. --Luc hevea-2.23/subst.mli0000644004317100512160000000251612017660721014427 0ustar marangetcristal(***********************************************************************) (* *) (* HEVEA *) (* *) (* Luc Maranget, projet Moscova, INRIA Rocquencourt *) (* *) (* Copyright 2001 Institut National de Recherche en Informatique et *) (* Automatique. Distributed only by permission. *) (* *) (* $Id: subst.mli,v 1.8 2007-06-06 18:24:19 maranget Exp $ *) (***********************************************************************) open Lexstate val do_subst_this : string arg -> string val do_subst_this_list : string list arg -> string val subst_list : string list arg -> string list val subst_this : string -> string val subst_arg : Lexing.lexbuf -> string val subst_expn_arg : Lexing.lexbuf -> string val subst_opt : string -> Lexing.lexbuf -> string list val subst_body : Lexing.lexbuf -> string list val subst_expn_body : Lexing.lexbuf -> string list val subst_arg_list : Lexing.lexbuf -> string list val uppercase : string -> string val lowercase : string -> string hevea-2.23/htmllex.mll0000644004317100512160000002451212323450432014743 0ustar marangetcristal(***********************************************************************) (* *) (* HEVEA *) (* *) (* Luc Maranget, projet Moscova, INRIA Rocquencourt *) (* *) (* Copyright 2001 Institut National de Recherche en Informatique et *) (* Automatique. Distributed only by permission. *) (* *) (***********************************************************************) { open Lexeme let to_string = function | Open (_,_,txt) | Close (_,txt) | Text txt | Blanks txt -> txt | Eof -> "Eof" let cost = function | {tag=FONT ; attrs=attrs;_} -> (1,List.length attrs) | _ -> (1,0) module Make(C:DoOut.Config) = struct open Lexing module Out = DoOut.Make(C) let txt_level = ref 0 and txt_stack = MyStack.create "htmllex" let error msg _lb = raise (Emisc.LexError msg) let init table (s,t)= Hashtbl.add table s t ;; let block = Hashtbl.create 17 ;; List.iter (init block) ["center", () ; "div", (); "blockquote", () ; "h1", () ; "h2", () ;"h3", () ;"h4", () ;"h5", () ;"h6", () ; "pre", () ; "table", () ; "tr",() ; "td", () ; "th",() ; "ol",() ; "ul",(); "p",() ; "li",() ; "dl",() ; "dt", () ; "dd",() ; ] ;; let ptop () = if not (MyStack.empty txt_stack) then begin let pos = MyStack.top txt_stack in Location.print_this_fullpos pos ; prerr_endline "This opening tag is pending" end let warnings = ref true let check_nesting _lb name = try Hashtbl.find block (String.lowercase name) ; if !txt_level <> 0 && !warnings then begin Location.print_fullpos () ; prerr_endline ("Warning, block level element: "^name^" nested inside text-level element") ; ptop () end with | Not_found -> () let text = Hashtbl.create 17 ;; List.iter (init text) ["tt",TT ; "i",I ; "b",B ; "big",BIG ; "small",SMALL ; "strike",STRIKE ; "s",S ; "u",U ; "font",FONT ; "em",EM ; "strong",STRONG ; "dfn",DFN ; "code",CODE ; "samp",SAMP ; "kbd",KBD ; "var",VAR ; "cite",CITE ; "abbr",ABBR ; "acronym",ACRONYM ; "q",Q ; "sub",SUB ; "sup",SUP ; "a", A ; "span", SPAN ; "script", SCRIPT; "style", STYLE; ] ;; let is_textlevel name = try let _ = Hashtbl.find text (String.lowercase name) in true with | Not_found -> false let is_br name = "br" = (String.lowercase name) let is_basefont name = "basefont" = (String.lowercase name) let set_basefont attrs lb = List.iter (fun (name,v,_) -> match String.lowercase name,v with | "size",Some s -> begin try Emisc.basefont := int_of_string s with | _ -> error "BASEFONT syntax" lb end | _ -> ()) attrs let get_value lb = function | Some s -> s | _ -> error "Bad attribute syntax" lb let is_size_relative v = match v with | "xx-small" | "x-small" | "small" | "medium" | "large" | "x-large" | "xx-large" -> false | _ -> true let font_value lb v = let v = get_value lb v in try let k = String.index v ':' in let tag = String.sub v 0 k and v = String.sub v (k+1) (String.length v - (k+1)) in let tag = match String.lowercase tag with | "font-family" -> Ffamily | "font-style" -> Fstyle | "font-variant" -> Fvariant | "font-weight" -> Fweight | "font-size" -> (* Catch case 'font-size:xxx%' which does not commute (with other font-size styles *) if is_size_relative v then raise Exit else Fsize | "color" -> Fcolor | "background-color" -> Fbgcolor | _ -> raise Exit in begin (* checks just one style *) try ignore (String.index v ';') ; raise Exit with | Exit -> raise Exit | _ -> () end ; tag,v with _ -> raise Exit let norm_attrs lb attrs = List.map (fun (name,value,txt) -> match String.lowercase name with | "size" -> SIZE (get_value lb value),txt | "color" -> COLOR (get_value lb value),txt | "face" -> FACE (get_value lb value),txt | "style" -> begin try let st,v = font_value lb value in ASTYLE (st,v),txt with Exit -> OTHER,txt end | _ -> OTHER, txt) attrs let ouvre lb name attrs txt = let uname = String.lowercase name in try let tag = Hashtbl.find text uname in let attrs = norm_attrs lb attrs in incr txt_level ; MyStack.push txt_stack (Location.get_pos ()) ; Open (tag,attrs,txt) with | Not_found -> assert false and ferme _lb name txt = try let tag = Hashtbl.find text (String.lowercase name) in decr txt_level ; begin if not (MyStack.empty txt_stack) then let _ = MyStack.pop txt_stack in () end ; Close (tag,txt) with | Not_found -> Text txt let buff = Out.create_buff () and abuff = Out.create_buff () let put s = Out.put buff s and putc c = Out.put_char buff c let aput s = Out.put abuff s } let blank = [' ''\t''\n''\r'] let tag = ['a'-'z''A'-'Z''0'-'9']+ let class_name = ['a'-'z''A'-'Z''0'-'9''-']+ let attr_name = ['a'-'z''A'-'Z']['a'-'z''A'-'Z''-''0'-'9'':']* rule main = parse | (blank|" "|"&XA0;")+ as lxm {Blanks lxm} | "" '\n'? {put (lexeme lexbuf)} | _ as c {putc c ; in_comment lexbuf} | eof {error "End of file in comment" lexbuf} and styles = parse | blank+ { styles lexbuf } | eof { [] } | blank* '.' ([^'{'' ''\t''\n']+ as name) blank* ((tag blank*)+ as addname)? ('{' [^'}']* '}' as cl) { Css.Class (name, addname, cl) :: styles lexbuf } | blank* ([^'{']+ '{' [^'}']* '}' as lxm) {Css.Other lxm :: styles lexbuf} (* Extract classes: values of the CLASS attribute *) and extract_classes cls = parse | "" { () } | _ { skip_comment lexbuf } | eof { error "End of file in comment" lexbuf } and skip_tag = parse | [^'>']* '>' { () } | eof { error "End of file in tag" lexbuf } and skip_value = parse | '\'' [^'\'']* '\'' | '"' [^'"']* '"' | '#'?['a'-'z''A'-'Z''0'-'9''-''+''_'':''.']+ { () } | "" { error "Attribute syntax (skip_value)" lexbuf } (* '"' *) and extract_value cls = parse | ['a'-'z''A'-'Z''0'-'9''-''+''_'':''.']+ as name { Emisc.Strings.add name cls } | '\'' { extract_values_q cls lexbuf } | '"' (* '"' *) { extract_values_qq cls lexbuf } | "" { error "Attribute syntax (extract_value)" lexbuf } and extract_values_q cls = parse | blank+ { extract_values_q cls lexbuf } | class_name as cl { extract_values_q (Emisc.Strings.add cl cls) lexbuf } | '\'' { cls } | "" { error "Class value syntax" lexbuf } and extract_values_qq cls = parse | blank+ { extract_values_qq cls lexbuf } | class_name as cl { extract_values_qq (Emisc.Strings.add cl cls) lexbuf } | '"' { cls } (* '"' *) | "" { error "Class value syntax" lexbuf } and extract_attrs cls = parse (* Blanks or attributes with no value *) | blank+|['a'-'z''A'-'Z''-''0'-'9']+ { extract_attrs cls lexbuf } (* Class attribute *) | ['c''C']['l''L']['a''A']['s''S']['s''S'] blank* '=' blank* { let cls = extract_value cls lexbuf in extract_attrs cls lexbuf } (* Other attributes with a value *) | attr_name blank* '=' blank* { skip_value lexbuf ; extract_attrs cls lexbuf } (* End of tag *) | '/'? '>' { cls } | "" { error "Attribute syntax (extract_attrs)" lexbuf } { let tok_buff = ref None ;; let txt_buff = Out.create_buff () ;; let rec read_tokens blanks lb = let t = main lb in match t with | Text txt -> Out.put txt_buff txt ; read_tokens false lb | Blanks txt -> Out.put txt_buff txt ; read_tokens blanks lb | _ -> let txt = Out.to_string txt_buff in match txt with | "" -> t | _ -> tok_buff := Some t ; if blanks then Blanks txt else Text txt let reset () = txt_level := 0 ; MyStack.reset txt_stack ; Out.reset txt_buff ; Out.reset buff ; Out.reset abuff let next_token lb = try match !tok_buff with | Some t -> tok_buff := None ; t | None -> read_tokens true lb with | e -> reset () ; raise e let classes lexbuf = let r = extract_classes Emisc.Strings.empty lexbuf in r end } hevea-2.23/isolatin1.hva0000644004317100512160000000003510404270225015153 0ustar marangetcristal\usepackage[latin1]{inputenc}hevea-2.23/parse_opts.ml0000644004317100512160000001354512017660721015301 0ustar marangetcristal(***********************************************************************) (* *) (* HEVEA *) (* *) (* Luc Maranget, projet PARA, INRIA Rocquencourt *) (* *) (* Copyright 1998 Institut National de Recherche en Informatique et *) (* Automatique. Distributed only by permission. *) (* *) (***********************************************************************) open Printf open Misc type input = File of string | Prog of string let files = ref [] ;; let add_input s = files := File s :: !files and add_program s = files := Prog s :: !files ;; (* use this to create your warnings if you wish to *) let frenchwarning = ref false ;; type destination = Html | Text | Info ;; let mathml = ref false ;; (*to activate advanced entities*) let moreentities = ref false ;; (* NO NEED AFTER BABEL SUPPORT *) (*let language = ref English*) type symbol_mode = SText | Symbol | Entity let symbol_mode = ref Entity and pedantic = ref false and destination = ref Html and fixpoint = ref false and optimize = ref false let width = ref 72 let except = ref [] let path = ref [] let outname = ref "" let small_length = ref 1024 let check_displayverb n = if n > 1 then displayverb := true let _ = Arg.parse [ ("-version", Arg.Unit (fun () -> print_endline ("hevea "^Version.version) ; print_endline ("library directory: "^Mylib.static_libdir) ; exit 0), "show hevea version and library directory") ; ("-v", Arg.Unit (fun () -> readverb := !readverb + 1 ; check_displayverb !readverb), "verbose flag, can be repeated to increase verbosity") ; ("-dv", Arg.Unit (fun () -> displayverb := true), "add borders to some block-level elements, so as to show hevea output structure") ; ("-s", Arg.Unit (fun () -> silent := true), "suppress warnings") ; ("-I", Arg.String (fun s -> path := s :: !path), "dir, add directory 'dir' to search path") ; ("-e", Arg.String (fun s -> except := s :: !except), "filename, prevent file 'filename' from being read") ; ("-fix", Arg.Unit (fun () -> fixpoint := true), "iterate Hevea until fixpoint") ; ("-O", Arg.Unit (fun () -> optimize := true), "call esponja to optimize HTML output") ; ("-exec", Arg.String add_program, "prog , execute external program 'prog', then read its result") ; ("-francais",Arg.Unit (fun () -> frenchwarning := true), "French mode (deprecated)") ; ("-moreentities", Arg.Unit (fun () -> moreentities := true), "Enable the output of some rare entities.") ; ("-entities", Arg.Unit (fun () -> symbol_mode := Entity), "Render symbols by using entities, this is the default") ; ("-textsymbols", Arg.Unit (fun () -> symbol_mode := SText), "Render symbols by english text") ; ("-noiso",Arg.Unit (fun () -> Misc.warning "-noiso is deprecated, by default hevea output is ascii"), "deprecated, does nothing") ; ("-pedantic",Arg.Unit (fun () -> pedantic := true), "be pedantic in interpreting HTML 4.0 transitional definition") ; ("-mathml",Arg.Unit (fun() -> mathml := true), "produces MathML output for equations, very experimental"); ("-text",Arg.Unit (fun () -> symbol_mode := SText ; destination := Text), "output plain text"); ("-info",Arg.Unit (fun () -> symbol_mode := SText ; destination := Info), "output info file(s)"); ("-w", Arg.String (fun s -> width := int_of_string s), "width, set the output width for text or info output"); ("-rsz", Arg.Int (fun i -> small_length := i), (sprintf "size of leaves in rope implementation (default %i)" !small_length)); ("-o", Arg.String (fun s -> outname := s), "filename, make hevea output go into file 'filename'") ] (add_input) ("hevea "^Version.version) ;; let warning s = if not !silent || !verbose > 0 then begin Location.print_pos () ; prerr_string "Warning: " ; prerr_endline s end ;; (* For correcting strange user (-exec prog en dernier) *) let rec ffirst = function | [] -> None,[] | Prog _ as arg::rem -> let file, rest = ffirst rem in file, arg::rest | File _ as arg::rem -> Some arg,rem ;; files := match ffirst !files with | None,rem -> rem | Some arg,rem -> arg::rem let base_in,name_in,styles = match !files with | File x :: rest -> if Filename.check_suffix x ".hva" then "","", !files else let base_file = Filename.basename x in begin try let base = if Filename.check_suffix base_file ".tex" then Filename.chop_extension base_file else base_file in base,x,rest with Invalid_argument _ -> base_file, x,rest end | []|Prog _::_ -> "","",!files let filter = match base_in with "" -> true | _ -> false ;; if filter then begin if !fixpoint then Misc.warning ("No fixpoint in filter mode"); fixpoint := false end ;; let base_out = match !outname with | "" -> begin match base_in with | "" -> "" | _ -> Filename.basename base_in end | name -> let suff = match !destination with | Html -> ".html" | Text -> ".txt" | Info -> ".info" in if Filename.check_suffix name suff then Filename.chop_suffix name suff else try Filename.chop_extension name with Invalid_argument _ -> name let name_out = match !outname with | "" -> begin match base_in with | "" -> "" | x -> begin match !destination with | Html ->x^".html" | Text ->x^".txt" | Info ->x^".info" end end | x -> x let _ = if !frenchwarning then begin warning "-francais option is deprecated, use babel instead" end hevea-2.23/lstlang1.sty0000644004317100512160000025731011524022160015045 0ustar marangetcristal%% %% This is file `lstlang1.sty', %% generated with the docstrip utility. %% %% The original source files were: %% %% lstdrvrs.dtx (with options: `lang1') %% %% The listings package is copyright 1996--2004 Carsten Heinz, and %% continued maintenance on the package is copyright 2006--2007 Brooks Moses. %% The drivers are copyright 1997/1998/1999/2000/2001/2002/2003/2004/2006/ %% 2007 any individual author listed in this file. %% %% This file is distributed under the terms of the LaTeX Project Public %% License from CTAN archives in directory macros/latex/base/lppl.txt. %% Either version 1.3 or, at your option, any later version. %% %% This file is completely free and comes without any warranty. %% %% Send comments and ideas on the package, error reports and additional %% programming languages to Brooks Moses at . %% \ProvidesFile{lstlang1.sty} [2004/09/05 1.3 listings language file] %% %% ACSL definition (c) 2000 by Andreas Matthias %% \lst@definelanguage{ACSL}[90]{Fortran}% {morekeywords={algorithm,cinterval,constant,derivative,discrete,% dynamic,errtag,initial,interval,maxterval,minterval,% merror,xerror,nsteps,procedural,save,schedule,sort,% table,terminal,termt,variable},% sensitive=false,% morecomment=[l]!% }[keywords, comments]% %% %% Ada 95 definition (c) Torsten Neuer %% %% Ada 2005 definition (c) 2006 Santiago Urue\~{n}a Pascual %% %% \lst@definelanguage[2005]{Ada}[95]{Ada}% {morekeywords={interface,overriding,synchronized}}% \lst@definelanguage[95]{Ada}[83]{Ada}% {morekeywords={abstract,aliased,protected,requeue,tagged,until}}% \lst@definelanguage[83]{Ada}% {morekeywords={abort,abs,accept,access,all,and,array,at,begin,body,% case,constant,declare,delay,delta,digits,do,else,elsif,end,entry,% exception,exit,for,function,generic,goto,if,in,is,limited,loop,% mod,new,not,null,of,or,others,out,package,pragma,private,% procedure,raise,range,record,rem,renames,return,reverse,select,% separate,subtype,task,terminate,then,type,use,when,while,with,% xor},% sensitive=f,% morecomment=[l]--,% morestring=[m]",% percent not defined as stringizer so far morestring=[m]'% }[keywords,comments,strings]% %% %% awk definitions (c) Christoph Giess %% \lst@definelanguage[gnu]{Awk}[POSIX]{Awk}% {morekeywords={and,asort,bindtextdomain,compl,dcgettext,gensub,% lshift,mktime,or,rshift,strftime,strtonum,systime,xor,extension}% }% \lst@definelanguage[POSIX]{Awk}% {keywords={BEGIN,END,close,getline,next,nextfile,print,printf,% system,fflush,atan2,cos,exp,int,log,rand,sin,sqrt,srand,gsub,% index,length,match,split,sprintf,strtonum,sub,substr,tolower,% toupper,if,while,do,for,break,continue,delete,exit,function,% return},% sensitive,% morecomment=[l]\#,% morecomment=[l]//,% morecomment=[s]{/*}{*/},% morestring=[b]"% }[keywords,comments,strings]% %% %% Visual Basic definition (c) 2002 Robert Frank %% \lst@definelanguage[Visual]{Basic} {morekeywords={Abs,Array,Asc,AscB,AscW,Atn,Avg,CBool,CByte,CCur,% CDate,CDbl,Cdec,Choose,Chr,ChrB,ChrW,CInt,CLng,Command,Cos,% Count,CreateObject,CSng,CStr,CurDir,CVar,CVDate,CVErr,Date,% DateAdd,DateDiff,DatePart,DateSerial,DateValue,Day,DDB,Dir,% DoEvents,Environ,EOF,Error,Exp,FileAttr,FileDateTime,FileLen,% Fix,Format,FreeFile,FV,GetAllStrings,GetAttr,% GetAutoServerSettings,GetObject,GetSetting,Hex,Hour,IIf,% IMEStatus,Input,InputB,InputBox,InStr,InstB,Int,Integer,IPmt,% IsArray,IsDate,IsEmpty,IsError,IsMissing,IsNull,IsNumeric,% IsObject,LBound,LCase,Left,LeftB,Len,LenB,LoadPicture,Loc,LOF,% Log,Ltrim,Max,Mid,MidB,Min,Minute,MIRR,Month,MsgBox,Now,NPer,% NPV,Oct,Partition,Pmt,PPmt,PV,QBColor,Rate,RGB,Right,RightB,Rnd,% Rtrim,Second,Seek,Sgn,Shell,Sin,SLN,Space,Spc,Sqr,StDev,StDevP,% Str,StrComp,StrConv,String,Switch,Sum,SYD,Tab,Tan,Time,Timer,% TimeSerial,TimeValue,Trim,TypeName,UBound,Ucase,Val,Var,VarP,% VarType,Weekday,Year},% functions morekeywords=[2]{Accept,Activate,Add,AddCustom,AddFile,AddFromFile,% AddFromTemplate,AddItem,AddNew,AddToAddInToolbar,% AddToolboxProgID,Append,AppendChunk,Arrange,Assert,AsyncRead,% BatchUpdate,BeginTrans,Bind,Cancel,CancelAsyncRead,CancelBatch,% CancelUpdate,CanPropertyChange,CaptureImage,CellText,CellValue,% Circle,Clear,ClearFields,ClearSel,ClearSelCols,Clone,Close,Cls,% ColContaining,ColumnSize,CommitTrans,CompactDatabase,Compose,% Connect,Copy,CopyQueryDef,CreateDatabase,CreateDragImage,% CreateEmbed,CreateField,CreateGroup,CreateIndex,CreateLink,% CreatePreparedStatement,CreatePropery,CreateQuery,% CreateQueryDef,CreateRelation,CreateTableDef,CreateUser,% CreateWorkspace,Customize,Delete,DeleteColumnLabels,% DeleteColumns,DeleteRowLabels,DeleteRows,DoVerb,Drag,Draw,Edit,% EditCopy,EditPaste,EndDoc,EnsureVisible,EstablishConnection,% Execute,ExtractIcon,Fetch,FetchVerbs,Files,FillCache,Find,% FindFirst,FindItem,FindLast,FindNext,FindPrevious,Forward,% GetBookmark,GetChunk,GetClipString,GetData,GetFirstVisible,% GetFormat,GetHeader,GetLineFromChar,GetNumTicks,GetRows,% GetSelectedPart,GetText,GetVisibleCount,GoBack,GoForward,Hide,% HitTest,HoldFields,Idle,InitializeLabels,InsertColumnLabels,% InsertColumns,InsertObjDlg,InsertRowLabels,InsertRows,Item,% KillDoc,Layout,Line,LinkExecute,LinkPoke,LinkRequest,LinkSend,% Listen,LoadFile,LoadResData,LoadResPicture,LoadResString,% LogEvent,MakeCompileFile,MakeReplica,MoreResults,Move,MoveData,% MoveFirst,MoveLast,MoveNext,MovePrevious,NavigateTo,NewPage,% NewPassword,NextRecordset,OLEDrag,OnAddinsUpdate,OnConnection,% OnDisconnection,OnStartupComplete,Open,OpenConnection,% OpenDatabase,OpenQueryDef,OpenRecordset,OpenResultset,OpenURL,% Overlay,PaintPicture,Paste,PastSpecialDlg,PeekData,Play,Point,% PopulatePartial,PopupMenu,Print,PrintForm,PropertyChanged,Pset,% Quit,Raise,RandomDataFill,RandomFillColumns,RandomFillRows,% rdoCreateEnvironment,rdoRegisterDataSource,ReadFromFile,% ReadProperty,Rebind,ReFill,Refresh,RefreshLink,RegisterDatabase,% Reload,Remove,RemoveAddInFromToolbar,RemoveItem,Render,% RepairDatabase,Reply,ReplyAll,Requery,ResetCustom,% ResetCustomLabel,ResolveName,RestoreToolbar,Resync,Rollback,% RollbackTrans,RowBookmark,RowContaining,RowTop,Save,SaveAs,% SaveFile,SaveToFile,SaveToolbar,SaveToOle1File,Scale,ScaleX,% ScaleY,Scroll,Select,SelectAll,SelectPart,SelPrint,Send,% SendData,Set,SetAutoServerSettings,SetData,SetFocus,SetOption,% SetSize,SetText,SetViewport,Show,ShowColor,ShowFont,ShowHelp,% ShowOpen,ShowPrinter,ShowSave,ShowWhatsThis,SignOff,SignOn,Size,% Span,SplitContaining,StartLabelEdit,StartLogging,Stop,% Synchronize,TextHeight,TextWidth,ToDefaults,TwipsToChartPart,% TypeByChartType,Update,UpdateControls,UpdateRecord,UpdateRow,% Upto,WhatsThisMode,WriteProperty,ZOrder},% methods morekeywords=[3]{AccessKeyPress,AfterAddFile,AfterChangeFileName,% AfterCloseFile,AfterColEdit,AfterColUpdate,AfterDelete,% AfterInsert,AfterLabelEdit,AfterRemoveFile,AfterUpdate,% AfterWriteFile,AmbienChanged,ApplyChanges,Associate,% AsyncReadComplete,AxisActivated,AxisLabelActivated,% AxisLabelSelected,AxisLabelUpdated,AxisSelected,% AxisTitleActivated,AxisTitleSelected,AxisTitleUpdated,% AxisUpdated,BeforeClick,BeforeColEdit,BeforeColUpdate,% BeforeConnect,BeforeDelete,BeforeInsert,BeforeLabelEdit,% BeforeLoadFile,BeforeUpdate,ButtonClick,ButtonCompleted,% ButtonGotFocus,ButtonLostFocus,Change,ChartActivated,% ChartSelected,ChartUpdated,Click,ColEdit,Collapse,ColResize,% ColumnClick,Compare,ConfigChageCancelled,ConfigChanged,% ConnectionRequest,DataArrival,DataChanged,DataUpdated,DblClick,% Deactivate,DeviceArrival,DeviceOtherEvent,DeviceQueryRemove,% DeviceQueryRemoveFailed,DeviceRemoveComplete,DeviceRemovePending,% DevModeChange,Disconnect,DisplayChanged,Dissociate,% DoGetNewFileName,Done,DonePainting,DownClick,DragDrop,DragOver,% DropDown,EditProperty,EnterCell,EnterFocus,Event,ExitFocus,% Expand,FootnoteActivated,FootnoteSelected,FootnoteUpdated,% GotFocus,HeadClick,InfoMessage,Initialize,IniProperties,% ItemActivated,ItemAdded,ItemCheck,ItemClick,ItemReloaded,% ItemRemoved,ItemRenamed,ItemSeletected,KeyDown,KeyPress,KeyUp,% LeaveCell,LegendActivated,LegendSelected,LegendUpdated,% LinkClose,LinkError,LinkNotify,LinkOpen,Load,LostFocus,% MouseDown,MouseMove,MouseUp,NodeClick,ObjectMove,% OLECompleteDrag,OLEDragDrop,OLEDragOver,OLEGiveFeedback,% OLESetData,OLEStartDrag,OnAddNew,OnComm,Paint,PanelClick,% PanelDblClick,PathChange,PatternChange,PlotActivated,% PlotSelected,PlotUpdated,PointActivated,PointLabelActivated,% PointLabelSelected,PointLabelUpdated,PointSelected,% PointUpdated,PowerQuerySuspend,PowerResume,PowerStatusChanged,% PowerSuspend,QueryChangeConfig,QueryComplete,QueryCompleted,% QueryTimeout,QueryUnload,ReadProperties,Reposition,% RequestChangeFileName,RequestWriteFile,Resize,ResultsChanged,% RowColChange,RowCurrencyChange,RowResize,RowStatusChanged,% SelChange,SelectionChanged,SendComplete,SendProgress,% SeriesActivated,SeriesSelected,SeriesUpdated,SettingChanged,% SplitChange,StateChanged,StatusUpdate,SysColorsChanged,% Terminate,TimeChanged,TitleActivated,TitleSelected,% TitleActivated,UnboundAddData,UnboundDeleteRow,% UnboundGetRelativeBookmark,UnboundReadData,UnboundWriteData,% Unload,UpClick,Updated,Validate,ValidationError,WillAssociate,% WillChangeData,WillDissociate,WillExecute,WillUpdateRows,% WithEvents,WriteProperties},% VB-events morekeywords=[4]{AppActivate,Base,Beep,Call,Case,ChDir,ChDrive,% Const,Declare,DefBool,DefByte,DefCur,DefDate,DefDbl,DefDec,% DefInt,DefLng,DefObj,DefSng,DefStr,Deftype,DefVar,DeleteSetting,% Dim,Do,Else,ElseIf,End,Enum,Erase,Event,Exit,Explicit,FileCopy,% For,ForEach,Friend,Function,Get,GoSub,GoTo,If,Implements,Kill,% Let,LineInput,Lock,Lset,MkDir,Name,Next,OnError,On,Option,% Private,Property,Public,Put,RaiseEvent,Randomize,ReDim,Rem,% Reset,Resume,Return,RmDir,Rset,SavePicture,SaveSetting,% SendKeys,SetAttr,Static,Sub,Then,Type,Unlock,Wend,While,Width,% With,Write},% statements sensitive=false,% keywordcomment=rem,% MoreSelectCharTable=\def\lst@BeginKC@{% chmod \lst@ResetToken \lst@BeginComment\lst@GPmode{{\lst@commentstyle}% \lst@Lmodetrue\lst@modetrue}\@empty},% morecomment=[l]{'},% morecomment=[s]{/*}{*/},% morestring=[b]",% }[keywords,comments,strings,keywordcomments] \lst@definelanguage[ANSI]{C++}[ISO]{C++}{}% \lst@definelanguage[GNU]{C++}[ISO]{C++}% {morekeywords={__attribute__,__extension__,__restrict,__restrict__,% typeof,__typeof__},% }% \lst@definelanguage[Visual]{C++}[ISO]{C++}% {morekeywords={__asm,__based,__cdecl,__declspec,dllexport,% dllimport,__except,__fastcall,__finally,__inline,__int8,__int16,% __int32,__int64,naked,__stdcall,thread,__try,__leave},% }% \lst@definelanguage[ISO]{C++}[ANSI]{C}% {morekeywords={and,and_eq,asm,bad_cast,bad_typeid,bitand,bitor,bool,% catch,class,compl,const_cast,delete,dynamic_cast,explicit,export,% false,friend,inline,mutable,namespace,new,not,not_eq,operator,or,% or_eq,private,protected,public,reinterpret_cast,static_cast,% template,this,throw,true,try,typeid,type_info,typename,using,% virtual,wchar_t,xor,xor_eq},% }% %% %% Objective-C definition (c) 1997 Detlev Droege %% \lst@definelanguage[Objective]{C}[ANSI]{C} {morekeywords={bycopy,id,in,inout,oneway,out,self,super,% @class,@defs,@encode,@end,@implementation,@interface,@private,% @protected,@protocol,@public,@selector},% moredirectives={import}% }% %% %% Handel-C definition, refer http://www.celoxica.com %% \lst@definelanguage[Handel]{C}[ANSI]{C} {morekeywords={assert,chan,chanin,chanout,clock,delay,expr,external,% external_divide,family,ifselect,in,inline,interface,internal,% internal_divid,intwidth,let,macro,mpram,par,part,prialt,proc,ram,% releasesema,reset,rom,select,sema,set,seq,shared,signal,try,% reset,trysema,typeof,undefined,width,with,wom},% }% \lst@definelanguage[ANSI]{C}% {morekeywords={auto,break,case,char,const,continue,default,do,double,% else,enum,extern,float,for,goto,if,int,long,register,return,% short,signed,sizeof,static,struct,switch,typedef,union,unsigned,% void,volatile,while},% sensitive,% morecomment=[s]{/*}{*/},% morecomment=[l]//,% nonstandard morestring=[b]",% morestring=[b]',% moredelim=*[directive]\#,% moredirectives={define,elif,else,endif,error,if,ifdef,ifndef,line,% include,pragma,undef,warning}% }[keywords,comments,strings,directives]% %% %% C-Sharp definition (c) 2002 Martin Brodbeck %% \lst@definelanguage[Sharp]{C}% {morekeywords={abstract,base,bool,break,byte,case,catch,char,checked,% class,const,continue,decimal,default,delegate,do,double,else,% enum,event,explicit,extern,false,finally,fixed,float,for,foreach,% goto,if,implicit,in,int,interface,internal,is,lock,long,% namespace,new,null,object,operator,out,override,params,private,% protected,public,readonly,ref,return,sbyte,sealed,short,sizeof,% static,string,struct,switch,this,throw,true,try,typeof,uint,% ulong,unchecked,unsafe,ushort,using,virtual,void,while,% as,volatile,stackalloc},% Kai K\"ohne sensitive,% morecomment=[s]{/*}{*/},% morecomment=[l]//,% morestring=[b]" }[keywords,comments,strings]% %% %% csh definition (c) 1998 Kai Below %% \lst@definelanguage{csh} {morekeywords={alias,awk,cat,echo,else,end,endif,endsw,exec,exit,% foreach,glob,goto,history,if,logout,nice,nohup,onintr,repeat,sed,% set,setenv,shift,source,switch,then,time,while,umask,unalias,% unset,wait,while,@,env,argv,child,home,ignoreeof,noclobber,% noglob,nomatch,path,prompt,shell,status,verbose,print,printf,% sqrt,BEGIN,END},% morecomment=[l]\#,% morestring=[d]"% }[keywords,comments,strings]% %% %% bash,sh definition (c) 2003 Riccardo Murri %% \lst@definelanguage{bash}[]{sh}% {morekeywords={alias,bg,bind,builtin,command,compgen,complete,% declare,disown,enable,fc,fg,history,jobs,et,local,logout,printf,% pushd,popd,select,set,suspend,shopt,source,times,type,typeset,% ulimit,unalias,wait},% }% \lst@definelanguage{sh}% {morekeywords={awk,break,case,cat,cd,continue,do,done,echo,else,% env,eval,exec,expr,exit,export,false,fi,for,function,getopts,% hash,history,if,kill,nice,nohup,ps,pwd,read,readonly,return,% sed,shift,test,then,times,trap,true,umask,unset,until,while},% morecomment=[l]\#,% morestring=[d]"% }[keywords,comments,strings]% \lst@definelanguage[90]{Fortran}[95]{Fortran}{} \lst@definelanguage[95]{Fortran}[77]{Fortran}% {deletekeywords=SAVE,% morekeywords={ACTION,ADVANCE,ALLOCATE,ALLOCATABLE,ASSIGNMENT,CASE,% CONTAINS,CYCLE,DEALLOCATE,DEFAULT,DELIM,EXIT,INCLUDE,IN,NONE,IN,% OUT,INTENT,INTERFACE,IOLENGTH,KIND,LEN,MODULE,NAME,NAMELIST,NMT,% NULLIFY,ONLY,OPERATOR,OPTIONAL,OUT,PAD,POINTER,POSITION,PRIVATE,% PUBLIC,READWRITE,RECURSIVE,RESULT,SELECT,SEQUENCE,SIZE,STAT,% TARGET,USE,WHERE,WHILE,BLOCKDATA,DOUBLEPRECISION,% ENDBLOCKDATA,ENDFILE,ENDFUNCTION,ENDINTERFACE,% ENDMODULE,ENDPROGRAM,ENDSELECT,ENDSUBROUTINE,ENDTYPE,ENDWHERE,% INOUT,SELECTCASE},% deletecomment=[f],% no fixed comment line: 1998 Magne Rudshaug morecomment=[l]!% }% \lst@definelanguage[77]{Fortran}% {morekeywords={ACCESS,ASSIGN,BACKSPACE,BLANK,BLOCK,CALL,CHARACTER,% CLOSE,COMMON,COMPLEX,CONTINUE,DATA,DIMENSION,DIRECT,DO,DOUBLE,% ELSE,ELSEIF,END,ENDIF,ENDDO,ENTRY,EOF,EQUIVALENCE,ERR,EXIST,EXTERNAL,% FILE,FMT,FORM,FORMAT,FORMATTED,FUNCTION,GO,TO,GOTO,IF,IMPLICIT,% INQUIRE,INTEGER,INTRINSIC,IOSTAT,LOGICAL,NAMED,NEXTREC,NUMBER,% OPEN,OPENED,PARAMETER,PAUSE,PRECISION,PRINT,PROGRAM,READ,REAL,% REC,RECL,RETURN,REWIND,SEQUENTIAL,STATUS,STOP,SUBROUTINE,THEN,% TYPE,UNFORMATTED,UNIT,WRITE,SAVE},% sensitive=f,%% not Fortran-77 standard, but allowed in Fortran-95 %% morecomment=[f]*,% morecomment=[f]C,% morecomment=[f]c,% morestring=[d]",%% not Fortran-77 standard, but allowed in Fortran-95 %% morestring=[d]'% }[keywords,comments,strings]% \lst@definelanguage{HTML}% {morekeywords={A,ABBR,ACRONYM,ADDRESS,APPLET,AREA,B,BASE,BASEFONT,% BDO,BIG,BLOCKQUOTE,BODY,BR,BUTTON,CAPTION,CENTER,CITE,CODE,COL,% COLGROUP,DD,DEL,DFN,DIR,DIV,DL,DOCTYPE,DT,EM,FIELDSET,FONT,FORM,% FRAME,FRAMESET,HEAD,HR,H1,H2,H3,H4,H5,H6,HTML,I,IFRAME,IMG,INPUT,% INS,ISINDEX,KBD,LABEL,LEGEND,LH,LI,LINK,LISTING,MAP,META,MENU,% NOFRAMES,NOSCRIPT,OBJECT,OPTGROUP,OPTION,P,PARAM,PLAINTEXT,PRE,% OL,Q,S,SAMP,SCRIPT,SELECT,SMALL,SPAN,STRIKE,STRING,STRONG,STYLE,% SUB,SUP,TABLE,TBODY,TD,TEXTAREA,TFOOT,TH,THEAD,TITLE,TR,TT,U,UL,% VAR,XMP,% accesskey,action,align,alink,alt,archive,axis,background,bgcolor,% border,cellpadding,cellspacing,charset,checked,cite,class,classid,% code,codebase,codetype,color,cols,colspan,content,coords,data,% datetime,defer,disabled,dir,event,error,for,frameborder,headers,% height,href,hreflang,hspace,http-equiv,id,ismap,label,lang,link,% longdesc,marginwidth,marginheight,maxlength,media,method,multiple,% name,nohref,noresize,noshade,nowrap,onblur,onchange,onclick,% ondblclick,onfocus,onkeydown,onkeypress,onkeyup,onload,onmousedown,% profile,readonly,onmousemove,onmouseout,onmouseover,onmouseup,% onselect,onunload,rel,rev,rows,rowspan,scheme,scope,scrolling,% selected,shape,size,src,standby,style,tabindex,text,title,type,% units,usemap,valign,value,valuetype,vlink,vspace,width,xmlns},% tag=**[s]<>,% sensitive=f,% morestring=[d]",% ??? doubled MoreSelectCharTable=% \lst@CArgX--\relax\lst@DefDelimB{}{}% {\ifnum\lst@mode=\lst@tagmode\else \expandafter\@gobblethree \fi}% \lst@BeginComment\lst@commentmode{{\lst@commentstyle}}% \lst@CArgX--\relax\lst@DefDelimE{}{}{}% \lst@EndComment\lst@commentmode }[keywords,comments,strings,html]% %% %% AspectJ definition (c) Robert Wenner %% \lst@definelanguage[AspectJ]{Java}[]{Java}% {morekeywords={% adviceexecution,after,args,around,aspect,aspectOf,before,% call,cflow,cflowbelow,% execution,get,handler,if,initialization,issingleton,pointcut,% percflow,percflowbelow,perthis,pertarget,preinitialization,% privileged,proceed,returning,set,staticinitialization,strictfp,% target,this,thisEnclosingJoinPoint,thisJoinPoint,throwing,% within,withincode},% MoreSelectCharTable=% \lst@DefSaveDef{`.}\lst@umdot{\lst@umdot\global\let\lst@derefop\@empty}% \ifx\lst@derefinstalled\@empty\else \global\let\lst@derefinstalled\@empty \lst@AddToHook{Output}% {\lst@ifkeywords \ifx\lst@derefop\@empty \global\let\lst@derefop\relax \ifx\lst@thestyle\lst@gkeywords@sty \ifx\lst@currstyle\relax \let\lst@thestyle\lst@identifierstyle \else \let\lst@thestyle\lst@currstyle \fi \fi \fi \fi} \lst@AddToHook{BOL}{\global\let\lst@derefop\relax}% \lst@AddTo\lst@ProcessSpace{\global\let\lst@derefop\relax}% \fi }% \lst@definelanguage{Java}% {morekeywords={abstract,boolean,break,byte,case,catch,char,class,% const,continue,default,do,double,else,extends,false,final,% finally,float,for,goto,if,implements,import,instanceof,int,% interface,label,long,native,new,null,package,private,protected,% public,return,short,static,super,switch,synchronized,this,throw,% throws,transient,true,try,void,volatile,while},% sensitive,% morecomment=[l]//,% morecomment=[s]{/*}{*/},% morestring=[b]",% morestring=[b]',% }[keywords,comments,strings]% %% %% ByteCodeJava definition (c) 2004 Martine Gautier %% \lst@definelanguage{JVMIS}% {morekeywords={aaload,astore,aconst_null,aload,aload_0,aload_1,% aload_2,aload_3,anewarray,areturn,arraylength,astore,astore_0,% astore_1,astore_2,astore_3,athrow,baload,bastore,bipush,caload,% castore,checkcast,d2f,d2i,d2l,dadd,daload,dastore,dcmpg,dcmpl,% dconst_0,dconst_1,ddiv,dload,dload_0,dload_1,dload_2,dload_3,% dmul,dneg,drem,dreturn,dstore,dstore_0,dstore_1,dstore_2,% dstore_3,dsub,dup,dup_x1,dup_x2,dup2,dup2_x1,dup2_x2,f2d,% f2i,f2l,fadd,faload,fastore,fcmpg,fcmpl,fconst_0,fconst_1,% fconst_2,fdiv,fload,fload_0,fload_1,fload_2,fload_3,fmul,% fneg,frem,freturn,fstore,fstore_0,fstore_1,fstore_2,fstore_3,% fsub,getfield,getstatic,goto,goto_w,i2b,i2c,i2d,i2f,i2l,i2s,% iadd,iaload,iand,iastore,iconst_0,iconst_1,iconst_2,iconst_3,% iconst_4,iconst_5,idiv,if_acmpeq,if_acmpne,if_icmpeq,if_icmpne,% if_icmplt,if_cmpge,if_cmpgt,if_cmple,ifeq,ifne,iflt,ifge,ifgt,% ifle,ifnonnull,ifnull,iinc,iload,iload_0,iload_1,iload_2,% iload_3,imul,ineg,instanceof,invokeinterface,invokespecial,% invokestatic,invokevirtual,ior,irem,ireturn,ishl,ishr,istore,% istore_0,istore_1,istore_2,istore_3,isub,iushr,ixor,jsr,jsr_w,% l2d,l2f,l2i,ladd,laload,land,lastore,lcmp,lconst_0,lconst_1,% ldc,ldc_w,ldc2_w,ldiv,lload,lload_0,lload_1,lload_2,lload_3,% lmul,lneg,lookupswitch,lor,lrem,lreturn,lshl,lshr,lstore,% lstore_0,lstore_1,lstore_2,lstore_3,lsub,lushr,lxor,% monitorenter,monitorexit,multianewarray,new,newarray,nop,pop,% pop2,putfield,putstatic,ret,return,saload,sastore,sipush,swap,% tableswitch,wide,limit,locals,stack},% }[keywords]% \lst@definelanguage{Matlab}% {morekeywords={gt,lt,gt,lt,amp,abs,acos,acosh,acot,acoth,acsc,acsch,% all,angle,ans,any,asec,asech,asin,asinh,atan,atan2,atanh,auread,% auwrite,axes,axis,balance,bar,bessel,besselk,bessely,beta,% betainc,betaln,blanks,bone,break,brighten,capture,cart2pol,% cart2sph,caxis,cd,cdf2rdf,cedit,ceil,chol,cla,clabel,clc,clear,% clf,clock,close,colmmd,Colon,colorbar,colormap,ColorSpec,colperm,% comet,comet3,compan,compass,computer,cond,condest,conj,contour,% contour3,contourc,contrast,conv,conv2,cool,copper,corrcoef,cos,% cosh,cot,coth,cov,cplxpair,cputime,cross,csc,csch,csvread,% csvwrite,cumprod,cumsum,cylinder,date,dbclear,dbcont,dbdown,% dbquit,dbstack,dbstatus,dbstep,dbstop,dbtype,dbup,ddeadv,ddeexec,% ddeinit,ddepoke,ddereq,ddeterm,ddeunadv,deblank,dec2hex,deconv,% del2,delete,demo,det,diag,diary,diff,diffuse,dir,disp,dlmread,% dlmwrite,dmperm,dot,drawnow,echo,eig,ellipj,ellipke,else,elseif,% end,engClose,engEvalString,engGetFull,engGetMatrix,engOpen,% engOutputBuffer,engPutFull,engPutMatrix,engSetEvalCallback,% engSetEvalTimeout,engWinInit,eps,erf,erfc,erfcx,erfinv,error,% errorbar,etime,etree,eval,exist,exp,expint,expm,expo,eye,fclose,% feather,feof,ferror,feval,fft,fft2,fftshift,fgetl,fgets,figure,% fill,fill3,filter,filter2,find,findstr,finite,fix,flag,fliplr,% flipud,floor,flops,fmin,fmins,fopen,for,format,fplot,fprintf,% fread,frewind,fscanf,fseek,ftell,full,function,funm,fwrite,fzero,% gallery,gamma,gammainc,gammaln,gca,gcd,gcf,gco,get,getenv,% getframe,ginput,global,gplot,gradient,gray,graymon,grid,griddata,% gtext,hadamard,hankel,help,hess,hex2dec,hex2num,hidden,hilb,hist,% hold,home,hostid,hot,hsv,hsv2rgb,if,ifft,ifft2,imag,image,% imagesc,Inf,info,input,int2str,interp1,interp2,interpft,inv,% invhilb,isempty,isglobal,ishold,isieee,isinf,isletter,isnan,% isreal,isspace,issparse,isstr,jet,keyboard,kron,lasterr,lcm,% legend,legendre,length,lin2mu,line,linspace,load,log,log10,log2,% loglog,logm,logspace,lookfor,lower,ls,lscov,lu,magic,matClose,% matDeleteMatrix,matGetDir,matGetFp,matGetFull,matGetMatrix,% matGetNextMatrix,matGetString,matlabrc,matlabroot,matOpen,% matPutFull,matPutMatrix,matPutString,max,mean,median,menu,mesh,% meshc,meshgrid,meshz,mexAtExit,mexCallMATLAB,mexdebug,% mexErrMsgTxt,mexEvalString,mexFunction,mexGetFull,mexGetMatrix,% mexGetMatrixPtr,mexPrintf,mexPutFull,mexPutMatrix,mexSetTrapFlag,% min,more,movie,moviein,mu2lin,mxCalloc,mxCopyCharacterToPtr,% mxCopyComplex16ToPtr,mxCopyInteger4ToPtr,mxCopyPtrToCharacter,% mxCopyPtrToComplex16,mxCopyPtrToInteger4,mxCopyPtrToReal8,% mxCopyReal8ToPtr,mxCreateFull,mxCreateSparse,mxCreateString,% mxFree,mxFreeMatrix,mxGetIr,mxGetJc,mxGetM,mxGetN,mxGetName,% mxGetNzmax,mxGetPi,mxGetPr,mxGetScalar,mxGetString,mxIsComplex,% mxIsFull,mxIsNumeric,mxIsSparse,mxIsString,mxIsTypeDouble,% mxSetIr,mxSetJc,mxSetM,mxSetN,mxSetName,mxSetNzmax,mxSetPi,% mxSetPr,NaN,nargchk,nargin,nargout,newplot,nextpow2,nnls,nnz,% nonzeros,norm,normest,null,num2str,nzmax,ode23,ode45,orient,orth,% pack,pascal,patch,path,pause,pcolor,pi,pink,pinv,plot,plot3,% pol2cart,polar,poly,polyder,polyeig,polyfit,polyval,polyvalm,% pow2,print,printopt,prism,prod,pwd,qr,qrdelete,qrinsert,quad,% quad8,quit,quiver,qz,rand,randn,randperm,rank,rat,rats,rbbox,% rcond,real,realmax,realmin,refresh,rem,reset,reshape,residue,% return,rgb2hsv,rgbplot,rootobject,roots,rose,rosser,rot90,rotate,% round,rref,rrefmovie,rsf2csf,save,saxis,schur,sec,sech,semilogx,% semilogy,set,setstr,shading,sign,sin,sinh,size,slice,sort,sound,% spalloc,sparse,spaugment,spconvert,spdiags,specular,speye,spfun,% sph2cart,sphere,spinmap,spline,spones,spparms,sprandn,sprandsym,% sprank,sprintf,spy,sqrt,sqrtm,sscanf,stairs,startup,std,stem,% str2mat,str2num,strcmp,strings,strrep,strtok,subplot,subscribe,% subspace,sum,surf,surface,surfc,surfl,surfnorm,svd,symbfact,% symmmd,symrcm,tan,tanh,tempdir,tempname,terminal,text,tic,title,% toc,toeplitz,trace,trapz,tril,triu,type,uicontrol,uigetfile,% uimenu,uiputfile,unix,unwrap,upper,vander,ver,version,view,% viewmtx,waitforbuttonpress,waterfall,wavread,wavwrite,what,% whatsnew,which,while,white,whitebg,who,whos,wilkinson,wk1read,% wk1write,xlabel,xor,ylabel,zeros,zlabel,zoom},% sensitive,% morecomment=[l]\%,% morestring=[m]'% }[keywords,comments,strings]% \lst@definelanguage[5.2]{Mathematica}[3.0]{Mathematica}%% {morekeywords={Above,AbsoluteOptions,AbsoluteTiming,AccountingForm,% AccuracyGoal,Active,ActiveItem,AddOnHelpPath,% AdjustmentBox,AdjustmentBoxOptions,After,AiryAiPrime,% AlgebraicRulesData,Algebraics,Alias,AlignmentMarker,% AllowInlineCells,AllowScriptLevelChange,Analytic,AnimationCycleOffset,% AnimationCycleRepetitions,AnimationDirection,AnimationDisplayTime,ApartSquareFree,% AppellF1,ArgumentCountQ,ArrayDepth,ArrayPlot,% ArrayQ,ArrayRules,AspectRatioFixed,Assuming,% Assumptions,AutoDelete,AutoEvaluateEvents,AutoGeneratedPackage,% AutoIndent,AutoIndentSpacings,AutoItalicWords,AutoloadPath,% AutoOpenNotebooks,AutoOpenPalettes,AutoScroll,AutoSpacing,% AutoStyleOptions,Axis,BackgroundTasksSettings,Backsubstitution,% Backward,Baseline,Before,BeginDialogPacket,% BeginFrontEndInteractionPacket,Below,BezoutMatrix,BinaryFormat,% BinaryGet,BinaryRead,BinaryReadList,BinaryWrite,% BitAnd,BitNot,BitOr,BitXor,% Black,BlankForm,Blue,Boole,% Booleans,Bottom,Bounds,Box,% BoxBaselineShift,BoxData,BoxDimensions,BoxFormFormatTypes,% BoxFrame,BoxMargins,BoxRegion,Brown,% Buchberger,Button,ButtonBox,ButtonBoxOptions,% ButtonCell,ButtonContents,ButtonData,ButtonEvaluator,% ButtonExpandable,ButtonFrame,ButtonFunction,ButtonMargins,% ButtonMinHeight,ButtonNote,ButtonNotebook,ButtonSource,% ButtonStyle,ButtonStyleMenuListing,ByteOrdering,CallPacket,% CarmichaelLambda,Cell,CellAutoOverwrite,CellBaseline,% CellBoundingBox,CellBracketOptions,CellContents,CellDingbat,% CellEditDuplicate,CellElementsBoundingBox,CellElementSpacings,CellEvaluationDuplicate,% CellFrame,CellFrameColor,CellFrameLabelMargins,CellFrameLabels,% CellFrameMargins,CellGroup,CellGroupData,CellGrouping,% CellGroupingRules,CellHorizontalScrolling,CellLabel,CellLabelAutoDelete,% CellLabelMargins,CellLabelPositioning,CellMargins,CellObject,% CellOpen,CellPasswords,CellPrint,CellSize,% CellStyle,CellTags,CellularAutomaton,Center,% CharacterEncoding,CharacterEncodingsPath,CharacteristicPolynomial,CharacterRange,% CheckAll,CholeskyDecomposition,Clip,ClipboardNotebook,% Closed,ClosingAutoSave,CoefficientArrays,CoefficientDomain,% CofactorExpansion,ColonForm,ColorFunctionScaling,ColorRules,% ColorSelectorSettings,Column,ColumnAlignments,ColumnLines,% ColumnsEqual,ColumnSpacings,ColumnWidths,CommonDefaultFormatTypes,% CompileOptimizations,CompletionsListPacket,Complexes,ComplexityFunction,% Compose,ComposeSeries,ConfigurationPath,ConjugateTranspose,% Connect,ConsoleMessage,ConsoleMessagePacket,ConsolePrint,% ContentsBoundingBox,ContextToFileName,ContinuedFraction,ConversionOptions,% ConversionRules,ConvertToBitmapPacket,ConvertToPostScript,ConvertToPostScriptPacket,% Copyable,CoshIntegral,CounterAssignments,CounterBox,% CounterBoxOptions,CounterEvaluator,CounterFunction,CounterIncrements,% CounterStyle,CounterStyleMenuListing,CreatePalettePacket,Cross,% CurrentlySpeakingPacket,Cyan,CylindricalDecomposition,DampingFactor,% DataRange,Debug,DebugTag,Decimal,% DedekindEta,DefaultDuplicateCellStyle,DefaultFontProperties,DefaultFormatType,% DefaultFormatTypeForStyle,DefaultInlineFormatType,DefaultInputFormatType, DefaultNaturalLanguage,% DefaultNewCellStyle,DefaultNewInlineCellStyle,DefaultNotebook,DefaultOutputFormatType,% DefaultStyleDefinitions,DefaultTextFormatType,DefaultTextInlineFormatType,DefaultValues,% DefineExternal,DegreeLexicographic,DegreeReverseLexicographic,Deletable,% DeleteContents,DeletionWarning,DelimiterFlashTime,DelimiterMatching,% Delimiters,DependentVariables,DiacriticalPositioning,DialogLevel,% DifferenceOrder,DigitCharacter,DigitCount,DiracDelta,% Direction,DirectoryName,DisableConsolePrintPacket,DiscreteDelta,% DisplayAnimation,DisplayEndPacket,DisplayFlushImagePacket,DisplayForm,% DisplayPacket,DisplayRules,DisplaySetSizePacket,DisplayString,% DivisionFreeRowReduction,DOSTextFormat,DoubleExponential,DoublyInfinite,% Down,DragAndDrop,DrawHighlighted,DualLinearProgramming,% DumpGet,DumpSave,Edit,Editable,% EditButtonSettings,EditCellTagsSettings,EditDefinition,EditIn,% Element,EliminationOrder,EllipticExpPrime,EllipticNomeQ,% EllipticReducedHalfPeriods,EllipticThetaPrime,Empty,EnableConsolePrintPacket,% Encoding,EndAdd,EndDialogPacket,EndFrontEndInteractionPacket,% EndOfLine,EndOfString,Enter,EnterExpressionPacket,% EnterTextPacket,EqualColumns,EqualRows,EquatedTo,% Erfi,ErrorBox,ErrorBoxOptions,ErrorNorm,% ErrorPacket,ErrorsDialogSettings,Evaluatable,EvaluatePacket,% EvaluationCell,EvaluationCompletionAction,EvaluationMonitor,EvaluationNotebook,% Evaluator,EvaluatorNames,EventEvaluator,ExactNumberQ,% ExactRootIsolation,Except,ExcludedForms,Exists,% ExitDialog,ExponentPosition,ExponentStep,Export,% ExportAutoReplacements,ExportPacket,ExportString,ExpressionPacket,% ExpToTrig,Extension,ExternalCall,ExternalDataCharacterEncoding,% Extract,Fail,FEDisableConsolePrintPacket,FEEnableConsolePrintPacket,% Fibonacci,File,FileFormat,FileInformation,% FileName,FileNameDialogSettings,FindFit,FindInstance,% FindMaximum,FindSettings,FitAll,FlushPrintOutputPacket,% Font,FontColor,FontFamily,FontName,% FontPostScriptName,FontProperties,FontReencoding,FontSize,% FontSlant,FontSubstitutions,FontTracking,FontVariations,% FontWeight,ForAll,FormatRules,FormatTypeAutoConvert,% FormatValues,FormBox,FormBoxOptions,Forward,% ForwardBackward,FourierCosTransform,FourierParameters,FourierSinTransform,% FourierTransform,FractionalPart,FractionBox,FractionBoxOptions,% FractionLine,FrameBox,FrameBoxOptions,FresnelC,% FresnelS,FromContinuedFraction,FromDigits,FrontEndExecute,% FrontEndObject,FrontEndStackSize,FrontEndToken,FrontEndTokenExecute,% FrontEndVersion,Full,FullAxes,FullSimplify,% FunctionExpand,FunctionInterpolation,GaussKronrod,GaussPoints,% GenerateBitmapCaches,GenerateConditions,GeneratedCell,GeneratedParameters,% Generic,GetBoundingBoxSizePacket,GetContext,GetFileName,% GetFrontEndOptionsDataPacket,GetLinebreakInformationPacket,% GetMenusPacket,GetPageBreakInformationPacket,% Glaisher,GlobalPreferences,GlobalSession,Gradient,% GraphicsData,GraphicsGrouping,Gray,Green,% Grid,GridBaseline,GridBox,GridBoxOptions,% GridCreationSettings,GridDefaultElement,GridFrame,GridFrameMargins,% GroupPageBreakWithin,HarmonicNumber,Hash,HashTable,% HeadCompose,HelpBrowserLookup,HelpBrowserNotebook,HelpBrowserSettings,% HessenbergDecomposition,Hessian,HoldAllComplete,HoldComplete,% HoldPattern,Horizontal,HorizontalForm,HorizontalScrollPosition,% HTMLSave,Hypergeometric0F1Regularized,Hypergeometric1F1Regularized,% Hypergeometric2F1Regularized,% HypergeometricPFQ,HypergeometricPFQRegularized,HyperlinkCreationSettings,Hyphenation,% HyphenationOptions,IgnoreCase,ImageCache,ImageCacheValid,% ImageMargins,ImageOffset,ImageRangeCache,ImageRegion,% ImageResolution,ImageRotated,ImageSize,Import,% ImportAutoReplacements,ImportString,IncludeFileExtension,IncludeSingularTerm,% IndentingNewlineSpacings,IndentMaxFraction,IndexCreationOptions,Inequality,% InexactNumberQ,InexactNumbers,Inherited,InitializationCell,% InitializationCellEvaluation,InitializationCellWarning,% InlineCounterAssignments,InlineCounterIncrements,% InlineRules,InputAliases,InputAutoFormat,InputAutoReplacements,% InputGrouping,InputNamePacket,InputNotebook,InputPacket,% InputSettings,InputStringPacket,InputToBoxFormPacket,InputToInputForm,% InputToStandardForm,InsertionPointObject,IntegerExponent,IntegerPart,% Integers,Interactive,Interlaced,InterpolationOrder,% InterpolationPoints,InterpolationPrecision,InterpretationBox,% InterpretationBoxOptions,% InterpretTemplate,InterruptSettings,Interval,IntervalIntersection,% IntervalMemberQ,IntervalUnion,InverseBetaRegularized,InverseEllipticNomeQ,% InverseErf,InverseErfc,InverseFourierCosTransform, InverseFourierSinTransform,% InverseFourierTransform,InverseGammaRegularized,InverseJacobiCD,% InverseJacobiCN,% InverseJacobiCS,InverseJacobiDC,InverseJacobiDN,InverseJacobiDS,% InverseJacobiNC,InverseJacobiND,InverseJacobiNS,InverseJacobiSC,% InverseJacobiSD,InverseLaplaceTransform,InverseWeierstrassP,InverseZTransform,% Jacobian,JacobiCD,JacobiCN,JacobiCS,% JacobiDC,JacobiDN,JacobiDS,JacobiNC,% JacobiND,JacobiNS,JacobiSC,JacobiSD,% JordanDecomposition,K,Khinchin,KleinInvariantJ,% KroneckerDelta,Language,LanguageCategory,LaplaceTransform,% Larger,Launch,LayoutInformation,Left,% LetterCharacter,Lexicographic,LicenseID,LimitsPositioning,% LimitsPositioningTokens,LinearSolveFunction,LinebreakAdjustments,LineBreakWithin,% LineForm,LineIndent,LineSpacing,LineWrapParts,% LinkActivate,LinkClose,LinkConnect,LinkConnectedQ,% LinkCreate,LinkError,LinkFlush,LinkHost,% LinkInterrupt,LinkLaunch,LinkMode,LinkObject,% LinkOpen,LinkOptions,LinkPatterns,LinkProtocol,% LinkRead,LinkReadHeld,LinkReadyQ,Links,% LinkWrite,LinkWriteHeld,ListConvolve,ListCorrelate,% Listen,ListInterpolation,ListQ,LiteralSearch,% LongestMatch,LongForm,Loopback,LUBackSubstitution,% LUDecomposition,MachineID,MachineName,MachinePrecision,% MacintoshSystemPageSetup,Magenta,Magnification,MakeBoxes,% MakeExpression,MakeRules,Manual,MatchLocalNameQ,% MathematicaNotation,MathieuC,MathieuCharacteristicA,MathieuCharacteristicB,% MathieuCharacteristicExponent,MathieuCPrime,MathieuS,MathieuSPrime,% MathMLForm,MathMLText,MatrixRank,Maximize,% MaxIterations,MaxPlotPoints,MaxPoints,MaxRecursion,% MaxStepFraction,MaxSteps,MaxStepSize,Mean,% Median,MeijerG,MenuPacket,MessageOptions,% MessagePacket,MessagesNotebook,MetaCharacters,Method,% MethodOptions,Minimize,MinRecursion,MinSize,% Mode,ModularLambda,MonomialOrder,MonteCarlo,% Most,MousePointerNote,MultiDimensional,MultilaunchWarning,% MultilineFunction,MultiplicativeOrder,Multiplicity,Nand,% NeedCurrentFrontEndPackagePacket,NeedCurrentFrontEndSymbolsPacket,% NestedScriptRules,NestWhile,% NestWhileList,NevilleThetaC,NevilleThetaD,NevilleThetaN,% NevilleThetaS,Newton,Next,NHoldAll,% NHoldFirst,NHoldRest,NMaximize,NMinimize,% NonAssociative,NonPositive,Nor,Norm,% NormalGrouping,NormalSelection,NormFunction,Notebook,% NotebookApply,NotebookAutoSave,NotebookClose,NotebookConvert,% NotebookConvertSettings,NotebookCreate,NotebookCreateReturnObject,NotebookDefault,% NotebookDelete,NotebookDirectory,NotebookFind,NotebookFindReturnObject,% NotebookGet,NotebookGetLayoutInformationPacket,NotebookGetMisspellingsPacket,% NotebookInformation,% NotebookLocate,NotebookObject,NotebookOpen,NotebookOpenReturnObject,% NotebookPath,NotebookPrint,NotebookPut,NotebookPutReturnObject,% NotebookRead,NotebookResetGeneratedCells,Notebooks,NotebookSave,% NotebookSaveAs,NotebookSelection,NotebookSetupLayoutInformationPacket,% NotebooksMenu,% NotebookWrite,NotElement,NProductExtraFactors,NProductFactors,% NRoots,NSumExtraTerms,NSumTerms,NumberMarks,% NumberMultiplier,NumberString,NumericFunction,NumericQ,% NValues,Offset,OLEData,OneStepRowReduction,% Open,OpenFunctionInspectorPacket,OpenSpecialOptions,OptimizationLevel,% OptionInspectorSettings,OptionQ,OptionsPacket,OptionValueBox,% OptionValueBoxOptions,Orange,Ordering,Oscillatory,% OutputAutoOverwrite,OutputFormData,OutputGrouping,OutputMathEditExpression,% OutputNamePacket,OutputToOutputForm,OutputToStandardForm,Over,% Overflow,Overlaps,Overscript,OverscriptBox,% OverscriptBoxOptions,OwnValues,PadLeft,PadRight,% PageBreakAbove,PageBreakBelow,PageBreakWithin,PageFooterLines,% PageFooters,PageHeaderLines,PageHeaders,PalettePath,% PaperWidth,ParagraphIndent,ParagraphSpacing,ParameterVariables,% ParentConnect,ParentForm,Parenthesize,PasteBoxFormInlineCells,% Path,PatternTest,PeriodicInterpolation,Pick,% Piecewise,PiecewiseExpand,Pink,Pivoting,% PixelConstrained,Placeholder,Plain,Plot3Matrix,% PointForm,PolynomialForm,PolynomialReduce,Polynomials,% PowerModList,Precedence,PreferencesPath,PreserveStyleSheet,% Previous,PrimaryPlaceholder,Primes,PrincipalValue,% PrintAction,PrintingCopies,PrintingOptions,PrintingPageRange,% PrintingStartingPageNumber,PrintingStyleEnvironment,PrintPrecision,% PrivateCellOptions,% PrivateEvaluationOptions,PrivateFontOptions,PrivateNotebookOptions,PrivatePaths,% ProductLog,PromptForm,Purple,Quantile,% QuasiMonteCarlo,QuasiNewton,RadicalBox,RadicalBoxOptions,% RandomSeed,RationalFunctions,Rationals,RawData,% RawMedium,RealBlockForm,Reals,Reap,% Red,Refine,Refresh,RegularExpression,% Reinstall,Release,Removed,RenderingOptions,% RepeatedString,ReplaceList,Rescale,ResetMenusPacket,% Resolve,ResumePacket,ReturnExpressionPacket,ReturnInputFormPacket,% ReturnPacket,ReturnTextPacket,Right,Root,% RootReduce,RootSum,Row,RowAlignments,% RowBox,RowLines,RowMinHeight,RowsEqual,% RowSpacings,RSolve,RuleCondition,RuleForm,% RulerUnits,Saveable,SaveAutoDelete,ScreenRectangle,% ScreenStyleEnvironment,ScriptBaselineShifts,ScriptLevel,ScriptMinSize,% ScriptRules,ScriptSizeMultipliers,ScrollingOptions,ScrollPosition,% Second,SectionGrouping,Selectable,SelectedNotebook,% Selection,SelectionAnimate,SelectionCell,SelectionCellCreateCell,% SelectionCellDefaultStyle,SelectionCellParentStyle,SelectionCreateCell,% SelectionDuplicateCell,% SelectionEvaluate,SelectionEvaluateCreateCell,SelectionMove,SelectionSetStyle,% SelectionStrategy,SendFontInformationToKernel,SequenceHold,SequenceLimit,% SeriesCoefficient,SetBoxFormNamesPacket,SetEvaluationNotebook,% SetFileLoadingContext,% SetNotebookStatusLine,SetOptionsPacket,SetSelectedNotebook,% SetSpeechParametersPacket,% SetValue,ShortestMatch,ShowAutoStyles,ShowCellBracket,% ShowCellLabel,ShowCellTags,ShowClosedCellArea,ShowContents,% ShowCursorTracker,ShowGroupOpenCloseIcon,ShowPageBreaks,ShowSelection,% ShowShortBoxForm,ShowSpecialCharacters,ShowStringCharacters,% ShrinkWrapBoundingBox,% SingleLetterItalics,SingularityDepth,SingularValueDecomposition,% SingularValueList,% SinhIntegral,Smaller,Socket,SolveDelayed,% SoundAndGraphics,Sow,Space,SpaceForm,% SpanAdjustments,SpanCharacterRounding,SpanLineThickness,SpanMaxSize,% SpanMinSize,SpanningCharacters,SpanSymmetric,Sparse,% SparseArray,SpeakTextPacket,SpellingDictionaries,SpellingDictionariesPath,% SpellingOptions,SpellingSuggestionsPacket,Spherical,Split,% SqrtBox,SqrtBoxOptions,StandardDeviation,StandardForm,% StartingStepSize,StartOfLine,StartOfString,StartupSound,% StepMonitor,StieltjesGamma,StoppingTest,StringCases,% StringCount,StringExpression,StringFreeQ,StringQ,% StringReplaceList,StringReplacePart,StringSplit,StripBoxes,% StripWrapperBoxes,StructuredSelection,StruveH,StruveL,% StyleBox,StyleBoxAutoDelete,StyleBoxOptions,StyleData,% StyleDefinitions,StyleForm,StyleMenuListing,StyleNameDialogSettings,% StylePrint,StyleSheetPath,Subresultants,SubscriptBox,% SubscriptBoxOptions,Subsets,Subsuperscript,SubsuperscriptBox,% SubsuperscriptBoxOptions,SubtractFrom,SubValues,SugarCube,% SuperscriptBox,SuperscriptBoxOptions,SuspendPacket,SylvesterMatrix,% SymbolName,Syntax,SyntaxForm,SyntaxPacket,% SystemException,SystemHelpPath,SystemStub,Tab,% TabFilling,TabSpacings,TagBox,TagBoxOptions,% TaggingRules,TagStyle,TargetFunctions,TemporaryVariable,% TensorQ,TeXSave,TextAlignment,TextBoundingBox,% TextData,TextJustification,TextLine,TextPacket,% TextParagraph,TextRendering,TextStyle,ThisLink,% TimeConstraint,TimeVariable,TitleGrouping,ToBoxes,% ToColor,ToFileName,Toggle,ToggleFalse,% Tolerance,TooBig,Top,ToRadicals,% Total,Tr,TraceAction,TraceInternal,% TraceLevel,TraditionalForm,TraditionalFunctionNotation,TraditionalNotation,% TraditionalOrder,TransformationFunctions,TransparentColor,Trapezoidal,% TrigExpand,TrigFactor,TrigFactorList,TrigReduce,% TrigToExp,Tuples,UnAlias,Underflow,% Underoverscript,UnderoverscriptBox,UnderoverscriptBoxOptions,Underscript,% UnderscriptBox,UnderscriptBoxOptions,UndocumentedTestFEParserPacket,% UndocumentedTestGetSelectionPacket,% UnitStep,Up,URL,Using,% V2Get,Value,ValueBox,ValueBoxOptions,% ValueForm,Variance,Verbatim,Verbose,% VerboseConvertToPostScriptPacket,VerifyConvergence,VerifySolutions,Version,% VersionNumber,Vertical,VerticalForm,ViewPointSelectorSettings,% Visible,VisibleCell,WeierstrassHalfPeriods,WeierstrassInvariants,% WeierstrassSigma,WeierstrassZeta,White,Whitespace,% WhitespaceCharacter,WindowClickSelect,WindowElements,WindowFloating,% WindowFrame,WindowFrameElements,WindowMargins,WindowMovable,% WindowSize,WindowTitle,WindowToolbars,WindowWidth,% WordBoundary,WordCharacter,WynnDegree,XMLElement},% morendkeywords={$,$AddOnsDirectory,$AnimationDisplayFunction,% $AnimationFunction,% $Assumptions,$BaseDirectory,$BoxForms,$ByteOrdering,% $CharacterEncoding,$ConditionHold,$CurrentLink,$DefaultPath,% $ExportEncodings,$ExportFormats,$FormatType,$FrontEnd,% $HistoryLength,$HomeDirectory,$ImportEncodings,$ImportFormats,% $InitialDirectory,$InstallationDate,$InstallationDirectory,% $InterfaceEnvironment,% $LaunchDirectory,$LicenseExpirationDate,$LicenseID,$LicenseProcesses,% $LicenseServer,$MachineDomain,$MaxExtraPrecision,$MaxLicenseProcesses,% $MaxNumber,$MaxPiecewiseCases,$MaxPrecision,$MaxRootDegree,% $MinNumber,$MinPrecision,$NetworkLicense,$NumberMarks,% $Off,$OutputForms,$ParentLink,$ParentProcessID,% $PasswordFile,$PathnameSeparator,$PreferencesDirectory,$PrintForms,% $PrintLiteral,$ProcessID,$ProcessorType,$ProductInformation,% $ProgramName,$PSDirectDisplay,$RandomState,$RasterFunction,% $RootDirectory,$SetParentLink,$SoundDisplay,$SuppressInputFormHeads,% $SystemCharacterEncoding,$SystemID,$TemporaryPrefix,$TextStyle,% $TopDirectory,$TraceOff,$TraceOn,$TracePattern,% $TracePostAction,$TracePreAction,$UserAddOnsDirectory,$UserBaseDirectory,% $UserName,Constant,Flat,HoldAll,% HoldAllComplete,HoldFirst,HoldRest,Listable,% Locked,NHoldAll,NHoldFirst,NHoldRest,% NumericFunction,OneIdentity,Orderless,Protected,% ReadProtected,SequenceHold},% }% %% %% Mathematica definitions (c) 1999 Michael Wiese %% \lst@definelanguage[3.0]{Mathematica}[1.0]{Mathematica}% {morekeywords={Abort,AbortProtect,AbsoluteDashing,AbsolutePointSize,% AbsoluteThickness,AbsoluteTime,AccountingFormAiry,AiPrime,AiryBi,% AiryBiPrime,Alternatives,AnchoredSearch,AxesEdge,AxesOrigin,% AxesStyle,Background,BetaRegularized,BoxStyle,C,CheckAbort,% Circle,ClebschGordan,CMYKColor,ColorFunction,ColorOutput,Compile,% Compiled,CompiledFunction,ComplexExpand,ComposeList,Composition,% ConstrainedMax,ConstrainedMin,Contexts,ContextToFilename,% ContourLines,Contours,ContourShading,ContourSmoothing,% ContourStyle,CopyDirectory,CopyFile,CosIntegral,CreateDirectory,% Cuboid,Date,DeclarePackage,DefaultColor,DefaultFont,Delete,% DeleteCases,DeleteDirectory,DeleteFile,Dialog,DialogIndent,% DialogProlog,DialogSymbols,DigitQ,Directory,DirectoryStack,Disk,% Dispatch,DownValues,DSolve,Encode,Epilog,Erfc,Evaluate,% ExponentFunction,FaceGrids,FileByteCount,FileDate,FileNames,% FileType,Find,FindList,FixedPointList,FlattenAt,Fold,FoldList,% Frame,FrameLabel,FrameStyle,FrameTicks,FromCharacterCode,% FromDate,FullGraphics,FullOptions,GammaRegularized,% GaussianIntegers,GraphicsArray,GraphicsSpacing,GridLines,% GroebnerBasis,Heads,HeldPart,HomeDirectory,Hue,IgnoreCases,% InputStream,Install,InString,IntegerDigits,InterpolatingFunction,% InterpolatingPolynomial,Interpolation,Interrupt,InverseFunction,% InverseFunctions,JacobiZeta,LetterQ,LinearProgramming,ListPlay,% LogGamma,LowerCaseQ,MachineNumberQ,MantissaExponent,MapIndexed,% MapThread,MatchLocalNames,MatrixExp,MatrixPower,MeshRange,% MeshStyle,MessageList,Module,NDSolve,NSolve,NullRecords,% NullWords,NumberFormat,NumberPadding,NumberSigns,OutputStream,% PaddedForm,ParentDirectory,Pause,Play,PlayRange,PlotRegion,% PolygonIntersections,PolynomialGCD,PolynomialLCM,PolynomialMod,% PostScript,PowerExpand,PrecisionGoal,PrimePi,Prolog,% QRDecomposition,Raster,RasterArray,RealDigits,Record,RecordLists,% RecordSeparators,ReleaseHold,RenameDirectory,RenameFile,% ReplaceHeldPart,ReplacePart,ResetDirectory,Residue,% RiemannSiegelTheta,RiemannSiegelZ,RotateLabel,SameTest,% SampleDepth,SampledSoundFunction,SampledSoundList,SampleRate,% SchurDecomposition,SessionTime,SetAccuracy,SetDirectory,% SetFileDate,SetPrecision,SetStreamPosition,Shallow,SignPadding,% SinIntegral,SixJSymbol,Skip,Sound,SpellingCorrection,% SphericalRegion,Stack,StackBegin,StackComplete,StackInhibit,% StreamPosition,Streams,StringByteCount,StringConversion,% StringDrop,StringInsert,StringPosition,StringReplace,% StringReverse,StringTake,StringToStream,SurfaceColor,% SyntaxLength,SyntaxQ,TableAlignments,TableDepth,% TableDirections,TableHeadings,TableSpacing,ThreeJSymbol,TimeUsed,% TimeZone,ToCharacterCode,ToDate,ToHeldExpression,TokenWords,% ToLowerCase,ToUpperCase,Trace,TraceAbove,TraceBackward,% TraceDepth,TraceDialog,TraceForward,TraceOff,TraceOn,% TraceOriginal,TracePrint,TraceScan,Trig,Unevaluated,Uninstall,% UnsameQ,UpperCaseQ,UpValues,ViewCenter,ViewVertical,With,Word,% WordSearch,WordSeparators},% morendkeywords={Stub,Temporary,$Aborted,$BatchInput,$BatchOutput,% $CreationDate,$DefaultFont,$DumpDates,$DumpSupported,$Failed,% $Input,$Inspector,$IterationLimit,$Language,$Letters,$Linked,% $LinkSupported,$MachineEpsilon,$MachineID,$MachineName,% $MachinePrecision,$MachineType,$MaxMachineNumber,$MessageList,% $MessagePrePrint,$MinMachineNumber,$ModuleNumber,$NewMessage,% $NewSymbol,$Notebooks,$OperatingSystem,$Packages,$PipeSupported,% $PreRead,$ReleaseNumber,$SessionID,$SoundDisplayFunction,% $StringConversion,$StringOrder,$SyntaxHandler,$TimeUnit,% $VersionNumber}% }% \lst@definelanguage[1.0]{Mathematica}% {morekeywords={Abs,Accuracy,AccurayGoal,AddTo,AiryAi,AlgebraicRules,% AmbientLight,And,Apart,Append,AppendTo,Apply,ArcCos,ArcCosh,% ArcCot,ArcCoth,ArcCsc,ArcCsch,ArcSec,ArcSech,ArcSin,ArcSinh,% ArcTan,ArcTanh,Arg,ArithmeticGeometricMean,Array,AspectRatio,% AtomQ,Attributes,Axes,AxesLabel,BaseForm,Begin,BeginPackage,% BernoulliB,BesselI,BesselJ,BesselK,BesselY,Beta,Binomial,Blank,% BlankNullSequence,BlankSequence,Block,Boxed,BoxRatios,Break,Byte,% ByteCount,Cancel,Cases,Catch,Ceiling,CForm,Character,Characters,% ChebyshevT,ChebyshevU,Check,Chop,Clear,ClearAll,ClearAttributes,% ClipFill,Close,Coefficient,CoefficientList,Collect,ColumnForm,% Complement,Complex,CompoundExpression,Condition,Conjugate,% Constants,Context,Continuation,Continue,ContourGraphics,% ContourPlot,Cos,Cosh,Cot,Coth,Count,Csc,Csch,Cubics,Cyclotomic,% D,Dashing,Decompose,Decrement,Default,Definition,Denominator,% DensityGraphics,DensityPlot,Depth,Derivative,Det,DiagonalMatrix,% DigitBlock,Dimensions,DirectedInfinity,Display,DisplayFunction,% Distribute,Divide,DivideBy,Divisors,DivisorSigma,Do,Dot,Drop,Dt,% Dump,EdgeForm,Eigensystem,Eigenvalues,Eigenvectors,Eliminate,% EllipticE,EllipticExp,EllipticF,EllipticK,EllipticLog,EllipticPi,% EllipticTheta,End,EndPackage,EngineeringForm,Environment,Equal,% Erf,EulerE,EulerPhi,EvenQ,Exit,Exp,Expand,ExpandAll,% ExpandDenominator,ExpandNumerator,ExpIntegralE,ExpIntegralEi,% Exponent,Expression,ExtendedGCD,FaceForm,Factor,FactorComplete,% Factorial,Factorial2,FactorInteger,FactorList,FactorSquareFree,% FactorSquareFreeList,FactorTerms,FactorTermsList,FindMinimum,% FindRoot,First,Fit,FixedPoint,Flatten,Floor,FontForm,For,Format,% FormatType,FortranForm,Fourier,FreeQ,FullDefinition,FullForm,% Function,Gamma,GCD,GegenbauerC,General,Get,Goto,Graphics,% Graphics3D,GrayLevel,Greater,GreaterEqual,Head,HermiteH,% HiddenSurface,Hold,HoldForm,Hypergeometric0F1,Hypergeometric1F1,% Hypergeometric2F1,HypergeometricU,Identity,IdentityMatrix,If,Im,% Implies,In,Increment,Indent,Infix,Information,Inner,Input,% InputForm,InputString,Insert,Integer,IntegerQ,Integrate,% Intersection,Inverse,InverseFourier,InverseJacobiSN,% InverseSeries,JacobiAmplitude,JacobiP,JacobiSN,JacobiSymbol,Join,% Label,LaguerreL,Last,LatticeReduce,LCM,LeafCount,LegendreP,% LegendreQ,LegendreType,Length,LerchPhi,Less,LessEqual,Level,% Lighting,LightSources,Limit,Line,LinearSolve,LineBreak,List,% ListContourPlot,ListDensityPlot,ListPlot,ListPlot3D,Literal,Log,% LogicalExpand,LogIntegral,MainSolve,Map,MapAll,MapAt,MatchQ,% MatrixForm,MatrixQ,Max,MaxBend,MaxMemoryUsed,MemberQ,% MemoryConstrained,MemoryInUse,Mesh,Message,MessageName,Messages,% Min,Minors,Minus,Mod,Modulus,MoebiusMu,Multinomial,N,NameQ,Names,% NBernoulliB,Needs,Negative,Nest,NestList,NIntegrate,% NonCommutativeMultiply,NonConstants,NonNegative,Normal,Not,% NProduct,NSum,NullSpace,Number,NumberForm,NumberPoint,NumberQ,% NumberSeparator,Numerator,O,OddQ,Off,On,OpenAppend,OpenRead,% OpenTemporary,OpenWrite,Operate,Optional,Options,Or,Order,% OrderedQ,Out,Outer,OutputForm,PageHeight,PageWidth,% ParametricPlot,ParametricPlot3D,Part,Partition,PartitionsP,% PartitionsQ,Pattern,Permutations,Plot,Plot3D,PlotDivision,% PlotJoined,PlotLabel,PlotPoints,PlotRange,PlotStyle,Pochhammer,% Plus,Point,PointSize,PolyGamma,Polygon,PolyLog,PolynomialQ,% PolynomialQuotient,PolynomialRemainder,Position,Positive,Postfix,% Power,PowerMod,PrecedenceForm,Precision,PreDecrement,Prefix,% PreIncrement,Prepend,PrependTo,Prime,PrimeQ,Print,PrintForm,% Product,Protect,PseudoInverse,Put,PutAppend,Quartics,Quit,% Quotient,Random,Range,Rational,Rationalize,Raw,Re,Read,ReadList,% Real,Rectangle,Reduce,Remove,RenderAll,Repeated,RepeatedNull,% Replace,ReplaceAll,ReplaceRepeated,Rest,Resultant,Return,Reverse,% RGBColor,Roots,RotateLeft,RotateRight,Round,RowReduce,Rule,% RuleDelayed,Run,RunThrough,SameQ,Save,Scaled,Scan,ScientificForm,% Sec,Sech,SeedRandom,Select,Sequence,SequenceForm,Series,% SeriesData,Set,SetAttributes,SetDelayed,SetOptions,Shading,Share,% Short,Show,Sign,Signature,Simplify,Sin,SingularValues,Sinh,% Skeleton,Slot,SlotSequence,Solve,SolveAlways,Sort,% SphericalHarmonicY,Splice,Sqrt,StirlingS1,StirlingS2,String,% StringBreak,StringForm,StringJoin,StringLength,StringMatchQ,% StringSkeleton,Subscript,Subscripted,Subtract,SubtractForm,Sum,% Superscript,SurfaceGraphics,Switch,Symbol,Table,TableForm,TagSet,% TagSetDelayed,TagUnset,Take,Tan,Tanh,ToString,TensorRank,TeXForm,% Text,TextForm,Thickness,Thread,Through,Throw,Ticks,% TimeConstrained,Times,TimesBy,Timing,ToExpression,Together,% ToRules,ToString,TotalHeight,TotalWidth,Transpose,TreeForm,TrueQ,% Unequal,Union,Unique,Unprotect,Unset,Update,UpSet,UpSetDelayed,% ValueQ,Variables,VectorQ,ViewPoint,WeierstrassP,% WeierstrassPPrime,Which,While,WorkingPrecision,Write,WriteString,% Xor,ZeroTest,Zeta},% morendkeywords={All,Automatic,Catalan,ComplexInfinity,Constant,% Degree,E,EndOfFile,EulerGamma,False,Flat,GoldenRatio,HoldAll,% HoldFirst,HoldRest,I,Indeterminate,Infinity,Listable,Locked,% Modular,None,Null,OneIdentity,Orderless,Pi,Protected,% ReadProtected,True,$CommandLine,$Context,$ContextPath,$Display,% $DisplayFunction,$Echo,$Epilog,$IgnoreEOF,$Line,$Messages,% $Output,$Path,$Post,$Pre,$PrePrint,$RecursionLimit,$System,% $Urgent,$Version},% sensitive,% morecomment=[s]{(*}{*)},% morestring=[d]"% }[keywords,comments,strings]% %% %% Octave definition (c) 2001,2002 Ulrich G. Wortmann %% \lst@definelanguage{Octave}% {morekeywords={gt,lt,amp,abs,acos,acosh,acot,acoth,acsc,acsch,% all,angle,ans,any,asec,asech,asin,asinh,atan,atan2,atanh,auread,% auwrite,axes,axis,balance,bar,bessel,besselk,bessely,beta,% betainc,betaln,blanks,bone,break,brighten,capture,cart2pol,% cart2sph,caxis,cd,cdf2rdf,cedit,ceil,chol,cla,clabel,clc,clear,% clf,clock,close,colmmd,Colon,colorbar,colormap,ColorSpec,colperm,% comet,comet3,compan,compass,computer,cond,condest,conj,contour,% contour3,contourc,contrast,conv,conv2,cool,copper,corrcoef,cos,% cosh,cot,coth,cov,cplxpair,cputime,cross,csc,csch,csvread,% csvwrite,cumprod,cumsum,cylinder,date,dbclear,dbcont,dbdown,% dbquit,dbstack,dbstatus,dbstep,dbstop,dbtype,dbup,ddeadv,ddeexec,% ddeinit,ddepoke,ddereq,ddeterm,ddeunadv,deblank,dec2hex,deconv,% del2,delete,demo,det,diag,diary,diff,diffuse,dir,disp,dlmread,% dlmwrite,dmperm,dot,drawnow,echo,eig,ellipj,ellipke,else,elseif,% end,engClose,engEvalString,engGetFull,engGetMatrix,engOpen,% engOutputBuffer,engPutFull,engPutMatrix,engSetEvalCallback,% engSetEvalTimeout,engWinInit,eps,erf,erfc,erfcx,erfinv,% errorbar,etime,etree,eval,exist,exp,expint,expm,expo,eye,fclose,% feather,feof,ferror,feval,fft,fft2,fftshift,fgetl,fgets,figure,% fill,fill3,filter,filter2,find,findstr,finite,fix,flag,fliplr,% flipud,floor,flops,fmin,fmins,fopen,for,format,fplot,fprintf,% fread,frewind,fscanf,fseek,ftell,full,function,funm,fwrite,fzero,% gallery,gamma,gammainc,gammaln,gca,gcd,gcf,gco,get,getenv,% getframe,ginput,global,gplot,gradient,gray,graymon,grid,griddata,% gtext,hadamard,hankel,help,hess,hex2dec,hex2num,hidden,hilb,hist,% hold,home,hostid,hot,hsv,hsv2rgb,if,ifft,ifft2,imag,image,% imagesc,Inf,info,input,int2str,interp1,interp2,interpft,inv,% invhilb,isempty,isglobal,ishold,isieee,isinf,isletter,isnan,% isreal,isspace,issparse,isstr,jet,keyboard,kron,lasterr,lcm,% legend,legendre,length,lin2mu,line,linspace,load,log,log10,log2,% loglog,logm,logspace,lookfor,lower,ls,lscov,lu,magic,matClose,% matDeleteMatrix,matGetDir,matGetFp,matGetFull,matGetMatrix,% matGetNextMatrix,matGetString,matlabrc,matlabroot,matOpen,% matPutFull,matPutMatrix,matPutString,max,mean,median,menu,mesh,% meshc,meshgrid,meshz,mexAtExit,mexCallMATLAB,mexdebug,% mexErrMsgTxt,mexEvalString,mexFunction,mexGetFull,mexGetMatrix,% mexGetMatrixPtr,mexPrintf,mexPutFull,mexPutMatrix,mexSetTrapFlag,% min,more,movie,moviein,mu2lin,mxCalloc,mxCopyCharacterToPtr,% mxCopyComplex16ToPtr,mxCopyInteger4ToPtr,mxCopyPtrToCharacter,% mxCopyPtrToComplex16,mxCopyPtrToInteger4,mxCopyPtrToReal8,% mxCopyReal8ToPtr,mxCreateFull,mxCreateSparse,mxCreateString,% mxFree,mxFreeMatrix,mxGetIr,mxGetJc,mxGetM,mxGetN,mxGetName,% mxGetNzmax,mxGetPi,mxGetPr,mxGetScalar,mxGetString,mxIsComplex,% mxIsFull,mxIsNumeric,mxIsSparse,mxIsString,mxIsTypeDouble,% mxSetIr,mxSetJc,mxSetM,mxSetN,mxSetName,mxSetNzmax,mxSetPi,% mxSetPr,NaN,nargchk,nargin,nargout,newplot,nextpow2,nnls,nnz,% nonzeros,norm,normest,null,num2str,nzmax,ode23,ode45,orient,orth,% pack,pascal,patch,path,pause,pcolor,pi,pink,pinv,plot,plot3,% pol2cart,polar,poly,polyder,polyeig,polyfit,polyval,polyvalm,% pow2,print,printopt,prism,prod,pwd,qr,qrdelete,qrinsert,quad,% quad8,quit,quiver,qz,rand,randn,randperm,rank,rat,rats,rbbox,% rcond,real,realmax,realmin,refresh,rem,reset,reshape,residue,% return,rgb2hsv,rgbplot,rootobject,roots,rose,rosser,rot90,rotate,% round,rref,rrefmovie,rsf2csf,save,saxis,schur,sec,sech,semilogx,% semilogy,set,setstr,shading,sign,sin,sinh,size,slice,sort,sound,% spalloc,sparse,spaugment,spconvert,spdiags,specular,speye,spfun,% sph2cart,sphere,spinmap,spline,spones,spparms,sprandn,sprandsym,% sprank,sprintf,spy,sqrt,sqrtm,sscanf,stairs,startup,std,stem,% str2mat,str2num,strcmp,strings,strrep,strtok,subplot,subscribe,% subspace,sum,surf,surface,surfc,surfl,surfnorm,svd,symbfact,% symmmd,symrcm,tan,tanh,tempdir,tempname,terminal,text,tic,title,% toc,toeplitz,trace,trapz,tril,triu,type,uicontrol,uigetfile,% uimenu,uiputfile,unix,unwrap,upper,vander,ver,version,view,% viewmtx,waitforbuttonpress,waterfall,wavread,wavwrite,what,% whatsnew,which,while,white,whitebg,who,whos,wilkinson,wk1read,% stderr,stdout,plot,set,endif,wk1write,xlabel,xor,ylabel,zeros,% zlabel,zoom,endwhile,endfunction,printf,case,switch,otherwise,% system,lsode,endfor,error,ones,oneplot,__gnuplot_set__,do,until},% sensitive=t,% morecomment=[l]\#,% morecomment=[l]\#\#,% morecomment=[l]\%,% morestring=[m]',% morestring=[m]"% }[keywords,comments,strings]% \lst@definelanguage[XSC]{Pascal}[Standard]{Pascal} {deletekeywords={alfa,byte,pack,unpack},% 1998 Andreas Stephan morekeywords={dynamic,external,forward,global,module,nil,operator,% priority,sum,type,use,dispose,mark,page,release,cimatrix,% cinterval,civector,cmatrix,complex,cvector,dotprecision,imatrix,% interval,ivector,rmatrix,rvector,string,im,inf,re,sup,chr,comp,% eof,eoln,expo,image,ival,lb,lbound,length,loc,mant,maxlength,odd,% ord,pos,pred,round,rval,sign,substring,succ,trunc,ub,ubound}% }% \lst@definelanguage[Borland6]{Pascal}[Standard]{Pascal} {morekeywords={asm,constructor,destructor,implementation,inline,% interface,nil,object,shl,shr,string,unit,uses,xor},% morendkeywords={Abs,Addr,ArcTan,Chr,Concat,Copy,Cos,CSeg,DiskFree,% DiskSize,DosExitCode,DosVersion,DSeg,EnvCount,EnvStr,Eof,Eoln,% Exp,FExpand,FilePos,FileSize,Frac,FSearch,GetBkColor,GetColor,% GetDefaultPalette,GetDriverName,GetEnv,GetGraphMode,GetMaxMode,% GetMaxX,GetMaxY,GetModeName,GetPaletteSize,GetPixel,GetX,GetY,% GraphErrorMsg,GraphResult,Hi,ImageSize,InstallUserDriver,% InstallUserFont,Int,IOResult,KeyPressed,Length,Lo,MaxAvail,% MemAvail,MsDos,Odd,Ofs,Ord,OvrGetBuf,OvrGetRetry,ParamCount,% ParamStr,Pi,Pos,Pred,Ptr,Random,ReadKey,Round,SeekEof,SeekEoln,% Seg,SetAspectRatio,Sin,SizeOf,Sound,SPtr,Sqr,Sqrt,SSeg,Succ,% Swap,TextHeight,TextWidth,Trunc,TypeOf,UpCase,WhereX,WhereY,% Append,Arc,Assign,AssignCrt,Bar,Bar3D,BlockRead,BlockWrite,ChDir,% Circle,ClearDevice,ClearViewPort,Close,CloseGraph,ClrEol,ClrScr,% Dec,Delay,Delete,DelLine,DetectGraph,Dispose,DrawPoly,Ellipse,% Erase,Exec,Exit,FillChar,FillEllipse,FillPoly,FindFirst,FindNext,% FloodFill,Flush,FreeMem,FSplit,GetArcCoords,GetAspectRatio,% GetDate,GetDefaultPalette,GetDir,GetCBreak,GetFAttr,% GetFillSettings,GetFTime,GetImage,GetIntVec,GetLineSettings,% GetMem,GetPalette,GetTextSettings,GetTime,GetVerify,% GetViewSettings,GoToXY,Halt,HighVideo,Inc,InitGraph,Insert,% InsLine,Intr,Keep,Line,LineRel,LineTo,LowVideo,Mark,MkDir,Move,% MoveRel,MoveTo,MsDos,New,NormVideo,NoSound,OutText,OutTextXY,% OvrClearBuf,OvrInit,OvrInitEMS,OvrSetBuf,PackTime,PieSlice,% PutImage,PutPixel,Randomize,Rectangle,Release,Rename,% RestoreCrtMode,RmDir,RunError,Sector,Seek,SetActivePage,% SetAllPalette,SetBkColor,SetCBreak,SetColor,SetDate,SetFAttr,% SetFillPattern,SetFillStyle,SetFTime,SetGraphBufSize,% SetGraphMode,SetIntVec,SetLineStyle,SetPalette,SetRGBPalette,% SetTextBuf,SetTextJustify,SetTextStyle,SetTime,SetUserCharSize,% SetVerify,SetViewPort,SetVisualPage,SetWriteMode,Sound,Str,% SwapVectors,TextBackground,TextColor,TextMode,Truncate,% UnpackTime,Val,Window}% }% \lst@definelanguage[Standard]{Pascal}% {morekeywords={alfa,and,array,begin,boolean,byte,case,char,const,div,% do,downto,else,end,false,file,for,function,get,goto,if,in,% integer,label,maxint,mod,new,not,of,or,pack,packed,page,program,% put,procedure,read,readln,real,record,repeat,reset,rewrite,set,% text,then,to,true,type,unpack,until,var,while,with,write,% writeln},% sensitive=f,% morecomment=[s]{(*}{*)},% morecomment=[s]{\{}{\}},% morestring=[d]'% }[keywords,comments,strings]% \lst@definelanguage{Perl}% {morekeywords={abs,accept,alarm,atan2,bind,binmode,bless,caller,% chdir,chmod,chomp,chop,chown,chr,chroot,close,closedir,connect,% continue,cos,crypt,dbmclose,dbmopen,defined,delete,die,do,dump,% each,else,elsif,endgrent,endhostent,endnetent,endprotoent,% endpwent,endservent,eof,eval,exec,exists,exit,exp,fcntl,fileno,% flock,for,foreach,fork,format,formline,getc,getgrent,getgrgid,% getgrnam,gethostbyaddr,gethostbyname,gethostent,getlogin,% getnetbyaddr,getnetbyname,getnetent,getpeername,getpgrp,% getppid,getpriority,getprotobyname,getprotobynumber,getprotoent,% getpwent,getpwnam,getpwuid,getservbyname,getservbyport,% getservent,getsockname,getsockopt,glob,gmtime,goto,grep,hex,if,% import,index,int,ioctl,join,keys,kill,last,lc,lcfirst,length,% link,listen,local,localtime,log,lstat,m,map,mkdir,msgctl,msgget,% msgrcv,msgsnd,my,next,no,oct,open,opendir,ord,pack,package,pipe,% pop,pos,print,printf,prototype,push,q,qq,quotemeta,qw,qx,rand,% read,readdir,readlink,recv,redo,ref,rename,require,reset,return,% reverse,rewinddir,rindex,rmdir,s,scalar,seek,seekdir,select,% semctl,semget,semop,send,setgrent,sethostent,setnetent,setpgrp,% setpriority,setprotoent,setpwent,setservent,setsockopt,shift,% shmctl,shmget,shmread,shmwrite,shutdown,sin,sleep,socket,% socketpair,sort,splice,split,sprintf,sqrt,srand,stat,study,sub,% substr,symlink,syscall,sysopen,sysread,system,syswrite,tell,% telldir,tie,tied,time,times,tr,truncate,uc,ucfirst,umask,undef,% unless,unlink,unpack,unshift,untie,until,use,utime,values,vec,% wait,waitpid,wantarray,warn,while,write,y},% sensitive,% morecomment=[l]\#,% morestring=[b]",% morestring=[b]',% MoreSelectCharTable=% \lst@ReplaceInput{\$\#}{\lst@ProcessOther\$\lst@ProcessOther\#}% }[keywords,comments,strings]% %% %% POV definition (c) 1999 Berthold H\"ollmann %% \lst@definelanguage{POV}% {morekeywords={abs,absorption,acos,acosh,adaptive,adc_bailout,agate,% agate_turb,all,alpha,ambient,ambient_light,angle,aperture,append,% arc_angle,area_light,array,asc,asin,asinh,assumed_gamma,atan,% atan2,atanh,average,background,bezier_spline,bicubic_patch,% black_hole,blob,blue,blur_samples,bounded_by,box,boxed,bozo,% break,brick,brick_size,brightness,brilliance,bumps,bump_map,% bump_size,camera,case,caustics,ceil,checker,chr,clipped_by,clock,% clock_delta,color,color_map,colour,colour_map,component,% composite,concat,cone,confidence,conic_sweep,control0,control1,% cos,cosh,count,crackle,crand,cube,cubic,cubic_spline,cubic_wave,% cylinder,cylindrical,debug,declare,default,defined,degrees,% density,density_file,density_map,dents,difference,diffuse,% dimensions,dimension_size,direction,disc,distance,% distance_maximum,div,eccentricity,else,emission,end,error,% error_bound,exp,extinction,fade_distance,fade_power,falloff,% falloff_angle,false,fclose,file_exists,filter,finish,fisheye,% flatness,flip,floor,focal_point,fog,fog_alt,fog_offset,fog_type,% fopen,frequency,gif,global_settings,gradient,granite,% gray_threshold,green,height_field,hexagon,hf_gray_16,hierarchy,% hollow,hypercomplex,if,ifdef,iff,ifndef,image_map,include,int,% interior,interpolate,intersection,intervals,inverse,ior,irid,% irid_wavelength,jitter,julia_fractal,lambda,lathe,leopard,% light_source,linear_spline,linear_sweep,local,location,log,% looks_like,look_at,low_error_factor,macro,mandel,map_type,marble,% material,material_map,matrix,max,max_intersections,max_iteration,% max_trace_level,media,media_attenuation,media_interaction,merge,% mesh,metallic,min,minimum_reuse,mod,mortar,nearest_count,no,% normal,normal_map,no_shadow,number_of_waves,object,octaves,off,% offset,omega,omnimax,on,once,onion,open,orthographic,panoramic,% perspective,pgm,phase,phong,phong_size,pi,pigment,pigment_map,% planar,plane,png,point_at,poly,polygon,poly_wave,pot,pow,ppm,% precision,prism,pwr,quadratic_spline,quadric,quartic,quaternion,% quick_color,quick_colour,quilted,radial,radians,radiosity,radius,% rainbow,ramp_wave,rand,range,ratio,read,reciprocal,% recursion_limit,red,reflection,reflection_exponent,refraction,% render,repeat,rgb,rgbf,rgbft,rgbt,right,ripples,rotate,roughness,% samples,scale,scallop_wave,scattering,seed,shadowless,sin,% sine_wave,sinh,sky,sky_sphere,slice,slope_map,smooth,% smooth_triangle,sor,specular,sphere,spherical,spiral1,spiral2,% spotlight,spotted,sqr,sqrt,statistics,str,strcmp,strength,strlen,% strlwr,strupr,sturm,substr,superellipsoid,switch,sys,t,tan,tanh,% text,texture,texture_map,tga,thickness,threshold,tightness,tile2,% tiles,torus,track,transform,translate,transmit,triangle,% triangle_wave,true,ttf,turbulence,turb_depth,type,u,% ultra_wide_angle,undef,union,up,use_color,use_colour,use_index,% u_steps,v,val,variance,vaxis_rotate,vcross,vdot,version,vlength,% vnormalize,vrotate,v_steps,warning,warp,water_level,waves,while,% width,wood,wrinkles,write,x,y,yes,z},% moredirectives={break,case,debug,declare,default,else,end,fclose,% fopen,local,macro,read,render,statistics,switch,undef,version,% warning,write},% moredelim=*[directive]\#,% sensitive,% morecomment=[l]//,% morecomment=[s]{/*}{*/},% morestring=[d]",% }[keywords,directives,comments,strings]% %% %% Python definition (c) 1998 Michael Weber %% \lst@definelanguage{Python}% {morekeywords={access,and,break,class,continue,def,del,elif,else,% except,exec,finally,for,from,global,if,import,in,is,lambda,not,% or,pass,print,raise,return,try,while},% sensitive=true,% morecomment=[l]\#,% morestring=[b]',% morestring=[b]",% morecomment=[s]{'''}{'''},% used for documentation text morecomment=[s]{"""}{"""}% added by Philipp Matthias Hahn }% %% %% Scilab definition (c) 2002,2003 Jean-Philippe Grivet %% \lst@definelanguage{Scilab}% {morekeywords={abcd,abinv,abort,abs,acoshm,acosh,acosm,acos,addcolor,% addf,addinter,addmenu,add_edge,add_node,adj2sp,adj_lists,aff2ab,% amell,analpf,analyze,ans,apropos,arc_graph,arc_number,argn,arhnk,% arl2,arma2p,armac,armax1,armax,arma,arsimul,artest,articul,ascii,% asinhm,asinh,asinm,asin,atanhm,atanh,atanm,atan,augment,auread,% auwrite,balanc,balreal,bandwr,basename,bdiag,besseli,besselj,% besselk,bessely,best_match,bezout,bifish,bilin,binomial,black,% bloc2exp,bloc2ss,bode,bool2s,boolean,boucle,break,bstap,buttmag,% bvode,cainv,calerf,calfrq,call,canon,casc,case,ccontrg,cdfbet,% cdfbin,cdfchi,cdfchn,cdffnc,cdff,cdfgam,cdfnbn,cdfnor,cdfpoi,% cdft,ceil,center,cepstrum,chaintest,chain_struct,champ1,champ,% chart,chdir,cheb1mag,cheb2mag,check_graph,check_io,chepol,chfact,% chol,chsolve,circuit,classmarkov,clean,clearfun,clearglobal,% clear,close,cls2dls,cmb_lin,cmndred,cmoment,code2str,coeff,coffg,% coff,colcompr,colcomp,colinout,colormap,colregul,companion,comp,% cond,conj,connex,contour2di,contour2d,contourf,contour,% contract_edge,contrss,contr,cont_frm,cont_mat,convex_hull,convol,% convstr,con_nodes,copfac,copy,correl,corr,coshm,cosh,cosm,cos,% cotg,cothm,coth,covar,csim,cspect,ctr_gram,cumprod,cumsum,% curblock,cycle_basis,czt,c_link,dasrt,dassl,datafit,date,dbphi,% dcf,ddp,debug,dec2hex,deff,definedfields,degree,delbpt,% delete_arcs,delete_nodes,delete,delip,delmenu,demos,denom,% derivative,derivat,des2ss,des2tf,determ,detr,det,dft,dhinf,% dhnorm,diag,diary,diff,diophant,dirname,dispbpt,dispfiles,disp,% dlgamma,double,dragrect,drawaxis,drawlater,drawnow,draw,driver,% dscr,dsearch,dsimul,dtsi,dt_ility,duplicate,edge_number,% edit_curv,edit_graph_menus,edit_graph,edit,eigenmarkov,ell1mag,% elseif,else,emptystr,endfunction,end,eqfir,eqiir,equil1,equil,% ereduc,erfcx,erfc,erf,errbar,errcatch,errclear,error,eval3dp,% eval3d,eval,evans,evstr,excel2sci,execstr,exec,exists,exit,expm,% exp,external,eye,fac3d,factors,faurre,fchamp,fcontour2d,fcontour,% fec,feedback,feval,ffilt,fftshift,fft,fgrayplot,figure,fileinfo,% file,filter,findm,findobj,findx0BD,find_freq,find_path,find,% findABCD,findAC,findBD,findBDK,findR,fit_dat,fix,floor,flts,foo,% formatman,format,fort,for,fourplan,fplot2d,fplot3d1,fplot3d,% fprintf,fprintfMat,frep2tf,freq,freson,frexp,frfit,frmag,fscanf,% fscanfMat,fsfirlin,fsolve,fspecg,fstabst,fstair,ftest,ftuneq,% fullrfk,fullrf,full,fun2string,funcprot,functions,function,% funptr,fusee,gainplot,gamitg,gammaln,gamma,gcare,gcd,gcf,% genfac3d,genlib,genmarkov,gen_net,geom3d,geomean,getblocklabel,% getcolor,getcurblock,getcwd,getdate,getd,getenv,getfield,getfont,% getf,getio,getlinestyle,getmark,getpid,getscicosvars,getsymbol,% getvalue,getversion,get_function_path,get,gfare,gfrancis,girth,% givens,glever,glist,global,glue,gpeche,graduate,grand,% graphics_entities,graph_2_mat,graph_center,graph_complement,% graph_diameter,graph_power,graph_simp,graph_sum,graph_union,% graph-list,graycolormap,grayplot,graypolarplot,grep,group,% gr_menu,gschur,gsort,gspec,gstacksize,gtild,g_margin,h2norm,halt,% hamilton,hankelsv,hank,harmean,havewindow,help,hermit,hess,% hex2dec,hilb,hinf,hist3d,histplot,horner,host,hotcolormap,% householder,hrmt,htrianr,hypermat,h_cl,h_inf_st,h_inf,h_norm,% iconvert,icon_edit,ieee,if,iirgroup,iirlp,iir,ilib_build,% ilib_compile,ilib_for_link,ilib_gen_gateway,ilib_gen_loader,% ilib_gen_Make,imag,impl,imrep2ss,imult,im_inv,inistate,input,% int16,int2d,int32,int3d,int8,intc,intdec,integrate,interpln,% interp,intersci,intersect,intg,intl,intppty,intsplin,inttrap,% inttype,int,invr,invsyslin,inv_coeff,inv,iqr,isdef,isdir,isequal,% iserror,isglobal,isinf,isnan,isoview,isreal,is_connex,jmat,% justify,kalm,karmarkar,kernel,keyboard,knapsack,kpure,krac2,% kroneck,kron,lasterror,lattn,lattp,lcf,lcmdiag,lcm,ldivf,ldiv,% leastsq,legends,length,leqr,levin,lev,lex_sort,lft,lgfft,library,% lib,lin2mu,lincos,lindquist,lines,line_graph,linfn,linf,link,% linmeq,linpro,linsolve,linspace,lin,listfiles,list,lmisolver,% lmitool,loadmatfile,loadplots,loadwave,load_graph,load,locate,% log10,log1p,log2,logm,logspace,log,lotest,lqe,lqg2stan,lqg_ltr,% lqg,lqr,lsq,lsslist,lstcat,lstsize,ltitr,ludel,lufact,luget,% lusolve,lu,lyap,macglov,macr2lst,macrovar,macro,mad,make_graph,% make_index,manedit,man,mapsound,markp2ss,matfile2sci,matrix,% mat_2_graph,maxi,max_cap_path,max_clique,max_flow,max,mclearerr,% mclose,meanf,mean,median,meof,mese,mesh2d,mfft,mfile2sci,mgeti,% mgetl,mgetstr,mget,milk_drop,mine,mini,minreal,minss,% min_lcost_cflow,min_lcost_flow1,min_lcost_flow2,min_qcost_flow,% min_weight_tree,min,mlist,mode,modulo,moment,mopen,move,% mps2linpro,mputl,mputstr,mput,mrfit,msd,mseek,mtell,mtlb_load,% mtlb_mode,mtlb_save,mtlb_sparse,mu2lin,mulf,mvvacov,m_circle,% names,nand2mean,nanmax,nanmeanf,nanmean,nanmedian,nanmin,% nanstdev,nansum,narsimul,ndims,nearfloat,nehari,neighbors,% netclose,netwindows,netwindow,newest,newfun,nextpow2,nf3d,nfreq,% nlev,nnz,nodes_2_path,nodes_degrees,node_number,noisegen,norm,% null,numdiff,numer,nyquist,obscont1,obscont,observer,obsvss,% obsv_mat,obs_gram,odedc,odedi,odeoptions,ode_discrete,ode_root,% ode,oldload,oldsave,ones,optim,orth,param3d1,param3d,% paramfplot2d,parrot,part,pathconvert,path_2_nodes,pause,pbig,% pdiv,pen2ea,pencan,penlaur,perctl,perfect_match,pertrans,pfss,% phasemag,phc,pinv,pipe_network,playsnd,plot2d1,plot2d2,plot2d3,% plot2d4,plot2d,plot3d1,plot3d2,plot3d3,plot3d,plotframe,% plotprofile,plot_graph,plot,plzr,pmodulo,pol2des,pol2str,pol2tex,% polarplot,polar,polfact,poly,portr3d,portrait,power,ppol,prbs_a,% predecessors,predef,printf,printing,print,prod,profile,projsl,% projspec,proj,psmall,pspect,pvm_addhosts,pvm_barrier,pvm_bcast,% pvm_bufinfo,pvm_config,pvm_delhosts,pvm_error,pvm_exit,% pvm_f772sci,pvm_getinst,pvm_gettid,pvm_get_timer,pvm_gsize,% pvm_halt,pvm_joingroup,pvm_kill,pvm_lvgroup,pvm_mytid,pvm_parent,% pvm_probe,pvm_recv,pvm_reduce,pvm_sci2f77,pvm_send,pvm_set_timer,% pvm_spawn_independent,pvm_spawn,pvm_start,pvm_tasks,% pvm_tidtohost,pvm,pwd,p_margin,qassign,qr,quapro,quart,quaskro,% quit,randpencil,rand,range,rankqr,rank,rat,rcond,rdivf,read4b,% readb,readc_,readmps,read,real,recur,reglin,regress,remezb,remez,% repfreq,replot,residu,resume,return,riccati,riccsl,ricc,ric_desc,% rlist,roots,rotate,round,routh_t,rowcompr,rowcomp,rowinout,% rowregul,rowshuff,rpem,rref,rtitr,rubberbox,salesman,savewave,% save_graph,save,scaling,scanf,schur,sci2exp,sci2for,sci2map,% sciargs,scicosim,scicos,scifunc_block,sd2sci,secto3d,select,% semidef,sensi,setbpt,seteventhandler,setfield,setmenu,% setscicosvars,set,sfact,sgrid,shortest_path,showprofile,% show_arcs,show_graph,show_nodes,sident,signm,sign,simp_mode,simp,% sincd,sinc,sinc,sinhm,sinh,sinm,sin,size,sm2des,sm2ss,smooth,% solve,sorder,sort,sound,sp2adj,spaninter,spanplus,spantwo,sparse,% spchol,spcompack,specfact,spec,speye,spget,splin,split_edge,% spones,sprand,sprintf,spzeros,sqroot,sqrtm,sqrt,squarewave,% square,srfaur,srkf,ss2des,ss2ss,ss2tf,sscanf,sskf,ssprint,ssrand,% stabil,stacksize,standard_define,standard_draw,standard_input,% standard_origin,standard_output,startup,stdevf,stdev,steadycos,% str2code,strange,strcat,strindex,strings,string,stripblanks,% strong_connex,strong_con_nodes,strsubst,st_deviation,st_ility,% subf,subgraph,subplot,successors,sum,supernode,sva,svd,svplot,% sylm,sylv,sysconv,sysdiag,sysfact,syslin,syssize,systems,system,% systmat,tabul,tangent,tanhm,tanh,tanm,tan,tdinit,testmatrix,% texprint,tf2des,tf2ss,then,thrownan,timer,time_id,titlepage,% tk_getdir,tk_getfile,tlist,toeplitz,tokenpos,tokens,trace,% translatepaths,trans_closure,trans,trfmod,trianfml,tril,trimmean,% trisolve,triu,trzeros,typename,typeof,type,uicontrol,uimenu,% uint16,uint32,uint8,ui_observer,ulink,unglue,union,unique,unix_g,% unix_s,unix_w,unix_x,unix,unobs,unsetmenu,user,varargin,% varargout,variancef,variance,varn,warning,wavread,wavwrite,% wcenter,wfir,what,whereami,whereis,where,while,whos,who_user,who,% wiener,wigner,window,winsid,with_gtk,with_pvm,with_texmacs,% with_tk,writb,write4b,write,xarcs,xarc,xarrows,xaxis,xbasc,% xbasimp,xbasr,xchange,xclear,xclea,xclick,xclip,xdel,xend,xfarcs,% xfarc,xfpolys,xfpoly,xfrect,xgetech,xgetfile,xgetmouse,xget,% xgraduate,xgrid,xinfo,xinit,xlfont,xload,xname,xnumb,xpause,% xpolys,xpoly,xrects,xrect,xrpoly,xs2fig,xs2gif,xs2ppm,xs2ps,% xsave,xsegs,select,xsetech,xsetm,xset,xstringb,xstringl,xstring,% xtape,xtitle,x_choices,x_choose,x_dialog,x_matrix,x_mdialog,% x_message_modeless,x_message,yulewalk,zeropen,zeros,zgrid,zpbutt,% zpch1,zpch2,zpell,mfprintf,mfscanf,mprintf,mscanf,msprintf,% msscanf,mucomp,% ABSBLK_f,AFFICH_f,ANDLOG_f,ANIMXY_f,BIGSOM_f,CLINDUMMY_f,CLKIN_f,% CLKINV_f,CLKOUT_f,CLKOUTV_f,CLKSOM_f,CLKSOMV_f,CLKSPLIT_f,% CLOCK_f,CLR_f,CLSS_f,CONST_f,COSBLK_f,CURV_f,DELAY_f,DELAYV_f,% DEMUX_f,DLR_f,DLRADAPT_f,DLSS_f,EVENTSCOPE_f,EVTDLY_f,EVTGEN_f,% EXPBLK_f,G_make,GAIN_f,GAINBLK_f,GENERAL_f,GENERIC_f,GENSIN_f,% GENSQR_f,HALT_f,IFTHEL_f,IN_f,INTEGRAL_f,INTRP2BLK_f,INTRPLBLK_f,% INVBLK_f,LOGBLK_f,LOOKUP_f,Matplot1,Matplot,MAX_f,MCLOCK_f,% MFCLCK_f,MIN_f,MUX_f,NDcost,NEGTOPOS_f,OUT_f,POSTONEG_f,POWBLK_f,% PROD_f,QUANT_f,RAND_f,READC_f,REGISTER_f,RELAY_f,RFILE_f,% ScilabEval,Sfgrayplot,Sgrayplot,SAMPLEHOLD_f,SAT_f,SAWTOOTH_f,% SCOPE_f,SCOPXY_f,SELECT_f,SINBLK_f,SOM_f,SPLIT_f,STOP_f,SUPER_f,% TANBLK_f,TCLSS_f,TEXT_f,TIME_f,TK_EvalFile,TK_EvalStr,TK_GetVar,% TK_SetVar,TRASH_f,WFILE_f,WRITEC_f,ZCROSS_f,% \%asn,\%helps,\%k,\%sn},% alsoletter=\%,% chmod sensitive,% morecomment=[l]//,% morestring=[b]",% morestring=[m]'% }[keywords,comments,strings]% %% %% SQL definition (c) 1998 Christian Haul %% (c) 2002 Neil Conway %% (c) 2002 Robert Frank %% (c) 2003 Dirk Jesko %% \lst@definelanguage{SQL}% {morekeywords={ABSOLUTE,ACTION,ADD,ALLOCATE,ALTER,ARE,AS,ASSERTION,% AT,BETWEEN,BIT_LENGTH,BOTH,BY,CASCADE,CASCADED,CASE,CAST,% CATALOG,CHAR_LENGTH,CHARACTER_LENGTH,CLUSTER,COALESCE,% COLLATE,COLLATION,COLUMN,CONNECT,CONNECTION,CONSTRAINT,% CONSTRAINTS,CONVERT,CORRESPONDING,CREATE,CROSS,CURRENT_DATE,% CURRENT_TIME,CURRENT_TIMESTAMP,CURRENT_USER,DAY,DEALLOCATE,% DEC,DEFERRABLE,DEFERED,DESCRIBE,DESCRIPTOR,DIAGNOSTICS,% DISCONNECT,DOMAIN,DROP,ELSE,END,EXEC,EXCEPT,EXCEPTION,EXECUTE,% EXTERNAL,EXTRACT,FALSE,FIRST,FOREIGN,FROM,FULL,GET,GLOBAL,% GRAPHIC,HAVING,HOUR,IDENTITY,IMMEDIATE,INDEX,INITIALLY,INNER,% INPUT,INSENSITIVE,INSERT,INTO,INTERSECT,INTERVAL,% ISOLATION,JOIN,KEY,LAST,LEADING,LEFT,LEVEL,LIMIT,LOCAL,LOWER,% MATCH,MINUTE,MONTH,NAMES,NATIONAL,NATURAL,NCHAR,NEXT,NO,NOT,NULL,% NULLIF,OCTET_LENGTH,ON,ONLY,ORDER,ORDERED,OUTER,OUTPUT,OVERLAPS,% PAD,PARTIAL,POSITION,PREPARE,PRESERVE,PRIMARY,PRIOR,READ,% RELATIVE,RESTRICT,REVOKE,RIGHT,ROWS,SCROLL,SECOND,SELECT,SESSION,% SESSION_USER,SIZE,SPACE,SQLSTATE,SUBSTRING,SYSTEM_USER,% TABLE,TEMPORARY,THEN,TIMEZONE_HOUR,% TIMEZONE_MINUTE,TRAILING,TRANSACTION,TRANSLATE,TRANSLATION,TRIM,% TRUE,UNIQUE,UNKNOWN,UPPER,USAGE,USING,VALUE,VALUES,% VARGRAPHIC,VARYING,WHEN,WHERE,WRITE,YEAR,ZONE,% AND,ASC,avg,CHECK,COMMIT,count,DECODE,DESC,DISTINCT,GROUP,IN,% FF LIKE,NUMBER,ROLLBACK,SUBSTR,sum,VARCHAR2,% FF MIN,MAX,UNION,UPDATE,% RF ALL,ANY,CUBE,CUBE,DEFAULT,DELETE,EXISTS,GRANT,OR,RECURSIVE,% DJ ROLE,ROLLUP,SET,SOME,TRIGGER,VIEW},% DJ morendkeywords={BIT,BLOB,CHAR,CHARACTER,CLOB,DATE,DECIMAL,FLOAT,% DJ INT,INTEGER,NUMERIC,SMALLINT,TIME,TIMESTAMP,VARCHAR},% moved here sensitive=false,% DJ morecomment=[l]--,% morecomment=[s]{/*}{*/},% morestring=[d]',% morestring=[d]"% }[keywords,comments,strings]% %% %% VHDL definition (c) 1997 Kai Wollenweber %% \lst@definelanguage{VHDL}% {morekeywords={ALL,ARCHITECTURE,ABS,AND,ASSERT,ARRAY,AFTER,ALIAS,% ACCESS,ATTRIBUTE,BEGIN,BODY,BUS,BLOCK,BUFFER,CONSTANT,CASE,% COMPONENT,CONFIGURATION,DOWNTO,ELSE,ELSIF,END,ENTITY,EXIT,% FUNCTION,FOR,FILE,GENERIC,GENERATE,GUARDED,GROUP,IF,IN,INOUT,IS,% INERTIAL,IMPURE,LIBRARY,LOOP,LABEL,LITERAL,LINKAGE,MAP,MOD,NOT,% NOR,NAND,NULL,NEXT,NEW,OUT,OF,OR,OTHERS,ON,OPEN,PROCESS,PORT,% PACKAGE,PURE,PROCEDURE,POSTPONED,RANGE,REM,ROL,ROR,REPORT,RECORD,% RETURN,REGISTER,REJECT,SIGNAL,SUBTYPE,SLL,SRL,SLA,SRA,SEVERITY,% SELECT,THEN,TYPE,TRANSPORT,TO,USE,UNITS,UNTIL,VARIABLE,WHEN,WAIT,% WHILE,XOR,XNOR,% DISCONNECT,ELIF,WITH},% Arnaud Tisserand sensitive=f,% 1998 Gaurav Aggarwal morecomment=[l]--,% morestring=[d]{"}% }[keywords,comments,strings]% %% %% VHDL-AMS definition (c) Steffen Klupsch %% \lst@definelanguage[AMS]{VHDL}[]{VHDL}% {morekeywords={ACROSS,ARRAY,BREAK,DISCONNECT,NATURE,NOISE,PORT,% PROCEDURAL,QUANTITY,SHARED,SPECTRUM,SUBNATURE,TERMINAL,THROUGH,% TOLERANCE,UNAFFACTED,UNITS}} \lst@definelanguage{XSLT}[]{XML}% {morekeywords={% % main elements xsl:stylesheet,xsl:transform,% % childs of the main element xsl:apply-imports,xsl:attribute-set,xsl:decimal-format,xsl:import,% xsl:include,xsl:key,xsl:namespace-alias,xsl:output,xsl:param,% xsl:preserve-space,xsl:strip-space,xsl:template,xsl:variable,% % 21 directives xsl:apply-imports,xsl:apply-templates,xsl:attribute,% xsl:call-template,xsl:choose,xsl:comment,xsl:copy,xsl:copy-of,% xsl:element,xsl:fallback,xsl:for-each,xsl:if,xsl:message,% xsl:number,xsl:otherwise,xsl:processing-instruction,xsl:text,% xsl:value-of,xsl:variable,xsl:when,xsl:with-param},% alsodigit={-},% }% \lst@definelanguage{Ant}[]{XML}% {morekeywords={% project,target,patternset,include,exclude,excludesfile,includesfile,filterset,% filter,filtersfile,libfileset,custom,classpath,fileset,none,depend,mapper,% filename,not,date,contains,selector,depth,or,and,present,majority,size,dirset,% filelist,pathelement,path,param,filterreader,extension,filterchain,linecontainsregexp,% regexp,classconstants,headfilter,tabstospaces,striplinebreaks,tailfilter,stripjavacomments,% expandproperties,linecontains,replacetokens,token,striplinecomments,comment,prefixlines,% classfileset,rootfileset,root,description,xmlcatalog,entity,dtd,substitution,% extensionSet,propertyfile,entry,vsscheckin,sql,transaction,cvspass,csc,% dirname,wlrun,wlclasspath,p4label,replaceregexp,get,jjtree,sleep,jarlib,% dependset,targetfileset,srcfileset,srcfilelist,targetfilelist,zip,zipgroupfileset,zipfileset,% patch,jspc,webapp,style,test,arg,jvmarg,sysproperty,testlet,env,tstamp,% format,unwar,vsshistory,icontract,cvschangelog,user,p4submit,ccmcheckin,% p4change,bzip2,vssadd,javadoc,bottom,source,doctitle,header,excludepackage,bootclasspath,% doclet,taglet,packageset,sourcepath,link,footer,package,group,title,tag,% translate,signjar,vajload,vajproject,jarlib,extensionset,WsdlToDotnet,buildnumber,% jpcovmerge,tomcat,ejbjar,weblogictoplink,jboss,borland,weblogic,iplanet,jonas,% support,websphere,wasclasspath,war,manifest,attribute,section,metainf,lib,% classes,webinf,rename,sequential,serverdeploy,generic,property,move,% copydir,cccheckin,wljspc,fixcrlf,sosget,pathconvert,map,record,p4sync,exec,% p4edit,maudit,rulespath,searchpath,antlr,netrexxc,jpcovreport,reference,filters,% coveragepath,execon,targetfile,srcfile,ccmcheckout,ant,xmlvalidate,xslt,% iplanet,ccmcheckintask,gzip,native2ascii,starteam,ear,archives,input,% rmic,extdirs,compilerarg,checksum,mail,bcc,message,cc,to,from,loadfile,vsscheckout,% stylebook,soscheckin,mimemail,stlabel,gunzip,concat,cab,touch,parallel,splash,% antcall,cccheckout,typedef,p4have,xmlproperty,copy,tomcat,antstructure,ccmcreatetask,% rpm,delete,replace,replacefilter,replacetoken,replacevalue,mmetrics,waitfor,isfalse,% equals,available,filepath,os,filesmatch,istrue,isset,socket,http,uptodate,srcfiles,% untar,loadproperties,echoproperties,vajexport,stcheckout,bunzip2,copyfile,vsscreate,% ejbc,unjar,tomcat,wsdltodotnet,mkdir,condition,cvs,commandline,marker,argument,% tempfile,junitreport,report,taskdef,echo,ccupdate,java,renameext,vsslabel,basename,% javadoc2,vsscp,tar,tarfileset,tomcat,vajimport,setproxy,wlstop,p4counter,ilasm,% soscheckout,apply,ccuncheckout,jarlib,location,url,cvstagdiff,jlink,mergefiles,% addfiles,javacc,pvcs,pvcsproject,jarlib,options,depends,chmod,jar,sound,fail,% success,mparse,blgenclient,genkey,dname,javah,class,ccmreconfigure,unzip,javac,% src,p4add,soslabel,jpcoverage,triggers,method,vssget,deltree,ddcreator}, deletekeywords={default},% } \lst@definelanguage{XML}% {keywords={,CDATA,DOCTYPE,ATTLIST,termdef,ELEMENT,EMPTY,ANY,ID,% IDREF,IDREFS,ENTITY,ENTITIES,NMTOKEN,NMTOKENS,NOTATION,% INCLUDE,IGNORE,SYSTEM,PUBLIC,NDATA,PUBLIC,% PCDATA,REQUIRED,IMPLIED,FIXED,%%% preceded by # xml,xml:space,xml:lang,version,standalone,default,preserve},% alsoother=$,% alsoletter=:,% tag=**[s]<>,% morestring=[d]",% ??? doubled morestring=[d]',% ??? doubled MoreSelectCharTable=% \lst@CArgX--\relax\lst@DefDelimB{}{}% {\ifnum\lst@mode=\lst@tagmode\else \expandafter\@gobblethree \fi}% \lst@BeginComment\lst@commentmode{{\lst@commentstyle}}% \lst@CArgX--\relax\lst@DefDelimE{}{}{}% \lst@EndComment\lst@commentmode \lst@CArgX[CDATA[\relax\lst@CDef{}% {\ifnum\lst@mode=\lst@tagmode \expandafter\lst@BeginCDATA \else \expandafter\lst@CArgEmpty \fi}% \@empty \lst@CArgX]]\relax\lst@CDef{}% {\ifnum\lst@mode=\lst@GPmode \expandafter\lst@EndComment \else \expandafter\lst@CArgEmpty \fi}% \@empty }[keywords,comments,strings,html]% \endinput %% %% End of file `lstlang1.sty'. hevea-2.23/makeidx.hva0000644004317100512160000000124412454751421014706 0ustar marangetcristal\@primitives{index} \newsavebox{\@indexbox} %%%% index citations that point to index commands \newcommand{\@index@loc}[1] {\if@refs% \sbox{\@indexbox}{\@indexwrite[default]{#1}{\@indexlabel}}%force evaluation \@locname{\usebox{\@indexbox}}{}% \fi} %%%% index citations that point to section titles. \newcommand{\@index@sec}[1] {\if@refs% \@@indexwrite[default]{#1}{\@currentlabel}{\@fmt@sec}%force evaluation \fi} \newif\ifindexsec\indexsecfalse \newcommand{\index}[1]{\ifindexsec\@index@sec{#1}\else\@index@loc{#1}} \newcommand{\printindex}{\@printindex[default]} \newcommand{\makeindex}{\newindex{default}{idx}{ind}{\indexname}} \newcommand{\see}[2]{\seename\ \textit{#1}} hevea-2.23/hot.mli0000644004317100512160000000156307303451221014055 0ustar marangetcristal(***********************************************************************) (* *) (* HEVEA *) (* *) (* Luc Maranget, projet Moscova, INRIA Rocquencourt *) (* *) (* Copyright 2001 Institut National de Recherche en Informatique et *) (* Automatique. Distributed only by permission. *) (* *) (* $Id: hot.mli,v 1.3 2001-05-25 12:37:23 maranget Exp $ *) (***********************************************************************) type saved val checkpoint : unit -> saved val start : saved -> unit hevea-2.23/counter.mli0000644004317100512160000000210010423155262014731 0ustar marangetcristal(***********************************************************************) (* *) (* HEVEA *) (* *) (* Luc Maranget, projet PARA, INRIA Rocquencourt *) (* *) (* Copyright 1998 Institut National de Recherche en Informatique et *) (* Automatique. Distributed only by permission. *) (* *) (***********************************************************************) type saved val checkpoint : unit -> saved val hot_start : saved -> unit val value_counter : string -> int val def_counter: string -> string -> unit val set_counter: string -> int -> unit val add_counter:string -> int -> unit val step_counter: string -> unit val addtoreset: string -> string -> unit val removefromreset: string -> string -> unit hevea-2.23/entry.mli0000644004317100512160000000162607010411403014415 0ustar marangetcristal(***********************************************************************) (* *) (* HEVEA *) (* *) (* Luc Maranget, projet PARA, INRIA Rocquencourt *) (* *) (* Copyright 1998 Institut National de Recherche en Informatique et *) (* Automatique. Distributed only by permission. *) (* *) (***********************************************************************) type key = string list * string list exception NoGood exception Fini val read_key : Lexing.lexbuf -> key * string option val read_indexentry : Lexing.lexbuf -> string * string hevea-2.23/videoc.mll0000644004317100512160000003447312401623123014542 0ustar marangetcristal(***********************************************************************) (* *) (* HEVEA *) (* *) (* Luc Maranget, projet Moscova, INRIA Rocquencourt *) (* Christian Queinnec, Universite Paris IV *) (* *) (* Copyright 2001 Institut National de Recherche en Informatique et *) (* Automatique. Distributed only by permission. *) (* *) (***********************************************************************) (* The plugin for HeVeA that implements the VideoC style. *) { open Printf module type T = sig end;; module Make (Dest : OutManager.S) (Image : ImageManager.S) (Scan : Latexscan.S) = struct open Misc open Lexing open Lexstate open Latexmacros open Subst open Scan let _header = "$Id: videoc.mll,v 1.32 2012-06-05 14:55:39 maranget Exp $" (* So I can synchronize my changes from Luc's ones *) let _qnc_header = "30 oct 2000" exception EndSnippet ;; exception EndTeXInclusion ;; (* Re-link with these variables inserted in latexscan. *) let withinSnippet = ref false;; let withinTeXInclusion = ref false;; let endSnippetRead = ref false;; (* Snippet global defaults *) let snippetLanguage = ref "";; let enableLispComment = ref false;; let enableSchemeCharacters = ref false;; (* Snippet Environment: run a series of hooks provided they exist as user macros. *) let runHook prefix parsing name = let run name = begin if !verbose > 2 then prerr_endline ("Trying to run hook " ^ name); if Latexmacros.exists name then begin Lexstate.scan_this parsing name; () end end in let rec iterate name suffix = run name; if suffix <> "" then iterate (name ^ (String.make 1 (String.get suffix 0))) (String.sub suffix 1 ((String.length suffix) - 1)) in iterate (prefix ^ name ^ "Hook") !snippetLanguage;; let snippetRunHook parsing name = runHook "\\snippet" parsing name;; let snipRunHook parsing name = runHook "\\snip" parsing name;; (* Hack for mutual recursion between modules: *) (* Convert a reference to a hint such as "3" "annote.ann" "premier indice" into "3_annote_ann". This is needed for the annote tool. *) let compute_hint_id number filename _notename = let result = number ^ "_" ^ filename in (*DEPRECATED let rec convert i = begin if i begin counter := !counter + 1; !counter end;; } let command_name = '\\' ((['@''A'-'Z' 'a'-'z']+ '*'?) | [^ 'A'-'Z' 'a'-'z'] | "\\*") rule snippetenv = parse | eof { () } | command_name {let csname = lexeme lexbuf in let pat,body = Latexmacros.find csname in begin match pat with | [],[] -> let args = make_stack csname pat lexbuf in let cur_subst = get_subst () in let exec = function | Subst body -> if !verbose > 2 then eprintf "user macro in snippet: [%a]\n" pretty_body body ; Lexstate.scan_this_list_may_cont Scan.main lexbuf cur_subst (string_to_arg body) | Toks l -> List.iter (fun s -> scan_this Scan.main s) (List.rev l) | CamlCode f -> f lexbuf in scan_body exec body args | _ -> raise (Misc.ScanError ("Command with arguments inside snippet")) end ; snippetenv lexbuf} | '\n' {Dest.put_tag "
"; Dest.put_char '\n'; snippetRunHook Scan.main "AfterLine"; snippetRunHook Scan.main "BeforeLine"; snippetenv lexbuf} | ' '|'\t' {Dest.put_nbsp (); snippetenv lexbuf} | ';' + {Dest.put (lexeme lexbuf); Dest.put_char ' '; if !enableLispComment then begin if !verbose > 1 then prerr_endline "Within snippet: Lisp comment entered"; Lexstate.withinLispComment := true; Scan.top_open_block "SPAN" ("class=\"" ^ !snippetLanguage ^ "Comment\""); snippetRunHook Scan.main "BeforeComment"; try Scan.main lexbuf with (* until a \n is read *) | exc -> begin snippetRunHook Scan.main "AfterComment"; Scan.top_close_block "SPAN"; Lexstate.withinLispComment := false; (* re-raise every exception but EndOfLispComment *) try raise exc with | Misc.EndOfLispComment nlnum -> begin let addon = (if !endSnippetRead then "\\endsnippet" else "") in if !verbose > 1 then Printf.fprintf stderr "%d NL after LispComment %s\n" nlnum ((if !endSnippetRead then "and " else "")^addon); let _ = Lexstate.scan_this snippetenv ((String.make (1+nlnum) '\n')^addon) in () end; end; end; snippetenv lexbuf} | '#' {Dest.put_char '#'; if !enableSchemeCharacters then begin if !verbose > 1 then prerr_endline "Within snippet: scheme characters enabled"; schemecharacterenv lexbuf end; snippetenv lexbuf} | _ as lxm {Scan.translate_put_unicode lxm (fun () -> read_lexbuf lexbuf) ; snippetenv lexbuf} and read_lexbuf = parse | _ as lxm { Char.code lxm } | eof { -1 } (* Scheme characters are written as #\A or #\Newspace *) and schemecharacterenv = parse | command_name {let csname = lexeme lexbuf in Dest.put csname} | "" { () } (* Swallow characters until the end of the line. *) and skip_blanks_till_eol_included = parse | ' ' + {skip_blanks_till_eol_included lexbuf} | '\n' { () } | "" { () } (* Parse a succession of things separated by commas. *) and comma_separated_values = parse | [ ^ ',' ] * ',' {let lxm = lexeme lexbuf in let s = String.sub lxm 0 (String.length lxm - 1) in if !verbose > 2 then prerr_endline ("CSV" ^ s); s :: comma_separated_values lexbuf} | eof { [] } (* Trailer: Register local macros as global. *) { let caml_print s = CamlCode (fun _ -> Dest.put s) let snippet_def name d = Latexmacros.def name zero_pat (CamlCode d) let rec do_endsnippet _ = if !Lexstate.withinLispComment then begin endSnippetRead := true; raise (Misc.EndOfLispComment 0) end; if !Scan.cur_env = "snippet" then raise EndSnippet else raise (Misc.ScanError ("\\endsnippet without opening \\snippet")) and do_texinclusion lexbuf = Scan.top_open_block "SPAN" ("class=\"" ^ !snippetLanguage ^ "Inclusion\""); snippetRunHook Scan.main "BeforeTeX"; withinTeXInclusion := true; begin (* Until a \] is read *) try Scan.main lexbuf with | exc -> begin snippetRunHook Scan.main "AfterTeX"; Scan.top_close_block "SPAN"; snippetRunHook Scan.main "Restart"; (* Re-raise every thing but EndTeXInclusion *) try raise exc with | EndTeXInclusion -> () end; end ; and do_texexclusion _ = if !withinSnippet then begin if !verbose > 2 then prerr_endline "\\] caught within TeX escape"; withinTeXInclusion := false; raise EndTeXInclusion end else raise (Misc.ScanError ("\\] without opening \\[ in snippet")) and do_backslash_newline _ = Dest.put "\\\n"; Lexstate.scan_this snippetenv "\n" and do_four_backslashes _ = Dest.put "\\" (* HACK: Define a macro with a body that is obtained via substitution. This is a kind of restricted \edef as in TeX. Syntax: \@EDEF\macroName{#2#1..} *) and do_edef _lxm lexbuf = let name = Scan.get_csname lexbuf in let body = subst_arg lexbuf in if Scan.echo_toimage () then Image.put ("\\def"^name^"{"^body^"}\n") ; Latexmacros.def name zero_pat (caml_print body); () (* Syntax: \@MULEDEF{\macroName,\macroName,...}{#1#3...} This is an awful hack extending the \@EDEF command. It locally rebinds the (comma-separated) \macronames to the corresponding (comma-separated) expansion of second argument. All \macronames should be a zero-ary macro. *) and do_muledef lxm lexbuf = let names = subst_arg lexbuf in let bodies = subst_arg lexbuf in let rec bind lasti lastj = try let i = String.index_from names lasti ',' in try let j = String.index_from bodies lastj ',' in let name = String.sub names lasti (i - lasti) in let body = String.sub bodies lastj (j - lastj) in if !verbose > 2 then prerr_endline (lxm ^ name ^ ";" ^ body); Latexmacros.def name zero_pat (caml_print body); bind (i+1) (j+1) with Not_found -> failwith "Missing bodies for \\@MULEDEF" with Not_found -> let name = String.sub names lasti (String.length names - lasti) in let body = String.sub bodies lastj (String.length bodies - lastj) in if !verbose > 2 then prerr_endline (lxm ^ name ^ ";" ^ body); Latexmacros.def name zero_pat (caml_print body) ; in bind 0 0; () (* The command that starts the \snippet inner environment: *) and do_snippet lexbuf = if !withinSnippet then raise (Misc.ScanError "No snippet within snippet.") else begin (* Obtain the current TeX value of \snippetDefaultLanguage *) let snippetDefaultLanguage = "\\snippetDefaultLanguage" in let language = get_prim_opt snippetDefaultLanguage lexbuf in let language = if language = "" then snippetDefaultLanguage else language in skip_blanks_till_eol_included lexbuf; Dest.put "
\n"; Scan.top_open_block "DIV" ("class=\"div" ^ language ^ "\""); Dest.put "\n"; Scan.new_env "snippet"; (* Define commands local to \snippet *) snippet_def "\\endsnippet" do_endsnippet; snippet_def "\\[" do_texinclusion ; snippet_def "\\]" do_texexclusion ; snippet_def "\\\\" do_four_backslashes ; snippet_def "\\\n" do_backslash_newline ; snippetLanguage := language; enableLispComment := false; enableSchemeCharacters := false; withinSnippet := true; snippetRunHook Scan.main "Before"; try snippetenv lexbuf with exc -> begin snippetRunHook Scan.main "AfterLine"; snippetRunHook Scan.main "After"; withinSnippet := false; Scan.close_env "snippet"; Scan.top_close_block "DIV"; (* Re-raise all exceptions but EndSnippet *) try raise exc with EndSnippet -> () end; end and do_enable_backslashed_chars lexbuf = let def_echo s = snippet_def s (fun _ -> Dest.put s) in let chars = subst_arg lexbuf in begin if !verbose > 2 then prerr_endline ("\\enableBackslashedChar "^chars); for i=0 to (String.length chars - 1) do let charcommandname = "\\" ^ (String.sub chars i 1) in def_echo charcommandname; done; end; () and do_enableLispComment _lexbuf = enableLispComment := true; () and do_disableLispComment _lexbuf = enableLispComment := false; () and do_enableSchemeCharacters _lexbuf = enableSchemeCharacters := true; () and do_disableSchemeCharacters _lexbuf = enableSchemeCharacters := false; () and do_snippet_run_hook lexbuf = let name = subst_arg lexbuf in begin snippetRunHook Scan.main name; () end and do_snip_run_hook lexbuf = let name = subst_arg lexbuf in begin snipRunHook Scan.main name; () end (* These macros are defined in Caml since they are not nullary macros. They require some arguments but they cannot get them in the snippet environment. So I code them by hand. *) and do_vicanchor lexbuf = begin let {arg=style} = Lexstate.save_opt "" lexbuf in let {arg=nfn} = Lexstate.save_opt "0,filename,notename" lexbuf in let fields = comma_separated_values (MyLexing.from_list (nfn @ [","])) in match fields with | [number;filename;notename] -> begin let uniqueNumber = (* Would be better: truncate(Unix.gettimeofday()) *) increment_internal_counter() and hintId = compute_hint_id number filename notename in let style = String.concat "" style and nfn = String.concat "" nfn in Dest.put_tag (""); () end | _ -> failwith "Missing comma-separated arguments" end and do_vicendanchor lexbuf = begin let {arg=nfn} = Lexstate.save_opt "0,filename,notename" lexbuf in let nfn = String.concat "" nfn in if !verbose > 2 then prerr_endline ("\\vicendanchor"^nfn); let fields = comma_separated_values (MyLexing.from_string (nfn ^ ",")) in match fields with | [_number;_filename;_notename] -> begin Dest.put_tag (""); () end | _ -> failwith "Missing comma-separated arguments" end and do_vicindex lexbuf = begin let _nfn = Lexstate.save_opt "0,filename,notename" lexbuf in Dest.put_char ' '; () end ;; (* This is the initialization function of the plugin: *) let init = function () -> begin (* Register global TeX macros: *) def_code "\\snippet" do_snippet; def_name_code "\\@EDEF" do_edef; def_name_code "\\@MULEDEF" do_muledef; def_code "\\ViCEndAnchor" do_vicendanchor; def_code "\\ViCAnchor" do_vicanchor; def_code "\\ViCIndex" do_vicindex; def_code "\\enableLispComment" do_enableLispComment; def_code "\\disableLispComment" do_disableLispComment; def_code "\\enableSchemeCharacters" do_enableSchemeCharacters; def_code "\\disableSchemeCharacters" do_disableSchemeCharacters; def_code "\\enableBackslashedChars" do_enable_backslashed_chars; def_code "\\snippetRunHook" do_snippet_run_hook; def_code "\\snipRunHook" do_snip_run_hook; () end;; register_init "videoc" init ;; end} hevea-2.23/section.ml0000644004317100512160000000413712017660721014563 0ustar marangetcristal(***********************************************************************) (* *) (* HEVEA *) (* *) (* Luc Maranget, projet PARA, INRIA Rocquencourt *) (* *) (* Copyright 1998 Institut National de Recherche en Informatique et *) (* Automatique. Distributed only by permission. *) (* *) (***********************************************************************) open Printf type style = Article | Book let style = ref Book let set_style sty = match String.uppercase sty with | "ARTICLE" -> style := Article | "BOOK" -> style := Book | _ -> Misc.warning (sprintf "strange style '%s'" sty) let value_article s = match s with | "DOCUMENT"|""|"NOW" -> 0 | "PART" -> 1 | "SECTION" -> 2 | "SUBSECTION" -> 3 | "SUBSUBSECTION" -> 4 | "PARAGRAPH" -> 5 | "SUBPARAGRAPH" -> 6 | _ -> Misc.warning (sprintf "argument '%s' as section level in article mode" s) ; 7 let value_book s = match s with | "DOCUMENT"|""|"NOW" -> 0 | "PART" -> 1 | "CHAPTER" ->2 | "SECTION" -> 3 | "SUBSECTION" -> 4 | "SUBSUBSECTION" -> 5 | "PARAGRAPH" -> 6 | "SUBPARAGRAPH" -> 7 | _ -> Misc.warning (Printf.sprintf "argument '%s' as section level in book mode" s) ; 8 let value s = (match !style with | Article -> value_article | Book -> value_book) (String.uppercase s) let pretty_article = function | 0 -> "document" | 1 -> "part" | 2 -> "section" | 3 -> "subsection" | 4 -> "subsubsection" | 5 -> "paragraph" | 6 -> "subparagraph" | _ -> assert false let pretty_book = function | 0 -> "document" | 1 -> "part" | 2 -> "chapter" | 3 -> "section" | 4 -> "subsection" | 5 -> "subsubsection" | 6 -> "paragraph" | 7 -> "subparagraph" | _ -> assert false let pretty x = (match !style with | Article -> pretty_article| Book -> pretty_book) x hevea-2.23/element.ml0000644004317100512160000000203512017660721014543 0ustar marangetcristal(***********************************************************************) (* *) (* HEVEA *) (* *) (* Luc Maranget, projet PARA, INRIA Rocquencourt *) (* *) (* Copyright 1998 Institut National de Recherche en Informatique et *) (* Automatique. Distributed only by permission. *) (* *) (***********************************************************************) (* For text-level elements *) type text = Style of string | Font of int | Color of string | StyleAttr of string * string let pretty_text = function Style s -> "Style: "^s | Font i -> "Font size: "^string_of_int i | Color s -> "Font color: "^s | StyleAttr (t,a) -> "Style with attributes: "^t^" ["^a^"]" ;; hevea-2.23/alltt.hva0000644004317100512160000000004507135354711014403 0ustar marangetcristal\@primitives{alltt} \alltt@loadedtruehevea-2.23/compat.hva0000644004317100512160000000026607042125057014547 0ustar marangetcristal\@stopoutput\@stopimage% Avoid echo to image file \let\@url\ahref% \def\url#1#2{\@url{#1}{#2}}% \def\oneurl#1{\ahrefurl{\texttt{#1}}} \let\footurl\url \@restartimage\@restartoutput% hevea-2.23/hot.ml0000644004317100512160000000264010461730545013711 0ustar marangetcristal(***********************************************************************) (* *) (* HEVEA *) (* *) (* Luc Maranget, projet Moscova, INRIA Rocquencourt *) (* *) (* Copyright 2001 Institut National de Recherche en Informatique et *) (* Automatique. Distributed only by permission. *) (* *) (* $Id: hot.ml,v 1.6 2006-07-26 18:16:05 maranget Exp $ *) (***********************************************************************) type saved = Misc.saved * Lexstate.saved * Latexmacros.saved * Counter.saved * Color.saved * Foot.saved let checkpoint () = Misc.checkpoint (), Lexstate.checkpoint (), Latexmacros.checkpoint (), Counter.checkpoint (), Color.checkpoint (), Foot.checkpoint () and start (misc, lexstate, latexmacros, counter, color, foot) = Misc.hot_start misc ; Lexstate.hot_start lexstate ; Latexmacros.hot_start latexmacros ; Counter.hot_start counter ; Color.hot_start color ; Foot.hot_start foot ; begin match !Parse_opts.destination with | Parse_opts.Info -> InfoRef.hot_start () | _ -> () end hevea-2.23/table.ml0000644004317100512160000000312412401623123014171 0ustar marangetcristal(***********************************************************************) (* *) (* HEVEA *) (* *) (* Luc Maranget, projet PARA, INRIA Rocquencourt *) (* *) (* Copyright 1999 Institut National de Recherche en Informatique et *) (* Automatique. Distributed only by permission. *) (* *) (***********************************************************************) exception Empty type 'a t = {mutable next : int ; mutable data : 'a array} let default_size = 32 ;; let create x = {next = 0 ; data = Array.make default_size x} and reset t = t.next <- 0 ;; let incr_table table new_size = let t = Array.make new_size table.data.(0) in Array.blit table.data 0 t 0 (Array.length table.data) ; table.data <- t let emit table i = let size = Array.length table.data in if table.next >= size then incr_table table (2*size); table.data.(table.next) <- i ; table.next <- table.next + 1 let apply table f = if table.next = 0 then raise Empty ; f table.data.(table.next - 1) let to_array t = Array.sub t.data 0 t.next let trim t = let r = Array.sub t.data 0 t.next in reset t ; r let remove_last table = table.next <- table.next -1; if table.next < 0 then table.next <- 0 ; ;; let get_size table = table.next ;; hevea-2.23/zyva.ml0000644004317100512160000000214110565402214014076 0ustar marangetcristal(***********************************************************************) (* *) (* HEVEA *) (* *) (* Luc Maranget, projet Moscova, INRIA Rocquencourt *) (* *) (* Copyright 2001 Institut National de Recherche en Informatique et *) (* Automatique. Distributed only by permission. *) (* *) (* $Id: zyva.ml,v 1.4 2007-02-16 19:22:52 maranget Exp $ *) (***********************************************************************) module type S = functor (Dest : OutManager.S) -> functor (Image : ImageManager.S) -> functor (Scan : Latexscan.S) -> sig end module Make (Dest: OutManager.S) (Image : ImageManager.S) (Scan : Latexscan.S) (ToMake : S) = struct module Rien = ToMake (Dest) (Image) (Scan) end hevea-2.23/out.mli0000644004317100512160000000136512017660721014077 0ustar marangetcristal(***********************************************************************) (* *) (* HEVEA *) (* *) (* Tibault Suzanne, Luc Maranget, projet Moscova, INRIA Rocquencourt *) (* *) (* Copyright 2012 Institut National de Recherche en Informatique et *) (* Automatique. Distributed only by permission. *) (* *) (***********************************************************************) include DoOut.S hevea-2.23/xxdate.exe0000755004317100512160000000132607112222714014561 0ustar marangetcristal#! /bin/sh cat < /dev/null || date | awk '{print $NF}'`} \newcounter{month}\setcounter{month}{`date +"%m"`} \newcounter{day}\setcounter{day}{`date +"%d"`} \newcounter{time}\setcounter{time}{60 * `date +"%H"` + `date +"%M"`} %% Extras \newcounter{hour}\setcounter{hour}{`date +"%H"`} \newcounter{Hour}\setcounter{Hour}{\value{hour}-(\value{hour}/12)*12} \newcounter{weekday}\setcounter{weekday}{`date +"%w"`} \newcounter{minute}\setcounter{minute}{`date +"%M"`} \newcounter{second}\setcounter{second}{`date +"%S"`} \def\ampm{\ifthenelse{\value{hour}>12}{PM}{AM}} \def\timezone{`date +"%Z" 2> /dev/null || date | awk '{print $5}'`} \def\heveadate{`date`} EOFhevea-2.23/lexstate.ml0000644004317100512160000005120612403604646014752 0ustar marangetcristal(***********************************************************************) (* *) (* HEVEA *) (* *) (* Luc Maranget, projet PARA, INRIA Rocquencourt *) (* *) (* Copyright 1998 Institut National de Recherche en Informatique et *) (* Automatique. Distributed only by permission. *) (* *) (***********************************************************************) open Printf open Misc open Lexing open MyStack (* Commands nature *) type action = | Subst of string list | Toks of string list | CamlCode of (Lexing.lexbuf -> unit) let body_to_string = String.concat "" let pretty_body chan = List.iter(fprintf chan "%s") let pretty_action acs = match acs with | Subst s -> eprintf "{%a}" (fun chan -> List.iter (fprintf chan "\"%s\" ")) s | Toks l -> List.iter (fun s -> Printf.fprintf stderr "{%s}, " s) l | CamlCode _ -> prerr_string "*code*" let rec is_empty_list = function | [] -> true | x::xs -> String.length x = 0 && is_empty_list xs type pat = string list * string list let pretty_pat (_,args) = List.iter (fun s -> prerr_string s ; prerr_char ',') args let is_subst body = match body with | CamlCode _ -> false | _ -> true let latex_pat opts n = let n_opts = List.length opts in let rec do_rec r i = if i <= n_opts then r else do_rec (("#"^string_of_int i)::r) (i-1) in opts,do_rec [] n let zero_pat = latex_pat [] 0 and one_pat = latex_pat [] 1 (* Environments *) type subst = Top | Env of string list arg array and 'a arg = {arg : 'a ; subst : subst } let mkarg arg subst = {arg=arg ; subst=subst } type alltt = Not | Inside | Macro let effective = function | Inside -> true | _ -> false let subst = ref Top and alltt = ref Not let stack_subst = MyStack.create "stack_subst" and stack_alltt = MyStack.create_init "stack_alltt" Not let get_subst () = !subst let top_subst = Top let pretty_subst = function | Top -> prerr_endline "Top level" | Env args -> if Array.length args <> 0 then begin prerr_endline "Env: " ; for i = 0 to Array.length args - 1 do prerr_string "\t'" ; eprintf "%a" pretty_body args.(i).arg ; prerr_endline "'" done end let rec pretty_subst_rec indent = function | Top -> prerr_string indent ; prerr_endline "Top level" | Env args -> if Array.length args <> 0 then begin prerr_string indent ; prerr_endline "Env: " ; for i = 0 to Array.length args - 1 do prerr_string indent ; prerr_string (" #"^string_of_int (i+1)^" ``"); pretty_body stderr args.(i).arg ; prerr_endline "''" ; pretty_subst_rec (" "^indent) args.(i).subst done end let full_pretty_subst s = pretty_subst_rec " " s exception Error of string (* Status flags *) let display = ref false and raw_chars = ref false and in_math = ref false and whitepre = ref false and optarg = ref false and styleloaded = ref false and activebrace = ref true and html = ref (match !Parse_opts.destination with | Parse_opts.Html -> true | Parse_opts.Info | Parse_opts.Text -> false) and text = ref (match !Parse_opts.destination with | Parse_opts.Html -> false | Parse_opts.Info | Parse_opts.Text -> true) and alltt_loaded = ref false (* Additional variables for videoc *) and withinLispComment = ref false and afterLispCommentNewlines = ref 0 (* Additional flags for transformations *) ;; type case = Upper | Lower | Neutral let case = ref Neutral ;; let string_to_arg arg = {arg=arg ; subst= !subst } (* Stacks for flags *) let stack_in_math = MyStack.create "stack_in_math" and stack_display = MyStack.create "stack_display" (* Stacks for entry stream *) let stack_lexbuf = MyStack.create "stack_lexbuf" ;; let pretty_lexbuf lb = let pos = lb.lex_curr_pos and len = Bytes.length lb.lex_buffer in prerr_endline "Buff contents:" ; let size = if !verbose > 3 then len-pos else min (len-pos) 80 in if size <> len-pos then begin prerr_string "<<" ; prerr_string (Bytes.sub_string lb.lex_buffer pos (size/2)) ; prerr_string "... (omitted) ..." ; prerr_string (Bytes.sub_string lb.lex_buffer (len-size/2-1) (size/2)) ; prerr_endline ">>" end else prerr_endline ("<<"^Bytes.sub_string lb.lex_buffer pos size^">>"); prerr_endline ("curr_pos="^string_of_int lb.lex_curr_pos); prerr_endline "End of buff" ;; (* arguments inside macros*) type closenv = string array t (* catcodes *) let plain_of_char = function | '{' -> 0 | '}' -> 1 | '$' -> 2 | '&' -> 3 | '#' -> 4 | '^' -> 5 | '_' -> 6 | '~' -> 7 | '\\' -> 8 | '%' -> 9 | '\'' -> 10 | '`' -> 11 | '-' -> 12 | '"' -> 13 (* '"' *) | c -> raise (Fatal ("Internal catcode table error: '"^String.make 1 c^"'")) and plain = Array.make 14 true let is_plain c = plain.(plain_of_char c) and set_plain c = (* if c = '_' then eprintf "set_plain %c\n" c ; *) plain.(plain_of_char c) <- true and unset_plain c = (* if c = '_' then eprintf "unset_plain %c\n" c ; *) plain.(plain_of_char c) <- false and plain_back b c = (* if c = '_' then eprintf "plain_back %c <- %b\n" c b ; *) plain.(plain_of_char c) <- b let top_level () = match !subst with Top -> true | _ -> false and is_top = function | Top -> true | _ -> false let prerr_args () = pretty_subst !subst let scan_arg lexfun i = let args = match !subst with | Top -> [||] | Env args -> args in if i >= Array.length args then begin if !verbose > 1 then begin prerr_string ("Subst arg #"^string_of_int (i+1)^" -> not found") ; pretty_subst !subst end ; raise (Error "Macro argument not found") end; let arg = args.(i) in if !verbose > 1 then begin eprintf "Subst arg #%i -> %a\n" i pretty_body arg.arg end ; let r = lexfun arg in r and scan_body do_exec body args = match body with | CamlCode _|Toks _ -> do_exec body | Subst _ -> let old_subst = !subst in subst := args ; let r = do_exec body in subst := old_subst ; r (* Recoding and restoring lexbufs *) let record_lexbuf lexbuf subst = MyStack.push stack_subst subst ; MyStack.push stack_lexbuf lexbuf ; and previous_lexbuf () = let lexbuf = MyStack.pop stack_lexbuf in subst := MyStack.pop stack_subst ; lexbuf ;; (* Saving and restoring lexing status *) let stack_lexstate = MyStack.create "stack_lexstate" let top_lexstate () = MyStack.empty stack_lexstate let save_lexstate () = let old_stack = MyStack.save stack_subst in MyStack.push stack_subst !subst ; push stack_lexstate (MyStack.save stack_lexbuf, MyStack.save stack_subst) ; MyStack.restore stack_subst old_stack and restore_lexstate () = let lexbufs,substs = pop stack_lexstate in MyStack.restore stack_lexbuf lexbufs ; MyStack.restore stack_subst substs ; subst := MyStack.pop stack_subst (* Flags save and restore *) let save_flags () = push stack_display !display ; push stack_in_math !in_math and restore_flags () = in_math := pop stack_in_math ; display := pop stack_display (* Total ckeckpoint of lexstate *) type saved_lexstate = (Lexing.lexbuf MyStack.saved * subst MyStack.saved) MyStack.saved * bool MyStack.saved * bool MyStack.saved let check_lexstate () = save_lexstate () ; save_flags () ; let r = MyStack.save stack_lexstate, MyStack.save stack_display, MyStack.save stack_in_math in restore_lexstate () ; restore_flags () ; r and hot_lexstate (l,d,m) = MyStack.restore stack_lexstate l ; MyStack.restore stack_display d ; MyStack.restore stack_in_math m ; restore_lexstate () ; restore_flags () ;; (* Blank lexing status *) let start_lexstate () = save_lexstate () ; MyStack.restore stack_lexbuf (MyStack.empty_saved) ; MyStack.restore stack_subst (MyStack.empty_saved) let start_lexstate_subst this_subst = start_lexstate () ; subst := this_subst ;; let flushing = ref false ;; let start_normal this_subst = start_lexstate () ; save_flags () ; display := false ; in_math := false ; subst := this_subst and end_normal () = restore_flags () ; restore_lexstate () ;; let full_peek_char lexbuf = let rec full_peek lexbuf = try Save.peek_next_char lexbuf with Not_found -> if MyStack.empty stack_lexbuf then raise Not_found else full_peek (previous_lexbuf ()) in full_peek lexbuf let full_save_arg eoferror mkarg parg lexfun lexbuf = let rec save_rec lexbuf = try let arg = lexfun lexbuf in mkarg arg !subst with Save.Eof -> begin if MyStack.empty stack_lexbuf then eoferror () else begin let lexbuf = previous_lexbuf () in if !verbose > 1 then begin prerr_endline "popping stack_lexbuf in full_save_arg"; pretty_lexbuf lexbuf ; prerr_args () end; save_rec lexbuf end end in let start_pos = Location.get_pos () in try Save.seen_par := false ; save_lexstate () ; let r = save_rec lexbuf in restore_lexstate () ; if !verbose > 2 then prerr_endline ("Arg parsed: '"^parg r^"'") ; r with | (Save.Error _ | Error _) as e -> restore_lexstate () ; Save.seen_par := false ; Location.print_this_pos start_pos ; prerr_endline "Parsing of argument failed" ; raise e | e -> restore_lexstate () ; raise e ;; let full_save_arg_limits eoferror parg lexfun lexbuf = let rec save_rec opt lexbuf = try lexfun opt lexbuf with Save.LimitEof r -> begin if MyStack.empty stack_lexbuf then match r with | None -> eoferror () | _ -> r else begin let lexbuf = previous_lexbuf () in if !verbose > 1 then begin prerr_endline "popping stack_lexbuf in full_save_arg_limits"; pretty_lexbuf lexbuf ; prerr_args () end; save_rec r lexbuf end end in let start_pos = Location.get_pos () in try Save.seen_par := false ; save_lexstate () ; let r = save_rec None lexbuf in restore_lexstate () ; if !verbose > 2 then prerr_endline ("Arg parsed: '"^parg r^"'") ; r with | (Save.Error _ | Error _) as e -> restore_lexstate () ; Save.seen_par := false ; Location.print_this_pos start_pos ; prerr_endline "Parsing of argument failed" ; raise e | e -> restore_lexstate () ; raise e ;; type ok = No of string | Yes of string list ;; let parg {arg=arg} = arg and pargs {arg=args} = String.concat ", " args and parg_list {arg=xs} = body_to_string xs and pok = function | {arg=Yes s} -> String.concat "" s | {arg=No s} -> "* default arg: ["^s^"] *" let eof_arg () = Save.empty_buffs () ; raise (Error "Eof while looking for argument") let save_arg lexbuf = full_save_arg eof_arg mkarg parg Save.arg lexbuf and save_body lexbuf = full_save_arg eof_arg mkarg parg_list Save.arg_list lexbuf and save_arg_with_delim delim lexbuf = full_save_arg eof_arg mkarg parg (Save.with_delim delim) lexbuf and save_filename lexbuf = full_save_arg eof_arg mkarg parg Save.filename lexbuf and save_verbatim lexbuf = full_save_arg eof_arg mkarg parg Save.arg_verbatim lexbuf and save_xy_arg lexbuf = full_save_arg eof_arg mkarg parg Save.xy_arg lexbuf and save_cite_arg lexbuf = full_save_arg eof_arg mkarg pargs Save.cite_arg lexbuf type sup_sub = { limits : Misc.limits option ; sup : string arg ; sub : string arg ; } let plimits = function | Some Limits -> "\\limits" | Some NoLimits -> "\\nolimits" | Some IntLimits -> "\\intlimits" | None -> "*no limit info*" exception Over let eof_over () = raise Over let save_limits lexbuf = let rec do_rec res = try let r = full_save_arg_limits eof_over plimits Save.get_limits lexbuf in match r with | None -> res | Some _ -> do_rec r with | Over -> res in do_rec None let mkoptionarg opt subst = match opt with | None -> None | Some s -> Some (mkarg s subst) and poptionarg = function | None -> "*None*" | Some a -> a.arg let save_sup lexbuf = try full_save_arg eof_over mkoptionarg poptionarg Save.get_sup lexbuf with | Over -> None and save_sub lexbuf = try full_save_arg eof_over mkoptionarg poptionarg Save.get_sub lexbuf with | Over -> None let unoption = function | None -> {arg="" ; subst=top_subst } | Some a -> a let save_sup_sub lexbuf = let limits = save_limits lexbuf in match save_sup lexbuf with | None -> let sub = save_sub lexbuf in let sup = save_sup lexbuf in {limits=limits ; sup = unoption sup ; sub = unoption sub} | Some sup -> let sub = save_sub lexbuf in {limits=limits ; sup = sup ; sub = unoption sub} let protect_save_string lexfun lexbuf = full_save_arg eof_arg (fun s _ -> s) (fun s -> s) lexfun lexbuf let eof_opt default () = {arg=No default ; subst=Top } let save_arg_opt default lexbuf = let r = full_save_arg (eof_opt default) mkarg pok (fun lexbuf -> try Yes (Save.opt_list lexbuf) with | Save.NoOpt -> No default) lexbuf in match r.arg with | Yes _ -> r | No _ -> mkarg (No default) !subst ;; let from_ok okarg = match okarg.arg with | Yes s -> optarg := true ; mkarg s okarg.subst | No s -> optarg := false ; mkarg [s] okarg.subst let pretty_ok = function Yes s -> "+"^String.concat "" s^"+" | No s -> "-"^s^"-" ;; let norm_arg s = String.length s = 2 && s.[0] = '#' && ('0' <= s.[1] && s.[1] <= '9') let list_arg a = { a with arg = [a.arg] } let rec parse_args_norm pat lexbuf = match pat with | [] -> [] | s :: (ss :: _ as pat) when norm_arg s && norm_arg ss -> let arg = save_body lexbuf in let r = parse_args_norm pat lexbuf in arg :: r | s :: ss :: pat when norm_arg s && not (norm_arg ss) -> let arg = save_arg_with_delim ss lexbuf in list_arg arg :: parse_args_norm pat lexbuf | s :: pat when not (norm_arg s) -> Save.skip_delim s lexbuf ; parse_args_norm pat lexbuf | _ :: pat -> let arg = save_body lexbuf in let r = parse_args_norm pat lexbuf in arg :: r ;; let skip_csname lexbuf = let _ = Save.csname (fun x -> x) (fun x -> x) lexbuf in () let skip_opt lexbuf = let _ = save_arg_opt "" lexbuf in () and save_opt def lexbuf = from_ok (save_arg_opt def lexbuf) ;; let rec save_opts pat lexbuf = match pat with [] -> [] | def::rest -> let arg = save_arg_opt def lexbuf in let r = save_opts rest lexbuf in arg :: r ;; let parse_args (popt,pat) lexbuf = Save.seen_par := false ; let opts = save_opts popt lexbuf in begin match pat with | s :: ss :: _ when norm_arg s && not (norm_arg ss) -> Save.skip_blanks_init lexbuf | _ -> () end ; let args = parse_args_norm pat lexbuf in (opts,args) ;; let make_stack name pat lexbuf = try let (opts,args) = parse_args pat lexbuf in let args = Array.of_list (List.map from_ok opts@args) in if !verbose > 1 then begin Printf.fprintf stderr "make_stack for macro: %s " name ; pretty_pat pat ; prerr_endline ""; for i = 0 to Array.length args-1 do Printf.fprintf stderr "\t#%d = %a\n" (i+1) pretty_body args.(i).arg ; pretty_subst (args.(i).subst) done end ; Env args with Save.Delim delim -> raise (Error ("Use of "^name^ " does not match its definition (delimiter: "^delim^")")) ;; let scan_this lexfun s = start_lexstate (); if !verbose > 1 then begin Printf.fprintf stderr "scan_this : [%s]" s ; prerr_endline "" end ; let lexbuf = MyLexing.from_string s in let r = lexfun lexbuf in if !verbose > 1 then begin Printf.fprintf stderr "scan_this : over" ; prerr_endline "" end ; restore_lexstate (); r and scan_this_list lexfun xs = start_lexstate (); if !verbose > 1 then begin eprintf "scan_this_list : [%a]" pretty_body xs ; prerr_endline "" end ; let lexbuf = MyLexing.from_list xs in let r = lexfun lexbuf in if !verbose > 1 then begin Printf.fprintf stderr "scan_this_list : over" ; prerr_endline "" end ; restore_lexstate (); r and scan_this_arg lexfun {arg=s ; subst=this_subst } = start_lexstate () ; subst := this_subst ; if !verbose > 1 then begin Printf.fprintf stderr "scan_this_arg : [%s]" s ; prerr_endline "" end ; let lexbuf = MyLexing.from_string s in let r = lexfun lexbuf in if !verbose > 1 then begin Printf.fprintf stderr "scan_this_arg : over" ; prerr_endline "" end ; restore_lexstate (); r and scan_this_arg_list lexfun {arg=xs ; subst=this_subst } = start_lexstate () ; subst := this_subst ; if !verbose > 1 then begin Printf.fprintf stderr "scan_this_arg_list : [%a]\n%!" pretty_body xs end ; let lexbuf = MyLexing.from_list xs in let r = lexfun lexbuf in if !verbose > 1 then begin Printf.fprintf stderr "scan_this_arg : over\n%!" end ; restore_lexstate (); r ;; let scan_this_may_cont lexfun lexbuf cur_subst {arg=s ; subst=env } = if !verbose > 1 then begin Printf.fprintf stderr "scan_this_may_cont : [%s]" s ; prerr_endline "" ; if !verbose > 1 then begin prerr_endline "Pushing lexbuf and env" ; pretty_lexbuf lexbuf ; pretty_subst !subst end end ; save_lexstate (); record_lexbuf lexbuf cur_subst ; subst := env ; let lexer = MyLexing.from_string s in let r = lexfun lexer in restore_lexstate (); if !verbose > 1 then begin Printf.fprintf stderr "scan_this_may_cont : over" ; prerr_endline "" end ; r let scan_this_list_may_cont lexfun lexbuf cur_subst {arg=s ; subst=env } = if !verbose > 1 then begin eprintf "scan_this_list_may_cont : [%a]\n%!" pretty_body s ; if !verbose > 1 then begin prerr_endline "Pushing lexbuf and env" ; pretty_lexbuf lexbuf ; pretty_subst !subst end end ; save_lexstate (); record_lexbuf lexbuf cur_subst ; subst := env ; let lexer = MyLexing.from_list s in let r = lexfun lexer in restore_lexstate (); if !verbose > 1 then begin Printf.fprintf stderr "scan_this_list_may_cont : over" ; prerr_endline "" end ; r let real_input_file loc_verb main filename input = if !verbose > 0 then prerr_endline ("Input file: "^filename) ; let buf = Lexing.from_channel input in Location.set filename buf ; let old_verb = !verbose in verbose := loc_verb ; if !verbose > 1 then prerr_endline ("scanning: "^filename) ; start_lexstate () ; let old_lexstate = MyStack.save stack_lexstate in subst := Top ; begin try main buf with | Misc.EndInput -> MyStack.restore stack_lexstate old_lexstate | e -> MyStack.restore stack_lexstate old_lexstate ; restore_lexstate (); close_in input ; verbose := old_verb ; (* NO Location.restore () ; for proper error messages *) raise e end ; restore_lexstate (); if !verbose > 1 then prerr_endline ("scanning over: "^filename) ; close_in input ; verbose := old_verb ; Location.restore () let input_file loc_verb main filename = try let filename,input = Myfiles.open_tex filename in real_input_file loc_verb main filename input with Myfiles.Except -> begin if !verbose > 0 then prerr_endline ("Not opening file: "^filename) ; raise Myfiles.Except end | Myfiles.Error m as x -> begin Misc.warning m ; raise x end (* Hot start *) type saved = (string * bool ref) list * bool list let cell_list = ref [] let checkpoint () = !cell_list, List.map (fun (_,cell) -> !cell) !cell_list ; and hot_start (cells, values) = let rec start_rec cells values = match cells, values with | [],[] -> () | (name,cell)::rcells, value :: rvalues -> if !verbose > 1 then begin prerr_endline ("Restoring "^name^" as "^if value then "true" else "false") end ; cell := value ; start_rec rcells rvalues | _,_ -> Misc.fatal ("Trouble in Lexstate.hot_start") in start_rec cells values ; cell_list := cells let register_cell name cell = cell_list := (name,cell) :: !cell_list and unregister_cell name = let rec un_rec = function | [] -> Misc.warning ("Cannot unregister cell: "^name) ; [] | (xname,cell) :: rest -> if xname = name then rest else (xname,cell) :: un_rec rest in cell_list := un_rec !cell_list hevea-2.23/lexstyle.mll0000644004317100512160000001044012265237214015140 0ustar marangetcristal(***********************************************************************) (* *) (* HEVEA *) (* *) (* Luc Maranget, projet Moscova, INRIA Rocquencourt *) (* *) (* Copyright 2012 Institut National de Recherche en Informatique et *) (* Automatique. Distributed only by permission. *) (* *) (***********************************************************************) (* Extract/abstract style attributes *) { open Printf open Emisc let error msg _lb = raise (Emisc.LexError msg) } let blank = [' ''\t''\n''\r'] let tag = ['a'-'z''A'-'Z''0'-'9']+ let class_name = ['a'-'z''A'-'Z''0'-'9''-']+ let attr_name = ['a'-'z''A'-'Z''0'-'9']['a'-'z''A'-'Z''-''0'-'9'':']* rule extract styles = parse (* TOC comments are scanned *) | "" '\n'? { } | _ {skip_comment lexbuf} | eof {error "End of file in comment" lexbuf} and dump m out = parse | "' '\n'? as lxm { fprintf out "%s" lxm ; Emisc.StringMap.iter (fun st cl -> Emisc.dump_class out cl st) m ; dump m out lexbuf } | "" '\n'? as lxm { output_string out lxm } | _ as c { output_char out c ; dump_comment out lexbuf } | eof {error "End of file in comment" lexbuf} and dump_tag out = parse | [^'>']* '>' as lxm { output_string out lxm } | "" { error "dump_tag" lexbuf } and abstract_tag cl attrs m out = parse | '>' { let cl = match cl with | [] -> [] | _ -> [sprintf "class=\"%s\"" (String.concat " " (List.rev cl))] in let na = cl @ List.rev attrs in List.iter (fprintf out " %s") na ; output_char out '>' } | blank+ { abstract_tag cl attrs m out lexbuf } | ("style"|"STYLE") blank* "=" blank* (('\'' ([^'\'']* as v) '\'' | '"' ([^'"']* as v) '"' | ('#'?['a'-'z''A'-'Z''0'-'9''-''+''_'':''.']+ as v))) as a (* '"' *) { try let tcl = Emisc.StringMap.find v m in abstract_tag (tcl::cl) attrs m out lexbuf with Not_found -> abstract_tag cl (a::attrs) m out lexbuf } | ("class"|"CLASS") blank* "=" blank* (('\'' ([^'\'']* as v) '\'' | '"' ([^'"']* as v) '"' | ('#'?['a'-'z''A'-'Z''0'-'9''-''+''_'':''.']+ as v))) (* '"' *) { abstract_tag (v::cl) attrs m out lexbuf } | attr_name ( blank* "=" blank* ('\'' ([^'\'']*) '\'' | '"' ([^'"']*) '"' | '#'?['a'-'z''A'-'Z''0'-'9''-''+''_'':''.']+))? as a (* '"' *) { abstract_tag cl (a::attrs) m out lexbuf } | "" { error "abstract_tag" lexbuf } { let get lexbuf = extract StringCount.empty lexbuf let set m out lexbuf = dump m out lexbuf } hevea-2.23/get.mll0000644004317100512160000003272312017660721014054 0ustar marangetcristal(***********************************************************************) (* *) (* HEVEA *) (* *) (* Luc Maranget, projet PARA, INRIA Rocquencourt *) (* *) (* Copyright 1998 Institut National de Recherche en Informatique et *) (* Automatique. Distributed only by permission. *) (* *) (***********************************************************************) { open Printf open Misc open Lexing open Latexmacros open Lexstate open MyStack open Length (* Compute functions *) exception Error of string let sbool = function | true -> "true" | false -> "false" let get_this = ref (fun _ -> assert false) and get_fun = ref (fun _f _lexbuf -> assert false) and open_env = ref (fun _ -> ()) and close_env = ref (fun _ -> ()) and get_csname = ref (fun _ -> assert false) and main = ref (fun _ -> assert false) ;; let bool_out = ref false and int_out = ref false let int_stack = MyStack.create "int_stack" and bool_stack = MyStack.create "bool_stack" and group_stack = MyStack.create "group_stack" and just_opened = ref false type saved = bool * bool MyStack.saved * bool * int MyStack.saved * (unit -> unit) MyStack.saved * bool let check () = !bool_out, MyStack.save bool_stack, !int_out, MyStack.save int_stack, MyStack.save group_stack, !just_opened and hot (b,bs,i,is,gs,j) = bool_out := b ; MyStack.restore bool_stack bs ; int_out := i ; MyStack.restore int_stack is ; MyStack.restore group_stack gs ; just_opened := j let push_int x = if !verbose > 2 then prerr_endline ("PUSH INT: "^string_of_int x) ; just_opened := false ; push int_stack x let open_ngroups n = let rec open_ngroups_rec = function | 0 ->() | n -> push group_stack (fun () -> ()) ; open_ngroups_rec (n-1) in if !verbose > 2 then prerr_endline ("OPEN NGROUPS: "^string_of_int n) ; if n > 0 then begin just_opened := true ; open_ngroups_rec n end let close_ngroups n = let rec close_ngroups_rec = function | 0 -> () | n -> let f = pop group_stack in f() ; close_ngroups_rec (n-1) in if !verbose > 2 then prerr_endline ("CLOSE NGROUPS: "^string_of_int n); close_ngroups_rec n let open_aftergroup f s = if !verbose > 2 then prerr_endline ("OPEN AFTER: "^s) ; just_opened := true ; push group_stack f } let command_name = '\\' ((['@''A'-'Z' 'a'-'z']+ '*'?) | [^ '@' 'A'-'Z' 'a'-'z'] | "\\*") rule result = parse (* Skip comments and spaces *) | '%' [^ '\n'] * '\n' {result lexbuf} | [' ' '\n']+ {result lexbuf} (* Integers *) | ['0'-'9']+ {let lxm = Lexing.lexeme lexbuf in push_int (int_of_string lxm) ; result lexbuf} | '\'' ['0'-'7']+ {let lxm = lexeme lexbuf in push_int (int_of_string ("0o"^String.sub lxm 1 (String.length lxm-1))) ; result lexbuf} | "\"" ['0'-'9' 'a'-'f' 'A'-'F']+ {let lxm = lexeme lexbuf in push_int (int_of_string ("0x"^String.sub lxm 1 (String.length lxm-1))) ; result lexbuf} | '`' {let token = !get_csname lexbuf in after_quote (MyLexing.from_string token) ; result lexbuf} | "true" {push bool_stack true ; result lexbuf} | "false" {push bool_stack false ; result lexbuf} (* Operands *) | '+' | '-' as lxm {let unary = !just_opened in if unary then begin let f = pop group_stack in open_aftergroup (fun () -> if !verbose > 2 then begin prerr_endline ("UNARY: "^String.make 1 lxm) ; MyStack.pretty string_of_int int_stack end ; let x1 = pop int_stack in let r = match lxm with | '+' -> x1 | '-' -> 0 - x1 | _ -> assert false in push_int r ; f()) "UNARY" end else begin close_ngroups 2 ; open_aftergroup (fun () -> if !verbose > 2 then begin prerr_endline ("OPPADD: "^String.make 1 lxm) ; MyStack.pretty string_of_int int_stack end ; let x2 = pop int_stack in let x1 = pop int_stack in let r = match lxm with | '+' -> x1 + x2 | '-' -> x1 - x2 | _ -> assert false in push_int r) "ADD"; open_ngroups 1 ; end ; result lexbuf} | '/' | '*' {let lxm = lexeme_char lexbuf 0 in close_ngroups 1 ; open_aftergroup (fun () -> if !verbose > 2 then begin prerr_endline ("MULTOP"^String.make 1 lxm) ; MyStack.pretty string_of_int int_stack end ; let x2 = pop int_stack in let x1 = pop int_stack in let r = match lxm with | '*' -> x1 * x2 | '/' -> x1 / x2 | _ -> assert false in push_int r) "MULT"; result lexbuf} (* boolean openrands *) | '<' | '>' | '=' {let lxm = Lexing.lexeme_char lexbuf 0 in close_ngroups 3 ; open_aftergroup (fun () -> if !verbose > 2 then begin prerr_endline ("COMP: "^String.make 1 lxm) ; MyStack.pretty string_of_int int_stack end ; let x2 = pop int_stack in let x1 = pop int_stack in push bool_stack (match lxm with | '<' -> x1 < x2 | '>' -> x1 > x2 | '=' -> x1 = x2 | _ -> assert false) ; if !verbose > 2 then MyStack.pretty sbool bool_stack) "COMP" ; open_ngroups 2 ; result lexbuf} (* Parenthesis for integer computing *) | '('|'{' {open_ngroups 2 ; result lexbuf} | ')'|'}' {close_ngroups 2 ; result lexbuf} (* Commands *) | '#' ['1'-'9'] {let lxm = lexeme lexbuf in let i = Char.code (lxm.[1]) - Char.code '1' in scan_arg (scan_this_arg_list result) i ; result lexbuf} | command_name as lxm {let pat,body = Latexmacros.find lxm in let args = make_stack lxm pat lexbuf in scan_body (function | Subst body -> scan_this_list result body | Toks l -> List.iter (scan_this result) (List.rev l) | CamlCode f -> let rs = !get_fun f lexbuf in scan_this result rs) body args ; result lexbuf} | _ {raise (Error ("Bad character in Get.result: ``"^lexeme lexbuf^"''"))} | eof {()} and after_quote = parse | '\\' [^ 'A'-'Z' 'a'-'z'] eof {let lxm = lexeme lexbuf in push_int (Char.code lxm.[1]); result lexbuf} | _ eof {let lxm = lexeme lexbuf in push_int (Char.code lxm.[0]); result lexbuf} | "" {Misc.fatal "Cannot understand `-like numerical argument"} { let init latexget latexgetfun latexopenenv latexcloseenv latexcsname latexmain = get_this := latexget ; get_fun := latexgetfun ; open_env := latexopenenv ; close_env := latexcloseenv ; get_csname := latexcsname ; main := latexmain ;; let def_loc name f = Latexmacros.def name zero_pat (CamlCode f) ; ;; let def_commands l = List.map (fun (name,f) -> name,Latexmacros.replace name (Some (zero_pat,CamlCode f))) l let def_commands_int () = def_commands ["\\value", (fun lexbuf -> let name = !get_this (save_arg lexbuf) in push_int (Counter.value_counter name)) ; "\\@lengthtonchar", (fun lexbuf -> let length = Length.main (MyLexing.from_string (!get_this (save_arg lexbuf))) in let r = match length with | Length.Char x -> x | Length.Pixel x -> pixel_to_char x | _ -> 2 in push_int r) ; "\\pushint", (fun lexbuf -> let s = !get_this (save_arg lexbuf) in scan_this result s)] let def_commands_bool () = let old_ints = def_commands_int () in let old_commands = def_commands ["\\(", (fun _ -> open_ngroups 7) ; "\\)", (fun _ -> close_ngroups 7) ; "\\@fileexists", (fun lexbuf -> let name = !get_this (save_arg lexbuf) in push bool_stack (try let _,chan = Myfiles.open_tex name in begin try close_in chan with Sys_error _ -> () end ; true with Myfiles.Except | Myfiles.Error _ -> false)) ; "\\@commandexists", (fun lexbuf -> let name = !get_csname lexbuf in (* Printf.eprintf "EXISTS? '%s'\n" name ; *) push bool_stack (Latexmacros.exists name)) ; "\\or", (fun _ -> close_ngroups 7 ; open_aftergroup (fun () -> if !verbose > 2 then begin prerr_endline "OR" ; MyStack.pretty sbool bool_stack end ; let b1 = pop bool_stack in let b2 = pop bool_stack in push bool_stack (b1 || b2)) "OR"; open_ngroups 6) ; "\\and", (fun _ -> close_ngroups 6 ; open_aftergroup (fun () -> if !verbose > 2 then begin prerr_endline "AND" ; MyStack.pretty sbool bool_stack end ; let b1 = pop bool_stack in let b2 = pop bool_stack in push bool_stack (b1 && b2)) "AND"; open_ngroups 5) ; "\\not", (fun _ -> close_ngroups 4 ; open_aftergroup (fun () -> if !verbose > 2 then begin prerr_endline "NOT" ; MyStack.pretty sbool bool_stack end ; let b1 = pop bool_stack in push bool_stack (not b1)) "NOT"; open_ngroups 3) ; "\\boolean", (fun lexbuf -> let name = !get_this (save_arg lexbuf) in let b = try let r = !get_this (string_to_arg ("\\if"^name^" true\\else false\\fi")) in match r with | "true" -> true | "false" -> false | _ -> raise (Misc.Fatal ("boolean value: "^r)) with Latexmacros.Failed -> true in push bool_stack b) ; "\\isodd", (fun _lexbuf -> close_ngroups 3 ; open_aftergroup (fun () -> if !verbose > 2 then begin prerr_endline ("ISODD") ; MyStack.pretty string_of_int int_stack end ; let x = pop int_stack in push bool_stack (x mod 2 = 1) ; if !verbose > 2 then MyStack.pretty sbool bool_stack) "ISODD" ; open_ngroups 2) ] in let old_equal = try Some (Latexmacros.find_fail "\\equal") with Failed -> None in def_loc "\\equal" (fun lexbuf -> let arg1 = save_arg lexbuf in let arg2 = save_arg lexbuf in scan_this !main "\\begin{@norefs}" ; let again = List.map (fun (name,x) -> name,Latexmacros.replace name x) ((("\\equal",old_equal)::old_ints)@old_commands) in push bool_stack (!get_this arg1 = !get_this arg2) ; let _ = List.map (fun (name,x) -> Latexmacros.replace name x) again in scan_this !main "\\end{@norefs}") type 'a funs = { pp : out_channel -> 'a -> unit ; to_string : 'a -> string ; scan_this : (Lexing.lexbuf -> unit) -> 'a -> unit; } let string_funs = { pp = output_string ; to_string = (fun x -> x) ; scan_this = scan_this; } let list_funs = { pp = pretty_body ; to_string = String.concat ""; scan_this = scan_this_list; } let do_get_int f {arg=expr ; subst=subst} = if !verbose > 1 then eprintf "get_int : '%a'\n%!" f.pp expr ; let r = let old_int = !int_out in int_out := true ; start_normal subst ; !open_env "*int*" ; let _ = def_commands_int () in open_ngroups 2 ; begin try f.scan_this result expr with | x -> begin eprintf "Error while scanning '%a' for integer result\n%!" f.pp expr ; raise x end end ; close_ngroups 2 ; !close_env "*int*" ; end_normal () ; if MyStack.empty int_stack then raise (Error (sprintf "'%s'' has no value as an integer" (f.to_string expr))) ; let r = pop int_stack in int_out := old_int ; r in if !verbose > 1 then eprintf "get_int: '%a' -> %i\n%!" f.pp expr r ; r let get_int_string a = do_get_int string_funs a let get_int a = do_get_int list_funs a let get_bool {arg=expr ; subst=subst} = if !verbose > 1 then prerr_endline ("get_bool : "^expr) ; let old_bool = !bool_out in bool_out := true ; start_normal subst ; !open_env "*bool*" ; def_commands_bool () ; open_ngroups 7 ; begin try scan_this result expr with | x -> begin prerr_endline ("Error while scanning ``"^expr^"'' for boolean result"); raise x end end ; close_ngroups 7 ; !close_env "*bool*" ; end_normal () ; if MyStack.empty bool_stack then raise (Error ("``"^expr^"'' has no value as a boolean")); let r = pop bool_stack in if !verbose > 1 then prerr_endline ("get_bool: "^expr^" = "^sbool r); bool_out := old_bool ; r let get_length arg = if !verbose > 1 then prerr_endline ("get_length : "^arg) ; let r = Length.main (MyLexing.from_string arg) in if !verbose > 2 then begin prerr_string ("get_length : "^arg^" -> ") ; prerr_endline (Length.pretty r) end ; r } hevea-2.23/hyperref.hva0000644004317100512160000000441712113070517015105 0ustar marangetcristal\ProvidesPackage{hyperref} \RequirePackage{url} \RequirePackage{labeltype} \@primitives{hyperref} \newcommand{\@hr@expand}[1] {\begingroup\catcode`\%=12\catcode`\~=12#1\endgroup} \newcommand{\texorpdfstring}[2]{#1} \newcommand{\hyperlink}[2]{\ahrefloc{#1}{#2}} \newcommand{\hypertarget}[2]{\aname{#1}{#2}} \newcommand{\hyperdef}[3]{\hypertarget{#1.#2}{#3}} \newcommand{\hyperbaseurl}[1]{} \newcommand{\@hyperreflabel}[2]{\ahrefloc{\@getprint{#1}}{{\let\ref\@auxread#2}}} \newcommand{\hyperref}[1][] {\ifoptarg\let\hyper@next\@hyperreflabel\else \let\hyper@next\@hyperref\fi \hyper@next{#1}} \def\url{\begingroup \def\UrlLeft##1\UrlRight{\ahrefurl{##1}}% \urlstyle{tt}% \Url} \newcommand{\hypersetup}[1]{} %%%%%%%%%%%%%%%%% %%Autoref stuff%% %%%%%%%%%%%%%%%%% %%Load list of words according to language \input{hrlang.hva} \newcommand{\HyLang@DeclareLang}[3] {\DeclareOption{#1}{\csname HyLang@#2\endcsname}} \HyLang@DeclareLang{english}{english}{} \HyLang@DeclareLang{UKenglish}{english}{} \HyLang@DeclareLang{british}{english}{} \HyLang@DeclareLang{USenglish}{english}{} \HyLang@DeclareLang{american}{english}{} \HyLang@DeclareLang{german}{german}{} \HyLang@DeclareLang{austrian}{german}{} \HyLang@DeclareLang{ngerman}{german}{} \HyLang@DeclareLang{naustrian}{german}{} \HyLang@DeclareLang{brazil}{portuges}{} \HyLang@DeclareLang{brazilian}{portuges}{} \HyLang@DeclareLang{portuguese}{portuges}{} \HyLang@DeclareLang{spanish}{spanish}{} \HyLang@DeclareLang{afrikaans}{afrikaans}{} \HyLang@DeclareLang{french}{french}{} \HyLang@DeclareLang{frenchb}{french}{} \HyLang@DeclareLang{francais}{french}{} \HyLang@DeclareLang{acadian}{french}{} \HyLang@DeclareLang{canadien}{french}{} \HyLang@DeclareLang{italian}{italian}{} \HyLang@DeclareLang{magyar}{magyar}{} \HyLang@DeclareLang{hungarian}{magyar}{} %%English default \HyLang@english %%Get the right sectionname macro from type \newcommand{\@hr@name}[1] {\ifu\csname #1autorefname\endcsname\csname #1name\endcsname\else \csname #1autorefname\endcsname\fi} \let\@hr@deflabeltype\@deflabeltype \def\@deflabeltype#1#2{% \@hr@deflabeltype{#1}{#2} \def\csname @hr@#1@name\endcsname{\@hr@name{#2}}% } %%expand \ref so as to include section name in link. \newcommand{\autoref}[1]{% \@locref{\@check@anchor@label{#1}}{\csname @hr@#1@name\endcsname~\@auxread{#1}}} \ProcessOptions* hevea-2.23/imagen.std0000755004317100512160000000461711330060611014534 0ustar marangetcristal#! /bin/sh LATEX=latex DVIPS=dvips GS=gs RESOLUTION=100 # resolution in dpi PNMCROP="pnmcrop -white" PNMEXTRA="" PNMMARGIN="pnmmargin -white 1" PPMQUANT="" #PPMTOEXT="pnmtopng -transparent '#ffffff'" #EXT=png PPMTOEXT="ppmtogif -transparent '#ffffff'" EXT=gif TODIR="." RM="/bin/rm -f" while true do case $1 in -todir) shift TODIR="$1" mkdir -p ${TODIR} 2> /dev/null || : ;; -gif) PPMTOEXT="ppmtogif -transparent '#ffffff'" EXT=gif ;; -png) PPMTOEXT="pnmtopng -transparent '#ffffff'" EXT=png ;; -pnm) PPMTOEXT=cat EXT=pnm ;; -quant) shift PPMQUANT="ppmquant $1 2>/dev/null |" ;; -extra) shift PNMEXTRA="$1 |" ;; -mag) shift RESOLUTION="$( expr '(' "$1" '*' 72 '+' 999 ')' '/' 1000)" ;; -res) shift RESOLUTION="$1" ;; -t) shift TPAPER="-t $1" ;; -pdflatex|-pdf) LATEX=pdflatex DVIPS=cat ;; *) break ;; esac shift done echo "RESOLUTION: $RESOLUTION" #always quantize for gifs (ppmtogif ouputs non valid files when colors >= 256) if [ "$EXT" = "gif" -a -z "$PPMQUANT" ] then PPMQUANT="ppmquant 255 2>/dev/null |" fi case $1 in '') BASE=image ;; *) BASE=$1 ;; esac NAME=${BASE}.image trap "${RM} ${NAME}.dvi ${NAME}.pdf `basename ${NAME}.log` `basename ${NAME}.aux` head.tmp body.tmp ; exit 2" 1 2 3 8 10 13 15 DVIPSOPTS="-Z $TPAPER" GSOPTS="-q -dNOPAUSE -dBATCH -DNOPROMPT -sDEVICE=ppmraw \ -r$RESOLUTION -dAutoRotatePages=/None \ -dTextAlphaBits=4 -dGraphicsAlphaBits=4" if [ "${TODIR}" = "." ] then FINAL=${BASE}%03d.${EXT} else FINAL=${TODIR}/${BASE}%03d.${EXT} fi test -f ${NAME}.tex ||\ { echo "Failure: no ${NAME}.tex file!" 2>&1 ; exit 2 ; } ${LATEX} ${NAME}.tex NAMEDIR=`dirname ${NAME}` if [ "${LATEX}" = "pdflatex" ] then if [ ${NAMEDIR} != "." ] then mv `basename ${NAME}.pdf` ${NAME}.pdf fi cat ${NAME}.pdf else if [ ${NAMEDIR} != "." ] then mv `basename ${NAME}.dvi` ${NAME}.dvi fi ${DVIPS} ${DVIPSOPTS} -o - ${NAME}.dvi fi |\ ${GS} ${GSOPTS} -sOutputFile="|\ ${PNMCROP} | ${PNMEXTRA} \ ${PNMMARGIN} | ${PPMQUANT} \ ${PPMTOEXT} 2>/dev/null > ${FINAL}" - ${RM} ${NAME}.dvi ${NAME}.pdf head.tmp body.tmp ${RM} `basename ${NAME}.log` `basename ${NAME}.aux`hevea-2.23/contents_motif.gif0000644004317100512160000000047406537544364016325 0ustar marangetcristalGIF89ap!" Imported from XPM image: toc.xpm!,@6313c B0 0 A0 0 0 0 `0@`0 `  `0@`0 `0@`0000000000 0000000000 00000000 000000 0000 000000000 00000000000 00000000000000` ;hevea-2.23/check402.ml0000644004317100512160000000016612403604660014417 0ustar marangetcristallet () = if compare Sys.ocaml_version "4.02.0" >= 0 then Printf.printf "ok\n" else Printf.printf "no\n" hevea-2.23/image.ml0000644004317100512160000000460012017660721014174 0ustar marangetcristal(***********************************************************************) (* *) (* HEVEA *) (* *) (* Luc Maranget, projet PARA, INRIA Rocquencourt *) (* *) (* Copyright 1998 Institut National de Recherche en Informatique et *) (* Automatique. Distributed only by permission. *) (* *) (***********************************************************************) open Misc let base = Parse_opts.base_out ;; let count = ref 0 ;; let buff = ref (Out.create_null ()) ;; let active = ref false ;; let start () = active := true ; count := 0 ; buff := Out.create_buff () ;; let active_stack = MyStack.create "Image.active" let stop () = MyStack.push active_stack !active ; active := false and restart () = if MyStack.empty active_stack then active := true else active := MyStack.pop active_stack let put s = if !active then Out.put !buff s and put_char c = if !active then Out.put_char !buff c let tmp_name = if Parse_opts.filter then "" else base ^ ".image.tex.new" let open_chan () = let chan = open_out tmp_name in Out.to_chan chan !buff ; buff := Out.create_chan chan and close_chan () = Out.close !buff let page () = let n = !count in if !verbose > 0 then begin Location.print_pos (); Printf.fprintf stderr "dump image number %d" (n+1) ; prerr_endline "" end ; if n = 0 then open_chan () ; incr count ; put ("\n\\clearpage% page: "^string_of_int n^"\n") ;; let dump s_open image lexbuf = Out.put !buff s_open ; image lexbuf ;; let finalize check = active := false ; if !count > 0 then begin close_chan() ; if check then begin let true_name = Filename.chop_suffix tmp_name ".new" in if Myfiles.changed tmp_name true_name then begin Mysys.rename tmp_name true_name ; Misc.message ("HeVeA Warning: images may have changed, run 'imagen "^ Misc.get_image_opt ()^" "^base^"'"); true end else begin Mysys.remove tmp_name ; false end end else false end else false hevea-2.23/foot.mli0000644004317100512160000000211112312060105014211 0ustar marangetcristal(***********************************************************************) (* *) (* HEVEA *) (* *) (* Luc Maranget, projet PARA, INRIA Rocquencourt *) (* *) (* Copyright 1998 Institut National de Recherche en Informatique et *) (* Automatique. Distributed only by permission. *) (* *) (***********************************************************************) type saved val checkpoint : unit -> saved val hot_start : saved -> unit val step_anchor : int -> unit val get_anchor : int -> int val register : int -> string -> string -> unit val sub_notes : unit -> unit val flush : bool -> (string -> unit) (* lexer *) -> (string -> unit) (* just output *) -> string -> string -> unit val end_notes : unit -> unit hevea-2.23/info/0000755004317100512160000000000012477067047013527 5ustar marangetcristalhevea-2.23/info/book.hva0000644004317100512160000000114112122274007015135 0ustar marangetcristal\ifstyleloaded\relax\else % << slight change from text/ included below % emacs info mode does not fontify level 1 headers if they're not % underlined by a line of *s \@makesection {\section}{0}{section} % {\@forcenewline\@open{head}{*=}} {\@forcenewline\@open{head}{*}} {\thesection}{\quad} {\@forcenewline\@close{head}} % >> end \input{text/book.hva} \setcounter{menudepth}{2} \newcommand{\sectionname}{Section} \newcommand{\subsectionname}{Subsection} \newcommand{\subsubsectionname}{Subsubsection} \renewcommand{\@indexsection}[1]{\chapter{#1}} \renewcommand{\@bibliosection}[1]{\chapter{#1}} \fihevea-2.23/info/hevea.hva0000644004317100512160000000443412122274007015303 0ustar marangetcristal\input{text/hevea.hva} % << slight change from text/ % emacs info mode does not fontify title if it's not flushed left % redefine \maketitle without env align{center} \renewcommand{\maketitle}{% \bgroup \newcommand{\checkcmd}[2] {\@ifundefined{@##1} {\hva@warn{No ##1 given}} {\usebox{\csname @##1\endcsname}##2}}% % \@open{align}{center}% \@open{head}{*}% \usebox{\@title}\\% \@close{head}% \@open{head}{=}%H3 \checkcmd{author}{\par}% \checkcmd{date}{}% \@close{head}% % \@close{align}% \egroup% \global\let\maketitle\relax} %>> \renewcommand{\@locname}[2]{\@infoname{#1}#2} \renewcommand{\@locref}[2] {#2{\@nostyle\@print{\@reference}\{#1\}}} \renewcommand{\@locnameref}[3] {\@infoname{#1}#3{{\@nostyle\@print{\@reference}\{#2\}}}} \let\textdocument=\document \let\endtextdocument=\enddocument \renewenvironment{document} {\textdocument\@infonode{Top}{Racine}} {\newboolean{infofoot}\setboolean{infofoot}{\boolean{footer}}\footerfalse \endtextdocument\setboolean{footer}{\boolean{infofoot}}} %%%%%%%%%%% Footnotes %%%% References only from text to note \renewcommand{\@noteref}[4] {\ifthenelse{\equal{#2}{text}} {\@locref{#1#3}{#4}} {\@locname{#2#3}{#4}}} \renewcommand{\@notepointer}[3]{\@locref{#1#2}{#3}} %%%% Number footnote nodes \newcounter{footnotesflush} \newcommand{\theflush}{Notes \arabic{footnotesflush}} \newsavebox{\footflushed} \renewenvironment{thefootnotes}[1] {\begin{lrbox}{\footflushed} \footnoterule% \begin{list}{}{\renewcommand{\makelabel}[1]{##1}}} {\end{list}\end{lrbox}% \@infoextranode{\theflush}{Notes}{\usebox{\footflushed}}% \stepcounter{footnotesflush}} %%%%%%%%%%%%%%Menus are introduced by redefining \@makesection %% #1 is section name, #2 is section depth number \newcounter{menudepth} \newcounter{lastnode}\setcounter{lastnode}{-1000} \newcommand{\@insertmenu}[3] {\ifthenelse{\value{menudepth} > #2} {\ifthenelse{#2 > \value{lastnode}} {\@infomenu{#1}} {}% \setcounter{lastnode}{#2}% \@infonode[#1] {\csname #1name\endcsname\ \csname the#1\endcsname} {#3}} {}}% \renewcommand{\@makesection}[7]{% \newcommand{#1}[2][!*!] {\@checkdepth{#2}{\refstepcounter{#3}}% \@footnoteflush{#3}% \@insertmenu{#3}{#2}{\begin{@norefs}##2\end{@norefs}}% #4\@checkdepth{#2}{#5#6} ##2#7\@secend}% \newcommand{#1*}[1]{#4##1#7\@secend}} hevea-2.23/info/report.hva0000644004317100512160000000002006714547664015537 0ustar marangetcristal\input{book.hva}hevea-2.23/info/article.hva0000644004317100512160000000114412122274007015631 0ustar marangetcristal\ifstyleloaded\relax\else % << slight change from text/ included below % emacs info mode does not fontify level 1 headers if they're not % underlined by a line of *s \@makesection {\section}{0}{section} % {\@forcenewline\@open{head}{*=}} {\@forcenewline\@open{head}{*}} {\thesection}{\quad} {\@forcenewline\@close{head}} % >> end \input{text/article.hva} \setcounter{menudepth}{2} \newcommand{\sectionname}{Section} \newcommand{\subsectionname}{Subsection} \newcommand{\subsubsectionname}{Subsubsection} \renewcommand{\@indexsection}[1]{\section{#1}} \renewcommand{\@bibliosection}[1]{\section{#1}} \fihevea-2.23/info/seminar.hva0000644004317100512160000000220106736142076015655 0ustar marangetcristal\ifstyleloaded\relax \else %%%% Landscape and portrait \iffrench \newcommand{\slidename}{Planche~:} \else \newcommand{\slidename}{Slide:} \fi \newcounter{slide} \newenvironment{slide}[1][]{% \stepcounter{slide}% \cuthere{section}{\slidename{} \theslide}% \infonode{}{\slidename{} \theslide}% \@printHR{}{100}% \@open{ALIGN}{RIGHT}% \@open{HEAD}{*=}\slidename{} \theslide\@close{HEAD}%H2 \@close{ALIGN} \@printHR{}{100}% }{} \newenvironment{slide*}[1][]{\begin{slide}}{\end{slide}} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% All seminar-specific commandes are null macros %% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \newcommand{\landscapeonly}{} \newcommand{\portraitonly}{} \newcommand{\twoup}{} %% Margins \newif\ifcenterslides \newcommand{\raggedslides}[1][]{} %% Page breaking \newcommand{\extraslideheight}[1]{} \newcommand{\newslide}{} \newcommand{\slidefuzz}{} %% Magnification \newcommand{\slidemag}[1]{} \newcommand{\semin}{in} \newcommand{\semcm}{cm} \newcommand{\ptsize}[1]{} %% FRAMES \newcommand{\slideframe}[2][]{} \newcommand{\newslideframe}[1]{\slideframe} %%%% load the article style file \input{article.hva} \fihevea-2.23/moreverb.hva0000644004317100512160000000076412017660721015110 0ustar marangetcristal\usepackage{verbatim} \@primitives{moreverb} \newcommand{\verbatimtabsize}{8} \newenvironment{boxedverbatim} {\@open{table}{style="border:1px;border-spacing:0" class="cellpadding1"}\@open{tr}{}\@open{td}{style="text-align:left"}\verbatim} {\endverbatim\@close{td}\@close{tr}\@close{table}} \newcommand{\verbatimtabinput}[2][\verbatimtabsize] {\@scaninput{\begin{verbatimtab}[#1] }{#2}{\end{verbatimtab}}} \newcommand{\listinginput}[3][1] {\@scaninput{\begin{listing}[#1]{#2}}{#3}{\end{listing}}} hevea-2.23/myStack.ml0000644004317100512160000000427212017651434014533 0ustar marangetcristal(***********************************************************************) (* *) (* HEVEA *) (* *) (* Luc Maranget, projet Moscova, INRIA Rocquencourt *) (* *) (* Copyright 2001 Institut National de Recherche en Informatique et *) (* Automatique. Distributed only by permission. *) (* *) (* $Id: myStack.ml,v 1.1 2007-02-08 17:48:28 maranget Exp $ *) (***********************************************************************) exception Fatal of string type 'a t = {mutable l : 'a list ; name : string ; bottom : 'a option} let create name = {l = [] ; name=name ; bottom = None} let create_init name x = {l = [] ; name=name ; bottom = Some x} let reset s = s.l <- [] let bottom msg s = match s.bottom with | None -> raise (Fatal (msg^": "^s.name)) | Some x -> x let name {name=name;_} = name and push s x = s.l <- x :: s.l and pop s = match s.l with | [] -> bottom "pop" s | x :: r -> s.l <- r ; x and top s = match s.l with | [] -> bottom "top" s | x :: _ -> x and top2 s = match s.l with | []|[_] -> bottom "top2" s | _ :: x :: _ -> x and length s = List.length s.l and empty s = match s.l with | [] -> true | _ -> false let pretty f stack = prerr_string stack.name ; prerr_string ": <<" ; let rec do_rec = function | [] -> prerr_endline ">>" | [x] -> prerr_string ("'"^f x^"'") ; prerr_endline ">>" | x :: r -> prerr_string "'" ; prerr_string (f x) ; prerr_string "'" ; do_rec r in do_rec stack.l let rev s = s.l <- List.rev s.l let map s f = s.l <- List.map f s.l type 'a saved = 'a list let empty_saved = [] and save {l=l;_} = l and restore s x = s.l <- x let finalize {l=now;_} p f = let rec f_rec = function | [] -> () | nx::n -> if p nx then () else begin f nx ; f_rec n end in f_rec now hevea-2.23/saver.mll0000644004317100512160000000751612312060105014403 0ustar marangetcristal(***********************************************************************) (* *) (* HEVEA *) (* *) (* Luc Maranget, projet PARA, INRIA Rocquencourt *) (* *) (* Copyright 1998 Institut National de Recherche en Informatique et *) (* Automatique. Distributed only by permission. *) (* *) (***********************************************************************) { open Lexing open SaveUtils module type Config = sig type t val of_string : string -> t val of_out : Out.t -> t end module type S = sig type out val opt : Lexing.lexbuf -> out val arg : Lexing.lexbuf -> out val arg2 : Lexing.lexbuf -> out end module Make(C:Config) = struct type out = C.t } let command_name = '\\' (( ['@''A'-'Z' 'a'-'z']+ '*'?) | [^ 'A'-'Z' 'a'-'z'] | "\\*") let space = [' ''\t''\r'] rule opt = parse | space* '\n'? space* '[' {put_echo (lexeme lexbuf) ; opt2 lexbuf} | '%' { skip_comment lexbuf ; opt lexbuf } | eof {raise Eof} | "" {raise NoOpt} and opt2 = parse | '{' {incr brace_nesting; put_both_char '{' ; opt2 lexbuf} | '}' { decr brace_nesting; if !brace_nesting >= 0 then begin put_both_char '}' ; opt2 lexbuf end else begin error "Bad brace nesting in optional argument" end} | ']' {if !brace_nesting > 0 then begin put_both_char ']' ; opt2 lexbuf end else begin put_echo_char ']' ; C.of_out arg_buff end} | '%' { skip_comment lexbuf ; opt2 lexbuf } | command_name as lxm {put_both lxm ; opt2 lexbuf } | _ as lxm {put_both_char lxm ; opt2 lexbuf } and skip_comment = parse | eof {()} | '\n' space* {()} | _ {skip_comment lexbuf} and arg = parse space+ | '\n'+ {put_echo (lexeme lexbuf) ; arg lexbuf} | '{' {incr brace_nesting; put_echo_char '{' ; arg2 lexbuf} | '%' {skip_comment lexbuf ; arg lexbuf} | "\\box" '\\' (['A'-'Z' 'a'-'z']+ '*'? | [^ 'A'-'Z' 'a'-'z']) {let lxm = lexeme lexbuf in put_echo lxm ; C.of_string lxm} | command_name {blit_both lexbuf ; skip_blanks lexbuf} | '#' ['1'-'9'] {let lxm = lexeme lexbuf in put_echo lxm ; C.of_string lxm} | [^ '}'] {let c = lexeme_char lexbuf 0 in put_both_char c ; C.of_out arg_buff} | eof {raise Eof} | "" {error "Argument expected"} and skip_blanks = parse | space* '\n' as lxm {seen_par := false ; put_echo lxm ; more_skip lexbuf} | space* as lxm {put_echo lxm ; C.of_out arg_buff} and more_skip = parse (space* '\n' space*)+ as lxm {seen_par := true ; put_echo lxm ; more_skip lexbuf} | space* as lxm { put_echo lxm ; C.of_out arg_buff} and arg2 = parse '{' {incr brace_nesting; put_both_char '{' ; arg2 lexbuf} | '}' {decr brace_nesting; if !brace_nesting > 0 then begin put_both_char '}' ; arg2 lexbuf end else begin put_echo_char '}' ; C.of_out arg_buff end} | '%' {skip_comment lexbuf ; arg2 lexbuf} | command_name | [^'\\''{''}''%']+ {blit_both lexbuf ; arg2 lexbuf } | _ {let c = lexeme_char lexbuf 0 in put_both_char c ; arg2 lexbuf} | eof {error "End of file in argument"} { end module String = Make (struct type t = string let of_string x = x let of_out = Out.to_string end) module List = Make (struct type t = string list let of_string x = [x] let of_out = Out.to_list end) } hevea-2.23/url.mli0000644004317100512160000000163412017660721014071 0ustar marangetcristal(***********************************************************************) (* *) (* HEVEA *) (* Luc Maranget, projet PARA, INRIA Rocquencourt *) (* *) (* Copyright 2012 Institut National de Recherche en Informatique et *) (* en Automatique. Distributed only by permission. *) (* *) (* *) (***********************************************************************) (* URL encoding and decoding *) val encode_fragment : (char -> unit) -> (string -> unit) -> string -> unit val decode_fragment : (char -> unit) -> (string -> unit) -> string -> unit hevea-2.23/amsmath.hva0000644004317100512160000002553212017660721014721 0ustar marangetcristal\ProvidesPackage{amsmath} \RequirePackage{amsfonts} \let\numberwithin\@addtoreset \let\text\mbox %% Equation tags \renewcommand{\theequation}{\arabic{equation}} \newif\ifams@star \newcommand{\ams@yesnumber} {\@yesnumber\gdef\ams@currentlabel{\theequation}} \newcommand{\ams@nonumber}{\global\let\@number\@empty} \def\tag#1{\gdef\@number{\eqno{\text{(#1)}}}\gdef\ams@currentlabel{\text{#1}}% \ifams@star\else\addtocounter{equation}{-1}\fi}% \def\tag*#1{\gdef\@number{\eqno{\text{#1}}}\gdef\ams@currentlabel{\text{#1}}% \ifams@star\else\addtocounter{equation}{-1}\fi}% \def\notag {\ams@nonumber \ifams@star\else\addtocounter{equation}{-1}\fi}% \let\nonumber\notag% %%%%% AMS equations \newenvironment{ams@equation}[1] {\[\def\@currentlabel{\ams@currentlabel}#1} {\@number\]} \newenvironment{equation*} {\ams@startrue\begin{ams@equation}{\ams@nonumber}} {\end{ams@equation}} \renewenvironment{equation} {\ams@starfalse\begin{ams@equation}{\ams@yesnumber\stepcounter{equation}}} {\end{ams@equation}} %%%%AMS align \newcounter{@align@col} \newcounter{@align@limit} \newenvironment{ams@alignat}[2] {\setcounter{@align@limit}{2*#1-1}% \@ifundefined{@align@inside}{\def\@align@inside{}}{\hva@warn{Nested align}}% \[\@changelabel\def\@currentlabel{\ams@currentlabel}% \setcounter{@align@col}{0}% #2% \def\@extra{\quad\quad}% \let\@PBS=\@HEVEA@bsbs \let\@PAM=\@HEVEA@amper \newcommand{\@eqna@complete} {\whiledo{\value{@align@col}<\value{@align@limit}}{\def\@extra{}&}} \renewcommand{\@hevea@amper} {\ifthenelse{\value{@align@col}<\value{@align@limit}} {\stepcounter{@align@col}% \ifthenelse{\isodd{\value{@align@col}}}{}{\@extra}% \@PAM} {\hva@warn{Extra column in eqnarray}}} \renewcommand{\\}[1][] {\@eqna@complete% End line \@PAM\@number\@PBS% format equation number #2%step equation number \setcounter{@align@col}{0}} \@array{*{#1}{rl}r}} {\\{}\end@array\]} \newenvironment{alignat}[1] {\ams@starfalse\begin{ams@alignat} {#1} {\ams@yesnumber\stepcounter{equation}}} {\end{ams@alignat}\addtocounter{equation}{-1}} \newenvironment{alignat*}[1] {\ams@startrue\begin{ams@alignat}{#1}{\ams@nonumber}} {\end{ams@alignat}} \newenvironment{align}{\begin{alignat}{5}}{\end{alignat}} \newenvironment{align*}{\begin{alignat*}{5}}{\end{alignat*}} %%%%%%%%AMS gather \newenvironment{ams@gather}[1] {\[\@changelabel\def\@currentlabel{\ams@currentlabel}% \@array{@{#1}c@{\@number}}} {\end@array\]} \newenvironment{gather} {\ams@starfalse\begin{ams@gather}{\ams@yesnumber\stepcounter{equation}}} {\end{ams@gather}} \newenvironment{gather*} {\ams@startrue\begin{ams@gather}{\ams@nonumber}} {\end{ams@gather}} %%%%%%%AMS multline \newcounter{ams@line} \newenvironment{ams@multline}[1] {\@changelabel\def\@currentlabel{\ams@currentlabel}% #1% \setcounter{ams@line}{0}% \let\@PBS=\\% \renewcommand{\\}[1][] {\@close{display}% \ifthenelse{\value{ams@line}>0}{\centering}{\raggedright}\)\endgroup\stepcounter{ams@line}\begingroup\(\@open{display}{}}% \begingroup\(\@open{display}{}} {\@close{display}\)\raggedleft\@number\endgroup} \newenvironment{multline} {\ams@starfalse\begin{ams@multline}{\ams@yesnumber\stepcounter{equation}}} {\end{ams@multline}} \newenvironment{multline*} {\ams@startrue\begin{ams@multline}{\ams@nonumber}} {\end{ams@multline}} %AMS split \newenvironment{split}{\begin{array}{rl}}{\end{array}}% \renewenvironment{cases}{\left\{\begin{array}{ll}}{\end{array}\right.}% \newcommand{\intertext}[1]{\qquad\mbox{#1}\\}% %%Matrices \newcounter{MaxMatrixCols}\setcounter{MaxMatrixCols}{10}% \newenvironment{matrix}{\begin{array}{*{\value{MaxMatrixCols}}{c}}}{\end{array}}% \newenvironment{pmatrix}{\left(\begin{array}{*{\value{MaxMatrixCols}}{c}}}{\end{array}\right)}% \newenvironment{bmatrix}{\left[\begin{array}{*{\value{MaxMatrixCols}}{c}}}{\end{array}\right]}% \newenvironment{vmatrix}{\left|\begin{array}{*{\value{MaxMatrixCols}}{c}}}{\end{array}\right|}% \newenvironment{Vmatrix}{\left|\left|\begin{array}{*{\value{MaxMatrixCols}}{c}}}{\end{array}\right|\right|}% \newcounter{@hdots}% \newcommand{\hdotsfor}[2][]{% \setcounter{@hdots}{#2}% \whiledo{\value{@hdots}>1}{\ldots &\addtocounter{@hdots}{-1}}% \ldots}% \newenvironment{smallmatrix}{\begin{matrix}}{\end{matrix}} %%%%%%%%%%%% Some commands by B. Salvy \newcommand{\binom}[2]{\begin{pmatrix}#1\\#2\end{pmatrix}} \newcommand{\boldmath}{\bf} %%%%%%%%%% AMS extra variable size delimiters \newcommand{\lvert}{|} \newcommand{\csname\delim@name{\lvert}\endcsname}[1] {\process@delim@one{#1}{\mid@vert}} \newcommand{\rvert}{|} \newcommand{\csname\delim@name{\rvert}\endcsname}[1] {\process@delim@one{#1}{\mid@vert}} %%% \DeclareSymbolHtml[||]{\lVert}{X2225} \newcommand{\csname\delim@name{\lVert}\endcsname}[1] {\process@delim@one{#1}{\mid@Vert}} \DeclareSymbolHtml[||]{\rVert}{X2225} \newcommand{\csname\delim@name{\rVert}\endcsname}[1] {\process@delim@one{#1}{\mid@Vert}} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Other variants of \frac % % \dfrac makes no estimate of display-style in HEVEA % % \tfrac makes no estimate of text-style in HEVEA % % \cfrac takes an optional argument as well % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \let\dfrac\frac \newcommand{\tfrac}[2]{{#1/#2}} \let\hva@frac\frac \NewcommandHtml{\textfrac}[3][]{\hva@frac{#2}{#3}} \NewcommandHtml{\@frac}[3][] {\@open@display\d@cell{#2}% \@close{tr}\@open{tr}{}% \@open@dcell{}% {\def\@tmp{#1}\ifx\@tmp\@empty\@hbar\else \@hbar[style="height:\@getlength{#1}px;"]\fi}% \@close@dcell% \@close{tr}\@open{tr}{class="bot"}% \d@cell[style="background-color:lime;"]{#3}% \@close@display} \NewcommandHtml{\gfrac}{\DisplayChoose\@frac\textfrac} %%%\cfrac -> vertical alignement on top in denominator \NewcommandHtml{\@@cfrac}[3][] {\@open@display% \d@cell[#1]{#2}% \@close{tr}\@open{tr}{}% \d@cell{\@hbar}\@addvsize{-1}% \@close{tr}\@open{tr}{}% \@open@dcell{}\@open{display}{style="vertical-align:top"}#3\@close{display}\@close@dcell% \@close@display} \NewcommandHtml{\@lcfrac}[2]{\@@cfrac[style="text-align:left;"]{#1}{#2}} \NewcommandHtml{\@rcfrac}[2]{\@@cfrac[style="text-align:right;"]{#1}{#2}} \newcommand{\@cfrac}[3][c] {\ifthenelse{\equal{#1}{c}}{\@@cfrac{#2}{#3}} {\ifthenelse{\equal{#1}{l}}{\@lcfrac{#2}{#3}} {\ifthenelse{\equal{#1}{r}}{\@rcfrac{#2}{#3}} {\hva@warn{Invalid Argument To \cfrac: '#1', ignored}{\@@cfrac{#2}{#3}}}}}} \NewcommandHtml{\textcfrac}[3]{\frac{#2}{#3}} \NewcommandHtml{\cfrac}{\DisplayChoose\@cfrac\textcfrac} \NewcommandHtml{\lcfrac}{\DisplayChoose\@lcfrac\frac} \NewcommandHtml{\rcfrac}{\DisplayChoose\@rcfrac\frac} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \newcommand{\eqref}[1]{(\ref{#1})} %\newcommand{\mathbb}[1]{{\bf #1}} %\newcommand{\mathfrak}[1]{{\green #1}} \newcommand{\mathnormal}[1]{#1} \newcommand{\mod}{\text{mod}} \newcommand{\operatorname}[1]{\text{#1}} \newcommand{\smallint}{\int} \newenvironment{proof}{\par\noindent{\bf Proof.}}{\par\medskip} %%%%%%%%%%%%%%%%% % \boxed command% %%%%%%%%%%%%%%%%% \NewcommandHtml{\boxed}{\DisplayChoose\@@boxed\@boxed} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Table 48: AMS Variable-sized Math Operators % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \newcommand{\MakeInt}[2]{\MakeBigSymbolHtml[\intlimits]{#1}{#2}} \DeclareSymbolHtml{\@iint}{X222C}\MakeInt{\iint}{\@iint} \DeclareSymbolHtml{\@iiint}{X222D}\MakeInt{\iiint}{\@iiint} \DeclareSymbolHtml{\@iiiint}{X2A0C}\MakeInt{\iiiint}{\@iiiint} \NewcommandHtml{\idotsint}{\int\cdots\int} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Table 97: AMS Log-Like symbols % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \@defl\injlim{inj lim} \@defl\projlim{proj lim} \@defl\varliminf{\underline{lim}} \@defl\varlimsup{\overline{lim}} %%%%%%%%%%%%%%%%%%%%%% % Table 39: AMS Dots % %%%%%%%%%%%%%%%%%%%%%% \@Let\dotsb\cdots \@Let\dotsi\cdots \@Let\dotso\ldots \@Let\dotsc\ldots \@Let\dotsm\cdots %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Table 129: AMS Extensible Accents % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \NewcommandHtml{\textoverleftrightarrow}[1] {\hva@warn{\overleftrightarrow outside display mode}#1} \NewcommandHtml{\@overleftrightarrow}[1] {\mathop{\@over@arrow[3] {\d@cell[style="width:1\%;"]{\hva@lefthead}% \d@cell[style="width:98\%;"]{\@hbar}% \d@cell[style="width:1\%;"]{\hva@righthead}} {#1}}\intlimits} \NewcommandHtml{\overleftrightarrow} {\DisplayChoose\@overleftrightarrow\textoverleftrightarrow} %%%%%%%%%%%%%%%%%%%%%%% \NewcommandHtml{\textunderleftrightarrow}[1] {\hva@warn{\underleftrightarrow outside display mode}#1} \NewcommandHtml{\@underleftrightarrow}[1] {\mathop{\@under@arrow[3] {\d@cell[style="width:1\%;"]{\hva@lefthead}% \d@cell[style="width:98\%;"]{\@hbar}% \d@cell[style="width:1\%;"]{\hva@righthead}}{#1}}\intlimits} \NewcommandHtml{\underleftrightarrow} {\DisplayChoose\@underleftrightarrow\textunderleftrightarrow} %%%%%%%%%%%%%%%%%%%%%%% \NewcommandHtml{\textunderrightarrow}[1] {\hva@warn{\underrightarrow outside display mode}#1} \NewcommandHtml{\@underrightarrow}[1] {\mathop{\@under@arrow[2] {\d@cell[style="width:99\%;"]{\@hbar}% \d@cell[style="width:1\%;"]{\hva@righthead}}{#1}}\intlimits} \NewcommandHtml{\underrightarrow} {\DisplayChoose\@underrightarrow\textunderrightarrow} %%%%%%%%%%%%%%%%%%%%%%% \NewcommandHtml{\textunderleftarrow}[1] {\hva@warn{\underleftarrow outside display mode}#1} \NewcommandHtml{\@underleftarrow}[1] {\mathop{\@under@arrow[2] {\d@cell[style="width:1\%;"]{\hva@lefthead}% \d@cell[style="width:100\%;"]{\@hbar}}{#1}}\intlimits} \NewcommandHtml{\underleftarrow} {\DisplayChoose\@underleftarrow\textunderleftarrow} %%%%%%%%%%%%%% New generic function for accents both below and above \NewcommandHtml{\@both@arrow}[4][2] {\@open@sizer\@open@display% \d@cell[colspan="#1" style="font-size:smaller;"]{#2}% \@close{tr}\@open{tr}{}% #3% \@close{tr}\@open{tr}{}% \d@cell[colspan="#1" style="font-size:smaller;"]{#4}% \@close@display\@close@sizer} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \NewcommandHtml{\textxleftarrow}[2][] {\hva@warn{\xleftarrow outside display mode}\leftarrow^{#2}_{#1}} \NewcommandHtml{\@xleftarrow}[2][~] {\mathop {\@both@arrow[2]{\quad{}#2\quad} {\d@cell[style="width:1\%;"]{\hva@lefthead}% \d@cell[style="width:99\%;"]{\@hbar}} {\quad{}#1\quad}% }\intlimits} \NewcommandHtml{\xleftarrow}{\DisplayChoose\@xleftarrow\textxleftarrow} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \NewcommandHtml{\textxrightarrow}[2][] {\hva@warn{\xrightarrow outside display mode}\rightarrow^{#2}_{#1}} \NewcommandHtml{\@xrightarrow}[2][~] {\mathop {\@both@arrow[2]{\quad{}#2\quad} {\d@cell[style="width:99\%;"]{\@hbar}% \d@cell[style="width:1\%;"]{\hva@righthead}} {\quad{}#1\quad}}\intlimits} \NewcommandHtml{\xrightarrow}{\DisplayChoose\@xrightarrow\textxrightarrow} %%% subarray/substack \NewcommandHtml{\@smaller}{\@span{style="font-size:smaller;"}} \NewcommandText{\@smaller}{} \NewcommandText{\@dclass}{} \newenvironment{subarray}[1]{\@smaller\begin{Array}[\@dclass]{#1}}{\end{Array}} \newcommand{\substack}[1]{\begin{subarray}{c}#1\end{subarray}} hevea-2.23/booktabs.hva0000644004317100512160000000131510757523076015076 0ustar marangetcristal\ProvidesPackage{booktabs} %Rather awfull way to read the (...) argument arg of \cmidrule %A better solution would be for \cmidrule to follow %usual LaTeX conventions. \def\@bt@op{(} \def\@bt@cp{)} \let\@bt@cmi\@gobble \def\@eatcp#1{% \def\@arg{#1}% \ifx\@arg\@bt@cp\let\@step\@bt@cmi\else\let\@step\@eatcp\fi% \@step} %%No-ops for all commands, perhaps style-sheets permit %%acurate rendering? \newcommand{\@btabs@void}[1][]{} \let\toprule\@btabs@void \let\midrule\@btabs@void \let\bottomrule\@btabs@void \newcommand{\@cmidrule}[1] {\def\@arg{#1}\ifx\@arg\@bt@op\@eatcp\else\@bt@cmi{#1}\fi} \newcommand{\cmidrule}[1][]{\@cmidrule} \let\morecmidrules\relax \newcommand{\specialrule}[3]{} \let\addlinespace\@btabs@voidhevea-2.23/simpleRope.ml0000644004317100512160000001470612403604646015244 0ustar marangetcristal(***********************************************************************) (* *) (* HEVEA *) (* *) (* Tibault Suzanne, Luc Maranget, projet Moscova, INRIA Rocquencourt *) (* *) (* Copyright 2012 Institut National de Recherche en Informatique et *) (* Automatique. Distributed only by permission. *) (* *) (***********************************************************************) open Printf exception Out_of_bounds module type Config = sig val small_length : int end module Make(C:Config) = struct open C (**********) (* Basics *) (**********) type t = | Str of string | App of t * t * int (* String length *) let length = function | Str s -> String.length s | App (_,_,len) -> len let of_string s = Str s let singleton c = of_string (String.make 1 c) let empty = of_string "" (**********) (* Append *) (**********) let app r1 r2 = match r1,r2 with | Str "",t | t,Str "" -> t | Str s1, Str s2 when String.length s1 < small_length && String.length s2 < small_length -> Str (s1^s2) | App (t1,Str s1,len), Str s2 when String.length s1 < small_length && String.length s2 < small_length -> App (t1,Str (s1^s2),len+String.length s2) | Str s1,App (Str s2,t2,len) when String.length s1 < small_length && String.length s2 < small_length -> App (Str (s1^s2),t2,len+String.length s1) | _,_ -> App (r1,r2,length r1+length r2) let append r1 r2 = app r1 r2 let rec app_string r s slen = match r with | Str rs -> if String.length rs < small_length then Str (rs ^ s) else raise Exit | App (r1,r2,len) -> let r2 = app_string r2 s slen in App (r1,r2,len+slen) let append_string r s = let slen = String.length s in if slen < small_length then try app_string r s slen with Exit -> App (r,Str s,length r+slen) else App (r,Str s,length r+slen) let sc2c s len c = let b = Bytes.create (len+1) in Bytes.blit_string s 0 b 0 len ; Bytes.set b len c ; Bytes.unsafe_to_string b let rec app_char r c = match r with | Str s -> let len = String.length s in if len < small_length then begin Str (sc2c s len c) end else raise Exit | App (r1,r2,len) -> let r2 = app_char r2 c in App (r1,r2,len+1) let append_char r c = try app_char r c with Exit -> App (r,Str (String.make 1 c),length r+1) (*************) (* Substring *) (*************) (* assumption: 0 <= start < stop <= len(t) *) let rec mksub start stop t = if start = 0 && stop = length t then t else match t with | Str s -> Str (String.sub s start (stop-start)) | App (t1, t2, _) -> let n1 = length t1 in if stop <= n1 then mksub start stop t1 else if start >= n1 then mksub (start-n1) (stop-n1) t2 else app (mksub start n1 t1) (mksub 0 (stop-n1) t2) let sub t ofs len = let stop = ofs + len in if ofs < 0 || len < 0 || stop > length t then raise Out_of_bounds; if len = 0 then empty else mksub ofs stop t (***********************) (* Get a char by index *) (***********************) let rec get_rec t i = match t with | Str s -> String.unsafe_get s i | App (t1, t2, _) -> let n1 = length t1 in if i < n1 then get_rec t1 i else get_rec t2 (i - n1) let get t i = if i < 0 || i >= length t then raise Out_of_bounds; get_rec t i (***********) (* Iterate *) (***********) let iter_string f s = for k=0 to String.length s-1 do f (String.unsafe_get s k) done let rec iter_rec f = function | Str s -> iter_string f s | App (t1,t2,_) -> iter_rec f t1 ; iter_rec f t2 let iter f t = iter_rec f t (**********) (* Output *) (**********) let rec output chan = function | Str s -> output_string chan s | App (t1,t2,_) -> output chan t1 ; output chan t2 let rec debug_rec indent chan = function | Str s -> fprintf chan "%s\"%a\"\n" indent output_string s | App (t1,t2,_) -> let indent2 = indent ^ " " in fprintf chan "%s[\n" indent ; debug_rec indent2 chan t1 ; debug_rec indent2 chan t2 ; fprintf chan "%s]\n" indent ; () let debug = debug_rec "" (*************) (* To string *) (*************) let rec blit t buff pos = match t with | Str s -> Bytes.blit_string s 0 buff pos (String.length s) | App (t1,t2,_) -> blit t1 buff pos ; blit t2 buff (pos+length t1) let to_string t = match t with | Str s -> s | App (_,_,len) -> let buff = Bytes.create len in blit t buff 0 ; Bytes.unsafe_to_string buff (***********************) (* To list (of string) *) (***********************) let rec do_to_list k = function | Str s -> if String.length s > 0 then (s::k) else k | App (t1,t2,_) -> let k = do_to_list k t2 in do_to_list k t1 let to_list t = do_to_list [] t let to_list_append t k = do_to_list k t (*******************) (* Index functions *) (*******************) let rec index_from r i c = match r with | Str s -> String.index_from s i c | App (t1,t2,_) -> let n1 = length t1 in if i < n1 then try index_from t1 i c with Not_found -> index_from t2 0 c + n1 else index_from t2 (i-n1) c let index r c = try index_from r 0 c with e -> eprintf "SimpleRope.index failed c='%c'\n" c ; debug stderr r ; raise e let rec rindex_from r i c = match r with | Str s -> String.rindex_from s i c | App (t1,t2,_) -> let n1 = length t1 in if i < n1 then rindex_from t1 i c else try rindex_from t2 (i-n1) c + n1 with Not_found -> rindex_from t1 (n1-1) c let rindex r c = rindex_from r (length r-1) c (* Erase end according to predicate *) let erase t pred = let rec do_rec t = match t with | Str s -> let len = String.length s in let rec find_no k = if k <= 0 then k else let c = String.unsafe_get s (k-1) in if pred c then find_no (k-1) else k in let k_lst = find_no len in if k_lst = len then t else Str (String.sub s 0 len) | App (t1,t2,_) -> let t2 = do_rec t2 in if t2 = empty then do_rec t1 else append t1 t2 in do_rec t end hevea-2.23/lstlang2.sty0000644004317100512160000023515611524022160015052 0ustar marangetcristal%% %% This is file `lstlang2.sty', %% generated with the docstrip utility. %% %% The original source files were: %% %% lstdrvrs.dtx (with options: `lang2') %% %% The listings package is copyright 1996--2004 Carsten Heinz, and %% continued maintenance on the package is copyright 2006--2007 Brooks Moses. %% The drivers are copyright 1997/1998/1999/2000/2001/2002/2003/2004/2006/ %% 2007 any individual author listed in this file. %% %% This file is distributed under the terms of the LaTeX Project Public %% License from CTAN archives in directory macros/latex/base/lppl.txt. %% Either version 1.3 or, at your option, any later version. %% %% This file is completely free and comes without any warranty. %% %% Send comments and ideas on the package, error reports and additional %% programming languages to Brooks Moses at . %% \ProvidesFile{lstlang2.sty} [2004/09/05 1.3 listings language file] %% %% Abap definition by Knut Lickert %% \lst@definelanguage[R/3 6.10]{ABAP}[R/3 4.6C]{ABAP}% {morekeywords={try,endtry},% }[keywords,comments,strings] \lst@definelanguage[R/3 4.6C]{ABAP}[R/3 3.1]{ABAP}% {morekeywords={method,ref,class,create,object,% methods,endmethod,private,protected,public,section,% catch,system-exceptions,endcatch,% },% moreprocnamekeys={class},% literate={->}{{$\rightarrow$}}1{=>}{{$\Rightarrow$}}1,% }[keywords,comments,strings,procnames] \lst@definelanguage[R/3 3.1]{ABAP}[R/2 5.0]{ABAP}{}% \lst@definelanguage[R/2 5.0]{ABAP}% {sensitive=f,% procnamekeys={report,program,form,function,module},% morekeywords={*,add,after,alias,analyzer,and,append,appending,area,assign,at,% authority-check,before,binary,blank,break-point,calendar,call,% case,change,changing,check,clear,cnt,co,collect,commit,common,% component,compute,condense,corresponding,cos,cp,cs,currency-conversion,% cursor,data,database,dataset,decimals,define,delete,deleting,dequeue,% describe,detail,dialog,directory,div,divide,do,documentation,% during,dynpro,else,end-of-page,end-of-selection,endat,endcase,% enddo,endfor,endform,endif,endloop,endmodule,endselect,% endwhile,enqueue,exceptions,exit,exp,export,exporting,extract,% field,fields,field-groups,field-symbols,find,for,form,format,free,% from,function,generating,get,giving,hide,id,if,import,% importing,in,incl,include,initial,initialization,input,insert,% interrupt,into,is,language,leave,leading,left-justified,like,line,lines,line-count, line-selection,list-processing,load,local,log,logfile,loop,% margin,mark,mask,memory,menue,message,mod,modify,module,move,% move-text,multiply,na,new,new-line,new-page,no-gaps,np,ns,% number,obligatory,occurs,of,on,or,others,output,parameter,% parameters,parts,perform,pf-status,places,position,process,% raise,raising,ranges,read,refresh,refresh-dynpro,reject,remote,% replace,report,reserve,reset,restart,right-justified,run,screen,scroll,search,% segments,select,select-options,selection-screen,set,shift,sin,% single,sqrt,start-of-selection,statement,structure,submit,% subtract,summary,summing,suppress,system,table,tables,task,% text,time,to,top-of-page,trace,transaction,transfer,% transfer-dynpro,translate,type,unpack,update,user-command,% using,value,when,where,while,window,with,workfile,write,},% morecomment=[l]",% morecomment=[f][commentstyle][0]*,% morestring=[d]'% }[keywords,comments,strings,procnames] \lst@definelanguage[R/2 4.3]{ABAP}[R/2 5.0]{ABAP}% {deletekeywords={function,importing,exporting,changing,exceptions,% raise,raising}% }[keywords,comments,strings] %% %% Corba IDL definition (c) 1999 Jens T. Berger Thielemann %% \lst@definelanguage[CORBA]{IDL}% {morekeywords={any,attribute,boolean,case,char,const,context,default,% double,enum,exception,fixed,float,in,inout,interface,long,module,% native,Object,octet,oneway,out,raises,readonly,sequence,short,% string,struct,switch,typedef,union,unsigned,void,wchar,wstring,% FALSE,TRUE},% sensitive,% moredirectives={define,elif,else,endif,error,if,ifdef,ifndef,line,% include,pragma,undef,warning},% moredelim=*[directive]\#,% morecomment=[l]//,% morecomment=[s]{/*}{*/},% morestring=[b]"% }[keywords,comments,strings,directives]% %% %% (Objective) Caml definition (c) 1999 Patrick Cousot %% %% Objective CAML and Caml light are freely available, together with a %% reference manual, at URL ftp.inria.fr/lang/caml-light for the Unix, %% Windows and Macintosh OS operating systems. %% \lst@definelanguage[Objective]{Caml}[light]{Caml} {deletekeywords={not,prefix,value,where},% morekeywords={assert,asr,class,closed,constraint,external,false,% functor,include,inherit,land,lazy,lor,lsl,lsr,lxor,method,mod,% module,new,open,parser,private,sig,struct,true,val,virtual,when,% object,ref},% TH }% \lst@definelanguage[light]{Caml} {morekeywords={and,as,begin,do,done,downto,else,end,exception,for,% fun,function,if,in,let,match,mutable,not,of,or,prefix,rec,then,% to,try,type,value,where,while,with},% sensitive,% morecomment=[n]{(*}{*)},% morestring=[b]",% moredelim=*[directive]\#,% moredirectives={open,close,include}% }[keywords,comments,strings,directives]% \lst@definelanguage[ibm]{Cobol}[1985]{Cobol}% {morekeywords={ADDRESS,BEGINNING,COMP-3,COMP-4,COMPUTATIONAL,% COMPUTATIONAL-3,COMPUTATIONAL-4,DISPLAY-1,EGCS,EJECT,ENDING,% ENTRY,GOBACK,ID,MORE-LABELS,NULL,NULLS,PASSWORD,RECORDING,% RETURN-CODE,SERVICE,SKIP1,SKIP2,SKIP3,SORT-CONTROL,SORT-RETURN,% SUPPRESS,TITLE,WHEN-COMPILED},% }% \lst@definelanguage[1985]{Cobol}[1974]{Cobol}% {morekeywords={ALPHABET,ALPHABETIC-LOWER,ALPHABETIC-UPPER,% ALPHANUMERIC,ALPHANUMERIC-EDITED,ANY,CLASS,COMMON,CONTENT,% CONTINUE,DAY-OF-WEEK,END-ADD,END-CALL,END-COMPUTE,END-DELETE,% END-DIVIDE,END-EVALUATE,END-IF,END-MULTIPLY,END-PERFORM,END-READ,% END-RECEIVE,END-RETURN,END-REWRITE,END-SEARCH,END-START,% END-STRING,END-SUBTRACT,END-UNSTRING,END-WRITE,EVALUATE,EXTERNAL,% FALSE,GLOBAL,INITIALIZE,NUMERIC-EDITED,ORDER,OTHER,% PACKED-DECIMAL,PADDING,PURGE,REFERENCE,RELOAD,REPLACE,STANDARD-1,% STANDARD-2,TEST,THEN,TRUE},% }% \lst@definelanguage[1974]{Cobol}% {morekeywords={ACCEPT,ACCESS,ADD,ADVANCING,AFTER,ALL,ALPHABETIC,ALSO,% ALTER,ALTERNATE,AND,ARE,AREA,AREAS,ASCENDING,ASSIGN,AT,AUTHOR,% BEFORE,BINARY,BLANK,BLOCK,BOTTOM,BY,CALL,CANCEL,CD,CF,CH,% CHARACTER,CHARACTERS,CLOCK-UNITS,CLOSE,COBOL,CODE,CODE-SET,% COLLATING,COLUMN,COMMA,COMMUNICATION,COMP,COMPUTE,CONFIGURATION,% CONTAINS,CONTROL,CONTROLS,CONVERTING,COPY,CORR,CORRESPONDING,% COUNT,CURRENCY,DATA,DATE,DATE-COMPILED,DATE-WRITTEN,DAY,DE,% DEBUG-CONTENTS,DEGUB-ITEM,DEBUG-LINE,DEBUG-NAME,DEBUG-SUB1,% DEBUG-SUB2,DEBUG-SUB3,DEBUGGING,DECIMAL-POINT,DECLARATIVES,% DELETE,DELIMITED,DELIMITER,DEPENDING,DESCENDING,DESTINATION,% DETAIL,DISABLE,DISPLAY,DIVIDE,DIVISION,DOWN,DUPLICATES,DYNAMIC,% EGI,ELSE,EMI,ENABLE,END,END-OF-PAGE,ENTER,ENVIRONMENT,EOP,EQUAL,% ERROR,ESI,EVERY,EXCEPTION,EXIT,EXTEND,FD,FILE,FILE-CONTROL,% FILLER,FINAL,FIRST,FOOTING,FOR,FROM,GENERATE,GIVING,GO,GREATER,% GROUP,HEADING,HIGH-VALUE,HIGH-VALUES,I-O,I-O-CONTROL,% IDENTIFICATION,IF,IN,INDEX,INDEXED,INDICATE,INITIAL,INITIATE,% INPUT,INPUT-OUTPUT,INSPECT,INSTALLATION,INTO,INVALID,IS,JUST,% JUSTIFIED,KEY,LABEL,LAST,LEADING,LEFT,LENGTH,LESS,LIMIT,LIMITS,% LINAGE,LINAGE-COUNTER,LINE,LINE-COUNTER,LINES,LINKAGE,LOCK,% LOW-VALUE,LOW-VALUES,MEMORY,MERGE,MESSAGE,MODE,MODULES,MOVE,% MULTIPLE,MULTIPLY,NATIVE,NEGATIVE,NEXT,NO,NOT,NUMBER,NUMERIC,% OBJECT-COMPUTER,OCCURS,OF,OFF,OMITTED,ON,OPEN,OPTIONAL,OR,% ORGANIZATION,OUTPUT,OVERFLOW,PAGE,PAGE-COUNTER,PERFORM,PF,PH,PIC,% PICTURE,PLUS,POINTER,POSITION,PRINTING,POSITIVE,PRINTING,% PROCEDURE,PROCEDURES,PROCEED,PROGRAM,PROGRAM-ID,QUEUE,QUOTE,% QUOTES,RANDOM,RD,READ,RECEIVE,RECORD,RECORDING,RECORDS,REDEFINES,% REEL,REFERENCES,RELATIVE,RELEASE,REMAINDER,REMOVAL,RENAMES,% REPLACING,REPORT,REPORTING,REPORTS,RERUN,RESERVE,RESET,RETURN,% REVERSED,REWIND,REWRITE,RF,RH,RIGHT,ROUNDED,RUN,SAME,SD,SEARCH,% SECTION,SECURITY,SEGMENT,SEGMENT-LIMIT,SELECT,SEND,SENTENCE,% SEPARATE,SEQUENCE,SEQUENTIAL,SET,SIGN,SIZE,SORT,SORT-MERGE,% SOURCE,SOURCE-COMPUTER,SPACE,SPACES,SPECIAL-NAMES,STANDARD,START,% STATUS,STOP,STRING,SUB-QUEUE-1,SUB-QUEUE-2,SUB-QUEUE-3,SUBTRACT,% SUM,SYMBOLIC,SYNC,SYNCHRONIZED,TABLE,TALLYING,TAPE,TERMINAL,% TERMINATE,TEXT,THAN,THROUGH,THRU,TIME,TIMES,TO,TOP,TRAILING,TYPE,% UNIT,UNSTRING,UNTIL,UP,UPON,USAGE,USE,USING,VALUE,VALUES,VARYING,% WHEN,WITH,WORDS,WORKING-STORAGE,WRITE,ZERO,ZEROES,ZEROS},% alsodigit=-,% sensitive=f,% ??? morecomment=[f][commentstyle][6]*,% morestring=[d]"% ??? doubled }[keywords,comments,strings]% \lst@definelanguage{Delphi}% {morekeywords={and,as,asm,array,begin,case,class,const,constructor,% destructor,div,do,downto,else,end,except,exports,file,finally,% for,function,goto,if,implementation,in,inherited,inline,% initialization,interface,is,label,library,mod,nil,not,object,of,% or,packed,procedure,program,property,raise,record,repeat,set,% shl,shr,string,then,to,try,type,unit,until,uses,var,while,with,% xor,% absolute,abstract,assembler,at,cdecl,default,dynamic,export,% external,far,forward,index,name,near,nodefault,on,override,% private,protected,public,published,read,resident,storedDir,% virtual,write},% morendkeywords={Abs,AddExitProc,Addr,AllocMem,AnsiCompareStr,% AnsiCompareText,AnsiLowerCase,AnsiUpperCase,Append,AppendStr,% ArcTan,AssignCrt,Assigned,AssignFile,BlockRead,BlockWrite,Break,% ChangeFileExt,ChDir,Chr,CloseFile,ClrEol,ClrScr,Concat,Continue,% Copy,Cos,CSeg,CursorTo,Date,DateTimeToFileDate,DateTimeToStr,% DateTimeToString,DateToStr,DayOfWeek,Dec,DecodeDate,DecodeTime,% Delete,DeleteFile,DiskFree,DiskSize,Dispose,DisposeStr,% DoneWinCrt,DSeg,EncodeDate,EncodeTime,Eof,Eoln,Erase,Exclude,% Exit,Exp,ExpandFileName,ExtractFileExt,ExtractFileName,% ExtractFilePath,FileAge,FileClose,FileDateToDateTime,FileExists,% FileGetAttr,FileGetDate,FileOpen,FilePos,FileRead,FileSearch,% FileSeek,FileSetAttr,FileSetDate,FileSize,FillChar,FindClose,% FindFirst,FindNext,FloatToDecimal,FloatToStrF,FloatToStr,% FloatToText,FloatToTextFmt,Flush,FmtLoadStr,FmtStr,Format,% FormatBuf,FormatDateTime,FormatFloat,Frac,Free,FreeMem,GetDir,% GetMem,GotoXY,Halt,Hi,High,Inc,Include,InitWinCrt,Insert,Int,% IntToHex,IntToStr,IOResult,IsValidIdent,KeyPressed,Length,Ln,Lo,% LoadStr,Low,LowerCase,MaxAvail,MemAvail,MkDir,Move,New,NewStr,% Now,Odd,Ofs,Ord,ParamCount,ParamStr,Pi,Pos,Pred,Ptr,Random,% Randomize,Read,ReadBuf,ReadKey,Readln,ReAllocMem,Rename,% RenameFile,Reset,Rewrite,RmDir,Round,RunError,ScrollTo,Seek,% SeekEof,SeekEoln,Seg,SetTextBuf,Sin,SizeOf,SPtr,Sqr,Sqrt,SSeg,% Str,StrCat,StrComp,StrCopy,StrDispose,StrECopy,StrEnd,StrFmt,% StrLCat,StrIComp,StrLComp,StrLCopy,StrLen,StrLFmt,StrLIComp,% StrLower,StrMove,StrNew,StrPas,StrPCopy,StrPos,StrScan,StrRScan,% StrToDate,StrToDateTime,StrToFloat,StrToInt,StrToIntDef,% StrToTime,StrUpper,Succ,Swap,TextToFloat,Time,TimeToStr,% TrackCursor,Trunc,Truncate,TypeOf,UpCase,UpperCase,Val,WhereX,% WhereY,Write,WriteBuf,WriteChar,Writeln},% sensitive=f,% morecomment=[s]{(*}{*)},% morecomment=[s]{\{}{\}},% morecomment=[l]{//},% 2001 Christian Gudrian morestring=[d]'% }[keywords,comments,strings]% \lst@definelanguage{Eiffel}% {morekeywords={alias,all,and,as,BIT,BOOLEAN,CHARACTER,check,class,% creation,Current,debug,deferred,do,DOUBLE,else,elseif,end,% ensure,expanded,export,external,false,feature,from,frozen,if,% implies,indexing,infix,inherit,inspect,INTEGER,invariant,is,% like,local,loop,NONE,not,obsolete,old,once,or,POINTER,prefix,% REAL,redefine,rename,require,rescue,Result,retry,select,% separate,STRING,strip,then,true,undefine,unique,until,variant,% when,xor},% sensitive,% morecomment=[l]--,% morestring=[d]",% }[keywords,comments,strings]% %% %% Euphoria definition (c) 1998 Detlef Reimers %% \lst@definelanguage{Euphoria}% {morekeywords={abort,and,and_bits,append,arctan,atom,by,call,% call_proc,call_func,c_proc,c_func,clear_screen,close,% command_line,compare,constant,cos,do,date,else,elsif,end,exit,% find,floor,for,function,getc,getenv,get_key,gets,global,% get_pixel,if,include,integer,length,log,match,machine_func,% machine_proc,mem_copy,mem_set,not,not_bits,or,object,open,% or_bits,procedure,puts,position,prepend,print,printf,power,peek,% poke,pixel,poke4,peek4s,peek4u,return,rand,repeat,remainder,% routine_id,sequence,sqrt,sin,system,sprintf,then,type,to,time,% trace,tan,while,with,without,xor,xor_bits},% sensitive,% morecomment=[l]--,% morestring=[d]',% morestring=[d]"% }[keywords,comments,strings]% %% %% Guarded Command Language (GCL) definition %% (c) 2002 Mark van Eijk %% \lst@definelanguage{GCL}% {morekeywords={const,con,var,array,of,skip,if,fi,do,od,div,mod},% literate={|[}{\ensuremath{|\hskip -0.1em[}}2% {]|}{\ensuremath{]\hskip -0.1em|}}2% {[]}{\ensuremath{[\hskip -0.1em]}}2% {->}{\ensuremath{\rightarrow}~}2% {==}{\ensuremath{\equiv}~}2% {>=}{\ensuremath{\geq}~}2% {<=}{\ensuremath{\leq}~}2% {/\\}{\ensuremath{\land}~}2% {\\/}{\ensuremath{\lor}~}2% {!}{\ensuremath{\lnot}}1% {!=}{\ensuremath{\neq}~}2% {max}{\ensuremath{\uparrow}}1% {min}{\ensuremath{\downarrow}}1,% sensitive=f,% morecomment=[s]{\{}{\}},% morestring=[d]'% }[keywords,comments,strings]% %% %% gnuplot definition (c) Christoph Giess %% \lst@definelanguage{Gnuplot}% {keywords={abs,acos,acosh,arg,asin,asinh,atan,atan2,atanh,besj0,% besj1,besy0,besy1,ceil,cos,cosh,erf,erfc,exp,floor,gamma,ibeta,% inverf,igamma,imag,invnorm,int,lgamma,log,log10,norm,rand,real,% sgn,sin,sinh,sqrt,tan,tanh,column,tm_hour,tm_mday,tm_min,tm_mon,% tm_sec,tm_wday,tm_yday,tm_year,valid,cd,call,clear,exit,fit,% help,if,load,pause,plot,print,pwd,quit,replot,reread,reset,save,% set,show,shell,splot,test,update,angles,arrow,autoscale,border,% boxwidth,clabel,clip,cntrparam,contour,data,dgrid3d,dummy,% format,function,functions,grid,hidden3d,isosamples,key,keytitle,% label,logscale,mapping,offsets,output,parametric,pointsize,% polar,rrange,samples,size,style,surface,terminal,tics,time,% timefmt,title,trange,urange,variables,view,vrange,xdata,xlabel,% xmargin,xrange,xtics,mxtics,mytics,xdtics,xmtics,xzeroaxis,% ydata,ylabel,yrange,ytics,ydtics,ymtics,yzeroaxis,zdata,zero,% zeroaxis,zlabel,zrange,ztics,zdtics,zmtics,timefm,using,title,% with,index,every,thru,smooth},% sensitive,% comment=[l]\#,% morestring=[b]",% morestring=[b]',% }[keywords,comments,strings]% %% %% Haskell98 as implemented in Hugs98. See http://www.haskell.org %% All keywords from Prelude and Standard Libraries %% (c) 1999 Peter Bartke %% \lst@definelanguage{Haskell}% {otherkeywords={=>},% morekeywords={abstype,if,then,else,case,class,data,default,deriving,% hiding,if,in,infix,infixl,infixr,import,instance,let,module,% newtype,of,qualified,type,where,do,AbsoluteSeek,AppendMode,% Array,BlockBuffering,Bool,BufferMode,Char,Complex,Double,Either,% FilePath,Float,Int,Integer,IO,IOError,Ix,LineBuffering,Maybe,% Ordering,NoBuffering,ReadMode,ReadWriteMode,ReadS,RelativeSeek,% SeekFromEnd,SeekMode,ShowS,StdGen,String,Void,Bounded,Enum,Eq,% Eval,ExitCode,exitFailure,exitSuccess,Floating,Fractional,% Functor,Handle,HandlePosn,IOMode,Integral,List,Monad,MonadPlus,% MonadZero,Num,Numeric,Ord,Random,RandomGen,Ratio,Rational,Read,% Real,RealFloat,RealFrac,Show,System,Prelude,EQ,False,GT,Just,% Left,LT,Nothing,Right,WriteMode,True,abs,accum,accumArray,% accumulate,acos,acosh,all,and,any,ap,appendFile,applyM,% approxRational,array,asTypeOf,asin,asinh,assocs,atan,atan2,atanh,% bounds,bracket,bracket_,break,catch,catMaybes,ceiling,chr,cis,% compare,concat,concatMap,conjugate,const,cos,cosh,curry,cycle,% decodeFloat,delete,deleteBy,deleteFirstsBy,denominator,% digitToInt,div,divMod,drop,dropWhile,either,elem,elems,elemIndex,% elemIndices,encodeFloat,enumFrom,enumFromThen,enumFromThenTo,% enumFromTo,error,even,exitFailure,exitWith,exp,exponent,fail,% filter,filterM,find,findIndex,findIndices,flip,floatDigits,% floatRadix,floatRange,floatToDigits,floor,foldl,foldM,foldl1,% foldr,foldr1,fromDouble,fromEnum,fromInt,fromInteger,% fromIntegral,fromJust,fromMaybe,fromRat,fromRational,% fromRealFrac,fst,gcd,genericLength,genericTake,genericDrop,% genericSplitAt,genericIndex,genericReplicate,getArgs,getChar,% getContents,getEnv,getLine,getProgName,getStdGen,getStdRandom,% group,groupBy,guard,hClose,hFileSize,hFlush,hGetBuffering,% hGetChar,hGetContents,hGetLine,hGetPosn,hIsClosed,hIsEOF,hIsOpen,% hIsReadable,hIsSeekable,hIsWritable,hLookAhead,hPutChar,hPutStr,% hPutStrLn,hPrint,hReady,hSeek,hSetBuffering,hSetPosn,head,% hugsIsEOF,hugsHIsEOF,hugsIsSearchErr,hugsIsNameErr,% hugsIsWriteErr,id,ioError,imagPart,index,indices,init,inits,% inRange,insert,insertBy,interact,intersect,intersectBy,% intersperse,intToDigit,ioeGetErrorString,ioeGetFileName,% ioeGetHandle,isAlreadyExistsError,isAlreadyInUseError,isAlpha,% isAlphaNum,isAscii,isControl,isDenormalized,isDoesNotExistError,% isDigit,isEOF,isEOFError,isFullError,isHexDigit,isIEEE,% isIllegalOperation,isInfinite,isJust,isLower,isNaN,% isNegativeZero,isNothing,isOctDigit,isPermissionError,isPrefixOf,% isPrint,isSpace,isSuffixOf,isUpper,isUserError,iterate,ixmap,% join,last,lcm,length,lex,lexDigits,lexLitChar,liftM,liftM2,% liftM3,liftM4,liftM5,lines,listArray,listToMaybe,log,logBase,% lookup,magnitude,makePolar,map,mapAccumL,mapAccumR,mapAndUnzipM,% mapM,mapM_,mapMaybe,max,maxBound,maximum,maximumBy,maybe,% maybeToList,min,minBound,minimum,minimumBy,mkPolar,mkStdGen,% mplus,mod,msum,mzero,negate,next,newStdGen,not,notElem,nub,nubBy,% null,numerator,odd,openFile,or,ord,otherwise,partition,phase,pi,% polar,pred,print,product,properFraction,putChar,putStr,putStrLn,% quot,quotRem,random,randomIO,randomR,randomRIO,randomRs,randoms,% rangeSize,read,readDec,readFile,readFloat,readHex,readInt,readIO,% readList,readLitChar,readLn,readParen,readOct,readSigned,reads,% readsPrec,realPart,realToFrac,recip,rem,repeat,replicate,return,% reverse,round,scaleFloat,scanl,scanl1,scanr,scanr1,seq,sequence,% sequence_,setStdGen,show,showChar,showEFloat,showFFloat,% showFloat,showGFloat,showInt,showList,showLitChar,showParen,% showSigned,showString,shows,showsPrec,significand,signum,sin,% sinh,snd,sort,sortBy,span,split,splitAt,sqrt,stderr,stdin,stdout,% strict,subtract,succ,sum,system,tail,tails,take,takeWhile,tan,% tanh,toEnum,toInt,toInteger,toLower,toRational,toUpper,transpose,% truncate,try,uncurry,undefined,unfoldr,union,unionBy,unless,% unlines,until,unwords,unzip,unzip3,unzip4,unzip5,unzip6,unzip7,% userError,when,words,writeFile,zero,zip,zip3,zip4,zip5,zip6,zip7,% zipWith,zipWithM,zipWithM_,zipWith3,zipWith4,zipWith5,zipWith6,% zipWith7},% sensitive,% morecomment=[l]--,% morecomment=[n]{\{-}{-\}},% morestring=[b]"% }[keywords,comments,strings]% %% %% IDL definition (c) 1998 Juergen Heim %% \lst@definelanguage{IDL}% {morekeywords={and,begin,case,common,do,else,end,endcase,endelse,% endfor,endif,endrep,endwhile,eq,for,function,ge,goto,gt,if,le,lt,% mod,ne,not,of,on_ioerror,or,pro,repeat,return,then,until,while,% xor,on_error,openw,openr,openu,print,printf,printu,plot,read,% readf,readu,writeu,stop},% sensitive=f,% morecomment=[l];,% morestring=[d]'% }[keywords,comments,strings]% %% %% Inform definition (c) 2003 Jonathan Sauer %% \lst@definelanguage{inform}{% % Language keywords morekeywords={breakdo,else,false,for,has,hasnt,if,% in,indirect,jump,notin,nothing,NULL,objectloop,ofclass,% private,property,provides,return,rfalse,rtrue,self,string,% switch,to,true,until,while,with,% creature,held,multiexcept,multiheld,multiinside,noun,number,% scope,topic},% % % Inform functions morekeywords=[2]{box,child,children,font,give,inversion,metaclass,move,% new_line,parent,print,print_ret,read,remove,restore,sibling,% save,spaces,quit,style,bold,underline,reverse,roman remaining,% create,destroy,recreate,copy},% % % Inform definitions morekeywords=[3]{Attribute,Array,Class,Constant,Default,End,Endif,Extend,% Global,Ifdef,Iffalse,Ifndef,Ifnot,Iftrue,Include,Object,% Property,Verb,Release,Serial,Statusline},% % % Library attributes morekeywords=[4]{absent,animate,clothing,concealed,container,door,edible,% enterable,female,general,light,lockable locked,male,moved,% neuter,on,open,openable,pluralname,proper,scenery,scored,% static,supporter,switchable,talkable,transparent,visited,% workflag,worn},% % % Libary properties morekeywords=[5]{n_to,s_to,e_to,w_to,ne_to,nw_to,se_to,sw_to,in_to,% out_to,u_to,d_to,add_to_scope,after,article,articles,before,% cant_go,capacity,daemon,describe,description,door_dir,door_to,% each_turn,found_in,grammar,initial,inside_description,invent,% life,list_together,name number,orders,parse_name,plural,% react_after,react_before,short_name,short_name_indef,time_left,% time_out,when_closed,when_open,when_on,when_off,% with_key}, % % Library routines morekeywords=[6]{Achieved,AfterRoutines,AllowPushDir,Banner,ChangePlayer,% CommonAncestor,DictionaryLookup,GetGNAOfObject,HasLightSource,% IndirectlyContains,IsSeeThrough,Locale,LoopOverScope,LTI_Insert,% MoveFloatingObjects,NextWord,NextWordStopped,NounDomain,% ObjectIsUntouchable OffersLight,ParseToken,PlaceInScope,PlayerTo,% PronounNotice,PronounValue,ScopeWithin,SetPronoun,SetTime,% StartDaemon,StartTimer,StopDaemon,StopTimer,TestScope,TryNumber,% UnsignedCompare,WordAddress,WordInProperty,WordLength,% WriteListFrom,YesOrNo},% % % Library,entry points morekeywords=[7]{AfterLife,AfterPrompt,Amusing,BeforeParsing,ChooseObjects,% DarkToDark,DeathMessage,GamePostRoutine GamePreRoutine,% Initialise,InScope,LookRoutine,NewRoom,ParseNoun,ParseNumber,% ParserError,PrintRank,PrintTaskName,PrintVerb,TimePasses,% UnknownVerb},% % % Library constants morekeywords=[8]{NEWLINE_BIT,INDENT_BIT,FULLINV_BIT,ENGLISH_BIT,RECURSE_BIT,% ALWAYS_BIT,TERSE_BIT,PARTINV_BIT,DEFART_BIT,WORKFLAG_BIT,% ISARE_BIT,CONCEAL_BIT},% % % Library,meta actions morekeywords=[9]{Pronouns,Quit,Restart,Restore,Save,Verify,ScriptOn,ScriptOff,% NotifyOn,NotifyOff,Places,Objects,Score,FullScore,Version,LMode1,% LMode2,Lmode3},% % % Library,main actions morekeywords=[10]{Close,Disrobe,Drop,Eat,Empty,EmptyT,Enter,Examine,Exit,GetOff,% Give,Go,GoIn,Insert,Inv,InvTall,InvWide,Lock,Look,Open,PutOn,Remove,% Search,Show,SwitchOff,SwitchOn,Take,Transfer,Unlock VagueGo,% Wear},% % % Library,stub actions morekeywords=[11]{Answer,Ask,AskFor,Attack,Blow,Burn,Buy,Climb,Consult,Cut,Dig,% Drink,Fill,Jump,JumpOver,Kiss,Listen,LookUnder,Mild,No,Pray,Pull,% Push,PushDir,Rub,Set,SetTo,Sing,Sleep,Smell,,Sleep,Smell,Sorry,% Squeeze,Strong,Swim,Swing,Taste,Tell,Think,ThrowAt,Tie,Touch,Turn,% Wait,Wake,WakeOther,Wave,WaveHands,Yes},% % otherkeywords={->,-->},% sensitive=false,% morestring=[d]{"},% morecomment=[l]{!}% }[keywords,comments,strings]% \lst@definelanguage{Lisp}% {morekeywords={abort,abs,acons,acos,acosh,adjoin,alphanumericp,alter,% append,apply,apropos,aref,arrayp,ash,asin,asinh,assoc,atan,atanh,% atom,bit,boole,boundp,break,butlast,byte,catenate,ceiling,cerror,% char,character,characterp,choose,chunk,cis,close,clrhash,coerce,% collect,commonp,compile,complement,complex,complexp,concatenate,% conjugate,cons,consp,constantp,continue,cos,cosh,cotruncate,% count,delete,denominator,describe,directory,disassemble,% documentation,dpb,dribble,ed,eighth,elt,enclose,endp,eq,eql,% equal,equalp,error,eval,evalhook,evenp,every,exp,expand,export,% expt,fboundp,fceiling,fdefinition,ffloor,fifth,fill,find,first,% float,floatp,floor,fmakunbound,format,fourth,fround,ftruncate,% funcall,functionp,gatherer,gcd,generator,gensym,gentemp,get,getf,% gethash,identity,imagpart,import,inspect,integerp,intern,% intersection,tively,isqrt,keywordp,last,latch,lcm,ldb,ldiff,% length,list,listen,listp,load,log,logand,logbitp,logcount,logeqv,% logior,lognand,lognor,lognot,logtest,logxor,macroexpand,% makunbound,map,mapc,mapcan,mapcar,mapcon,maphash,mapl,maplist,% mask,max,member,merge,min,mingle,minusp,mismatch,mod,namestring,% nbutlast,nconc,nintersection,ninth,not,notany,notevery,nreconc,% nreverse,nsublis,nsubst,nth,nthcdr,null,numberp,numerator,nunion,% oddp,open,packagep,pairlis,pathname,pathnamep,phase,plusp,% position,positions,pprint,previous,princ,print,proclaim,provide,% random,rassoc,rational,rationalize,rationalp,read,readtablep,% realp,realpart,reduce,rem,remhash,remove,remprop,replace,require,% rest,revappend,reverse,room,round,rplaca,rplacd,sbit,scan,schar,% search,second,series,set,seventh,shadow,signal,signum,sin,sinh,% sixth,sleep,some,sort,split,sqrt,streamp,string,stringp,sublis,% subseq,subseries,subsetp,subst,substitute,subtypep,svref,sxhash,% symbolp,tailp,tan,tanh,tenth,terpri,third,truename,truncate,% typep,unexport,unintern,union,until,values,vector,vectorp,warn,% write,zerop,and,assert,case,ccase,cond,ctypecase,decf,declaim,% defclass,defconstant,defgeneric,defmacro,defmethod,defpackage,% defparameter,defsetf,defstruct,deftype,defun,defvar,do,dolist,% dotimes,ecase,encapsulated,etypecase,flet,formatter,gathering,% incf,iterate,labels,let,locally,loop,macrolet,mapping,or,pop,% producing,prog,psetf,psetq,push,pushnew,remf,return,rotatef,% setf,shiftf,step,time,trace,typecase,unless,untrace,when},% sensitive,% ??? alsodigit=-,% morecomment=[l];,% morecomment=[s]{\#|}{|\#},% 1997 Aslak Raanes morestring=[b]"% }[keywords,comments,strings]% %% %% AutoLISP/VisualLISP - Stefan Lagotzki, info@lagotzki.de %% \lst@definelanguage[Auto]{Lisp}% {morekeywords={abs,acad_colordlg,acad_helpdlg,acad_strlsort,% action_tile,add_list,alert,alloc,and,angle,angtof,angtos,append,% apply,arx,arxload,arxunload,ascii,assoc,atan,atof,atoi,atom,% atoms-family,autoarxload,autoload,Boole,boundp,caddr,cadr,car,% cdr,chr,client_data_tile,close,command,cond,cons,cos,cvunit,% defun,defun-q,defun-q-list-ref,defun-q-list-set,dictadd,dictnext,% dictremove,dictrename,dictsearch,dimx_tile,dimy_tile,distance,% distof,done_dialog,end_image,end_list,entdel,entget,entlast,% entmake,entmakex,entmod,entnext,entsel,entupd,eq,equal,*error*,% eval,exit,exp,expand,expt,fill_image,findfile,fix,float,foreach,% function,gc,gcd,get_attr,get_tile,getangle,getcfg,getcname,% getcorner,getdist,getenv,getfiled,getint,getkword,getorient,% getpoint,getreal,getstring,getvar,graphscr,grclear,grdraw,grread,% grtext,grvecs,handent,help,if,initdia,initget,inters,itoa,lambda,% last,layoutlist,length,list,listp,load,load_dialog,log,logand,% logior,lsh,mapcar,max,mem,member,menucmd,menugroup,min,minusp,% mode_tile,namedobjdict,nentsel,nentselp,new_dialog,not,nth,% null,numberp,open,or,osnap,polar,prin1,princ,print,progn,prompt,% quit,quote,read,read-char,read-line,redraw,regapp,rem,repeat,% reverse,rtos,set,set_tile,setcfg,setenv,setfunhelp,setq,% setvar,setview,sin,slide_image,snvalid,sqrt,ssadd,ssdel,ssget,% ssgetfirst,sslength,ssmemb,ssname,ssnamex,sssetfirst,startapp,% start_dialog,start_image,start_list,strcase,strcat,strlen,subst,% substr,tablet,tblnext,tblobjname,tblsearch,term_dialog,terpri,% textbox,textpage,textscr,trace,trans,type,unload_dialog,untrace,% vector_image,ver,vl-acad-defun,vl-acad-undefun,vl-arx-import,% vl-bb-ref,vl-bb-set,vl-catch-all-apply,% vl-catch-all-error-message,vl-catch-all-error-p,vl-cmdf,vl-consp,% vl-directory-files,vl-doc-export,vl-doc-import,vl-doc-ref,% vl-doc-set,vl-every,vl-exit-with-error,vl-exit-with-value,% vl-file-copy,vl-file-delete,vl-file-directory-p,vl-file-rename,% vl-file-size,vl-file-systime,vl-filename-base,% vl-filename-directory,vl-filename-extension,vl-filename-mktemp,% vl-get-resource,vl-list*,vl-list->string,% vl-list-exported-functions,vl-list-length,vl-list-loaded-vlx,% vl-load-all,vl-load-com,vl-load-reactors,vl-member-if,% vl-member-if-not,vl-position,vl-prin1-to-string,% vl-princ-to-string,vl-propagate,vl-registry-delete,% vl-registry-descendents,vl-registry-read,vl-registry-write,% vl-remove,vl-remove-if,vl-remove-if-not,vl-some,vl-sort,% vl-sort-i,vl-string->list,vl-string-elt,vl-string-left-trim,% vl-string-mismatch,vl-string-position,vl-string-right-trim,% vl-string-search,vl-string-subst,vl-string-translate,% vl-string-trim,vl-symbol-name,vl-symbol-value,vl-symbolp,% vl-unload-vlx,vl-vbaload,vl-vbarun,vl-vlx-loaded-p,vlax-3D-point,% vlax-add-cmd,vlax-create-object,vlax-curve-getArea,% vlax-curve-getDistAtParam,vlax-curve-getDistAtPoint,% vlax-curve-getEndParam,vlax-curve-getEndPoint,% vlax-curve-getParamAtDist,vlax-curve-getParamAtPoint,% vlax-curve-getPointAtDist,vlax-curve-getPointAtParam,% vlax-curve-getStartParam,vlax-curve-getStartPoint,% vlax-curve-isClosed,vlax-curve-isPeriodic,vlax-curve-isPlanar,% vlax-curve-getClosestPointTo,% vlax-curve-getClosestPointToProjection,vlax-curve-getFirstDeriv,% vlax-curve-getSecondDeriv,vlax-dump-object,% vlax-ename->vla-object,vlax-erased-p,vlax-for,% vlax-get-acad-object,vlax-get-object,vlax-get-or-create-object,% vlax-get-property,vlax-import-type-library,vlax-invoke-method,% vlax-ldata-delete,vlax-ldata-get,vlax-ldata-list,vlax-ldata-put,% vlax-ldata-test,vlax-make-safearray,vlax-make-variant,% vlax-map-collection,vlax-method-applicable-p,% vlax-object-released-p,vlax-product-key,% vlax-property-available-p,vlax-put-property,vlax-read-enabled-p,% vlax-release-object,vlax-remove-cmd,vlax-safearray-fill,% vlax-safearray-get-dim,vlax-safearray-get-element,% vlax-safearray-get-l-bound,vlax-safearray-get-u-bound,% vlax-safearray-put-element,vlax-safearray-type,% vlax-safearray->list,vlax-tmatrix,vlax-typeinfo-available-p,% vlax-variant-change-type,vlax-variant-type,vlax-variant-value,% vlax-vla-object->ename,vlax-write-enabled-p,vlisp-compile,% vlr-acdb-reactor,vlr-add,vlr-added-p,vlr-beep-reaction,% vlr-command-reactor,vlr-current-reaction-name,vlr-data,% vlr-data-set,vlr-deepclone-reactor,vlr-docmanager-reactor,% vlr-dwg-reactor,vlr-dxf-reactor,vlr-editor-reactor,% vlr-insert-reactor,vlr-linker-reactor,vlr-lisp-reactor,% vlr-miscellaneous-reactor,vlr-mouse-reactor,vlr-notification,% vlr-object-reactor,vlr-owner-add,vlr-owner-remove,vlr-owners,% vlr-pers,vlr-pers-list,vlr-pers-p,vlr-pers-release,% vlr-reaction-names,vlr-reaction-set,vlr-reactions,vlr-reactors,% vlr-remove,vlr-remove-all,vlr-set-notification,% vlr-sysvar-reactor,vlr-toolbar-reactor,vlr-trace-reaction,% vlr-type,vlr-types,vlr-undo-reactor,vlr-wblock-reactor,% vlr-window-reactor,vlr-xref-reactor,vports,wcmatch,while,% write-char,write-line,xdroom,xdsize,zerop},% alsodigit=->,% otherkeywords={1+,1-},% sensitive=false,% morecomment=[l];,% morecomment=[l];;,% morestring=[b]"% }[keywords,comments,strings]% %% %% Make definitions (c) 2000 Rolf Niepraschk %% \lst@definelanguage[gnu]{make}% {morekeywords={SHELL,MAKE,MAKEFLAGS,$@,$\%,$<,$?,$^,$+,$*,% @,^,<,\%,+,?,*,% Markus Pahlow export,unexport,include,override,define,ifdef,ifneq,ifeq,else,% endif,vpath,subst,patsubst,strip,findstring,filter,filter-out,% sort,dir,notdir,suffix,basename,addsuffix,addprefix,join,word,% words,firstword,wildcard,shell,origin,foreach,% @D,@F,*D,*F,\%D,\%F,,-->,--->,:-,==,=>,<=,<=>},% morekeywords={module,include_module,import_module,interface,% end_module,implementation,mode,is,failure,semidet,nondet,det,% multi,erroneous,inst,in,out,di,uo,ui,type,typeclass,instance,% where,with_type,pred,func,lambda,impure,semipure,if,then,else,% some,all,not,true,fail,pragma,memo,no_inline,inline,loop_check,% minimal_model,fact_table,type_spec,terminates,does_not_terminate,% check_termination,promise_only_solution,unsafe_promise_unique,% source_file,obsolete,import,export,c_header_code,c_code,% foreign_code,foreign_proc,may_call_mercury,will_not_call_mercury,% thread_safe,not_thread_safe},% sensitive=t,% morecomment=[l]\%,% morecomment=[s]{/*}{*/},% morestring=[bd]",% morestring=[bd]'% }[keywords,comments,strings]% %% %% Miranda definition (c) 1998 Peter Bartke %% %% Miranda: pure lazy functional language with polymorphic type system, %% garbage collection and functions as first class citizens %% \lst@definelanguage{Miranda}% {morekeywords={abstype,div,if,mod,otherwise,readvals,show,type,where,% with,bool,char,num,sys_message,False,True,Appendfile,Closefile,% Exit,Stderr,Stdout,System,Tofile,\%include,\%export,\%free,% \%insert,abs,and,arctan,cjustify,code,concat,const,converse,cos,% decode,digit,drop,dropwhile,entier,error,exp,filemode,filter,% foldl,foldl1,foldr,foldr1,force,fst,getenv,hd,hugenum,id,index,% init,integer,iterate,last,lay,layn,letter,limit,lines,ljustify,% log,log10,map,map2,max,max2,member,merge,min,min2,mkset,neg,% numval,or,pi,postfix,product,read,rep,repeat,reverse,rjustify,% scan,seq,showfloat,shownum,showscaled,sin,snd,sort,spaces,sqrt,% subtract,sum,system,take,takewhile,tinynum,tl,transpose,undef,% until,zip2,zip3,zip4,zip5,zip6,zip},% sensitive,% morecomment=[l]||,% morestring=[b]"% }[keywords,comments,strings]% %% %% ML definition (c) 1999 Torben Hoffmann %% \lst@definelanguage{ML}% {morekeywords={abstype,and,andalso,as,case,do,datatype,else,end,% eqtype,exception,fn,fun,functor,handle,if,in,include,infix,% infixr,let,local,nonfix,of,op,open,orelse,raise,rec,sharing,sig,% signature,struct,structure,then,type,val,with,withtype,while},% sensitive,% morecomment=[n]{(*}{*)},% morestring=[d]"% }[keywords,comments,strings]% %% %% Oz definition (c) Andres Becerra Sandoval %% \lst@definelanguage{Oz}% {morekeywords={andthen,at,attr,case,catch,choice,class,% cond,declare,define,dis,div,else,elsecase,% elseif,end,export,fail,false,feat,finally,% from,fun,functor,if,import,in,local,% lock,meth,mod,not,of,or,orelse,% prepare,proc,prop,raise,require,self,skip,% then,thread,true,try,unit},% sensitive=true,% morecomment=[l]{\%},% morecomment=[s]{/*}{*/},% morestring=[b]",% morestring=[d]'% }[keywords,comments,strings]% %% %% PHP definition by Luca Balzerani %% \lst@definelanguage{PHP}% {morekeywords={% %--- core language ,::,break,case,continue,default,do,else,% elseif,for,foreach,if,include,require,phpinfo,% switch,while,false,FALSE,true,TRUE,% %--- apache functions apache_lookup_uri,apache_note,ascii2ebcdic,ebcdic2ascii,% virtual,apache_child_terminate,apache_setenv,% %--- array functions array,array_change_key_case,array_chunk,array_count_values,% array_filter,array_flip,array_fill,array_intersect,% array_keys,array_map,array_merge,array_merge_recursive,% array_pad,array_pop,array_push,array_rand,array_reverse,% array_shift,array_slice,array_splice,array_sum,array_unique,% array_values,array_walk,arsort,asort,compact,count,current,each,% extract,in_array,array_search,key,krsort,ksort,list,natsort,% next,pos,prev,range,reset,rsort,shuffle,sizeof,sort,uasort,% usort,% %--- aspell functions aspell_new,aspell_check,aspell_check_raw,aspell_suggest,% %--- bc functions bcadd,bccomp,bcdiv,bcmod,bcmul,bcpow,bcscale,bcsqrt,bcsub,% %--- bzip2 functions bzclose,bzcompress,bzdecompress,bzerrno,bzerror,bzerrstr,% bzopen,bzread,bzwrite,% %--- calendar functions JDToGregorian,GregorianToJD,JDToJulian,JulianToJD,JDToJewish,% JDToFrench,FrenchToJD,JDMonthName,JDDayOfWeek,easter_date,% unixtojd,jdtounix,cal_days_in_month,cal_to_jd,cal_from_jd,% %--- ccvs functions ccvs_init,ccvs_done,ccvs_new,ccvs_add,ccvs_delete,ccvs_auth,% ccvs_reverse,ccvs_sale,ccvs_void,ccvs_status,ccvs_count,% ccvs_report,ccvs_command,ccvs_textvalue,% %--- classobj functions call_user_method,call_user_method_array,class_exists,get_class,% get_class_vars,get_declared_classes,get_object_vars,% is_a,is_subclass_of,method_exists,% %--- com functions COM,VARIANT,com_load,com_invoke,com_propget,com_get,com_propput,% com_set,com_addref,com_release,com_isenum,com_load_typelib,% %--- cpdf functions cpdf_add_annotation,cpdf_add_outline,cpdf_arc,cpdf_begin_text,% cpdf_clip,cpdf_close,cpdf_closepath,cpdf_closepath_fill_stroke,% cpdf_continue_text,cpdf_curveto,cpdf_end_text,cpdf_fill,% cpdf_finalize,cpdf_finalize_page,% cpdf_import_jpeg,cpdf_lineto,cpdf_moveto,cpdf_newpath,cpdf_open,% cpdf_page_init,cpdf_place_inline_image,cpdf_rect,cpdf_restore,% cpdf_rmoveto,cpdf_rotate,cpdf_rotate_text,cpdf_save,% cpdf_scale,cpdf_set_char_spacing,cpdf_set_creator,% cpdf_set_font,cpdf_set_horiz_scaling,cpdf_set_keywords,% cpdf_set_page_animation,cpdf_set_subject,cpdf_set_text_matrix,% cpdf_set_text_rendering,cpdf_set_text_rise,cpdf_set_title,% cpdf_setdash,cpdf_setflat,cpdf_setgray,cpdf_setgray_fill,% cpdf_setlinecap,cpdf_setlinejoin,cpdf_setlinewidth,% cpdf_setrgbcolor,cpdf_setrgbcolor_fill,cpdf_setrgbcolor_stroke,% cpdf_show_xy,cpdf_stringwidth,cpdf_set_font_directories,% cpdf_set_viewer_preferences,cpdf_stroke,cpdf_text,% cpdf_set_action_url,% %--- crack functions crack_opendict,crack_closedict,crack_check,crack_getlastmessage,% %--- ctype functions ctype_alnum,ctype_alpha,ctype_cntrl,ctype_digit,ctype_lower,% ctype_print,ctype_punct,ctype_space,ctype_upper,ctype_xdigit,% %--- curl functions curl_init,curl_setopt,curl_exec,curl_close,curl_version,% curl_error,curl_getinfo,% %--- cybercash functions cybercash_encr,cybercash_decr,cybercash_base64_encode,% %--- cybermut functions cybermut_creerformulairecm,cybermut_testmac,% %--- cyrus functions cyrus_connect,cyrus_authenticate,cyrus_bind,cyrus_unbind,% cyrus_close,% %--- datetime functions checkdate,date,getdate,gettimeofday,gmdate,gmmktime,gmstrftime,% microtime,mktime,strftime,time,strtotime,% %--- dbase functions dbase_create,dbase_open,dbase_close,dbase_pack,dbase_add_record,% dbase_delete_record,dbase_get_record,% dbase_numfields,dbase_numrecords,% %--- dba functions dba_close,dba_delete,dba_exists,dba_fetch,dba_firstkey,% dba_nextkey,dba_popen,dba_open,dba_optimize,dba_replace,% %--- dbm functions dbmopen,dbmclose,dbmexists,dbmfetch,dbminsert,dbmreplace,% dbmfirstkey,dbmnextkey,dblist,% %--- dbx functions dbx_close,dbx_connect,dbx_error,dbx_query,dbx_sort,dbx_compare,% %--- dio functions dio_open,dio_read,dio_write,dio_truncate,dio_stat,dio_seek,% dio_close,% %--- dir functions chroot,chdir,dir,closedir,getcwd,opendir,readdir,rewinddir,% %--- dotnet functions dotnet_load,% %--- errorfunc functions error_log,error_reporting,restore_error_handler,% trigger_error,user_error,% %--- exec functions escapeshellarg,escapeshellcmd,exec,passthru,system,shell_exec,% %--- fbsql functions fbsql_affected_rows,fbsql_autocommit,fbsql_change_user,% fbsql_commit,fbsql_connect,fbsql_create_db,fbsql_create_blob,% fbsql_database_password,fbsql_data_seek,fbsql_db_query,% fbsql_drop_db,fbsql_errno,fbsql_error,fbsql_fetch_array,% fbsql_fetch_field,fbsql_fetch_lengths,fbsql_fetch_object,% fbsql_field_flags,fbsql_field_name,fbsql_field_len,% fbsql_field_table,fbsql_field_type,fbsql_free_result,% fbsql_list_dbs,fbsql_list_fields,fbsql_list_tables,% fbsql_num_fields,fbsql_num_rows,fbsql_pconnect,fbsql_query,% fbsql_read_clob,fbsql_result,fbsql_rollback,fbsql_set_lob_mode,% fbsql_start_db,fbsql_stop_db,fbsql_tablename,fbsql_warnings,% fbsql_get_autostart_info,fbsql_hostname,fbsql_password,% fbsql_username,% %--- fdf functions fdf_open,fdf_close,fdf_create,fdf_save,fdf_get_value,% fdf_next_field_name,fdf_set_ap,fdf_set_status,fdf_get_status,% fdf_get_file,fdf_set_flags,fdf_set_opt,% fdf_set_javascript_action,fdf_set_encoding,fdf_add_template,% %--- filepro functions filepro,filepro_fieldname,filepro_fieldtype,filepro_fieldwidth,% filepro_fieldcount,filepro_rowcount,% %--- filesystem functions basename,chgrp,chmod,chown,clearstatcache,copy,delete,dirname,% diskfreespace,disk_total_space,fclose,feof,fflush,fgetc,fgetcsv,% fgetss,file_get_contents,file,file_exists,fileatime,filectime,% fileinode,filemtime,fileowner,fileperms,filesize,filetype,flock,% fopen,fpassthru,fputs,fread,fscanf,fseek,fstat,ftell,ftruncate,% set_file_buffer,is_dir,is_executable,is_file,is_link,% is_writable,is_writeable,is_uploaded_file,link,linkinfo,mkdir,% parse_ini_file,pathinfo,pclose,popen,readfile,readlink,rename,% rmdir,stat,lstat,realpath,symlink,tempnam,tmpfile,touch,umask,% %--- fribidi functions fribidi_log2vis,% %--- ftp functions ftp_connect,ftp_login,ftp_pwd,ftp_cdup,ftp_chdir,ftp_mkdir,% ftp_nlist,ftp_rawlist,ftp_systype,ftp_pasv,ftp_get,ftp_fget,% ftp_fput,ftp_size,ftp_mdtm,ftp_rename,ftp_delete,ftp_site,% ftp_quit,ftp_exec,ftp_set_option,ftp_get_option,% %--- funchand functions call_user_func_array,call_user_func,create_function,% func_get_args,func_num_args,function_exists,% register_shutdown_function,register_tick_function,% %--- gettext functions bindtextdomain,bind_textdomain_codeset,dcgettext,dcngettext,% dngettext,gettext,ngettext,textdomain,% %--- gmp functions gmp_init,gmp_intval,gmp_strval,gmp_add,gmp_sub,gmp_mul,% gmp_div_r,gmp_div_qr,gmp_div,gmp_mod,gmp_divexact,gmp_cmp,% gmp_com,gmp_abs,gmp_sign,gmp_fact,gmp_sqrt,gmp_sqrtrm,% gmp_pow,gmp_powm,gmp_prob_prime,gmp_gcd,gmp_gcdext,gmp_invert,% gmp_jacobi,gmp_random,gmp_and,gmp_or,gmp_xor,gmp_setbit,% gmp_scan0,gmp_scan1,gmp_popcount,gmp_hamdist,% %--- http functions header,headers_sent,setcookie,% %--- hw functions hw_Array2Objrec,hw_Children,hw_ChildrenObj,hw_Close,hw_Connect,% hw_Deleteobject,hw_DocByAnchor,hw_DocByAnchorObj,% hw_Document_BodyTag,hw_Document_Content,hw_Document_SetContent,% hw_ErrorMsg,hw_EditText,hw_Error,hw_Free_Document,hw_GetParents,% hw_GetChildColl,hw_GetChildCollObj,hw_GetRemote,% hw_GetSrcByDestObj,hw_GetObject,hw_GetAndLock,hw_GetText,% hw_GetObjectByQueryObj,hw_GetObjectByQueryColl,% hw_GetChildDocColl,hw_GetChildDocCollObj,hw_GetAnchors,% hw_Mv,hw_Identify,hw_InCollections,hw_Info,hw_InsColl,hw_InsDoc,% hw_InsertObject,hw_mapid,hw_Modifyobject,hw_New_Document,% hw_Output_Document,hw_pConnect,hw_PipeDocument,hw_Root,% hw_Who,hw_getusername,hw_stat,hw_setlinkroot,hw_connection_info,% hw_insertanchors,hw_getrellink,hw_changeobject,% %--- ibase functions ibase_connect,ibase_pconnect,ibase_close,ibase_query,% ibase_fetch_row,ibase_fetch_object,ibase_field_info,% ibase_free_result,ibase_prepare,ibase_execute,ibase_trans,% ibase_rollback,ibase_timefmt,ibase_num_fields,ibase_blob_add,% ibase_blob_close,ibase_blob_create,ibase_blob_echo,% ibase_blob_import,ibase_blob_info,ibase_blob_open,% %--- icap functions icap_open,icap_close,icap_fetch_event,icap_list_events,% icap_delete_event,icap_snooze,icap_list_alarms,% icap_rename_calendar,icap_delete_calendar,icap_reopen,% %--- iconv functions iconv,iconv_get_encoding,iconv_set_encoding,ob_iconv_handler,% %--- ifx functions ifx_connect,ifx_pconnect,ifx_close,ifx_query,ifx_prepare,ifx_do,% ifx_errormsg,ifx_affected_rows,ifx_getsqlca,ifx_fetch_row,% ifx_fieldtypes,ifx_fieldproperties,ifx_num_fields,ifx_num_rows,% ifx_create_char,ifx_free_char,ifx_update_char,ifx_get_char,% ifx_copy_blob,ifx_free_blob,ifx_get_blob,ifx_update_blob,% ifx_textasvarchar,ifx_byteasvarchar,ifx_nullformat,% ifxus_free_slob,ifxus_close_slob,ifxus_open_slob,% ifxus_seek_slob,ifxus_read_slob,ifxus_write_slob,% %--- iisfunc functions iis_get_server_by_path,iis_get_server_by_comment,iis_add_server,% iis_set_dir_security,iis_get_dir_security,iis_set_server_rights,% iis_set_script_map,iis_get_script_map,iis_set_app_settings,% iis_stop_server,iis_stop_service,iis_start_service,% %--- image functions exif_imagetype,exif_read_data,exif_thumbnail,getimagesize,% imagealphablending,imagearc,imagefilledarc,imageellipse,% imagechar,imagecharup,imagecolorallocate,imagecolordeallocate,% imagecolorclosest,imagecolorclosestalpha,imagecolorclosestthwb,% imagecolorexactalpha,imagecolorresolve,imagecolorresolvealpha,% imagecolorset,imagecolorsforindex,imagecolorstotal,% imagecopy,imagecopymerge,imagecopymergegray,imagecopyresized,% imagecreate,imagecreatetruecolor,imagetruecolortopalette,% imagecreatefromgd2,imagecreatefromgd2part,imagecreatefromgif,% imagecreatefrompng,imagecreatefromwbmp,imagecreatefromstring,% imagecreatefromxpm,imagedashedline,imagedestroy,imagefill,% imagefilledrectangle,imagefilltoborder,imagefontheight,% imagegd,imagegd2,imagegif,imagepng,imagejpeg,imagewbmp,% imageline,imageloadfont,imagepalettecopy,imagepolygon,% imagepsencodefont,imagepsfreefont,imagepsloadfont,% imagepsslantfont,imagepstext,imagerectangle,imagesetpixel,% imagesetstyle,imagesettile,imagesetthickness,imagestring,% imagesx,imagesy,imagettfbbox,imageftbbox,imagettftext,% imagetypes,jpeg2wbmp,png2wbmp,iptcembed,read_exif_data,% %--- imap functions imap_8bit,imap_alerts,imap_append,imap_base64,imap_binary,% imap_bodystruct,imap_check,imap_clearflag_full,imap_close,% imap_delete,imap_deletemailbox,imap_errors,imap_expunge,% imap_fetchbody,imap_fetchheader,imap_fetchstructure,% imap_getmailboxes,imap_getsubscribed,imap_header,% imap_headers,imap_last_error,imap_listmailbox,% imap_mail,imap_mail_compose,imap_mail_copy,imap_mail_move,% imap_mime_header_decode,imap_msgno,imap_num_msg,imap_num_recent,% imap_ping,imap_popen,imap_qprint,imap_renamemailbox,imap_reopen,% imap_rfc822_parse_headers,imap_rfc822_write_address,% imap_search,imap_setacl,imap_set_quota,imap_setflag_full,% imap_status,imap_subscribe,imap_uid,imap_undelete,% imap_utf7_decode,imap_utf7_encode,imap_utf8,imap_thread,% %--- info functions assert,assert_options,extension_loaded,dl,getenv,get_cfg_var,% get_defined_constants,get_extension_funcs,getmygid,% get_loaded_extensions,get_magic_quotes_gpc,% getlastmod,getmyinode,getmypid,getmyuid,get_required_files,% ini_alter,ini_get,ini_get_all,ini_restore,ini_set,phpcredits,% phpversion,php_logo_guid,php_sapi_name,php_uname,putenv,% set_time_limit,version_compare,zend_logo_guid,zend_version,% %--- ircg functions ircg_pconnect,ircg_fetch_error_msg,ircg_set_current,ircg_join,% ircg_msg,ircg_notice,ircg_nick,ircg_topic,ircg_channel_mode,% ircg_whois,ircg_kick,ircg_ignore_add,ircg_ignore_del,% ircg_is_conn_alive,ircg_lookup_format_messages,% ircg_set_on_die,ircg_set_file,ircg_get_username,% ircg_nickname_unescape,% %--- java functions java_last_exception_clear,java_last_exception_get,% %--- ldap functions ldap_add,ldap_bind,ldap_close,ldap_compare,ldap_connect,% ldap_delete,ldap_dn2ufn,ldap_err2str,ldap_errno,ldap_error,% ldap_first_attribute,ldap_first_entry,ldap_free_result,% ldap_get_dn,ldap_get_entries,ldap_get_option,ldap_get_values,% ldap_list,ldap_modify,ldap_mod_add,ldap_mod_del,% ldap_next_attribute,ldap_next_entry,ldap_read,ldap_rename,% ldap_set_option,ldap_unbind,ldap_8859_to_t61,% ldap_next_reference,ldap_parse_reference,ldap_parse_result,% ldap_sort,ldap_start_tls,ldap_t61_to_8859,% %--- mail functions mail,ezmlm_hash,% %--- math functions abs,acos,acosh,asin,asinh,atan,atanh,atan2,base_convert,bindec,% cos,cosh,decbin,dechex,decoct,deg2rad,exp,expm1,floor,% hexdec,hypot,is_finite,is_infinite,is_nan,lcg_value,log,log10,% max,min,mt_rand,mt_srand,mt_getrandmax,number_format,octdec,pi,% rad2deg,rand,round,sin,sinh,sqrt,srand,tan,tanh,% %--- mbstring functions mb_language,mb_parse_str,mb_internal_encoding,mb_http_input,% mb_detect_order,mb_substitute_character,mb_output_handler,% mb_strlen,mb_strpos,mb_strrpos,mb_substr,mb_strcut,mb_strwidth,% mb_convert_encoding,mb_detect_encoding,mb_convert_kana,% mb_decode_mimeheader,mb_convert_variables,% mb_decode_numericentity,mb_send_mail,mb_get_info,% mb_ereg,mb_eregi,mb_ereg_replace,mb_eregi_replace,mb_split,% mb_ereg_search,mb_ereg_search_pos,mb_ereg_search_regs,% mb_ereg_search_getregs,mb_ereg_search_getpos,% %--- mcal functions mcal_open,mcal_popen,mcal_reopen,mcal_close,% mcal_rename_calendar,mcal_delete_calendar,mcal_fetch_event,% mcal_append_event,mcal_store_event,mcal_delete_event,% mcal_list_alarms,mcal_event_init,mcal_event_set_category,% mcal_event_set_description,mcal_event_set_start,% mcal_event_set_alarm,mcal_event_set_class,mcal_is_leap_year,% mcal_date_valid,mcal_time_valid,mcal_day_of_week,% mcal_date_compare,mcal_next_recurrence,% mcal_event_set_recur_daily,mcal_event_set_recur_weekly,% mcal_event_set_recur_monthly_wday,mcal_event_set_recur_yearly,% mcal_event_add_attribute,mcal_expunge,mcal_week_of_year,% %--- mcrypt functions mcrypt_get_cipher_name,mcrypt_get_block_size,% mcrypt_create_iv,mcrypt_cbc,mcrypt_cfb,mcrypt_ecb,mcrypt_ofb,% mcrypt_list_modes,mcrypt_get_iv_size,mcrypt_encrypt,% mcrypt_module_open,mcrypt_module_close,mcrypt_generic_deinit,% mcrypt_generic,mdecrypt_generic,mcrypt_generic_end,% mcrypt_enc_is_block_algorithm_mode,% mcrypt_enc_is_block_mode,mcrypt_enc_get_block_size,% mcrypt_enc_get_supported_key_sizes,mcrypt_enc_get_iv_size,% mcrypt_enc_get_modes_name,mcrypt_module_self_test,% mcrypt_module_is_block_algorithm,mcrypt_module_is_block_mode,% mcrypt_module_get_algo_key_size,% %--- mhash functions mhash_get_hash_name,mhash_get_block_size,mhash_count,mhash,% %--- misc functions connection_aborted,connection_status,connection_timeout,% define,defined,die,eval,exit,get_browser,highlight_file,% ignore_user_abort,iptcparse,leak,pack,show_source,sleep,uniqid,% usleep,% %--- mnogosearch functions udm_add_search_limit,udm_alloc_agent,udm_api_version,% udm_cat_list,udm_clear_search_limits,udm_errno,udm_error,% udm_free_agent,udm_free_ispell_data,udm_free_res,% udm_get_res_field,udm_get_res_param,udm_load_ispell_data,% udm_check_charset,udm_check_stored,udm_close_stored,udm_crc32,% %--- msession functions msession_connect,msession_disconnect,msession_count,% msession_destroy,msession_lock,msession_unlock,msession_set,% msession_uniq,msession_randstr,msession_find,msession_list,% msession_set_array,msession_listvar,msession_timeout,% msession_getdata,msession_setdata,msession_plugin,% %--- msql functions msql,msql_affected_rows,msql_close,msql_connect,msql_create_db,% msql_data_seek,msql_dbname,msql_drop_db,msql_dropdb,msql_error,% msql_fetch_field,msql_fetch_object,msql_fetch_row,% msql_field_seek,msql_fieldtable,msql_fieldtype,msql_fieldflags,% msql_free_result,msql_freeresult,msql_list_fields,% msql_list_dbs,msql_listdbs,msql_list_tables,msql_listtables,% msql_num_rows,msql_numfields,msql_numrows,msql_pconnect,% msql_regcase,msql_result,msql_select_db,msql_selectdb,% %--- mssql functions mssql_close,mssql_connect,mssql_data_seek,mssql_fetch_array,% mssql_fetch_object,mssql_fetch_row,mssql_field_length,% mssql_field_seek,mssql_field_type,mssql_free_result,% mssql_min_error_severity,mssql_min_message_severity,% mssql_num_fields,mssql_num_rows,mssql_pconnect,mssql_query,% mssql_select_db,mssql_bind,mssql_execute,mssql_fetch_assoc,% mssql_guid_string,mssql_init,mssql_rows_affected,% %--- muscat functions muscat_setup,muscat_setup_net,muscat_give,muscat_get,% %--- mysql functions mysql_affected_rows,mysql_change_user,mysql_character_set_name,% mysql_connect,mysql_create_db,mysql_data_seek,mysql_db_name,% mysql_drop_db,mysql_errno,mysql_error,mysql_escape_string,% mysql_fetch_assoc,mysql_fetch_field,mysql_fetch_lengths,% mysql_fetch_row,mysql_field_flags,mysql_field_name,% mysql_field_seek,mysql_field_table,mysql_field_type,% mysql_info,mysql_insert_id,mysql_list_dbs,mysql_list_fields,% mysql_list_tables,mysql_num_fields,mysql_num_rows,% mysql_ping,mysql_query,mysql_unbuffered_query,% mysql_result,mysql_select_db,mysql_tablename,mysql_thread_id,% mysql_get_host_info,mysql_get_proto_info,mysql_get_server_info,% %--- network functions checkdnsrr,closelog,debugger_off,debugger_on,% fsockopen,gethostbyaddr,gethostbyname,gethostbynamel,getmxrr,% getprotobynumber,getservbyname,getservbyport,ip2long,long2ip,% pfsockopen,socket_get_status,socket_set_blocking,% syslog,% %--- nis functions yp_get_default_domain,yp_order,yp_master,yp_match,yp_first,% yp_errno,yp_err_string,yp_all,yp_cat,% %--- oci8 functions OCIDefineByName,OCIBindByName,OCILogon,OCIPLogon,OCINLogon,% OCIExecute,OCICommit,OCIRollback,OCINewDescriptor,OCIRowCount,% OCIResult,OCIFetch,OCIFetchInto,OCIFetchStatement,% OCIColumnName,OCIColumnSize,OCIColumnType,OCIServerVersion,% OCINewCursor,OCIFreeStatement,OCIFreeCursor,OCIFreeDesc,% OCIError,OCIInternalDebug,OCICancel,OCISetPrefetch,% OCISaveLobFile,OCISaveLob,OCILoadLob,OCIColumnScale,% OCIColumnTypeRaw,OCINewCollection,OCIFreeCollection,% OCICollAppend,OCICollAssignElem,OCICollGetElem,OCICollMax,% OCICollTrim,% %--- oracle functions Ora_Bind,Ora_Close,Ora_ColumnName,Ora_ColumnSize,Ora_ColumnType,% Ora_CommitOff,Ora_CommitOn,Ora_Do,Ora_Error,Ora_ErrorCode,% Ora_Fetch,Ora_Fetch_Into,Ora_GetColumn,Ora_Logoff,Ora_Logon,% Ora_Numcols,Ora_Numrows,Ora_Open,Ora_Parse,Ora_Rollback,% %--- outcontrol functions flush,ob_start,ob_get_contents,ob_get_length,ob_get_level,% ob_flush,ob_clean,ob_end_flush,ob_end_clean,ob_implicit_flush,% %--- ovrimos functions ovrimos_connect,ovrimos_close,ovrimos_longreadlen,% ovrimos_execute,ovrimos_cursor,ovrimos_exec,ovrimos_fetch_into,% ovrimos_result,ovrimos_result_all,ovrimos_num_rows,% ovrimos_field_name,ovrimos_field_type,ovrimos_field_len,% ovrimos_free_result,ovrimos_commit,ovrimos_rollback,% %--- pcntl functions pcntl_fork,pcntl_signal,pcntl_waitpid,pcntl_wexitstatus,% pcntl_wifsignaled,pcntl_wifstopped,pcntl_wstopsig,% pcntl_exec,% %--- pcre functions preg_match,preg_match_all,preg_replace,preg_replace_callback,% preg_quote,preg_grep,Pattern Modifiers,Pattern Syntax,% %--- pdf functions pdf_add_annotation,pdf_add_bookmark,pdf_add_launchlink,% pdf_add_note,pdf_add_outline,pdf_add_pdflink,pdf_add_thumbnail,% pdf_arc,pdf_arcn,pdf_attach_file,pdf_begin_page,% pdf_begin_template,pdf_circle,pdf_clip,pdf_close,pdf_closepath,% pdf_closepath_stroke,pdf_close_image,pdf_close_pdi,% pdf_concat,pdf_continue_text,pdf_curveto,pdf_delete,% pdf_endpath,pdf_end_pattern,pdf_end_template,pdf_fill,% pdf_findfont,pdf_get_buffer,pdf_get_font,pdf_get_fontname,% pdf_get_image_height,pdf_get_image_width,pdf_get_parameter,% pdf_get_pdi_value,pdf_get_majorversion,pdf_get_minorversion,% pdf_initgraphics,pdf_lineto,pdf_makespotcolor,pdf_moveto,% pdf_open,pdf_open_CCITT,pdf_open_file,pdf_open_gif,% pdf_open_image_file,pdf_open_jpeg,pdf_open_memory_image,% pdf_open_pdi_page,pdf_open_png,pdf_open_tiff,pdf_place_image,% pdf_rect,pdf_restore,pdf_rotate,pdf_save,pdf_scale,pdf_setcolor,% pdf_setflat,pdf_setfont,pdf_setgray,pdf_setgray_fill,% pdf_setlinecap,pdf_setlinejoin,pdf_setlinewidth,pdf_setmatrix,% pdf_setpolydash,pdf_setrgbcolor,pdf_setrgbcolor_fill,% pdf_set_border_color,pdf_set_border_dash,pdf_set_border_style,% pdf_set_duration,pdf_set_font,pdf_set_horiz_scaling,% pdf_set_info_author,pdf_set_info_creator,pdf_set_info_keywords,% pdf_set_info_title,pdf_set_leading,pdf_set_parameter,% pdf_set_text_rendering,pdf_set_text_rise,pdf_set_text_matrix,% pdf_set_word_spacing,pdf_show,pdf_show_boxed,pdf_show_xy,% pdf_stringwidth,pdf_stroke,pdf_translate,% %--- pfpro functions pfpro_init,pfpro_cleanup,pfpro_process,pfpro_process_raw,% %--- pgsql functions pg_close,pg_affected_rows,pg_connect,pg_dbname,pg_end_copy,% pg_query,pg_fetch_array,pg_fetch_object,pg_fetch_row,% pg_field_name,pg_field_num,pg_field_prtlen,pg_field_size,% pg_free_result,pg_last_oid,pg_host,pg_last_notice,pg_lo_close,% pg_lo_export,pg_lo_import,pg_lo_open,pg_lo_read,pg_lo_seek,% pg_lo_read_all,pg_lo_unlink,pg_lo_write,pg_num_fields,% pg_options,pg_pconnect,pg_port,pg_put_line,pg_fetch_result,% pg_client_encoding,pg_trace,pg_tty,pg_untrace,pg_get_result,% pg_send_query,pg_cancel_query,pg_connection_busy,% pg_connection_status,pg_copy_from,pg_copy_to,pg_escape_bytea,% pg_result_error,% %--- posix functions posix_kill,posix_getpid,posix_getppid,posix_getuid,% posix_getgid,posix_getegid,posix_setuid,posix_seteuid,% posix_setegid,posix_getgroups,posix_getlogin,posix_getpgrp,% posix_setpgid,posix_getpgid,posix_getsid,posix_uname,% posix_ctermid,posix_ttyname,posix_isatty,posix_getcwd,% posix_getgrnam,posix_getgrgid,posix_getpwnam,posix_getpwuid,% %--- printer functions printer_open,printer_abort,printer_close,printer_write,% printer_set_option,printer_get_option,printer_create_dc,% printer_start_doc,printer_end_doc,printer_start_page,% printer_create_pen,printer_delete_pen,printer_select_pen,% printer_delete_brush,printer_select_brush,printer_create_font,% printer_select_font,printer_logical_fontheight,% printer_draw_rectangle,printer_draw_elipse,printer_draw_text,% printer_draw_chord,printer_draw_pie,printer_draw_bmp,% %--- pspell functions pspell_add_to_personal,pspell_add_to_session,pspell_check,% pspell_config_create,pspell_config_ignore,pspell_config_mode,% pspell_config_repl,pspell_config_runtogether,% pspell_new,pspell_new_config,pspell_new_personal,% pspell_store_replacement,pspell_suggest,% %--- qtdom functions qdom_tree,qdom_error,% %--- readline functions readline,readline_add_history,readline_clear_history,% readline_info,readline_list_history,readline_read_history,% %--- recode functions recode_string,recode,recode_file,% %--- regex functions ereg,ereg_replace,eregi,eregi_replace,split,spliti,sql_regcase,% %--- sem functions sem_get,sem_acquire,sem_release,sem_remove,shm_attach,% shm_remove,shm_put_var,shm_get_var,shm_remove_var,ftok,% %--- sesam functions sesam_connect,sesam_disconnect,sesam_settransaction,% sesam_rollback,sesam_execimm,sesam_query,sesam_num_fields,% sesam_diagnostic,sesam_fetch_result,sesam_affected_rows,% sesam_field_array,sesam_fetch_row,sesam_fetch_array,% sesam_free_result,% %--- session functions session_start,session_destroy,session_name,session_module_name,% session_id,session_register,session_unregister,session_unset,% session_get_cookie_params,session_set_cookie_params,% session_encode,session_set_save_handler,session_cache_limiter,% session_write_close,% %--- shmop functions shmop_open,shmop_read,shmop_write,shmop_size,shmop_delete,% %--- snmp functions snmpget,snmpset,snmpwalk,snmpwalkoid,snmp_get_quick_print,% snmprealwalk,% %--- strings functions addcslashes,addslashes,bin2hex,chop,chr,chunk_split,% count_chars,crc32,crypt,echo,explode,get_html_translation_table,% hebrev,hebrevc,htmlentities,htmlspecialchars,implode,join,% localeconv,ltrim,md5,md5_file,metaphone,nl_langinfo,nl2br,ord,% print,printf,quoted_printable_decode,quotemeta,str_rot13,rtrim,% setlocale,similar_text,soundex,sprintf,strncasecmp,strcasecmp,% strcmp,strcoll,strcspn,strip_tags,stripcslashes,stripslashes,% strlen,strnatcmp,strnatcasecmp,strncmp,str_pad,strpos,strrchr,% strrev,strrpos,strspn,strstr,strtok,strtolower,strtoupper,% strtr,substr,substr_count,substr_replace,trim,ucfirst,ucwords,% vsprintf,wordwrap,% %--- swf functions swf_openfile,swf_closefile,swf_labelframe,swf_showframe,% swf_getframe,swf_mulcolor,swf_addcolor,swf_placeobject,% swf_removeobject,swf_nextid,swf_startdoaction,% swf_actiongeturl,swf_actionnextframe,swf_actionprevframe,% swf_actionstop,swf_actiontogglequality,swf_actionwaitforframe,% swf_actiongotolabel,swf_enddoaction,swf_defineline,% swf_definepoly,swf_startshape,swf_shapelinesolid,% swf_shapefillsolid,swf_shapefillbitmapclip,% swf_shapemoveto,swf_shapelineto,swf_shapecurveto,% swf_shapearc,swf_endshape,swf_definefont,swf_setfont,% swf_fontslant,swf_fonttracking,swf_getfontinfo,swf_definetext,% swf_definebitmap,swf_getbitmapinfo,swf_startsymbol,% swf_startbutton,swf_addbuttonrecord,swf_oncondition,% swf_viewport,swf_ortho,swf_ortho2,swf_perspective,swf_polarview,% swf_pushmatrix,swf_popmatrix,swf_scale,swf_translate,swf_rotate,% %--- sybase functions sybase_affected_rows,sybase_close,sybase_connect,% sybase_fetch_array,sybase_fetch_field,sybase_fetch_object,% sybase_field_seek,sybase_free_result,sybase_get_last_message,% sybase_min_error_severity,sybase_min_message_severity,% sybase_num_fields,sybase_num_rows,sybase_pconnect,sybase_query,% sybase_select_db,% %--- uodbc functions odbc_autocommit,odbc_binmode,odbc_close,odbc_close_all,% odbc_connect,odbc_cursor,odbc_do,odbc_error,odbc_errormsg,% odbc_execute,odbc_fetch_into,odbc_fetch_row,odbc_fetch_array,% odbc_fetch_object,odbc_field_name,odbc_field_num,% odbc_field_len,odbc_field_precision,odbc_field_scale,% odbc_longreadlen,odbc_num_fields,odbc_pconnect,odbc_prepare,% odbc_result,odbc_result_all,odbc_rollback,odbc_setoption,% odbc_tableprivileges,odbc_columns,odbc_columnprivileges,% odbc_primarykeys,odbc_foreignkeys,odbc_procedures,% odbc_specialcolumns,odbc_statistics,% %--- url functions base64_decode,base64_encode,parse_url,rawurldecode,rawurlencode,% urlencode,% %--- var functions doubleval,empty,floatval,gettype,get_defined_vars,% import_request_variables,intval,is_array,is_bool,is_double,% is_int,is_integer,is_long,is_null,is_numeric,is_object,is_real,% is_scalar,is_string,isset,print_r,serialize,settype,strval,% unset,var_dump,var_export,is_callable,% %--- vpopmail functions vpopmail_add_domain,vpopmail_del_domain,% vpopmail_add_domain_ex,vpopmail_del_domain_ex,% vpopmail_add_user,vpopmail_del_user,vpopmail_passwd,% vpopmail_auth_user,vpopmail_alias_add,vpopmail_alias_del,% vpopmail_alias_get,vpopmail_alias_get_all,vpopmail_error,% %--- w32api functions w32api_set_call_method,w32api_register_function,% w32api_deftype,w32api_init_dtype,% %--- wddx functions wddx_serialize_value,wddx_serialize_vars,wddx_packet_start,% wddx_add_vars,wddx_deserialize,% %--- xml functions xml_parser_create,xml_set_object,xml_set_element_handler,% xml_set_processing_instruction_handler,xml_set_default_handler,% xml_set_notation_decl_handler,% xml_parse,xml_get_error_code,xml_error_string,% xml_get_current_column_number,xml_get_current_byte_index,% xml_parser_free,xml_parser_set_option,xml_parser_get_option,% utf8_encode,xml_parser_create_ns,% xml_set_start_namespace_decl_handler,% %--- xslt functions xslt_set_log,xslt_create,xslt_errno,xslt_error,xslt_free,% xslt_set_sax_handler,xslt_set_scheme_handler,% xslt_set_base,xslt_set_encoding,xslt_set_sax_handlers,% %--- yaz functions yaz_addinfo,yaz_close,yaz_connect,yaz_errno,yaz_error,yaz_hits,% yaz_database,yaz_range,yaz_record,yaz_search,yaz_present,% yaz_scan,yaz_scan_result,yaz_ccl_conf,yaz_ccl_parse,% yaz_wait,yaz_sort,% %--- zip functions zip_close,zip_entry_close,zip_entry_compressedsize,% zip_entry_filesize,zip_entry_name,zip_entry_open,zip_entry_read,% zip_read,% %--- zlib functions gzclose,gzeof,gzfile,gzgetc,gzgets,gzgetss,gzopen,gzpassthru,% gzread,gzrewind,gzseek,gztell,gzwrite,readgzfile,gzcompress,% gzdeflate,gzinflate,gzencode,},% sensitive,% morecomment=[l]\#,% morecomment=[l]//,% morecomment=[s]{/*}{*/},% morestring=[b]",% morestring=[b]'% }[keywords,comments,strings]% %% %% Prolog definition (c) 1997 Dominique de Waleffe %% \lst@definelanguage{Prolog}% {morekeywords={op,mod,abort,ancestors,arg,ascii,ask,assert,asserta,% assertz,atom,atomic,char,clause,close,concat,consult,ed,ef,em,% eof,fail,file,findall,write,functor,getc,integer,is,length,% listing,load,name,nl,nonvar,not,numbervars,op,or,pp,prin,print,% private,prompt,putc,ratom,read,read_from_this_file,rename,repeat,% retract,retractall,save,see,seeing,seen,sh,skip,statistics,% subgoal_of,system,tab,tell,telling,time,told,trace,true,unload,% untrace,var,write},% sensitive=f,% morecomment=[l]\%,% morecomment=[s]{/*}{*/},% morestring=[bd]",% morestring=[bd]'% }[keywords,comments,strings]% %% %% classic rexx listings definition %% by Patrick TJ McPhee %% \lst@definelanguage{Rexx} {morekeywords={address,arg,call,do,drop,else,end,exit,if,iterate,% interpret,leave,nop,numeric,options,otherwise,parse,% procedure,pull,push,queue,return,say,signal,then,to,% trace,when},% sensitive=false,% morecomment=[n]{/*}{*/},% morestring=[d]{'},% morestring=[d]{"},% }[keywords,comments,strings]% \lst@definelanguage{Ruby}% {morekeywords={__FILE__,__LINE__,BEGIN,END,alias,and,begin,break,% case,class,def,defined?,do,else,elsif,end,ensure,false,for,% if,in,module,next,nil,not,or,redo,rescue,retry,return,self,% super,then,true,undef,unless,until,when,while,yield},% sensitive=true,% morecomment=[l]\#,% morecomment=[l]\#\#,% morecomment=[s]{=BEGIN}{=END},% morestring=[b]',% morestring=[b]",% morestring=[s]{\%q/}{/},% morestring=[s]{\%q!}{!},% morestring=[s]{\%q\{}{\}},% morestring=[s]{\%q(}{)},% morestring=[s]{\%q[}{]},% morestring=[s]{\%q-}{-},% morestring=[s]{\%Q/}{/},% morestring=[s]{\%Q!}{!},% morestring=[s]{\%Q\{}{\}},% morestring=[s]{\%Q(}{)},% morestring=[s]{\%Q[}{]},% morestring=[s]{\%Q-}{-}% }[keywords,comments,strings]% %% %% SHELXL definition (c) 1999 Aidan Philip Heerdegen %% \lst@definelanguage{SHELXL}% {morekeywords={TITL,CELL,ZERR,LATT,SYMM,SFAC,DISP,UNIT,LAUE,% REM,MORE,TIME,END,HKLF,OMIT,SHEL,BASF,TWIN,EXTI,SWAT,% MERG,SPEC,RESI,MOVE,ANIS,AFIX,HFIX,FRAG,FEND,EXYZ,EADP,% EQIV,OMIT,CONN,PART,BIND,FREE,DFIX,BUMP,SAME,SADI,CHIV,% FLAT,DELU,SIMU,DEFS,ISOR,SUMP,L.S.,CGLS,SLIM,BLOC,DAMP,% WGHT,FVAR,BOND,CONF,MPLA,RTAB,LIST,ACTA,SIZE,TEMP,WPDB,% FMAP,GRID,PLAN,MOLE},% sensitive=false,% alsoother=_,% Makes the syntax highlighting ignore the underscores morecomment=[l]{! },% }% %% %% Tcl/Tk definition (c) Gerd Neugebauer %% \lst@definelanguage[tk]{tcl}[]{tcl}% {morekeywords={activate,add,separator,radiobutton,checkbutton,% command,cascade,all,bell,bind,bindtags,button,canvas,canvasx,% canvasy,cascade,cget,checkbutton,config,configu,configur,% configure,clipboard,create,arc,bitmap,image,line,oval,polygon,% rectangle,text,textwindow,curselection,delete,destroy,end,entry,% entrycget,event,focus,font,actual,families,measure,metrics,names,% frame,get,grab,current,release,status,grid,columnconfigure,% rowconfigure,image,image,create,bitmap,photo,delete,height,types,% widt,names,index,insert,invoke,itemconfigure,label,listbox,lower,% menu,menubutton,message,move,option,add,clear,get,readfile,pack,% photo,place,radiobutton,raise,scale,scroll,scrollbar,search,see,% selection,send,stdin,stdout,stderr,tag,bind,text,tk,tkerror,% tkwait,window,variable,visibility,toplevel,unknown,update,winfo,% class,exists,ismapped,parent,reqwidth,reqheight,rootx,rooty,% width,height,wm,aspect,client,command,deiconify,focusmodel,frame,% geometry,group,iconbitmap,iconify,iconmask,iconname,iconposition,% iconwindow,maxsize,minsize,overrideredirect,positionfrom,% protocol,sizefrom,state,title,transient,withdraw,xview,yview,% yposition,% -accelerator,-activebackground,-activeborderwidth,% -activeforeground,-after,-anchor,-arrow,-arrowshape,-aspect,% -async,-background,-before,-bg,-bigincrement,-bitmap,-bordermode,% -borderwidth,-button,-capstyle,-channel,-class,-closeenough,% -colormap,-column,-columnspan,-command,-confine,-container,% -count,-cursor,-data,-default,-detail,-digits,-direction,% -displayof,-disableforeground,-elementborderwidth,-expand,% -exportselection,-extend,-family,-fg,-file,-fill,-focus,-font,% -fontmap,-foreground,-format,-from,-gamma,-global,-height,% -highlightbackground,-highlightcolor,-highlightthickness,-icon,% -image,-in,-insertbackground,-insertborderwidth,-insertofftime,% -insertontime,-imsertwidth,-ipadx,-ipady,-joinstyle,-jump,% -justify,-keycode,-keysym,-label,-lastfor,-length,-maskdata,% -maskfile,-menu,-message,-mode,-offvalue,-onvalue,-orient,% -outlien,-outlinestipple,-overstrike,-override,-padx,-pady,% -pageanchor,-pageheight,-pagewidth,-pagey,-pagey,-palette,% -parent,-place,-postcommand,-relheight,-relief,-relwidth,-relx,% -rely,-repeatdelay,-repeatinterval,-resolution,-root,-rootx,% -rooty,-rotate,-row,-rowspan,-screen,-selectcolor,-selectimage,% -sendevent,-serial,-setgrid,-showvalue,-shrink,-side,-size,% -slant,-sliderlength,-sliderrelief,-smooth,-splinesteps,-state,% -sticky,-stipple,-style,-subsample,-subwindow,-tags,-takefocus,% -tearoff,-tearoffcommand,-text,-textvariable,-tickinterval,-time,% -title,-to,-troughcolor,-type,-underline,-use,-value,-variable,% -visual,-width,-wrap,-wraplength,-x,-xscrollcommand,-y,% -bgstipple,-fgstipple,-lmargin1,-lmargin2,-rmargin,-spacing1,% -spacing2,-spacing3,-tabs,-yscrollcommand,-zoom,% activate,add,addtag,bbox,cget,clone,configure,coords,% curselection,debug,delete,delta,deselect,dlineinfo,dtag,dump,% entrycget,entryconfigure,find,flash,fraction,get,gettags,handle,% icursor,identify,index,insert,invoke,itemcget,itemconfigure,mark,% moveto,own,post,postcascade,postscript,put,redither,ranges,% scale,select,show,tag,type,unpost,xscrollcommand,xview,% yscrollcommand,yview,yposition}% }% \lst@definelanguage[]{tcl}% {alsoletter={.:,*=&-},% morekeywords={after,append,array,names,exists,anymore,donesearch,% get,nextelement,set,size,startsearch,auto_mkindex,binary,break,% case,catch,cd,clock,close,concat,console,continue,default,else,% elseif,eof,error,eval,exec,-keepnewline,exit,expr,fblocked,% fconfigure,fcopy,file,atime,dirname,executable,exists,extension,% isdirectory,isfile,join,lstat,mtime,owned,readable,readlink,% rootname,size,stat,tail,type,writable,-permissions,-group,-owner,% -archive,-hidden,-readonly,-system,-creator,-type,-force,% fileevent,flush,for,foreach,format,gets,glob,global,history,if,% incr,info,argsbody,cmdcount,commands,complete,default,exists,% globals,level,library,locals,patchlevel,procs,script,tclversion,% vars,interp,join,lappend,lindex,linsert,list,llength,lrange,% lreplace,lsearch,-exact,-regexp,-glob,lsort,-ascii,-integer,% -real,-dictionary,-increasing,-decreasing,-index,-command,load,% namespace,open,package,forget,ifneeded,provide,require,unknown,% vcompare,versions,vsatisfies,pid,proc,puts,-nonewline,pwd,read,% regexp,-indices,regsub,-all,-nocaserename,return,scan,seek,set,% socket,source,split,string,compare,first,index,last,length,match,% range,tolower,toupper,trim,trimleft,trimright,subst,switch,tell,% time,trace,variable,vdelete,vinfo,unknown,unset,uplevel,upvar,% vwait,while,acos,asin,atan,atan2,ceil,cos,cosh,exp,floor,fmod,% hypot,log,log10,pow,sin,sinh,sqrt,tan,tanh,abs,double,int,round% },% morestring=[d]",% morecomment=[f]\#,% morecomment=[l]{;\#},% morecomment=[l]{[\#},% morecomment=[l]{\{\#}% }[keywords,comments,strings]% %% %% VBScript definition (c) 2000 Sonja Weidmann %% \lst@definelanguage{VBScript}% {morekeywords={Call,Case,Const,Dim,Do,Each,Else,End,Erase,Error,Exit,% Explicit,For,Function,If,Loop,Next,On,Option,Private,Public,% Randomize,ReDim,Rem,Select,Set,Sub,Then,Wend,While,Abs,Array,Asc,% Atn,CBool,CByte,CCur,CDate,CDbl,Chr,CInt,CLng,Cos,CreateObject,% CSng,CStr,Date,DateAdd,DateDiff,DatePart,DateSerial,DateValue,% Day,Exp,Filter,Fix,FormatCurrency,FormatDateTime,FormatNumber,% FormatPercent,GetObject,Hex,Hour,InputBox,InStr,InStrRev,Int,% IsArray,IsDate,IsEmpty,IsNull,IsNumeric,IsObject,Join,LBound,% LCase,Left,Len,LoadPicture,Log,LTrim,Mid,Minute,Month,MonthName,% MsgBox,Now,Oct,Replace,RGB,Right,Rnd,Round,RTrim,ScriptEngine,% ScriptEngineBuildVersion,ScriptEngineMajorVersion,% ScriptEngineMinorVersion,Second,Sgn,Sin,Space,Split,Sqr,StrComp,% StrReverse,String,Tan,Time,TimeSerial,TimeValue,Trim,TypeName,% UBound,UCase,VarType,Weekday,WeekdayName,Year, And,Eqv,Imp,Is,% Mod,Not,Or,Xor,Add,BuildPath,Clear,Close,Copy,CopyFile,% CopyFolder,CreateFolder,CreateTextFile,Delete,DeleteFile,% DeleteFolder,Dictionary,Drive,DriveExists,Drives,Err,Exists,File,% FileExists,FileSystemObject,Files,Folder,FolderExists,Folders,% GetAbsolutePathName,GetBaseName,GetDrive,GetDriveName,% GetExtensionName,GetFile,GetFileName,GetFolder,% GetParentFolderName,GetSpecialFolder,GetTempName,Items,Keys,Move,% MoveFile,MoveFolder,OpenAsTextStream,OpenTextFile,Raise,Read,% ReadAll,ReadLine,Remove,RemoveAll,Skip,SkipLine,TextStream,Write,% WriteBlankLines,WriteLine,Alias,Archive,CDROM,Compressed,% Directory,Fixed,ForAppending,ForReading,ForWriting,Hidden,Normal,% RAMDisk,ReadOnly,Remote,Removable,System,SystemFolder,% TemporaryFolder,TristateFalse,TristateTrue,TristateUseDefault,% Unknown,Volume,WindowsFolder,vbAbortRetryIgnore,% vbApplicationModal,vbArray,vbBinaryCompare,vbBlack,vbBlue,% vbBoolean,vbByte,vbCr,vbCrLf,vbCritical,vbCurrency,vbCyan,% vbDataObject,vbDate,vbDecimal,vbDefaultButton1,vbDefaultButton2,% vbDefaultButton3,vbDefaultButton4,vbDouble,vbEmpty,vbError,% vbExclamation,vbFirstFourDays,vbFirstFullWeek,vbFirstJan1,% vbFormFeed,vbFriday,vbGeneralDate,vbGreen,vbInformation,% vbInteger,vbLf,vbLong,vbLongDate,vbLongTime,vbMagenta,vbMonday,% vbNewLine,vbNull,vbNullChar,vbNullString,vbOKC,ancel,vbOKOnly,% vbObject,vbObjectError,vbQuestion,vbRed,vbRetryCancel,vbSaturday,% vbShortDate,vbShortTime,vbSingle,vbString,vbSunday,vbSystemModal,% vbTab,vbTextCompare,vbThursday,vbTuesday,vbUseSystem,% vbUseSystemDayOfWeek,vbVariant,vbVerticalTab,vbWednesday,vbWhite,% vbYellow,vbYesNo,vbYesNoCancel},% sensitive=f,% morecomment=[l]',% morestring=[d]"% }[keywords,comments,strings]% %% %% VRML definition (c) 2001 Oliver Baum %% \lst@definelanguage[97]{VRML} {morekeywords={DEF,EXTERNPROTO,FALSE,IS,NULL,PROTO,ROUTE,TO,TRUE,USE,% eventIn,eventOut,exposedField,field,Introduction,Anchor,% Appearance,AudioClip,Background,Billboard,Box,Collision,Color,% ColorInterpolator,Cone,Coordinate,CoordinateInterpolator,% Cylinder,CylinderSensor,DirectionalLight,ElevationGrid,Extrusion,% Fog,FontStyle,Group,ImageTexture,IndexedFaceSet,IndexedLineSet,% Inline,LOD,Material,MovieTexture,NavigationInfo,Normal,% NormalInterpolator,OrientationInterpolator,PixelTexture,% PlaneSensor,PointLight,PointSet,PositionInterpolator,% ProximitySensor,ScalarInterpolator,Script,Shape,Sound,Sphere,% SphereSensor,SpotLight,Switch,Text,TextureCoordinate,% TextureTransform,TimeSensor,TouchSensor,Transform,Viewpoint,% VisibilitySensor,WorldInfo},% morecomment=[l]\#,% bug: starts comment in the first column morestring=[b]"% }[keywords,comments,strings] \endinput %% %% End of file `lstlang2.sty'. hevea-2.23/fmt_map.mll0000644004317100512160000000040110375147225014710 0ustar marangetcristal{ open Printf } rule line = parse | ('#' [^'\n']* '\n' | '\n') {line lexbuf } | [^'#''\n']+ as txt ('#' [^'\n']*) ? '\n' { printf "%s\n" txt ; line lexbuf } | eof { () } { let main () = line (Lexing.from_channel stdin) let _ = main () ; exit 0 } hevea-2.23/info.mli0000644004317100512160000000137111774606345014233 0ustar marangetcristal(***********************************************************************) (* *) (* HEVEA *) (* *) (* Luc Maranget, projet PARA, INRIA Rocquencourt *) (* *) (* Copyright 1998 Institut National de Recherche en Informatique et *) (* Automatique. Distributed only by permission. *) (* *) (***********************************************************************) include OutManager.S hevea-2.23/examples/0000755004317100512160000000000012477067043014406 5ustar marangetcristalhevea-2.23/examples/hevea.sty0000644004317100512160000000576212477065533016253 0ustar marangetcristal% hevea : hevea.sty % This is a very basic style file for latex document to be processed % with hevea. It contains definitions of LaTeX environment which are % processed in a special way by the translator. % Mostly : % - latexonly, not processed by hevea, processed by latex. % - htmlonly , the reverse. % - rawhtml, to include raw HTML in hevea output. % - toimage, to send text to the image file. % The package also provides hevea logos, html related commands (ahref % etc.), void cutting and image commands. \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{hevea}[2002/01/11] \RequirePackage{comment} \newif\ifhevea\heveafalse \@ifundefined{ifimagen}{\newif\ifimagen\imagenfalse} \makeatletter% \newcommand{\heveasmup}[2]{% \raise #1\hbox{$\m@th$% \csname S@\f@size\endcsname \fontsize\sf@size 0% \math@fontsfalse\selectfont #2% }}% \DeclareRobustCommand{\hevea}{H\kern-.15em\heveasmup{.2ex}{E}\kern-.15emV\kern-.15em\heveasmup{.2ex}{E}\kern-.15emA}% \DeclareRobustCommand{\hacha}{H\kern-.15em\heveasmup{.2ex}{A}\kern-.15emC\kern-.1em\heveasmup{.2ex}{H}\kern-.15emA}% \DeclareRobustCommand{\html}{\protect\heveasmup{0.ex}{HTML}} %%%%%%%%% Hyperlinks hevea style \newcommand{\ahref}[2]{{#2}} \newcommand{\ahrefloc}[2]{{#2}} \newcommand{\aname}[2]{{#2}} \newcommand{\ahrefurl}[1]{\texttt{#1}} \newcommand{\footahref}[2]{#2\footnote{\texttt{#1}}} \newcommand{\mailto}[1]{\texttt{#1}} \newcommand{\imgsrc}[2][]{} \newcommand{\home}[1]{\protect\raisebox{-.75ex}{\char126}#1} \AtBeginDocument {\@ifundefined{url} {%url package is not loaded \let\url\ahref\let\oneurl\ahrefurl\let\footurl\footahref} {}} %% Void cutting instructions \newcounter{cuttingdepth} \newcommand{\tocnumber}{} \newcommand{\notocnumber}{} \newcommand{\cuttingunit}{} \newcommand{\cutdef}[2][]{} \newcommand{\cuthere}[2]{} \newcommand{\cutend}{} \newcommand{\htmlhead}[1]{} \newcommand{\htmlfoot}[1]{} \newcommand{\htmlprefix}[1]{} \newenvironment{cutflow}[1]{}{} \newcommand{\cutname}[1]{} \newcommand{\toplinks}[3]{} \newcommand{\setlinkstext}[3]{} \newcommand{\flushdef}[1]{} \newcommand{\footnoteflush}[1]{} %%%% Html only \excludecomment{rawhtml} \newcommand{\rawhtmlinput}[1]{} \excludecomment{htmlonly} %%%% Latex only \newenvironment{latexonly}{}{} \newenvironment{verblatex}{}{} %%%% Image file stuff \def\toimage{\endgroup} \def\endtoimage{\begingroup\def\@currenvir{toimage}} \def\verbimage{\endgroup} \def\endverbimage{\begingroup\def\@currenvir{verbimage}} \newcommand{\imageflush}[1][]{} %%% Bgcolor definition \newsavebox{\@bgcolorbin} \newenvironment{bgcolor}[2][] {\newcommand{\@mycolor}{#2}\begin{lrbox}{\@bgcolorbin}\vbox\bgroup} {\egroup\end{lrbox}% \begin{flushleft}% \colorbox{\@mycolor}{\usebox{\@bgcolorbin}}% \end{flushleft}} %%% Style sheets macros, defined as no-ops \newcommand{\newstyle}[2]{} \newcommand{\addstyle}[1]{} \newcommand{\setenvclass}[2]{} \newcommand{\getenvclass}[1]{} \newcommand{\loadcssfile}[1]{} \newenvironment{divstyle}[1]{}{} \newenvironment{cellstyle}[2]{}{} \newif\ifexternalcss %%% Postlude \makeatother hevea-2.23/examples/sym.tex0000644004317100512160000010571212017660721015736 0ustar marangetcristal\documentclass{article} \@def@charset{UTF-8} \usepackage{latexsym} \usepackage{textcomp} \usepackage{amssymb} \usepackage{amsmath} \usepackage{st} \title{Selected extracts from the ``Comprehensive \LaTeX{} symbol list''} \author{} \date{} \begin{document}\maketitle \section*{Introduction} This file consists in extracts of the \ahref{http://www.ctan.org/tex-archive/info/symbols/comprehensive/} {Comprehensive list of \LaTeX{} symbols}. Il also serves as a test of UTF-8 output encoding. \section{Body-text symbols} \begin{symtable}{\latexE{} Escapable ``Special'' Characters} \index{special characters=``special'' characters} \index{escapable characters} \label{special-escapable} \begin{tabular}{*6{ll@{\qqquad}}ll} \K\$ & \K\% & \K\_$\,^*$ & \Kp\} & \K\& & \K\# & \Kp\{ \\ \end{tabular} \bigskip \begin{tablenote}[*] The \pkgname{underscore} package redefines ``\verb+_+'' to produce an underscore in text mode (i.e.,~it makes it unnecessary to escape the underscore character). \end{tablenote} \end{symtable} \begin{symtable}{Predefined \latexE{} Text-mode Commands} \index{space, visible} \index{inequalities} \index{tilde} \index{copyright} \idxboth{legal}{symbols} \label{text-predef} \begin{tabular}{lll@{\qqquad}lll} \V\textasciicircum & \V\textless \\ \V\textasciitilde & \V[\ltextordfeminine]\textordfeminine \\ \V\textasteriskcentered & \V[\ltextordmasculine]\textordmasculine \\ \V\textbackslash & \V\textparagraph$^*$ \\ \V\textbar & \V\textperiodcentered \\ \V\textbraceleft$^*$ & \V\textquestiondown \\ \V\textbraceright$^*$ & \V\textquotedblleft \\ \V\textbullet & \V\textquotedblright \\ \V[\ltextcopyright]\textcopyright$^*$ & \V\textquoteleft \\ \V\textdagger$^*$ & \V\textquoteright \\ \V\textdaggerdbl$^*$ & \V[\ltextregistered]\textregistered \\ \V\textdollar$^*$ & \V\textsection$^*$ \\ \V\textellipsis$^*$ & \V\textsterling$^*$ \\ \V\textemdash & \V[\ltexttrademark]\texttrademark \\ \V\textendash & \V\textunderscore$^*$ \\ \V\textexclamdown & \V\textvisiblespace \\ \V\textgreater \\ \end{tabular} \bigskip \twosymbolmessage \bigskip \usetextmathmessage[*] \end{symtable} \begin{symtable}{\latexE{} Commands Defined to Work in Both Math and Text Mode} \index{dots (ellipses)} \index{ellipses (dots)} \index{copyright} \idxboth{legal}{symbols} \label{math-text} \begin{tabular}{*3{lll@{\qqquad}}lll} \V\$ & \V\_ & \V\ddag & \Vp\{ \\ \V\P & \V[\ltextcopyright]\copyright & \V\dots & \Vp\} \\ \V\S & \V\dag & \V\pounds \\ \end{tabular} \bigskip \twosymbolmessage \end{symtable} \begin{symtable}{Non-ASCII Letters (Excluding Accented Letters)} \index{letters>non-ASCII}\index{ASCII} \label{non-ascii} \begin{tabular}{*4{ll@{\hspace*{3em}}}ll} \K\aa & \Ks\DH & \K\L & \K\o & \K\ss \\ \K\AA & \Ks\dh & \K\l & \K\O & \K\SS \\ \K\AE & \Ks\DJ & \Ks\NG & \K\OE & \Ks\TH \\ \K\ae & \Ks\dj & \Ks\ng & \K\oe & \Ks\th \\ \end{tabular} \bigskip \begin{tablenote}[*] Not available in the OT1 \fntenc[OT1]. Use the \pkgname{fontenc} package to select an alternate \fntenc[T1], such as T1. \end{tablenote} \end{symtable} \begin{symtable}{Punctuation Marks Not Found in OT1} \index{punctuation} \label{punc-no-OT1} \begin{tabular}{*8l} \Kt\guillemotleft & \Kt\guilsinglleft & \Kt\quotedblbase & \Kt\textquotedbl \\ \Kt\guillemotright & \Kt\guilsinglright & \Kt\quotesinglbase \\ \end{tabular} \bigskip \begin{tablenote} To get these symbols, use the \pkgname{fontenc} package to select an alternate \fntenc[T1], such as~T1. \end{tablenote} \end{symtable} \begin{symtable}{\TC\ Diacritics} \index{accents} \label{tc-accent-chars} \begin{tabular}{*3{ll}} \K\textacutedbl & \K\textasciicaron & \K\textasciimacron \\ \K\textasciiacute & \K\textasciidieresis & \K\textgravedbl \\ \K\textasciibreve & \K\textasciigrave \\ \end{tabular} \bigskip \begin{tablenote} The \TC\ package defines all of the above as ordinary characters, not as accents. \end{tablenote} \end{symtable} \begin{symtable}{\TC\ Currency Symbols} \idxboth{currency}{symbols} \idxboth{monetary}{symbols} \label{tc-currency} \begin{tabular}{*4{ll}} \K\textbaht & \K\textdollar$^*$ & \K\textguarani & \K\textwon \\ \K\textcent & \NK\textdollaroldstyle & \K\textlira & \K\textyen \\ \NK\textcentoldstyle & \K\textdong & \K\textnaira \\ \K\textcolonmonetary & \K\texteuro & \K\textpeso \\ \K\textcurrency & \K\textflorin & \K\textsterling$^*$ \\ \end{tabular} \bigskip \usetextmathmessage[*] \end{symtable} \begin{symtable}{\TC\ Legal Symbols} \index{copyright} \idxboth{legal}{symbols} \label{tc-legal} \begin{tabular}{*2{lll@{\qquad}}lll} \V\textcircledP & \V[\ltextcopyright]\textcopyright & \V\textservicemark \\ \NV\textcopyleft & \V[\ltextregistered]\textregistered & \V[\ltexttrademark]\texttrademark \\ \end{tabular} \bigskip \twosymbolmessage \medskip \begin{tablenote} \hspace*{15pt}% See \url{http://www.tex.ac.uk/cgi-bin/texfaq2html?label=tradesyms} for solutions to common problems that occur when using these symbols (e.g.,~getting a~``\textcircled{r}'' when you expected to get a~``\textregistered''). \end{tablenote} \end{symtable} \begin{symtable}{Miscellaneous \TC\ Symbols} \idxboth{musical}{symbols} \index{tilde} \label{tc-misc} \begin{tabular}{lll@{\qquad}lll} \V\textasteriskcentered & \V[\ltextordfeminine]\textordfeminine \\ \V\textbardbl & \V[\ltextordmasculine]\textordmasculine \\ \V\textbigcircle & \V\textparagraph$^*$ \\ \NV\textblank & \V\textperiodcentered \\ \V\textbrokenbar & \V\textpertenthousand \\ \V\textbullet & \V\textperthousand \\ \V\textdagger$^*$ & \V\textpilcrow \\ \V\textdaggerdbl$^*$ & \V\textquotesingle \\ \V\textdblhyphen & \NV\textquotestraightbase \\ \V\textdblhyphenchar & \NV\textquotestraightdblbase \\ \V\textdiscount & \V\textrecipe \\ \V\textestimated & \V\textreferencemark \\ \V\textinterrobang & \V\textsection$^*$ \\ \NV\textinterrobangdown & \NV\textthreequartersemdash \\ \V\textmusicalnote & \V\texttildelow \\ \V\textnumero & \NV\texttwelveudash \\ \V\textopenbullet \\ \end{tabular} \bigskip \twosymbolmessage \bigskip \usetextmathmessage[*] \end{symtable} \begin{symtable}{Text-mode Accents} \index{accents} \label{text-accents} \begin{tabular}{*3{ll@{\hspace*{3em}}}ll} \Q\" & \Q\` & \Q\d & \Q\r \\ \Q\' & \QivBAR\ddag & \Qiv\G\ddag & \NQ\t \\ \Q\. & \Q\~ & \Qv\h\S & \Q\u \\ \Q\= & \Q\b & \QQ{\H}{O}{o} & \Qiv\U\ddag \\ \Q\^ & \QQ{\c}Cc & \Qt\k$^\dag$ & \Q\v \\ \end{tabular} \par\medskip \begin{tabular}{ll@{\hspace*{3em}}ll} \NQ\newtie$^*$ & \Qc\textcircled \end{tabular} \bigskip \begin{tablenote}[*] Requires the \TC\ package. \end{tablenote} \medskip \begin{tablenote}[\dag] Not available in the OT1 \fntenc[OT1]. Use the \pkgname{fontenc} package to select an alternate \fntenc[T1], such as T1. \end{tablenote} \medskip \begin{tablenote}[\ddag] Requires the T4 \fntenc[T4], provided by the \FC\ package. \end{tablenote} \medskip \begin{tablenote}[\S] Requires the T5 \fntenc[T5], provided by the \VIET\ package. \end{tablenote} \bigskip \begin{tablenote} \index{dotless i=dotless $i~(\imath)$>text mode} \index{dotless j=dotless $j~(\jmath)$>text mode} Also note the existence of \cmdI{\i} and \cmdI{\j}, which produce dotless versions of ``i'' and ``j'' (viz., ``\i'' and ``\j''). These are useful when the accent is supposed to replace the dot. For example, ``\verb|na\"{\i}ve|'' produces a correct ``na\"{\i}ve'', while ``\verb|na\"{i}ve|'' would yield the rather odd-looking ``na\"{i}ve''. (``\verb|na\"{i}ve|'' \emph{does} work in encodings other than OT1, however.) \end{tablenote} \end{symtable} \section{Symbols for maths} \begin{symtable}{Math-Mode Versions of Text Symbols} \index{math-text} \begin{tabular}{*3{ll}} \X\mathdollar & \X\mathparagraph & \X\mathsterling \\ \X\mathellipsis & \X\mathsection & \X\mathunderscore \\ \end{tabular} \bigskip \usetextmathmessage \end{symtable} \begin{symtable}{Binary Operators} \idxboth{binary}{operators} \index{division} \label{bin} \begin{tabular}{*4{ll}} \X\amalg & \X\cup & \X\oplus & \X\times \\ \X\ast & \X\dagger & \X\oslash & \X\triangleleft \\ \X\bigcirc & \X\ddagger & \X\otimes & \X\triangleright \\ \X\bigtriangledown & \X\diamond & \X\pm & \X\unlhd$^*$ \\ \X\bigtriangleup & \X\div & \X\rhd$^*$ & \X\unrhd$^*$ \\ \X\bullet & \X\lhd$^*$ & \X\setminus & \X\uplus \\ \X\cap & \X\mp & \X\sqcap & \X\vee \\ \X\cdot & \X\odot & \X\sqcup & \X\wedge \\ \X\circ & \X\ominus & \X\star & \X\wr \\ \end{tabular} \bigskip \notpredefinedmessage \end{symtable} \begin{symtable}{Variable-sized Math Operators} \idxboth{variable-sized}{symbols} \index{integrals} \label{op} \renewcommand{\arraystretch}{1.75} % Keep tall symbols from touching. \begin{tabular}{*3{l@{$\:$}ll@{\qquad}}l@{$\:$}ll} \R\bigcap & \R\bigotimes & \R\bigwedge & \R\prod \\ \R\bigcup & \R\bigsqcup & \R\coprod & \R\sum \\ \R\bigodot & \R\biguplus & \R\int \\ \R\bigoplus & \R\bigvee & \R\oint \\ \end{tabular} \end{symtable} \begin{symtable}{Binary Relations} \idxboth{relational}{symbols} \index{tacks} \label{rel} \begin{tabular}{*4{ll}} \X\approx & \X\equiv & \X\perp & \X\smile \\ \X\asymp & \X\frown & \X\prec & \X\succ \\ \X\bowtie & \X\Join$^*$ & \X\preceq & \X\succeq \\ \X\cong & \X\mid & \X\propto & \X\vdash \\ \X\dashv & \X\models & \X\sim \\ \X\doteq & \X\parallel & \X\simeq \\ \end{tabular} \bigskip \notpredefinedmessageABX \end{symtable} \begin{symtable}{Subset and Superset Relations} \index{binary relations} \index{relational symbols>binary} \index{subsets} \index{supersets} \index{symbols>subset and superset} \label{subsets} \begin{tabular}{*3{ll}} \X\sqsubset$^*$ & \X\sqsupseteq & \X\supset \\ \X\sqsubseteq & \X\subset & \X\supseteq \\ \X\sqsupset$^*$ & \X\subseteq \\ \end{tabular} \bigskip \notpredefinedmessageABX \end{symtable} \begin{symtable}{Inequalities} \index{binary relations}\index{relational symbols>binary} \index{inequalities} \label{inequal-rel} \begin{tabular}{*5{ll}} \X\geq & \X\gg & \X\leq & \X\ll & \X\neq \\ \end{tabular} \end{symtable} \begin{symtable}{Arrows} \index{arrows} \label{arrow} \begin{tabular}{*3{ll}} \X\Downarrow & \X\longleftarrow & \X\nwarrow \\ \X\downarrow & \X\Longleftarrow & \X\Rightarrow \\ \X\hookleftarrow & \X\longleftrightarrow & \X\rightarrow \\ \X\hookrightarrow & \X\Longleftrightarrow & \X\searrow \\ \X\leadsto$^*$ & \X\longmapsto & \X\swarrow \\ \X\leftarrow & \X\Longrightarrow & \X\uparrow \\ \X\Leftarrow & \X\longrightarrow & \X\Uparrow \\ \X\Leftrightarrow & \X\mapsto & \X\updownarrow \\ \X\leftrightarrow & \X\nearrow$^\dag$ & \X\Updownarrow \\ \end{tabular} \bigskip \notpredefinedmessage \bigskip \begin{tablenote}[\dag] See the note beneath Table~\ref{extensible-accents} for information about how to put a diagonal arrow across a mathematical expression% \ifhavecancel ~(as in ``$\cancelto{0}{\nabla \cdot \vec{B}}\quad$'') \fi . \end{tablenote} \end{symtable} \begin{symtable}{Harpoons} \index{harpoons} \label{harpoons} \begin{tabular}{*3{ll}} \X\leftharpoondown & \X\rightharpoondown & \X\rightleftharpoons \\ \X\leftharpoonup & \X\rightharpoonup \\ \end{tabular} \end{symtable} \begin{symtable}{Extension Characters} \index{extension characters} \label{ext} \begin{tabular}{*2{ll}} \X\relbar & \X\Relbar \\ \end{tabular} \end{symtable} \begin{symtable}{Log-like Symbols} \idxboth{log-like}{symbols} \index{atomic math objects} \index{limits} \label{log} \begin{tabular}{*8l} \Z\arccos & \Z\cos & \Z\csc & \Z\exp & \Z\ker & \Z\limsup & \Z\min & \Z\sinh \\ \Z\arcsin & \Z\cosh & \Z\deg & \Z\gcd & \Z\lg & \Z\ln & \Z\Pr & \Z\sup \\ \Z\arctan & \Z\cot & \Z\det & \Z\hom & \Z\lim & \Z\log & \Z\sec & \Z\tan \\ \Z\arg & \Z\coth & \Z\dim & \Z\inf & \Z\liminf & \Z\max & \Z\sin & \Z\tanh \end{tabular} \bigskip \begin{tablenote} Calling the above ``symbols'' may be a bit misleading.\footnotemark{} Each log-like symbol merely produces the eponymous textual equivalent, but with proper surrounding spacing. As \cmd{\bmod} and \cmd{\pmod} are arguably not symbols we refer the reader to the Short Math Guide for \latex~\cite{Downes:smg} for samples. \end{tablenote} \end{symtable} \footnotetext{Michael\index{Downes, Michael J.} J. Downes prefers the more general term, ``atomic\index{atomic math objects} math objects''.} \begin{symtable}{\TC\ Text-mode Arrows} \index{arrows} \label{tc-arrows} \begin{tabular}{*2{ll}} \K\textdownarrow & \K\textrightarrow \\ \K\textleftarrow & \K\textuparrow \\ \end{tabular} \end{symtable} \begin{symtable}{Math-mode Accents} \index{accents} \index{tilde} \label{math-accents} \begin{tabular}{*4{ll}} \W\acute{a} & \W\check{a} & \W\grave{a} & \W\tilde{a} \\ \W\bar{a} & \NW\ddot{a} & \W\hat{a} & \NW\vec{a} \\ \W\breve{a} & \W\dot{a} & \W\mathring{a} \\ \end{tabular} \bigskip \begin{tablenote} \index{dotless i=dotless $i~(\imath)$>math mode} \index{dotless j=dotless $j~(\jmath)$>math mode} Also note the existence of \cmdX{\imath} and \cmdX{\jmath}, which produce dotless versions of ``\textit{i}'' and ``\textit{j}''. (See Table~\vref{ord}.) These are useful when the accent is supposed to replace the dot. For example, ``\verb|\hat{\imath}|'' produces a correct ``$\,\hat{\imath}\,$'', while ``\verb|\hat{i}|'' would yield the rather odd-looking ``\,$\hat{i}\,$''. \end{tablenote} \end{symtable} \begin{symtable}{Greek Letters} \index{Greek}\index{alphabets>Greek} \label{greek} \begin{tabular}{*8l} \X\alpha &\X\theta &\X o &\X\tau \\ \X\beta &\X\vartheta &\X\pi &\X\upsilon \\ \X\gamma &\X\iota &\X\varpi &\X\phi \\ \X\delta &\X\kappa &\X\rho &\X\varphi \\ \X\epsilon &\X\lambda &\X\varrho &\X\chi \\ \X\varepsilon &\X\mu &\X\sigma &\X\psi \\ \X\zeta &\X\nu &\X\varsigma &\X\omega \\ \X\eta &\X\xi \\ \\ \X\Gamma &\X\Lambda &\X\Sigma &\X\Psi \\ \X\Delta &\X\Xi &\X\Upsilon &\X\Omega \\ \X\Theta &\X\Pi &\X\Phi \end{tabular} \bigskip \begin{tablenote} The remaining Greek majuscules\index{majuscules} can be produced with ordinary Latin letters. The symbol ``M'', for instance, is used for both an uppercase ``m'' and an uppercase ``$\mu$''. \end{tablenote} \end{symtable} \begin{symtable}{Letter-like Symbols} \idxboth{letter-like}{symbols} \index{tacks} \label{letter-like} \begin{tabular}{*5{ll}} \X\bot & \X\forall & \X\imath & \X\ni & \X\top \\ \X\ell & \X\hbar & \X\in & \X\partial & \X\wp \\ \X\exists & \X\Im & \X\jmath & \X\Re \\ \end{tabular} \end{symtable} \begin{symtable}{Variable-sized Delimiters} \index{delimiters} \index{delimiters>variable-sized} \label{dels} \renewcommand{\arraystretch}{1.75} % Keep tall symbols from touching. \begin{tabular}{lll@{\qquad}lll@{\hspace*{1.5cm}}lll@{\qquad}lll} \N\downarrow & \N\Downarrow & \N{[} & \N[\magicrbrack]{]} \\ \N\langle & \N\rangle & \N|$^*$ & \N\| \\ \N\lceil & \N\rceil & \N\uparrow & \N\Uparrow \\ \N\lfloor & \N\rfloor & \N\updownarrow & \N\Updownarrow \\ \N( & \N) & \N\{ & \N\} \\ \N/ & \N\backslash \\ \end{tabular} \bigskip \begin{tablenote} When used with \cmd{\left} and \cmd{\right}, these symbols expand to the height of the enclosed math expression. Note that \cmdX{\vert} is a synonym for \verb+|+, and \cmdX{\Vert} is a synonym for \verb+\|+. \end{tablenote} \bigskip \begin{tablenote}[*] $\varepsilon$-\TeX{}\index{e-tex=$\varepsilon$-\TeX} provides a \cmd{\middle} analogue to \cmd{\left} and \cmd{\right} that can be used to make an internal ``$|$'' (often used to indicate ``evaluated\index{evaluated at=evaluated at ($\vert$)} at'') expand to the height of the surrounding \cmd{\left} and \cmd{\right} symbols. A similar effect can be achieved in conventional \latex using the \pkgname{braket} package. \end{tablenote} \end{symtable} \begin{symtable}{Large, Variable-sized Delimiters} \index{delimiters} \index{delimiters>variable-sized} \label{ldels} \renewcommand{\arraystretch}{2.5} % Keep tall symbols from touching. \begin{tabular}{*3{lll@{\qquad}}lll} \Y\lmoustache & \Y\rmoustache & \Y\lgroup & \Y\rgroup \\ \Y\arrowvert & \Y\Arrowvert & \Y\bracevert \end{tabular} \bigskip \begin{tablenote} These symbols \emph{must} be used with \cmd{\left} and \cmd{\right}. The \ABX\ package, however, redefines \cmdI[$\string\big\string\lgroup$]{\lgroup} and \cmdI[$\string\big\string\rgroup$]{\rgroup} so that those symbols can work without \cmd{\left} and \cmd{\right}. \end{tablenote} \end{symtable} \begin{symtable}{\TC\ Text-mode Delimiters} \index{delimiters} \index{delimiters>text-mode} \label{tc-delimiters} \begin{tabular}{*2{ll}} \K\textlangle & \K\textrangle \\ \K\textlbrackdbl & \K\textrbrackdbl \\ \NK\textlquill & \NK\textrquill \\ \end{tabular} \end{symtable} \begin{symtable}{Extensible Accents} \index{accents} \idxboth{extensible}{accents} \idxboth{extensible}{arrows} \index{tilde} \index{tilde>extensible} \index{extensible tildes} \label{extensible-accents} \renewcommand{\arraystretch}{1.5} \begin{tabular}{*4l} \NW\widetilde{abc}{$^*$} & \NW\widehat{abc}{$^*$} \\ \WD\overleftarrow{abc}{$^\dag$} & \WD\overrightarrow{abc}{$^\dag$} \\ \WD\overline{abc}{} & \WD\underline{abc}{} \\ \WD\overbrace{abcd\cdots{}wxyz}{} & \WD\underbrace{abcd\cdots{}wxyz}{} \\[5pt] \WD\sqrt{abc}{$^\ddag$} \\ \end{tabular} \bigskip \begin{tablenote} \def\longdivsign{% \ensuremath{\overline{\vphantom{)}% \hbox{\smash{\raise3.5\fontdimen8\textfont3\hbox{$)$}}}% abc}}} \index{long division|(} \index{division|(} \index{polynomial division|(} As demonstrated in a 1997 TUGboat\index{TUGboat} article about typesetting long-division problems~\cite{Gibbons:longdiv}, an extensible long-division sign (``\,\longdivsign\,'') can be faked by putting a ``\verb|\big)|'' in a \texttt{tabular} environment with an \verb|\hline| or \verb|\cline| in the preceding row. The article also presents a piece of code (uploaded to CTAN\idxCTAN{} as \texttt{longdiv.tex}% \index{longdiv=\textsf{longdiv} (package)}% \index{packages>\textsf{longdiv}}) that automatically solves and typesets---by putting an \cmdW{\overline} atop ``\verb|\big)|'' and the desired text---long-division problems. See also the \pkgname{polynom} package, which automatically solves and typesets polynomial-division problems in a similar manner. \index{long division|)} \index{division|)} \index{polynomial division|)} \end{tablenote} \begin{tablenote}[\dag] If you're looking for an extensible \emph{diagonal} line or arrow to be used for canceling or reducing mathematical subexpressions\index{arrows>diagonal, for reducing subexpressions} \ifhavecancel (e.g.,~``$\cancel{x + -x}$'' or ``$\cancelto{5}{3+2}\quad$'') \fi then consider using the \pkgname{cancel} package. \end{tablenote} \bigskip \begin{tablenote}[\ddag] With an optional argument, \verb|\sqrt| typesets nth roots. For example, ``\verb|\sqrt[3]{abc}|'' produces~``$\!\sqrt[3]{abc}$\,'' and ``\verb|\sqrt[n]{abc}|'' produces~``$\!\sqrt[n]{abc}$\,''. \end{tablenote} \end{symtable} \begin{symtable}{Dots} \idxboth{dot}{symbols} \index{dots (ellipses)} \index{ellipses (dots)} \label{dots} \ifMDOTS \def\MDfn{$^\dag$}% \else \def\MDfn{}% \fi % MDOTS test \begin{tabular}{*{3}{ll@{\hspace*{1.5cm}}}ll} \X\cdotp & \X\colon$^*$ & \X\ldotp & \X\vdots\MDfn \\ \X\cdots & \X\ddots\MDfn & \X\ldots \\ \end{tabular} \bigskip \begin{tablenote}[*] While ``\texttt{:}'' is valid in math mode, \cmd{\colon} uses different surrounding spacing. \end{tablenote} \ifMDOTS \bigskip \begin{tablenote}[\dag] The \MDOTS\ package redefines \cmdX{\ddots} and \cmdX{\vdots} to make them scale properly with font size. (They normally scale horizontally but not vertically.) \cmdX{\fixedddots} and \cmdX{\fixedvdots} provide the original, fixed-height functionality of \latexE's \cmdX{\ddots} and \cmdX{\vdots} macros. \end{tablenote} \fi % MDOTS test \end{symtable} \begin{symtable}{Miscellaneous \TC\ Text-mode Math Symbols} \index{fractions} \label{tc-math} \ifFRAC \def\FRACfn{$^\dag$} \else \def\FRACfn{} \fi \begin{tabular}{*3{ll}} \K\textdegree$^*$ & \K\textonehalf\FRACfn & \K\textthreequarters\FRACfn \\ \K\textdiv & \K\textonequarter\FRACfn & \K\textthreesuperior \\ \K\textfractionsolidus & \K\textonesuperior & \K\texttimes \\ \K\textlnot & \K\textpm & \K\texttwosuperior \\ \K\textminus & \K\textsurd \\ \end{tabular} \bigskip \begin{tablenote}[*] If you prefer a larger degree symbol you might consider defining one as ``\verb|\ensuremath{^\circ}|''~(``$^\circ$'')% \indexcommand[$\string\circ$]{\circ}. \end{tablenote} \ifFRAC \bigskip \begin{tablenote}[\dag] \pkgname{nicefrac} (part of the \pkgname{units} package) can be used to construct vulgar fractions like ``\nicefrac{1}{2}'', ``\nicefrac{1}{4}'', ``\nicefrac{3}{4}'', and even ``\nicefrac{c}{o}''\index{care of=care of (\nicefrac{c}{o})}. \end{tablenote} \fi % FRAC test \end{symtable} \begin{symtable}{\TC\ Text-mode Science and Engineering Symbols} \label{tc-science} \begin{tabular}{*4{ll}} \K\textcelsius & \K\textmho & \K\textmu & \K\textohm \\ \end{tabular} \end{symtable} \begin{symtable}{\TC\ Genealogical Symbols} \idxboth{genealogical}{symbols} \label{genealogical} \begin{tabular}{*3{ll}} \K\textborn & \K\textdivorced & \K\textmarried \\ \K\textdied & \NK\textleaf \\ \end{tabular} \end{symtable} \begin{symtable}{Miscellaneous \latexE{} Math Symbols} \idxboth{miscellaneous}{symbols} \index{card suits} \index{diamonds (suit)} \index{hearts (suit)} \index{clubs (suit)} \index{spades (suit)} \idxboth{musical}{symbols} \index{dots (ellipses)} \index{ellipses (dots)} \index{null set} \index{dotless i=dotless $i~(\imath)$>math mode} \index{dotless j=dotless $j~(\jmath)$>math mode} \index{angles} \label{ord} \ifAMS \def\AMSfn{$^\ddag$} \else \def\AMSfn{} \fi \begin{tabular}{*4{ll}} \X\aleph & \X\Diamond$^*$ & \X\infty & \X\prime \\ \X\angle & \X\diamondsuit & \X\mho$^*$ & \X\sharp \\ \X\backslash & \X\emptyset\AMSfn & \X\nabla & \X\spadesuit \\ \X\Box$^{*,\dag}$ & \X\flat & \X\natural & \X\surd \\ \X\clubsuit & \X\heartsuit & \X\neg & \X\triangle \\ \end{tabular} \bigskip \notpredefinedmessage \bigskip \begin{tablenote}[\dag] To use \cmdX{\Box}---or any other symbol---as an end-of-proof (Q.E.D\@.)\index{Q.E.D.}\index{end of proof}\index{proof, end of} marker, consider using the \pkgname{ntheorem} package, which properly juxtaposes a symbol with the end of the proof text. \end{tablenote} \ifAMS \bigskip \begin{tablenote}[\ddag] Many people prefer the look of \AMS's \cmdX{\varnothing} (Table~\ref{ams-misc}) to that of \latex's \cmdX{\emptyset}. \end{tablenote} \fi % AMS test \end{symtable} \section*{AMS symbols} \begin{symtable}[AMS]{\AMS\ Commands Defined to Work in Both Math and Text Mode} \label{ams-math-text} \begin{tabular}{*2{ll@{\qquad}}ll} \X\checkmark & \X\circledR & \X\maltese \end{tabular} \end{symtable} \begin{symtable}[AMS]{\AMS\ Binary Operators} \idxboth{binary}{operators} \index{semidirect products} \label{ams-bin} \begin{tabular}{*3{ll}} \X\barwedge & \X\circledcirc & \X\intercal \\ \X\boxdot & \X\circleddash & \X\leftthreetimes \\ \X\boxminus & \X\Cup & \X\ltimes \\ \X\boxplus & \X\curlyvee & \X\rightthreetimes \\ \X\boxtimes & \X\curlywedge & \X\rtimes \\ \X\Cap & \X\divideontimes & \X\smallsetminus \\ \X\centerdot & \X\dotplus & \X\veebar \\ \X\circledast & \X\doublebarwedge \\ \end{tabular} \end{symtable} \begin{symtable}[AMS]{\AMS\ Variable-sized Math Operators} \idxboth{variable-sized}{symbols} \index{integrals} \label{ams-large} \renewcommand{\arraystretch}{2.5} % Keep tall symbols from touching. \begin{tabular}{l@{$\:$}ll@{\qquad}l@{$\:$}ll} \R[\AMSiint]\iint & \R[\AMSiiint]\iiint \\ \R[\AMSiiiint]\iiiint & \R[\AMSidotsint]\idotsint \\ \end{tabular} \end{symtable} \begin{symtable}[AMS]{\AMS\ Binary Relations} \index{binary relations} \index{relational symbols>binary} \label{ams-rel} \begin{tabular}{*3{ll}} \X\approxeq & \X\eqcirc & \X\succapprox \\ \X\backepsilon & \X\fallingdotseq & \X\succcurlyeq \\ \X\backsim & \X\multimap & \X\succsim \\ \X\backsimeq & \X\pitchfork & \X\therefore \\ \X\because & \X\precapprox & \NX\thickapprox \\ \X\between & \X\preccurlyeq & \NX\thicksim \\ \X\Bumpeq & \X\precsim & \X\varpropto \\ \X\bumpeq & \X\risingdotseq & \X\Vdash \\ \X\circeq & \NX\shortmid & \X\vDash \\ \X\curlyeqprec & \NX\shortparallel & \X\Vvdash \\ \X\curlyeqsucc & \NX\smallfrown & \\ \X\doteqdot & \NX\smallsmile & \\ \end{tabular} \end{symtable} \begin{symtable}[AMS]{\AMS\ Negated Binary Relations} \index{binary relations>negated} \index{relational symbols>negated binary} \label{ams-nrel} \begin{tabular}{*3{ll}} \X\ncong & \NX\nshortparallel & \X\nVDash \\ \X\nmid & \X\nsim & \X\precnapprox \\ \X\nparallel & \X\nsucc & \X\precnsim \\ \X\nprec & \X\nsucceq & \X\succnapprox \\ \X\npreceq & \X\nvDash & \X\succnsim \\ \NX\nshortmid & \X\nvdash \\ \end{tabular} \end{symtable} \begin{symtable}[AMS]{\AMS\ Subset and Superset Relations} \index{binary relations} \index{relational symbols>binary} \index{subsets} \index{supersets} \index{symbols>subset and superset} \label{ams-subsets} \begin{tabular}{*3{ll}} \X\nsubseteq & \X\subseteqq & \X\supsetneqq \\ \X\nsupseteq & \X\subsetneq & \NX\varsubsetneq \\ \NX\nsupseteqq & \X\subsetneqq & \NX\varsubsetneqq \\ \X\sqsubset & \X\Supset & \NX\varsupsetneq \\ \X\sqsupset & \X\supseteqq & \NX\varsupsetneqq \\ \X\Subset & \X\supsetneq \\ \end{tabular} \end{symtable} \begin{symtable}[AMS]{\AMS\ Inequalities} \index{binary relations}\index{relational symbols>binary} \index{inequalities} \label{ams-inequal-rel} \renewcommand{\arraystretch}{1.5} % Keep visually similar symbols from touching. \begin{tabular}{*4{ll}} \X\eqslantgtr & \X\gtrdot & \X\lesseqgtr & \X\ngeq \\ \X\eqslantless & \X\gtreqless & \X\lesseqqgtr & \NX\ngeqq \\ \X\geqq & \X\gtreqqless & \X\lessgtr & \NX\ngeqslant \\ \X\geqslant & \X\gtrless & \X\lesssim & \X\ngtr \\ \X\ggg & \X\gtrsim & \X\lll & \X\nleq \\ \X\gnapprox & \NX\gvertneqq & \X\lnapprox & \NX\nleqq \\ \X\gneq & \X\leqq & \X\lneq & \NX\nleqslant \\ \X\gneqq & \X\leqslant & \X\lneqq & \X\nless \\ \X\gnsim & \X\lessapprox & \X\lnsim & \\ \X\gtrapprox & \X\lessdot & \NX\lvertneqq & \\ \end{tabular} \end{symtable} \begin{symtable}[AMS]{\AMS\ Triangle Relations} \index{triangle relations}\index{relational symbols>triangle} \label{ams-triangle-rel} \begin{tabular}{*4{ll}} \X\blacktriangleleft & \X\ntrianglelefteq & \X\trianglelefteq & \X\vartriangleleft \\ \X\blacktriangleright & \X\ntriangleright & \X\triangleq & \X\vartriangleright \\ \X\ntriangleleft & \X\ntrianglerighteq & \X\trianglerighteq \\ \end{tabular} \end{symtable} \begin{symtable}[AMS]{\AMS\ Arrows} \index{arrows} \label{ams-arrows} \begin{tabular}{*3{ll}} \X\circlearrowleft & \X\leftleftarrows & \X\rightleftarrows \\ \X\circlearrowright & \X\leftrightarrows & \X\rightrightarrows \\ \X\curvearrowleft & \X\leftrightsquigarrow & \X\rightsquigarrow \\ \X\curvearrowright & \X\Lleftarrow & \X\Rsh \\ \X\dashleftarrow & \X\looparrowleft & \X\twoheadleftarrow \\ \X\dashrightarrow & \X\looparrowright & \X\twoheadrightarrow \\ \X\downdownarrows & \X\Lsh & \X\upuparrows \\ \X\leftarrowtail & \X\rightarrowtail & \\ \end{tabular} \end{symtable} \begin{symtable}[AMS]{\AMS\ Negated Arrows} \index{arrows>negated} \label{ams-narrows} \begin{tabular}{*3{ll}} \X\nLeftarrow & \X\nLeftrightarrow & \X\nRightarrow \\ \X\nleftarrow & \X\nleftrightarrow & \X\nrightarrow \\ \end{tabular} \end{symtable} \begin{symtable}[AMS]{\AMS\ Harpoons} \index{harpoons} \label{ams-harpoons} \begin{tabular}{*3{ll}} \X\downharpoonleft & \X\leftrightharpoons & \X\upharpoonleft \\ \X\downharpoonright & \X\rightleftharpoons & \X\upharpoonright \\ \end{tabular} \end{symtable} \begin{symtable}[AMS]{\AMS\ Log-like Symbols} \idxboth{log-like}{symbols} \index{atomic math objects} \index{limits} \label{ams-log} \renewcommand{\arraystretch}{1.5} % Keep tall symbols from touching. \begin{tabular}{*2{ll@{\qquad}}ll} \X\injlim & \NX\varinjlim & \X\varlimsup \\ \X\projlim & \X\varliminf & \NX\varprojlim \end{tabular} \bigskip \begin{tablenote} Load the \pkgname{amsmath} package to get these symbols. As \cmd{\mod} and \cmd{\pod} are arguably not symbols we refer the reader to the Short Math Guide for \latex~\cite{Downes:smg} for samples. \end{tablenote} \end{symtable} \begin{symtable}[AMS]{\AMS\ Greek Letters} \index{Greek}\index{alphabets>Greek} \label{ams-greek} \begin{tabular}{*4l} \X\digamma &\X\varkappa \end{tabular} \end{symtable} \begin{symtable}[AMS]{\AMS\ Hebrew Letters} \index{Hebrew}\index{alphabets>Hebrew} \label{ams-hebrew} \begin{tabular}{*6l} \X\beth & \X\gimel & \X\daleth \end{tabular} \bigskip \begin{tablenote} \cmdX{\aleph} appears in Table~\vref{ord}. \end{tablenote} \end{symtable} \begin{symtable}[AMS]{\AMS\ Letter-like Symbols} \idxboth{letter-like}{symbols} \label{ams-letter-like} \begin{tabular}{*3{ll}} \X\Bbbk & \X\complement & \X\hbar \\ \X\circledR & \X\Finv & \X\hslash \\ \X\circledS & \X\Game & \X\nexists \\ \end{tabular} \end{symtable} \begin{symtable}[AMS]{\AMS\ Delimiters} \index{delimiters} \label{ams-del} \begin{tabular}{*2{ll}} \X\ulcorner & \X\urcorner \\ \X\llcorner & \X\lrcorner \end{tabular} \end{symtable} \begin{symtable}[AMS]{\AMS\ Variable-sized Delimiters} \index{delimiters} \index{delimiters>variable-sized} \label{ams-var-del} \renewcommand{\arraystretch}{2.5} % Keep tall symbols from touching. \begin{tabular}{lll@{\qquad}lll} \N\lvert & \N\rvert \\ \N\lVert & \N\rVert \\ \end{tabular} \bigskip \begin{tablenote} According to the \texttt{amsmath} documentation~\cite{AMS1999:amsmath}, the preceding symbols are intended to be used as delimiters (e.g.,~as in ``$\lvert -z \rvert$'') while the \cmdX{\vert} and \cmdX{\Vert} symbols (Table~\vref{dels}) are intended to be used as operators (e.g.,~as in ``$p \vert q$''). \end{tablenote} \end{symtable} \begin{symtable}[AMS]{\AMS\ Math-mode Accents} \index{accents} \label{ams-math-accents} \begin{tabular}{ll@{\hspace*{2em}}ll} \NW\dddot{a} & \NW\ddddot{a} \\ \end{tabular} \bigskip \begin{tablenote} These accents are also provided by the \ABX\ package. \end{tablenote} \end{symtable} \begin{symtable}[AMS]{\AMS\ Extensible Accents} \idxboth{extensible}{accents} \idxboth{extensible}{arrows} \label{extensible-arrows} \renewcommand{\arraystretch}{1.5} \begin{tabular}{l@{\qquad}l} \WD\overleftrightarrow{abc\cdots{}xyz}{} & \WD\underleftrightarrow{abc\cdots{}xyz}{} \\ \WD\underleftarrow{abc}{} & \WD\underrightarrow{abc}{} \\[2ex] \multicolumn{2}{p{0.75\textwidth}}{% The following are a sort of ``reverse accent'' in that the argument text serves as a superscript to the arrow. In addition, the optional first argument (not shown) serves as a subscript to the arrow. See the Short Math Guide for \latex~\cite{Downes:smg} for further examples. } \\~\\[-2ex] \WD\xleftarrow{abc}{} & \WD\xrightarrow{abc}{} \\ \end{tabular} \end{symtable} \begin{symtable}[AMS]{\AMS\ Dots} \idxboth{dot}{symbols} \index{dots (ellipses)} \index{ellipses (dots)} \label{ams-dots} \begin{tabular}{*{2}{ll@{\hspace*{1.5cm}}}ll} \X[\cdots]\dotsb & \X[\cdots]\dotsi & \X[\ldots]\dotso \\ \X[\ldots]\dotsc & \X[\cdots]\dotsm \\ \end{tabular} \bigskip \begin{tablenote} The \AMS\ dot symbols are named according to their intended usage: \cmdI[$\string\cdots$]{\dotsb} between pairs of binary operators/relations, \cmdI[$\string\ldots$]{\dotsc} between pairs of commas, \cmdI[$\string\cdots$]{\dotsi} between pairs of integrals, \cmdI[$\string\cdots$]{\dotsm} between pairs of multiplication signs, and \cmdI[$\string\ldots$]{\dotso} between other symbol pairs. \end{tablenote} \end{symtable} \begin{symtable}[AMS]{Miscellaneous \AMS\ Math Symbols} \idxboth{miscellaneous}{symbols} \index{stars} \index{triangles} \index{null set} \index{angles} \label{ams-misc} \begin{tabular}{*3{ll}} \X\angle & \X\blacktriangledown & \X\mho \\ \X\backprime & \X\diagdown & \X\sphericalangle \\ \X\bigstar & \X\diagup & \X\square \\ \X\blacklozenge & \X\eth & \X\triangledown \\ \X\blacksquare & \X\lozenge & \X\varnothing \\ \X\blacktriangle & \X\measuredangle & \X\vartriangle \\ \end{tabular} \end{symtable} \end{document} hevea-2.23/examples/graphicx.tex0000644004317100512160000000114007415373521016726 0ustar marangetcristal\documentclass{article} \usepackage{graphicx} \setkeys{Gin}{width=4cm} \DeclareGraphicsExtensions{{.ps}} \DeclareGraphicsRule{.ps.gz}{eps}{.ps.bb}{} \begin{document} \section{Commande \texttt{\char92 includegraphics}} \begin{center} \includegraphics{HF} \end{center} \includegraphics{HF.ps.gz} \includegraphics*[draft, width=2cm]{HF.ps} \section{Rotations} \rotatebox[origin=c]{45}{\scalebox{.5}{\includegraphics{HF.ps}}} \newcommand{\monrot}[3][]{\rotatebox[#1]{#2}{#3}} \monrot[origin=b]{135}{\scalebox{.5}{\includegraphics{HF.ps}}} \monrot{135}{\scalebox{.5}{\includegraphics{HF.ps}}} \end{document} hevea-2.23/examples/cart-ter.tex0000644004317100512160000000157012017660721016644 0ustar marangetcristal\documentclass{article} \renewcommand{\cuttingunit}{section} \flushdef{part} \setcounter{cuttingdepth}{2}. \begin{document} \title{Coucou\footnote{Coucou} --- Toi\footnote{Toi}} \author{Moi\thanks{Moi}} \date{Aujourd'hui} \maketitle \begin{quote} Non-default \hacha{} behavior for \texttt{article}: cut at sections, flush footnotes at parts. \end{quote} \part{Grand un} \section{Un} Un\footnote{un}. \subsection{Un-Un} Un-Un~\footnote{un-un}. \subsection{Un-Deux} Un-Deux~\footnote{un-deux}. \subsection{Un-Trois} Un-Trois~\footnote{un-trois}. \subsubsection{Un-Trois-Un} Un-Trois-Un~\footnote{un-trois-un}. \subsubsection{Un-Trois-Deux} Un-Trois-Deux~\footnote{un-trois-deux}. \subsection{Un-Quatre} Un-Quatre~\footnote{un-quatre}. \section{Deux} Deux\footnote{deux}. \section{Trois} Trois\footnote{trois}. \part{Grand deux} \section{Quatre} Quatre\footnote{quatre}. \end{document} hevea-2.23/examples/cart-bis.tex0000644004317100512160000000156212017660721016630 0ustar marangetcristal\documentclass{article} \renewcommand{\cuttingunit}{part} \flushdef{part} \setcounter{cuttingdepth}{2}. \begin{document} \title{Coucou\footnote{Coucou} --- Toi\footnote{Toi}} \author{Moi\thanks{Moi}} \date{Aujourd'hui} \maketitle \begin{quote} Non-default \hacha{} behavior for \texttt{article}: cut at parts, flush footnotes at parts. \end{quote} \part{Grand un} \section{Un} Un\footnote{un}. \subsection{Un-Un} Un-Un~\footnote{un-un}. \subsection{Un-Deux} Un-Deux~\footnote{un-deux}. \subsection{Un-Trois} Un-Trois~\footnote{un-trois}. \subsubsection{Un-Trois-Un} Un-Trois-Un~\footnote{un-trois-un}. \subsubsection{Un-Trois-Deux} Un-Trois-Deux~\footnote{un-trois-deux}. \subsection{Un-Quatre} Un-Quatre~\footnote{un-quatre}. \section{Deux} Deux\footnote{deux}. \section{Trois} Trois\footnote{trois}. \part{Grand deux} \section{Quatre} Quatre\footnote{quatre}. \end{document} hevea-2.23/examples/a.tex0000644004317100512160000001072512017700472015343 0ustar marangetcristal\documentclass{article} \usepackage{fullpage} \usepackage[latin1]{inputenc} \usepackage{hevea} \usepackage[french]{babel} \def\homedir{http://w3.edu.polytechnique.fr/profs/informatique/Luc.Maranget/X.97} \begin{latexonly} \gdef\url#1#2{#2} \gdef\oneurl#1{\url{#1}{{\tt #1}}} \end{latexonly} \title{TD-5, encore les pointeurs} \date{} \author{} \pagestyle{empty} \begin{document} \maketitle \thispagestyle{empty} \begin{center} Ce document est disponible l'URL \oneurl{\homedir/TD-5/enonce.html} \end{center} \begin{center} Programmes {\em Prenom.Nom.c} dposer par {\em ftp} sur {\tt poly} en {\tt /users/profs/maranget/TD-5}. \end{center} \section{Calculatrice HP} On se propose de raliser une petite calculette HP. \subsection{Quatre oprations} Cette premire partie s'inspire du cours. On utilisera une pile {\tt stack}, globale et code en machine par une liste d'entiers, voici la dfinition de {\tt stack} et le constructeur des listes~:{\small \begin{verbatim} typedef struct cell { int val; struct cell *next; } Cell, *Stack; Stack stack = NULL; Cell *cons(int val,Cell *next) { Cell *r; r = (Cell *)malloc(sizeof(Cell)); if ( r == NULL) { fprintf(stderr,"Plus de memoire\n"); exit(-1); } r->val = val; r->next = next; return r; } \end{verbatim} } \begin{itemize} \item crire les fonctions de base de manipulation de la pile, affichage de la pile ({\tt afficher}), empilage ({\tt push}) et dpilage ({\tt pop}). Voici des signatures possibles~:{\small \begin{verbatim} void afficher(void) int pop(void) void push(int i) \end{verbatim} } \item Une quelconque des quatre oprations (par exemple $-$) se ralise ainsi~: dpiler le second argument (par exemple $i_2$), dpiler le premier argument, (par exemple $i_1$), effectuer l'opration (par exemple $i_1-i_2$) et empiler le rsultat. La calculatrice obira un programme contenu dans une chane de caractres et affichera, chaque tape intermdiaire, le caractre lu (utiliser \verb+printf+ avec le format \verb+"%c"+) et l'tat de de la pile. Par exemple, pour le programme {\tt "12-34++"}, on aura~(la pile est affiche du sommet vers le fond)~:{\small \begin{verbatim} [] 1 : [1] 2 : [2, 1] - : [-1] 3 : [3, -1] 4 : [4, 3, -1] + : [7, -1] + : [6] \end{verbatim} } Vous aurez donc lire la chane-programme caractre par caractre (rappelez vous qu'une chane est un tableau de caractres) et empiler un entier ou raliser une opration selon ce que vous avez lu. Les quatre oprations devront bien entendu utiliser les primitives de pile, {\tt push} et {\tt pop}. Attention au sens de la soustraction et de la division. \end{itemize} \subsection{Oprations avances sur les piles} Les vraies calculatrices HP ont des touches spciales qui permettent des manipulations de la pile. Les oprations suivantes (qui diffrent un peu de celles des calculatrices HP) sont raliser sans allouer aucune cellule de liste. \begin{itemize} \item {\em changer} les deux lments du sommet de pile. Cette opration sera ralise par le caractre {\tt 's'}. Ainsi, le programme {\tt "12s-"} donnera le rsultat suivant~:{\small \begin{verbatim} [] 1 : [1] 2 : [2, 1] s : [1, 2] - : [1] \end{verbatim} } \item {\em Rotation de la pile vers le haut}~: tous les lments montent d'un cran vers le sommet de pile, le sommet de pile se retrouve en fond de pile. Le programme {\tt "4321u"} devra produire~:{\small \begin{verbatim} [] 4 : [4] 3 : [3, 4] 2 : [2, 3, 4] 1 : [1, 2, 3, 4] u : [2, 3, 4, 1] \end{verbatim} } \item {\em Rotation de la pile vers le bas}~: c'est l'opration inverse, tous les lments descendent d'un cran, le fond de pile se retrouve en sommet de pile. Ainsi, le programme {\tt "4321d"} s'excute ainsi~:{\small \begin{verbatim} [] 4 : [4] 3 : [3, 4] 2 : [2, 3, 4] 1 : [1, 2, 3, 4] d : [4, 1, 2, 3] \end{verbatim} } \end{itemize} Remarquez que les rotations reviennent, pour la rotation vers le haut, mettre la cellule de tte en queue de liste et pour la rotation vers le bas, mettre la cellule de queue en tte de liste. Vous aurez sans doute intrt faire de petits dessins pour vous guider. La solution de cet exercice apparatra \url{hp.c}{en hp.c}. \section{S'il vous reste du temps} Raliser une calculatrice PH, dont la structure de contrle est une file. La file sera ralise par une liste (voir la fin du cours). Une opration se fera en dfilant les deux arguments et en enfilant le rsultat. Vous pouvez aller jusqu' donner une signification claire aux rotations et les programmer. \end{document} hevea-2.23/examples/mathpartir-test.tex0000644004317100512160000003301310077737453020263 0ustar marangetcristal% Mathpartir --- Math Paragraph for Typesetting Inference Rules % % Copyright (C) 2001, 2002, 2003 Didier Rmy % % Author : Didier Remy % Version : 1.1.1 % Bug Reports : to author % Web Site : http://pauillac.inria.fr/~remy/latex/ % % WhizzyTeX 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, or (at your option) % any later version. % % Mathpartir 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 % (http://pauillac.inria.fr/~remy/license/GPL). % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % File mathpartir.tex (Documentation) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \documentclass {article} \usepackage {mathpartir} \usepackage {listings} \usepackage {array} \usepackage {url} \newif \ifhevea %HEVEA \heveatrue \ifhevea \usepackage {hevea} \fi \lstset {basicstyle=\tt} \let \lst \verb \title {Remy's Mathpartir} \begin{document} \begin{abstract} This package provides macros for displaying lists of formulas that are typeset in mixed horizontal and vertical modes. The package is two-folded. The first part is an environment \verb"mathpar" that generalizes the math display mode to allow several formulas on the same line, and several lines in the same display. The arrangement of the sequence of formulas into lines is automatic depending on the line width and on a minimum inter-formula space and line width alike words in a paragraphs (in centerline mode). A typical application is displaying a set of type inference rules. The second par is a macro \lst"inferrule" to typeset inference rules themselves. Here again, both premises and conclusions are presented as list of formulas that should be displayed in almost the same way, except that the width is not fixed in advance; and the inference rule should use no more width than necessary so that other inference rules are given a chance to appear on the same line. Although \verb"mathpar" and \verb"inferrule" look similar in their specification, and are often used in combination, they are in fact completely different in their implementations. \end{abstract} \section {The mathpar environment} The mathpar environment is a ``paragraph mode for formulas''. It allows to typeset long list of formulas putting as many as possible on the same line: $$ \begin{tabular}{m{0.45\hsize}m{0.1\hsize}m{0.45\hsize}} \begin{lstlisting}{Ocaml} \begin{mathpar} A-Formula \and Longer-Formula \and And \and The-Last-One \end{mathpar} \end{lstlisting} & ~~~ & \begin{mathpar} A-Formula \and Longer-Formula \and And \and The-Last-One \end{mathpar} \end{tabular} $$ Formulas are separated by \verb"\and" (or equivalently by a blank line). To enforce a vertical break it sufficies to replace \verb"\and" by \verb"\\". The implementation of \verb"mathpar" entirely relies on the paragraph mode for text. It starts a new paragraph, and a math formula within a paragraph, after adjusting the spacing and penalties for breaks. Then, it simply binds \verb"\and" to something like \verb"\goodbreak". \section {The inferrule macro} The inferrule macro is designed to typeset inference rules. It should only\footnote {Even though the basic version may work in text mode, we discourage its use in text mode; the star-version cannot be used in text-mode} be used in math mode (or display math mode). The basic use of the rule is \begin{verbatim} \inferrule {one \\ two \\ three \\ or \\ more \\ premisses} {and \\ any \\ number \\ of \\ conclusions \\ as \\ well} \end{verbatim} This is the rendering on a large page \def \one {\inferrule {one \\ two \\ three \\ or \\ more \\ premisses} {and \\ any \\ number \\ of \\ conclusions \\ as \\ well} } $$ \ifhevea \one \else \fbox {\vbox {\advance \hsize by -2\fboxsep \advance \hsize by -2\fboxrule \linewidth\hsize $$\one$$}} \fi $$ However, the same formula on a narrower page will automatically be typsetted like that: \def \two {\inferrule {one \\\\ two \\ three \\ or \\\\ more \\ premisses} {and \\ any \\ number \\\\ of \\ conclusions \\\\ as \\ well} } $$ \ifhevea \two \else \fbox {\hsize 0.33 \hsize \vbox {$$\two$$}} \fi $$ An inference rule is mainly composed of a premisse and a conclusion. The premisse and the conclusions are both list of formulas where the elements are separated by \verb"\\". Note the dissymetry between typesetting of the premisses and of conclusions where lines closer to the center are fit first. A newline can be forced by adding an empty line \verb"\\\\" \begin{tabular}{m{0.44\hsize}m{0.1\hsize}m{0.44\hsize}} \begin{lstlisting}{Ocaml} \inferrule {aa \\\\ bb} {dd \\ ee \\ ff} \end{lstlisting} & ~~~ & $\inferrule {aa \\\\bb}{dd \\ ee \\ ff}$ \\ \end{tabular} \subsection {Single rules} Single rules are the default mode. Rules are aligned on their fraction bar, as illustrated below: $$ \inferrule {aa \\ bb}{ee} \hspace {4em} \inferrule {aa \\\\ bb \\ ee}{ee} $$ If the premise or the conclusion is empty, then the fraction bar is not typeset and the premise or the conclusion is centered: $$ \begin{tabular}{m{0.3\hsize}m{0.05\hsize}m{0.3\hsize}m{0.05\hsize}m{0.3\hsize}} \begin{lstlisting}{Ocaml} \inferrule {}{aa} + \inferrule {aa \\\\ aa}{} \end{lstlisting} & ~~~~~~~~ & $\inferrule {}{aa}$ & $+$ & $\inferrule {aa \\\\ aa}{}$ \\ \end{tabular} $$ Use use \verb"{ }" instead of \verb"{}" to get an axiom for instance: $$ \begin{tabular}{m{0.45\hsize}m{0.1\hsize}m{0.45\hsize}} \begin{lstlisting}{Ocaml} \inferrule { }{aa} + \inferrule {aa}{ } \end{lstlisting} & ~~~~~~ & $ \inferrule { }{aa} + \inferrule {aa}{ } $ \\ \end{tabular} $$ The macro \lst"\inferrule" acceps a label as optional argument, which will be typeset on the top left corner of the rule: \par \begin{tabular}{m{0.45\hsize}m{0.1\hsize}m{0.45\hsize}} \begin{lstlisting}{Ocaml} \inferrule [yop] {aa \\ bb} {cc} \end{lstlisting} & $\inferrule [Yop]{aa \\ bb}{cc}$ \\ \end{tabular} \par\noindent See section~\ref {options} for changing typesetting of labels. A label can also be placed next to the rule directly, since the rule is centered: \par \begin{tabular}{m{0.45\hsize}m{0.1\hsize}m{0.45\hsize}} \begin{lstlisting}{Ocaml} \inferrule {aa \\ bb} {cc} \quad (\textsc {Yop}) \end{lstlisting} & ~~~~~~ & $\inferrule{aa \\ bb}{cc} \quad (\textsc {Yop})$ \\ \end{tabular} \subsection {Customizing} By default, lines are centerred in inference rules. However, this can be changed by either \lst"\mprset{flushleft}" or \lst"\mprset{center}". For instance, \begin{tabular}{m{0.44\hsize}m{0.12\hsize}m{0.44\hsize}} \begin{lstlisting}{Ocaml} $$\mprset{flushleft} \inferrule {a \\ bbb \\\\ ccc \\ dddd} {e \\ ff \\ gg}$$ \end{lstlisting} & ~~~~~ & $$\mprset{flushleft} \inferrule {a \\ bbb \\\\ ccc \\ dddd}{e \\ ff \\ gg}$$ \\ \end{tabular} \noindent Note that lines are aligned independently in the premise and the conclusion, which are both themselves centered. In particular, left alignment will not affect a single-line premisse or conclusion. \subsection {Derivation trees} To help writing cascades of rules forming a derivation tree, inference rules can also be aligned on their bottom line. For this, we use the star-version: $$ \begin{tabular}{m{0.45\hsize}m{0.1\hsize}m{0.45\hsize}} \begin{lstlisting}{Ocaml} \inferrule* {\inferrule* {aa \\ bb}{cc} \\ dd} {ee} \end{lstlisting} & ~~~~~~ & $ \inferrule* {\inferrule* {aa \\ bb}{cc} \\ dd} {ee} $ \\ \end{tabular} $$ The star version can also take an optional argument, but with a different semantics. The optional argument is parsed by the \verb"keyval" package, so as to offer a set of record-like options: $$ \def \val {{\em v}} \def \arraystretch {1.4} \begin{tabular}{|>{\tt}c|p{0.7\hsize}|} \hline \bf key & \bf Effect for value {\val} \\\hline\hline before & Execute {\val} before typesetting the rule. Useful for instance to change the maximal width of the rule. \\\hline width & Set the width of the rule to {\val} \\\hline narrower & Set the width of the rule to {\val} times \verb"\hsize". \\\hline left & Put a label {\val} on the left of the rule \\\hline Left & Idem, but as if the label had zero width. \\\hline Right & As \verb"Left", but on the right of the rule. \\\hline right & As \verb"left", but on the right of the rule. \\\hline leftskip & Cheat by (skip negative space) {\val} on the left side. \\\hline rightskip & Cheat by {\val} on the right side of the rule. \\\hline vdots & Raise the rule by {\val} and insert vertical dots. \\\hline \end{tabular} $$ Here is an example of a complex derivation: $$ \inferrule* [left=Total] {\inferrule* [Left=Foo] {\inferrule* [Right=Bar, leftskip=2em,rightskip=2em,vdots=1.5em] {a \\ a \\\\ bb \\ cc \\ dd} {ee} \\ ff \\ gg} {hh} \\\\ \inferrule* [lab=XX]{uu \\ vv}{ww} } {(1)} $$ and its code \begin{lstlisting}{Ocaml} \inferrule* [left=Total] {\inferrule* [Left=Foo] {\inferrule* [Right=Bar, leftskip=2em,rightskip=2em,vdots=1.5em] {a \\ a \\\\ bb \\ cc \\ dd} {ee} \\ ff \\ gg} {hh} \\ \inferrule* [lab=XX]{uu \\ vv}{ww}} {(1)} \end{lstlisting} \def \L#1{\lower 0.4ex \hbox {#1}} \def \R#1{\raise 0.4ex \hbox {#1}} \def \hevea {H\L{E}\R{V}\L{E}A} \def \hevea {$\mbox {H}\!_{\mbox {E}}\!\mbox {V}\!_{\mbox {E}}\!\mbox {A}$} \subsection {Implementation} The main macro in the implementation of inference rules is the one that either premises and conclusions. The macros uses two box-registers one \verb"hbox" for typesetting each line and one \verb"vbox" for collecting lines. The premise appears as a list with \verb"\\" as separator. Each element is considered in turn typeset in a \verb"hbox" in display math mode. Its width is compare to the space left on the current line. If the box would not fit, the current horizontal line is transferred to the vertical box and emptied. Then, the current formula can safely be added to the horizontal line (if it does not fit, nothing can be done). When moved to the vertical list, lines are aligned on their center (as if their left-part was a left overlapped). At the end the vbox is readjusted on the right. This description works for conclusions. For premises, the elements must be processes in reverse order and the vertical list is simply built upside down. \section {Other Options} \label {options} The package also defines \verb"\infer" as a shortcut for \verb"\inferrule" but only if it is not previously defined. The package uses \verb"\TirName" and \verb"\RefTirName" to typeset labels, which can safely be redefined by the user. The former is used for defining occurrences ({\em ie.} in rule \lst"\inferrule") while the latter is used for referencing ({\em ie.} in the star-version). The vertical space in \verb"mathpar" is adjusted by \verb"\MathparLineskip". To restore the normal paragraph parameters in mathpar mode (for instance for some inner paragraph), use the command \verb"\MathparNormalpar". The environment uses \verb"\MathparBindings" to rebind \verb"\\", \verb"and", and \verb"\par". You can redefine thus command to change the default bindings or add your own. \section {Examples} See the source of this documentation ---the file \lst"mathpartir.tex"--- for full examples. \section {{\hevea} compatibility} The package also redefines \verb"\hva" to do nothing in \lst"mathpar" environment and nor in inference rules. In HeVeA, \verb"\and" will always produce a vertical break in mathpar environment; to obtain a horizontal break, use \verb"\hva \and" instead. Conversely, \verb"\\" will always produce a horizontal break in type inference rules; to obtain a vertical break, use \verb"\hva \\" instead. For instance, by default the following code, \begin{lstlisting}{Ocaml} \begin{mathpar} \inferrule* [Left=Foo] {\inferrule* [Right=Bar,width=8em, leftskip=2em,rightskip=2em,vdots=1.5em] {a \\ a \\ bb \\ cc \\ dd} {ee} \\ ff \\ gg} {hh} \and \inferrule* [lab=XX]{uu \\ vv}{ww} \end{mathpar} \end{lstlisting} which typesets in {\TeX} as follows, \begin{mathpar} \inferrule* [Left=Foo] {\inferrule* [Right=Bar,width=8em, leftskip=2em,rightskip=2em,vdots=1.5em] {a \\ a \\ bb \\ cc \\ dd} {ee} \\ ff \\ gg} {hh} \and \inferrule* [lab=XX]{uu \\ vv}{ww} \end{mathpar} would appear as follows with the compatible {\hevea} mode: \begin{mathpar} \inferrule* [left=Foo] {\inferrule* [right=Bar] {a \\ a \\ bb \\ cc \\ dd} {ee} \\ ff \\ gg} {hh} \\ \inferrule* [lab=XX]{uu \\ vv}{ww} \end{mathpar} To obtain (almost) the same rendering as in {\TeX}, it could be typed as \begin{lstlisting}[escapechar=\%]{Ocaml} \begin{mathpar} \inferrule* [Left=Foo] {\inferrule* [Right=Bar,width=8em, leftskip=2em,rightskip=2em,vdots=1.5em] {a \\ a \hva \\ bb \\ cc \\ dd} {ee} \\ ff \\ gg} {hh} \hva \and \inferrule* [lab=XX]{uu \\ vv}{ww} \end{mathpar} \end{lstlisting} Actually, it would be typeset and follows with the compatible {\hevea} mode: \begin{mathpar} \inferrule* [left=Foo] {\inferrule* [right=Bar] {a \\ a \\\\ bb \\ cc \\ dd} {ee} \\ ff \\ gg} {hh} \and \inferrule* [lab=XX]{uu \\ vv}{ww} \end{mathpar} \end{document} \end{document} % LocalWords: mathpar aa Yop bb dd ee ff cc Ocaml Foo leftskip rightskip vdots % LocalWords: gg hh uu vv ww HeVeA escapechar hevea-2.23/examples/list.tex0000644004317100512160000000220512017700472016070 0ustar marangetcristal\documentclass{article} \title{List test} \date{} \footerfalse \newenvironment{list2} {\begin{list}{}{\setlength{\itemsep}{0em}\setlength{\labelsep}{0em}% \renewcommand{\makelabel}[1]{\textbf{$\bullet$\ ##1}}}} {\end{list}}% \begin{document}\maketitle \section{Paragraphs} Long text, long text, long text, long text, long text, long text, long text, long text, long text, long text, long text, long text, long text. Long text, long text, long text, long text, long text, long text, long text, long text, long text, long text, long text, long text, long text. \section{Simple lists}Environment \texttt{itemize} \begin{itemize} \item First item. \item Second item. \end{itemize} Environment \texttt{enumerate} \begin{enumerate} \item First item. \item Second item. \end{enumerate} Environment \texttt{description} \begin{description} \item[First] item. \item[Second] item. \item[Third] long item, long item, long item, long item, long item, long item, long item, long item, long item. \end{description} \section{Complex list} \begin{list2} \item Coucou \item Zobi \begin{list2} \item[a] Coucou \item[b] Zobi \end{list2} \end{list2} \end{document} hevea-2.23/examples/smile.hva0000644004317100512160000000016106633550644016216 0ustar marangetcristal\newenvironment{centergpic} {\begin{toimage}} {\box\graph\end{toimage}\begin{center}\imageflush\end{center}} hevea-2.23/examples/hp.c0000644004317100512160000000416106720317573015163 0ustar marangetcristal#include #include typedef struct cell { int val; struct cell *next; } Cell, *Stack; Stack stack = NULL; Cell *cons(int val,Cell *next) { Cell *r; r = (Cell *)malloc(sizeof(Cell)); if ( r == NULL) { fprintf(stderr,"Plus de memoire\n"); exit(-1); } r->val = val; r->next = next; return r; } void afficher(void) { Stack p; printf("["); for (p=stack ; p != NULL ; p = p->next) { printf("%d",p->val); if (p->next != NULL) printf(", "); } printf("]"); } Tree pop(void) { Tree r; Stack tmp; if (stack == NULL) { fprintf(stderr,"Tentative de depiler une pile vide, adieu\n"); exit(-1); } r = stack->val; tmp = stack; stack = stack->next; free(tmp); return r; } void push(i) { stack = cons(i,stack); } void swap(void) { int t; if (stack == NULL || stack->next == NULL) return; t = stack->val; stack->val = stack->next->val; stack->next->val = t; return; } void down(void) { Stack p,q; if (stack == NULL) return; for (p = stack ; p->next->next != NULL ; p = p->next) ; q = p->next; p->next = NULL; q->next = stack; stack = q; } void up(void) { Stack p,q; if (stack == NULL || stack->next == NULL) return; for (p = stack ; p->next != NULL ; p = p->next) ; q = stack; stack = stack->next; q->next = NULL; p->next = q; } void main(void) { char pgm[] = "4321ud"; char c; int i; int r1,r2; printf(" "); afficher(); printf("\n"); for(i=0; pgm[i] != '\0'; i++) { c = pgm[i]; switch (c) { case '+': r1 = pop(); r2 = pop(); push(r2+r1); break; case '-': r1 = pop(); r2 = pop(); push(r2-r1); break; case '*': r1 = pop(); r2 = pop(); push(r2*r1); break; case '/': r1 = pop(); r2 = pop(); push(r2/r1); break; case 's': swap(); break; case 'd': down(); break; case 'u': up(); break; default: if ('0' <= c && c <= '9') push(c - '0'); } printf("%c : ",c); afficher(); printf("\n"); } } hevea-2.23/examples/colorcir.eps0000644004317100512160000000431606614121561016727 0ustar marangetcristal%!PS-Adobe-2.0 EPSF-1.2 %%Title: colorcir.ps %%Creator: Ghostscript ps2epsi from colorcir.ps %%CreationDate: Oct 23 14:52 %%For:maranget maranget %%Pages: 1 %%DocumentFonts: Times-Roman %%BoundingBox: 9 33 290 319 save countdictstack mark newpath /showpage {} def %%EndProlog %%Page 1 1 %! 0.5 0.5 scale gsave /Times-Roman findfont 24 scalefont setfont 72 72 translate 0 0 moveto 1 0 0 setrgbcolor (Red) show 72 0 translate 0 0 moveto 0 1 0 setrgbcolor (Green) show 72 0 translate 0 0 moveto 0 0 1 setrgbcolor (Blue) show 72 0 translate 0 0 moveto 1 1 0 setrgbcolor (Yellow) show 72 0 translate 0 0 moveto 1 0 1 setrgbcolor (Pink) show 72 0 translate 0 0 moveto 0 1 1 setrgbcolor (Cyan) show 72 0 translate 0 0 moveto 0.9 0.9 0.9 setrgbcolor ('White') show grestore 0.0 setlinewidth /length 0.1 def /width 0.02 def /hsvcircle { gsave /h 0.0 def 0 4 360 { pop gsave 0.5 0.0 translate newpath 0.0 0.0 moveto length 0.0 lineto length width lineto 0.0 width lineto closepath h 1.0 1.0 sethsbcolor fill %newpath %0.0 0.0 moveto %length 0.0 lineto %length width lineto %0.0 width lineto %closepath %0.0 setgray %stroke grestore /h h 4 360 div add def 4 rotate } for grestore } def /graycircle { gsave /h -1.0 def 0 4 360 { pop gsave 0.5 0.0 translate newpath 0.0 0.0 moveto length 0.0 lineto length width lineto 0.0 width lineto closepath h abs setgray fill %newpath %0.0 0.0 moveto %length 0.0 lineto %length width lineto %0.0 width lineto %closepath %0.0 setgray %stroke grestore /h h 8 360 div add def 4 rotate } for grestore } def 0.0 setlinewidth 0.0 setgray 300 400 translate 500 500 scale 30 rotate 1.0 0.7 scale -30 rotate hsvcircle 0.8 0.8 scale graycircle 0.8 0.8 scale hsvcircle 0.8 0.8 scale graycircle 0.8 0.8 scale hsvcircle 0.8 0.8 scale graycircle 0.8 0.8 scale hsvcircle 0.8 0.8 scale graycircle 0.8 0.8 scale hsvcircle 0.8 0.8 scale graycircle 0.8 0.8 scale hsvcircle 0.8 0.8 scale graycircle 0.8 0.8 scale hsvcircle 0.8 0.8 scale graycircle showpage %%Trailer cleartomark countdictstack exch sub { end } repeat restore %%EOF hevea-2.23/examples/pat.def0000644004317100512160000005274607077105370015664 0ustar marangetcristal\makeatletter \typeout{``page''} % cedric: removed for llncs %page layout %\oddsidemargin 0cm %\evensidemargin 0cm %\topmargin 10pt %\headheight 0pt %\headsep 0pt %\footheight 0pt %\footskip 24pt %\textheight 24cm %\textwidth 15.5cm %\footnotesep 1cm %\baselineskip = 24pt plus 4pt minus 3pt %\voffset=-0.5cm %\hoffset=0.5cm \makeatother \makeatletter % on active et desactive le mode frtypo par \frtypotrue et frtypofalse % quelquesoit le mode les caract\`eres : ; ? ! sont actifs. % En particulier ces caract\`eres ne peuvent plus \^etre mis dans des % \'etiquettes. \def\halfspace{\kern .166em} \def\space@pv{\ifmmode ;\else \halfspace;\fi} \def\space@dc{\ifmmode :\else \halfspace:\fi} \def\space@pi{\ifmmode ?\else \halfspace?\fi} \def\space@pe{\ifmmode !\else \halfspace!\fi} \let\nospace@pv=; \let\nospace@dc=: \let\nospace@pi=? \let\nospace@pe=! \catcode`;=\active \catcode`:=\active \catcode`?=\active \catcode`!=\active \def \frtypo {\let;=\space@pv\let:=\space@dc\let!=\space@pe\let?=\space@pi} \def \entypo {\let;=\nospace@pv\let:=\nospace@dc\let!=\nospace@pe\let?=\nospace@pi} \frtypo \def\@sanitize {\@makeother\ \@makeother\\\@makeother\$\@makeother\&% \@makeother\#\@makeother\^\@makeother\^^K\@makeother\_\@makeother\^^A% \@makeother\%\@makeother\~\@makeother\;\@makeother\?\@makeother% \:\@makeother\!} \let \oldspecials \dospecials \def \dospecials {\oldspecials \do\:\do\!\do \?\do\;} %\scrollmode \makeatletter %=========================================================================== % Personals macros (They might have strange latex side effects %----------------- \def\noparindent{\everypar={\hskip -\parindent\everypar={}}} \def \para {\medskip\noparindent} \def \pari {\medskip\noparindent} \def \parii {\smallskip\noparindent} \let\paro=\noparindent %=========================================================================== % Definitions Theorems %--------------------- \newif \iffrench \if \csname french\endcsname \relax \frenchfalse \else \frenchtrue\fi \if \csname definition\endcsname\relax \newtheorem{definition}{D\iffrench \'e\else e\fi finition}\fi \def\bdf{\begin{definition}\begin{em}} \def\edf{\ifvmode\vskip-\lastskip\nopagebreak\else \penalty 100\fi\end{em}\end{definition}} \if \csname theorem\endcsname\relax \newtheorem{theorem}{\iffrench Thorme\else Theorem\fi}\fi \def\bthm{\begin{theorem}} \def\ethm{\end{theorem}} \newtheorem{algorithm}{Algorithm\if\french e\else\fi} \def\balgo{\begin{algorithm}} \def\ealgo{\end{algorithm}} \if \csname proposition\endcsname\relax \newtheorem{proposition}{Proposition}\fi \def\bprop{\begin{proposition}} \def\eprop{\end{proposition}} \if \csname lemma\endcsname\relax \newtheorem{lemma}[proposition]{Lemm\iffrench e\else a\fi}\fi \def\blem{\begin{lemma}} \def\elem{\end{lemma}} \if \csname corollary\endcsname\relax \newtheorem{corollary}[proposition]{Corollary}\fi \def\bcor{\begin{corollary}} \def\ecor{\end{corollary}} \def\brmk{\trivlist \item[\hskip \labelsep {\bf {Note}}]} \def\ermk{\endtrivlist} \newtheorem{Note}{Note} \def\bnote{\begin{note}\begin{em}} \def\enote{\end{em}\end{note}} \if \csname example\endcsname\relax %\newtheorem{example}[remark]{Ex\iffrench a\else e\fi mple}\fi \newtheorem{example}{Ex\iffrench a\else e\fi mple}\fi \def\bxple{\trivlist \item[\hskip \labelsep {\bf {Example}}]} %{\begin{example}\begin{em}} \def\exple{\endtrivlist} %{\end{em}\end{example}} \def\@begintheorem#1#2{\it \trivlist \item[\hskip \labelsep{\bf #1\ #2}]} \def\@opargbegintheorem#1#2#3{\it \trivlist \item[\hskip \labelsep{\bf #1\ #2\ (#3)}]} \def\@endtheorem{\endtrivlist} \newcount \indemo \def \makeno #1{\global \advance \indemo by 1\global \expandafter \edef \csname demo/\the\cdemo/#1\endcsname{\the\indemo}} \def \refno #1{\if \relax\csname demo/\the\cdemo/#1\endcsname \relax \write0 {Demo counter #1 undefined}??\else \csname demo/\the\cdemo/#1\endcsname\fi} \def \labno #1{\makeno {#1}\refno {#1}} \newif \ifdemo \demotrue \newcount \cdemo \newenvironment{demo}{\bdemo}{\edemo} \def\bdemotrue{\trivlist \item[\hskip \labelsep {\underline {\iffrench Preuve\else Proof\fi}:}]\advance\cdemo by 1\indemo 0} \def\edemo{\penalty 100\hfill\rule{2mm}{2mm} \endtrivlist\@doendpe} \long \def \bdemofalse #1\edemo{\relax} \outer \def \bdemo {\ifdemo \bdemotrue \else \expandafter \bdemofalse \fi\indent} \newif \ifhint \hintfalse \newtheorem{hint}{\rm \underline {Hint}} \def\bhintiftrue{\trivlist \item[\hskip \labelsep {\underline {Hint}:}]} \def\ehint{\penalty 100\hfill\noindent\rule{2mm}{2mm}\endtrivlist} \long \def \bhintiffalse #1\ehint{\relax} \outer \def \bhint {\ifhint \bhintiftrue \else \expandafter \bhintiffalse \fi} \newif \ifexpert \expertfalse \newtheorem{expert}{Remark} \def\bexpertiftrue{\trivlist \item[\hskip \labelsep {\underline {Hint}:}]} \def\eexpert{\penalty 100\hfill\noindent\rule{2mm}{2mm}\endtrivlist} \long \def \bexpertiffalse #1\eexpert{\relax} \outer \def \bexpert {\ifexpert \bexpertiftrue \else \expandafter \bexpertiffalse \fi} \def\notitle{\hskip\hsize minus\hsize\nobreak\hbox{}} \def\notation{\paragraph*{Notation}} \def\hypothesis{\paragraph*{Assumption}} \def \caseparagraph{\@startsection {case}{6}{\z@}{1.5ex plus .3ex minus .2ex}{-1em}{\normalsize\bf}} \def \subcaseparagraph{\@startsection % {subcase}{7}{\parindent}{1.5ex plus .3ex minus .2ex}{-1em}{\normalsize\bf}} {subcase}{7}{\z@}{1.5ex plus .3ex minus .2ex}{-1em}{\normalsize\bf}} \if \csname datefrench\endcsname\relax \def \langcase {Case} \def \langsubcase {Subcase} \else \def \langcase {Cas} \def \langsubcase {Sous-cas} \fi \def\case#1{\caseparagraph*{\langcase\space #1:}} \def\othercase#1{\caseparagraph*{#1:}} \def\mathcase#1{\caseparagraph*{\langcase\space $#1$:}} \def\subcase#1{\subcaseparagraph*{\langsubcase\space #1:}} % Send a warning when running latex \def\warning#1{\immediate\write0{Warning: #1}} \newenvironment{care}{\bwarning}{\ewarning} \def\bcare{\trivlist \item[\hskip \labelsep {\bf Warning!}]} \def\ecare{\endtrivlist} \def\subst#1#2{^{#1} \!/\! _{#2}} \def \comment #1{{\em #1}} %\def \comment #1{} \makeatother \makeatletter %%% To change size in math mode \let\Ts=\textstyle \let\Ds=\displaystyle \let\Ss=\scriptstyle %%% Abrevs \let \comp \circ \let \wild \_ %%% To put text between two formulas on the same line \def\text#1{\qquad\hbox{#1}\qquad} %%% Macros for mathematics %% Special symbols \def \nat {{\mathord{I\kern -.33em N}}} \def \natb {{\mathord{I\kern -.33em\overline{N}}}} \def\Vdash {\mathrel{\hbox{\vrule\kern .1ex$\vdash$}}} \def\VVdash {\mathrel{\hbox{\vrule\kern .2ex\vrule\kern .1ex $\vdash$}}} % An open box to end demonstrations with \def\Box{\hbox {\vbox {\hrule height .033em \hbox to .5em {\vrule width .033em \hbox{\vbox to .5em{\vss}\hss} \vrule width .033em} \hrule height .033em }}} %% Balanced symbols \def\absolute#1{\mathopen\mid#1\mathclose\mid} %% Operators \def \domain {\dv} %\def \domain {\dvmathop{\sl dom\,}} \def \image {\mathop{\sl im\,}} \def \modulo {\mathbin{\rm modulo}} \def \inverse{{}^{-1}} \def \cardinal {{\sl Card\,}} %\def \restrict #1{\mathbin{\mid}_{#1}} \def \restrict {\mathbin{\hbox{$\mid$\kern-.24em\lower.09em\hbox{\rm\char'22}$\!$}}} \let \arity = \varrho %% Quantifiers \def \fall #1,{\forall #1,\;} \def \exist #1,{\exists #1,\;} \def \qt #1.{\forall\,#1.\,} \def \ex #1.{\exists\,#1.\,} %% Arrows \let\ar=\rightarrow \let\dar=\Rightarrow \def\imply{\Longrightarrow} \def \rewrite {\mathrel{-}\joinrel\leadsto} %% Equalities %\def \axiom {\mathrel {\mathop =^!}} \def \axiom {=} \def \eqdef {\mathrel {\mathop {=\joinrel=}\limits^{def}}} %% Sizes \def\({\left(} \def\){\right)} \def\Mid{\mathrel{\Big|}} %% Indices see also indices.def \def \ind #1#2{_{#1\in[1,#2]}} %% %% names \let \th \vdash \let \tth \Vdash \let \ttth \VVdash \let \thh \models \def\Cal#1{{\cal #1}} \let \eset = \emptyset %% Aligned constructions in math mode % For internal use only \def\noskip{\lineskiplimit=\the\lineskiplimit \lineskip=\the\lineskip} \def\moreskip{\lineskiplimit=0.4em\lineskip=0.4em plus 0.2em} \def\moremoreskip{\lineskiplimit=1.2em\lineskip=1.2em plus 0.2em} \def\vatrix#1{\null\,\vcenter{\normalbaselines\moreskip\m@th \let \and \cr \ialign{$\displaystyle##$\hfil &\quad$\displaystyle##$\hfil&\quad##\hfil\crcr \mathstrut\crcr\noalign{\kern-\baselineskip} #1\crcr\mathstrut\crcr\noalign{\kern-\baselineskip}}}\,} % A sequence of expressions is writen on separate lines to form one expression \def \band #1{\left\{\vatrix{#1}\right.} % brace and \def \wand #1{\wedge\band{#1}} % wedge and \def \vand #1{\vee\band{#1}} % vee and \def \vor #1{\vee\left[\vatrix{#1}\right.} % vee and or \def \Wand #1{\bigwedge\band{#1}} % big wedge and \def \Vand #1{\bigvee\band{#1}} % big vee and \def \Wor #1{\bigvee\left[\vatrix{#1}\right.} % big vee and % A general usage tabulation in math mode. % Indentation is alternatively left and right, so that good place for % tabs will produce many different % \dalign { & blabla :& blabla \cr % & bla :& blablabla \cr % } % \dalign { blabla :&& blabla \cr % bla : && blablabla \cr % } % \dalign { & blabla :& blabla \cr % & bla :& blablabla \cr % } % Internal and personal use \def\Dalign#1#2{\vcenter \bgroup \let\>=\qquad \def\title##1{\crcr\noalign{\medskip}\multispan#1{\hfil\bf##1\hfil}} % \halign{$##$\hfil\qquad&&\hfil$##{}$&${}##$\hfil\qquad\cr#2\crcr} % \halign{$##$\hfil&&\qquad\hfil$##{}$&${}##$\hfil\cr#2\crcr} \halign{&${}##$\hfil&\hfil$##{}$\cr#2\crcr} \egroup} % End internal use \def\align#1{\vcenter \bgroup \let\>=\qquad \halign{#1\crcr} \egroup} %\def\aligndef#1#2{\expandafter\def\csname aligndef#1\endcsname{#2}} %\aligndef ]{\argalign} %\aligndef l{&\hfil$##{}$} %\aligndef r{&${}##$\hfil} %\aligndef c{&\hfil$##$\hfil} %\aligndef -{\qquad} %\aligndef L{&\hfil##$} %\aligndef R{&##\hfil} %\aligndef C{&\hfil##\hfil} %\def\argalign#1{\relax} %\def\prealign#1{\csname aligndef#1\endcsname\prealign} %\def\doalign#1]{\dohalign{\prealign#1]}} %\def\dohalign#1#2{\expandafter\halign{#1\cr#2\crcr}} %\def\dalign#1{\ifx#1[\doalign\else\Dalign3{#1}\fi} \def\dalign{\Dalign3} \def\Strut{\raise .4em\hbox{\strut}\raise -.4em\hbox{\strut}} \def \deftitle #1 {\def \title ##1 {\crcr\noalign{\medskip}\multispan#1{\hfil\bf##1\hfil}}} \bgroup \catcode `\^^M \active \gdef \obeycr {\catcode `\^^M\active \let ^^M\crcr} \egroup \ifx \csname linewidth\endcsname \hsize \let \realwidth \hsize \else \let \realwidth \linewidth \fi \def \oris {\crcr \mid&} \def \syntaxtable #1 {\def\is {::=&} \def \\{\cr\noalign{\medskip}}\def\cont{\cr&}\vbox \bgroup \tabskip=100pt plus 1000pt minus 1000pt \halign to \realwidth {\hfil$##{}$\tabskip=0pt& ${}##$\hfil \tabskip=100pt plus 1000pt minus 1000pt& &##\hfil \cr#1\crcr} \egroup} \def \assertions #1 {\deftitle2 \vbox \bgroup \halign {\hfil$##{}$&$##$\hfil&&\quad##\hfil\cr#1\crcr} \egroup} %%% old version \def\malign#1{\vcenter\bgroup \deftitle #1 \def \lign ##1\cr {\noalign {##1}} \def \textlign##1{\noalign {\medskip \vbox {\noindent ##1}\medskip}} \tabskip=100pt plus 1000pt minus 1000pt \halign to \realwidth {\hfil$##{}$\tabskip=0pt& ${}##$\hfil \tabskip=100pt plus 1000pt minus 1000pt& &##\hfil&$##$\hfil& \cr#1\crcr\egroup}} \newif \ifhsize \hsizefalse \newskip \nullskip \nullskip 0pt \newskip \fullskip \fullskip 100pt plus 1000pt minus 1000pt \def \maligntrue {\tabskip \fullskip \halign to \realwidth \bgroup} \def \malignfalse {\halign \bgroup} \def \malign {\vcenter \bgroup \ifhsize \expandafter \maligntrue \else \expandafter \malignfalse \fi} \def \endmalign {\crcr \egroup \egroup} \def \makeword #1#2#3{\expandafter \def \noexpand#3{#2 {#1\expandafter \let \expandafter \dummy\string #3}}} \let \vect \overrightarrow \def \uad {\hskip 0.5em} \newskip \mathandskip \newskip\mathmargin \mathmargin 0em \mathandskip 2em plus 0.5fil minus 0.5em \def \mathand {\hskip \mathandskip} \def \mathleftright {\hfill{}\hskip 0em plus -2fill\penalty 50{}\hfill} \def \mathandcr {\penalty 50\mathand} \def \mathcr {\penalty -10000\mathand} \def \mathcrleft {\hfill{}\hskip 0em plus -2fill\penalty -10000{}\hskip \mathmargin} \def \mathbreak {\penalty 50} \def \incrmargin #1{\advance\mathmargin by #1em\advance\mathmargin by #1em} \def \mathslash#1{\let \do \mathcrleft \ifx #1[\let\do\mathdoskip\fi\do#1} \def \mathdoskip#1#2]{\incrmargin {#2}\mathcrleft} % Type inference rules \let \mathmoreskip=\moremoreskip \def \nomoreskip {\let \mathmoreskip \relax} \def \bmaths {\let \and \mathandcr \hsize \realwidth \centering \vbox \bgroup \mathmoreskip \noindent $\displaystyle \let \\ \mathslash} \def \emaths {\unskip$\egroup} \def \mathflushleft {\def \emaths {\hfill$\egroup}\nomoreskip} \newenvironment {maths}{\bmaths}{\emaths} \def \maths #1{\bmaths #1\emaths} \def \whereis {\leftarrow} \def \where #1{[{\let \is \whereis #1}]} \def \dowhere #1\is#2\is{[\ifx#2\empty #1\else #2/#1\fi]} \def \where #1{\let \is \relax\dowhere #1\is\empty\is} \let \closeplus\relax \let \Empty \relax \let \is \relax \def \plus #1{\PLUS #1\is\is\END} \def \PLUS #1\is#2\is#3\END{\oplus\ifx #3\is (#1\plustoken#2)\else #1\fi} \let \plustoken \mapsto \let \diverge \uparrow \def \set #1{\{#1\}} \def \sem #1{\lbrack\!\lbrack#1\rbrack\!\rbrack} \def\mathrm #1{\mathrel {\rm #1}} \let \coerce \leq \makeatother \makeatletter %% see infer.doc for a documentation % Judgements \let\th=\vdash % naming \expandafter \ifx \csname name\endcsname\relax \def\name#1{\hbox{\sc #1}}\else \relax \fi \def \labname #1{{\rm(\name{#1})}} \let \lab = \labname \def \clab #1{\hbox {$\smash {\lab{#1}}$}} \newskip \beforelabskip \beforelabskip = 0.5em \def \eqlab {\eqno \lab} %% inside rules \def \nmir #1[#2]{\crcr \hrulefill \cr} \def \rmir #1[#2]{\crcr \hrulefill & \clab {#2} \cr} \def \lmir #1[#2]{\relax} \def \Lmir #1[#2]{\crcr \Llabo {#2}\hrulefill \cr} \def \Rmir #1[#2]{\crcr \hrulefill \Rlabo {#2}\cr} \def \imir {\crcr \hrulefill\cr} % outside rules \def \rlabo #1{\hskip \beforelabskip \clab {#1}} \def \llabo #1{\clab {#1}\hskip \beforelabskip} \def \Rlabo #1{\rlap {\rlabo {#1}}} \def \Llabo #1{\llap {\llabo {#1}}} \let \labr \rlabo \let \labl \llabo \let \labR \Rlabo \let \labL \Llabo \def \rlab #1 {\rlap {\lab {#1}}} \def \llab #1 {\llap {\lab {#1}}} % A good separator for multiple hypothesis \let \and \qquad \let \andcr \cr % Single rules \def \lessskip {\lineskiplimit=.3em\lineskip= .2em plus .1em} \makeatletter \def \mathrulename {\scriptsize \labname} \def \ignoredash #1{\let\next\ignoredash \ifx #1-\relax\else\let\next#1\fi\next} \def \mathrule {\@ifnextchar [{\mathrulelab}{\@mathrule}} \def \mathrulelab[#1]#2{\hbox {\vbox {\hbox {\mathrulename {#1}}\nointerlineskip\smallskip \hbox {$\@mathrule{#2}$}}}} \def \@mathrule #1{{\let \and \qquad \let \rlab \rl \let \llab \ll \def \mir {MiR}\def\endrule {EnDrUlE} \displaystyle \offinterlineskip \lessskip \bgroup \openrule \beginrule #1\mir \mir \endrule}} \def \beginrule #1\mir#2{#1\ifx #2\mir \let \next \finishrule \else \def \next {\middlerule\openrule \beginrule\ignoredash#2}\fi\next} \def\finishrule#1\endrule{\closerule\egroup} \def \openrule {\hbox \bgroup \vbox \bgroup \halign \bgroup \hfil $##$\hfil &\hskip \beforelabskip$##$\hfil \cr} \def \closerule {\crcr\egroup\egroup\egroup} %\def \endrule {\closerule \egroup} \def \singleRule {\crcr\noalign {\vskip -0.1em}\closerule \over} \let \middlerule \singleRule % Double and Tripple rules see infer-more.def % Logic and rewriterules \def \logicrule #1{\let \mir \Longrightarrow #1} \def \longleadsto {\mathrel{-}\joinrel\leadsto} \def \rewriterule #1{\displaystyle \offinterlineskip \lessskip \bgroup\let \mir \longleadsto \openrule#1\endrule} \def \suspend #1{\vbox to #1 {\leaders \hbox {$\cdot$}\vfill}} \if \relax \csname keywordstyle\endcsname \let \keywordstyle \tt \fi %\def \keyword #1{{\hbox {\keywordstyle #1}}} \def \keyword #1{{\keywordstyle #1}} \def \mathtoken #1{\ifmmode \mathopen{}\keyword {#1}\mathclose{}\else \keyword{#1}\fi} \def \mathpostfix #1{\mathrel{\keyword {#1}}\mathclose{}} \def \mathprefix #1{\mathopen{}\mathrel{\keyword {#1}}} \def \mathinfix #1{\mathrel{\keyword {#1}}} \def\ignorefirst #1{} \def \lwt #1{\expandafter \lowercase \expandafter \bgroup \expandafter \ignorefirst \string #1\egroup} \def \makeprefix #1#2{\expandafter\def \noexpand #1{\mathprefix {#2}}} \def \makepostfix #1#2{\expandafter\def \noexpand #1{\mathpostfix {#2}}} \def \maketoken #1#2{\expandafter\def \noexpand #1{\mathtoken {#2}}} \def \makeinfix #1#2{\expandafter\def \noexpand #1{\mathinfix {#2}}} \def \makein #1{\expandafter\def \noexpand #1##1in{\keyword {\lwt #1}\,\,##1\,\,\keyword {in}\,\,}} \let \@ \; \def \Let #1=#2in{\keyword {let}\@ {#1 = #2} \@\keyword {in}\@} \def \fun (#1){\keyword {fun}\@ #1 \rightarrow} \def \type #1=#2in{\keyword {type}\@ #1 = #2 \@\keyword {in}\@} \makeatother \let \cont \kappa \let \t \tau \let \l \ell \let \s \sigma \let \tv \alpha \let \vect \bar \def \Gen {{\rm Gen}} \def \tplus #1{\TPLUS #1\is\is\END} \def \TPLUS #1\is#2\is#3\END{\oplus\ifx #3\is (#1:#2)\else #1\fi} %%%%%%%%%%%%%%% light programs \makeatletter \def \progstyle {\tt} \newskip \programindent \programindent 4em \def \program {\par \begingroup \medskip \parindent \programindent \@tempswafalse \frenchspacing \@vobeyspaces \let \par \programpar \obeylines \progstyle \catcode``=13 \@noligs \let \do \@makeother \dospecials \catcode `\\ 0 \catcode `\{ 1 \catcode `\} 2 \prog@specials \prog@initspecials \obeyspaces} \def \programpar {\if@tempswa\hbox{}\fi\@tempswatrue\@@par} \bgroup \gdef \less@specials {\relax \catcode `| \active \catcode `< \active \catcode `> \active \catcode `- \active \catcode `\' \active } \gdef \more@specials {\relax \catcode `( \active \catcode `) \active } \gdef \prog@specials {\less@specials\more@specials} \prog@specials \gdef \prog@initspecials {\def -{\minus@program}\def '{\acurate@program}\def |{\bar@program}\def <{\less@program}\def >{\greater@program}\def ({\less@program}\def ){\greater@program}} \gdef \bar@@program {\let\do \eattoken \ifx \token >$\droite$\else ${}\mid{}$\let \do \relax\fi \do} \gdef \minus@@program {\let\do \eattoken \ifx \token >$\ar$\else -\let \do \relax\fi \do} \egroup \def \acurate@program {\futurelet \token \acurate@@program} \def \acurate@@program {\let \do \eattoken \ifx \token a$\alpha$\else \ifx \token b$\beta$\else \char `\' \let \do \relax\fi\fi \do} \def \less@program {\hbox{$<$}} \def \greater@program {\hbox{$>$}} \def \bar@program {\futurelet \token \bar@@program} \def \minus@program {\futurelet \token \minus@@program} \def \endprogram {\ifdim\lastskip >\z@ \@tempskipa\lastskip \vskip -\lastskip\fi\medskip \endgroup \@endpetrue} \def\prog {\begingroup \hbox \bgroup \catcode ``=13 \@noligs \let \do \@makeother \dospecials \progstyle \prog@specials \prog@initspecials \catcode `\\ 0 \catcode `\{ 1 \catcode `\} 2 \@prog} \def\@prog#1{\obeyspaces \frenchspacing \catcode `\ 10 \def\@tempa ##1#1{##1\egroup\endgroup}\@tempa} \makeatother %%%%%%%%%%%%%%%%%%% "quotations" \makeatletter % on active le cararectere " et on s'en sert pour le mode \prog % s'il est dfini ou \verb autrement \bgroup \@makeother \" \gdef \progquote {\prog"} \catcode `\" \active \gdef "{\progquote} \egroup \def \quoteon { \let \quote@sanitize \@sanitize \def \@sanitize {\quote@sanitize \@makeother\"} \let \quote@specials \dospecials \def \dospecials {\quote@specials \do\"} \def \quoteon {\catcode `\" \active}\quoteon} \def \quoteoff {\@makeother \"} \makeatother %%%%%%%%%%%%%%%% \def \lift #1{\;{}^{#1}} \def \inu #1{\lift {i \in 1..#1}} \def \jnu #1{\lift {j \in 1..#1}} %% typo \mathchardef \le "313C \mathchardef \ge "313E \mathcode `< "4268 \mathcode `> "5269 \catcode `\| \active \let \olspecials \dospecials \def \dospecials {\olspecials \do \|} %\def \droite {\mathrel {\,\hbox {\large$\triangleright$}\,}} \def \droite {\mathrel{\tt =}} \makeatletter \def |{\baractive} \def \baractive {\futurelet\token \next@baractive} \def \eattoken #1{} \def \next@baractive{\let\do\eattoken \ifx \token>\droite\else \mid \let \do \relax \fi \do} \def \Def #1in{\mathprefix {let}#1\mathinfix{in}} \def \Let#1in{\mathprefix {let}#1\mathinfix{in}} \def \Reply#1to{\mathprefix {reply}#1\mathinfix{to}} \def \>{\droite} \def \And {\mathrel{\tt and}} \def \tuple #1{{\tt (}#1{\tt )}} \def \<#1> {\tuple {#1}} \let \bcup \cup \let \thd \th \def \fv {fv} \def \defines {::} \def \produces #1{\Ds\mathop{\Longrightarrow}^{#1}} \def \reduces {\longrightarrow} \let \red \reduces \let \redcham \mapsto \let \plus \tplus \makeatother \def \dd {{\cal D}} \def \pp {{\cal P}} \def \dv {dv} \def \redsoupe {\mathrel {\mathop {\red} \limits^s}} \let \redstruct \rightleftharpoons \let \redchaud \rightharpoonup \let \redfroid \leftharpoondown \let \cool \leftharpoondown \let \heat \rightharpoonup \def\redstep{\mathrel{\mathpalette\redstepaux{}}} \def\redstepaux#1{\vcenter{\hbox{\ooalign{\hfil \raise2pt \hbox{$\rightharpoonup$}\hfil\cr\hfil \lower2pt\hbox {$\leftharpoondown$}\hfil\crcr $\longrightarrow$}}}} \let \redsoupe \red \let \redx \red \def \Comment #1{} \let \agree \approx \quoteon \maketoken \int {int} hevea-2.23/examples/fancy-test.tex0000644004317100512160000002170010071257024017171 0ustar marangetcristal \documentclass {article} \input{fancysection.hva} %\colorsections{20} %\definecolor{title}{named}{Blue} \usepackage {mathpartir} \usepackage {listings} \usepackage {array} \usepackage {url} \newif \ifhevea %HEVEA \heveatrue \ifhevea \usepackage {hevea} \fi \lstset {basicstyle=\tt} \let \lst \verb \title {Didier's Mathpartir} \author{Didier Remy} %\loadcssfile{x.css} %\setLATEXstyle{title}{background:green;color:black;font:helvetica} %\setHTMLstyle{H1.part}{background:green;color:white;font:helvetica} %\setLATEXstyle{section}{background:blue;color:white} %\setLATEXstyle{subsection}{background:blue;color:white} %\setHTMLstyle{H5}{background:cyan;color:black} %\setLATEXstyle{subparagraph}{background:magenta;color:white} %\setHTMLstyle{H3}{background:blue;color:white;font:sans-serif} %\setstyles{background:blue;color:white;font:sans-serif} %\setstyles{backgound:green} \begin{document} \maketitle \part{Only One Part} \section {The inferrule macro} The inferrule macro is designed to typeset inference rules. It should only\footnote {Even though the basic version may work in text mode, we discourage its use in text mode; the star-version cannot be used in text-mode} be used in math mode (or display math mode). The basic use of the rule is \begin{verbatim} \inferrule {one \\ two \\ three \\ or \\ more \\ premisses} {and \\ any \\ number \\ of \\ conclusions \\ as \\ well} \end{verbatim} This is the rendering on a large page \def \one {\inferrule {one \\ two \\ three \\ or \\ more \\ premisses} {and \\ any \\ number \\ of \\ conclusions \\ as \\ well} } $$ \ifhevea \one \else \fbox {\vbox {\advance \hsize by -2\fboxsep \advance \hsize by -2\fboxrule \linewidth\hsize $$\one$$}} \fi $$ However, the same formula on a narrower page will automatically be typsetted like that: \def \two {\inferrule {one \\\\ two \\ three \\ or \\\\ more \\ premisses} {and \\ any \\ number \\\\ of \\ conclusions \\\\ as \\ well} } $$ \ifhevea \two \else \fbox {\hsize 0.33 \hsize \vbox {$$\two$$}} \fi $$ An inference rule is mainly composed of a premisse and a conclusion. The premisse and the conclusions are both list of formulas where the elements are separated by \verb"\\". Note the dissymetry between typesetting of the premisses and of conclusions where lines closer to the center are fit first. A newline can be forced by adding an empty line \verb"\\\\" \begin{tabular}{m{0.44\hsize}m{0.1\hsize}m{0.44\hsize}} \begin{lstlisting}{Ocaml} \inferrule {aa \\\\ bb} {dd \\ ee \\ ff} \end{lstlisting} & ~~~ & $\inferrule {aa \\\\bb}{dd \\ ee \\ ff}$ \\ \end{tabular} \subsection {Single rules} Single rules are the default mode. Rules are aligned on their fraction bar, as illustrated below: $$ \inferrule {aa \\ bb}{ee} \hspace {4em} \inferrule {aa \\\\ bb \\ ee}{ee} $$ If the premise or the conclusion is empty, then the fraction bar is not typeset and the premise or the conclusion is centered: $$ \begin{tabular}{m{0.45\hsize}m{0.1\hsize}m{0.45\hsize}} \begin{lstlisting}{Ocaml} \inferrule {}{aa} + \inferrule {aa \\\\ aa}{} \end{lstlisting} & ~~~~~~~~ & $ \inferrule {}{aa} + \inferrule {aa \\\\ aa}{} $ \\ \end{tabular} $$ \paragraph{OOOOOH} Use use \verb"{ }" instead of \verb"{}" to get an axiom for instance: $$ \begin{tabular}{m{0.45\hsize}m{0.1\hsize}m{0.45\hsize}} \begin{lstlisting}{Ocaml} \inferrule { }{aa} + \inferrule {aa}{ } \end{lstlisting} & ~~~~~~ & \mbox {$ \inferrule { }{aa} + \inferrule {aa}{ } $} \\ \end{tabular} $$ \subparagraph{OOOOHOOOH} The macro \lst"\inferrule" acceps a label as optional argument, which will be typeset on the top left corner of the rule: \par \begin{tabular}{m{0.45\hsize}m{0.1\hsize}m{0.45\hsize}} \begin{lstlisting}{Ocaml} \inferrule [yop] {aa \\ bb} {cc} \end{lstlisting} & $\inferrule [Yop]{aa \\ bb}{cc}$ \\ \end{tabular} \par\noindent See section~\ref{options} for changing typesetting of labels. A label can also be placed next to the rule directly, since the rule is centered: \par \begin{tabular}{m{0.45\hsize}m{0.1\hsize}m{0.45\hsize}} \begin{lstlisting}{Ocaml} \inferrule {aa \\ bb} {cc} \quad (\textsc {Yop}) \end{lstlisting} & ~~~~~~ & $\inferrule{aa \\ bb}{cc} \quad (\textsc {Yop})$ \\ \end{tabular} \subsection {Customizing} By default, lines are centerred in inference rules. However, this can be changed by either \lst"\mprset{flushleft}" or \lst"\mprset{center}". For instance, \begin{tabular}{m{0.44\hsize}m{0.12\hsize}m{0.44\hsize}} \begin{lstlisting}{Ocaml} $$\mprset{flushleft} \inferrule {a \\ bbb \\\\ ccc \\ dddd} {e \\ ff \\ gg}$$ \end{lstlisting} & ~~~~~ & $$\mprset{flushleft} \inferrule {a \\ bbb \\\\ ccc \\ dddd}{e \\ ff \\ gg}$$ \\ \end{tabular} \noindent Note that lines are aligned independently in the premise and the conclusion, which are both themselves centered. In particular, left alignment will not affect a single-line premisse or conclusion. \subsection {Derivation trees} To help writing cascades of rules forming a derivation tree, inference rules can also be aligned on their bottom line. For this, we use the star-version: $$ \begin{tabular}{m{0.45\hsize}m{0.1\hsize}m{0.45\hsize}} \begin{lstlisting}{Ocaml} \inferrule* {\inferrule* {aa \\ bb}{cc} \\ dd} {ee} \end{lstlisting} & ~~~~~~ & $ \inferrule* {\inferrule* {aa \\ bb}{cc} \\ dd} {ee} $ \\ \end{tabular} $$ The star version can also take an optional argument, but with a different semantics. The optional argument is parsed by the \verb"keyval" package, so as to offer a set of record-like options: $$ \def \val {{\em v}} \def \arraystretch {1.4} \begin{tabular}{|>{\tt}c|p{0.7\hsize}|} \hline \bf key & \bf Effect for value {\val} \\\hline\hline before & Execute {\val} before typesetting the rule. Useful for instance to change the maximal width of the rule. \\\hline width & Set the width of the rule to {\val} \\\hline narrower & Set the width of the rule to {\val} times \verb"\hsize". \\\hline left & Put a label {\val} on the left of the rule \\\hline Left & Idem, but as if the label had zero width. \\\hline Right & As \verb"Left", but on the right of the rule. \\\hline right & As \verb"left", but on the right of the rule. \\\hline leftskip & Cheat by (skip negative space) {\val} on the left side. \\\hline rightskip & Cheat by {\val} on the right side of the rule. \\\hline vdots & Raise the rule by {\val} and insert vertical dots. \\\hline \end{tabular} $$ Here is an example of a complex derivation: $$ \inferrule* [left=Total] {\inferrule* [Left=Foo] {\inferrule* [Right=Bar, leftskip=2em,rightskip=2em,vdots=1.5em] {a \\ a \\\\ bb \\ cc \\ dd} {ee} \\ ff \\ gg} {hh} \\ \inferrule* [lab=XX]{uu \\ vv}{ww}} {(1)} $$ and its code \begin{lstlisting}{Ocaml} \inferrule* [left=Total] {\inferrule* [Left=Foo] {\inferrule* [Right=Bar, leftskip=2em,rightskip=2em,vdots=1.5em] {a \\ a \\\\ bb \\ cc \\ dd} {ee} \\ ff \\ gg} {hh} \\ \inferrule* [lab=XX]{uu \\ vv}{ww}} {(1)} \end{lstlisting} \def \L#1{\lower 0.4ex \hbox {#1}} \def \R#1{\raise 0.4ex \hbox {#1}} \def \hevea {H\L{E}\R{V}\L{E}A} \def \hevea {$\mbox {H}\!_{\mbox {E}}\!\mbox {V}\!_{\mbox {E}}\!\mbox {A}$} \subsection {Implementation} The main macro in the implementation of inference rules is the one that either premises and conclusions. The macros uses two box-registers one \verb"hbox" for typesetting each line and one \verb"vbox" for collecting lines. The premise appears as a list with \verb"\\" as separator. Each element is considered in turn typeset in a \verb"hbox" in display math mode. Its width is compare to the space left on the current line. If the box would not fit, the current horizontal line is transferred to the vertical box and emptied. Then, the current formula can safely be added to the horizontal line (if it does not fit, nothing can be done). When moved to the vertical list, lines are aligned on their center (as if their left-part was a left overlapped). At the end the vbox is readjusted on the right. This description works for conclusions. For premises, the elements must be processes in reverse order and the vertical list is simply built upside down. \section {Other Options} \label {options} The package also defines \verb"\infer" as a shortcut for \verb"\inferrule" but only if it is not previously defined. The package uses \verb"\TirName" and \verb"\RefTirName" to typeset labels, which can safely be redefined by the user. The former is used for defining occurrences ({\em ie.} in rule \lst"\inferrule") while the latter is used for referencing ({\em ie.} in the star-version). The vertical space in \verb"mathpar" is adjusted by \verb"\MathparLineskip". To restore the normal paragraph parameters in mathpar mode (for instance for some inner paragraph), use the command \verb"\MathparNormalpar". The environment uses \verb"\MathparBindings" to rebind \verb"\\", \verb"and", and \verb"\par". You can redefine thus command to change the default bindings or add your own. \end{document} hevea-2.23/examples/natbib.sty0000644004317100512160000011310010634250756016400 0ustar marangetcristal%% %% This is file `natbib.sty', %% generated with the docstrip utility. %% %% The original source files were: %% %% natbib.dtx (with options: `package,all') %% ============================================= %% IMPORTANT NOTICE: %% %% This program can be redistributed and/or modified under the terms %% of the LaTeX Project Public License Distributed from CTAN %% archives in directory macros/latex/base/lppl.txt; either %% version 1 of the License, or any later version. %% %% This is a generated file. %% It may not be distributed without the original source file natbib.dtx. %% %% Full documentation can be obtained by LaTeXing that original file. %% Only a few abbreviated comments remain here to describe the usage. %% ============================================= %% Copyright 1993-2007 Patrick W Daly %% Max-Planck-Institut f\"ur Sonnensystemforschung %% Max-Planck-Str. 2 %% D-37191 Katlenburg-Lindau %% Germany %% E-mail: daly@mps.mpg.de \NeedsTeXFormat{LaTeX2e}[1995/06/01] \ProvidesPackage{natbib} [2007/02/05 8.0 (PWD)] % This package reimplements the LaTeX \cite command to be used for various % citation styles, both author-year and numerical. It accepts BibTeX % output intended for many other packages, and therefore acts as a % general, all-purpose citation-style interface. % % With standard numerical .bst files, only numerical citations are % possible. With an author-year .bst file, both numerical and % author-year citations are possible. % % If author-year citations are selected, \bibitem must have one of the % following forms: % \bibitem[Jones et al.(1990)]{key}... % \bibitem[Jones et al.(1990)Jones, Baker, and Williams]{key}... % \bibitem[Jones et al., 1990]{key}... % \bibitem[\protect\citeauthoryear{Jones, Baker, and Williams}{Jones % et al.}{1990}]{key}... % \bibitem[\protect\citeauthoryear{Jones et al.}{1990}]{key}... % \bibitem[\protect\astroncite{Jones et al.}{1990}]{key}... % \bibitem[\protect\citename{Jones et al., }1990]{key}... % \harvarditem[Jones et al.]{Jones, Baker, and Williams}{1990}{key}... % % This is either to be made up manually, or to be generated by an % appropriate .bst file with BibTeX. % Author-year mode || Numerical mode % Then, \citet{key} ==>> Jones et al. (1990) || Jones et al. [21] % \citep{key} ==>> (Jones et al., 1990) || [21] % Multiple citations as normal: % \citep{key1,key2} ==>> (Jones et al., 1990; Smith, 1989) || [21,24] % or (Jones et al., 1990, 1991) || [21,24] % or (Jones et al., 1990a,b) || [21,24] % \cite{key} is the equivalent of \citet{key} in author-year mode % and of \citep{key} in numerical mode % Full author lists may be forced with \citet* or \citep*, e.g. % \citep*{key} ==>> (Jones, Baker, and Williams, 1990) % Optional notes as: % \citep[chap. 2]{key} ==>> (Jones et al., 1990, chap. 2) % \citep[e.g.,][]{key} ==>> (e.g., Jones et al., 1990) % \citep[see][pg. 34]{key}==>> (see Jones et al., 1990, pg. 34) % (Note: in standard LaTeX, only one note is allowed, after the ref. % Here, one note is like the standard, two make pre- and post-notes.) % \citealt{key} ==>> Jones et al. 1990 % \citealt*{key} ==>> Jones, Baker, and Williams 1990 % \citealp{key} ==>> Jones et al., 1990 % \citealp*{key} ==>> Jones, Baker, and Williams, 1990 % Additional citation possibilities (both author-year and numerical modes) % \citeauthor{key} ==>> Jones et al. % \citeauthor*{key} ==>> Jones, Baker, and Williams % \citeyear{key} ==>> 1990 % \citeyearpar{key} ==>> (1990) % \citetext{priv. comm.} ==>> (priv. comm.) % \citenum{key} ==>> 11 [non-superscripted] % Note: full author lists depends on whether the bib style supports them; % if not, the abbreviated list is printed even when full requested. % % For names like della Robbia at the start of a sentence, use % \Citet{dRob98} ==>> Della Robbia (1998) % \Citep{dRob98} ==>> (Della Robbia, 1998) % \Citeauthor{dRob98} ==>> Della Robbia % % % Citation aliasing is achieved with % \defcitealias{key}{text} % \citetalias{key} ==>> text % \citepalias{key} ==>> (text) % % Defining the citation mode and punctual (citation style) % \setcitestyle{} % Example: \setcitestyle{square,semicolon} % Alternatively: % Use \bibpunct with 6 mandatory arguments: % 1. opening bracket for citation % 2. closing bracket % 3. citation separator (for multiple citations in one \cite) % 4. the letter n for numerical styles, s for superscripts % else anything for author-year % 5. punctuation between authors and date % 6. punctuation between years (or numbers) when common authors missing % One optional argument is the character coming before post-notes. It % appears in square braces before all other arguments. May be left off. % Example (and default) \bibpunct[, ]{(}{)}{;}{a}{,}{,} % % To make this automatic for a given bib style, named newbib, say, make % a local configuration file, natbib.cfg, with the definition % \newcommand{\bibstyle@newbib}{\bibpunct...} % Then the \bibliographystyle{newbib} will cause \bibstyle@newbib to % be called on THE NEXT LATEX RUN (via the aux file). % % Such preprogrammed definitions may be invoked anywhere in the text % by calling \citestyle{newbib}. This is only useful if the style specified % differs from that in \bibliographystyle. % % With \citeindextrue and \citeindexfalse, one can control whether the % \cite commands make an automatic entry of the citation in the .idx % indexing file. For this, \makeindex must also be given in the preamble. % % Package Options: (for selecting punctuation) % round - round parentheses are used (default) % square - square brackets are used [option] % curly - curly braces are used {option} % angle - angle brackets are used