implementing flexible typesetting.