- | A.AttributedTerm (attr, t) ->
- aux_attribute mathonly xref pos prec uris t attr
- | A.Ident (literal, _) -> P.Mi (make_href xref [], to_unicode literal)
- | A.Num (literal, _) -> P.Mn (make_href xref [], to_unicode literal)
- | A.Symbol (literal, _) -> P.Mo (make_href xref uris, to_unicode literal)
- | A.Uri (literal, _) -> P.Mi (make_href xref [], to_unicode literal)
- | A.Literal l -> aux_literal xref prec uris l
- | A.Layout l -> aux_layout mathonly xref pos prec uris l
+ | A.AttributedTerm _ ->
+ aux_attributes xmlattrs mathonly xref pos prec t
+ | A.Num (literal, _) ->
+ let attrs =
+ (RenderingAttrs.number_attributes `MathML)
+ @ make_href xmlattrs xref
+ in
+ Mpres.Mn (attrs, literal)
+ | A.Symbol (literal, _) ->
+ let attrs =
+ (RenderingAttrs.symbol_attributes `MathML)
+ @ make_href xmlattrs xref
+ in
+ Mpres.Mo (attrs, to_unicode literal)
+ | A.Ident (literal, subst)
+ | A.Uri (literal, subst) ->
+ let attrs =
+ (RenderingAttrs.ident_attributes `MathML)
+ @ make_href xmlattrs xref
+ in
+ let name = Mpres.Mi (attrs, to_unicode literal) in
+ (match subst with
+ | Some []
+ | None -> name
+ | Some substs ->
+ let substs' =
+ box_of mathonly (A.H, false, false) []
+ (open_brace
+ :: (CicNotationUtil.dress semicolon
+ (List.map
+ (fun (name, t) ->
+ box_of mathonly (A.H, false, false) [] [
+ Mpres.Mi ([], name);
+ Mpres.Mo ([], to_unicode "\\def");
+ aux [] mathonly xref pos prec t ])
+ substs))
+ @ [ closed_brace ])
+ in
+ let substs_maction = toggle_action [ hidden_substs; substs' ] in
+ box_of mathonly (A.H, false, false) [] [ name; substs_maction ])
+ | A.Literal l -> aux_literal xmlattrs xref prec l
+ | A.UserInput -> Mpres.Mtext ([], "%")
+ | A.Layout l -> aux_layout mathonly xref pos prec l