$ pdflatex foo.tex
For more information visit read this. You need to convert the tex
file into xml
and then html
and finally epub
:
$ latexml --dest=foo.xml foo.tex
$ latexmlpost --dest=foo.html foo.xml
$ ebook-convert foo.html foo.epub --language en --no-default-epub-cover