{
 "metadata":{},
 "nbformat":4,
 "nbformat_minor":4,
 "cells":[
  {
   "cell_type":"markdown",
   "metadata":{
    "editable":true
   },
   "source":[
    "<!-- jupyter-book 02_testdoc.ipynb -->\n",
    "\n",
    "\n",
    "# Section 1\n",
    "\n",
    "<div id=\"sec1\"></div>\n",
    "\n",
    "Here is a nested list:\n",
    "\n",
    "  * item1\n",
    "\n",
    "  * item2\n",
    "\n",
    "  * item3 which continues\n",
    "    on the next line to test that feature\n",
    "\n",
    "  * and a sublist\n",
    "\n",
    "    * with indented subitem1\n",
    "\n",
    "    * and a subitem2\n",
    "\n",
    "\n",
    "  * and perhaps an ordered sublist\n",
    "\n",
    "a. first item\n",
    "\n",
    "b. second item,\n",
    "      continuing on a new line\n",
    "\n",
    "\n",
    "**Here is a list with paragraph heading.**\n",
    "\n",
    "  * item1\n",
    "\n",
    "  * item2\n",
    "\n",
    "### Here is a list with subsubsection heading\n",
    "\n",
    "  * item1\n",
    "\n",
    "  * item2\n",
    "\n",
    "> Here are two lines that make up\n",
    "> a block quote for testing *emphasized words* and **boldface words**,\n",
    "> also with hypens:\n",
    "> *pre*-fix, post-*fix*, **pre**-fix, post-**fix**.\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "Here are two references. Equation ([6](my:eq1.html#my:eq1)) is fine. Eq. ([6](my:eq1.html#my:eq1)) too.\n",
    "Even Equation ([6](my:eq1.html#my:eq1)) without the tilde.\n",
    "\n",
    "## Subsection 1\n",
    "<div id=\"subsec1\"></div>\n",
    "\n",
    "<!-- Refer to section/appendix etc. at the beginning of the line -->\n",
    "<!-- and other special fix situations for HTML. -->\n",
    "\n",
    "More text, with a reference back to\n",
    "the section [Section 1](sec1.html#sec1) and [Subsection 1](subsec1.html#subsec1), and further to the\n",
    "the sections [Subsection 1](subsec1.html#subsec1) and [URLs](subsubsec:ex.html#subsubsec:ex), which\n",
    "encourages you to do the tasks in [Problem 2: Flip a Coin](demo:ex:1.html#demo:ex:1) and [Exercise 10: Make references to projects and problems](06_testdoc.html#exer:some:formula).\n",
    " [Appendix: Just for testing; part I](#app1) and [Appendix: Just for testing; part II](#app2) are also nice elements.\n",
    "\n",
    "### Test Section reference at beginning of line and after a sentence\n",
    "\n",
    "The section [Subsection 1](subsec1.html#subsec1) is fine.\n",
    "The section [URLs](subsubsec:ex.html#subsubsec:ex) too.\n",
    "\n",
    "<!-- sphinx code-blocks: pycod=python cod=fortran cppcod=c++ sys=console -->\n",
    "\n",
    "### Computer code\n",
    "\n",
    "Let's do some copying from files too. First from subroutine up to the very end,"
   ]
  },
  {
   "cell_type":"markdown",
   "metadata":{
    "editable":true
   },
   "source":[
    "              subroutine test()\n",
    "              integer i\n",
    "              real*8 r\n",
    "              r = 0\n",
    "              do i = 1, i\n",
    "                 r = r + i\n",
    "              end do\n",
    "              return\n",
    "        C     END1\n",
    "        \n",
    "              program testme\n",
    "              call test()\n",
    "              return\n"
   ]
  },
  {
   "cell_type":"markdown",
   "metadata":{
    "editable":true
   },
   "source":[
    "and then just the subroutine,"
   ]
  },
  {
   "cell_type":"markdown",
   "metadata":{
    "editable":true
   },
   "source":[
    "        \n",
    "              subroutine test()\n",
    "              integer i\n",
    "              real*8 r\n",
    "              r = 0\n",
    "              do i = 1, i\n",
    "                 r = r + i\n",
    "              end do\n",
    "              return\n"
   ]
  },
  {
   "cell_type":"markdown",
   "metadata":{
    "editable":true
   },
   "source":[
    "and finally the complete file with a plain text verbatim environment\n",
    "(`envir=ccq`):"
   ]
  },
  {
   "cell_type":"markdown",
   "metadata":{
    "editable":true
   },
   "source":[
    "        C     a comment\n",
    "        \n",
    "              subroutine test()\n",
    "              integer i\n",
    "              real*8 r\n",
    "              r = 0\n",
    "              do i = 1, i\n",
    "                 r = r + i\n",
    "              end do\n",
    "              return\n",
    "        C     END1\n",
    "        \n",
    "              program testme\n",
    "              call test()\n",
    "              return\n"
   ]
  },
  {
   "cell_type":"markdown",
   "metadata":{
    "editable":true
   },
   "source":[
    "Testing other code environments. First Python:"
   ]
  },
  {
   "cell_type":"markdown",
   "metadata":{
    "editable":true
   },
   "source":[
    "        !bc pycod\n",
    "        def f(x):\n",
    "            return x+1\n",
    "        !ec\n"
   ]
  },
  {
   "cell_type":"markdown",
   "metadata":{
    "editable":true
   },
   "source":[
    "which gets rendered as"
   ]
  },
  {
   "cell_type":"markdown",
   "metadata":{
    "editable":true
   },
   "source":[
    "```Python\n",
    "        def f(x):\n",
    "            return x+1\n",
    "```"
   ]
  },
  {
   "cell_type":"markdown",
   "metadata":{
    "editable":true
   },
   "source":[
    "Test paragraph and subsubsection headings before\n",
    "before code.\n",
    "\n",
    "**Paragraph heading before code.**"
   ]
  },
  {
   "cell_type":"markdown",
   "metadata":{
    "editable":true
   },
   "source":[
    "```Python\n",
    "        import sys\n",
    "        sys.path.insert(0, os.pardir)\n",
    "```"
   ]
  },
  {
   "cell_type":"markdown",
   "metadata":{
    "editable":true
   },
   "source":[
    "### Subsubsection heading before code"
   ]
  },
  {
   "cell_type":"markdown",
   "metadata":{
    "editable":true
   },
   "source":[
    "```Python\n",
    "        def h(z):\n",
    "            return z+1\n",
    "```"
   ]
  },