-let rec add_mpres_attributes new_attr = function
- | Mpresentation.Mobject (attr, box) ->
- Mpresentation.Mobject (attr, add_box_attributes new_attr box)
- | mpres ->
- Mpresentation.set_attr (new_attr @ Mpresentation.get_attr mpres) mpres
-and add_box_attributes new_attr = function
- | Box.Object (attr, mpres) ->
- Box.Object (attr, add_mpres_attributes new_attr mpres)
- | box -> Box.set_attr (new_attr @ Box.get_attr box) box
-
-let box_of mathonly spec attrs children =
- match children with
- | [t] -> add_mpres_attributes attrs t
- | _ ->
- let kind, spacing, indent = spec in
- let dress children =
- if spacing then
- NotationUtil.dress small_skip children
- else
- children
- in
- if mathonly then Mpresentation.Mrow (attrs, dress children)
- else
- let attrs' =
- (if spacing then RenderingAttrs.spacing_attributes `BoxML else [])
- @ (if indent then RenderingAttrs.indent_attributes `BoxML else [])
- @ attrs
- in
- match kind with
- | Ast.H ->
- if List.for_all eligible_math children then
- Mpresentation.Mrow (attrs',
- dress (List.map promote_to_math children))
- else
- mpres_of_box (Box.H (attrs',
- List.map box_of_mpres children))
-(* | Ast.H when List.for_all genuine_math children ->
- Mpresentation.Mrow (attrs', dress children) *)
- | Ast.V ->
- mpres_of_box (Box.V (attrs',
- List.map box_of_mpres children))
- | Ast.HV ->
- mpres_of_box (Box.HV (attrs',
- List.map box_of_mpres children))
- | Ast.HOV ->
- mpres_of_box (Box.HOV (attrs',
- List.map box_of_mpres children))
-
-let open_paren = Mpresentation.Mo ([], "(")
-let closed_paren = Mpresentation.Mo ([], ")")
-let open_bracket = Mpresentation.Mo ([], "[")
-let closed_bracket = Mpresentation.Mo ([], "]")
-let open_brace = Mpresentation.Mo ([], "{")
-let closed_brace = Mpresentation.Mo ([], "}")
-let hidden_substs = Mpresentation.Mtext ([], "{...}")
-let hidden_lctxt = Mpresentation.Mtext ([], "[...]")
-let open_box_paren = Box.Text ([], "(")
-let closed_box_paren = Box.Text ([], ")")
-let semicolon = Mpresentation.Mo ([], ";")