let pp_print_title lvl fmt str =
let pp_print_underlined c fmt str =
pp_print_string fmt str;
pp_print_newline fmt ();
pp_print_string fmt (String.make (String.length str) c)
in
if lvl = 1 then
pp_print_underlined '=' fmt str
else if lvl = 2 then
pp_print_underlined '-' fmt str
else
begin
(* ATX style *)
pp_print_string fmt (String.make lvl '#');
pp_print_string fmt str
end;
pp_print_endblock fmt ()