Published by

gaussian integral
\( \)

1. Why Noteshare for Mathematicians?

Thanks to Donald Knuth and Leslie Lamport, mathematicians have truly wonderful tools —  TeX and LaTeX — for writing mathematical documents. Because they provide both a tool and language, we can write anything we want. And the rendered text is — well, beautiful.

A tool for authors

The aim of VS is to bring these same tools to the web — with some additions, such as search facilities, an image database, the click environment, interactive graphics, and export to other formats such as LaTeX and ePub. The goal is frictionless composition: you type, and each time you press "Update" or ctrl-U, Voila! the latest version of your class notes is on the web. (Of course, you can control the visibility of your work if you wish: keep it completely private, share it with a group which you designate, or share it with the world when you press "Publish").

If you want to see what typeset mathematics in Noteshare looks like now, go to the sample mathematics article. To see the author’s source text, choose Source from the View menu. The source is written in Asciidoc-LaTeX, a hybrid of two markup languages.

Noteshare also gives you tools for collaboration. Form groups to share work, and set permissions to read, edit, and create documents belonging to the group. To make sure that sections of a document are edited by only one person at a time, individual sections can be "checked out."

1.1. Editing

Screen Shot 2015 08 20 at 5.15.54 AM

The two-pane editor displays the source text on the left, the rendered text on the right. By default, the two windows are yoked together: scroll the left window, and the text in the right window follows. Press ctrl-I to let the two windows scroll independently. Press ctrl-Y to re-yoke them. If you forget these commands, press the Help button, or selec Help from the Home menu.

1.2. Interactivity: click blocks and apps.

A word about two interactive features. First is the "click environment," a feature especially useful for problem sets and instructional handouts. Below are two examples — problems where the answer or hint — the text in blue — is "clickable." Click on the blue header to reveal the "body" of the click block. Click again to hide it. The syntax is very close to what one might do in LaTeX. See the sidebar for the source code.ยจ

Problem 1.
What is the value of the integral below? \[ \int_0^1 x^n dx \]
\[ \frac{1}{n+1} \]
Problem 2.
What is the sum of the series below? \[ S = \sum_{n=0}^\infty \frac{1}{3^n} \]
Consider the relation of \(S\) to the quantity \(3S\).

Second is the capability of incorporating apps written in Javascript in Noteshare. See the sidebar for an example. For more examples and details on who this is done, see the JSXGraph Scrapbook and also the Noteshare Handbook.

1.3. Feature summary

  • Frictionless publishing. Type and save. It is already on the web.

  • Available everywhere, secure. Any place you have an internet connection, you have access to your Noteshare documents. They are backed up, and secure.

  • Smart phones and tablets. Later this spring, Noteshare will be compatible with smart phones and tablets. Functionality decreases with the size of the device, but in all cases Noteshare content can be read regardless of the size of the device.

  • Search. For documents, authors, images. Full text search also available.

  • Searchable image database. Images you place there can be private, or part of the Noteshare intellectual commons.

  • Collaboration. Form groups, check sections of a document in and out for collaborative composition and editing.

  • Export to LaTeX, PDF, and ePub.[1]

  • Ownership. You own what you create. Source text and media resources such as images are stored on Noteshare servers. See this blog post for instructions how to download your Noteshare work to your computer.

  • Snippet sharing. If you wish, you can make selected sections of includable. This means that others can incorporate them verbatim in their own documents. Included snippets cannot be changed except by the author; credit is given, and cannot be removed wihout removing the snippet. This can be a great labor-saving device. Why re-invent the wheel when there is so much new work to be done?

In this section we discuss two scenarios

In the sections that follow we discuss how to compose documents (notebooks) in VS.

1.4. Lecture Notes

Screen Shot 2015 08 20 at 5.15.54 AM
Figure 1. Editor control panel

You are giving a lecture and want to write up your notes for the web. You start a new document ("notebook") on Noteshare and type away using familiar LaTeX notation and Noteshare’s verson of latex in noteshare. Pressing update as you go, or typing control-U, you check the changes in the split editor — source on the left, rendered LaTeX on the right. When you are finished, you press exit. In the editor control palette you press Publish — and Presto!! The notes for your talk are on the web.

To let your colleagues and students know about your write-up, you press Share in the control panel. This brings up a blank email with a public link to your write-up. You fill in the address field, press "send", and are done with your work.

Later that day. You realize that a few points in your talk need a more detailed explanation. You choose the Recent item from the Home menu to locate the last section of the last Noteshare document you were working on. You click on the link to bring up your notes, then select Write from the menu bar. You make your changes, press upate and Voila! The updated version of your notes is published.

