experiments with latex generation for aoo presentation.
This commit is contained in:
parent
7cb6577797
commit
dbce392e8b
|
@ -15,7 +15,7 @@ theory
|
|||
OutOfOrderPresntn
|
||||
imports
|
||||
"Isabelle_DOF.Conceptual"
|
||||
keywords "text-" :: document_body
|
||||
keywords "text-" "textN" :: document_body
|
||||
begin
|
||||
|
||||
section\<open>Elementary Creation of Doc-items and Access of their Attibutes\<close>
|
||||
|
@ -54,13 +54,16 @@ fun gen_enriched_document_command2 cid_transform attr_transform
|
|||
val _ = Context_Position.reports ctxt
|
||||
[(pos, Markup.language_document (Input.is_delimited toks)),
|
||||
(pos, Markup.plain_text)];
|
||||
|
||||
val text = Thy_Output.output_document
|
||||
(Proof_Context.init_global thy)
|
||||
markdown toks
|
||||
val file = {path = Path.make [oid ^ "_snippet.tex"],
|
||||
|
||||
val file = {path = Path.make [oid ^ "_snippet.tex"],
|
||||
pos = @{here},
|
||||
content = Latex.output_text text}
|
||||
val _ = Generated_Files.write_file (Path.make ["latex_test"])
|
||||
|
||||
val _ = Generated_Files.write_file (Path.make ["latex_test"])
|
||||
file
|
||||
val _ = writeln (Latex.output_text text)
|
||||
in thy end
|
||||
|
@ -78,6 +81,37 @@ val _ =
|
|||
(ODL_Command_Parser.attributes -- Parse.opt_target -- Parse.document_source
|
||||
>> (Toplevel.theory o (gen_enriched_document_command2 I I {markdown = true} )));
|
||||
|
||||
(* copied from Pure_syn for experiments *)
|
||||
|
||||
fun output_document2 state markdown txt =
|
||||
let
|
||||
val ctxt = Toplevel.presentation_context state;
|
||||
val pos = Input.pos_of txt;
|
||||
val _ =
|
||||
Context_Position.reports ctxt
|
||||
[(pos, Markup.language_document (Input.is_delimited txt)),
|
||||
(pos, Markup.plain_text)];
|
||||
val txt' = Thy_Output.output_document ctxt markdown txt
|
||||
val _ = writeln (Latex.output_text txt')
|
||||
in Thy_Output.output_document ctxt markdown txt end;
|
||||
|
||||
fun document_command2 markdown (loc, txt) =
|
||||
Toplevel.keep (fn state =>
|
||||
(case loc of
|
||||
NONE => ignore (output_document2 state markdown txt)
|
||||
| SOME (_, pos) =>
|
||||
error ("Illegal target specification -- not a theory context"
|
||||
^ Position.here pos)))
|
||||
o
|
||||
Toplevel.present_local_theory loc
|
||||
(fn state => ignore (output_document2 state markdown txt));
|
||||
|
||||
|
||||
val _ =
|
||||
Outer_Syntax.command ("textN", \<^here>) "formal comment (primary style)"
|
||||
(Parse.opt_target -- Parse.document_source >> document_command2 {markdown = true});
|
||||
|
||||
|
||||
\<close>
|
||||
|
||||
|
||||
|
@ -92,24 +126,32 @@ text*[aaa::B]\<open>dfg\<close>
|
|||
text-[dfgdfg::B]
|
||||
\<open> Lorem ipsum ... @{thm [display] refl} _ Frédéric \textbf{TEST} \verb+sdf+ \<open>dfgdfg\<close> \<close>
|
||||
|
||||
|
||||
textN\<open> Lorem ipsum ... @{thm [display] refl} _ Frédéric \textbf{TEST} \verb+sdf+ \<open>dfgdfg\<close> \<close>
|
||||
|
||||
text-[asd::B]
|
||||
\<open>... and here is its application macro expansion:
|
||||
@{B [display] "dfgdfg"}
|
||||
\textbf{TEST}
|
||||
@{cartouche [display]
|
||||
\<open>text*[dfgdfg::B]
|
||||
\<open> Lorem ipsum ... @{thm refl} _ Frédéric \textbf{TEST} \verb+sdf+ \<open>dfgdfg\<close> \<close>
|
||||
\<close>}
|
||||
\<close>
|
||||
|
||||
text\<open>... and here is its application macro expansion:
|
||||
textN\<open>... and here is its application macro expansion:
|
||||
@{B [display] "dfgdfg"}
|
||||
\textbf{TEST}
|
||||
@{cartouche [display]
|
||||
\<open>text*[dfgdfg::B]
|
||||
\<open> Lorem ipsum ... @{thm refl} _ Frédéric \textbf{TEST} \verb+sdf+ \<open>dfgdfg\<close> \<close>
|
||||
\<close>}\<close>
|
||||
|
||||
textN\<open> \<^theory_text>\<open>definition df = ...
|
||||
\<close>
|
||||
@{theory_text [display] \<open>definition df = ...
|
||||
\<close>}
|
||||
@{cartouche [display] \<open> @{figure "cfgdfg"}\<close>} \<close>
|
||||
|
||||
(*<*)
|
||||
text\<open>Final Status:\<close>
|
||||
print_doc_items
|
||||
|
|
Loading…
Reference in New Issue