HomeOne source, two documents

One source, two documents

From one LaTeX file, a tagged PDF to print and file, and a web page to read on any screen. They carry the same words, formulas, headings and numbers, and the software checks that they do.

One LaTeX source divides into a PDF and a web page; Theorem 2.1 and equation (2) appear in both. quadratic.tex one LaTeX source PDF Web page Thm 2.1 Thm 2.1 (2) (2)
The lecture notes below, built once into each form.

Side by side

On the left, the PDF's page as it prints. On the right, the web page itself, set into this one: its headings, formulas and links work as they do on their own.

The PDF
Page 1 of the PDF made from the same source, as it prints
The web page

Quadratic equations

A. Lecturer

1 Completing the square

Definition 1.1. The discriminant of ๐‘Žโข๐‘ฅ2+๐‘โข๐‘ฅ+๐‘a x^{2} + b x + c, with ๐‘Žโ‰ 0a \neq 0, is ฮ”=๐‘2โˆ’4โข๐‘Žโข๐‘\Delta = b^{2} - 4 a c.

Lemma 1.2. For ๐‘Žโ‰ 0a \neq 0,

๐‘Žโข๐‘ฅ2+๐‘โข๐‘ฅ+๐‘=๐‘Žโข(๐‘ฅ+๐‘2โข๐‘Ž)2โˆ’ฮ”4โข๐‘Ž.a x^{2} + b x + c = a \left( x + \frac{b}{2 a} \right)^{2} - \frac{\Delta}{4 a}.(1)

2 The roots

Theorem 2.1. If ฮ”โ‰ฅ0\Delta \geq 0, the roots of ๐‘Žโข๐‘ฅ2+๐‘โข๐‘ฅ+๐‘=0a x^{2} + b x + c = 0 are

๐‘ฅ=โˆ’๐‘ยฑ๐‘2โˆ’4โข๐‘Žโข๐‘2โข๐‘Ž.x = \frac{-b \pm \sqrt{b^{2} - 4 a c}}{2 a}.(2)

Proof. Set the right-hand side of (1) to zero and solve for ๐‘ฅx, using Definition 1.1.โˆŽ

Section 1 gives Lemma 1.2; Theorem 2.1 follows, as in [1, 2].

References

  1. [1] V. J. Katz, A History of Mathematics, 3rd ed., Addison-Wesley, 2009.
  2. [2] R. Rashed, The Development of Arabic Mathematics, Kluwer, 1994.

What agrees, and how we know

When this page was built, the software compared the two documents it had just made, and found:

  • all 53 words of the source in both, with 0 lost;
  • 9 of 9 formulas, each as MathML with spoken words;
  • 4 of 4 headings, at the same levels;
  • 6 numbered things, each named alike in both.

In our own work, a document whose two forms disagree does not go out until a person has looked at it. Every check the document carries is listed on A document that proves itself.

Why two

The PDF is the document of record. It prints the same everywhere, files neatly in a course archive, and is tagged so that a screen reader in a PDF viewer can follow its headings, lists and formulas.

The web page is the document people read on a phone at the bus stop. Its text reflows to any width, grows with the reader's font size, and gives every screen reader and browser the formulas as MathML.

Because both come from the same source in the same run, a correction to the LaTeX corrects both. There is no second copy to keep in step by hand.

For projects of your own, both are a request away: the tagged PDF and the web page at Intex Institute.

The LaTeX source of these lecture notes
\documentclass{article}
\usepackage{amsmath,amsthm}
\newtheorem{theorem}{Theorem}[section]
\newtheorem{lemma}[theorem]{Lemma}
\theoremstyle{definition}
\newtheorem{definition}[theorem]{Definition}
\title{Quadratic equations}
\author{A. Lecturer}
\date{}
\begin{document}
\maketitle
\section{Completing the square}\label{sec:square}
\begin{definition}\label{def:disc}
The discriminant of $ax^2 + bx + c$, with $a \neq 0$, is $\Delta = b^2 - 4ac$.
\end{definition}
\begin{lemma}\label{lem:square}
For $a \neq 0$,
\begin{equation}\label{eq:square}
ax^2 + bx + c = a\left(x + \frac{b}{2a}\right)^2 - \frac{\Delta}{4a}.
\end{equation}
\end{lemma}
\section{The roots}\label{sec:roots}
\begin{theorem}\label{thm:roots}
If $\Delta \geq 0$, the roots of $ax^2 + bx + c = 0$ are
\begin{equation}\label{eq:roots}
x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}.
\end{equation}
\end{theorem}
\begin{proof}
Set the right-hand side of \eqref{eq:square} to zero and solve for $x$, using Definition~\ref{def:disc}.
\end{proof}
Section~\ref{sec:square} gives Lemma~\ref{lem:square}; Theorem~\ref{thm:roots} follows, as in \cite{rashed, katz}.
\begin{thebibliography}{9}
\bibitem{katz} V. J. Katz, \emph{A History of Mathematics}, 3rd ed., Addison-Wesley, 2009.
\bibitem{rashed} R. Rashed, \emph{The Development of Arabic Mathematics}, Kluwer, 1994.
\end{thebibliography}
\end{document}