compile tex for ref