Skip to content

Instantly share code, notes, and snippets.

@nekketsuuu
Last active October 9, 2018 13:58
Show Gist options
  • Save nekketsuuu/91f8be0a79f3a75f9c3049909df1d155 to your computer and use it in GitHub Desktop.
Save nekketsuuu/91f8be0a79f3a75f9c3049909df1d155 to your computer and use it in GitHub Desktop.
Display the source blob
Display the rendered blob
Raw
@require: stdjabook
@import: matrix
document (|
title = {\SATySFi;で行列};
author = {\@nekketsuuu};
show-title = false;
show-toc = false;
|) '<
+math(${
\matrix!([
[${1}; ${2}; ${3}];
[${4}; ${5}; ${6}];
[${7}; ${8}; ${9}];
])
});
>
@require: math
@require: table
module Matrix : sig
direct \matrix : [(math list) list] math-cmd
end = struct
let-math \matrix elmss =
let body = text-in-math MathInner (fun ctx -> (
let cellss = fun t -> List.map (List.map (fun elm -> t#c {${#elm}})) elmss in
let grf = fun _ _ -> [] in
read-inline ctx {\tabular(cellss)(grf);}))
in ${\paren{#body}}
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment