load("alt-display.mac");

define_alt_display(
	es_display2d(x), 
	block([display2d:true, alt_display1d:false, alt_display2d:false], mathml(?caddr(x))));

set_alt_display(1,es_display2d) $

(set_prompt('prefix, "prompt;>>",'suffix, "<<prompt;"), 
	define_alt_display( 
		es_display(x), 
		block([type], 
			type:op(x), 
			if type='?mtext then printf(true,"~%TEXT;>>~a<<TEXT;~%",first(x)) 
			else 
				if type=?mlabel 
				then (printf(true,"~%out;>>~%(~a)~%", first(x)), 
					es_display2d(x), 
					printf(true, "~%<<out;~%"))
				else 
					es_display2d(x))),
set_alt_display(2,es_display)) $

display2d:true $

