- Given below are 3
bat files, 3 cfg files and one tco file.
- Copy *.bat files to
C:\Program Files\MiKTeX 2.9\scripts\tex4ht\ folder.
- Copy *.cfg files to
C:\Program Files\MiKTeX 2.9\tex\latex\base\cfg\ folder.
- Note that you may have to create
tex4ht and cfg folders.
- Use MiKTeX Settings(Admin) and
Refresh FNDB
- Go to
TeXnicCenter -> Build -> Define Output Profiles -> Import tex4ht.tco
- Three (3) new output profiles will be created in
TeXnicCenter
LaTeX=>HTML2 and LaTeX=>MathJax profiles create *.html output files:
LaTeX=>MathML profile creates *.xml output file.
- Kindly improve the above by incorporating the code for pstricks and tikz.
latex2html.bat
REM @echo off
REM - windows batch file for converting latex to html
cd "%1"
htlatex %2 "html,mathml-"
@echo "Process Ended"
latex2mathjax.bat
REM @echo off
REM - windows batch file for converting latex to html using MathJax
cd "%1"
htlatex %2 "ht5mathjax,charset=utf-8,NoFonts" " -cunihtf -utf8"
@echo "Process Ended"
latex2mathml.bat
REM @echo off
REM - windows batch file for converting latex to xml
cd "%1"
mk4ht mzlatex %2 "html,pmathml,charset=utf-8,NoFonts" " -cunihtf -utf8"
@echo "Process Ended"
ht5mathjax.cfg
\Preamble{xhtml,mathml}
\Configure{VERSION}{}
\Configure{DOCTYPE}{\HCode{<!DOCTYPE html>\Hnewline}}
\Configure{HTML}{\HCode{<html>\Hnewline}}{\HCode{\Hnewline</html>}}
\Configure{@HEAD}{}
\Configure{@HEAD}{\HCode{<meta charset="UTF-8" />\Hnewline}}
\Configure{@HEAD}{\HCode{<meta name="generator" content="TeX4ht
(http://www.cse.ohio-state.edu/\string~gurari/TeX4ht/)" />\Hnewline}}
\Configure{@HEAD}{\HCode{<link
rel="stylesheet" type="text/css"
href="\expandafter\csname aa:CssFile\endcsname" />\Hnewline}}
\Configure{@HEAD}{\HCode{<script type="text/javascript"\Hnewline
src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"\Hnewline
></script>\Hnewline}}
\Configure{@HEAD}{\HCode{<style type="text/css">\Hnewline
.MathJax_MathML {text-indent: 0;}\Hnewline
</style>\Hnewline}}
\begin{document}
\EndPreamble
% From Michal Hoftich <michal.h21@gmail.com> on 2 Aug 2012
% by email with cc to tex4ht@tug.org
% Hoftich suggests the name mathjax.cfg
% His suggested command line:
% htlatex 1109.1881v2.tex "ht5mathjax, charset=utf-8,NoFonts" " -cunihtf -utf8"
% to produce html file
% Mods by William F. Hammond
% mk4ht mzlatex $1 "ht5mathjax"
html.cfg
Preamble{xhtml}
\Configure{VERSION}{}
\Configure{DOCTYPE}{\HCode{<!DOCTYPE html>\Hnewline}}
\Configure{HTML}{\HCode{<html>\Hnewline}}{\HCode{\Hnewline</html>}}
\Configure{@HEAD}{}
\Configure{@HEAD}{\HCode{<meta charset="UTF-8" />\Hnewline}}
\Configure{@HEAD}{\HCode{<meta name="generator" content="TeX4ht
(http://www.cse.ohio-state.edu/\string~gurari/TeX4ht/)" />\Hnewline}}
\Configure{@HEAD}{\HCode{<link
rel="stylesheet" type="text/css"
href="\expandafter\csname aa:CssFile\endcsname" />\Hnewline}}
\begin{document}
\EndPreamble
xhtml.cfg
\Configure{VERSION}{}
\Configure{DOCTYPE}{\HCode{<!DOCTYPE html>\Hnewline}}
\Configure{HTML}{\HCode{<html>\Hnewline}}{\HCode{\Hnewline</html>}}
\Configure{@HEAD}{}
\Configure{@HEAD}{\HCode{<meta charset="UTF-8" />\Hnewline}}
\Configure{@HEAD}{\HCode{<meta name="generator" content="TeX4ht
(http://www.cse.ohio-state.edu/\string~gurari/TeX4ht/)" />\Hnewline}}
\Configure{@HEAD}{\HCode{<link
rel="stylesheet" type="text/css"
href="\expandafter\csname aa:CssFile\endcsname" />\Hnewline}}
\begin{document}
\EndPreamble
tex4ht.tco
<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
<txcop:outputProfiles version="2" xmlns:txcop="http://schemas.ToolsCenter.org/TeXnicCenter/OutputProfiles.xsd">
<outputProfileList>
<outputProfile name="LaTeX=>MathJax" stopOnLatexError="false">
<texCommand execute="false" path="" arguments=""/>
<bibTexCommand execute="false" path="" arguments=""/>
<makeIndexCommand execute="false" path="" arguments=""/>
<preProcessors/>
<postProcessors>
<processor name="latex2mathjax" path="latex2mathjax.bat" arguments=""%dm" %nm" inputFile="" outputFile=""/>
</postProcessors>
<viewer path="firefox.exe" closeBeforeCompilation="false">
<viewProjectCommand type="commandLine">
<commandLineCommand path="firefox.exe" arguments="%bm.html"/>
<ddeCommand path="" server="" topic="System" command=""/>
</viewProjectCommand>
<viewCurrentFileCommand type="commandLine">
<commandLineCommand path="firefox.exe" arguments=""/>
<ddeCommand path="" server="" topic="System" command=""/>
</viewCurrentFileCommand>
<viewCloseCommand type="commandLine">
<commandLineCommand path="" arguments=""/>
<ddeCommand path="" server="" topic="System" command=""/>
</viewCloseCommand>
</viewer>
</outputProfile>
<outputProfile name="LaTeX=>HTML2" stopOnLatexError="false">
<texCommand execute="false" path="" arguments=""/>
<bibTexCommand execute="false" path="" arguments=""/>
<makeIndexCommand execute="false" path="" arguments=""/>
<preProcessors/>
<postProcessors>
<processor name="latex2html batch file" path="latex2html.bat" arguments=""%dm" %nm" inputFile="" outputFile=""/>
</postProcessors>
<viewer path="firefox.exe"" closeBeforeCompilation="false">
<viewProjectCommand type="commandLine">
<commandLineCommand path="firefox.exe"" arguments="%bm.html"/>
<ddeCommand path="" server="" topic="System" command=""/>
</viewProjectCommand>
<viewCurrentFileCommand type="commandLine">
<commandLineCommand path="firefox.exe"" arguments=""/>
<ddeCommand path="" server="" topic="System" command=""/>
</viewCurrentFileCommand>
<viewCloseCommand type="commandLine">
<commandLineCommand path="" arguments=""/>
<ddeCommand path="" server="" topic="System" command=""/>
</viewCloseCommand>
</viewer>
</outputProfile>
<outputProfile name="LaTeX => MathML" stopOnLatexError="false">
<texCommand execute="false" path="htlatex.exe " arguments="%bm.tex "html,mathplayer""/>
<bibTexCommand execute="false" path="" arguments=""/>
<makeIndexCommand execute="false" path="" arguments=""/>
<preProcessors/>
<postProcessors>
<processor name="latex2mathml" path="latex2mathml.bat" arguments=""%dm" %nm" inputFile="" outputFile=""/>
</postProcessors>
<viewer path="firefox.exe" closeBeforeCompilation="false">
<viewProjectCommand type="commandLine">
<commandLineCommand path="firefox.exe" arguments="%bm.xml"/>
<ddeCommand path="" server="" topic="System" command=""/>
</viewProjectCommand>
<viewCurrentFileCommand type="commandLine">
<commandLineCommand path="firefox.exe" arguments=""/>
<ddeCommand path="" server="" topic="System" command=""/>
</viewCurrentFileCommand>
<viewCloseCommand type="commandLine">
<commandLineCommand path="" arguments=""/>
<ddeCommand path="" server="" topic="System" command=""/>
</viewCloseCommand>
</viewer>
</outputProfile>
</outputProfileList>
</txcop:outputProfiles>
htlatex(from an editor? from the command line?) – Alan Munn Dec 27 '11 at 18:25htlatexfrom the command line (the black background window). So, in order to use it you have to open a command window, by typingcmdin the same search bar. And then you can typehtlatex C:\path\to\your\file\name.tex. That will create the HTML for you. – adn Dec 28 '11 at 02:54cmdconsole as an administrator, just right click and you will see the menu. – yannisl Jan 30 '12 at 21:27