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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

}}<br />

<br />

MathJax.Hub.Config({<br />

extensions: ["tex2jax.js"],<br />

jax: ["input/TeX", "output/HTML-CSS"],<br />

tex2jax: {<br />

\unexp<strong>and</strong>ed{inlineMath: [ ['$','$'], ["\\(","\\)"] ],}<br />

\unexp<strong>and</strong>ed{displayMath: [ ['$$','$$'], ["\\[","\\]"] ],}<br />

processEscapes: true<br />

},<br />

"HTML-CSS": { availableFonts: ["TeX"] }<br />

});<br />

<br />

\Configure{@HEAD}{\HCode{<br />

}}<br />

\Configure{@HEAD}{\HCode{<br />

.MathJax_MathML {text-indent: 0;}<br />

}}<br />

\begin{document}<br />

%this is used to pass latex directly to mathjax<br />

%thanks to CVR, see http://tug.org/pipermail/tex4ht/2011q2/000299.html<br />

\makeatletter<br />

\Configure{$}{}{}{\exp<strong>and</strong>after\getMath}%$<br />

\def\getMath#1${\relax$%<br />

\def\next{$#1$}%<br />

\HCode{\exp<strong>and</strong>after\strip@prefix\meaning\next}}<br />

\makeatother<br />

\EndPreamble<br />

3.5 How to make tex4ht <strong>and</strong> pdflatex work in the same file?<br />

There are number of ways to add htlatex comm<strong>and</strong>s to latex document. But the document has to still work<br />

with pdflatex.<br />

Here is one way to do it, using ifx<br />

\documentclass{report}<br />

\usepackage{hyperref}<br />

\begin{document}<br />

\tableofcontents<br />

\ifx\HCode\undefined \else<br />

\href{foo.htm}{HTML}<br />

\TocAt{chapter,section,subsection,subsubsection}<br />

\fi<br />

\chapter{chapter 1}<br />

\section{section 1 in chapter 1}<br />

\subsection{subsection 1 in section 1 in chapter 1}<br />

\subsection{subsection 2 in section 1 in chapter 1}<br />

\subsubsection{subsubsection 1 subsection 2 in section 1 in chapter 1}<br />

\end{document}<br />

57

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

Saved successfully!

Ooh no, something went wrong!