I'm currently working on a little thing I called offline blog engine. The idea is to write my articles in simple (La)TeX files and create some static HTML files which contains the blog posts.
The infrastructure is written with an ant script. At the moment I'm having trouble to get HtLaTeX to work on my Windows 7 box (using MiKTeX 2.9).
HtLaTeX works just fine if I'm in the CLI in the directory with the article. E.g. If I'm currently in the directory C:\users\me\articles\ and there's one article article.tex:
C:\users\me\articles$> htlatex article.tex
Works just fine. It generates the formulas as PNGs, creates the css file and puts it in the current directory.
If I'm in a whole different directory and calling HtLaTeX with an absolute path it doesn't work. So,
C:\users\me\other\dir$> htlatex C:\uisers\me\articles\article.tex
just generates an log file containg this information:
This is pdfTeX, Version 3.1415926-2.4-1.40.13 (MiKTeX 2.9) (preloaded format=latex 2013.8.3) 18 AUG 2013 11:20
entering extended mode
**\makeatletter\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx\HCode\def\HCod
e##1{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\def\Link#1.a.b.c.{\g
@addto@macro\@documentclasshook{\RequirePackage[#1,html]{tex4ht}}\let\HCode\doc
umentstyle\def\documentstyle{\let\documentstyle\HCode\expandafter\def\csname te
x4ht\endcsname{#1,html}\def\HCode####1{\documentstyle[tex4ht,}\@ifnextchar[{\HC
ode}{\documentstyle[tex4ht]}}}\makeatother\HCode html.a.b.c.\input e:\Users\zo
mbie\Documents\Blog\articles\Zukunftsplanung.tex
! Emergency stop.
<*> ...keatother\HCode html.a.b.c.\input c:\Users
\me\articles\art...
End of file on the terminal!
Here is how much of TeX's memory you used:
4 strings out of 493922
56 string characters out of 3144897
49031 words of memory out of 3000000
3403 multiletter control sequences out of 15000+200000
3640 words of font info for 14 fonts, out of 3000000 for 9000
841 hyphenation exceptions out of 8191
4i,0n,3p,1b,8s stack positions out of 5000i,500n,10000p,200000b,50000s
No pages of output.
If I use relative paths some files more are generated (like the DVI file) but the html file and the mathematical formulas are missing too.
Any idea what's wrong here? Problem consist within ant script and from the CLI.
UPDATE: While escaping the backslashes didn't work, replacing them with regular slashes worked. (As David Carlisle suggested) But the PNGs of the formulas are missing. In the output they are generated but I can't find them.
The command looks like that:
C:\users\me\other\dir$> htlatex C:\users\me\articles\article.tex "html" "" "-dC:\users\me\articles\html"
Within the ant script it doesn't work because ant uses automatically the path devider of the current system and on windows it's backslash. (No problem, this call could be replaced by an batch file.)
make4htcan process files with absolute paths – michal.h21 Aug 18 '13 at 10:42