# Exporting Latex code snippets into HTML when using Emacs org mode

Hi I recently stumbled upon Emacs' org mode for taking notes and I am interested in using it. I wish to keep my notes in an org file and publish them in html for reading.

But I also wish to include Latex formulae into my notes.

So far I have been able to export plain text in my org file into HTML and export latex notes in another org file into a latex pdf.

But Latex formulae are not displayed when I export my document to HTML. This is what I tried to get my Latex into HTML

    #+TITLE:     NOTES
#+AUTHOR:    [Smiling Buddha]
#+EMAIL:     xyz.notes@gmail.com
#+DATE:      2013-08-22 Thu
#+KEYWORDS:
#+LANGUAGE:  en
#+OPTIONS:   H:3 num:t toc:t \n:nil @:t ::t |:t ^:t -:t f:t *:t <:t
#+OPTIONS:   TeX:t LaTeX:nil skip:nil d:nil todo:t pri:nil tags:not-in-toc
#+INFOJS_OPT: view:nil toc:nil ltoc:t mouse:underline buttons:0 path:http://orgmode.org/org-info.js
#+EXPORT_SELECT_TAGS: export
#+EXPORT_EXCLUDE_TAGS: noexport
#+STARTUP: indent
#+LaTeX: \usepackage{amsmath}

#+BEGIN_LaTeX
\sqrt{x}  = 4
#+END_LaTeX


However the HTML document just displays the title of the document and the authors name.

Latex formula $\sqrt{x}=4$ is not generated. Does anyone know how to do this?

-

org-mode uses MathJax to typeset the TeX when exported to html. To that end, in your org file you should have something like Hello world $$e^{-i\pi) = 1$$ which should be exported correctly.

-

#+BEGIN_LaTeX ... #+END_LaTeX only applies when exporting to latex. It allows for backend specific code when exporting (by the same concept #+Begin_HTML ... #+END_HTML does the same for HTML code.
• Text within the usual LaTeX math delimiters. To avoid conflicts with currency specifications, single ‘$’ characters are only recognized as math delimiters if the enclosed text contains at most two line breaks, is directly attached to the ‘$’ characters with no whitespace in between, and if the closing ‘\$’ is followed by whitespace, punctuation or a dash. For the other delimiters, there is no such restriction, so when in doubt, use ‘(...)’ as inline math delimiters.