src/Pure/Thy/thy_output.ML
changeset 61614 34978e1b234f
parent 61600 1ca11ddfcc70
child 61619 f22054b192b0
equal deleted inserted replaced
61613:e4194168a1eb 61614:34978e1b234f
   648     text_antiquotation @{binding cartouche});
   648     text_antiquotation @{binding cartouche});
   649 
   649 
   650 end;
   650 end;
   651 
   651 
   652 
   652 
       
   653 (* theory text with tokens (unchecked) *)
       
   654 
       
   655 val _ =
       
   656   Theory.setup
       
   657     (antiquotation @{binding theory_text} (Scan.lift Args.text_input)
       
   658       (fn {context = ctxt, ...} => fn source =>
       
   659         let
       
   660           val _ =
       
   661             Context_Position.report ctxt (Input.pos_of source)
       
   662               (Markup.language_outer (Input.is_delimited source));
       
   663 
       
   664           val keywords = Thy_Header.get_keywords' ctxt;
       
   665           val toks =
       
   666             Source.of_list (Input.source_explode source)
       
   667             |> Token.source' true keywords
       
   668             |> Source.exhaust;
       
   669           val _ = Context_Position.reports_text ctxt (maps (Token.reports keywords) toks);
       
   670         in
       
   671           implode (map Latex.output_token toks)
       
   672           |> (if Config.get ctxt display then Latex.environment "isabelle" else enclose "\\isa{" "}")
       
   673         end));
       
   674 
       
   675 
   653 (* basic entities *)
   676 (* basic entities *)
   654 
   677 
   655 local
   678 local
   656 
   679 
   657 fun basic_entities name scan pretty =
   680 fun basic_entities name scan pretty =