Fixed issues with latex and ipynb. Tests work.