Test of editing markup

Test of editing markup

HPL

Aug 4, 2014

Summary. In this mini article we demonstrate the editing markup in DocOnce. This allows highlighting of corrections in a text.

A math story

Given \( f(x) \). We seek the roots of \( f \) i.e. the \( x \) values for which \( f(x)=0 \). The most famous method is Newton's method: $$ x_{k+1} = x_k - \frac{f'(x_k)}{f(x_k)},\quad k=0,1,\ldots $$ It needs \( x_0 \). In theory this method has quadratic convergence, however it requires \( x_0 \) to be close to a root.

Problems with the text above. Readers will normally find problems with the text above and a desire to edit. DocOnce features a syntax for editing running text. This syntax is demonstrated below. Markup for editing is not allowed in math blocks, code blocks, or section headings.

The text above is typeset as

__Summary.__ In this mini article we demonstrate the editing
markup in DocOnce. This allows highlighting of corrections in
a text.

======= A math story =======

Given $f(x)$. We seek the roots of $f$ i.e. the $x$ values for which
$f(x)=0$. The most famous method is Newton's method:

!bt
\[ x_{k+1} = x_k - \frac{f'(x_k)}{f(x_k)},\quad k=0,1,\ldots \]
!et
It needs $x_0$. In theory this method has quadratic convergence,
however it requires $x_0$ to be close to a root.


We now want to annotate this text with markup for our edits. Such markup has the syntax of inline comments, which are comments inside square brackets with an identifier and the comment text:

[identifier: some text]

The identifier can be a name (to recognize the reader who provided the comment), but in edit markup it is usually either add, del, or edit. The markup for editing consists of

[add: ,]
[add: .]
[add: ;]
[del: ,]
[del: ,]
[del: .]
[del: ;]
[add: some text]
[del: some text]
[edit: some text -> some replacement for text]

In addition, one may provide an ordinary inline comment a la

[edit: change the title to *Root finding*.]

Below is the text with edits, followed by the rendering of how such edits look like in the present format (html).


Summary. In this (edit 1:) mini article, (edit 2: add comma) we demonstrate the editing markup in DocOnce (edit 3:) . This which allows highlighting of corrections (edit 4:) via colors in a text.

A math story

(edit 5: change heading to Root finding)

Given (edit 6:) a function \( f(x) \). We seek the roots of \( f \), (edit 2: add comma) i.e., (edit 2: add comma) the \( x \) values for which \( f(x)=0 \). (edit 9:) The most A famous (edit 10:) iterative solution method is Newton's method: $$ x_{k+1} = x_k - \frac{f'(x_k)}{f(x_k)},\quad k=0,1,\ldots $$ (edit 11: error in right-hand side, the fraction \( \frac{f'(x_k)}{f(x_k)} \) must be \( \frac{f(x_k)}{f'(x_k)} \).) (edit 12:) It needs \( x_0 \) A start value \( x_0 \) is required. In theory, (edit 2: add comma) this method has quadratic convergence (edit 14: delete comma). (edit 15: add period) (edit 16:) h However, (edit 2: add comma) (edit 18:) it the result requires \( x_0 \) to be close to a root.


To remove the edit markup and implement their implications, run

Terminal> doconce apply_edit_comments mydoc.do.txt

if the name of the DocOnce source file is mydoc.do.txt.