fix bugs of js and export to latex