{"action":"created","issue":{"url":"https://api.github.com/repos/jgm/pandoc/issues/2679","labels_url":"https://api.github.com/repos/jgm/pandoc/issues/2679/labels{/name}","comments_url":"https://api.github.com/repos/jgm/pandoc/issues/2679/comments","events_url":"https://api.github.com/repos/jgm/pandoc/issues/2679/events","html_url":"https://github.com/jgm/pandoc/issues/2679","id":128404545,"number":2679,"title":"Prevent interpretation of TeX formulas","user":{"login":"baskerville","id":159419,"avatar_url":"https://avatars.githubusercontent.com/u/159419?v=3","gravatar_id":"","url":"https://api.github.com/users/baskerville","html_url":"https://github.com/baskerville","followers_url":"https://api.github.com/users/baskerville/followers","following_url":"https://api.github.com/users/baskerville/following{/other_user}","gists_url":"https://api.github.com/users/baskerville/gists{/gist_id}","starred_url":"https://api.github.com/users/baskerville/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/baskerville/subscriptions","organizations_url":"https://api.github.com/users/baskerville/orgs","repos_url":"https://api.github.com/users/baskerville/repos","events_url":"https://api.github.com/users/baskerville/events{/privacy}","received_events_url":"https://api.github.com/users/baskerville/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-01-24T15:26:18Z","updated_at":"2016-01-24T21:28:33Z","closed_at":null,"body":"I've written a script to convert embedded TeX math in EPUBs to SVG images (via *dvisvgm*) and I've noticed that *pandoc* converts formulas to HTML whenever it can, e.g.:\r\n\r\nIf *test.md* contains:\r\n```\r\n$$\\int_{-\\infty}^\\infty e^{-x^2} = \\sqrt{\\pi}$$\r\n\r\n$$n! = \\int_0^\\infty x^n e^{-x} dx$$\r\n```\r\nthen `pandoc -t html test.md` yields\r\n```html\r\n<p><br /><span class=\"math display\">$$\\int_{-\\infty}^\\infty e^{-x^2} = \\sqrt{\\pi}$$</span><br /></p>\r\n<p><br /><span class=\"math display\"><em>n</em>!=∫<sub>0</sub><sup>∞</sup><em>x</em><sup><em>n</em></sup><em>e</em><sup>−<em>x</em></sup><em>d</em><em>x</em></span><br /></p>\r\n```\r\nThe first formula is left alone but the second formula is interpreted as HTML.\r\n\r\nIf there a way to prevent *pandoc* from trying to translate TeX formulas to HTML?"},"comment":{"url":"https://api.github.com/repos/jgm/pandoc/issues/comments/174343200","html_url":"https://github.com/jgm/pandoc/issues/2679#issuecomment-174343200","issue_url":"https://api.github.com/repos/jgm/pandoc/issues/2679","id":174343200,"user":{"login":"jgm","id":3044,"avatar_url":"https://avatars.githubusercontent.com/u/3044?v=3","gravatar_id":"","url":"https://api.github.com/users/jgm","html_url":"https://github.com/jgm","followers_url":"https://api.github.com/users/jgm/followers","following_url":"https://api.github.com/users/jgm/following{/other_user}","gists_url":"https://api.github.com/users/jgm/gists{/gist_id}","starred_url":"https://api.github.com/users/jgm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jgm/subscriptions","organizations_url":"https://api.github.com/users/jgm/orgs","repos_url":"https://api.github.com/users/jgm/repos","events_url":"https://api.github.com/users/jgm/events{/privacy}","received_events_url":"https://api.github.com/users/jgm/received_events","type":"User","site_admin":false},"created_at":"2016-01-24T21:28:33Z","updated_at":"2016-01-24T21:28:33Z","body":"See the manual under \"Math rendering in HTML.\"  The\nconversion you mention is done in the writer.  There are\nvarious options you can use that will preserve the TeX\nsections, e.g. --mathjax.  You could  use one of those.\n\nA cleaner solution might be to write a pandoc filter,\nrather than using a script that operates on the output.\n(A filter would operate directly on the abstract\nrepresentation of the document, and you could easily\nhave it just affect Math sections and replace them with\nimages.)\n\n+++ Bastien Dejean [Jan 24 16 07:26 ]:\n>   I've written a script to convert embedded TeX math in EPUBs to SVG\n>   images (via dvisvgm) and I've noticed that pandoc converts formulas to\n>   HTML whenever it can, eg:\n>\n>   If testmd contains:\n>$$\\int_{-\\infty}^\\infty e^{-x^2} = \\sqrt{\\pi}$$\n>$$n! = \\int_0^\\infty x^n e^{-x} dx$$\n>\n>   then pandoc -t html testmd yields\n>\n><p><br /><span class=\"math display\">$$\\int_{-\\infty}^\\infty e^{-x^2} = \\sqrt{\\pi\n>}$$</span><br /> <br /><span class=\"math display\"><em>n</em>!=∫<sub>0</sub><sup>\n>∞</sup><em>x</em><sup><em>n</em></sup><em>e</em><sup>−<em>x</em></sup><em>d</em>\n><em>x</em></span><br /></p>\n>\n>   The first formula is left alone but the second formula is interpreted\n>   as HTML\n>\n>   If there a way to prevent pandoc from trying to translate TeX formulas\n>   to HTML?\n>\n>   —\n>   Reply to this email directly or [1]view it on GitHub.\n>\n>References\n>\n>   1. https://github.com/jgm/pandoc/issues/2679\n"}}