It's been quite a while since I wrote any LaTeX, but you could compile a LaTeX document into ePub if you wanted to. In essence, LaTeX is the source code for the document, and the output is whatever target it is compiled to. So, if it is compiled to pdf, that is what you get, but nothing fundamental prevents it from compiling to other formats, given that someone writes the compiler.