# Can I compile .tex to .html from within AUCTeX?

Can I compile .tex to .html from within AUCTeX? What are the keybindings?

Thanks!

-
What are you using to compile to html? latex2html? I don't know what options are available... –  Seamus Nov 30 '10 at 18:20
@Seamus I am using htlatex, but I am not committed to it; it doesn't play nicely with files generated by pdflatex. –  David Nov 30 '10 at 18:25

Well, you can do it directly from `emacs` without having to use AUCTeX: `M-x compile` and then change the `Compile command:` to the appropriate `latex2html` command. If you are going to be doing the .html rendering a lot, you can add the following code to the end of your .tex file:

``````% Local Variables:
% compile-command: "latex2html yourfile.tex"
``````

From then on, whenever you load your .tex file the `M-x compile` command will default to the correct `latex2html` command.

You can bind `M-x compile` to a keyboard shortcut by adding something like `(global-set-key "\C-xc" 'compile)` to your .emacs file.

-
will this work alongside Auctex? Currently, it loads PDFLatex major mode when I open a .tex file. –  David Nov 30 '10 at 18:27
I am fairly certain that it will not affect AUCTeX at all. –  ESultanik Nov 30 '10 at 18:32
Also, you can obviously put whatever command you want (e.g., `htlatex`) as the `compile-command`; it does not need to be `latex2html`. –  ESultanik Nov 30 '10 at 21:40