13.11.2015 Views

my Latex and Tex4ht cheat sheet

my Latex cheat sheet - 12000.org

my Latex cheat sheet - 12000.org

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

\subsection{problem 3}<br />

\lipsum[10]<br />

\ifdefined\HCode<br />

\TocAt{chapter,section} %turn on TOC<br />

\PauseCutAt{section} % do not SPLIT this section<br />

\fi<br />

%------------------------------<br />

\chapter{project}<br />

\ifdefined\HCode<br />

\else<br />

{ %turn on local TOC<br />

\startcontents[chapter]<br />

\printcontents[chapter]{}{1}{\setcounter{tocdepth}{1}}<br />

}<br />

\fi<br />

\section{introduction}<br />

\lipsum[10]<br />

\section{design}<br />

\lipsum[10]<br />

\section{appendix}<br />

\lipsum[10]<br />

\end{document}<br />

3.4 Using mathjax with htlatex<br />

htlatex can be made to use mathjax to render the math. These steps show how to that.<br />

Will show two ways to do this. Is first is by telling tex4ht to generate mathml into the HTML page, then<br />

load mathjax to render the mathml. The second way, is to tell tex4ht to just pass the latex code, as is, to the<br />

HTML page, <strong>and</strong> let mathjax worry about the whole thing.<br />

The second method above is better, since tex4ht has few issues with some of the mathml code for some math<br />

symbols it generates. The current issue with this method though, is that there is no way to tell tex4ht to pass<br />

the display math latex code to the HTML page. Only in-line latex code can be passed as is to the HTML page.<br />

Hence, as of now, only the first method is really of practical use.<br />

3.4.1 method one, tex4ht generates mathml<br />

Assume the latex file is foo.tex<br />

\documentclass{article}<br />

\begin{document}<br />

$\frac{a}{b}$<br />

\end{document}<br />

The file is compiled as<br />

htlatex example1.tex "nma.cfg,htm,charset=utf-8" " -cunihtf -utf8"<br />

where nma.cfg is<br />

55

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!