Search code examples
htmllatextexmaker

How to translate a Latex file into a HTML file?


I have begun to post in a new social network called PeakD, here, I can create several posts using HTML as an option. I don't know HTML, I would like not to have to learn HTML. But I know LaTex, I have been looking for a way to take my code in LaTex and translate it into an HTML code, then, copy and paste the result on the page, in this way I hope to get my equations and formulas in the post, I don't know if this can be possible, but I.'m going to try. This is my first question.

Is it possible to pass the code from LaTex to HTML and then copy and paste it into this page that says it has an HTML mode?

enter image description here

As you can see, the syntax to write on the page is very similar to Stack Overflow

I have been using Texmaker to code in latex long time ago so I look into its options to find some tool that could help me, I found something called Latex4htm, but I wasn't able to make it worked

enter image description here

When I hit the button "iniciar" (enter or go) this appears

enter image description here

Therefore, nothing happens, this is my second question.

How can I turn a LaTex code into an HTML code? or how can I do Texmaker does the conversion?

Thank you in advance.


Solution

  • You could use pandoc (documentation) at the terminal in the following way:

    pandoc input.tex -o output.html
    

    If you do not include the -o argument, the output will be displayed on the terminal. You might also include -t html5 if you want to make sure the output is in html.

    Be aware that you might have to make some tweaks on the output if your .tex input is too complex.