
  {
   "cell_type":"markdown",
   "metadata":{
    "editable":true
   },
   "source":[
    "Here is a program that is supposed to be interactive via\n",
    "Python Online Tutorial, but that service is not accessible\n",
    "for the present format."
   ]
  },
  {
   "cell_type":"code",
   "execution_count":1,
   "metadata":{
    "collapsed":false,
    "editable":true
   },
   "outputs":[],
   "source":[
    "class Line:\n",
    "    def __init__(self, a, b):\n",
    "        self.a, self.b = a, b\n",
    "\n",
    "    def __call__(self, x):\n",
    "        a, b = self.a, self.b\n",
    "        return a*x + b\n",
    "\n",
    "line = Line(2, 1)\n",
    "y = line(x=3)\n",
    "print(y)"
   ]
  },
  {
   "cell_type":"markdown",
   "metadata":{
    "editable":true
   },
   "source":[
    "Some more Python code (actually specified as a sage cell, but\n",
    "such cells are not supported by this format)."
   ]
  },
  {
   "cell_type":"code",
   "execution_count":2,
   "metadata":{
    "collapsed":false,
    "editable":true
   },
   "outputs":[],
   "source":[
    "%matplotlib inline\n",
    "\n",
    "a = 2\n",
    "b = 3\n",
    "print('a+b:', a + b)\n",
    "\n",
    "# In a sage cell we can also plot\n",
    "from matplotlib.pyplot import *\n",
    "from numpy import *\n",
    "x = linspace(0, 4*pi, 101)\n",
    "y = exp(-0.1*x)*cos(x)\n",
    "plot(x, y)\n",
    "xlabel('x'); ylabel('y')\n",
    "show()"
   ]
  },
  {
   "cell_type":"markdown",
   "metadata":{
    "editable":true
   },
   "source":[
    "Then Cython (with -h option so it is hidden in html/sphinx):"
   ]
  },
  {
   "cell_type":"markdown",
   "metadata":{
    "editable":true
   },
   "source":[
    "        cpdef f(double x):\n",
    "            return x + 1\n"
   ]
  },
  {
   "cell_type":"markdown",
   "metadata":{
    "editable":true
   },
   "source":[
    "Standard Python shell sessions:"
   ]
  },
  {
   "cell_type":"code",
   "execution_count":3,
   "metadata":{
    "collapsed":false,
    "editable":true
   },
   "outputs":[],
   "source":[
    "from numpy import linspace, sin\n",
    "# Some comment\n",
    "x = linspace(0, 2, 11)\n",
    "y = sin(x)\n",
    "y[0]"
   ]
  },
  {
   "cell_type":"markdown",
   "metadata":{
    "editable":true
   },
   "source":[
    "Similar IPython sessions:"
   ]
  },
  {
   "cell_type":"code",
   "execution_count":4,
   "metadata":{
    "collapsed":false,
    "editable":true
   },
   "outputs":[],
   "source":[
    "from numpy import linspace, sin\n",
    "# Some comment\n",
    "x = linspace(0, 2, 11)\n",
    "y = sin(x)\n",
    "y[0]"
   ]
  },
  {
   "cell_type":"code",
   "execution_count":5,
   "metadata":{
    "collapsed":false,
    "editable":true
   },
   "outputs":[],
   "source":[
    "import matplotlib.pyplot as plt\n",
    "plt.plot(x, y)\n",
    "a='multiple-\\nline\\noutput'\n",
    "a"
   ]
  },
  {
   "cell_type":"code",
   "execution_count":6,
   "metadata":{
    "collapsed":false,
    "editable":true
   },
   "outputs":[],
   "source":[
    "print(a)"
   ]
  },
  {
   "cell_type":"markdown",
   "metadata":{
    "editable":true
   },
   "source":[
    "Here is the interactive session again, but with `pyshell-t`."
   ]
  },
  {
   "cell_type":"markdown",
   "metadata":{
    "editable":true
   },
   "source":[
    "```Python\n",
    "        >>> from numpy import linspace, sin\n",
    "        >>> # Some comment\n",
    "        >>> x = linspace(0, 2, 11)\n",
    "        >>> y = sin(x)\n",
    "        >>> y[0]\n",
    "        0\n",
    "        >>> import matplotlib.pyplot as plt\n",
    "        >>> plt.plot(x, y)\n",
    "```"
   ]
  },
  {
   "cell_type":"markdown",
   "metadata":{
    "editable":true
   },
   "source":[
    "<!-- This one tests a + sign before a code environment -->\n",
    "C++:"
   ]
  },
  {
   "cell_type":"markdown",
   "metadata":{
    "editable":true
   },
   "source":[
    "```Cpp\n",
    "        #include <iostream>\n",
    "        \n",
    "        int main()\n",
    "        {\n",
    "           std::cout << \"Sample output\" << std::endl;\n",
    "           return 0\n",
    "        }\n",
    "```"
   ]
  },
  {
   "cell_type":"markdown",
   "metadata":{
    "editable":true
   },
   "source":[
    "<!-- The next should get correctly typset in sphinx (cod is fcod) -->\n",
    "<!-- It also tests emoji before code -->\n",
    "And a little bit of Fortran: :dizzy_face:"
   ]
  },
  {
   "cell_type":"markdown",
   "metadata":{
    "editable":true
   },
   "source":[
    "        !bc cod\n",
    "              subroutine midpt(x, length, a, b)\n",
    "              real*8 a, b, x\n",
    "              x = (a + b)/2\n",
    "              length = b - a\n",
    "              return\n",
    "              end\n",
    "        !ec\n"
   ]
  },
  {
   "cell_type":"markdown",
   "metadata":{
    "editable":true
   },
   "source":[
    "which then is typeset as"
   ]
  },
  {
   "cell_type":"markdown",
   "metadata":{
    "editable":true
   },
   "source":[
    "```Python\n",
    "        subroutine midpt(x, length, a, b)\n",
    "              real*8 a, b, x\n",
    "              x = (a + b)/2\n",
    "              length = b - a\n",
    "              return\n",
    "              end\n",
    "```"
   ]
  },
  {
   "cell_type":"markdown",
   "metadata":{
    "editable":true
   },
   "source":[
    "HTML:"
   ]
  },