Add algorithm snippet for tex