LaTeX2HTML Demonstration LaTeX Doc








\newcommand{\set}[1]{\left\{#1\right\}}

LaTeX2HTML Demonstration LaTeX Doc van abel [email protected] Southwest University 01/24/2013 Keywords. Latex, Html

摘要. This doc is the demonstration of LaTeX doc which can be directly use in a new post. You can copy and paste all the content of this document into a new post (in HTML mode), and see the demonstration.

目录
Contents
 1.  What did This Doc Do
 2.  How to Get this Doc
 3.  Itemize and Enumerate: How to List Stuffs
 4.  The Color Scheme: How to Colorize You Content
 5.  How to Write a Theorem
   5.1.  Definition, Lemma, Proposition, Theorem, Corollary…
     5.1.1.  Basic Usage of Environments
     5.1.2.  Assign a Name for Your Theorem
     5.1.3.  The Proof Environment
     5.1.4.  More Examples of Environments
   5.2.  The Problem, Answer Environments
   5.3.  The Exercise Environment
   5.4.  The Quote Environment
 6.  Auto Numbering and Referring Back
   6.1.  Auto Numbering and Referring Back to Equations
     6.1.1.  Basic Usage of Mathematical Environments
     6.1.2.  Auto Numbering Scheme of Equations
     6.1.3.  How to Numbered Equations by 3.a and 3.b

1. What did This Doc Do To demonstrate my plugins LaTeX2HTML, I write this demo-Doc of LaTeX, which can be compiled by LaTeX or PDFLaTeX on one hand, and can publish on your blog by directly copy and paste all the content into a new post in HTML mode.
2. How to Get this Doc This doc has published with the LaTeX2HTML plugin with version higher than 1.1.0, the LaTeX2HTML plugin can be download at WordPress.com.
3. Itemize and Enumerate: How to List Stuffs As you have already saw, we can list the element as
  • Firstly
  • Secondly
What’s more you can nest them, for example
  • Firstly
  • Secondly
    • The first item of Second
    • The second item of Second
      • The first item of the third item of second item
Enumerate works almost the same as itemize, except the style is different. For example replace enumerate in the above example with enumerate, then we get:
  1. Firstly
  2. Secondly
    1. The first item of Second
    2. The second item of Second
      1. The first item of the third item of second item
4. The Color Scheme: How to Colorize You Content Firstly, you must decide which class your content belonged to, the text content or the mathematics content, since these two classes are proceeded by different scheme, text is by latex2html and mathematics by mathjax.

Just as in Latex, the you can set a color for your formula, for example
\[
\color{red}{a+b},\quad\color{blue}{a+b},\quad\color{green}{a+b}
\]
\[
\frac{\color{cyan}{a+b}}{c+d}, \quad
\frac{a}{\color{magenta}{a+b}},\quad
\frac{a}{a+\color{yellow}{b}}
\]
On the other hand, if you want to give color for your text content, then you should use something like this:

red and blue and green and cyan and magenta and yellow.
5. How to Write a Theorem There are two group of environments, which proceed the content such as Theorem. One is used for a post, in which you mainly state something formally, just like you do in a research paper; The other is used for problem-discussion situation, in which you ask questions and hope for some examples and answers.

Of course the border is not so strict, for example the examp environment can used in both cases.

Here are the complete list of environments you can use (The example will be pop up at some time later), I take first few words of a environment to represent it, for example thm for Theorem:

  • First group: defn(Definition), lem(Lemma), prop(Proposition), thm(Theorem), cor(Corollary), rem(Remark), excs(Exercise), proof(Proof)
  • Second group: prob(Problem), answer(Answer)
  • Mixed: examp(Example), quote(Quotation)
I will go through the two group one by one, let’s begin with the first group.
5.1. Definition, Lemma, Proposition, Theorem, Corollary… 5.1.1. Basic Usage of Environments Here is an example of definition environment:
定义 1. Suppose that $(X,\mathcal M)$ and $(Y,\mathcal N)$ are measurable spaces,
and $f:X\to Y$ is a map. We call $f$ is measurable if for every $B\in\mathcal N$
the set $f^{-1}(B)$ is in $\mathcal M$.

The other is similar, just replace defn with any one of the above environment:
注记 1. If $Y$ is a topological space, and $\mathcal N$ is the $\sigma$-algebra of Borel sets,
then $f$ is measurable if and only if the following condition satisfied:
  • For every open set $V$ in $Y$, the inverse image $f^{-1}(V)$ is measurable.

5.1.2. Assign a Name for Your Theorem You can even assign a name to these environment, just as you did in latex, use [text] just behind the environment, for example:
引理 2 (fundamental lemma of integration). Let $\set{f_n}$ be a Cauchy sequence of step mappings. Then there exists a subsequence which converges pointwise almost everywhere, and satisfies the additional property: given $\eps$ there exists a set $Z$ of measure $<\eps$ such that this subsequence converges absolutely and uniformly outside $Z$.
5.1.3. The Proof EnvironmentThe following are the proof environment, and some more examples, if you are impatient to other contents, then just skip this subsection by click 5.2.
证明 . For each integer $k$ there exists $N_k$ such that if $m,n\geq N_k$, then \[ \|f_m-f_n\|_1< \frac{1}{2^{2k}}. \] We let our subsequence be $g_k=f_{N_k}$, taking the $N_k$ inductively to be strictly increasing. Then we have for all $m,n$: \[ \|g_m-g_n\|_1 \] We shall show that the series \[ g_1(x)+\sum_{k=1}^\infty\left(g_{k+1}(x)-g_k(x)\right) \] converges absolutely for almost all $x$ to an element of $E$, and in fact we shall prove that this convergence is uniform except on a set of arbitrarily small measure. Let $Y_n$ be the set of $x\in X$ such that \[ |g_{n+1}(x)-g_n(x)|\geq\frac{1}{2^n}. \] Since $g_n$ and $g_{n+1}$ are step mappings, it follows that $Y_n$ has finite measure. On $Y_n$ we have the inequality \[ \frac{1}{2^n}\leq|g_{n+1}-g_n| \] whence \[ \frac{1}{2^n}\mu(Y)=\int_{Y_n}\frac{1}{2^n}\leq\int_X|g_{n+1}-g_{n}|\leq\frac{1}{2^{2n}}. \] Hence \[ \mu(Y_n)\leq\frac{1}{2^n}. \] Let \[ Z_n=Y_n\cup Y_{n+1}\cup\cdots. \] Then \[ \mu(Z_n)\leq \frac{1}{2^{n-1}}. \] If $x\not\in Z_n$, then for $k\geq n$ we have \[ |g_{k+1}(x)-g_k(x)| \] and from this we conclude that our series \[ \sum_{k=n}^\infty\left(g_{k+1}(x)-g_{k}(x)\right) \] is absolutely and uniformly convergent, for $x\not\in Z_n$. This proves the statement concerning the uniform convergence. If we let $Z$ be the intersection of all $Z_n$, then $Z$ has measure $0$, and if $x\not\in Z$, then $x\not\in Z_n$ for some $n$, whence our series converges for this $x$. This proves the lemma.
5.1.4. More Examples of Environments
定理 3. Let $f_n$ be a Cauchy sequence in $\mathcal L^1$ which is $L^1$-convergent to an element $f$ in $\mathcal L^1$. Then there exists a subsequence which converges to $f$ almost everywhere, and also such that given $\eps$, there exists a set $Z$ of measure $< \eps$ such that the convergence is uniform on the complement of $Z$.
推论 4. An element $f\in\mathcal L^1$ has seminorm $\|f\|_1=\int_X|f|\rd\mu=0$ if and only if $f$ is equal to $0$ almost everywhere.
命题 5 (Monotone Convergence Theorem). Let $\set{f_n}$ be an increasing (resp. decreasing) sequence of real valued functions in $\mathcal L^1$ such that the integrals \[ \int_X f_n\rd\mu \] are bounded. Then $\set{f_n}$ is a Cauchy sequence, and is both $\mathcal L^1$ and almost everywhere convergent to some function $f\in\mathcal L^1$.
命题 6 (Fatou's Lemma). Let $\set{f_n}$ be a sequence of real valued non-negative functions in $\mathcal L^1$. Assume that \[ \liminf\|f_n\|_1 \] is exists (so is a real number $\geq0$). Then $\liminf f_n(x)$ exists for almost all $x$, the function $\liminf f_n$ is in $\mathcal L^1$, and we have \[ \int_X\liminf f_n\rd \mu\leq\liminf\int_X f_n\rd\mu=\liminf\|f_n\|_1. \]
5.2. The Problem, Answer Environments The second group of environments are provided for discussion, after all, this is a discussion platform. They are: prob for Problem, examp for Example, and answer for Answer. It almost works the same as the first group, for example
问题 1 (Egoroff's theorem). Assume that $\mu$ is $\sigma$-finite. Let $f:X\to E$ be a map and assume that $f$ is the pointwise limit of a sequence of simple maps $\set{\varphi_n}$. Given $\eps$, show that there exists a set $Z$ with $\mu(Z)< \eps$ such that the convergence of $\set{\varphi_n}$ is uniform on the complement of $Z$.
But, the differences between them is that, the answer is numbered with prob (the examp, excs, rem will numbered independently), to see this, for example:
解答 1.1. Assume first that $\mu(X)$ is finite. Let $A_k$ be the set where $|f|\geq k$. The intersection of all $A_k$ is empty so their measures tend to $0$. Excluding a set of small measure, you can assume that $f$ is bounded, in which case $f$ is in $\mathcal L^1(\mu)$ and you can use the fundamental lemma of integration.
解答 1.2. This is another answer for the problem.
You should note that the number of answer is reset to 1 by prob, of course, more sensible. For example:
问题 2. Why we should firstly process the positive measurable functions, then the real measurable functions and at last the complex measurable functions for the integral of measurable functions?
There are the answers for this problem:
解答 2.1. In fact, you can define the integral of complex function directly.
解答 2.2. There is another more instructive answer...
5.3. The Exercise Environment Maybe, at somewhere, you want the reader consider about something, then you can use excs environment for Exercise. Please keep in mind that it will have independent numbering, just as prob, but will not reset the number of answer. Here is an example:
习题 1. Suppose $(X,\mu)$ is a measure space, and that $f$ is measurable, then $\int_X f\rd \mu=0$ if and only if $f\equiv0$ almost everywhere.
5.4. The Quote Environment Sometimes, there are some words or comments on the content, it is like a remark, but it is not so formal. And, if you are write a lecture notes, these words may be the lecturer said before or after an important thing, such as theorems. I have defined a new environment quote to deal with these stuff. For example: Before the theorem
定理 7. Let $\Omega\subset\R^n$ and $u:\Omega\to\R$, then
  1. If $u\in C^2(\Omega)$ is harmonic in $\Omega$, then $u$ satisfies MVP;
  2. If $u\in C(\Omega)$ satisfies MVP, then $u$ is smooth and harmonic.
we want to add a comment on it, then you can use
A function satisfying mean-value properties is only required to be continuous. However, a harmonic function is required to be $C^2$. Thus, the equivalence of this two kind of functions will be significant.
6. Auto Numbering and Referring Back 6.1. Auto Numbering and Referring Back to Equations 6.1.1. Basic Usage of Mathematical EnvironmentsAll the mathematical environments: equation, align, multline, gather will auto-numbering. For example \begin{equation}\begin{cases} 3=2x+y\\ 3=y+2x\end{cases} \end{equation} An example of multline, which will make the last line flush right: \begin{multline} \int_a^b \biggl\{ \int_a^b [ f(x)^2 g(y)^2 + f(y)^2 g(x)^2 ] -2f(x) g(x) f(y) g(y) \,dx \biggr\} \,dy \\ =\int_a^b \biggl\{ g(y)^2 \int_a^b f^2 + f(y)^2 \int_a^b g^2 - 2f(y) g(y) \int_a^b fg \biggr\} \,dy \end{multline} The next example will show how to numbered the equation at a given line: \begin{gather} \begin{split} \varphi(x,z) &= z – \gamma_{10} x – \sum_{m+n\ge2} \gamma_{mn} x^m z^n\\ &= z – M r^{-1} x – \sum_{m+n\ge2} M r^{-(m+n)} x^m z^n \end{split}\tag{4}\\ \begin{split} \zeta^0 &= (\xi^0)^2, \\ \zeta^1 &= \xi^0 \xi^1 \end{split}\notag \end{gather} 6.1.2. Auto Numbering Scheme of EquationsI hope you have already noticed that the above equations are numbered automatically, in fact, this is my first goal to write a plugin to proceed the latex code. Mathjax proceed mathematical perfectly, the only non-advantage is that it can't automatically add number for equations. When I got a way to add number for the equations automatically, I found that I can go a litter far
  1. automatically numbering theorems, which can be realize by set CSS's before element with a counter, but it may not work for IE6;
  2. automatically numbering sections, and which can produce a table of contents, as you have already see.
6.1.3. How to Numbered Equations by 3.a and 3.bHere is an example with varied number: \begin{align} x^2+y^2&=z^2,\quad{x,y,z\in\mathbb{Z}}\tag{5.a}\\ x^3+y^3&=z^3,\quad{x,y,z\in\mathbb{Z}}\tag{5.b} \end{align} \begin{equation} x^4+y^4=z^4,\quad{x,y,z\in\mathbb{Z}}\tag{7.a.b} \end{equation} For example, if you write another equation, which you would like to numbered automatically, then this equation will be numbered as (8) in the present situation, since we already used 7 in 7.a.b. For example, \begin{gather} \int_a^b \biggl\{ \int_a^b [ f(x)^2 g(y)^2 + f(y)^2 g(x)^2 ] -2f(x) g(x) f(y) g(y) \,dx \biggr\} \,dy \\ =\int_a^b \biggl\{ g(y)^2 \int_a^b f^2 + f(y)^2 \int_a^b g^2 - 2f(y) g(y) \int_a^b fg \biggr\} \,dy \end{gather}

1 条关于 “LaTeX2HTML Demonstration LaTeX Doc”的评论

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

*