
  {
   "cell_type":"markdown",
   "metadata":{
    "editable":true
   },
   "source":[
    "        <table>\n",
    "        <tr><td>Column 1</td><td>Column 2</td></tr>\n",
    "        <tr><td>0.67526 </td><td>0.92871 </td></tr>\n",
    "        <!-- comment -->\n",
    "        </table>\n"
   ]
  },
  {
   "cell_type":"markdown",
   "metadata":{
    "editable":true
   },
   "source":[
    "But inline HTML code is also important, like text that starts with\n",
    "`<a href=\"` (which can destroy the following text if not properly\n",
    "quoted).\n",
    "\n",
    "Matlab with comments requires special typesetting:"
   ]
  },
  {
   "cell_type":"markdown",
   "metadata":{
    "editable":true
   },
   "source":[
    "        % Comment on the beginning of the line can be escaped by %%\n",
    "        if a > b\n",
    "          % Indented comment needs this trick\n",
    "          c = a + b\n",
    "        end\n"
   ]
  },
  {
   "cell_type":"markdown",
   "metadata":{
    "editable":true
   },
   "source":[
    "And here is a system call:"
   ]
  },
  {
   "cell_type":"markdown",
   "metadata":{
    "editable":true
   },
   "source":[
    "```\n",
    "        Terminal> mkdir test\n",
    "        Terminal> cd test\n",
    "        Terminal> myprog -f\n",
    "        output1\n",
    "        output2\n",
    "```"
   ]
  },
  {
   "cell_type":"markdown",
   "metadata":{
    "editable":true
   },
   "source":[
    "Any valid pygments lexer/language name can appear to, e.g.,"
   ]
  },
  {
   "cell_type":"markdown",
   "metadata":{
    "editable":true
   },
   "source":[
    "        !bc restructuredtext\n",
    "        =======\n",
    "        Heading\n",
    "        =======\n",
    "        \n",
    "        Some text.\n",
    "        !ec\n"
   ]
  },
  {
   "cell_type":"markdown",
   "metadata":{
    "editable":true
   },
   "source":[
    "results in"
   ]
  },
  {
   "cell_type":"markdown",
   "metadata":{
    "editable":true
   },
   "source":[
    "        =======\n",
    "        Heading\n",
    "        =======\n",
    "        \n",
    "        Some text.\n"
   ]
  },
  {
   "cell_type":"markdown",
   "metadata":{
    "editable":true
   },
   "source":[
    "<!-- Here goes hidden code. -->\n",
    "<!-- Python can be treated by some formats, Fortran is always out. -->"
   ]
  },
  {
   "cell_type":"code",
   "execution_count":7,
   "metadata":{
    "collapsed":true,
    "editable":true
   },
   "outputs":[],
   "source":[
    "def f(x):\n",
    "    \"\"\"Secret, hidden function to be defined.\"\"\"\n",
    "    return 42"
   ]
  },
  {
   "cell_type":"markdown",
   "metadata":{
    "editable":true
   },
   "source":[
    "Finally, `!bc do` supports highlighting of DocOnce source:"
   ]
  },
  {
   "cell_type":"markdown",
   "metadata":{
    "editable":true
   },
   "source":[
    "        ======= DocOnce test file =======\n",
    "        \n",
    "        ===== Computer code =====\n",
    "        \n",
    "        Inline verbatim code, as in `import numpy as np`, is allowed, as well as\n",
    "        code blocks:\n",
    "        \n",
    "        !bc pycod\n",
    "        from math import sin\n",
    "        \n",
    "        def f(x):\n",
    "            \"\"\"Example on a function.\"\"\"\n",
    "            return sin(x) + 1\n",
    "        \n",
    "        print(f(0))\n",
    "        !ec\n",
    "        \n",
    "        \n",
    "        ===== Mathematics =====\n",
    "        \n",
    "        Formulas can be inline, as in $\\nabla\\cdot\\boldsymbol{u} = 0$, or typeset\n",
    "        as equations:\n",
    "        \n",
    "        !bt\n",
    "        \\begin{align*}\n",
    "        \\nabla\\cdot\\boldsymbol{u} &= 0,\\\\\n",
    "        \\boldsymbol{u} &= \\nabla\\phi .\n",
    "        \\end{align*}\n",
    "        !et\n",
    "        \n",
    "        === Subsubsection heading ===\n",
    "        \n",
    "        DocOnce files can have chapters, sections, subsections, and subsubsections.\n",
    "        \n",
    "        __Paragraph heading.__ Paragraphs may have headings.\n"
   ]
  },
  {
   "cell_type":"markdown",
   "metadata":{
    "editable":true
   },
   "source":[
    "It is time to test `verbatim inline font` especially with `a newline\n",
    "inside the text` and an exclamation mark at the end: `BEGIN`! For\n",
    "spellcheck, test `a verbatim expression` in `another` in a `third`.\n",
    "Also test exclamation mark as in `!bc` and `!ec` as well as `a != b`.\n",
    "Also test backslashes and braces like `\\begin`, `\\begin{enumerate}`,\n",
    "`\\end{this}\\end{that}`, and `{something \\inside braces}`.\n",
    "\n",
    "The following attempt to exemplify colored text does not work in\n",
    "format pandoc.\n",
    "Here is some <font color=\"red\">red color</font> and an attempt to write <font color=\"green\">with\n",
    "green color containing a linebreak\n",
    "code.</font> Some formats will only display \n",
    "this correctly when `html` \n",
    "is the output format.\n",
    "But here some more running text is added which is not part of\n",
    "the previous blocks with line breaks.\n",
    "\n",
    "### Running OS commands"
   ]
  },
  {
   "cell_type":"markdown",
   "metadata":{
    "editable":true
   },
   "source":[
    "        Terminal> python -c 'print(\"Testing\\noutput\\nfrom\\nPython.\")'\n",
    "        Testing\n",
    "        output\n",
    "        from\n",
    "        Python.\n"
   ]
  },