`texdrive` is an emacs minor-mode for adding mathematical equations to html-pages; things like Euler's , Pythagoras

and so on... It's a replacement for a little tool called *WebTex* that I wrote a few years ago.

- [2009-02-22] Version 0.2 released. Minor fixes.

M-x texdrive-insert-formula Formula: $P(A|B) = \frac{P(B|A)P(A)}{P(B|A)P(A) + P(B|\overline{A})P(\overline{A})}$ Title: bayes-theoremEt voilą; the following is inserted:

<img src="bayes-theorem.png" title="bayes-theorem" class="texdrive-formula" name="$P(A|B) = \frac{P(B|A)P(A)}{P(B|A)P(A) + P(B|\overline{A})P(\overline{A})}$" border="0">Now, all we need to do is texdrive-generate-images-from-html RET, and the corresponding image will be generated:

(require 'texdrive)to your

(texdrive-mode)This will enable two keybindings:

`C-c TAB f`for texdrive-insert-formula`C-c TAB g`for texdrive-generate-images

`texdrive-img-path`- the (relative) path where images are stored; if you store images in some`images/`directory on your webserver, you could set`texdrive-image-path`to that. Default is`""`;`texdrive-tmp-path`- determines where temporary files are stored; by default this is in`/tmp`, but you can set it to somewhere else if you don't trust the other users on your system.

*Why is it called 'texdrive'?*I don't know; have any better ideas?*What kind of LaTeX environment is texdrive using for the formulae?*It's using the single-$ math environment by default; if you want to use the '$$' environment, simply put '$' at the beginning/end of your formula;*I don't like the Computer Modern font that texdrive is using; how can I change it?*At this moment, you cannot change it without changing the texdrive source code, but it's pretty easy. Search for '\\usepackage' and add your favourite fontpackage there, as outlined in A Survey of Free Math Fonts for TeX and LaTeX;*I want to use texdrive to generate images from formulae*Use emacs in batch-mode; create a shell script**outside**emacs. How can I do that?`texdrive.sh`like:#!/bin/sh emacs -batch -nw --eval="(load-library \"~/.elisp/texdrive.el\")" --eval="(texdrive-create-png \"$1\" \"$2\")" 2>&1 | grep -v 'Loading\|Skipping'

Now, use$ texdrive.sh abc 'a^2 + b^2 = c^2'

to create`abc.png`. (Note: you'll probably need to update the path to 'texdrive.el'.)

© 2008 Dirk-Jan C. Binnema