Category Typesetting and algorithms