
  {
   "cell_type":"markdown",
   "metadata":{
    "editable":true
   },
   "source":[
    "### Footnotes\n",
    "\n",
    "Here is a test of footnotes [^footnote], which are handy in text.\n",
    "They are used in different flavors, now in\n",
    "\n",
    " * list items (note below that footnotes work after math, verbatim, and URLs - bin fact old and emphasize too!)\n",
    "\n",
    " * even with math $\\nabla^2u$[^math1]\n",
    "\n",
    " * and code `h[i] += 1`[^code]\n",
    "   (*must* have space between inline code and footnote!)\n",
    "\n",
    " * and [links](https://google.com)[^google-search]\n",
    "\n",
    "which gives flexibility in writing.\n",
    "This is the third[^example-of-the-third-footnote] example.\n",
    "\n",
    "  [^footnote]: Typesetting of the footnote depends on the format.\n",
    "Plain text does nothing, LaTeX removes the\n",
    "definition and inserts the footnote as part of the LaTeX text.\n",
    "reStructuredText and Sphinx employ a similar type of typesetting\n",
    "as Extended Markdown and DocOnce, and in HTML we keep the same\n",
    "syntax, just displayed properly in HTML.\n",
    "[^math1]: Math footnotes can be dangerous since it\n",
    "interferes with an exponent.\n",
    "[^code]: One-line footnote.\n",
    "\n",
    "[^google-search]: <google.com> is perhaps the most famous\n",
    "web site today.\n",
    "\n",
    "Here is some more text before a new definition of a footnote that was\n",
    "used above.\n",
    "\n",
    "**Non-breaking space character.**\n",
    "\n",
    "This paragraph aims to test [non-breaking space character](https://en.wikipedia.org/wiki/Non-breaking_space), and a typical\n",
    "example where this is needed is in physical units: 7.4 km is traveled\n",
    "in $7.4/5.5\\approx 1.345$ s.  Also check that a~[link](https://google.com) is\n",
    "not broken across lines (drag the browser window to test this).\n",
    "(On the other hand, the tilde is used in\n",
    "computer code, e.g., as in `[~x for x in y]` or in `y=~x`, and should\n",
    "of course remain a tilde in those contexts.)\n",
    "\n",
    "\n",
    "\n",
    "## Subsection 2: Testing figures\n",
    "<div id=\"subsec:ex\"></div>\n",
    "\n",
    "Test of figures. In particular we refer to [Figure 1](fig:impact.html#fig:impact) in which\n",
    "there is a flow.\n",
    "\n",
    "<!-- dom:FIGURE:[../doc/src/manual/fig/wave1D.png, width=200] Visualization **of** a *wave*. <div id=\"fig:impact\"></div> -->\n",
    "<!-- begin figure -->\n",
    "<div id=\"fig:impact\"></div>\n",
    "\n",
    "<img src=\"../doc/src/manual/fig/wave1D.png\" width=200><p style=\"font-size: 0.9em\"><i>Figure 1: Visualization <b>of</b> a <em>wave</em>.</i></p>\n",
    "<!-- end figure -->\n",
    "\n",
    "Figures without captions are allowed and will be inlined.\n",
    "\n",
    "<!-- dom:FIGURE:[../doc/src/manual/fig/wave1D.png, width=200] -->\n",
    "<!-- begin figure -->\n",
    "\n",
    "<img src=\"../doc/src/manual/fig/wave1D.png\" width=200><p style=\"font-size: 0.9em\"><i>Figure 2: </i></p>\n",
    "<!-- end figure -->\n",
    "\n",
    "<!-- Test multi-line caption in figure with sidecap=True -->\n",
    "\n",
    "Here is [figure 2](myfig.html#myfig) with a long (illegal) multi-line caption\n",
    "containing inline verbatim text:\n",
    "\n",
    "<!-- dom:FIGURE: [../doc/src/manual/fig/wave1D.png, width=500 sidecap=True] A long caption spanning several lines and containing verbatim words like `my_file_v1` and `my_file_v2` as well as math with subscript as in $t_{i+1}$. <div id=\"myfig\"></div>  -->\n",
    "<!-- begin figure -->\n",
    "<div id=\"myfig\"></div>\n",
    "\n",
    "<img src=\"../doc/src/manual/fig/wave1D.png\" width=500><p style=\"font-size: 0.9em\"><i>Figure 2: A long caption spanning several lines and containing verbatim words like <code>my_file_v1</code> and <code>my_file_v2</code> as well as math with subscript as in $t_{i+1}$.</i></p>\n",
    "<!-- end figure -->\n",
    "\n",
    "<!-- Must be a blank line after MOVIE or FIGURE to detect this problem -->\n",
    "\n",
    "Test URL as figure name:\n",
    "\n",
    "<!-- dom:FIGURE: [https://raw.github.com/doconce/doconce/master/doc/src/blog/f_plot.png, width=500 frac=0.8] -->\n",
    "<!-- begin figure -->\n",
    "\n",
    "<img src=\"https://raw.github.com/doconce/doconce/master/doc/src/blog/f_plot.png\" width=500><p style=\"font-size: 0.9em\"><i>Figure 3: </i></p>\n",
    "<!-- end figure -->\n",
    "\n",
    "<!-- Test wikimedia type of files that otherwise reside in subdirs -->\n",
    "\n",
    "**Remark.**\n",
    "Movies are tested in separate file `movies.do.txt`.\n",
    "\n",
    "<!-- Somewhat challenging heading with latex math, \\t, \\n, ? and parenthesis -->\n",
    "\n",
    "## The $\\theta$ parameter (not $\\nabla$?)\n",
    "<div id=\"decay:sec:theta\"></div>\n",
    "\n",
    "Functions do not always need to be advanced, here is one\n",
    "involving $\\theta$:"
   ]
  },
  {
   "cell_type":"markdown",
   "metadata":{
    "editable":true
   },
   "source":[
    "        def f(theta):\n",
    "            return theta**2\n"
   ]
  },
  {
   "cell_type":"markdown",
   "metadata":{
    "editable":true
   },
   "source":[
    "**More on $\\theta$.** Here is more text following headline with math.\n",
    "\n",
    "Newcommands must also be tested in this test report:\n",
    "$\\frac{1}{2}$, ${1/2}$, $\\pmb{x}$, $\\frac{Du}{dt}$,\n",
    "both inline and in block:"
   ]
  },
  {
   "cell_type":"markdown",
   "metadata":{
    "editable":true
   },
   "source":[
    "$$\n",
    "\\frac{Du}{dt} = 0\\nonumber\n",
    "$$"
   ]
  },
  {
   "cell_type":"markdown",
   "metadata":{
    "editable":true
   },
   "source":[
    "<!-- Equation labels as ordinary links -->\n",
    "<div id=\"_auto1\"></div>\n",
    "\n",
    "$$\n",
    "\\begin{equation}  \n",
    "\\frac{1}{2} = {1/2}\n",
    "\\label{_auto1} \\tag{1}\n",
    "\\end{equation}\n",
    "$$"
   ]
  },