| Authors: | HPL |
|---|---|
| Date: | Aug 4, 2014 |
Summary. In this mini article we demonstrate the editing markup in DocOnce. This allows highlighting of corrections in a text.
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:
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 (sphinx).
Summary. In this (edit 1: delete mini) article, (edit 2: add comma) we demonstrate the editing markup in DocOnce(edit 3: remove . This) (insert:)which (end insert) allows highlighting of corrections (edit 4: add) via colors (end add) in a text.
[edit 5: change heading to Root finding]
Given (edit 6: add) a function (end add) \(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: remove The most) (insert:)A (end insert) famous (edit 10: add) iterative solution (end add) method is Newton’s method:
[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: remove It needs \(x_0\)) (insert:)A start value \(x_0\) is required (end insert). In theory, (edit 2: add comma) this method has quadratic convergence (edit 14: delete comma). (edit 15: add period) (edit 16: remove h) (insert:)H (end insert)owever, (edit 2: add comma) (edit 18: remove it) (insert:)the result (end insert) 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.