Corrected both finding `latex` and exporting

- A small typo when looking for `latex`, now works perfectly
- Added encoding/decoding when exporting to html