In academia many use TeX typesetting system for their writing needs. The route from LaTeX to PDF is well documented. I use LaTeX to write this blog that carries content in HTML format. Together, these routes are sufficient to serve all my writing needs – research paper submissions, class notes, text book (that I have begun writing), lecture presentation and internet writing. Some notes on the LaTeX to HTML route for blogging:
If you use WordPress as your blog software, typing in LaTeX is already enabled if your blog is hosted through their free http://wordpress.com acocunt. You need to type in your LaTeX commands between $latex… $. If you have a WordPress blog hosted in a separate domain, there are several options to enable math in your blog through LaTeX. If your server allows a latex installation (Dreamhost, my webhost, already runs an installation), enabling server side conversion of latex symbols to images is done through the LaTeXRender wordpress plugin. Other ways exist, when server side install of latex is not possible – see for instance, LaTeX Render as an offline tool or using CodeCogs equation editor.
The disadvantage of this method is that once the internet writing is done (and the blog posted), you are left with a text containing LaTeX markup along with other HTML markups (for list, images, links etc.). If you want this text to be reused in your class notes or research papers (as I require), you probably need to clean it up and reformat to suit those needs.
A better way is to use LaTeX to generate content once in your local computer that runs a TeX installation and convert the content either as PDF or HTML, as required.
Assuming we know to write in LaTeX, we would have our content in, say, a example.tex file. Using a default article class file, this file contains all the standard TeX markups for math equations using standard packages like amsmath, the hypperref package to create hyperlinks and the graphicx package for including and aligning images.
For converting this example.tex to example.html, we can use the TeX4ht package. This package comes with MikTeX 2.7, the TeX program for Windows. For earlier versions of MikTeX, a separate install of TeX4ht is necessary.
TeX4ht converts all LaTeX math markups into PNG images (default) using Image Magick software – which should be installed before running TeX4ht. The other orignial images used in the LaTeX file are retained in their formats. Hyperlink conversion is smooth.
The command line usage of TeX4ht can get tedious (but will definitely work), if you want to use the various features of TeX4ht while generating the HTML files. There is a TeXConverter program developed by Steve Meyer that allows TeX to HTML conversion through mouse clicks, with easy access to additional TeX4ht features including separate image directories and style files. The TeX Converter needs an initial configuration update, after which it should work fine with Win XP. In Windows Vista, for some reason the paths in the .ini file is not recognized. I am yet to find a work around.
But using TeX Converter or command line conversion are optional. Another way is to hack and add optional commands into your TeX editor program itself, to call TeX4ht tools to perform the conversion. I do this.
Following one of these conversion methods, we now have a file that is example.html
If you have a simple HTML based website or one that uses Blosxom to show the files in a blog format, you can simply ftp the example.html and the associated style files and images into the blog root folder and you are done.
Unfortunately, other feature-rich blog or content management software like WordPress, Drupal, Joomla use editors that don’t recognize some of the XHTML tags and indents generated by TeX4ht. If you do a copy paste of the HTML source of example.html into the text editor of these software, the XHTML is not cleaned and the final file looks ugly with hanging markups. To clean this XHTML properly, we could write separate Python scripts, if we are as smart as John Hawks. There are also some workarounds.
Simplest is this: open example.html in a web browser; copy the content directly from the browser and paste into the WYSIWYG type rich text editor of the blog or CMS software and save. For this you need to enable the rich text editor mode in these CMS tools. The content should now look fine. Of course, if you look at the content through the HTML editor (not the rich text editor), you can see the ugly indents and tags are retained. But the direct copy paste allows proper auto wrapping of the text.
Another way is to remove the TeX4ht generated tabs in the example.html source. Removing these tabs and indent wraps manually could be tedious. But there are text editors that do this clean-job for us. I recommend Notepad++, a remarkably powerful yet open source program. A crude way is to open the example.html file in Notepad++, choose Select All text and apply Join Lines command from the Edit menu. Copy the resulting content into your blog or CMS editor (in the HTML mode, not the rich text mode) and save. Your content should look fine. Of course, all the indent tags are retained but they will not be not visible in the browser.
Another way, if you use Notepad++, is to use HTML tidying script through the built-in TextFX plugin.
(If you use other text editors, HTML tidying is available as scripts separately in the HTML tidy project.)
To round off, you can use Notepad++ to Find/Replace the image folder link before each image filename that appears in example.html to match your blog image folder location (say, wp-content/uploads as default in WordPress). This action can be set as a macro. So once your example.html is ready, opening it in Notepad++ and two clicks and copy paste content, you are done.
For geeks: Notepad++ itself handles a host of files including TeX files with decent color markup. Custom user commands can be set in Notepad++ (through hot keys) for running latex or pdflatex for TeX to PDF conversions and running htrun or htlatex for TeX to HTML conversion. This way, Notepad++ serves as your single content generator and manipulator – at least in Windows.
Programs/scripts mentioned above
Code cogs wordpress plugin ; LaTeX Render an offline LaTeX to image conversion tool ; CodeCogs, a LaTeX equation editor ; Image Magick image editing software ; TeX4ht package for TeX to HTML conversion using MikTeX ;MikTeX 2.7, Windows TeX installation ; TeXConverter program ; Notepad++ text editor ; TextFX plugin for Notepad++ ; HTML tidy scripts for cleaning HTML documents.

The LHS figure is a geometric structure that satisfies the definition of a porous medium. Based on certain properties that we could measure, this porous medium can be considered homogeneous. Let us measure the volume fraction of the porous medium defined as the ratio of total volume of the pores and total volume occupied by the porous medium. For the two dimensional example porous medium the volume fraction reduces to a surface area fraction. The surface fraction can be defined as the ratio between the total area of one constituent of the porous medium (say, the white region in the figure) and the total area of the sample considered. Figure 1b illustrates a method to measure this surface fraction.
The Φ symbol on the ordinate represents the surface or volume fraction of the sample and the abscissa represents the increasing size of the measurement window. After the initial wiggles for small values of the measurement window, as the size of the sampling area (or volume) increases, the surface (or volume) fraction settles down to a certain fixed value, within certain percentage of error. For the example porous medium considered in the earlier figure, this happens beyond a sample area size represented as 4 (arbitrarily, not to scale). Beyond this size, any further increase in the sampling size should result in a fixed value for the surface fraction. In other words, beyond the visual resolution of this sampling area, the porous medium would exhibit homogeneity in terms of the property, surface (or volume) fraction.
In the figure, the surface (or volume) fraction measured in the sampling size marked 1 should remain invariant when tested at different locations of the larger sample. If it doesn’t satisfy the check, a larger sampling area (marked 2) should be tested as a suitable candidate.
The accompanying figure is reproduced from page 5 of [3]. It defines continuum using the density variation over a volume sampling for a ”continuous” medium. The analogy with what we discussed so far for a porous medium is obvious. 

