On Mon, Nov 25, 2013 at 3:46 PM, Matej Kosik <5764c029b688c1c0d24a2e97cd764f@gmail.com> wrote:
I would like to define custom directives, that would enable me to write code like e.g. this:

Print.printf "regular %bold_on bold %bold_off regular %italic_on italic %italic_off"; 
[...]
Can somebody give me some advice how to create simple "parameterless format directives" (like those above)?

IIRC, this should work:

   let printer_bold_on k = k (fun oc -> output_string oc "blah")

to define the format directive %bold_on.

-- 
Jeremie