
  {
   "cell_type":"markdown",
   "metadata":{
    "editable":true
   },
   "source":[
    "<!-- Equation labels as ordinary links -->\n",
    "<div id=\"_auto2\"></div>\n",
    "\n",
    "$$\n",
    "\\begin{equation}  \n",
    "\\frac{1}{2}\\pmb{x} = \\pmb{n}\n",
    "\\label{_auto2} \\tag{2}\n",
    "\\end{equation}\n",
    "$$"
   ]
  },
  {
   "cell_type":"markdown",
   "metadata":{
    "editable":true
   },
   "source":[
    "Or with align with label and numbers:"
   ]
  },
  {
   "cell_type":"markdown",
   "metadata":{
    "editable":true
   },
   "source":[
    "<!-- Equation labels as ordinary links -->\n",
    "<div id=\"aligneq1\"></div>\n",
    "\n",
    "$$\n",
    "\\begin{equation}\n",
    "\\frac{Du}{dt} = 0\n",
    "\\label{aligneq1} \\tag{3}\n",
    "\\end{equation}\n",
    "$$"
   ]
  },
  {
   "cell_type":"markdown",
   "metadata":{
    "editable":true
   },
   "source":[
    "<!-- Equation labels as ordinary links -->\n",
    "<div id=\"_auto3\"></div>\n",
    "\n",
    "$$\n",
    "\\begin{equation}  \n",
    "\\frac{1}{2} = {1/2}\n",
    "\\label{_auto3} \\tag{4}\n",
    "\\end{equation}\n",
    "$$"
   ]
  },
  {
   "cell_type":"markdown",
   "metadata":{
    "editable":true
   },
   "source":[
    "<!-- Equation labels as ordinary links -->\n",
    "<div id=\"aligneq2\"></div>\n",
    "\n",
    "$$\n",
    "\\begin{equation}  \n",
    "\\frac{1}{2}\\pmb{x} = \\pmb{n}\n",
    "\\label{aligneq2} \\tag{5}\n",
    "\\end{equation}\n",
    "$$"
   ]
  },
  {
   "cell_type":"markdown",
   "metadata":{
    "editable":true
   },
   "source":[
    "## Custom Environments\n",
    "\n",
    "Here is an attempt to create a theorem environment via Mako\n",
    "(for counting theorems) and comment lines to help replacing lines in\n",
    "the `.tex` by proper begin-end LaTeX environments for theorems.\n",
    "Should look nice in most formats!\n",
    "\n",
    "<!-- begin theorem -->\n",
    "<div id=\"theorem:fundamental1\"></div>\n",
    "\n",
    "**Theorem 5.**\n",
    "Let $a=1$ and $b=2$. Then $c=3$.\n",
    "<!-- end theorem -->\n",
    "\n",
    "<!-- begin proof -->\n",
    "**Proof.**\n",
    "Since $c=a+b$, the result follows from straightforward addition.\n",
    "$\\Diamond$\n",
    "<!-- end proof -->\n",
    "\n",
    "As we see, the proof of Theorem 5 is a modest\n",
    "achievement.\n",
    "\n",
    "## Tables\n",
    "<div id=\"subsec:table\"></div>\n",
    "\n",
    "<!-- index with comma could fool sphinx -->\n",
    "\n",
    "Let us take this table from the manual:\n",
    "\n",
    "<table border=\"1\">\n",
    "<thead>\n",
    "<tr><th align=\"center\">time</th> <th align=\"center\">velocity</th> <th align=\"center\">acceleration</th> </tr>\n",
    "</thead>\n",
    "<tbody>\n",
    "<tr><td align=\"left\">   0.0     </td> <td align=\"right\">   1.4186      </td> <td align=\"right\">   -5.01           </td> </tr>\n",
    "<tr><td align=\"left\">   2.0     </td> <td align=\"right\">   1.376512    </td> <td align=\"right\">   11.919          </td> </tr>\n",
    "<tr><td align=\"left\">   4.0     </td> <td align=\"right\">   1.1E+1      </td> <td align=\"right\">   14.717624       </td> </tr>\n",
    "</tbody>\n",
    "</table>\n",
    "The DocOnce source code reads"
   ]
  },
  {
   "cell_type":"markdown",
   "metadata":{
    "editable":true
   },
   "source":[
    "        \n",
    "          |--------------------------------|\n",
    "          |time  | velocity | acceleration |\n",
    "          |--l--------r-----------r--------|\n",
    "          | 0.0  | 1.4186   | -5.01        |\n",
    "          | 2.0  | 1.376512 | 11.919       |\n",
    "          | 4.0  | 1.1E+1   | 14.717624    |\n",
    "          |--------------------------------|\n",
    "        \n"
   ]
  },