That evening. You decide to put in some links to related work in your write-up. You open up your document and add this text:[Twin primes]

In the rendered text, you see this: Twin primes. You exit, pressing control-X this time, and select Print from the View menu. Up comes a printable version of your notes. That’s it for the day!

Several days later. You have expanded your notes from one section to three. This time you select Compiled from the View menu. Noteshare assembles all sections of you notebook into a single document which you print. You notice the URL of the compiled document in your browser. It is something like this:

You email that link to some colleagures and students. Done for the day!

Several months latter. You have refined your notes further and decide to submit them for publication. Instead of "Compiled", you select LaTeX. Noteshare assembles all the sections of your notebook into a single LaTeX document and provides you with a link to dowload it to your computer. Note: this last feature is in development and will be ready for beta testers by June 1.

1.5. Problem Sets

Here is an example problem set, first in rendered form, then in source form.

  1. Compute the integral \[ \int_0^1 x^n dx \]

    \[ \frac{1}{n+1} \]
  2. Determine the number and nature of the oots of the equation \(x^2 + 5x + 1 = 0\) without actually finding the roots. Explain how you did this.

    The discriminant of this equation is \(b^2 - 4ac = 21\). Because it is nonzero, there are two distinc roots. Because it is positive, the roots are real. Because it is not a perfect square, the roots are irrational.

Here is the source:

. Compute the integral \[ \int_0^1 x^n dx \]
 \[ \frac{1}{n+1} \]

. Determine the number and nature
of the roots of the equation
$x^2 + 5x + 1 = 0$ without
actually finding the roots.
Explain how you did this.
The discriminant of this equation is
$b^2 - 4ac = 21$.  Because
it is nonzero, there are two
distinct roots.  Because it is
positive, the roots are real.
Because it is not a perfect square,
the roots are irrational.

The little + signs that you see are to make sure that the question and the answer are treated as forming an entire item in a numbered list. Such + signs are called continuations.

Choose Source from the View menu to compare the source and rendered text — the best way to learn Asciidoc-LaTeX. Choose Standard to go back.
\( %% Blackboard bold \def\NN{\mathbb{N}} \def\QQ{\mathbb{Q}} \def\RR{\mathbb{R}} \def\ZZ{\mathbb{Z}} \)

2. Sample mathematics article

In this article we discuss a number of results regarding the integers, \(\ZZ = \set{ \cdots -2, -1, 0, 1, 2, \cdots }\)

2.1. Pythagorean triples

One of the first real pieces of mathematics we learn is this:

Theorem 1.
Let \(a\), \(b\), and \(c\) be the sides of a right triangle, where \(c\) is the hypotenuse. Then \(a^2 + b^2 = c^2\).

The Pythagorean theorem suggests an equation,

\[ x^2 + y^2 = z^2 \] (1)

If we demand that the unknowns be integers, then this is a Diophantine equation. We all know one solution, to equation 1, the 3-4-5 triangle. However, there are in fact, infinitely many solutions …​ Quite remarkably, there is a clay tablet (Plympton 322) from Mesopotamia, dated to about 1800 BC, that contains a list of 15 such "Pythagorean triples." See Wikipedia or this blog.

Figure 2. Plympton 322

2.2. Another result from ancient times

Theorem 2.
There are infinitely many primes.

Suppose that there are only finitely many primes, say \(p_1, p_2, \ldots, p_N\). Let

\[ Q = p_1p_2 \cdots p_N + 1 \] (2)

This number is is greater than the greatest prime, \(p_N\). Therefore it is composite, and therefore it is divisible by \(p_i\) for some \(i\). But the remainder of \(Q\) upon division by \(p_i\) is 1, a contradiction. Q.E.D.

However, let’s check that our cross-references work. We learned about the Pythagorean formula in equation 1, and the number of solutions it has in Theorem 1. We also learned in Theorem 2 that prime numbers are quite abundant in Nature: there are infinitely many of them (\(\aleph_0\)).

2.3. Algorithms

One of the most basic algorithms is the one used to find the greatest common divisor and which bears Euclid’s name. See Listing 1 below.

Listing 1.
if m < n, swap(m,n)
while n does not equal 0
   r = m mod n
   m = n
   n = r
