Mathematical layout for web and paper
qqmbr is a publishing engine for mathematical texts that aims on different media: web, mobile and paper.
You can look at my Lecture Notes on ODE sources (see e.g. this qqmbr source and its HTML render, in Russian) or at the code sample below.
You can also play with a limited subset of qqmbr features in a live demo.
qqmbr was inspired by various projects and conceptions:
The following features are on the to-do list:
gather
, multline
and so on);You are welcome to participate with pull requests and issue-reporting.
This is an example of qqmbr markup. See the live demo.
\chapter Euler's formula
\section Complex numbers \label sec:comlex
One can introduce \em{complex numbers} by considering so-called \em{imaginary unit} $i$, such that:
\equation \label eq:i
i^2 = -1.
\definition
\emph{Complex number} is a number of a form $x+iy$, where $x, y \in \mathbb R$.
\section Exponent of complex number \label sec:exp
\theorem \label thm:1
Let $x$ be real number. Then
\equation \label eq:main
e^{ix} = \cos x+i\sin x.
\proof
Let us recall series for exponent, sine and cosine:
\align
\item \label eq:series-exp
e^z &= 1 + z + \frac{z^2}{2} + \frac{z^3}{3!} + \ldots = \sum_{k=0}^\infty \frac{z^k}{k!}
\item \label eq:series-sin
\sin z &= z - \frac{z^3}{3!} + \frac{z^5}{5!} - \frac{z^7}{7!} + \ldots
\item \label eq:series-cos
\cos z &= 1 - \frac{z^2}{2} +\frac{z^4}{4!} - \frac{z^6}{6!} + \ldots
It follows from \ref{eq:i} that
\eq
i^k=\begin{cases}
1 & \text{for } k = 4m\\\\
i & \text{for } k = 4m+1\\\\
-1 & \text{for } k = 4m+2\\\\
-i & \text{for } k = 4m+3
\end{cases}
Let us put $z=ix$ into \ref{eq:series-exp}. For even $k$, $(ix)^k$ is real and for odd $k$ it is imaginary. Moreover, the sign alternates when one pass to the next term. It follows immediately that the real part of \ref{eq:series-exp} is equal to \ref{eq:series-sin} and the imaginary part is equal to \ref{eq:series-cos} with substitution $z=ix$.
This finished the proof of \ref[Euler's formula\nonumber][thm:1].
\chapter Corollary
It follows from \ref[Theorem][thm:1] from \ref[Section][sec:exp] that
\eq
\sin x = \frac{e^{ix}-e^{-ix}}{2i}.
Therefore,
\align
\item \nonumber
\sin 2x &= \frac{e^{2ix}-e^{-2ix}}{2i} = \frac{1}{2i}((e^{ix})^2-(e^{-ix})^2)=
\item \nonumber
&\frac{1}{2i}(e^{ix}-e^{-ix})(e^{ix}+e^{-ix})=2\sin x \cos x.
\question
Express $\cos x$ in terms of exponents. (Click on pencil to check the correct answer.)
\quiz
\choice
$(e^{ix}+e^{-ix})/(2i)$
\comment
No, this is complex number!
\choice \correct
$(e^{ix}+e^{-ix})/2$
\comment
Yes! That's right!
\choice
$(e^{ix}-e^{-ix}))/(2)$
\comment
No, that's $-i\sin x$.
\exercise
Express $\cos 2x$ in terms of $\sin x$ and $\cos x$.