
  {
   "cell_type":"markdown",
   "metadata":{
    "editable":true
   },
   "source":[
    "Here is yet another table to test that we can handle more than\n",
    "one table:\n",
    "\n",
    "<table border=\"1\">\n",
    "<thead>\n",
    "<tr><th align=\"left\">time</th> <th align=\"left\">velocity</th> <th align=\"left\">acceleration</th> </tr>\n",
    "</thead>\n",
    "<tbody>\n",
    "<tr><td align=\"left\">   0.0     </td> <td align=\"left\">   1.4186      </td> <td align=\"left\">   -5.01           </td> </tr>\n",
    "<tr><td align=\"left\">   1.0     </td> <td align=\"left\">   1.376512    </td> <td align=\"left\">   11.919          </td> </tr>\n",
    "<tr><td align=\"left\">   3.0     </td> <td align=\"left\">   1.1E+1      </td> <td align=\"left\">   14.717624       </td> </tr>\n",
    "</tbody>\n",
    "</table>\n",
    "And one with math headings (that are expanded and must be treated\n",
    "accordingly), verbatim heading and entry, and no space around the pipe\n",
    "symbol:\n",
    "\n",
    "<table border=\"1\">\n",
    "<thead>\n",
    "<tr><th align=\"center\">$i$</th> <th align=\"center\">$h_i$ </th> <th align=\"center\">$\\bar T_i$</th> <th align=\"center\"> <code>L_i</code> </th> </tr>\n",
    "</thead>\n",
    "<tbody>\n",
    "<tr><td align=\"left\">   0      </td> <td align=\"right\">   0         </td> <td align=\"right\">   288           </td> <td align=\"right\">   -0.0065    </td> </tr>\n",
    "<tr><td align=\"left\">   1      </td> <td align=\"right\">   11,000    </td> <td align=\"right\">   216           </td> <td align=\"right\">   0.0        </td> </tr>\n",
    "<tr><td align=\"left\">   2      </td> <td align=\"right\">   20,000    </td> <td align=\"right\">   216           </td> <td align=\"right\">   0.001      </td> </tr>\n",
    "<tr><td align=\"left\">   3      </td> <td align=\"right\">   32,000    </td> <td align=\"right\">   228           </td> <td align=\"right\">   0.0028     </td> </tr>\n",
    "<tr><td align=\"left\">   4      </td> <td align=\"right\">   47,000    </td> <td align=\"right\">   270           </td> <td align=\"right\">   0.0        </td> </tr>\n",
    "<tr><td align=\"left\">   5      </td> <td align=\"right\">   51,000    </td> <td align=\"right\">   270           </td> <td align=\"right\">   -0.0028    </td> </tr>\n",
    "<tr><td align=\"left\">   6      </td> <td align=\"right\">   71,000    </td> <td align=\"right\">   214           </td> <td align=\"right\">   <code>NaN</code>      </td> </tr>\n",
    "</tbody>\n",
    "</table>\n",
    "And add one with verbatim headings (with underscores),\n",
    "and rows starting with `|-` because of a negative number,\n",
    "and `|` right before and after verbatim word (with no space):\n",
    "\n",
    "<table border=\"1\">\n",
    "<thead>\n",
    "<tr><th align=\"center\">exact</th> <th align=\"center\"><code>v_1</code> </th> <th align=\"center\">$a_i$ + <code>v_2</code></th> <th align=\"center\"><code>verb_3_</code></th> </tr>\n",
    "</thead>\n",
    "<tbody>\n",
    "<tr><td align=\"right\">   9        </td> <td align=\"right\">   9.62      </td> <td align=\"right\">   5.57             </td> <td align=\"right\">   8.98         </td> </tr>\n",
    "<tr><td align=\"right\">   -20      </td> <td align=\"right\">   -23.39    </td> <td align=\"right\">   -7.65            </td> <td align=\"right\">   -19.93       </td> </tr>\n",
    "<tr><td align=\"right\">   10       </td> <td align=\"right\">   17.74     </td> <td align=\"right\">   -4.50            </td> <td align=\"right\">   9.96         </td> </tr>\n",
    "<tr><td align=\"right\">   0        </td> <td align=\"right\">   -9.19     </td> <td align=\"right\">   4.13             </td> <td align=\"right\">   -0.26        </td> </tr>\n",
    "</tbody>\n",
    "</table>\n",
    "Pipe symbols in verbatim and math text in tables used to pose difficulties,\n",
    "but not\n",
    "anymore:\n",
    "\n",
    "<table border=\"1\">\n",
    "<thead>\n",
    "<tr><th align=\"center\">    $S$    </th> <th align=\"center\">   command   </th> </tr>\n",
    "</thead>\n",
    "<tbody>\n",
    "<tr><td align=\"left\">   $ ||a_0|| $    </td> <td align=\"right\">   <code>norm|length</code>    </td> </tr>\n",
    "<tr><td align=\"left\">   $x\\cap y$      </td> <td align=\"right\">   <code>x|y</code>            </td> </tr>\n",
    "</tbody>\n",
    "</table>\n",
    "Here is a table with X alignment:\n",
    "\n",
    "<table border=\"1\">\n",
    "<thead>\n",
    "<tr><th align=\"center\"> Type</th> <th align=\"center\">                                                                                                     Description                                                                                                      </th> </tr>\n",
    "</thead>\n",
    "<tbody>\n",
    "<tr><td align=\"center\">   X        </td> <td align=\"left\">   Alignment character that is used for specifying a potentially very long text in a column in a table. It makes use of the <code>tabularx</code> package in LaTeX, otherwise (for other formats) it means <code>l</code> (centered alignment).    </td> </tr>\n",
    "<tr><td align=\"center\">   l,r,c    </td> <td align=\"left\">   standard alignment characters                                                                                                                                                                                             </td> </tr>\n",
    "</tbody>\n",
    "</table>\n",
    "Finally, a table with math\n",
    "(`bm` that expands to `boldsymbol`, was tricky, but\n",
    "cleanly handled now)\n",
    "and URLs.\n",
    "\n",
    "<!-- Mako code to expand URLs in the table -->\n",
    "<!-- (These types of tables did not work before Jan 2014) -->\n",
    "\n",
    "<table border=\"1\">\n",
    "<tr></tr>\n",
    "<tbody>\n",
    "<tr><td align=\"center\">   $\\mathcal{L}=0$                    </td> <td align=\"center\">   [<code>080</code>](../doc/src/manual/mov/wave_frames/frame_0080.png)    </td> <td align=\"center\">   [<code>085</code>](../doc/src/manual/mov/wave_frames/frame_0085.png)    </td> </tr>\n",
    "<tr><td align=\"center\">   $a=b$                              </td> <td align=\"center\">   [<code>090</code>](../doc/src/manual/mov/wave_frames/frame_0090.png)    </td> <td align=\"center\">   [<code>095</code>](../doc/src/manual/mov/wave_frames/frame_0095.png)    </td> </tr>\n",
    "<tr><td align=\"center\">   $\\nabla\\cdot\\boldsymbol{u} =0 $    </td> <td align=\"center\">   [<code>100</code>](../doc/src/manual/mov/wave_frames/frame_0100.png)    </td> <td align=\"center\">   [<code>105</code>](../doc/src/manual/mov/wave_frames/frame_0105.png)    </td> </tr>\n",
    "</tbody>\n",
    "</table>\n",
    "## A test of verbatim words in heading with subscript $a_i$: `my_file_v1` and `my_file_v2`\n",
    "\n",
    "**Paragraph with verbatim and math: `my_file_v1.py` and `my_file_v2.py` define some math $a_{i-1}$.** Here is more `__verbatim__` code and\n",
    "some plain text on a new line.\n",
    "\n",
    "<!-- Test various types of headlines -->\n",
    "## **Just bold**\n",
    "\n",
    "Some text.\n",
    "\n",
    "## *Just emphasize*\n",
    "\n",
    "Some text.\n",
    "\n",
    "## `Just verbatim`\n",
    "\n",
    "Some text.\n",
    "\n",
    "## **Bold** beginning\n",
    "\n",
    "Some text.\n",
    "\n",
    "## *Emphasize* beginning\n",
    "\n",
    "Some text.\n",
    "\n",
    "## `Verbatim` beginning\n",
    "\n",
    "Some text.\n",
    "\n",
    "## Maybe **bold end**\n",
    "\n",
    "Some text.\n",
    "\n",
    "## Maybe *emphasize end*\n",
    "\n",
    "Some text.\n",
    "\n",
    "## Maybe `verbatim end`\n",
    "\n",
    "Some text.\n",
    "\n",
    "## The middle has **bold** word\n",
    "\n",
    "Some text.\n",
    "\n",
    "## The middle has *emphasize* word\n",
    "\n",
    "Some text.\n",
    "\n",
    "## The middle has `verbatim` word\n",
    "\n",
    "Some text.\n",
    "\n",
    "***Just emphasize*.** Some text.\n",
    "\n",
    "**`Just verbatim`.** Some text.\n",
    "\n",
    "***Emphasize* beginning.** Some text.\n",
    "\n",
    "**`Verbatim beginning`.** Some text.\n",
    "\n",
    "**Maybe *emphasize end*.** Some text.\n",
    "\n",
    "**Maybe `verbatim end`.** Some text.\n",
    "\n",
    "**The middle has *emphasize* word.** Some text.\n",
    "\n",
    "**The middle has `verbatim` word.** Some text.\n",
    "\n",
    "**Ampersand.**\n",
    "We can test Hennes & Mauritz, often abbreviated H&M, but written\n",
    "as `Hennes & Mauritz` and `H & M`.\n",
    "A sole `&` must also work.\n",
    "<!-- Note: substitutions must not occur inside verbatim, just in ordinary text. -->"
   ]
  },