output m
\( %% Arrows, sets, etc. \newcommand{\set}[1]{ \{\,#1\, \} } \newcommand{\sett}[2]{ \{\,#1\, \mid\, #2\, \} } \newcommand{\Set}[1]{ \Big\{\,#1\, \Big\} } \newcommand{\Sett}[2]{ \Big\{\,#1\, \Big\vert\; #2\, \Big\} } \newcommand{\mapright}[1]{\ \smash{ \mathop{\longrightarrow}\limits^{#1}}\ } \)

3. LaTeX in Noteshare

\( \def\modulo{\text{mod}} \)

LaTeX in Noteshare is made possible by two technologies: MathJax and Asciidoctor-LaTeX. The first is the engine which displays mathematical formulas. The second provides an analogue of LaTeX environments — theorem, equation, etc.

3.1. Inline and displayed mathematics

Use the familiar $ …​ $ syntax for inline mathematics. Thus $ a^2 + b^2 = c^2 $ renders as \( a^2 + b^2 = c^2 \). You can also use the familiar

   \[ ... \]

notation for displayed mathematics. Thus

     e^{2\pi\sqrt{-1}} = 1

renders as \[ e^{2\pi\sqrt{-1}}= 1 \]

3.2. Environments

Asciidoctor-LaTeX provides LaTeX-like features in Noteshare — environments for theorems, definitions, equations, multi-line equations displays, etc. We give some examples here and refer you to the Asciidoctor-LaTeX manual for treatment of cross-referenceing, options, etc.

3.2.1. The theorem environment

The source text

There are infinitely many prime numbers.

renders as

Theorem 3.
There are infinitely many prime numbers.

The body of the environment can contain mathematical text. Thus

If $a$ and $b$ are the sides of
a right triangle, and $c$
is the hypotenuse, then
   a^2 + b^2 = c^2

renders as

Theorem 4.
If \(a\) and \(b\) are the sides of a right triangle, and \(c\) is the hypotenuse, then \[ a^2 + b^2 = c^2 \]

Asciidoctor-LaTeX environments have the form


The TYPE can be any alphabetical string — proposition, lemma, defiintion, joke, etc. Some TYPES, such as equation and equationalign, receive special treatment.

3.3. Labels

Label an environment like this:

If $a$ is not divisible by a prime  $p$, then
   a^{p-1} \equiv 1 \ \text{modulo $p$}
Theorem 5.
If \(a\) is not divisible by a prime \(p\), then \[ a^{p-1} \equiv 1 \ \modulo\ p \]

We will use the label later when we dicuss cross-references.

3.4. The equation environment

For numbered equations, use this source text as a model:

\sum_{n=1}^\infty \frac{1}{n} = \infty

It renders as

\[ \sum_{n=1}^\infty \frac{1}{n} = \infty \]

Notice that the escaped bracket pair, \[ …​ \] is unnecessary.

3.4.1. The equationalign environment

For multi-line equation displays, use this source text as a model:

E &= (a + b)^2 \\
   &= a^2 +2ab + b^2

It renders as

\[\begin{split} E &= (a + b)^2 \\ &= a^2 +2ab + b^2 \end{split}\]

Notice once again that the escaped bracket pair, \[ …​ \] is unnecessary.

3.5. Cross references

Earlier we labeled a theorem using the syntax [env.TYPE#LABEL]. Here is how we use it. The source text

The result in <<fermat>> is the basis of the RSA
cryptograhy scheme.

It rnders like this:

The result Theorem 5 is the basis of the RSA cryptograhy scheme.

with the reference acting as a clickable link.

3.6. Macros

There are several ways to include TeX macros in what you write. One way is to use the texmacro environment right in the text, as is this example:


The macro can be used in the section you are writing from the point of definition onward. This is what we did or Theorem 5 — the texmaro environment is at the top of ths section. Another way is to put the texmacro block in the settings for the current notebook. This is generally the best option, since then the macro definitions are available throughout the document.

3.6.1. Notebook Macros


It is usually more convenient to define macros in such a way that they can be used for an entire noteobook. To do this, put tex like that below in the Notebook Attributes field. To so this, go to the main edit window and press the button NA.


4. JSXGraph

You may have to refresh your browser to active the app. Once it is running grab the red weight with the mouse, pull it, and let it go.

JSXGraph is a Javascript package for drawing figures — polygons, functon graphs, etc. Below is one example, It is based on the template

.Harmonic oscillator
[env.jsxgraph, box=box2, width=400, height=400]

See the JSXGraph Scrapbook for more information.

JSXGraph 1: Harmonic oscillator

Source: JSXGraph


1. These are experimental and in varying stages of development. The experimental LaTeX converter is available now. The others will be available later this year