
  {
   "cell_type":"markdown",
   "metadata":{
    "editable":true
   },
   "source":[
    "        # Just to check that ampersand works in code blocks:\n",
    "        c = a & b\n"
   ]
  },
  {
   "cell_type":"markdown",
   "metadata":{
    "editable":true
   },
   "source":[
    "**Quotes.**\n",
    "Let us also add a test of quotes such as \"double quotes, with numbers\n",
    "like 3.14 and newline/comma and hyphen (as in double-quote)\"; written\n",
    "in the standard LaTeX-style that gives correct LaTeX formatting and\n",
    "ordinary double quotes for all non-LaTeX formats.  Here is another\n",
    "sentence that \"caused\" a bug in the past because double backtick\n",
    "quotes could imply verbatim text up to a verbatim word starting with\n",
    "period, like `.txt`.\n",
    "\n",
    "More quotes to be tested for spellcheck:\n",
    "(\"with parenthesis\"), \"with newline\"\n",
    "and \"with comma\", \"hyphen\"-wise, and \"period\".\n",
    "\n",
    "## Bibliography test\n",
    "\n",
    "Here is an example: <a href=\"07_testdoc.html#Langtangen_Pedersen_2002\">[1]</a> discussed propagation of\n",
    "large destructive water waves, <a href=\"07_testdoc.html#Langtangen_et_al_2002\">[2]</a> gave\n",
    "an overview of numerical methods for solving the Navier - Stokes equations,\n",
    "while the use of Backward Kolmogorov equations for analyzing\n",
    "random vibrations was investigated in <a href=\"07_testdoc.html#Langtangen_1994a\">[3]</a>.\n",
    "The book chapter <a href=\"07_testdoc.html#Mardal_et_al_2003a\">[4]</a> contains information on\n",
    "C++ software tools for programming multigrid methods. A real retro\n",
    "reference is <a href=\"07_testdoc.html#Langtangen_1988d\">[5]</a> about a big FORTRAN package.\n",
    "Multiple references are also possible, e.g., see\n",
    "<a href=\"07_testdoc.html#Langtangen_Pedersen_2002\">[1]</a> <a href=\"07_testdoc.html#Mardal_et_al_2003a\">[4]</a>.\n",
    "\n",
    "We need to cite more than 10 papers to reproduce an old formatting\n",
    "problem with blanks in the keys in reST format:\n",
    "<a href=\"07_testdoc.html#Langtangen_1992c\">[6]</a> <a href=\"07_testdoc.html#Langtangen_1994a\">[3]</a> <a href=\"07_testdoc.html#Mortensen_et_al_2011\">[7]</a> <a href=\"07_testdoc.html#Langtangen_Pedersen_2002\">[1]</a>\n",
    "and\n",
    "<a href=\"07_testdoc.html#Langtangen_et_al_2002\">[2]</a> <a href=\"07_testdoc.html#Glimsdal_et_al_20006\">[8]</a> <a href=\"07_testdoc.html#Rahman_et_al_2006b\">[9]</a> <a href=\"07_testdoc.html#Haga_et_al_2011a\">[10]</a> <a href=\"07_testdoc.html#Langtangen_2003a\">[11]</a> <a href=\"07_testdoc.html#Langtangen_2008a\">[12]</a> <a href=\"07_testdoc.html#Langtangen:95\">[13]</a>\n",
    "and all the work of\n",
    "<a href=\"07_testdoc.html#Langtangen_2012\">[14]</a> <a href=\"07_testdoc.html#Mardal_et_al_2003a\">[4]</a> <a href=\"07_testdoc.html#Jeberg_et_al_2004\">[15]</a> as well as\n",
    "old work <a href=\"07_testdoc.html#Langtangen_1988d\">[5]</a> and <a href=\"07_testdoc.html#Langtangen_1989e\">[16]</a>, and the\n",
    "talk <a href=\"07_testdoc.html#Langtangen_talk_2007a\">[17]</a>.\n",
    "Langtangen also had two thesis <a href=\"07_testdoc.html#Langtangen:85\">[18]</a> <a href=\"07_testdoc.html#Langtangen_1989e\">[16]</a>\n",
    "back in the days.\n",
    "More retro citations are\n",
    "the old ME-IN323 book <a href=\"07_testdoc.html#Langtangen:91\">[19]</a> and the\n",
    "<a href=\"07_testdoc.html#Langtangen:94b\">[20]</a> OONSKI '94 paper.\n",
    "\n",
    "<!-- --- begin exercise --- -->\n",
    "\n",
    "## Example 1: Examples can be typeset as exercises\n",
    "<div id=\"Example\"></div>\n",
    "\n",
    "Examples can start with a subsection heading starting with `Example:`\n",
    "and then, with the command-line option `--examples_as_exercises` be\n",
    "typeset as exercises. This is useful if one has solution\n",
    "environments as part of the example.\n",
    "\n",
    "**a)**\n",
    "State some problem.\n",
    "\n",
    "**Solution.**\n",
    "The answer to this subproblem can be written here.\n",
    "\n",
    "**b)**\n",
    "State some other problem.\n",
    "\n",
    "**Hint 1.**\n",
    "A hint can be given.\n",
    "\n",
    "**Hint 2.**\n",
    "Maybe even another hint?\n",
    "\n",
    "**Solution.**\n",
    "The answer to this other subproblem goes here,\n",
    "maybe over multiple doconce input lines.\n",
    "\n",
    "<!-- --- end exercise --- -->\n",
    "\n",
    "## User-defined environments\n",
    "\n",
    "The example in the section [Example 1: A test function](ex:test:1p1.html#ex:test:1p1) demonstrates how to write a test function.\n",
    "That is, a special test function for a function `add` appears in\n",
    "the example in the section [Example 1: A test function](ex:test:1p1.html#ex:test:1p1).\n",
    "\n",
    "## Example 1: A test function\n",
    "<div id=\"ex:test:1p1\"></div>\n",
    "\n",
    "Suppose we want to write a test function for checking the\n",
    "implementation of a Python function for addition."
   ]
  },
  {
   "cell_type":"code",
   "execution_count":8,
   "metadata":{
    "collapsed":false,
    "editable":true
   },
   "outputs":[],
   "source":[
    "def add(a, b):\n",
    "    return a + b\n",
    "\n",
    "def test_add():\n",
    "    a = 1; b = 1\n",
    "    expected = a + b\n",
    "    computed = add(a, b)\n",
    "    assert expected == computed"
   ]
  },
  {
   "cell_type":"markdown",
   "metadata":{
    "editable":true
   },
   "source":[
    "## Example 2: Addition\n",
    "<div id=\"ex:math:1p1\"></div>\n",
    "\n",
    "We have"
   ]
  },
  {
   "cell_type":"markdown",
   "metadata":{
    "editable":true
   },
   "source":[
    "$$\n",
    "1 + 1 = 2\n",
    "$$"
   ]
  },
  {
   "cell_type":"markdown",
   "metadata":{
    "editable":true
   },
   "source":[
    "or in tabular form:\n",
    "\n",
    "<table border=\"1\">\n",
    "<thead>\n",
    "<tr><th align=\"center\">Problem</th> <th align=\"center\">Result</th> </tr>\n",
    "</thead>\n",
    "<tbody>\n",
    "<tr><td align=\"center\">   $1+1$      </td> <td align=\"center\">   $2$       </td> </tr>\n",
    "</tbody>\n",
    "</table>\n",
    "**Highlight box!**\n",
    "\n",
    "This environment is used to highlight something:"
   ]
  },
  {
   "cell_type":"markdown",
   "metadata":{
    "editable":true
   },
   "source":[
    "$$\n",
    "E = mc^2\n",
    "$$"
   ]
  },
  {
   "cell_type":"markdown",
   "metadata":{
    "editable":true
   },
   "source":[
    "## URLs\n",
    "<div id=\"subsubsec:ex\"></div>\n",
    "\n",
    "Testing of URLs: hpl's home page [hpl](https://folk.uio.no/hpl), or\n",
    "the entire URL if desired, <https://folk.uio.no/hpl>.  Here is a\n",
    "plain file link <testdoc.do.txt>, or <testdoc.do.txt>, or\n",
    "<testdoc.do.txt> or <testdoc.do.txt> or [a link with\n",
    "newline](testdoc.do.txt). Can test spaces with the link with word\n",
    "too: [hpl](https://folk.uio.no/hpl) or [hpl](https://folk.uio.no/hpl). Also `file:///` works: [link to a\n",
    "file](file:///home/hpl/vc/doconce/doc/demos/manual/manual.html) is\n",
    "fine to have. Moreover, \"loose\" URLs work, i.e., no quotes, just\n",
    "the plain URL as in <https://folk.uio.no/hpl>, if followed by space, comma,\n",
    "colon, semi-colon, question mark, exclamation mark, but not a period\n",
    "(which gets confused with the periods inside the URL).\n",
    "\n",
    "Mail addresses can also be used: [`hpl@simula.no`](mailto:hpl@simula.no), or just a [mail link](mailto:hpl@simula.no), or a raw <mailto:hpl@simula.no>.\n",
    "\n",
    "Here are some tough tests of URLs, especially for the `latex` format:\n",
    "[Newton-Cotes](https://en.wikipedia.org/wiki/Newton%E2%80%93Cotes_formulas) formulas\n",
    "and a [good book](https://www.springer.com/mathematics/computational+science+%26+engineering/book/978-3-642-23098-1). Need to test\n",
    "Newton-Cotes with percentage in URL too:\n",
    "<https://en.wikipedia.org/wiki/Newton%E2%80%93Cotes_formulas>\n",
    "and <https://en.wikipedia.org/wiki/Newton-Cotes#Open_Newton.E2.80.93Cotes_formulae> which has a shebang.\n",
    "\n",
    "For the `--device=paper` option it is important to test that URLs with\n",
    "monospace font link text get a footnote\n",
    "(unless the `--latex_no_program_footnotelink`\n",
    "is used), as in this reference to\n",
    "[`decay_mod`](https://github.com/hplgit/INF5620/tree/gh-pages/src/decay/experiments/decay_mod.py), [`ball1.py`](https://tinyurl.com/pwyasaa/formulas.ball1.py),\n",
    "and [`ball2.py`](https://tinyurl.com/pwyasaa/formulas.ball2.py).\n",
    "\n",
    "<!-- Comments should be inserted outside paragraphs (because in the rst -->\n",
    "<!-- format extra blanks make a paragraph break). -->\n",
    "\n",
    "<!-- Note that when there is no https: or file:, it can be a file link -->\n",
    "<!-- if the link name is URL, url, \"URL\", or \"url\". Such files should, -->\n",
    "<!-- if rst output is desired, but placed in a `_static*` folder. -->\n",
    "\n",
    "More tough tests: repeated URLs whose footnotes when using the\n",
    "`--device=paper` option must be correct. We have\n",
    "[google](https://google.com), [google](https://google.com), and\n",
    "[google](https://google.com), which should result in exactly three\n",
    "footnotes."
   ]
  }
 ]
}