packages feed

pandoc 3.1.4 → 3.1.5

raw patch · 46 files changed

+7420/−1264 lines, 46 filesdep ~aesondep ~commonmarkdep ~skylightingPVP ok

version bump matches the API change (PVP)

Dependency ranges changed: aeson, commonmark, skylighting, skylighting-core, typst

API changes (from Hackage documentation)

+ Text.Pandoc.Class: toTextM :: PandocMonad m => FilePath -> ByteString -> m Text
+ Text.Pandoc.Writers: writeAsciiDocLegacy :: PandocMonad m => WriterOptions -> Pandoc -> m Text
+ Text.Pandoc.Writers.AsciiDoc: writeAsciiDocLegacy :: PandocMonad m => WriterOptions -> Pandoc -> m Text

Files

AUTHORS.md view
@@ -203,6 +203,7 @@ - Karl Pettersson - Keiichiro Shikano - Kelsey Hightower+- Kevin Broch - Kolen Cheung - Konstantin Zudov - Kristof Bastiaensen@@ -310,6 +311,7 @@ - RyanGlScott - S.P.H - Salim B+- Sam S. Almahri - Samuel Tardieu - Saumel Lemmenmeier - Sascha Wilde@@ -413,6 +415,7 @@ - obcat - oltolm - oquechy+- pacien - perro tuerto - qerub - quasicomputational
MANUAL.txt view
@@ -1,7 +1,7 @@ --- title: Pandoc User's Guide author: John MacFarlane-date: June 24, 2023+date: July 07, 2023 ---  # Synopsis@@ -284,7 +284,9 @@ :   Specify output format.  *FORMAT* can be:      ::: {#output-formats}-    - `asciidoc` ([AsciiDoc]) or `asciidoctor` ([AsciiDoctor])+    - `asciidoc` (modern [AsciiDoc] as interpreted by [AsciiDoctor])+    - `asciidoc_legacy` ([AsciiDoc] as interpreted by [`asciidoc-py`]).+    - `asciidoctor` (deprecated synonym for `asciidoc`)     - `beamer` ([LaTeX beamer][`beamer`] slide show)     - `bibtex` ([BibTeX] bibliography)     - `biblatex` ([BibLaTeX] bibliography)@@ -415,7 +417,7 @@  :   Suppress warning messages. -`--fail-if-warnings`+`--fail-if-warnings[=true|false]`  :   Exit with error status if there are any warnings. @@ -503,6 +505,7 @@ [Emacs Org mode]: https://orgmode.org [AsciiDoc]: https://www.methods.co.nz/asciidoc/ [AsciiDoctor]: https://asciidoctor.org/+[`asciidoc-py`]: https://github.com/asciidoc-py/asciidoc-py [DZSlides]: https://paulrouget.com/dzslides/ [Word docx]: https://en.wikipedia.org/wiki/Office_Open_XML [PDF]: https://www.adobe.com/pdf/@@ -559,7 +562,7 @@     require different kinds of images.  Currently this option only affects     the Markdown and LaTeX readers. -`--file-scope`+`--file-scope[=true|false]`  :   Parse each file individually before combining for multifile     documents. This will allow footnotes in different files with the@@ -670,7 +673,7 @@     for first in the working directory, and then in the `metadata`     subdirectory of the user data directory (see `--data-dir`). -`-p`, `--preserve-tabs`+`-p`, `--preserve-tabs[=true|false]`  :   Preserve tabs instead of converting them to spaces. (By default, pandoc     converts tabs to spaces before parsing its input.)  Note that this will@@ -723,7 +726,7 @@     space, and the period will not produce sentence-ending space     in formats like LaTeX.  The strings may not contain spaces. -`--trace`+`--trace[=true|false]`  :   Print diagnostic output tracing parser progress to stderr.     This option is intended for use by developers in diagnosing@@ -763,7 +766,7 @@     document in standalone mode. If no *VAL* is specified, the     key will be given the value `true`. -`--sandbox`+`--sandbox[=true|false]`  :   Run pandoc in a sandbox, limiting IO operations in readers     and writers to reading the files specified on the command line.@@ -837,7 +840,7 @@     in the generated source code (see `--wrap`).  It also affects     calculation of column widths for plain text tables (see [Tables] below). -`--toc`, `--table-of-contents`+`--toc[=true|false]`, `--table-of-contents[=true|false]`  :   Include an automatically generated table of contents (or, in     the case of `latex`, `context`, `docx`, `odt`,@@ -858,7 +861,7 @@     of contents.  The default is 3 (which means that level-1, 2, and 3     headings will be listed in the contents). -`--strip-comments`+`--strip-comments[=true|false]`  :   Strip out HTML comments in the Markdown or Textile source,     rather than passing them on to Markdown, Textile or HTML@@ -956,7 +959,7 @@     downloaded). If you're behind a proxy, you also need to set     the environment variable `http_proxy` to `http://...`. -`--no-check-certificate`+`--no-check-certificate[=true|false]`  :   Disable the certificate verification to allow access to     unsecure HTTP resources (for example when the certificate@@ -964,11 +967,11 @@  ## Options affecting specific writers {.options} -`--self-contained`+`--self-contained[=true|false]`  :   *Deprecated synonym for `--embed-resources --standalone`.* -`--embed-resources`+`--embed-resources[=true|false]`  :   Produce a standalone HTML file with no external dependencies, using     `data:` URIs to incorporate the contents of linked scripts, stylesheets,@@ -989,13 +992,13 @@     advanced features (e.g.  zoom or speaker notes) may not work     in an offline "self-contained" `reveal.js` slide show. -`--html-q-tags`+`--html-q-tags[=true|false]`  :   Use `<q>` tags for quotes in HTML.  (This option only has an     effect if the `smart` extension is enabled for the input     format used.) -`--ascii`+`--ascii[=true|false]`  :   Use only ASCII characters in output. Currently supported for XML     and HTML formats (which use entities instead of UTF-8 when this@@ -1004,7 +1007,7 @@     limited degree LaTeX (which uses standard commands for accented     characters when possible). -`--reference-links`+`--reference-links[=true|false]`  :   Use reference-style links, rather than inline links, in writing Markdown     or reStructuredText.  By default inline links are used.  The@@ -1030,7 +1033,7 @@     ATX-style headings are always used for levels 3+.     This option also affects Markdown cells in `ipynb` output. -`--list-tables`+`--list-tables[=true|false]`  :   Render tables as list tables in RST output. @@ -1068,14 +1071,14 @@     be numbered "1.5", specify `--number-offset=1,4`.     Offsets are 0 by default.  Implies `--number-sections`. -`--listings`+`--listings[=true|false]`  :   Use the [`listings`] package for LaTeX code blocks. The package     does not support multi-byte encoding for source code. To handle UTF-8     you would need to use a custom template. This issue is fully     documented here: [Encoding issue with the listings package]. -`-i`, `--incremental`+`-i`, `--incremental[=true|false]`  :   Make list items in slide shows display incrementally (one by one).     The default is for lists to be displayed all at once.@@ -1092,12 +1095,13 @@     explicitly, the slide level will be set automatically based on     the contents of the document; see [Structuring the slide show]. -`--section-divs`+`--section-divs[=true|false]`  :   Wrap sections in `<section>` tags (or `<div>` tags for `html4`),     and attach identifiers to the enclosing `<section>` (or `<div>`)-    rather than the heading itself. See-    [Heading identifiers], below.+    rather than the heading itself (see+    [Heading identifiers], below). This option only affects+    HTML output (and does not affect HTML slide formats).  `--email-obfuscation=none`|`javascript`|`references` @@ -1527,7 +1531,7 @@  ## Options for wrapper scripts {.options} -`--dump-args`+`--dump-args[=true|false]`  :   Print information about command-line arguments to *stdout*, then exit.     This option is intended primarily for use in wrapper scripts.@@ -1538,7 +1542,7 @@     pandoc options and their arguments, but do include any options appearing     after a `--` separator at the end of the line. -`--ignore-args`+`--ignore-args[=true|false]`  :   Ignore command-line arguments (for use in wrapper scripts).     Regular pandoc options are not ignored.  Thus, for example,@@ -4150,7 +4154,7 @@ [^2]:  The point of this rule is to ensure that normal paragraphs     starting with people's initials, like -        B. Russell was an English philosopher.+        B. Russell won a Nobel Prize (but not for "On Denoting").      do not get treated as list items. @@ -5016,11 +5020,9 @@   ~ It will be rendered using an [interpreted text role `:math:`].  AsciiDoc-  ~ For AsciiDoc output format (`-t asciidoc`) it will appear verbatim-    surrounded by `latexmath:[$...$]` (for inline math) or-    `[latexmath]++++\[...\]+++` (for display math).-    For AsciiDoctor output format (`-t asciidoctor`) the LaTeX delimiters-    (`$..$` and `\[..\]`) are omitted.+  ~ For AsciiDoc output math will appear verbatim surrounded by+    `latexmath:[...]`. For `asciidoc_legacy` the bracketed+    material will also include inline or display math delimiters.  Texinfo   ~ It will be rendered inside a `@math` command.
README.md view
@@ -107,8 +107,12 @@  <div id="output-formats"> -- `asciidoc` ([AsciiDoc](https://www.methods.co.nz/asciidoc/)) or-  `asciidoctor` ([AsciiDoctor](https://asciidoctor.org/))+- `asciidoc` (modern [AsciiDoc](https://www.methods.co.nz/asciidoc/) as+  interpreted by [AsciiDoctor](https://asciidoctor.org/))+- `asciidoc_legacy` ([AsciiDoc](https://www.methods.co.nz/asciidoc/) as+  interpreted by+  [`asciidoc-py`](https://github.com/asciidoc-py/asciidoc-py)).+- `asciidoctor` (deprecated synonym for `asciidoc`) - `beamer` ([LaTeX beamer](https://ctan.org/pkg/beamer) slide show) - `bibtex` ([BibTeX](https://ctan.org/pkg/bibtex) bibliography) - `biblatex` ([BibLaTeX](https://ctan.org/pkg/biblatex) bibliography)
changelog.md view
@@ -1,5 +1,105 @@ # Revision history for pandoc +## pandoc 3.1.5 (2023-07-07)++  * Allow all boolean flags to take an optional `true` or `false` value+    (#8788, Sam S. Almahri). The default is true if no value is specified,+    so this is fully backwards-compatible.++  * Support `--id-prefix` for markdown output (#8878)++  * Markdown reader:++    + Add strictness annotations to fix a memory leak (#8762).++  * Typst reader:++    + Use typst-hs 0.3.0.0, which is more robust, fixes many bugs, and+      targets typst 0.6.+    + Package loading is now supported, as long as the package has been+      cached or is local.+    + Rewrite Typst reader in a way that makes it easier to extend.+    + Filter out CR in raw.+    + Handle block content for link element.+    + Handle block-level content in text element.+    + Handle style, align, place in inline contexts too.+    + Improve info message for skipped elements.++  * Add typst reader tests (#8942).++  * MediaWiki reader:++    + Revise treatment of "link trail." Previously we only included ASCII+      letters. That is correct for English but not for, e.g., Spanish (see+      comment in #8525). A safer approach is to include all letters except+      those in the CJK unified ideograph ranges.++  * AsciiDoc writer:++    + Make modern AsciiDoc the target for `asciidoc` (#8936).+      The AsciiDoc community now regards the dialect parsed by `asciidoctor`+      as the official AsciiDoc syntax, so it should be the target of our+      `asciidoc` format. The `asciidoc` output format now behaves like+      `asciidoctor` used to. `asciidoctor` is a deprecated synonynm. For+      the old `asciidoc` behavior (targeting the Python script),+      use `asciidoc_legacy`. The templates have been consolidated. Instead of+      separate `default.asciidoctor` and `default.asciidoc` templates, there+      is just `default.asciidoc`.+    + Text.Pandoc.Writers.AsciiDoc API changes:+      - `writeAsciiDoc` now behaves like `writeAsciiDoctor` used to.+      - `writeAsciiDoctor` is now a deprecated synonym for `writeAsciiDoc`.+      - New exported function `writeAsciiDocLegacy` behaves like+        `writeAsciDoc` used to.+    + Update line-through for asciidoc writer to custom inline style (#8933,+      Kevin Broch).++  * Typst writer:++    + Support `unlisted` class in headings (#8941).+    + Consolidate bibliography files into one `#bibliography` command (#8937).+    + Improve handling of autolinks (#8931).++  * Docx writer:++    + Make relative widths work in tables. This didn't work before because we+      were missing an attribute that tells Word to used fixed widths rather+      than computing optimal ones.++  * DokuWiki writer: fix lists with Div elements (#8920).+    The DokuWiki writer doesn't render Divs specially, so their presence in+    a list (e.g. because of custom-styles) need not prevent a regular+    DokuWiki list from being used. (Falling back to raw HTML in this case is+    pointless because no new information is given.)++  * LaTeX writer:++    + Fix babel name for `fa` (should be `persian`).+    + Prevent babel language from being imported twice (#8925).++  * Text.Pandoc.Class:++    + Add `toTextM` [API change]. This is like `Text.Pandoc.UTF8.toText`,+      except:++      - it takes a file path as first argument, in addition to+        bytestring contents+      - it raises an informative error with source position if+        the contents are not UTF8-encoded++    This replaces `utf8ToText` whenever we have the filename and are+    in a PandocMonad instance. This will lead to more informative error+    messages for UTF8-encoding, indicating the file path and byte offset+    where the error occurs (#8884).++  * Remove invalid term "Subject" from Turkish translations (#8921).++  * stack.yaml: add pkg-config to nix packages (#8927, pacien).++  * Allow aeson 2.2.++  * MANUAL: Add clarification on --section-divs. Closes #8882.++ ## pandoc 3.1.4 (2023-06-24)    * Fix a security vulnerability in MediaBag and T.P.Class.IO.writeMedia.@@ -7,7 +107,7 @@     arbitrary files to any location by feeding pandoc a specially crafted     URL in an image element.  The vulnerability is serious for anyone     using pandoc to process untrusted input.  The vulnerability does-    not affect pandoc when run with the `--sandbox` flag.+    not affect pandoc when run with the `--sandbox` flag. [CVE-2023-35936]    * Allow `epub-title-page` to be used in defaults files (#8908). 
data/templates/default.asciidoc view
@@ -17,6 +17,9 @@ $if(toc)$ :toc: $endif$+$if(math)$+:stem: latexmath+$endif$  $endif$ $if(abstract)$
− data/templates/default.asciidoctor
@@ -1,43 +0,0 @@-$if(titleblock)$-= $title$-$if(author)$-$for(author)$$author$$sep$; $endfor$-$if(date)$-$date$-$endif$-$elseif(date)$-:revdate: $date$-$endif$-$if(keywords)$-:keywords: $for(keywords)$$keywords$$sep$, $endfor$-$endif$-$if(lang)$-:lang: $lang$-$endif$-$if(toc)$-:toc:-$endif$-$if(math)$-:stem: latexmath-$endif$--$endif$-$if(abstract)$-[abstract]-== Abstract-$abstract$--$endif$-$for(header-includes)$-$header-includes$--$endfor$-$for(include-before)$-$include-before$--$endfor$-$body$-$for(include-after)$--$include-after$-$endfor$
data/templates/default.typst view
@@ -87,10 +87,10 @@  #set bibliography(style: "$bibliographystyle$") $endif$-$for(bibliography)$+$if(bibliography)$ -#bibliography("$bibliography$")-$endfor$+#bibliography($for(bibliography)$"$bibliography$"$sep$,$endfor$)+$endif$ $endif$ $for(include-after)$ 
data/translations/tr.yaml view
@@ -17,6 +17,5 @@ References: Kaynaklar See: bkz. SeeAlso: ayrıca bkz.-Subject: İlgili Table: Tablo To: Alıcı
man/pandoc.1 view
@@ -14,7 +14,7 @@ . ftr VB CB . ftr VBI CBI .\}-.TH "Pandoc User\[cq]s Guide" "" "June 24, 2023" "pandoc 3.1.4" ""+.TH "Pandoc User\[cq]s Guide" "" "July 07, 2023" "pandoc 3.1.5" "" .hy .SH NAME pandoc - general markup converter@@ -339,8 +339,13 @@ \f[I]FORMAT\f[R] can be: .RS .IP \[bu] 2-\f[V]asciidoc\f[R] (AsciiDoc) or \f[V]asciidoctor\f[R] (AsciiDoctor)+\f[V]asciidoc\f[R] (modern AsciiDoc as interpreted by AsciiDoctor) .IP \[bu] 2+\f[V]asciidoc_legacy\f[R] (AsciiDoc as interpreted by+\f[V]asciidoc-py\f[R]).+.IP \[bu] 2+\f[V]asciidoctor\f[R] (deprecated synonym for \f[V]asciidoc\f[R])+.IP \[bu] 2 \f[V]beamer\f[R] (LaTeX beamer slide show) .IP \[bu] 2 \f[V]bibtex\f[R] (BibTeX bibliography)@@ -537,7 +542,7 @@ \f[V]--quiet\f[R] Suppress warning messages. .TP-\f[V]--fail-if-warnings\f[R]+\f[V]--fail-if-warnings[=true|false]\f[R] Exit with error status if there are any warnings. .TP \f[V]--log=\f[R]\f[I]FILE\f[R]@@ -605,7 +610,7 @@ different kinds of images. Currently this option only affects the Markdown and LaTeX readers. .TP-\f[V]--file-scope\f[R]+\f[V]--file-scope[=true|false]\f[R] Parse each file individually before combining for multifile documents. This will allow footnotes in different files with the same identifiers to work as expected.@@ -729,7 +734,7 @@ in the \f[V]metadata\f[R] subdirectory of the user data directory (see \f[V]--data-dir\f[R]). .TP-\f[V]-p\f[R], \f[V]--preserve-tabs\f[R]+\f[V]-p\f[R], \f[V]--preserve-tabs[=true|false]\f[R] Preserve tabs instead of converting them to spaces. (By default, pandoc converts tabs to spaces before parsing its input.) Note that this will only affect tabs in literal code spans and code@@ -782,7 +787,7 @@ the period will not produce sentence-ending space in formats like LaTeX. The strings may not contain spaces. .TP-\f[V]--trace\f[R]+\f[V]--trace[=true|false]\f[R] Print diagnostic output tracing parser progress to stderr. This option is intended for use by developers in diagnosing performance issues.@@ -816,7 +821,7 @@ If no \f[I]VAL\f[R] is specified, the key will be given the value \f[V]true\f[R]. .TP-\f[V]--sandbox\f[R]+\f[V]--sandbox[=true|false]\f[R] Run pandoc in a sandbox, limiting IO operations in readers and writers to reading the files specified on the command line. Note that this option does not limit IO operations by filters or in the@@ -891,7 +896,7 @@ It also affects calculation of column widths for plain text tables (see Tables below). .TP-\f[V]--toc\f[R], \f[V]--table-of-contents\f[R]+\f[V]--toc[=true|false]\f[R], \f[V]--table-of-contents[=true|false]\f[R] Include an automatically generated table of contents (or, in the case of \f[V]latex\f[R], \f[V]context\f[R], \f[V]docx\f[R], \f[V]odt\f[R], \f[V]opendocument\f[R], \f[V]rst\f[R], or \f[V]ms\f[R], an instruction@@ -913,7 +918,7 @@ The default is 3 (which means that level-1, 2, and 3 headings will be listed in the contents). .TP-\f[V]--strip-comments\f[R]+\f[V]--strip-comments[=true|false]\f[R] Strip out HTML comments in the Markdown or Textile source, rather than passing them on to Markdown, Textile or HTML output as raw HTML. This does not apply to HTML comments inside raw HTML blocks when the@@ -1007,17 +1012,17 @@ If you\[cq]re behind a proxy, you also need to set the environment variable \f[V]http_proxy\f[R] to \f[V]http://...\f[R]. .TP-\f[V]--no-check-certificate\f[R]+\f[V]--no-check-certificate[=true|false]\f[R] Disable the certificate verification to allow access to unsecure HTTP resources (for example when the certificate is no longer valid or self signed). .SS Options affecting specific writers .TP-\f[V]--self-contained\f[R]+\f[V]--self-contained[=true|false]\f[R] \f[I]Deprecated synonym for \f[VI]--embed-resources --standalone\f[I].\f[R] .TP-\f[V]--embed-resources\f[R]+\f[V]--embed-resources[=true|false]\f[R] Produce a standalone HTML file with no external dependencies, using \f[V]data:\f[R] URIs to incorporate the contents of linked scripts, stylesheets, images, and videos.@@ -1041,12 +1046,12 @@ speaker notes) may not work in an offline \[lq]self-contained\[rq] \f[V]reveal.js\f[R] slide show. .TP-\f[V]--html-q-tags\f[R]+\f[V]--html-q-tags[=true|false]\f[R] Use \f[V]<q>\f[R] tags for quotes in HTML. (This option only has an effect if the \f[V]smart\f[R] extension is enabled for the input format used.) .TP-\f[V]--ascii\f[R]+\f[V]--ascii[=true|false]\f[R] Use only ASCII characters in output. Currently supported for XML and HTML formats (which use entities instead of UTF-8 when this option is selected), CommonMark, gfm, and Markdown@@ -1054,7 +1059,7 @@ and to a limited degree LaTeX (which uses standard commands for accented characters when possible). .TP-\f[V]--reference-links\f[R]+\f[V]--reference-links[=true|false]\f[R] Use reference-style links, rather than inline links, in writing Markdown or reStructuredText. By default inline links are used.@@ -1080,7 +1085,7 @@ ATX-style headings are always used for levels 3+. This option also affects Markdown cells in \f[V]ipynb\f[R] output. .TP-\f[V]--list-tables\f[R]+\f[V]--list-tables[=true|false]\f[R] Render tables as list tables in RST output. .TP \f[V]--top-level-division=default\f[R]|\f[V]section\f[R]|\f[V]chapter\f[R]|\f[V]part\f[R]@@ -1119,14 +1124,14 @@ Offsets are 0 by default. Implies \f[V]--number-sections\f[R]. .TP-\f[V]--listings\f[R]+\f[V]--listings[=true|false]\f[R] Use the \f[V]listings\f[R] package for LaTeX code blocks. The package does not support multi-byte encoding for source code. To handle UTF-8 you would need to use a custom template. This issue is fully documented here: Encoding issue with the listings package. .TP-\f[V]-i\f[R], \f[V]--incremental\f[R]+\f[V]-i\f[R], \f[V]--incremental[=true|false]\f[R] Make list items in slide shows display incrementally (one by one). The default is for lists to be displayed all at once. .TP@@ -1145,11 +1150,13 @@ set automatically based on the contents of the document; see Structuring the slide show. .TP-\f[V]--section-divs\f[R]+\f[V]--section-divs[=true|false]\f[R] Wrap sections in \f[V]<section>\f[R] tags (or \f[V]<div>\f[R] tags for \f[V]html4\f[R]), and attach identifiers to the enclosing-\f[V]<section>\f[R] (or \f[V]<div>\f[R]) rather than the heading itself.-See Heading identifiers, below.+\f[V]<section>\f[R] (or \f[V]<div>\f[R]) rather than the heading itself+(see Heading identifiers, below).+This option only affects HTML output (and does not affect HTML slide+formats). .TP \f[V]--email-obfuscation=none\f[R]|\f[V]javascript\f[R]|\f[V]references\f[R] Specify a method for obfuscating \f[V]mailto:\f[R] links in HTML@@ -1646,7 +1653,7 @@ .RE .SS Options for wrapper scripts .TP-\f[V]--dump-args\f[R]+\f[V]--dump-args[=true|false]\f[R] Print information about command-line arguments to \f[I]stdout\f[R], then exit. This option is intended primarily for use in wrapper scripts.@@ -1659,7 +1666,7 @@ include any options appearing after a \f[V]--\f[R] separator at the end of the line. .TP-\f[V]--ignore-args\f[R]+\f[V]--ignore-args[=true|false]\f[R] Ignore command-line arguments (for use in wrapper scripts). Regular pandoc options are not ignored. Thus, for example,@@ -5531,11 +5538,10 @@ It will be rendered using an interpreted text role \f[V]:math:\f[R]. .TP AsciiDoc-For AsciiDoc output format (\f[V]-t asciidoc\f[R]) it will appear-verbatim surrounded by \f[V]latexmath:[$...$]\f[R] (for inline math) or-\f[V][latexmath]++++\[rs][...\[rs]]+++\f[R] (for display math).-For AsciiDoctor output format (\f[V]-t asciidoctor\f[R]) the LaTeX-delimiters (\f[V]$..$\f[R] and \f[V]\[rs][..\[rs]]\f[R]) are omitted.+For AsciiDoc output math will appear verbatim surrounded by+\f[V]latexmath:[...]\f[R].+For \f[V]asciidoc_legacy\f[R] the bracketed material will also include+inline or display math delimiters. .TP Texinfo It will be rendered inside a \f[V]\[at]math\f[R] command.
pandoc.cabal view
@@ -1,10 +1,10 @@ cabal-version:   2.4 name:            pandoc-version:         3.1.4+version:         3.1.5 build-type:      Simple license:         GPL-2.0-or-later license-file:    COPYING.md-copyright:       (c) 2006-2022 John MacFarlane+copyright:       (c) 2006-2023 John MacFarlane author:          John MacFarlane <jgm@berkeley.edu> maintainer:      John MacFarlane <jgm@berkeley.edu> bug-reports:     https://github.com/jgm/pandoc/issues@@ -86,7 +86,6 @@                  data/templates/default.revealjs                  data/templates/default.dzslides                  data/templates/default.asciidoc-                 data/templates/default.asciidoctor                  data/templates/default.haddock                  data/templates/default.textile                  data/templates/default.org@@ -274,6 +273,8 @@                  test/media/rId25.jpg                  test/media/rId26.jpg                  test/media/rId27.jpg+                 test/typst-reader.typ+                 test/undergradmath.typ                  test/latex-reader.latex                  test/textile-reader.textile                  test/markdown-reader-more.txt@@ -313,7 +314,7 @@                  test/tables.opendocument                  test/tables.org                  test/tables.asciidoc-                 test/tables.asciidoctor+                 test/tables.asciidoc_legacy                  test/tables.haddock                  test/tables.texinfo                  test/tables.typst@@ -351,7 +352,7 @@                  test/writer.opendocument                  test/writer.org                  test/writer.asciidoc-                 test/writer.asciidoctor+                 test/writer.asciidoc_legacy                  test/writer.haddock                  test/writer.rst                  test/writer.icml@@ -465,7 +466,7 @@                  Glob                  >= 0.7      && < 0.11,                  JuicyPixels           >= 3.1.6.1  && < 3.4,                  SHA                   >= 1.6      && < 1.7,-                 aeson                 >= 2.0.1.0  && < 2.2,+                 aeson                 >= 2.0.1.0  && < 2.3,                  aeson-pretty          >= 0.8.9    && < 0.9,                  array                 >= 0.5      && < 0.6,                  attoparsec            >= 0.12     && < 0.15,@@ -475,7 +476,7 @@                  bytestring            >= 0.9      && < 0.12,                  case-insensitive      >= 1.2      && < 1.3,                  citeproc              >= 0.8.1    && < 0.9,-                 commonmark            >= 0.2.2    && < 0.3,+                 commonmark            >= 0.2.3    && < 0.3,                  commonmark-extensions >= 0.2.3.4  && < 0.3,                  commonmark-pandoc     >= 0.2.1.3  && < 0.3,                  containers            >= 0.6.0.1  && < 0.7,@@ -509,8 +510,8 @@                  random                >= 1        && < 1.3,                  safe                  >= 0.3.18   && < 0.4,                  scientific            >= 0.3      && < 0.4,-                 skylighting           >= 0.13.3   && < 0.14,-                 skylighting-core      >= 0.13.3   && < 0.14,+                 skylighting           >= 0.13.4   && < 0.14,+                 skylighting-core      >= 0.13.4   && < 0.14,                  split                 >= 0.2      && < 0.3,                  syb                   >= 0.1      && < 0.8,                  tagsoup               >= 0.14.6   && < 0.15,@@ -525,7 +526,7 @@                  zip-archive           >= 0.4.3    && < 0.5,                  zlib                  >= 0.5      && < 0.7,                  xml                   >= 1.3.12   && < 1.4,-                 typst                 >= 0.1      && < 0.2,+                 typst                 >= 0.3      && < 0.4,                  vector                >= 0.12     && < 0.14    if !os(windows)
src/Text/Pandoc/App.hs view
@@ -366,10 +366,11 @@ -- only affect the Markdown reader. readAbbreviations :: PandocMonad m => Maybe FilePath -> m (Set.Set Text) readAbbreviations mbfilepath =-  Set.fromList . filter (not . T.null) . T.lines . UTF8.toText <$>-  case mbfilepath of+  (case mbfilepath of     Nothing -> readDataFile "abbreviations"-    Just f  -> readFileStrict f+    Just f  -> readFileStrict f)+    >>= fmap (Set.fromList . filter (not . T.null) . T.lines) .+         toTextM (fromMaybe mempty mbfilepath)  createPngFallbacks :: (PandocMonad m, MonadIO m) => Int -> m () createPngFallbacks dpi = do
src/Text/Pandoc/App/CommandLineOptions.hs view
@@ -293,18 +293,27 @@                 ""      , Option "" ["file-scope"]-                 (NoArg-                  (\opt -> return opt { optFileScope = True }))+                 (OptArg+                  (\arg opt -> do+                        boolValue <- readBoolFromOptArg arg+                        return opt { optFileScope = boolValue })+                  "true|false")                  "" -- "Parse input files before combining"      , Option "" ["sandbox"]-                 (NoArg-                  (\opt -> return opt { optSandbox = True }))+                 (OptArg+                  (\arg opt -> do+                        boolValue <- readBoolFromOptArg arg+                        return opt { optSandbox = boolValue })+                  "true|false")                  ""      , Option "s" ["standalone"]-                 (NoArg-                  (\opt -> return opt { optStandalone = True }))+                 (OptArg+                  (\arg opt -> do+                        boolValue <- readBoolFromOptArg arg+                        return opt { optStandalone = boolValue })+                  "true|false")                  "" -- "Include needed header and footer on output"      , Option "" ["template"]@@ -337,13 +346,19 @@                  "" -- "Option for wrapping text in output"      , Option "" ["ascii"]-                 (NoArg-                  (\opt -> return opt { optAscii = True }))+                 (OptArg+                  (\arg opt -> do+                        boolValue <- readBoolFromOptArg arg+                        return opt { optAscii = boolValue })+                  "true|false")                  ""  -- "Prefer ASCII output"      , Option "" ["toc", "table-of-contents"]-                (NoArg-                 (\opt -> return opt { optTableOfContents = True }))+                (OptArg+                 (\arg opt -> do+                        boolValue <- readBoolFromOptArg arg+                        return opt { optTableOfContents = boolValue })+                 "true|false")                "" -- "Include table of contents"      , Option "" ["toc-depth"]@@ -486,8 +501,11 @@                  "" -- "Length of line in characters"      , Option "p" ["preserve-tabs"]-                 (NoArg-                  (\opt -> return opt { optPreserveTabs = True }))+                 (OptArg+                  (\arg opt -> do+                        boolValue <- readBoolFromOptArg arg+                        return opt { optPreserveTabs = boolValue })+                  "true|false")                  "" -- "Preserve tabs instead of converting to spaces"      , Option "" ["tab-stop"]@@ -529,15 +547,20 @@                  "" -- "Path of custom reference doc"      , Option "" ["self-contained"]-                 (NoArg-                  (\opt -> do-                    deprecatedOption "--self-contained" "use --embed-resources --standalone"-                    return opt { optSelfContained = True }))+                 (OptArg+                  (\arg opt -> do+                        deprecatedOption "--self-contained" "use --embed-resources --standalone"+                        boolValue <- readBoolFromOptArg arg+                        return opt { optSelfContained = boolValue })+                    "true|false")                  "" -- "Make slide shows include all the needed js and css (deprecated)" -    , Option "" ["embed-resources"]-                 (NoArg-                  (\opt -> return opt { optEmbedResources = True }))+    , Option "" ["embed-resources"] -- maybe True (\argStr -> argStr == "true") arg+                 (OptArg+                  (\arg opt -> do+                        boolValue <- readBoolFromOptArg arg+                        return opt { optEmbedResources =  boolValue })+                  "true|false")                  "" -- "Make slide shows include all the needed js and css"      , Option "" ["request-header"]@@ -550,8 +573,11 @@                  ""      , Option "" ["no-check-certificate"]-                (NoArg-                 (\opt -> return opt { optNoCheckCertificate = True }))+                (OptArg+                 (\arg opt -> do+                        boolValue <- readBoolFromOptArg arg+                        return opt { optNoCheckCertificate = boolValue })+                 "true|false")                 "" -- "Disable certificate validation"      , Option "" ["abbreviations"]@@ -627,13 +653,19 @@                  "" -- "Accepting or reject MS Word track-changes.""      , Option "" ["strip-comments"]-                (NoArg-                 (\opt -> return opt { optStripComments = True }))+                (OptArg+                 (\arg opt -> do+                        boolValue <- readBoolFromOptArg arg+                        return opt { optStripComments = boolValue })+                 "true|false")                "" -- "Strip HTML comments"      , Option "" ["reference-links"]-                 (NoArg-                  (\opt -> return opt { optReferenceLinks = True } ))+                 (OptArg+                  (\arg opt -> do+                        boolValue <- readBoolFromOptArg arg+                        return opt { optReferenceLinks = boolValue })+                  "true|false")                  "" -- "Use reference links in parsing HTML"      , Option "" ["reference-location"]@@ -664,19 +696,27 @@                   ""      , Option "" ["list-tables"]-                 (NoArg-                  (\opt -> do-                    return opt { optListTables = True } ))+                 (OptArg+                  (\arg opt -> do+                        boolValue <- readBoolFromOptArg arg+                        return opt { optListTables = boolValue })+                  "true|false")                  "" -- "Use list tables for RST"      , Option "" ["listings"]-                 (NoArg-                  (\opt -> return opt { optListings = True }))+                 (OptArg+                  (\arg opt -> do+                        boolValue <- readBoolFromOptArg arg+                        return opt { optListings = boolValue })+                  "true|false")                  "" -- "Use listings package for LaTeX code blocks"      , Option "i" ["incremental"]-                 (NoArg-                  (\opt -> return opt { optIncremental = True }))+                 (OptArg+                  (\arg opt -> do+                        boolValue <- readBoolFromOptArg arg+                        return opt { optIncremental = boolValue })+                  "true|false")                  "" -- "Make list items display incrementally in Slidy/Slideous/S5"      , Option "" ["slide-level"]@@ -691,14 +731,19 @@                  "" -- "Force header level for slides"      , Option "" ["section-divs"]-                 (NoArg-                  (\opt -> return opt { optSectionDivs = True }))+                 (OptArg+                  (\arg opt -> do+                        boolValue <- readBoolFromOptArg arg+                        return opt { optSectionDivs = boolValue })+                  "true|false")                  "" -- "Put sections in div tags in HTML"      , Option "" ["html-q-tags"]-                 (NoArg-                  (\opt ->-                     return opt { optHtmlQTags = True }))+                 (OptArg+                  (\arg opt -> do+                        boolValue <- readBoolFromOptArg arg+                        return opt { optHtmlQTags = boolValue })+                  "true|false")                  "" -- "Use <q> tags for quotes in HTML"      , Option "" ["email-obfuscation"]@@ -908,18 +953,27 @@                  "" -- "Use gladtex for HTML math"      , Option "" ["trace"]-                 (NoArg-                  (\opt -> return opt { optTrace = True }))+                 (OptArg+                  (\arg opt -> do+                        boolValue <- readBoolFromOptArg arg+                        return opt { optTrace = boolValue })+                  "true|false")                  "" -- "Turn on diagnostic tracing in readers."      , Option "" ["dump-args"]-                 (NoArg-                  (\opt -> return opt { optDumpArgs = True }))+                 (OptArg+                  (\arg opt -> do+                        boolValue <- readBoolFromOptArg arg+                        return opt { optDumpArgs = boolValue })+                  "true|false")                  "" -- "Print output filename and arguments to stdout."      , Option "" ["ignore-args"]-                 (NoArg-                  (\opt -> return opt { optIgnoreArgs = True }))+                 (OptArg+                  (\arg opt -> do+                        boolValue <- readBoolFromOptArg arg+                        return opt { optIgnoreArgs = boolValue })+                  "true|false")                  "" -- "Ignore command-line arguments."      , Option "" ["verbose"]@@ -933,8 +987,11 @@                  "" -- "Suppress warnings."      , Option "" ["fail-if-warnings"]-                 (NoArg-                  (\opt -> return opt { optFailIfWarnings = True }))+                 (OptArg+                  (\arg opt -> do+                        boolValue <- readBoolFromOptArg arg+                        return opt { optFailIfWarnings = boolValue })+                  "true|false")                  "" -- "Exit with error status if there were  warnings."      , Option "" ["log"]@@ -1097,6 +1154,13 @@   | s == "False" = MetaBool False   | s == "FALSE" = MetaBool False   | otherwise    = MetaString $ T.pack s++readBoolFromOptArg ::  Maybe String -> ExceptT OptInfo IO Bool+readBoolFromOptArg = maybe (return True) readBoolFromArg+    where readBoolFromArg arg = case toLower <$> arg of+            "true"  -> return True+            "false" -> return False+            _       -> optError $ PandocOptionError "value must be either true or false"  -- On Windows with ghc 8.6+, we need to rewrite paths -- beginning with \\ to \\?\UNC\. -- See #5127.
src/Text/Pandoc/App/Input.hs view
@@ -18,7 +18,7 @@ import Control.Monad.Except (throwError, catchError) import Data.Text (Text) import Network.URI (URI (..), parseURI, unEscapeString)-import Text.Pandoc.Class ( PandocMonad, openURL+import Text.Pandoc.Class ( PandocMonad, openURL, toTextM                          , readFileStrict, readStdinStrict, report) import Text.Pandoc.Definition (Pandoc (..), Attr, Block (..), Inline (..)) import Text.Pandoc.Error (PandocError (..))@@ -26,15 +26,13 @@ import Text.Pandoc.MIME (getCharset, MimeType) import Text.Pandoc.Options (Extensions, ReaderOptions (..)) import Text.Pandoc.Readers (Reader (..))-import Text.Pandoc.Shared (tabFilter, textToIdentifier, tshow)+import Text.Pandoc.Shared (tabFilter, textToIdentifier) import Text.Pandoc.URI (uriPathToPath) import Text.Pandoc.Walk (walk) import qualified Data.ByteString as BS import qualified Data.ByteString.Char8 as B8 import qualified Data.ByteString.Lazy as BL import qualified Data.Text as T-import qualified Data.Text.Encoding as TSE-import qualified Data.Text.Encoding.Error as TSE  -- | Settings specifying how and which input should be processed. data InputParameters m = InputParameters@@ -97,21 +95,6 @@                  readFileStrict (uriPathToPath $ T.pack $ uriPath u)     _       -> (,Nothing) <$> readFileStrict src -utf8ToText :: PandocMonad m => FilePath -> BS.ByteString -> m Text-utf8ToText fp bs =-  case TSE.decodeUtf8' . dropBOM $ bs of-    Left (TSE.DecodeError _ (Just w)) ->-      case BS.elemIndex w bs of-        Just offset -> throwError $ PandocUTF8DecodingError (T.pack fp) offset w-        Nothing -> throwError $ PandocUTF8DecodingError (T.pack fp) 0 w-    Left e -> throwError $ PandocAppError (tshow e)-    Right t -> return t- where-   dropBOM bs' =-     if "\xEF\xBB\xBF" `BS.isPrefixOf` bs'-        then BS.drop 3 bs'-        else bs'- inputToText :: PandocMonad m             => (Text -> Text)             -> (FilePath, (BS.ByteString, Maybe MimeType))@@ -119,11 +102,11 @@ inputToText convTabs (fp, (bs,mt)) =   (fp,) . convTabs . T.filter (/='\r') <$>   case mt >>= getCharset of-    Just "UTF-8"      -> utf8ToText fp bs+    Just "UTF-8"      -> toTextM fp bs     Just "ISO-8859-1" -> return $ T.pack $ B8.unpack bs     Just charset      -> throwError $ PandocUnsupportedCharsetError charset     Nothing           -> catchError-                           (utf8ToText fp bs)+                           (toTextM fp bs)                            (\case                               PandocUTF8DecodingError{} -> do                                 report $ NotUTF8Encoded
src/Text/Pandoc/App/OutputSettings.hs view
@@ -47,7 +47,7 @@ import qualified Text.Pandoc.UTF8 as UTF8  readUtf8File :: PandocMonad m => FilePath -> m T.Text-readUtf8File = fmap UTF8.toText . readFileStrict+readUtf8File fp = readFileStrict fp >>= toTextM fp  -- | Settings specifying how document output should be produced. data OutputSettings m = OutputSettings@@ -93,6 +93,9 @@                      return (defaultOutputFlavor,Nothing)                    Just f  -> return (f, Nothing) +  when (format == "asciidoctor") $ do+    report $ Deprecated "asciidoctor" "use asciidoc instead"+   let makeSandboxed pureWriter =           let files = maybe id (:) (optReferenceDoc opts) .                       maybe id (:) (optEpubMetadata opts) .@@ -174,7 +177,7 @@                          (ListVal $ v : map toVal vs) ctxMap               Nothing -> M.insert k (toVal vs) ctxMap -  let getTextContents fp = UTF8.toText . fst <$> fetchItem (T.pack fp)+  let getTextContents fp = (fst <$> fetchItem (T.pack fp)) >>= toTextM fp    let setFilesVariableM k fps ctx = do         xs <- mapM getTextContents fps@@ -209,8 +212,9 @@     >>=     (\vars ->  if format == "dzslides"                   then do-                      dztempl <- UTF8.toText <$> readDataFile-                                   ("dzslides" </> "template.html")+                      dztempl <-+                        let fp = "dzslides" </> "template.html"+                         in readDataFile fp >>= toTextM fp                       let dzline = "<!-- {{{{ dzslides core"                       let dzcore = T.unlines                                  $ dropWhile (not . (dzline `T.isPrefixOf`))
src/Text/Pandoc/Citeproc.hs view
@@ -24,7 +24,7 @@ import qualified Text.Pandoc.Builder as B import Text.Pandoc.Definition as Pandoc import Text.Pandoc.Class (PandocMonad(..), getResourcePath, getUserDataDir,-                          fetchItem, report, setResourcePath)+                          fetchItem, report, setResourcePath, toTextM) import Text.Pandoc.Data (readDataFile) import Text.Pandoc.Error (PandocError(..)) import Text.Pandoc.Extensions (pandocExtensions)@@ -32,7 +32,6 @@ import Text.Pandoc.Options (ReaderOptions(..)) import Text.Pandoc.Shared (stringify, tshow) import Data.Containers.ListUtils (nubOrd)-import qualified Text.Pandoc.UTF8 as UTF8 import Text.Pandoc.Walk (query, walk, walkM) import Control.Applicative ((<|>)) import Control.Monad.Except (catchError, throwError)@@ -143,7 +142,8 @@    let getCslDefault = readDataFile "default.csl" -  cslContents <- UTF8.toText <$> maybe getCslDefault (getFile ".csl") cslfile+  cslContents <- maybe getCslDefault (getFile ".csl") cslfile >>=+                   toTextM (maybe mempty T.unpack cslfile)    let abbrevFile = lookupMeta "citation-abbreviations" meta >>= metaValueToText @@ -161,8 +161,8 @@   let getParentStyle url = do         -- first, try to retrieve the style locally, then use HTTP.         let basename = T.takeWhileEnd (/='/') url-        UTF8.toText <$>-          catchError (getFile ".csl" basename) (\_ -> fst <$> fetchItem url)+        catchError (getFile ".csl" basename) (\_ -> fst <$> fetchItem url)+          >>= toTextM (T.unpack url)    styleRes <- Citeproc.parseStyle getParentStyle cslContents   case styleRes of@@ -254,13 +254,14 @@ getRefs locale format idpred mbfp raw = do   let err' = throwError .              PandocBibliographyError (fromMaybe mempty mbfp)+  let fp = maybe mempty T.unpack mbfp   case format of     Format_bibtex ->-      either (err' . tshow) return .-        readBibtexString Bibtex locale idpred . UTF8.toText $ raw+      toTextM fp raw >>=+        either (err' . tshow) return . readBibtexString Bibtex locale idpred     Format_biblatex ->-      either (err' . tshow) return .-        readBibtexString Biblatex locale idpred . UTF8.toText $ raw+      toTextM fp raw >>=+      either (err' . tshow) return . readBibtexString Biblatex locale idpred     Format_json ->       either (err' . T.pack)              (return . filter (idpred . unItemId . referenceId)) .@@ -272,7 +273,7 @@               raw       return $ mapMaybe metaValueToReference rs     Format_ris -> do-      Pandoc meta _ <- readRIS def (UTF8.toText raw)+      Pandoc meta _ <- toTextM fp raw >>= readRIS def       case lookupMeta "references" meta of         Just (MetaList rs) -> return $ mapMaybe metaValueToReference rs         _ -> return []
src/Text/Pandoc/Class/PandocMonad.hs view
@@ -47,6 +47,7 @@   , setResourcePath   , getResourcePath   , readMetadataFile+  , toTextM   , fillMediaBag   , toLang   , makeCanonical@@ -74,7 +75,7 @@ import Text.Pandoc.Logging import Text.Pandoc.MIME (MimeType, getMimeType) import Text.Pandoc.MediaBag (MediaBag, lookupMedia, MediaItem(..))-import Text.Pandoc.Shared (safeRead, makeCanonical)+import Text.Pandoc.Shared (safeRead, makeCanonical, tshow) import Text.Pandoc.URI (uriPathToPath) import Text.Pandoc.Walk (walkM) import Text.Parsec (ParsecT, getPosition, sourceLine, sourceName)@@ -83,7 +84,8 @@ import qualified Data.Text as T import qualified Debug.Trace import qualified Text.Pandoc.MediaBag as MB-import qualified Text.Pandoc.UTF8 as UTF8+import qualified Data.Text.Encoding as TSE+import qualified Data.Text.Encoding.Error as TSE  -- | The PandocMonad typeclass contains all the potentially -- IO-related functions used in pandoc's readers and writers.@@ -271,7 +273,7 @@ readFileFromDirs :: PandocMonad m => [FilePath] -> FilePath -> m (Maybe T.Text) readFileFromDirs [] _ = return Nothing readFileFromDirs (d:ds) f = catchError-    (Just . T.pack . UTF8.toStringLazy <$> readFileLazy (d </> f))+    (Just <$> (readFileStrict (d </> f) >>= toTextM (d </> f)))     (\_ -> readFileFromDirs ds f)  -- | Convert BCP47 string to a Lang, issuing warning@@ -402,6 +404,27 @@ withPaths (p:ps) action fp =   catchError ((p </> fp,) <$> action (p </> fp))              (\_ -> withPaths ps action fp)++-- | A variant of Text.Pandoc.UTF8.toText that takes a FilePath+-- as well as the file's contents as parameter, and traps UTF8+-- decoding errors so it can issue a more informative PandocUTF8DecodingError+-- with source position.+toTextM :: PandocMonad m => FilePath -> B.ByteString -> m T.Text+toTextM fp bs =+  case TSE.decodeUtf8' . filterCRs . dropBOM $ bs of+    Left (TSE.DecodeError _ (Just w)) ->+      case B.elemIndex w bs of+        Just offset ->+          throwError $ PandocUTF8DecodingError (T.pack fp) offset w+        Nothing -> throwError $ PandocUTF8DecodingError (T.pack fp) 0 w+    Left e -> throwError $ PandocAppError (tshow e)+    Right t -> return t+ where+   dropBOM bs' =+     if "\xEF\xBB\xBF" `B.isPrefixOf` bs'+        then B.drop 3 bs'+        else bs'+   filterCRs = B.filter (/=13)  -- | Returns @fp@ if the file exists in the current directory; otherwise -- searches for the data file relative to @/subdir/@. Returns @Nothing@
src/Text/Pandoc/Readers/CommonMark.hs view
@@ -33,8 +33,7 @@ import Text.Pandoc.Parsing (runParserT, getInput, getPosition,                             runF, defaultParserState, option, many1, anyChar,                             Sources(..), ToSources(..), ParsecT, Future,-                            sourceName, sourceLine, incSourceLine,-                            fromParsecError)+                            incSourceLine, fromParsecError) import Text.Pandoc.Walk (walk) import qualified Data.Text as T import qualified Data.Attoparsec.Text as A
src/Text/Pandoc/Readers/Markdown.hs view
@@ -1908,12 +1908,11 @@         -> F Inlines         -> MarkdownParser m (F Inlines) regLink constructor lab = try $ do-  (src, tit) <- source+  (!src, !tit) <- source   rebase <- option False (True <$ guardEnabled Ext_rebase_relative_paths)   pos <- getPosition-  let src' = if rebase then rebasePath pos src else src-  attr <- option nullAttr $-          guardEnabled Ext_link_attributes >> attributes+  let !src' = if rebase then rebasePath pos src else src+  !attr <- option nullAttr $ guardEnabled Ext_link_attributes >> attributes   return $ constructor attr src' tit <$> lab  -- a link like [this][ref] or [this][] or [this]@@ -1923,7 +1922,7 @@               -> MarkdownParser m (F Inlines) referenceLink constructor (lab, raw) = do   sp <- (True <$ lookAhead (char ' ')) <|> return False-  (_,raw') <- option (mempty, "") $+  (_,!raw') <- option (mempty, "") $       lookAhead (try (do guardEnabled Ext_citations                          guardDisabled Ext_spaced_reference_links <|> spnl                          normalCite@@ -1931,8 +1930,8 @@       <|>       try ((guardDisabled Ext_spaced_reference_links <|> spnl) >> reference)   when (raw' == "") $ guardEnabled Ext_shortcut_reference_links-  let labIsRef = raw' == "" || raw' == "[]"-  let key = toKey $ if labIsRef then raw else raw'+  let !labIsRef = raw' == "" || raw' == "[]"+  let !key = toKey $ if labIsRef then raw else raw'   parsedRaw <- parseFromString' inlines raw'   fallback  <- parseFromString' inlines $ dropBrackets raw   implicitHeaderRefs <- option False $@@ -2056,25 +2055,24 @@ rawLaTeXInline' = do   guardEnabled Ext_raw_tex   notFollowedBy' rawConTeXtEnvironment-  try $ do-    s <- rawLaTeXInline-    return $ return $ B.rawInline "tex" s -- "tex" because it might be context+  !s <- rawLaTeXInline+  return $ return $ B.rawInline "tex" s -- "tex" because it might be context  rawConTeXtEnvironment :: PandocMonad m => ParsecT Sources st m Text rawConTeXtEnvironment = try $ do   string "\\start"   completion <- inBrackets (letter <|> digit <|> spaceChar)                <|> many1Char letter-  contents <- manyTill (rawConTeXtEnvironment <|> countChar 1 anyChar)+  !contents <- manyTill (rawConTeXtEnvironment <|> countChar 1 anyChar)                        (try $ string "\\stop" >> textStr completion)-  return $ "\\start" <> completion <> T.concat contents <> "\\stop" <> completion+  return $! "\\start" <> completion <> T.concat contents <> "\\stop" <> completion  inBrackets :: PandocMonad m => ParsecT Sources st m Char -> ParsecT Sources st m Text inBrackets parser = do   char '['   contents <- manyChar parser   char ']'-  return $ "[" <> contents <> "]"+  return $! "[" <> contents <> "]"  spanHtml :: PandocMonad m => MarkdownParser m (F Inlines) spanHtml = do@@ -2155,15 +2153,12 @@  -- Emoji -emojiChars :: [Char]-emojiChars = ['a'..'z'] ++ ['0'..'9'] ++ ['_','+','-']- emoji :: PandocMonad m => MarkdownParser m (F Inlines) emoji = do   guardEnabled Ext_emoji   try $ do     char ':'-    emojikey <- many1Char (oneOf emojiChars)+    emojikey <- many1Char (alphaNum <|> oneOf "_+-")     char ':'     case emojiToInline emojikey of       Just i -> return (return $ B.singleton i)
src/Text/Pandoc/Readers/MediaWiki.hs view
@@ -19,7 +19,7 @@  import Control.Monad import Control.Monad.Except (throwError)-import Data.Char (isAscii, isDigit, isLetter, isSpace)+import Data.Char (isDigit, isLetter, isSpace) import qualified Data.Foldable as F import Data.List (intersperse) import Data.Maybe (fromMaybe, maybeToList)@@ -664,13 +664,31 @@              -- [[Help:Contents|] -> "Contents"              <|> return (B.text $ T.drop 1 $ T.dropWhile (/=':') pagename) )   sym "]]"-  linktrail <- B.text <$> manyChar (satisfy (\c -> isAscii c && isLetter c))+  -- see #8525:+  linktrail <- B.text <$> manyChar (satisfy (\c -> isLetter c && not (isCJK c)))   let link = B.link (addUnderscores pagename) "wikilink" (label <> linktrail)   if "Category:" `T.isPrefixOf` pagename      then do        updateState $ \st -> st{ mwCategoryLinks = link : mwCategoryLinks st }        return mempty      else return link++isCJK :: Char -> Bool+isCJK c =+  (c >= '\x3400' && c <= '\x4DBF') ||+  (c >= '\x4E00' && c <= '\x9FFF') ||+  (c >= '\x20000' && c <= '\x2A6DF') ||+  (c >= '\x2A700' && c <= '\x2B73F') ||+  (c >= '\x2B740' && c <= '\x2B81F') ||+  (c >= '\x2B820' && c <= '\x2CEAF') ||+  (c >= '\x2CEB0' && c <= '\x2EBEF') ||+  (c >= '\x30000' && c <= '\x3134F') ||+  (c >= '\x31350' && c <= '\x323AF') ||+  (c >= '\xF900' && c <= '\xFAFF') ||+  (c >= '\x2F800' && c <= '\x2FA1F') ||+  (c >= '\x2F00' && c <= '\x2FDF') ||+  (c >= '\x2E80' && c <= '\x2EFF') ||+  (c >= '\x3000' && c <= '\x303F')  externalLink :: PandocMonad m => MWParser m Inlines externalLink = try $ do
src/Text/Pandoc/Readers/Typst.hs view
@@ -1,3 +1,4 @@+{-# LANGUAGE RankNTypes #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE UndecidableInstances #-} {-# LANGUAGE OverloadedStrings #-}@@ -27,13 +28,15 @@ import Text.Pandoc.Definition import Typst ( parseTypst, evaluateTypst ) import Text.Pandoc.Error (PandocError(..))+import Text.Pandoc.Shared (tshow, blocksToInlines) import Control.Monad.Except (throwError)-import Control.Monad (MonadPlus (mplus), void)+import Control.Monad (MonadPlus (mplus), void, mzero) import qualified Data.Foldable as F import qualified Data.Map as M-import Data.Maybe (catMaybes, fromMaybe, isNothing)+import Data.Maybe (catMaybes, fromMaybe) import Data.Sequence (Seq) import qualified Data.Sequence as Seq+import qualified Data.Set as Set import Data.Text (Text) import qualified Data.Text as T import qualified Data.Vector as V@@ -43,10 +46,11 @@ import Text.TeXMath (writeTeX) import Text.TeXMath.Shared (getSpaceChars) import Text.Pandoc.Readers.Typst.Math (pMathMany)-import Text.Pandoc.Readers.Typst.Parsing (pTok, warn, chunks, getField, P)-import Typst.Methods (applyPureFunction, formatNumber)+import Text.Pandoc.Readers.Typst.Parsing (pTok, ignored, chunks, getField, P)+import Typst.Methods (formatNumber, applyPureFunction) import Typst.Types +-- import Debug.Trace  -- | Read Typst from an input string and return a Pandoc document. readTypst :: (PandocMonad m, ToSources a)@@ -58,12 +62,49 @@         _ -> ""   case parseTypst inputName (sourcesToText sources) of     Left e -> throwError $ PandocParseError $ T.pack $ show e-    Right parsed ->-      evaluateTypst readFileStrict inputName parsed >>=+    Right parsed -> do+      let ops = Operations {+                  loadBytes = readFileStrict,+                  currentUTCTime = getCurrentTime,+                  lookupEnvVar = fmap (fmap T.unpack) . lookupEnv . T.pack,+                  checkExistence = fileExists }+      evaluateTypst ops inputName parsed >>=                   either (throwError . PandocParseError . T.pack . show) pure >>=                   runParserT pPandoc () inputName . F.toList >>=                   either (throwError . PandocParseError . T.pack . show) pure +pBlockElt :: PandocMonad m => P m B.Blocks+pBlockElt = try $ do+  res <- pTok (\t -> isBlock t || not (isInline t))+  -- check for following label+  mbident <- option Nothing $ Just <$> pLab+  case res of+    Elt name@(Identifier tname) pos fields -> do+      case M.lookup name blockHandlers of+        Nothing -> do+          ignored ("unknown block element " <> tname <>+                   " at " <> tshow pos)+          pure mempty+        Just handler -> handler mbident fields+    _ -> pure mempty++pInline :: PandocMonad m => P m B.Inlines+pInline = try $ do+  res <- pTok (\t -> isInline t || not (isBlock t))+  case res of+    Txt t -> pure $ B.text t+    Lab name -> pure $ B.spanWith (name, [], []) mempty+    Elt (Identifier tname) _ _+      | "math." `T.isPrefixOf` tname ->+          B.math . writeTeX <$> pMathMany (Seq.singleton res)+    Elt name@(Identifier tname) pos fields ->+      case M.lookup name inlineHandlers of+        Nothing -> do+          ignored ("unknown inline element " <> tname <>+                   " at " <> tshow pos)+          pure mempty+        Just handler -> handler Nothing fields+ pPandoc :: PandocMonad m => P m B.Pandoc pPandoc = B.doc <$> pBlocks @@ -73,16 +114,11 @@ pBlock :: PandocMonad m => P m B.Blocks pBlock = pPara <|> pBlockElt -pBlockElt :: PandocMonad m => P m B.Blocks-pBlockElt = pTok isBlock >>= handleBlock- pSpace :: PandocMonad m => P m Content pSpace = pTok       ( \case           Txt t | T.all (== ' ') t -> True-          _ -> False-      )-+          _ -> False )  pLab :: PandocMonad m => P m Text pLab = try $ do@@ -94,23 +130,50 @@        )   pure t -handleBlock :: PandocMonad m => Content -> P m B.Blocks-handleBlock tok = do-  -- check for following label-  mbident <- option Nothing $ Just <$> pLab-  case tok of-    Txt {} -> fail "pBlockElt encountered Txt"-    Lab {} -> pure mempty-    Elt "heading" _ fields -> do+isBlock :: Content -> Bool+isBlock (Elt "raw" _ fields) = M.lookup "block" fields == Just (VBoolean True)+isBlock (Elt name _ _) = name `Set.member` blockKeys+isBlock Lab{} = True+isBlock _ = False++isInline :: Content -> Bool+isInline (Elt "raw" _ fields) = M.lookup "block" fields /= Just (VBoolean True)+isInline (Elt name _ _) = name `Set.member` inlineKeys+isInline Lab{} = True+isInline Txt{} = True++blockKeys :: Set.Set Identifier+blockKeys = Set.fromList $ M.keys+  (blockHandlers :: M.Map Identifier+     (Maybe Text -> M.Map Identifier Val -> P PandocPure B.Blocks))++inlineKeys :: Set.Set Identifier+inlineKeys = Set.fromList $ M.keys+  (inlineHandlers :: M.Map Identifier+     (Maybe Text -> M.Map Identifier Val -> P PandocPure B.Inlines))++blockHandlers :: PandocMonad m =>+                   M.Map Identifier+                   (Maybe Text -> M.Map Identifier Val -> P m B.Blocks)+blockHandlers = M.fromList+  [("text", \_ fields -> do       body <- getField "body" fields+      -- sometimes text elements include para breaks+      notFollowedBy $ void $ pWithContents pInlines body+      pWithContents pBlocks body)+  ,("box", \_ fields -> do+      body <- getField "body" fields+      B.divWith ("", ["box"], []) <$> pWithContents pBlocks body)+  ,("heading", \mbident fields -> do+      body <- getField "body" fields       lev <- getField "level" fields <|> pure 1-      B.headerWith (fromMaybe "" mbident,[],[]) lev <$> pWithContents pInlines body-    Elt "list" _ fields -> do+      B.headerWith (fromMaybe "" mbident,[],[]) lev+         <$> pWithContents pInlines body)+  ,("list", \_ fields -> do       children <- V.toList <$> getField "children" fields-      B.bulletList <$> mapM (pWithContents pBlocks) children-    Elt "list.item" _ fields ->-      getField "body" fields >>= pWithContents pBlocks-    Elt "enum" _ fields -> do+      B.bulletList <$> mapM (pWithContents pBlocks) children)+  ,("list.item", \_ fields -> getField "body" fields >>= pWithContents pBlocks)+  ,("enum", \_ fields -> do       children <- V.toList <$> getField "children" fields       mbstart <- getField "start" fields       start <- case mbstart of@@ -138,10 +201,9 @@               "(I)" -> (B.UpperRoman, B.TwoParens)               _ -> (B.DefaultStyle, B.DefaultDelim)       let listAttr = (start, sty, delim)-      B.orderedListWith listAttr <$> mapM (pWithContents pBlocks) children-    Elt "enum.item" _ fields ->-      getField "body" fields >>= pWithContents pBlocks-    Elt "terms" _ fields -> do+      B.orderedListWith listAttr <$> mapM (pWithContents pBlocks) children)+  ,("enum.item", \_ fields -> getField "body" fields >>= pWithContents pBlocks)+  ,("terms", \_ fields -> do       children <- V.toList <$> getField "children" fields       B.definitionList         <$> mapM@@ -152,40 +214,39 @@                 pure (t', [d'])               _ -> pure (mempty, [])           )-          children-    Elt "terms.item" _ fields ->-      getField "body" fields >>= pWithContents pBlocks-    Elt "raw" _ fields -> do-      txt <- getField "text" fields+          children)+  ,("terms.item", \_ fields -> getField "body" fields >>= pWithContents pBlocks)+  ,("raw", \mbident fields -> do+      txt <- T.filter (/= '\r') <$> getField "text" fields       mblang <- getField "lang" fields       let attr = (fromMaybe "" mbident, maybe [] (\l -> [l]) mblang, [])-      pure $ B.codeBlockWith attr txt-    Elt "parbreak" _ _ -> pure mempty-    Elt "block" _ fields ->+      pure $ B.codeBlockWith attr txt)+  ,("parbreak", \_ _ -> pure mempty)+  ,("block", \mbident fields ->       B.divWith (fromMaybe "" mbident, [], [])-        <$> (getField "body" fields >>= pWithContents pBlocks)-    Elt "place" pos fields -> do-      warn "Ignoring parameters of place"-      handleBlock (Elt "block" pos fields)-    Elt "columns" _ fields -> do+        <$> (getField "body" fields >>= pWithContents pBlocks))+  ,("place", \_ fields -> do+      ignored "parameters of place"+      getField "body" fields >>= pWithContents pBlocks)+  ,("columns", \_ fields -> do       (cnt :: Integer) <- getField "count" fields       B.divWith ("", ["columns-flow"], [("count", T.pack (show cnt))])-        <$> (getField "body" fields >>= pWithContents pBlocks)-    Elt "rect" _ fields ->-      B.divWith ("", ["rect"], []) <$> (getField "body" fields >>= pWithContents pBlocks)-    Elt "circle" _ fields ->-      B.divWith ("", ["circle"], []) <$> (getField "body" fields >>= pWithContents pBlocks)-    Elt "ellipse" _ fields ->-      B.divWith ("", ["ellipse"], []) <$> (getField "body" fields >>= pWithContents pBlocks)-    Elt "polygon" _ fields ->-      B.divWith ("", ["polygon"], []) <$> (getField "body" fields >>= pWithContents pBlocks)-    Elt "square" _ fields ->-      B.divWith ("", ["square"], []) <$> (getField "body" fields >>= pWithContents pBlocks)-    Elt "align" _ fields -> do+        <$> (getField "body" fields >>= pWithContents pBlocks))+  ,("rect", \_ fields ->+      B.divWith ("", ["rect"], []) <$> (getField "body" fields >>= pWithContents pBlocks))+  ,("circle", \_ fields ->+      B.divWith ("", ["circle"], []) <$> (getField "body" fields >>= pWithContents pBlocks))+  ,("ellipse", \_ fields ->+      B.divWith ("", ["ellipse"], []) <$> (getField "body" fields >>= pWithContents pBlocks))+  ,("polygon", \_ fields ->+      B.divWith ("", ["polygon"], []) <$> (getField "body" fields >>= pWithContents pBlocks))+  ,("square", \_ fields ->+      B.divWith ("", ["square"], []) <$> (getField "body" fields >>= pWithContents pBlocks))+  ,("align", \_ fields -> do       alignment <- getField "alignment" fields       B.divWith ("", [], [("align", repr alignment)])-        <$> (getField "body" fields >>= pWithContents pBlocks)-    Elt "stack" _ fields -> do+        <$> (getField "body" fields >>= pWithContents pBlocks))+  ,("stack", \_ fields -> do       (dir :: Direction) <- getField "dir" fields `mplus` pure Ltr       rawchildren <- getField "children" fields       children <-@@ -199,8 +260,8 @@       pure $         B.divWith ("", [], [("stack", repr (VDirection dir))]) $           mconcat $-            map (B.divWith ("", [], [])) children-    Elt "grid" _ fields -> do+            map (B.divWith ("", [], [])) children)+  ,("grid", \mbident fields -> do       children <- getField "children" fields >>= mapM (pWithContents pBlocks) . V.toList       (columns :: Val) <- getField "columns" fields       let toWidth (VFraction f) = Just (floor $ 1000 * f)@@ -269,9 +330,10 @@           colspecs           (B.TableHead B.nullAttr [])           [B.TableBody B.nullAttr 0 [] rows]-          (B.TableFoot B.nullAttr [])-    Elt "table" pos fields -> handleBlock (Elt "grid" pos fields)-    Elt "figure" _ fields -> do+          (B.TableFoot B.nullAttr []))+  ,("table", \mbident fields ->+       maybe mzero (\f -> f mbident fields) $ M.lookup "grid" blockHandlers)+  ,("figure", \mbident fields -> do       body <- getField "body" fields >>= pWithContents pBlocks       (mbCaption :: Maybe (Seq Content)) <- getField "caption" fields       (caption :: B.Blocks) <- maybe mempty (pWithContents pBlocks) mbCaption@@ -280,15 +342,14 @@           B.singleton             (B.Table attr (B.Caption Nothing (B.toList caption)) colspecs thead tbodies tfoot)         _ -> B.figureWith (fromMaybe "" mbident, [], [])-                          (B.Caption Nothing (B.toList caption)) body-    Elt "line" _ fields-      | isNothing-          ( M.lookup "start" fields+                          (B.Caption Nothing (B.toList caption)) body)+  ,("line", \_ fields ->+      case ( M.lookup "start" fields               >> M.lookup "end" fields-              >> M.lookup "angle" fields-          ) -> do-          pure $ B.horizontalRule-    Elt "numbering" _ fields -> do+              >> M.lookup "angle" fields ) of+        Nothing -> pure B.horizontalRule+        _ -> pure mempty)+  ,("numbering", \_ fields -> do       numStyle <- getField "numbering" fields       (nums :: V.Vector Integer) <- getField "numbers" fields       let toText v = fromMaybe "" $ fromVal v@@ -300,96 +361,15 @@                   Success x -> toText x                   Failure _ -> "?"               _ -> "?"-      pure $ B.plain . B.text . mconcat . map toNum $ V.toList nums-    Elt "footnote.entry" _ fields ->-      getField "body" fields >>= pWithContents pBlocks-    Elt (Identifier tname) _ _ -> do-      warn ("Skipping unknown block element " <> tname)-      pure mempty--pPara :: PandocMonad m => P m B.Blocks-pPara =-  B.para . B.trimInlines . mconcat <$> (many1 pInline <* optional pParBreak)--pParBreak :: PandocMonad m => P m ()-pParBreak =-  void $-    pTok-      ( \case-          Elt "parbreak" _ _ -> True-          _ -> False-      )--isInline :: Content -> Bool-isInline (Lab {}) = True-isInline (Txt {}) = True-isInline x = not (isBlock x)--isBlock :: Content -> Bool-isBlock (Txt {}) = False-isBlock (Lab {}) = True-isBlock (Elt name _ fields) =-  case name of-    "align" -> True-    "bibliography" -> True-    "block" -> True-    "circle" -> True-    "colbreak" -> True-    "columns" -> True-    "csv" -> True-    "ellipse" -> True-    "enum" -> True-    "enum.item" -> True-    "figure" -> True-    "grid" -> True-    "heading" -> True-    "json" -> True-    "line" -> True-    "list" -> True-    "list.item" -> True-    "numbering" -> True-    "footnote.entry" -> True-    "outline" -> True-    "page" -> True-    "pagebreak" -> True-    "par" -> True-    "parbreak" -> True-    "place" -> True-    "polygon" -> True-    "raw" -> M.lookup "block" fields == Just (VBoolean True)-    "read" -> True-    "rect" -> True-    "square" -> True-    "stack" -> True-    "table" -> True-    "terms" -> True-    "terms.item" -> True-    "toml" -> True-    "v" -> True-    "xml" -> True-    "yaml" -> True-    _ -> False--pWithContents :: PandocMonad m => P m a -> Seq Content -> P m a-pWithContents pa cs = do-  inp <- getInput-  setInput $ F.toList cs-  res <- pa-  setInput inp-  pure res--pInlines :: PandocMonad m => P m B.Inlines-pInlines = mconcat <$> many pInline--pInline :: PandocMonad m => P m B.Inlines-pInline = pTok isInline >>= handleInline+      pure $ B.plain . B.text . mconcat . map toNum $ V.toList nums)+  ,("footnote.entry", \_ fields ->+      getField "body" fields >>= pWithContents pBlocks)+  ] -handleInline :: PandocMonad m => Content -> P m B.Inlines-handleInline tok =-  case tok of-    Txt t -> pure $ B.text t-    Lab name -> pure $ B.spanWith (name, [], []) mempty-    Elt "ref" _ fields -> do+inlineHandlers :: PandocMonad m =>+    M.Map Identifier (Maybe Text -> M.Map Identifier Val -> P m B.Inlines)+inlineHandlers = M.fromList+  [("ref", \_ fields -> do       VLabel target <- getField "target" fields       supplement' <- getField "supplement" fields       supplement <- case supplement' of@@ -399,18 +379,18 @@                       VFunction _ _ _f -> -- TODO for now, until we can locate the element                            pure $ B.text ("[" <> target <> "]")                       _ -> pure mempty-      pure $ B.linkWith ("", ["ref"], []) ("#" <> target) "" supplement-    Elt "linebreak" _ _ -> pure B.linebreak-    Elt "text" _ fields -> do+      pure $ B.linkWith ("", ["ref"], []) ("#" <> target) "" supplement)+  ,("linebreak", \_ _ -> pure B.linebreak)+  ,("text", \_ fields -> do       body <- getField "body" fields       (mbweight :: Maybe Text) <- getField "weight" fields       case mbweight of         Just "bold" -> B.strong <$> pWithContents pInlines body-        _ -> pWithContents pInlines body-    Elt "raw" _ fields -> B.code <$> getField "text" fields-    Elt "footnote" _ fields ->-      B.note <$> (getField "body" fields >>= pWithContents pBlocks)-    Elt "cite" _ fields -> do+        _ -> pWithContents pInlines body)+  ,("raw", \_ fields -> B.code . T.filter (/= '\r') <$> getField "text" fields)+  ,("footnote", \_ fields ->+      B.note <$> (getField "body" fields >>= pWithContents pBlocks))+  ,("cite", \_ fields -> do       keys <- V.toList <$> getField "keys" fields       let toCitation key =             B.Citation@@ -422,41 +402,41 @@                 B.citationHash = 0               }       let citations = map toCitation keys-      pure $ B.cite citations (B.text $ "[" <> T.intercalate "," keys <> "]")-    Elt "lower" _ fields -> do+      pure $ B.cite citations (B.text $ "[" <> T.intercalate "," keys <> "]"))+  ,("lower", \_ fields -> do       body <- getField "text" fields-      walk (modString T.toLower) <$> pWithContents pInlines body-    Elt "upper" _ fields -> do+      walk (modString T.toLower) <$> pWithContents pInlines body)+  ,("upper", \_ fields -> do       body <- getField "text" fields-      walk (modString T.toUpper) <$> pWithContents pInlines body-    Elt "emph" _ fields -> do+      walk (modString T.toUpper) <$> pWithContents pInlines body)+  ,("emph", \_ fields -> do       body <- getField "body" fields-      B.emph <$> pWithContents pInlines body-    Elt "strong" _ fields -> do+      B.emph <$> pWithContents pInlines body)+  ,("strong", \_ fields -> do       body <- getField "body" fields-      B.strong <$> pWithContents pInlines body-    Elt "sub" _ fields -> do+      B.strong <$> pWithContents pInlines body)+  ,("sub", \_ fields -> do       body <- getField "body" fields-      B.subscript <$> pWithContents pInlines body-    Elt "super" _ fields -> do+      B.subscript <$> pWithContents pInlines body)+  ,("super", \_ fields -> do       body <- getField "body" fields-      B.superscript <$> pWithContents pInlines body-    Elt "strike" _ fields -> do+      B.superscript <$> pWithContents pInlines body)+  ,("strike", \_ fields -> do       body <- getField "body" fields-      B.strikeout <$> pWithContents pInlines body-    Elt "smallcaps" _ fields -> do+      B.strikeout <$> pWithContents pInlines body)+  ,("smallcaps", \_ fields -> do       body <- getField "body" fields-      B.smallcaps <$> pWithContents pInlines body-    Elt "underline" _ fields -> do+      B.smallcaps <$> pWithContents pInlines body)+  ,("underline", \_ fields -> do       body <- getField "body" fields-      B.underline <$> pWithContents pInlines body-    Elt "link" _ fields -> do+      B.underline <$> pWithContents pInlines body)+  ,("link", \_ fields -> do       dest <- getField "dest" fields       src <- case dest of         VString t -> pure t         VLabel t -> pure $ "#" <> t         VDict _ -> do-          warn "Unable to link to location, linking to #"+          ignored "link to location, linking to #"           pure "#"         _ -> fail $ "Expected string or label for dest"       body <- getField "body" fields@@ -471,9 +451,11 @@                     if "tel:" `T.isPrefixOf` src                       then T.drop 4 src                       else src-          else pWithContents pInlines body-      pure $ B.link src "" description-    Elt "image" _ fields -> do+          else pWithContents pInlines body <|>+               pWithContents+                (B.fromList . blocksToInlines . B.toList <$> pBlocks) body+      pure $ B.link src "" description)+  ,("image", \_ fields -> do       path <- getField "path" fields       alt <- (B.text <$> getField "alt" fields) `mplus` pure mempty       (mbwidth :: Maybe Text) <-@@ -486,34 +468,55 @@               maybe [] (\x -> [("width", x)]) mbwidth                 ++ maybe [] (\x -> [("height", x)]) mbheight             )-      pure $ B.imageWith attr path "" alt-    Elt "box" _ fields -> do+      pure $ B.imageWith attr path "" alt)+  ,("box", \_ fields -> do       body <- getField "body" fields-      B.spanWith ("", ["box"], []) <$> pWithContents pInlines body-    Elt "h" _ fields -> do+      B.spanWith ("", ["box"], []) <$> pWithContents pInlines body)+  ,("h", \_ fields -> do       amount <- getField "amount" fields `mplus` pure (LExact 1 LEm)       let em = case amount of             LExact x LEm -> toRational x             _ -> case amount <> LExact 0 LPt of -- force to Pt               LExact x LPt -> toRational x / 12               _ -> 1 / 3 -- guess!-      pure $ B.text $ getSpaceChars em-    Elt "style" _ fields -> do-      Function f <- getField "func" fields-      case applyPureFunction (Function f) [VStyles] of-        Success (VContent cs) -> pWithContents pInlines cs-        Success x -> pure $ B.text $ repr x-        Failure e -> fail e-    Elt "math.equation" _ fields -> do+      pure $ B.text $ getSpaceChars em)+  ,("place", \_ fields -> do+      ignored "parameters of place"+      getField "body" fields >>= pWithContents pInlines)+  ,("align", \_ fields -> do+      alignment <- getField "alignment" fields+      B.spanWith ("", [], [("align", repr alignment)])+        <$> (getField "body" fields >>= pWithContents pInlines))+  ,("math.equation", \_ fields -> do       body <- getField "body" fields       display <- getField "block" fields-      (if display then B.displayMath else B.math) . writeTeX <$> pMathMany body-    Elt (Identifier tname) _ _-      | "math." `T.isPrefixOf` tname ->-          B.math . writeTeX <$> pMathMany (Seq.singleton tok)-    Elt (Identifier tname) _ _ -> do-      warn ("Skipping unknown inline element " <> tname)-      pure mempty+      (if display then B.displayMath else B.math) . writeTeX <$> pMathMany body)+  ]++pPara :: PandocMonad m => P m B.Blocks+pPara =+  B.para . B.trimInlines . mconcat <$> (many1 pInline <* optional pParBreak)++pParBreak :: PandocMonad m => P m ()+pParBreak =+  void $+    pTok+      ( \case+          Elt "parbreak" _ _ -> True+          _ -> False+      )++pWithContents :: PandocMonad m => P m a -> Seq Content -> P m a+pWithContents pa cs = try $ do+  inp <- getInput+  setInput $ F.toList cs+  res <- pa+  eof+  setInput inp+  pure res++pInlines :: PandocMonad m => P m B.Inlines+pInlines = mconcat <$> many pInline  modString :: (Text -> Text) -> B.Inline -> B.Inline modString f (B.Str t) = B.Str (f t)
src/Text/Pandoc/Readers/Typst/Math.hs view
@@ -28,7 +28,7 @@   ) import Text.TeXMath.Unicode.ToTeX (getSymbolType) import Text.Pandoc.Readers.Typst.Parsing-    ( P, pTok, warn, pWithContents, getField, chunks )+    ( P, pTok, ignored, pWithContents, getField, chunks ) import Typst.Types  -- import Debug.Trace@@ -37,15 +37,24 @@ withGroup [x] = x withGroup xs = EGrouped xs -data AttachmentStyle = Limits | Scripts+data AttachmentStyle = Limits | LimitsDisplay | Scripts   deriving (Eq, Show)  getAttachmentStyle :: PandocMonad m => M.Map Identifier Val -> P m (Maybe AttachmentStyle) getAttachmentStyle fields = do   (base :: Seq Content) <- getField "base" fields   case base of-    [Elt "limits" _ _] -> pure $ Just Limits-    [Elt "scripts" _ _] -> pure $ Just Scripts+    [Elt "math.op" _ fs] -> do+      limits <- getField "limits" fs+      if limits == VBoolean True+         then pure $ Just Limits+         else pure Nothing+    [Elt "math.limits" _ fs] -> do+      inl <- getField "inline" fs+      if inl == VBoolean False+         then pure $ Just LimitsDisplay+         else pure $ Just Limits+    [Elt "math.scripts" _ _] -> pure $ Just Scripts     _ -> pure Nothing  pMath :: PandocMonad m => P m Exp@@ -55,7 +64,7 @@ handleMath tok =   case tok of     Lab t -> do-      warn ("skipping label " <> t)+      ignored ("label " <> t)       pure (EGrouped [])     Txt t       | T.any isDigit t -> pure $ ENumber t@@ -86,7 +95,6 @@             _ -> acc       pure $ EOver False base acc'     Elt "math.attach" _ fields -> do-      attachmentStyle <- getAttachmentStyle fields       base <- getField "base" fields >>= pMathGrouped       t' <- getField "t" fields       b' <- getField "b" fields@@ -94,7 +102,12 @@       tl' <- getField "tl" fields       br' <- getField "br" fields       bl' <- getField "bl" fields-      let limits = attachmentStyle == Just Limits+      attachmentStyle <- getAttachmentStyle fields+      let limits = case attachmentStyle of+                     Just Limits -> True+                     Just LimitsDisplay -> True+                     _ -> False+      let convertible = attachmentStyle == Just LimitsDisplay       let (mbt, mbtr) =             case (t', tr') of               (Just top, Just topright) -> (Just top, Just topright)@@ -133,9 +146,10 @@        suffix <- case (mbt, mbb) of         (Nothing, Nothing) -> pure base'-        (Nothing, Just bot) -> EUnder False base' <$> pMathGrouped bot-        (Just top, Nothing) -> EOver False base' <$> pMathGrouped top-        (Just top, Just bot) -> EUnderover False base' <$> pMathGrouped bot <*> pMathGrouped top+        (Nothing, Just bot) -> EUnder convertible base' <$> pMathGrouped bot+        (Just top, Nothing) -> EOver convertible base' <$> pMathGrouped top+        (Just top, Just bot) -> EUnderover convertible base'+                                  <$> pMathGrouped bot <*> pMathGrouped top        addPrefix suffix     Elt "math.serif" _ fields ->@@ -312,11 +326,27 @@     Elt "table" pos fields -> handleMath (Elt "grid" pos fields)     Elt "link" _ fields -> do       body <- getField "body" fields-      warn "Hyperlinks not supported in math"+      ignored "hyperlink in math"       pMathGrouped body+    Elt "math.display" _ fields -> do+      content <- getField "content" fields+      ignored "display"+      pMathGrouped content+    Elt "math.inline" _ fields -> do+      content <- getField "content" fields+      ignored "inline"+      pMathGrouped content+    Elt "math.script" _ fields -> do+      content <- getField "content" fields+      ignored "script"+      pMathGrouped content+    Elt "math.sscript" _ fields -> do+      content <- getField "content" fields+      ignored "sscript"+      pMathGrouped content     Elt (Identifier name) _ fields -> do       body <- getField "body" fields `mplus` pure mempty-      warn ("Ignoring unsupported " <> name)+      ignored name       pMathGrouped body  arrayDelims :: PandocMonad m => M.Map Identifier Val -> P m (Text, Text)
src/Text/Pandoc/Readers/Typst/Parsing.hs view
@@ -7,7 +7,7 @@   ( P,     pTok,     pWithContents,-    warn,+    ignored,     getField,     chunks,   )@@ -36,8 +36,8 @@     match x | f x = Just x     match _ = Nothing -warn :: PandocMonad m => Text -> P m ()-warn msg = lift $ report $ IgnoredElement msg+ignored :: PandocMonad m => Text -> P m ()+ignored msg = lift $ report $ IgnoredElement msg  pWithContents :: PandocMonad m => P m a -> Seq Content -> P m a pWithContents pa cs = do
src/Text/Pandoc/Templates.hs view
@@ -44,9 +44,9 @@ import Text.DocTemplates (Template, TemplateMonad(..), compileTemplate, renderTemplate) import Text.Pandoc.Class.CommonState (CommonState(..)) import Text.Pandoc.Class.PandocMonad (PandocMonad, fetchItem,-                                      getCommonState, modifyCommonState)+                                      getCommonState, modifyCommonState,+                                      toTextM) import Text.Pandoc.Data (readDataFile)-import qualified Text.Pandoc.UTF8 as UTF8 import Control.Monad.Except (catchError, throwError) import Data.Text (Text) import qualified Data.Text as T@@ -66,14 +66,14 @@  instance PandocMonad m => TemplateMonad (WithDefaultPartials m) where   getPartial fp = WithDefaultPartials $-    UTF8.toText <$> readDataFile ("templates" </> takeFileName fp)+    readDataFile ("templates" </> takeFileName fp) >>= toTextM fp  instance PandocMonad m => TemplateMonad (WithPartials m) where   getPartial fp = WithPartials $ getTemplate fp  -- | Retrieve text for a template. getTemplate :: PandocMonad m => FilePath -> m Text-getTemplate tp = UTF8.toText <$>+getTemplate tp =   ((do surl <- stSourceURL <$> getCommonState        -- we don't want to look for templates remotely        -- unless the full URL is specified:@@ -91,7 +91,7 @@              PandocIOError _ ioe | isDoesNotExistError ioe ->                 -- see #5987 on reason for takeFileName                 readDataFile ("templates" </> takeFileName tp)-             _ -> throwError e))+             _ -> throwError e)) >>= toTextM tp  -- | Get default template for the specified writer. getDefaultTemplate :: PandocMonad m@@ -106,6 +106,8 @@        "fb2"     -> return ""        "pptx"    -> return ""        "ipynb"   -> return ""+       "asciidoctor" -> getDefaultTemplate "asciidoc"+       "asciidoc_legacy" -> getDefaultTemplate "asciidoc"        "odt"     -> getDefaultTemplate "opendocument"        "html"    -> getDefaultTemplate "html5"        "docbook" -> getDefaultTemplate "docbook5"@@ -121,7 +123,7 @@        "commonmark_x"      -> getDefaultTemplate "commonmark"        _        -> do          let fname = "templates" </> "default" <.> T.unpack format-         UTF8.toText <$> readDataFile fname+         readDataFile fname >>= toTextM fname  -- | Get and compile default template for the specified writer. -- Raise an error on compilation failure.
src/Text/Pandoc/Translations.hs view
@@ -20,7 +20,7 @@                          ) where import Text.Pandoc.Translations.Types-import Text.Pandoc.Class (PandocMonad(..), CommonState(..), report)+import Text.Pandoc.Class (PandocMonad(..), CommonState(..), toTextM, report) import Text.Pandoc.Data (readDataFile) import Text.Pandoc.Error (PandocError(..)) import Text.Pandoc.Logging (LogMessage(..))@@ -58,8 +58,8 @@          let translationFile = "translations/" <> renderLang lang <> ".yaml"          let fallbackFile = "translations/" <> langLanguage lang <> ".yaml"          let getTrans fp = do-               bs <- readDataFile fp-               case readTranslations (UTF8.toText bs) of+               txt <- readDataFile fp >>= toTextM fp+               case readTranslations txt of                     Left e   -> do                       report $ CouldNotLoadTranslations (renderLang lang)                         (T.pack fp <> ": " <> e)
src/Text/Pandoc/Writers.hs view
@@ -20,6 +20,7 @@       Writer(..)     , writers     , writeAsciiDoc+    , writeAsciiDocLegacy     , writeAsciiDoctor     , writeBeamer     , writeBibTeX@@ -183,7 +184,8 @@   ,("rtf"          , TextWriter writeRTF)   ,("org"          , TextWriter writeOrg)   ,("asciidoc"     , TextWriter writeAsciiDoc)-  ,("asciidoctor"  , TextWriter writeAsciiDoctor)+  ,("asciidoctor"  , TextWriter writeAsciiDoc)+  ,("asciidoc_legacy" , TextWriter writeAsciiDocLegacy)   ,("haddock"      , TextWriter writeHaddock)   ,("commonmark"   , TextWriter writeCommonMark)   ,("commonmark_x" , TextWriter writeCommonMark)
src/Text/Pandoc/Writers/AsciiDoc.hs view
@@ -19,7 +19,11 @@  AsciiDoc:  <http://www.methods.co.nz/asciidoc/> -}-module Text.Pandoc.Writers.AsciiDoc (writeAsciiDoc, writeAsciiDoctor) where+module Text.Pandoc.Writers.AsciiDoc (+  writeAsciiDoc,+  writeAsciiDocLegacy,+  writeAsciiDoctor+  ) where import Control.Monad (foldM) import Control.Monad.State.Strict     ( StateT, MonadState(get), gets, modify, evalStateT )@@ -49,7 +53,7 @@                                , bulletListLevel     :: Int                                , intraword           :: Bool                                , autoIds             :: Set.Set Text-                               , asciidoctorVariant  :: Bool+                               , legacy              :: Bool                                , inList              :: Bool                                , hasMath             :: Bool                                -- |0 is no table@@ -64,7 +68,7 @@                                  , bulletListLevel    = 0                                  , intraword          = False                                  , autoIds            = Set.empty-                                 , asciidoctorVariant = False+                                 , legacy             = False                                  , inList             = False                                  , hasMath            = False                                  , tableNestingLevel  = 0@@ -75,11 +79,16 @@ writeAsciiDoc opts document =   evalStateT (pandocToAsciiDoc opts document) defaultWriterState --- | Convert Pandoc to AsciiDoctor compatible AsciiDoc.+{-# DEPRECATED writeAsciiDoctor "Use writeAsciiDoc instead" #-}+-- | Deprecated synonym of 'writeAsciiDoc'. writeAsciiDoctor :: PandocMonad m => WriterOptions -> Pandoc -> m Text-writeAsciiDoctor opts document =+writeAsciiDoctor = writeAsciiDoc++-- | Convert Pandoc to legacy AsciiDoc.+writeAsciiDocLegacy :: PandocMonad m => WriterOptions -> Pandoc -> m Text+writeAsciiDocLegacy opts document =   evalStateT (pandocToAsciiDoc opts document)-    defaultWriterState{ asciidoctorVariant = True }+    defaultWriterState{ legacy = True }  type ADW = StateT WriterState @@ -101,7 +110,7 @@                $ defField "toc"                   (writerTableOfContents opts &&                    isJust (writerTemplate opts))-               $ defField "math" (hasMath st)+               $ defField "math" (hasMath st && not (legacy st))                $ defField "titleblock" titleblock metadata   return $ render colwidth $     case writerTemplate opts of@@ -364,10 +373,10 @@ bulletListItemToAsciiDoc opts blocks = do   lev <- gets bulletListLevel   modify $ \s -> s{ bulletListLevel = lev + 1 }-  isAsciidoctor <- gets asciidoctorVariant-  let blocksWithTasks = if isAsciidoctor-                          then (taskListItemToAsciiDoc blocks)-                          else blocks+  isLegacy <- gets legacy+  let blocksWithTasks = if isLegacy+                          then blocks+                          else (taskListItemToAsciiDoc blocks)   contents <- foldM (addBlock opts) empty blocksWithTasks   modify $ \s -> s{ bulletListLevel = lev }   let marker = text (replicate (lev + 1) '*')@@ -517,7 +526,7 @@   return $ marker <> contents <> marker inlineToAsciiDoc opts (Strikeout lst) = do   contents <- inlineListToAsciiDoc opts lst-  return $ "[line-through]*" <> contents <> "*"+  return $ "[line-through]#" <> contents <> "#" inlineToAsciiDoc opts (Superscript lst) = do   contents <- inlineListToAsciiDoc opts lst   return $ "^" <> contents <> "^"@@ -526,38 +535,38 @@   return $ "~" <> contents <> "~" inlineToAsciiDoc opts (SmallCaps lst) = inlineListToAsciiDoc opts lst inlineToAsciiDoc opts (Quoted qt lst) = do-  isAsciidoctor <- gets asciidoctorVariant+  isLegacy <- gets legacy   inlineListToAsciiDoc opts $     case qt of       SingleQuote-        | isAsciidoctor -> [Str "'`"] ++ lst ++ [Str "`'"]-        | otherwise     -> [Str "`"] ++ lst ++ [Str "'"]+        | isLegacy     -> [Str "`"] ++ lst ++ [Str "'"]+        | otherwise    -> [Str "'`"] ++ lst ++ [Str "`'"]       DoubleQuote-        | isAsciidoctor -> [Str "\"`"] ++ lst ++ [Str "`\""]-        | otherwise     -> [Str "``"] ++ lst ++ [Str "''"]+        | isLegacy     -> [Str "``"] ++ lst ++ [Str "''"]+        | otherwise    -> [Str "\"`"] ++ lst ++ [Str "`\""] inlineToAsciiDoc _ (Code _ str) = do-  isAsciidoctor <- gets asciidoctorVariant+  isLegacy <- gets legacy   let escChar '`' = "\\'"       escChar c   = T.singleton c   let contents = literal (T.concatMap escChar str)   return $-    if isAsciidoctor-       then text "`+" <> contents <> "+`"-       else text "`"  <> contents <> "`"+    if isLegacy+       then text "`"  <> contents <> "`"+       else text "`+" <> contents <> "+`" inlineToAsciiDoc _ (Str str) = escapeString str inlineToAsciiDoc _ (Math InlineMath str) = do-  isAsciidoctor <- gets asciidoctorVariant+  isLegacy <- gets legacy   modify $ \st -> st{ hasMath = True }-  let content = if isAsciidoctor-                then literal str-                else "$" <> literal str <> "$"+  let content = if isLegacy+                then "$" <> literal str <> "$"+                else literal str   return $ "latexmath:[" <> content <> "]" inlineToAsciiDoc _ (Math DisplayMath str) = do-  isAsciidoctor <- gets asciidoctorVariant+  isLegacy <- gets legacy   modify $ \st -> st{ hasMath = True }-  let content = if isAsciidoctor-                then literal str-                else "\\[" <> literal str <> "\\]"+  let content = if isLegacy+                   then "\\[" <> literal str <> "\\]"+                   else literal str   inlist <- gets inList   let sepline = if inlist                    then text "+"
src/Text/Pandoc/Writers/Docx/Table.hs view
@@ -32,7 +32,7 @@       Alignment(..),       RowSpan(..),       ColSpan(..),-      ColWidth(ColWidth) )+      ColWidth(..) ) import Text.Pandoc.Class.PandocMonad (PandocMonad) import Text.Pandoc.Translations (translateTerm) import Text.Pandoc.Writers.Docx.Types@@ -109,6 +109,7 @@   let (gridCols, tblWattr) = tableLayout (elems colspecs)   listLevel <- asks envListLevel   let indent = (listLevel + 1) * 720+  let hasWidths = not $ all ((== ColWidthDefault) . snd) colspecs   let tbl = mknode "w:tbl" []         ( mknode "w:tblPr" []           ( mknode "w:tblStyle" [("w:val","Table")] () :@@ -124,6 +125,7 @@             mknode "w:jc" [("w:val","start")] ()             : [ mknode "w:tblInd" [("w:w", tshow indent),("w:type","dxa")] ()                 | indent > 0 ] +++            [ mknode "w:tblLayout" [("w:type", "fixed")] () | hasWidths ] ++             [ mknode "w:tblCaption" [("w:val", captionStr)] ()             | not (T.null captionStr) ]           )
src/Text/Pandoc/Writers/DokuWiki.hs view
@@ -102,7 +102,8 @@  blockToDokuWiki opts (Div _attrs bs) = do   contents <- blockListToDokuWiki opts bs-  return $ contents <> "\n"+  indent <- asks stIndent+  return $ contents <> if T.null indent then "\n" else ""  blockToDokuWiki opts (Plain inlines) =   inlineListToDokuWiki opts inlines@@ -310,6 +311,8 @@ isSimpleListItem :: [Block] -> Bool isSimpleListItem []  = True isSimpleListItem [x, CodeBlock{}] | isPlainOrPara x = True+isSimpleListItem (Div _ bs : ys) = -- see #8920+  isSimpleListItem bs && all isSimpleList ys isSimpleListItem (x:ys) | isPlainOrPara x = all isSimpleList ys isSimpleListItem _ = False 
src/Text/Pandoc/Writers/LaTeX.hs view
@@ -151,6 +151,7 @@                           Nothing | null docLangs -> Nothing                                   | otherwise     -> Just "en"   -- we need a default here since lang is used in template conditionals+  let otherLangs = [l | l <- docLangs, mblang /= Just l]    let dirs = query (extract "dir") blocks @@ -225,7 +226,7 @@         $ maybe id (\l -> defField "babel-lang"                       (literal l)) (mblang >>= toBabel)         $ defField "babel-otherlangs"-             (map literal $ mapMaybe toBabel docLangs)+             (map literal $ mapMaybe toBabel otherLangs)         $ defField "latex-dir-rtl"            ((render Nothing <$> getField "dir" context) ==                Just ("rtl" :: Text)) context
src/Text/Pandoc/Writers/LaTeX/Lang.hs view
@@ -88,7 +88,7 @@     fromIso "es"  = Just "spanish"     fromIso "et"  = Just "estonian"     fromIso "eu"  = Just "basque"-    fromIso "fa"  = Just "farsi"+    fromIso "fa"  = Just "persian"     fromIso "fi"  = Just "finnish"     fromIso "fr"  = Just "french"     fromIso "fur" = Just "friulan"
src/Text/Pandoc/Writers/Markdown.hs view
@@ -313,9 +313,9 @@  -- | (Code) blocks with a single class and no attributes can just use it -- standalone, no need to bother with curly braces.-classOrAttrsToMarkdown :: Attr -> Doc Text-classOrAttrsToMarkdown ("",[cls],[]) = literal cls-classOrAttrsToMarkdown attrs = attrsToMarkdown attrs+classOrAttrsToMarkdown :: WriterOptions -> Attr -> Doc Text+classOrAttrsToMarkdown _ ("",[cls],[]) = literal cls+classOrAttrsToMarkdown opts attrs = attrsToMarkdown opts attrs  -- | Ordered list start parser for use in Para below. olMarker :: Parsec Text ParserState ()@@ -383,8 +383,8 @@            | isEnabled Ext_fenced_divs opts &&              attrs /= nullAttr ->                 let attrsToMd = if variant == Commonmark-                                then attrsToMarkdown-                                else classOrAttrsToMarkdown+                                then attrsToMarkdown opts+                                else classOrAttrsToMarkdown opts                 in nowrap (literal ":::" <+> attrsToMd attrs) $$                    chomp contents $$                    literal ":::" <> blankline@@ -493,10 +493,10 @@                                  && id' == autoId -> empty                    (id',_,_)   | isEnabled Ext_mmd_header_identifiers opts ->                                     space <> brackets (literal id')-                   _ | variant == Markua -> attrsToMarkua attr+                   _ | variant == Markua -> attrsToMarkua opts attr                      | isEnabled Ext_header_attributes opts ||                        isEnabled Ext_attributes opts ->-                                    space <> attrsToMarkdown attr+                                    space <> attrsToMarkdown opts attr                      | otherwise -> empty   contents <- inlineListToMarkdown opts $                  -- ensure no newlines; see #3736@@ -546,7 +546,7 @@           backticks <> attrs <> cr <> literal str <> cr <> backticks <> blankline            | isEnabled Ext_fenced_code_blocks opts ->           tildes <> attrs <> cr <> literal str <> cr <> tildes <> blankline-     _ | variant == Markua -> blankline <> attrsToMarkua attribs <> cr <> backticks <> cr <>+     _ | variant == Markua -> blankline <> attrsToMarkua opts attribs <> cr <> backticks <> cr <>                                 literal str <> cr <> backticks <> cr <> blankline        | otherwise -> nest (writerTabStop opts) (literal str) <> blankline    where@@ -560,7 +560,7 @@      tildes = endline '~'      attrs  = if isEnabled Ext_fenced_code_attributes opts ||                  isEnabled Ext_attributes opts-                 then nowrap $ " " <> classOrAttrsToMarkdown attribs+                 then nowrap $ " " <> classOrAttrsToMarkdown opts attribs                  else case attribs of                             (_,cls:_,_) -> " " <> literal cls                             _             -> empty
src/Text/Pandoc/Writers/Markdown/Inline.hs view
@@ -113,11 +113,11 @@ escapeMarkuaString s = foldr (uncurry T.replace) s [("--","~-~-"),                         ("**","~*~*"),("//","~/~/"),("^^","~^~^"),(",,","~,~,")] -attrsToMarkdown :: Attr -> Doc Text-attrsToMarkdown attribs = braces $ hsep [attribId, attribClasses, attribKeys]+attrsToMarkdown :: WriterOptions -> Attr -> Doc Text+attrsToMarkdown opts attribs = braces $ hsep [attribId, attribClasses, attribKeys]         where attribId = case attribs of                                 ("",_,_) -> empty-                                (i,_,_)  -> "#" <> escAttr i+                                (i,_,_)  -> "#" <> escAttr (writerIdentifierPrefix opts <> i)               attribClasses = case attribs of                                 (_,[],_) -> empty                                 (_,cs,_) -> hsep $@@ -134,13 +134,13 @@               escAttrChar '\\' = literal "\\\\"               escAttrChar c    = literal $ T.singleton c -attrsToMarkua:: Attr -> Doc Text-attrsToMarkua attributes+attrsToMarkua:: WriterOptions -> Attr -> Doc Text+attrsToMarkua opts attributes      | null list = empty      | otherwise = braces $ intercalateDocText list         where attrId = case attributes of                         ("",_,_) -> []-                        (i,_,_)  -> [literal $ "id: " <> i]+                        (i,_,_)  -> [literal $ "id: " <> writerIdentifierPrefix opts <> i]               -- all non explicit (key,value) attributes besides id are getting               -- a default class key to be Markua conform               attrClasses = case attributes of@@ -184,7 +184,7 @@ linkAttributes opts attr =   if (isEnabled Ext_link_attributes opts ||         isEnabled Ext_attributes opts) && attr /= nullAttr-     then attrsToMarkdown attr+     then attrsToMarkdown opts attr      else empty  getKey :: Doc Text -> Key@@ -361,11 +361,11 @@              _ -> id          $ case variant of                 PlainText -> contents-                Markua -> "`" <> contents <> "`" <> attrsToMarkua attrs+                Markua -> "`" <> contents <> "`" <> attrsToMarkua opts attrs                 _     | attrs == nullAttr -> contents                       | isEnabled Ext_bracketed_spans opts ->                         let attrs' = if attrs /= nullAttr-                                        then attrsToMarkdown attrs+                                        then attrsToMarkdown opts attrs                                         else empty                         in "[" <> contents <> "]" <> attrs'                       | isEnabled Ext_raw_html opts ||@@ -483,9 +483,9 @@   let attrsEnabled = isEnabled Ext_inline_code_attributes opts ||                      isEnabled Ext_attributes opts   let attrs = case variant of-                       Markua -> attrsToMarkua attr+                       Markua -> attrsToMarkua opts attr                        _   -> if attrsEnabled && attr /= nullAttr-                                        then attrsToMarkdown attr+                                        then attrsToMarkdown opts attr                                         else empty   case variant of      PlainText -> return $ literal str@@ -529,7 +529,7 @@   variant <- asks envVariant   case () of     _ | variant == Markua -> do-        let attributes = attrsToMarkua (addKeyValueToAttr ("",[],[])+        let attributes = attrsToMarkua opts (addKeyValueToAttr ("",[],[])                                                         ("format", "latex"))         return $ blankline <> attributes <> cr <> literal "```" <> cr             <> literal str <> cr <> literal "```" <> blankline@@ -667,8 +667,8 @@       | useAuto -> return $ literal srcSuffix       | otherwise -> return linktext     Markua-      | T.null tit -> return $ result <> attrsToMarkua attr-      | otherwise ->  return $ result <> attrsToMarkua attributes+      | T.null tit -> return $ result <> attrsToMarkua opts attr+      | otherwise ->  return $ result <> attrsToMarkua opts attributes         where result = "[" <> linktext <> "](" <> (literal src) <> ")"               attributes = addKeyValueToAttr attr ("title", tit)     -- Use wikilinks where possible@@ -710,7 +710,7 @@                else alternate   linkPart <- inlineToMarkdown opts (Link attr txt (source, tit))   alt <- inlineListToMarkdown opts alternate-  let attributes | variant == Markua = attrsToMarkua $+  let attributes | variant == Markua = attrsToMarkua opts $             addKeyValueToAttr (addKeyValueToAttr attr ("title", tit))             ("alt", render (Just (writerColumns opts)) alt)                  | otherwise = empty
src/Text/Pandoc/Writers/Typst.hs view
@@ -91,10 +91,15 @@   case block of     Plain inlines -> inlinesToTypst inlines     Para inlines -> ($$ blankline) <$> inlinesToTypst inlines-    Header level (ident,_,_) inlines -> do+    Header level (ident,cls,_) inlines -> do       contents <- inlinesToTypst inlines       let lab = toLabel ident-      return $ literal (T.replicate level "=") <> space <> contents <> cr <> lab+      return $+        if "unlisted" `elem` cls+           then literal "#heading(outlined: false)" <> brackets contents <>+                 cr <> lab+           else literal (T.replicate level "=") <> space <> contents <>+                 cr <> lab     RawBlock fmt str ->       case fmt of         Format "typst" -> return $ literal str@@ -268,7 +273,7 @@                    Just ('#', ident) -> "<" <> literal ident <> ">"                    _ -> doubleQuoted src       return $ "#link" <> parens dest <>-                if render Nothing contents == src+                if inlines == [Str src]                    then mempty                    else nowrap $ brackets contents     Image (_,_,kvs) _inlines (src,_tit) -> do
test/Tests/Old.hs view
@@ -178,7 +178,7 @@         "tikiwiki-reader.tikiwiki" "tikiwiki-reader.native" ]   , testGroup "other writers" $ map (\f -> testGroup f $ writerTests' f)     [ "opendocument" , "context" , "texinfo", "icml", "tei"-    , "man" , "plain" , "asciidoc", "asciidoctor"+    , "man" , "plain" , "asciidoc", "asciidoc_legacy"     , "xwiki", "zimwiki"     ]   , testGroup "writers-lang-and-dir"@@ -195,7 +195,12 @@     ]   , testGroup "typst"     [ testGroup "writer" $ writerTests' "typst"+    , testGroup "reader"+       [ test' "typst-reader" ["-r", "typst", "-w", "native", "-s"]+          "typst-reader.typ" "typst-reader.native"+       ]     ]+   , testGroup "creole"     [ test' "reader" ["-r", "creole", "-w", "native", "-s"]       "creole-reader.txt" "creole-reader.native"
test/Tests/Writers/AsciiDoc.hs view
@@ -9,10 +9,10 @@ import Text.Pandoc.Builder  asciidoc :: (ToPandoc a) => a -> String-asciidoc = unpack . purely (writeAsciiDoc def) . toPandoc+asciidoc = unpack . purely (writeAsciiDocLegacy def) . toPandoc  asciidoctor :: (ToPandoc a) => a -> String-asciidoctor = unpack . purely (writeAsciiDoctor def) . toPandoc+asciidoctor = unpack . purely (writeAsciiDoc def) . toPandoc  testAsciidoc :: (ToString a, ToPandoc a)              => String
test/command/8437.md view
@@ -1,5 +1,5 @@ ```-% pandoc -f markdown -t asciidoctor+% pandoc -f markdown -t asciidoc [![alt](https://img.shields.io/badge/License-Apache%202.0-blue.svg "title")](http://www.apache.org/licenses/LICENSE-2.0) ^D http://www.apache.org/licenses/LICENSE-2.0[image:https://img.shields.io/badge/License-Apache%202.0-blue.svg[alt,title="title"]]
test/command/8665.md view
@@ -1,5 +1,5 @@ ```-% pandoc -f docbook -t asciidoctor+% pandoc -f docbook -t asciidoc <informaltable frame="all" rowsep="1" colsep="1">     <tgroup cols="1">         <thead>
+ test/tables.asciidoc_legacy view
@@ -0,0 +1,67 @@+Simple table with caption:++.Demonstration of simple table syntax.+[cols=">,<,^,",options="header",]+|===+|Right |Left |Center |Default+|12 |12 |12 |12+|123 |123 |123 |123+|1 |1 |1 |1+|===++Simple table without caption:++[cols=">,<,^,",options="header",]+|===+|Right |Left |Center |Default+|12 |12 |12 |12+|123 |123 |123 |123+|1 |1 |1 |1+|===++Simple table indented two spaces:++.Demonstration of simple table syntax.+[cols=">,<,^,",options="header",]+|===+|Right |Left |Center |Default+|12 |12 |12 |12+|123 |123 |123 |123+|1 |1 |1 |1+|===++Multiline table with caption:++.Here’s the caption. It may span multiple lines.+[width="80%",cols="^20%,<17%,>20%,<43%",options="header",]+|===+|Centered Header |Left Aligned |Right Aligned |Default aligned+|First |row |12.0 |Example of a row that spans multiple lines.+|Second |row |5.0 |Here’s another one. Note the blank line between rows.+|===++Multiline table without caption:++[width="80%",cols="^20%,<17%,>20%,<43%",options="header",]+|===+|Centered Header |Left Aligned |Right Aligned |Default aligned+|First |row |12.0 |Example of a row that spans multiple lines.+|Second |row |5.0 |Here’s another one. Note the blank line between rows.+|===++Table without column headers:++[cols=">,<,^,>",]+|===+|12 |12 |12 |12+|123 |123 |123 |123+|1 |1 |1 |1+|===++Multiline table without column headers:++[width="80%",cols="^20%,<17%,>20%,43%",]+|===+|First |row |12.0 |Example of a row that spans multiple lines.+|Second |row |5.0 |Here’s another one. Note the blank line between rows.+|===
− test/tables.asciidoctor
@@ -1,67 +0,0 @@-Simple table with caption:--.Demonstration of simple table syntax.-[cols=">,<,^,",options="header",]-|===-|Right |Left |Center |Default-|12 |12 |12 |12-|123 |123 |123 |123-|1 |1 |1 |1-|===--Simple table without caption:--[cols=">,<,^,",options="header",]-|===-|Right |Left |Center |Default-|12 |12 |12 |12-|123 |123 |123 |123-|1 |1 |1 |1-|===--Simple table indented two spaces:--.Demonstration of simple table syntax.-[cols=">,<,^,",options="header",]-|===-|Right |Left |Center |Default-|12 |12 |12 |12-|123 |123 |123 |123-|1 |1 |1 |1-|===--Multiline table with caption:--.Here’s the caption. It may span multiple lines.-[width="80%",cols="^20%,<17%,>20%,<43%",options="header",]-|===-|Centered Header |Left Aligned |Right Aligned |Default aligned-|First |row |12.0 |Example of a row that spans multiple lines.-|Second |row |5.0 |Here’s another one. Note the blank line between rows.-|===--Multiline table without caption:--[width="80%",cols="^20%,<17%,>20%,<43%",options="header",]-|===-|Centered Header |Left Aligned |Right Aligned |Default aligned-|First |row |12.0 |Example of a row that spans multiple lines.-|Second |row |5.0 |Here’s another one. Note the blank line between rows.-|===--Table without column headers:--[cols=">,<,^,>",]-|===-|12 |12 |12 |12-|123 |123 |123 |123-|1 |1 |1 |1-|===--Multiline table without column headers:--[width="80%",cols="^20%,<17%,>20%,43%",]-|===-|First |row |12.0 |Example of a row that spans multiple lines.-|Second |row |5.0 |Here’s another one. Note the blank line between rows.-|===
+ test/typst-reader.native view
@@ -0,0 +1,5394 @@+Pandoc+  Meta { unMeta = fromList [] }+  [ Para []+  , Header+      1+      ( "" , [] , [] )+      [ Str "Fibonacci" , Space , Str "sequence" ]+  , Para+      [ Str "The"+      , Space+      , Str "Fibonacci"+      , Space+      , Str "sequence"+      , Space+      , Str "is"+      , Space+      , Str "defined"+      , Space+      , Str "through"+      , Space+      , Str "the"+      , SoftBreak+      , Str "recurrence"+      , Space+      , Str "relation"+      , Space+      , Math InlineMath "F_{n} = F_{n - 1} + F_{n - 2}"+      , Str "."+      , SoftBreak+      , Str "It"+      , Space+      , Str "can"+      , Space+      , Str "also"+      , Space+      , Str "be"+      , Space+      , Str "expressed"+      , Space+      , Str "in"+      , Space+      , Emph [ Str "closed" , Space , Str "form:" ]+      ]+  , Para+      [ Math+          InlineMath+          "F_{n} = \\left\\lfloor {\\frac{1}{\\sqrt{5}}\\phi^{n}} \\right\\rceil,\\quad\\phi = \\frac{1 + \\sqrt{5}}{2}"+      ]+  , Para []+  , Para+      [ Str "The"+      , Space+      , Str "first"+      , Space+      , Str "8"+      , Space+      , Str "numbers"+      , Space+      , Str "of"+      , Space+      , Str "the"+      , Space+      , Str "sequence"+      , Space+      , Str "are:"+      ]+  , Div+      ( "" , [] , [ ( "align" , "center" ) ] )+      [ Table+          ( "" , [] , [] )+          (Caption Nothing [])+          [ ( AlignDefault , ColWidthDefault )+          , ( AlignDefault , ColWidthDefault )+          , ( AlignDefault , ColWidthDefault )+          , ( AlignDefault , ColWidthDefault )+          , ( AlignDefault , ColWidthDefault )+          , ( AlignDefault , ColWidthDefault )+          , ( AlignDefault , ColWidthDefault )+          , ( AlignDefault , ColWidthDefault )+          ]+          (TableHead ( "" , [] , [] ) [])+          [ TableBody+              ( "" , [] , [] )+              (RowHeadColumns 0)+              []+              [ Row+                  ( "" , [] , [] )+                  [ Cell+                      ( "" , [] , [] )+                      AlignDefault+                      (RowSpan 1)+                      (ColSpan 1)+                      [ Para [ Math InlineMath "F_{1}" ] ]+                  , Cell+                      ( "" , [] , [] )+                      AlignDefault+                      (RowSpan 1)+                      (ColSpan 1)+                      [ Para [ Math InlineMath "F_{2}" ] ]+                  , Cell+                      ( "" , [] , [] )+                      AlignDefault+                      (RowSpan 1)+                      (ColSpan 1)+                      [ Para [ Math InlineMath "F_{3}" ] ]+                  , Cell+                      ( "" , [] , [] )+                      AlignDefault+                      (RowSpan 1)+                      (ColSpan 1)+                      [ Para [ Math InlineMath "F_{4}" ] ]+                  , Cell+                      ( "" , [] , [] )+                      AlignDefault+                      (RowSpan 1)+                      (ColSpan 1)+                      [ Para [ Math InlineMath "F_{5}" ] ]+                  , Cell+                      ( "" , [] , [] )+                      AlignDefault+                      (RowSpan 1)+                      (ColSpan 1)+                      [ Para [ Math InlineMath "F_{6}" ] ]+                  , Cell+                      ( "" , [] , [] )+                      AlignDefault+                      (RowSpan 1)+                      (ColSpan 1)+                      [ Para [ Math InlineMath "F_{7}" ] ]+                  , Cell+                      ( "" , [] , [] )+                      AlignDefault+                      (RowSpan 1)+                      (ColSpan 1)+                      [ Para [ Math InlineMath "F_{8}" ] ]+                  ]+              , Row+                  ( "" , [] , [] )+                  [ Cell+                      ( "" , [] , [] )+                      AlignDefault+                      (RowSpan 1)+                      (ColSpan 1)+                      [ Para [ Str "1" ] ]+                  , Cell+                      ( "" , [] , [] )+                      AlignDefault+                      (RowSpan 1)+                      (ColSpan 1)+                      [ Para [ Str "1" ] ]+                  , Cell+                      ( "" , [] , [] )+                      AlignDefault+                      (RowSpan 1)+                      (ColSpan 1)+                      [ Para [ Str "2" ] ]+                  , Cell+                      ( "" , [] , [] )+                      AlignDefault+                      (RowSpan 1)+                      (ColSpan 1)+                      [ Para [ Str "3" ] ]+                  , Cell+                      ( "" , [] , [] )+                      AlignDefault+                      (RowSpan 1)+                      (ColSpan 1)+                      [ Para [ Str "5" ] ]+                  , Cell+                      ( "" , [] , [] )+                      AlignDefault+                      (RowSpan 1)+                      (ColSpan 1)+                      [ Para [ Str "8" ] ]+                  , Cell+                      ( "" , [] , [] )+                      AlignDefault+                      (RowSpan 1)+                      (ColSpan 1)+                      [ Para [ Str "13" ] ]+                  , Cell+                      ( "" , [] , [] )+                      AlignDefault+                      (RowSpan 1)+                      (ColSpan 1)+                      [ Para [ Str "21" ] ]+                  ]+              ]+          ]+          (TableFoot ( "" , [] , [] ) [])+      ]+  , Para []+  , Para []+  , Para []+  , Para []+  , Para []+  , Para []+  , Div+      ( "" , [ "columns-flow" ] , [ ( "count" , "2" ) ] )+      [ Para+          [ Span+              ( "" , [] , [ ( "align" , "center" ) ] )+              [ Underline+                  [ Link+                      ( "" , [] , [] )+                      [ Strong+                          [ Str "Typst"+                          , Space+                          , Str "Math"+                          , Space+                          , Str "for"+                          , Space+                          , Str "Undergrads"+                          ]+                      ]+                      ( "https://github.com/johanvx/typst-undergradmath"+                      , ""+                      )+                  ]+              ]+          ]+      , Para+          [ Str "This"+          , Space+          , Str "is"+          , Space+          , Str "a"+          , Space+          , Str "Typst"+          , Space+          , Str "port"+          , Space+          , Str "of"+          , Space+          , Emph+              [ Span+                  ( "" , [ "box" ] , [] )+                  [ Str "L\8202A\8202"+                  , Span ( "" , [ "box" ] , [] ) [ Str "T\8202E\8202X" ]+                  ]+              , Space+              , Str "Math"+              , Space+              , Str "for"+              , Space+              , Str "Undergrads"+              ]+          , Space+          , Str "by"+          , Space+          , Str "Jim"+          , Space+          , Str "Hefferon."+          , SoftBreak+          , Str "The"+          , Space+          , Str "original"+          , Space+          , Str "version"+          , Space+          , Str "is"+          , Space+          , Str "available"+          , Space+          , Str "at"+          , Space+          , Underline+              [ Underline+                  [ Link+                      ( "" , [] , [] )+                      [ Str+                          "https://gitlab.com/jim.hefferon/undergradmath"+                      ]+                      ( "https://gitlab.com/jim.hefferon/undergradmath"+                      , ""+                      )+                  ]+              ]+          , Str "."+          ]+      , Para+          [ Strong+              [ Str "Meaning"+              , Space+              , Str "of"+              , Space+              , Str "annotations\8192\160"+              ]+          ]+      , Table+          ( "" , [] , [] )+          (Caption Nothing [])+          [ ( AlignLeft , ColWidth 0.3333333333333333 )+          , ( AlignLeft , ColWidth 0.6666666666666666 )+          ]+          (TableHead ( "" , [] , [] ) [])+          [ TableBody+              ( "" , [] , [] )+              (RowHeadColumns 0)+              []+              [ Row+                  ( "" , [] , [] )+                  [ Cell+                      ( "" , [] , [] )+                      AlignDefault+                      (RowSpan 1)+                      (ColSpan 1)+                      [ Para+                          [ Span+                              ( "" , [ "box" ] , [] )+                              [ Str "2023-05-22"+                              , Space+                              , Str "\10060"+                              ]+                          ]+                      ]+                  , Cell+                      ( "" , [] , [] )+                      AlignDefault+                      (RowSpan 1)+                      (ColSpan 1)+                      [ Para+                          [ Str "This"+                          , Space+                          , Str "is"+                          , Space+                          , Str "unavailable."+                          , Space+                          , Str "Last"+                          , Space+                          , Str "check"+                          , Space+                          , Str "date"+                          , Space+                          , Str "is"+                          , Space+                          , Str "2023-05-22."+                          ]+                      ]+                  ]+              ]+          ]+          (TableFoot ( "" , [] , [] ) [])+      , Para [ Span ( "unavailable" , [] , [] ) [] ]+      , Table+          ( "" , [] , [] )+          (Caption Nothing [])+          [ ( AlignLeft , ColWidth 0.3333333333333333 )+          , ( AlignLeft , ColWidth 0.6666666666666666 )+          ]+          (TableHead ( "" , [] , [] ) [])+          [ TableBody+              ( "" , [] , [] )+              (RowHeadColumns 0)+              []+              [ Row+                  ( "" , [] , [] )+                  [ Cell+                      ( "" , [] , [] )+                      AlignDefault+                      (RowSpan 1)+                      (ColSpan 1)+                      [ Para+                          [ Span+                              ( "" , [ "box" ] , [] ) [ Str "\128166" ]+                          ]+                      ]+                  , Cell+                      ( "" , [] , [] )+                      AlignDefault+                      (RowSpan 1)+                      (ColSpan 1)+                      [ Para+                          [ Str "Get"+                          , Space+                          , Str "this"+                          , Space+                          , Str "in"+                          , Space+                          , Str "a"+                          , Space+                          , Str "tricky"+                          , Space+                          , Str "way."+                          , Space+                          , Str "Need"+                          , Space+                          , Str "a"+                          , Space+                          , Str "simpler"+                          , Space+                          , Str "method."+                          ]+                      ]+                  ]+              ]+          ]+          (TableFoot ( "" , [] , [] ) [])+      , Para [ Span ( "tricky" , [] , [] ) [] ]+      , Table+          ( "" , [] , [] )+          (Caption Nothing [])+          [ ( AlignLeft , ColWidth 0.3333333333333333 )+          , ( AlignLeft , ColWidth 0.6666666666666666 )+          ]+          (TableHead ( "" , [] , [] ) [])+          [ TableBody+              ( "" , [] , [] )+              (RowHeadColumns 0)+              []+              [ Row+                  ( "" , [] , [] )+                  [ Cell+                      ( "" , [] , [] )+                      AlignDefault+                      (RowSpan 1)+                      (ColSpan 1)+                      [ Para+                          [ Span+                              ( "" , [ "box" ] , [] )+                              [ Str "No"+                              , Space+                              , Str "idea"+                              , Space+                              , Str "\128533"+                              ]+                          ]+                      ]+                  , Cell+                      ( "" , [] , [] )+                      AlignDefault+                      (RowSpan 1)+                      (ColSpan 1)+                      [ Para+                          [ Str "Don\8217t"+                          , Space+                          , Str "know"+                          , Space+                          , Str "how"+                          , Space+                          , Str "to"+                          , Space+                          , Str "get"+                          , Space+                          , Str "this."+                          ]+                      ]+                  ]+              ]+          ]+          (TableFoot ( "" , [] , [] ) [])+      , Para [ Span ( "noidea" , [] , [] ) [] ]+      , Para+          [ Strong [ Str "Rule" , Space , Str "One\8192\160" ]+          , Str "Any"+          , Space+          , Str "mathematics"+          , Space+          , Str "at"+          , Space+          , Str "all,"+          , Space+          , Str "even"+          , Space+          , Str "a"+          , Space+          , Str "single"+          , Space+          , Str "character,"+          , Space+          , Str "gets"+          , Space+          , Str "a"+          , Space+          , Str "mathematical"+          , Space+          , Str "setting."+          , SoftBreak+          , Str "Thus,"+          , Space+          , Str "for"+          , Space+          , Str "\8220the"+          , Space+          , Str "value"+          , Space+          , Str "of"+          , Space+          , Math InlineMath "x"+          , Space+          , Str "is"+          , Space+          , Math InlineMath "7"+          , Str "\8221"+          , Space+          , Str "enter"+          , Space+          , Code ( "" , [] , [] ) "the value of $x$ is $7$"+          , Str "."+          ]+      , Para+          [ Strong [ Str "Template\8192\160" ]+          , Str "Your"+          , Space+          , Str "document"+          , Space+          , Str "should"+          , Space+          , Str "contain"+          , Space+          , Str "at"+          , Space+          , Str "least"+          , Space+          , Str "this."+          ]+      , Table+          ( "" , [] , [] )+          (Caption Nothing [])+          [ ( AlignDefault , ColWidthDefault )+          , ( AlignDefault , ColWidthDefault )+          ]+          (TableHead ( "" , [] , [] ) [])+          [ TableBody+              ( "" , [] , [] )+              (RowHeadColumns 0)+              []+              [ Row+                  ( "" , [] , [] )+                  [ Cell+                      ( "" , [] , [] )+                      AlignDefault+                      (RowSpan 1)+                      (ColSpan 1)+                      [ Para [] ]+                  , Cell+                      ( "" , [] , [] )+                      AlignDefault+                      (RowSpan 1)+                      (ColSpan 1)+                      [ CodeBlock+                          ( "" , [] , [] )+                          "-- document body here --\n  "+                      ]+                  ]+              ]+          ]+          (TableFoot ( "" , [] , [] ) [])+      , Para+          [ Strong+              [ Str "Common" , Space , Str "constructs\8192\160" ]+          ]+      , Div+          ( "" , [] , [ ( "align" , "center" ) ] )+          [ Table+              ( "" , [] , [] )+              (Caption Nothing [])+              [ ( AlignLeft , ColWidthDefault )+              , ( AlignLeft , ColWidthDefault )+              ]+              (TableHead ( "" , [] , [] ) [])+              [ TableBody+                  ( "" , [] , [] )+                  (RowHeadColumns 0)+                  []+                  [ Row+                      ( "" , [] , [] )+                      [ Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "x^{2}"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "x^2"+                                  ]+                              ]+                          ]+                      , Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "\\sqrt{2}"+                                  , Str ","+                                  , Space+                                  , Math InlineMath "\\sqrt[n]{3}"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "sqrt(2)"+                                  , Str ","+                                  , Space+                                  , Code ( "" , [] , [] ) "root(n, 3)"+                                  ]+                              ]+                          ]+                      ]+                  , Row+                      ( "" , [] , [] )+                      [ Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "x_{i,j}"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "x_(i, j)"+                                  ]+                              ]+                          ]+                      , Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "\\frac{2}{3}"+                                  , Str ","+                                  , Space+                                  , Math InlineMath "2/3"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "2 / 3"+                                  , Str ","+                                  , Space+                                  , Code ( "" , [] , [] ) "2 \\/ 3"+                                  , Space+                                  , Str "or"+                                  , Space+                                  , Code ( "" , [] , [] ) "2 slash 3"+                                  ]+                              ]+                          ]+                      ]+                  ]+              ]+              (TableFoot ( "" , [] , [] ) [])+          ]+      , Para+          [ Strong+              [ Str "Calligraphic" , Space , Str "letters\8192\160" ]+          , Str "Use"+          , Space+          , Str "as"+          , Space+          , Str "in"+          , Space+          , Code ( "" , [] , [] ) "$cal(A)$"+          , Str "."+          ]+      , Para+          [ Math InlineMath "\\mathcal{ABCDEFGHIJKLMNOPQRSTUVWXYZ}" ]+      , Para+          [ Str "Getting"+          , Space+          , Str "script"+          , Space+          , Str "letters"+          , Space+          , Str "is"+          , Space+          , Link+              ( "" , [ "ref" ] , [] )+              [ Str "[unavailable]" ]+              ( "#unavailable" , "" )+          , Str "."+          ]+      , Para [ Strong [ Str "Greek\8192\160" ] ]+      , Div+          ( "" , [] , [ ( "align" , "center" ) ] )+          [ Table+              ( "" , [] , [] )+              (Caption Nothing [])+              [ ( AlignLeft , ColWidthDefault )+              , ( AlignLeft , ColWidthDefault )+              ]+              (TableHead ( "" , [] , [] ) [])+              [ TableBody+                  ( "" , [] , [] )+                  (RowHeadColumns 0)+                  []+                  [ Row+                      ( "" , [] , [] )+                      [ Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "\\alpha"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "alpha"+                                  ]+                              ]+                          ]+                      , Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "\\xi"+                                  , Str ","+                                  , Space+                                  , Math InlineMath "\\Xi"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "xi"+                                  , Str ","+                                  , Space+                                  , Code ( "" , [] , [] ) "Xi"+                                  ]+                              ]+                          ]+                      ]+                  , Row+                      ( "" , [] , [] )+                      [ Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "\\beta"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "beta"+                                  ]+                              ]+                          ]+                      , Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "\959"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "omicron"+                                  ]+                              ]+                          ]+                      ]+                  , Row+                      ( "" , [] , [] )+                      [ Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "\\gamma"+                                  , Str ","+                                  , Space+                                  , Math InlineMath "\\Gamma"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "gamma"+                                  , Str ","+                                  , Space+                                  , Code ( "" , [] , [] ) "Gamma"+                                  ]+                              ]+                          ]+                      , Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "\\pi"+                                  , Str ","+                                  , Space+                                  , Math InlineMath "\\Pi"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "pi"+                                  , Str ","+                                  , Space+                                  , Code ( "" , [] , [] ) "Pi"+                                  ]+                              ]+                          ]+                      ]+                  , Row+                      ( "" , [] , [] )+                      [ Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "\\delta"+                                  , Str ","+                                  , Space+                                  , Math InlineMath "\\Delta"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "delta"+                                  , Str ","+                                  , Space+                                  , Code ( "" , [] , [] ) "Delta"+                                  ]+                              ]+                          ]+                      , Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "\\varpi"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "pi.alt"+                                  ]+                              ]+                          ]+                      ]+                  , Row+                      ( "" , [] , [] )+                      [ Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "\\epsilon"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "epsilon.alt"+                                  ]+                              ]+                          ]+                      , Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "\\rho"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "rho"+                                  ]+                              ]+                          ]+                      ]+                  , Row+                      ( "" , [] , [] )+                      [ Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "\\varepsilon"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "epsilon"+                                  ]+                              ]+                          ]+                      , Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "\\varrho"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "rho.alt"+                                  ]+                              ]+                          ]+                      ]+                  , Row+                      ( "" , [] , [] )+                      [ Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "\\zeta"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "zeta"+                                  ]+                              ]+                          ]+                      , Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "\\sigma"+                                  , Str ","+                                  , Space+                                  , Math InlineMath "\\Sigma"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "sigma"+                                  , Str ","+                                  , Space+                                  , Code ( "" , [] , [] ) "Sigma"+                                  ]+                              ]+                          ]+                      ]+                  , Row+                      ( "" , [] , [] )+                      [ Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "\\eta"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "eta"+                                  ]+                              ]+                          ]+                      , Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "\\varsigma"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "\\u{03C2}"+                                  , Space+                                  , Link+                                      ( "" , [ "ref" ] , [] )+                                      [ Str "[tricky]" ]+                                      ( "#tricky" , "" )+                                  ]+                              ]+                          ]+                      ]+                  , Row+                      ( "" , [] , [] )+                      [ Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "\\theta"+                                  , Str ","+                                  , Space+                                  , Math InlineMath "\\Theta"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "theta"+                                  , Str ","+                                  , Space+                                  , Code ( "" , [] , [] ) "Theta"+                                  ]+                              ]+                          ]+                      , Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "\\tau"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "tau"+                                  ]+                              ]+                          ]+                      ]+                  , Row+                      ( "" , [] , [] )+                      [ Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "\\vartheta"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "theta.alt"+                                  ]+                              ]+                          ]+                      , Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "\\upsilon"+                                  , Str ","+                                  , Space+                                  , Math InlineMath "\\Upsilon"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "upsilon"+                                  , Str ","+                                  , Space+                                  , Code ( "" , [] , [] ) "Upsilon"+                                  ]+                              ]+                          ]+                      ]+                  , Row+                      ( "" , [] , [] )+                      [ Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "\\iota"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "iota"+                                  ]+                              ]+                          ]+                      , Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "\\phi"+                                  , Str ","+                                  , Space+                                  , Math InlineMath "\\Phi"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "phi.alt"+                                  , Str ","+                                  , Space+                                  , Code ( "" , [] , [] ) "Phi"+                                  ]+                              ]+                          ]+                      ]+                  , Row+                      ( "" , [] , [] )+                      [ Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "\\kappa"+                                  , Str "\8192"+                                  , Math InlineMath "\922"+                                  ]+                              ]+                          ]+                      , Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "\\varphi"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "phi"+                                  ]+                              ]+                          ]+                      ]+                  , Row+                      ( "" , [] , [] )+                      [ Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "\\lambda"+                                  , Str ","+                                  , Space+                                  , Math InlineMath "\\Lambda"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "lambda"+                                  , Str ","+                                  , Space+                                  , Code ( "" , [] , [] ) "Lambda"+                                  ]+                              ]+                          ]+                      , Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "\\chi"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "chi"+                                  ]+                              ]+                          ]+                      ]+                  , Row+                      ( "" , [] , [] )+                      [ Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "\\mu"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "mu"+                                  ]+                              ]+                          ]+                      , Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "\\psi"+                                  , Str ","+                                  , Space+                                  , Math InlineMath "\\Psi"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "psi"+                                  , Str ","+                                  , Space+                                  , Code ( "" , [] , [] ) "Psi"+                                  ]+                              ]+                          ]+                      ]+                  , Row+                      ( "" , [] , [] )+                      [ Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "\\nu"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "nu"+                                  ]+                              ]+                          ]+                      , Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "\\omega"+                                  , Str ","+                                  , Space+                                  , Math InlineMath "\\Omega"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "omega"+                                  , Str ","+                                  , Space+                                  , Code ( "" , [] , [] ) "Omega"+                                  ]+                              ]+                          ]+                      ]+                  ]+              ]+              (TableFoot ( "" , [] , [] ) [])+          ]+      , Para+          [ Strong+              [ Str "Sets"+              , Space+              , Str "and"+              , Space+              , Str "logic\8192\160"+              ]+          ]+      , Div+          ( "" , [] , [ ( "align" , "center" ) ] )+          [ Table+              ( "" , [] , [] )+              (Caption Nothing [])+              [ ( AlignLeft , ColWidthDefault )+              , ( AlignLeft , ColWidthDefault )+              , ( AlignLeft , ColWidthDefault )+              ]+              (TableHead ( "" , [] , [] ) [])+              [ TableBody+                  ( "" , [] , [] )+                  (RowHeadColumns 0)+                  []+                  [ Row+                      ( "" , [] , [] )+                      [ Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "\\cup"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "union"+                                  ]+                              ]+                          ]+                      , Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "\\mathbb{R}"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "RR"+                                  , Str ","+                                  , Space+                                  , Code ( "" , [] , [] ) "bb(R)"+                                  ]+                              ]+                          ]+                      , Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "\\forall"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "forall"+                                  ]+                              ]+                          ]+                      ]+                  , Row+                      ( "" , [] , [] )+                      [ Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "\\cap"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "sect"+                                  ]+                              ]+                          ]+                      , Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "\\mathbb{Z}"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "ZZ"+                                  , Str ","+                                  , Space+                                  , Code ( "" , [] , [] ) "bb(Z)"+                                  ]+                              ]+                          ]+                      , Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "\\exists"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "exists"+                                  ]+                              ]+                          ]+                      ]+                  , Row+                      ( "" , [] , [] )+                      [ Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "\\subset"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "subset"+                                  ]+                              ]+                          ]+                      , Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "\\mathbb{Q}"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "QQ"+                                  , Str ","+                                  , Space+                                  , Code ( "" , [] , [] ) "bb(Q)"+                                  ]+                              ]+                          ]+                      , Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "\\neg"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "not"+                                  ]+                              ]+                          ]+                      ]+                  , Row+                      ( "" , [] , [] )+                      [ Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "\\subseteq"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "subset.eq"+                                  ]+                              ]+                          ]+                      , Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "\\mathbb{N}"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "NN"+                                  , Str ","+                                  , Space+                                  , Code ( "" , [] , [] ) "bb(N)"+                                  ]+                              ]+                          ]+                      , Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "\\vee"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "or"+                                  ]+                              ]+                          ]+                      ]+                  , Row+                      ( "" , [] , [] )+                      [ Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "\\supset"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "supset"+                                  ]+                              ]+                          ]+                      , Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "\\mathbb{C}"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "CC"+                                  , Str ","+                                  , Space+                                  , Code ( "" , [] , [] ) "bb(C)"+                                  ]+                              ]+                          ]+                      , Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "\\land"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "and"+                                  ]+                              ]+                          ]+                      ]+                  , Row+                      ( "" , [] , [] )+                      [ Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "\\supseteq"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "supset.eq"+                                  ]+                              ]+                          ]+                      , Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "\\varnothing"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "diameter"+                                  ]+                              ]+                          ]+                      , Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "\\vdash"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "tack.r"+                                  ]+                              ]+                          ]+                      ]+                  , Row+                      ( "" , [] , [] )+                      [ Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "\\in"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "in"+                                  ]+                              ]+                          ]+                      , Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "\\varnothing"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "nothing"+                                  ]+                              ]+                          ]+                      , Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "\\models"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "models"+                                  ]+                              ]+                          ]+                      ]+                  , Row+                      ( "" , [] , [] )+                      [ Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "\\notin"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "in.not"+                                  ]+                              ]+                          ]+                      , Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "\1488"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "alef"+                                  ]+                              ]+                          ]+                      , Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "\\smallsetminus"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "without"+                                  ]+                              ]+                          ]+                      ]+                  ]+              ]+              (TableFoot ( "" , [] , [] ) [])+          ]+      , Para+          [ Str "Negate"+          , Space+          , Str "an"+          , Space+          , Str "operator,"+          , Space+          , Str "as"+          , Space+          , Str "in"+          , Space+          , Math InlineMath "\8836"+          , Str ","+          , Space+          , Str "with"+          , Space+          , Code ( "" , [] , [] ) "subset.not"+          , Str "."+          , SoftBreak+          , Str "Get"+          , Space+          , Str "the"+          , Space+          , Str "set"+          , Space+          , Str "complement"+          , Space+          , Math InlineMath "A^{\\mathsf{c}}"+          , Space+          , Str "with"+          , Space+          , Code ( "" , [] , [] ) "A^(sans(c))"+          , Space+          , Str "(or"+          , Space+          , Math InlineMath "A^{\\complement}"+          , Space+          , Str "with"+          , Space+          , Code ( "" , [] , [] ) "A^(complement)"+          , Str ","+          , Space+          , Str "or"+          , Space+          , Math InlineMath "\\underset{\175}{A}"+          , Space+          , Str "with"+          , Space+          , Code ( "" , [] , [] ) "overline(A)"+          , Str ")."+          ]+      , Para []+      , DefinitionList+          [ ( [ Str "Remark" ]+            , [ [ Para+                    [ Str "Using"+                    , Space+                    , Code ( "" , [] , [] ) "diameter"+                    , Space+                    , Str "for"+                    , Space+                    , Code ( "" , [] , [] ) "\\varnothing"+                    , Space+                    , Str "may"+                    , Space+                    , Str "cause"+                    , Space+                    , Str "some"+                    , Space+                    , Str "confusion."+                    , Space+                    , Str "However,"+                    , Space+                    , Span+                        ( "" , [ "box" ] , [] )+                        [ Str "L\8202A\8202"+                        , Span+                            ( "" , [ "box" ] , [] )+                            [ Str "T\8202E\8202X" ]+                        ]+                    , Space+                    , Str "also"+                    , Space+                    , Str "uses"+                    , Space+                    , Math InlineMath "\\varnothing"+                    , Space+                    , Str "("+                    , Code ( "" , [] , [] ) "\\u{2300}"+                    , Str ")"+                    , Space+                    , Str "instead"+                    , Space+                    , Str "of"+                    , Space+                    , Math InlineMath "\\varnothing"+                    , Space+                    , Str "("+                    , Code ( "" , [] , [] ) "\\u{2205}"+                    , Str "),"+                    , Space+                    , Str "see"+                    , Space+                    , Underline+                        [ Link+                            ( "" , [] , [] )+                            [ Str "newcm"+                            , Space+                            , Math InlineMath "\167"+                            , Str "13.3"+                            ]+                            ( "https://mirrors.sustech.edu.cn/CTAN/fonts/newcomputermodern/doc/newcm-doc.pdf"+                            , ""+                            )+                        ]+                    , Str "."+                    , SoftBreak+                    , Str "Another"+                    , Space+                    , Str "solution"+                    , Space+                    , Str "is"+                    , Space+                    , Str "to"+                    , Space+                    , Str "use"+                    , Space+                    , Code+                        ( "" , [] , [] )+                        "text(font: \"Fira Sans\", nothing)"+                    , Str ","+                    , Space+                    , Str "but"+                    , Space+                    , Str "the"+                    , Space+                    , Str "resultant"+                    , Space+                    , Str "glyph"+                    , Space+                    , Math InlineMath "\\varnothing"+                    , Space+                    , Str "is"+                    , Space+                    , Str "subtly"+                    , Space+                    , Str "different"+                    , Space+                    , Str "from"+                    , Space+                    , Str "the"+                    , Space+                    , Str "widely"+                    , Space+                    , Str "used"+                    , Space+                    , Str "one."+                    , SoftBreak+                    , Str "Ultimately,"+                    , Space+                    , Str "the"+                    , Space+                    , Str "choice"+                    , Space+                    , Str "is"+                    , Space+                    , Str "always"+                    , Space+                    , Strong [ Str "your" , Space , Str "decision" ]+                    , Str "."+                    ]+                ]+              ]+            )+          ]+      , Para [ Strong [ Str "Decorations\8192\160" ] ]+      , Div+          ( "" , [] , [ ( "align" , "center" ) ] )+          [ Table+              ( "" , [] , [] )+              (Caption Nothing [])+              [ ( AlignLeft , ColWidthDefault )+              , ( AlignLeft , ColWidthDefault )+              , ( AlignLeft , ColWidthDefault )+              ]+              (TableHead ( "" , [] , [] ) [])+              [ TableBody+                  ( "" , [] , [] )+                  (RowHeadColumns 0)+                  []+                  [ Row+                      ( "" , [] , [] )+                      [ Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "f\\prime"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "f'"+                                  , Str ","+                                  , Space+                                  , Code ( "" , [] , [] ) "f prime"+                                  ]+                              ]+                          ]+                      , Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math+                                      InlineMath "\\overset{\\cdot}{a}"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "dot(a)"+                                  ]+                              ]+                          ]+                      , Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math+                                      InlineMath "\\overset{\\sim}{a}"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "tilde(a)"+                                  ]+                              ]+                          ]+                      ]+                  , Row+                      ( "" , [] , [] )+                      [ Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "f''"+                                  , Str "\8192"+                                  , Code+                                      ( "" , [] , [] ) "f prime.double"+                                  ]+                              ]+                          ]+                      , Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "\\overset{\168}{a}"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "diaer(a)"+                                  ]+                              ]+                          ]+                      , Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "\\overline{a}"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "macron(a)"+                                  ]+                              ]+                          ]+                      ]+                  , Row+                      ( "" , [] , [] )+                      [ Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "\\Sigma^{*}"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "Sigma^*"+                                  ]+                              ]+                          ]+                      , Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "\\hat{a}"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "hat(a)"+                                  ]+                              ]+                          ]+                      , Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math+                                      InlineMath+                                      "\\overset{\\rightarrow}{a}"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "arrow(a)"+                                  ]+                              ]+                          ]+                      ]+                  ]+              ]+              (TableFoot ( "" , [] , [] ) [])+          ]+      , Para+          [ Str "If"+          , Space+          , Str "the"+          , Space+          , Str "decorated"+          , Space+          , Str "letter"+          , Space+          , Str "is"+          , Space+          , Math InlineMath "i"+          , Space+          , Str "or"+          , Space+          , Math InlineMath "j"+          , Space+          , Str "then"+          , Space+          , Str "some"+          , Space+          , Str "decorations"+          , Space+          , Str "need"+          , Space+          , Code ( "" , [] , [] ) "\\u{1D6A4}"+          , Space+          , Link+              ( "" , [ "ref" ] , [] )+              [ Str "[tricky]" ]+              ( "#tricky" , "" )+          , Space+          , Str "and"+          , Space+          , Code ( "" , [] , [] ) "\\u{1D6A5}"+          , Space+          , Link+              ( "" , [ "ref" ] , [] )+              [ Str "[tricky]" ]+              ( "#tricky" , "" )+          , Str ","+          , Space+          , Str "as"+          , Space+          , Str "in"+          , Space+          , Math InlineMath "\\overset{\\rightarrow}{\\imath}"+          , Space+          , Str "with"+          , Space+          , Code ( "" , [] , [] ) "arrow(\\u{1D6A4})"+          , Str "."+          , SoftBreak+          , Str "Some"+          , Space+          , Str "authors"+          , Space+          , Str "use"+          , Space+          , Str "boldface"+          , Space+          , Str "for"+          , Space+          , Str "vectors:"+          , Space+          , Code ( "" , [] , [] ) "bold(x)"+          , Str "."+          ]+      , Para+          [ Str "Entering"+          , Space+          , Code ( "" , [] , [] ) "overline(x + y)"+          , Space+          , Str "produces"+          , Space+          , Math InlineMath "\\underset{\175}{x + y}"+          , Str ","+          , Space+          , Str "and"+          , Space+          , Code ( "" , [] , [] ) "hat(x + y)"+          , Space+          , Str "gives"+          , Space+          , Math InlineMath "\\hat{x + y}"+          , Str "."+          , SoftBreak+          , Str "Comment"+          , Space+          , Str "on"+          , Space+          , Str "an"+          , Space+          , Str "expression"+          , Space+          , Str "as"+          , Space+          , Str "here"+          , Space+          , Str "(there"+          , Space+          , Str "is"+          , Space+          , Str "also"+          , Space+          , Code ( "" , [] , [] ) "overbrace(..)"+          , Str ")."+          ]+      , Para+          [ Span+              ( "" , [] , [ ( "align" , "center" ) ] )+              [ Span+                  ( "" , [ "box" ] , [] )+                  [ Math+                      InlineMath "\\underset{|A|}{\\underbrace{x + y}}"+                  , Str "\8192"+                  , Code ( "" , [] , [] ) "underbrace(x + y, |A|)"+                  ]+              ]+          ]+      , Para+          [ Strong [ Str "Dots\8192\160" ]+          , Str "Use"+          , Space+          , Str "low"+          , Space+          , Str "dots"+          , Space+          , Str "in"+          , Space+          , Str "a"+          , Space+          , Str "list"+          , Space+          , Math InlineMath "\\left\\{ 0,1,2,\\ldots \\right\\}"+          , Str ","+          , Space+          , Str "entered"+          , Space+          , Str "as"+          , Space+          , Code ( "" , [] , [] ) "{0, 1, 2, ...}"+          , Str "."+          , SoftBreak+          , Str "Use"+          , Space+          , Str "centered"+          , Space+          , Str "dots"+          , Space+          , Str "in"+          , Space+          , Str "a"+          , Space+          , Str "sum"+          , Space+          , Str "or"+          , Space+          , Str "product"+          , Space+          , Math InlineMath "1 + \\cdots + 100"+          , Str ","+          , Space+          , Str "entered"+          , Space+          , Str "as"+          , Space+          , Code ( "" , [] , [] ) "1 + dots.h.c + 100"+          , Str "."+          , SoftBreak+          , Str "You"+          , Space+          , Str "can"+          , Space+          , Str "also"+          , Space+          , Str "get"+          , Space+          , Str "vertical"+          , Space+          , Str "dots"+          , Space+          , Code ( "" , [] , [] ) "dots.v"+          , Str ","+          , Space+          , Str "diagonal"+          , Space+          , Str "dots"+          , Space+          , Code ( "" , [] , [] ) "dots.down"+          , Space+          , Str "and"+          , Space+          , Str "anti-diagonal"+          , Space+          , Str "dots"+          , Space+          , Code ( "" , [] , [] ) "dots.up"+          , Str "."+          ]+      , Para+          [ Strong [ Str "Roman" , Space , Str "names\8192\160" ]+          , Str "Just"+          , Space+          , Str "type"+          , Space+          , Str "them!"+          ]+      , Div+          ( "" , [] , [ ( "align" , "center" ) ] )+          [ Table+              ( "" , [] , [] )+              (Caption Nothing [])+              [ ( AlignLeft , ColWidthDefault )+              , ( AlignLeft , ColWidthDefault )+              , ( AlignLeft , ColWidthDefault )+              ]+              (TableHead ( "" , [] , [] ) [])+              [ TableBody+                  ( "" , [] , [] )+                  (RowHeadColumns 0)+                  []+                  [ Row+                      ( "" , [] , [] )+                      [ Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "\\sin"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "sin"+                                  ]+                              ]+                          ]+                      , Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "\\sinh"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "sinh"+                                  ]+                              ]+                          ]+                      , Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "\\arcsin"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "arcsin"+                                  ]+                              ]+                          ]+                      ]+                  , Row+                      ( "" , [] , [] )+                      [ Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "\\cos"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "cos"+                                  ]+                              ]+                          ]+                      , Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "\\cosh"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "cosh"+                                  ]+                              ]+                          ]+                      , Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "\\arccos"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "arccos"+                                  ]+                              ]+                          ]+                      ]+                  , Row+                      ( "" , [] , [] )+                      [ Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "\\tan"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "tan"+                                  ]+                              ]+                          ]+                      , Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "\\tanh"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "tanh"+                                  ]+                              ]+                          ]+                      , Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "\\arctan"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "arctan"+                                  ]+                              ]+                          ]+                      ]+                  , Row+                      ( "" , [] , [] )+                      [ Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "\\sec"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "sec"+                                  ]+                              ]+                          ]+                      , Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "\\coth"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "coth"+                                  ]+                              ]+                          ]+                      , Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "\\min"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "min"+                                  ]+                              ]+                          ]+                      ]+                  , Row+                      ( "" , [] , [] )+                      [ Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "\\csc"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "csc"+                                  ]+                              ]+                          ]+                      , Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "\\det"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "det"+                                  ]+                              ]+                          ]+                      , Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "\\max"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "max"+                                  ]+                              ]+                          ]+                      ]+                  , Row+                      ( "" , [] , [] )+                      [ Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "\\cot"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "cot"+                                  ]+                              ]+                          ]+                      , Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "\\dim"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "dim"+                                  ]+                              ]+                          ]+                      , Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "\\inf"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "inf"+                                  ]+                              ]+                          ]+                      ]+                  , Row+                      ( "" , [] , [] )+                      [ Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "\\exp"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "exp"+                                  ]+                              ]+                          ]+                      , Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "\\ker"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "ker"+                                  ]+                              ]+                          ]+                      , Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "\\sup"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "sup"+                                  ]+                              ]+                          ]+                      ]+                  , Row+                      ( "" , [] , [] )+                      [ Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "\\log"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "log"+                                  ]+                              ]+                          ]+                      , Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "\\deg"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "deg"+                                  ]+                              ]+                          ]+                      , Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "\\liminf"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "liminf"+                                  ]+                              ]+                          ]+                      ]+                  , Row+                      ( "" , [] , [] )+                      [ Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "\\ln"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "ln"+                                  ]+                              ]+                          ]+                      , Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "\\arg"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "arg"+                                  ]+                              ]+                          ]+                      , Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "\\limsup"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "limsup"+                                  ]+                              ]+                          ]+                      ]+                  , Row+                      ( "" , [] , [] )+                      [ Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "\\lg"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "lg"+                                  ]+                              ]+                          ]+                      , Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "\\gcd"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "gcd"+                                  ]+                              ]+                          ]+                      , Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "\\lim"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "lim"+                                  ]+                              ]+                          ]+                      ]+                  ]+              ]+              (TableFoot ( "" , [] , [] ) [])+          ]+      , Para+          [ Strong [ Str "Other" , Space , Str "symbols\8192\160" ] ]+      , Div+          ( "" , [] , [ ( "align" , "center" ) ] )+          [ Table+              ( "" , [] , [] )+              (Caption Nothing [])+              [ ( AlignLeft , ColWidthDefault )+              , ( AlignLeft , ColWidthDefault )+              , ( AlignLeft , ColWidthDefault )+              ]+              (TableHead ( "" , [] , [] ) [])+              [ TableBody+                  ( "" , [] , [] )+                  (RowHeadColumns 0)+                  []+                  [ Row+                      ( "" , [] , [] )+                      [ Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "<"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "<"+                                  , Str ","+                                  , Space+                                  , Code ( "" , [] , [] ) "lt"+                                  ]+                              ]+                          ]+                      , Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "\\angle"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "angle"+                                  ]+                              ]+                          ]+                      , Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "\\cdot"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "dot"+                                  ]+                              ]+                          ]+                      ]+                  , Row+                      ( "" , [] , [] )+                      [ Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "\\leq"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "<="+                                  , Str ","+                                  , Space+                                  , Code ( "" , [] , [] ) "lt.eq"+                                  ]+                              ]+                          ]+                      , Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "\\measuredangle"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "angle.arc"+                                  ]+                              ]+                          ]+                      , Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "\\pm"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "plus.minus"+                                  ]+                              ]+                          ]+                      ]+                  , Row+                      ( "" , [] , [] )+                      [ Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath ">"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) ">"+                                  , Str ","+                                  , Space+                                  , Code ( "" , [] , [] ) "gt"+                                  ]+                              ]+                          ]+                      , Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "\\ell"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "ell"+                                  ]+                              ]+                          ]+                      , Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "\\mp"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "minus.plus"+                                  ]+                              ]+                          ]+                      ]+                  , Row+                      ( "" , [] , [] )+                      [ Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "\\geq"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) ">="+                                  , Str ","+                                  , Space+                                  , Code ( "" , [] , [] ) "gt.eq"+                                  ]+                              ]+                          ]+                      , Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "\\parallel"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "parallel"+                                  ]+                              ]+                          ]+                      , Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "\\times"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "times"+                                  ]+                              ]+                          ]+                      ]+                  , Row+                      ( "" , [] , [] )+                      [ Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "\\neq"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "!="+                                  , Str ","+                                  , Space+                                  , Code ( "" , [] , [] ) "eq.not"+                                  ]+                              ]+                          ]+                      , Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "45{^\\circ}"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "45 degree"+                                  ]+                              ]+                          ]+                      , Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "\\div"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "div"+                                  ]+                              ]+                          ]+                      ]+                  , Row+                      ( "" , [] , [] )+                      [ Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "< <"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "<<"+                                  , Str ","+                                  , Space+                                  , Code ( "" , [] , [] ) "lt.double"+                                  ]+                              ]+                          ]+                      , Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "\\cong"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "tilde.eqq"+                                  ]+                              ]+                          ]+                      , Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "*"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "*"+                                  , Str ","+                                  , Space+                                  , Code ( "" , [] , [] ) "ast"+                                  ]+                              ]+                          ]+                      ]+                  , Row+                      ( "" , [] , [] )+                      [ Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "> >"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) ">>"+                                  , Str ","+                                  , Space+                                  , Code ( "" , [] , [] ) "gt.double"+                                  ]+                              ]+                          ]+                      , Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "\\ncong"+                                  , Str "\8192"+                                  , Code+                                      ( "" , [] , [] ) "tilde.eqq.not"+                                  ]+                              ]+                          ]+                      , Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "\\mid"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "divides"+                                  ]+                              ]+                          ]+                      ]+                  , Row+                      ( "" , [] , [] )+                      [ Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "\\approx"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "approx"+                                  ]+                              ]+                          ]+                      , Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "\\sim"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "tilde"+                                  ]+                              ]+                          ]+                      , Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "\\nmid"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "divides.not"+                                  ]+                              ]+                          ]+                      ]+                  , Row+                      ( "" , [] , [] )+                      [ Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "\\asymp"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "\\u{224D}"+                                  , Space+                                  , Link+                                      ( "" , [ "ref" ] , [] )+                                      [ Str "[tricky]" ]+                                      ( "#tricky" , "" )+                                  ]+                              ]+                          ]+                      , Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "\\simeq"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "tilde.eq"+                                  ]+                              ]+                          ]+                      , Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "n!"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "n!"+                                  ]+                              ]+                          ]+                      ]+                  , Row+                      ( "" , [] , [] )+                      [ Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "\\equiv"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "ident"+                                  ]+                              ]+                          ]+                      , Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "\\nsim"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "tilde.not"+                                  ]+                              ]+                          ]+                      , Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "\\partial"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "diff"+                                  ]+                              ]+                          ]+                      ]+                  , Row+                      ( "" , [] , [] )+                      [ Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "\\prec"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "prec"+                                  ]+                              ]+                          ]+                      , Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "\\oplus"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "plus.circle"+                                  ]+                              ]+                          ]+                      , Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "\\nabla"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "nabla"+                                  ]+                              ]+                          ]+                      ]+                  , Row+                      ( "" , [] , [] )+                      [ Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "\\preccurlyeq"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "prec.eq"+                                  ]+                              ]+                          ]+                      , Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "\\ominus"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "minus.cirle"+                                  ]+                              ]+                          ]+                      , Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "\\hslash"+                                  , Str "\8192"+                                  , Code+                                      ( "" , [] , [] ) "planck.reduce"+                                  ]+                              ]+                          ]+                      ]+                  , Row+                      ( "" , [] , [] )+                      [ Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "\\succ"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "succ"+                                  ]+                              ]+                          ]+                      , Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "\\odot"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "dot.circle"+                                  ]+                              ]+                          ]+                      , Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "\\circ"+                                  , Str "\8192"+                                  , Code+                                      ( "" , [] , [] )+                                      "circle.stroked.tiny"+                                  ]+                              ]+                          ]+                      ]+                  , Row+                      ( "" , [] , [] )+                      [ Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "\\succcurlyeq"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "succ.eq"+                                  ]+                              ]+                          ]+                      , Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "\\otimes"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "times.circle"+                                  ]+                              ]+                          ]+                      , Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "\\star"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "star"+                                  ]+                              ]+                          ]+                      ]+                  , Row+                      ( "" , [] , [] )+                      [ Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "\\propto"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "prop"+                                  ]+                              ]+                          ]+                      , Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "\\oslash"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "\\u{2298}"+                                  , Space+                                  , Link+                                      ( "" , [ "ref" ] , [] )+                                      [ Str "[tricky]" ]+                                      ( "#tricky" , "" )+                                  ]+                              ]+                          ]+                      , Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "\\sqrt{}"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "sqrt(\"\")"+                                  ]+                              ]+                          ]+                      ]+                  , Row+                      ( "" , [] , [] )+                      [ Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "\\doteq"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "\\u{2250}"+                                  , Space+                                  , Link+                                      ( "" , [ "ref" ] , [] )+                                      [ Str "[tricky]" ]+                                      ( "#tricky" , "" )+                                  ]+                              ]+                          ]+                      , Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "\\upharpoonright"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "harpoon.tr"+                                  ]+                              ]+                          ]+                      , Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "\10003"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "checkmark"+                                  ]+                              ]+                          ]+                      ]+                  ]+              ]+              (TableFoot ( "" , [] , [] ) [])+          ]+      , Para+          [ Str "Use"+          , Space+          , Code ( "" , [] , [] ) "a divides b"+          , Space+          , Str "for"+          , Space+          , Str "the"+          , Space+          , Str "divides"+          , Space+          , Str "relation,"+          , Space+          , Math InlineMath "a \\mid b"+          , Str ","+          , Space+          , Str "and"+          , Space+          , Code ( "" , [] , [] ) "a divides.not b"+          , Space+          , Str "for"+          , Space+          , Str "the"+          , Space+          , Str "negation,"+          , Space+          , Math InlineMath "a \\nmid b"+          , Str "."+          , SoftBreak+          , Str "Use"+          , Space+          , Code ( "" , [] , [] ) "|"+          , Space+          , Str "to"+          , Space+          , Str "get"+          , Space+          , Str "set"+          , Space+          , Str "builder"+          , Space+          , Str "notation"+          , Space+          , Math+              InlineMath+              "\\left\\{ a \\in S~|~a\\text{ is odd} \\right\\}"+          , Space+          , Str "with"+          , Space+          , Code ( "" , [] , [] ) "{a in S | a \"is odd\"}"+          , Str "."+          ]+      , Para [ Strong [ Str "Arrows\8192\160" ] ]+      , Div+          ( "" , [] , [ ( "align" , "center" ) ] )+          [ Table+              ( "" , [] , [] )+              (Caption Nothing [])+              [ ( AlignLeft , ColWidthDefault )+              , ( AlignLeft , ColWidthDefault )+              ]+              (TableHead ( "" , [] , [] ) [])+              [ TableBody+                  ( "" , [] , [] )+                  (RowHeadColumns 0)+                  []+                  [ Row+                      ( "" , [] , [] )+                      [ Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "\\rightarrow"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "->"+                                  , Str ","+                                  , Space+                                  , Code ( "" , [] , [] ) "arrow.r"+                                  ]+                              ]+                          ]+                      , Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "| \\rightarrow"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "|->"+                                  , Str ","+                                  , Space+                                  , Code ( "" , [] , [] ) "arrow.r.bar"+                                  ]+                              ]+                          ]+                      ]+                  , Row+                      ( "" , [] , [] )+                      [ Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "\\nrightarrow"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "arrow.r.not"+                                  ]+                              ]+                          ]+                      , Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "\\longmapsto"+                                  , Str "\8192"+                                  , Code+                                      ( "" , [] , [] )+                                      "arrow.r.long.bar"+                                  ]+                              ]+                          ]+                      ]+                  , Row+                      ( "" , [] , [] )+                      [ Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "\\longrightarrow"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "arrow.r.long"+                                  ]+                              ]+                          ]+                      , Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "\\leftarrow"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "<-"+                                  , Str ","+                                  , Space+                                  , Code ( "" , [] , [] ) "arrow.l"+                                  ]+                              ]+                          ]+                      ]+                  , Row+                      ( "" , [] , [] )+                      [ Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "\\Rightarrow"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "=>"+                                  , Str ","+                                  , Space+                                  , Code+                                      ( "" , [] , [] ) "arrow.r.double"+                                  ]+                              ]+                          ]+                      , Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "\\leftarrow >"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "<->"+                                  , Str ","+                                  , Space+                                  , Code ( "" , [] , [] ) "arrow.l.r"+                                  ]+                              ]+                          ]+                      ]+                  , Row+                      ( "" , [] , [] )+                      [ Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "\\nRightarrow"+                                  , Str "\8192"+                                  , Code+                                      ( "" , [] , [] )+                                      "arrow.r.double.not"+                                  ]+                              ]+                          ]+                      , Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "\\downarrow"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "arrow.b"+                                  ]+                              ]+                          ]+                      ]+                  , Row+                      ( "" , [] , [] )+                      [ Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "\\Longrightarrow"+                                  , Str "\8192"+                                  , Code+                                      ( "" , [] , [] )+                                      "arrow.r.double.long"+                                  ]+                              ]+                          ]+                      , Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "\\uparrow"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "arrow.t"+                                  ]+                              ]+                          ]+                      ]+                  , Row+                      ( "" , [] , [] )+                      [ Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "\8668"+                                  , Str "\8192"+                                  , Code+                                      ( "" , [] , [] ) "arrow.squiggly"+                                  ]+                              ]+                          ]+                      , Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "\\updownarrow"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "arrow.t.b"+                                  ]+                              ]+                          ]+                      ]+                  ]+              ]+              (TableFoot ( "" , [] , [] ) [])+          ]+      , Para+          [ Str "The"+          , Space+          , Str "right"+          , Space+          , Str "arrows"+          , Space+          , Str "in"+          , Space+          , Str "the"+          , Space+          , Str "first"+          , Space+          , Str "column"+          , Space+          , Str "have"+          , Space+          , Str "matching"+          , Space+          , Str "left"+          , Space+          , Str "arrows,"+          , Space+          , Str "such"+          , Space+          , Str "as"+          , Space+          , Code ( "" , [] , [] ) "arrow.l.not"+          , Str ","+          , Space+          , Str "and"+          , Space+          , Str "there"+          , Space+          , Str "are"+          , Space+          , Str "some"+          , Space+          , Str "other"+          , Space+          , Str "matches"+          , Space+          , Str "for"+          , Space+          , Str "down"+          , Space+          , Str "arrows,"+          , Space+          , Str "etc."+          ]+      , Para+          [ Strong+              [ Str "Variable-sized"+              , Space+              , Str "operators\8192\160"+              ]+          , Str "The"+          , Space+          , Str "summation"+          , Space+          , Math InlineMath "\\sum_{j = 0}^{3}j^{2}"+          , Space+          , Code ( "" , [] , [] ) "sum_(j = 0)^3 j^2"+          , Space+          , Str "and"+          , Space+          , Str "the"+          , Space+          , Str "integral"+          , Space+          , Math InlineMath "\\int_{x = 0}^{3}x^{2}dx"+          , Space+          , Code ( "" , [] , [] ) "integral_(x = 0)^3 x^2 dif x"+          , Space+          , Str "expand"+          , Space+          , Str "when"+          , Space+          , Str "displayed."+          ]+      , Para+          [ Math+              InlineMath+              "\\sum_{j = 0}^{3}j^{2}\\qquad\\int_{x = 0}^{3}x^{2}dx"+          ]+      , Para+          [ Str "These"+          , Space+          , Str "do"+          , Space+          , Str "the"+          , Space+          , Str "same."+          ]+      , Div+          ( "" , [] , [ ( "align" , "center" ) ] )+          [ Table+              ( "" , [] , [] )+              (Caption Nothing [])+              [ ( AlignLeft , ColWidthDefault )+              , ( AlignLeft , ColWidthDefault )+              , ( AlignLeft , ColWidthDefault )+              ]+              (TableHead ( "" , [] , [] ) [])+              [ TableBody+                  ( "" , [] , [] )+                  (RowHeadColumns 0)+                  []+                  [ Row+                      ( "" , [] , [] )+                      [ Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "\\int"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "integral"+                                  ]+                              ]+                          ]+                      , Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "\\iiint"+                                  , Str "\8192"+                                  , Code+                                      ( "" , [] , [] ) "integral.triple"+                                  ]+                              ]+                          ]+                      , Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "\\bigcup"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "union.big"+                                  ]+                              ]+                          ]+                      ]+                  , Row+                      ( "" , [] , [] )+                      [ Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "\\iint"+                                  , Str "\8192"+                                  , Code+                                      ( "" , [] , [] ) "integral.double"+                                  ]+                              ]+                          ]+                      , Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "\\oint"+                                  , Str "\8192"+                                  , Code+                                      ( "" , [] , [] ) "integral.cont"+                                  ]+                              ]+                          ]+                      , Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "\\bigcap"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "sect.big"+                                  ]+                              ]+                          ]+                      ]+                  ]+              ]+              (TableFoot ( "" , [] , [] ) [])+          ]+      , Para [ Strong [ Str "Fences\8192\160" ] ]+      , Div+          ( "" , [] , [ ( "align" , "center" ) ] )+          [ Table+              ( "" , [] , [] )+              (Caption Nothing [])+              [ ( AlignLeft , ColWidthDefault )+              , ( AlignLeft , ColWidthDefault )+              , ( AlignLeft , ColWidthDefault )+              ]+              (TableHead ( "" , [] , [] ) [])+              [ TableBody+                  ( "" , [] , [] )+                  (RowHeadColumns 0)+                  []+                  [ Row+                      ( "" , [] , [] )+                      [ Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "()"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "()"+                                  ]+                              ]+                          ]+                      , Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "\\langle\\rangle"+                                  , Str "\8192"+                                  , Code+                                      ( "" , [] , [] ) "angle.l angle.r"+                                  ]+                              ]+                          ]+                      , Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math+                                      InlineMath "\\left| {} \\right|"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "abs(\"\")"+                                  ]+                              ]+                          ]+                      ]+                  , Row+                      ( "" , [] , [] )+                      [ Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math InlineMath "\\lbrack\\rbrack"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "[]"+                                  ]+                              ]+                          ]+                      , Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math+                                      InlineMath+                                      "\\left\\lfloor {} \\right\\rfloor"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "floor(\"\")"+                                  ]+                              ]+                          ]+                      , Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math+                                      InlineMath+                                      "\\left. \\parallel{} \\right.\\parallel"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "norm(\"\")"+                                  ]+                              ]+                          ]+                      ]+                  , Row+                      ( "" , [] , [] )+                      [ Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math+                                      InlineMath "\\left\\{ \\right\\}"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "{}"+                                  ]+                              ]+                          ]+                      , Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Span+                                  ( "" , [ "box" ] , [] )+                                  [ Math+                                      InlineMath+                                      "\\left\\lceil {} \\right\\rceil"+                                  , Str "\8192"+                                  , Code ( "" , [] , [] ) "ceil(\"\")"+                                  ]+                              ]+                          ]+                      , Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          []+                      ]+                  ]+              ]+              (TableFoot ( "" , [] , [] ) [])+          ]+      , Para+          [ Str "Fix"+          , Space+          , Str "the"+          , Space+          , Str "size"+          , Space+          , Str "with"+          , Space+          , Str "the"+          , Space+          , Code ( "" , [] , [] ) "lr"+          , Space+          , Str "function."+          ]+      , Div+          ( "" , [] , [ ( "align" , "center" ) ] )+          [ Table+              ( "" , [] , [] )+              (Caption Nothing [])+              [ ( AlignLeft , ColWidthDefault )+              , ( AlignLeft , ColWidthDefault )+              ]+              (TableHead ( "" , [] , [] ) [])+              [ TableBody+                  ( "" , [] , [] )+                  (RowHeadColumns 0)+                  []+                  [ Row+                      ( "" , [] , [] )+                      [ Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Math+                                  InlineMath+                                  "\\left. \\left\\lbrack \\sum_{k = 0}^{n}e^{k^{2}} \\right\\rbrack \\right."+                              ]+                          ]+                      , Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ CodeBlock+                              ( "" , [] , [] )+                              "lr([sum_(k = 0)^n e^(k^2)], size: #50%)\n  "+                          ]+                      ]+                  ]+              ]+              (TableFoot ( "" , [] , [] ) [])+          ]+      , Para+          [ Str "To"+          , Space+          , Str "have"+          , Space+          , Str "them"+          , Space+          , Str "grow"+          , Space+          , Str "with"+          , Space+          , Str "the"+          , Space+          , Str "enclosed"+          , Space+          , Str "formula,"+          , Space+          , Str "also"+          , Space+          , Str "use"+          , Space+          , Str "the"+          , Space+          , Code ( "" , [] , [] ) "lr"+          , Space+          , Str "function."+          ]+      , Div+          ( "" , [] , [ ( "align" , "center" ) ] )+          [ Table+              ( "" , [] , [] )+              (Caption Nothing [])+              [ ( AlignLeft , ColWidthDefault )+              , ( AlignLeft , ColWidthDefault )+              ]+              (TableHead ( "" , [] , [] ) [])+              [ TableBody+                  ( "" , [] , [] )+                  (RowHeadColumns 0)+                  []+                  [ Row+                      ( "" , [] , [] )+                      [ Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Math+                                  InlineMath+                                  "\\left\\langle i,2^{2^{i}} \\right\\rangle"+                              ]+                          ]+                      , Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ CodeBlock+                              ( "" , [] , [] )+                              "lr(angle.l i, 2^(2^i) angle.r)\n  "+                          ]+                      ]+                  ]+              ]+              (TableFoot ( "" , [] , [] ) [])+          ]+      , Para+          [ Str "Fences"+          , Space+          , Str "scale"+          , Space+          , Str "by"+          , Space+          , Str "default"+          , Space+          , Str "if"+          , Space+          , Str "entered"+          , Space+          , Str "directly"+          , Space+          , Str "as"+          , Space+          , Str "codepoints,"+          , Space+          , Str "and"+          , Space+          , Str "don\8217t"+          , Space+          , Str "scale"+          , Space+          , Str "automatically"+          , Space+          , Str "if"+          , Space+          , Str "entered"+          , Space+          , Str "as"+          , Space+          , Str "symbol"+          , Space+          , Str "notation."+          ]+      , Div+          ( "" , [] , [ ( "align" , "center" ) ] )+          [ Table+              ( "" , [] , [] )+              (Caption Nothing [])+              [ ( AlignLeft , ColWidthDefault )+              , ( AlignLeft , ColWidthDefault )+              ]+              (TableHead ( "" , [] , [] ) [])+              [ TableBody+                  ( "" , [] , [] )+                  (RowHeadColumns 0)+                  []+                  [ Row+                      ( "" , [] , [] )+                      [ Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Math+                                  InlineMath+                                  "\\left( \\frac{1}{n^{\\alpha}} \\right)"+                              ]+                          ]+                      , Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ CodeBlock+                              ( "" , [] , [] ) "(1 / n^(alpha))\n  "+                          ]+                      ]+                  , Row+                      ( "" , [] , [] )+                      [ Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Math+                                  InlineMath "(\\frac{1}{n^{\\alpha}})"+                              ]+                          ]+                      , Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ CodeBlock+                              ( "" , [] , [] )+                              "paren.l 1 / n^(alpha) paren.r\n  "+                          ]+                      ]+                  ]+              ]+              (TableFoot ( "" , [] , [] ) [])+          ]+      , Para+          [ Str "The"+          , Space+          , Code ( "" , [] , [] ) "lr"+          , Space+          , Str "function"+          , Space+          , Str "also"+          , Space+          , Str "allows"+          , Space+          , Str "to"+          , Space+          , Str "scale"+          , Space+          , Str "unmatched"+          , Space+          , Str "delimiters"+          , Space+          , Str "and"+          , Space+          , Str "one-side"+          , Space+          , Str "fences."+          ]+      , Div+          ( "" , [] , [ ( "align" , "center" ) ] )+          [ Table+              ( "" , [] , [] )+              (Caption Nothing [])+              [ ( AlignLeft , ColWidthDefault )+              , ( AlignLeft , ColWidthDefault )+              ]+              (TableHead ( "" , [] , [] ) [])+              [ TableBody+                  ( "" , [] , [] )+                  (RowHeadColumns 0)+                  []+                  [ Row+                      ( "" , [] , [] )+                      [ Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Math+                                  InlineMath+                                  "\\left. \\frac{df}{dx} \\right|_{x_{0}}"+                              ]+                          ]+                      , Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ CodeBlock+                              ( "" , [] , [] )+                              "lr(frac(dif f, dif x) |)_(x_0)\n  "+                          ]+                      ]+                  ]+              ]+              (TableFoot ( "" , [] , [] ) [])+          ]+      , Para+          [ Strong [ Str "Arrays," , Space , Str "Matrices\8192\160" ]+          , Str "Get"+          , Space+          , Str "a"+          , Space+          , Str "matrix"+          , Space+          , Str "with"+          , Space+          , Str "the"+          , Space+          , Code ( "" , [] , [] ) "mat"+          , Space+          , Str "function."+          , Space+          , Str "You"+          , Space+          , Str "can"+          , Space+          , Str "pass"+          , Space+          , Str "an"+          , Space+          , Str "array"+          , Space+          , Str "to"+          , Space+          , Str "it."+          ]+      , Div+          ( "" , [] , [ ( "align" , "center" ) ] )+          [ Table+              ( "" , [] , [] )+              (Caption Nothing [])+              [ ( AlignLeft , ColWidthDefault )+              , ( AlignLeft , ColWidthDefault )+              ]+              (TableHead ( "" , [] , [] ) [])+              [ TableBody+                  ( "" , [] , [] )+                  (RowHeadColumns 0)+                  []+                  [ Row+                      ( "" , [] , [] )+                      [ Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Math+                                  InlineMath+                                  "\\begin{pmatrix}\na & b \\\\\nc & d\n\\end{pmatrix}"+                              ]+                          ]+                      , Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ CodeBlock+                              ( "" , [] , [] ) "$ mat(a, b; c, d) $\n  "+                          ]+                      ]+                  ]+              ]+              (TableFoot ( "" , [] , [] ) [])+          ]+      , Para+          [ Str "In"+          , Space+          , Str "Typst,"+          , Space+          , Underline+              [ Underline+                  [ Link+                      ( "" , [] , [] )+                      [ Str "array" ]+                      ( "https://typst.app/docs/reference/typst/array"+                      , ""+                      )+                  ]+              ]+          , Space+          , Str "is"+          , Space+          , Str "a"+          , Space+          , Str "sequence"+          , Space+          , Str "of"+          , Space+          , Str "values,"+          , SoftBreak+          , Str "while"+          , Space+          , Str "in"+          , Space+          , Span+              ( "" , [ "box" ] , [] )+              [ Str "L\8202A\8202"+              , Span ( "" , [ "box" ] , [] ) [ Str "T\8202E\8202X" ]+              ]+          , Str ","+          , Space+          , Str "array"+          , Space+          , Str "is"+          , Space+          , Str "a"+          , Space+          , Str "matrix"+          , Space+          , Str "without"+          , Space+          , Str "fences,"+          , Space+          , Str "which"+          , Space+          , Str "is"+          , Space+          , Code ( "" , [] , [] ) "$mat(delim: #none, ..)$"+          , Space+          , Str "in"+          , Space+          , Str "Typst."+          ]+      , Para+          [ Str "For"+          , Space+          , Str "the"+          , Space+          , Str "determinant"+          , Space+          , Str "use"+          , Space+          , Code ( "" , [] , [] ) "|A|"+          , Str ","+          , Space+          , Str "text"+          , Space+          , Str "operator"+          , Space+          , Math InlineMath "\\det"+          , Space+          , Code ( "" , [] , [] ) "det"+          , Space+          , Str "or"+          , Space+          , Code ( "" , [] , [] ) "mat(delim: \"|\", ..)"+          , Str "."+          ]+      , Para+          [ Str "Definition"+          , Space+          , Str "by"+          , Space+          , Str "cases"+          , Space+          , Str "can"+          , Space+          , Str "be"+          , Space+          , Str "easily"+          , Space+          , Str "obtained"+          , Space+          , Str "with"+          , Space+          , Str "the"+          , Space+          , Code ( "" , [] , [] ) "cases"+          , Space+          , Str "function."+          ]+      , Div+          ( "" , [] , [ ( "align" , "center" ) ] )+          [ Table+              ( "" , [] , [] )+              (Caption Nothing [])+              [ ( AlignLeft , ColWidthDefault )+              , ( AlignLeft , ColWidthDefault )+              ]+              (TableHead ( "" , [] , [] ) [])+              [ TableBody+                  ( "" , [] , [] )+                  (RowHeadColumns 0)+                  []+                  [ Row+                      ( "" , [] , [] )+                      [ Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Math+                                  InlineMath+                                  "f_{n} = \\begin{cases}\na & \\text{if }n = 0 \\\\\nr \\cdot f_{n - 1} & \\text{else }\n\\end{cases}"+                              ]+                          ]+                      , Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ CodeBlock+                              ( "" , [] , [] )+                              "$ f_n = cases(\n    a &\"if\" n = 0,\n    r dot f_(n - 1) &\"else\"\n  ) $\n  "+                          ]+                      ]+                  ]+              ]+              (TableFoot ( "" , [] , [] ) [])+          ]+      , Para+          [ Strong+              [ Str "Spacing"+              , Space+              , Str "in"+              , Space+              , Str "mathematics\8192\160"+              ]+          , Str "Improve"+          , Space+          , Math InlineMath "\\sqrt{2}x"+          , Space+          , Str "to"+          , Space+          , Math InlineMath "\\sqrt{2}\\, x"+          , Space+          , Str "with"+          , Space+          , Str "a"+          , Space+          , Str "thin"+          , Space+          , Str "space,"+          , Space+          , Str "as"+          , Space+          , Str "in"+          , Space+          , Code ( "" , [] , [] ) "sqrt(2) thin x"+          , Str "."+          , SoftBreak+          , Str "Slightly"+          , Space+          , Str "wider"+          , Space+          , Str "are"+          , Space+          , Code ( "" , [] , [] ) "medium"+          , Space+          , Str "and"+          , Space+          , Code ( "" , [] , [] ) "thick"+          , Space+          , Str "(the"+          , Space+          , Str "three"+          , Space+          , Str "are"+          , Space+          , Str "in"+          , Space+          , Str "ratio"+          , Space+          , Math InlineMath "3:4:5"+          , Str ")."+          , SoftBreak+          , Str "Bigger"+          , Space+          , Str "space"+          , Space+          , Str "is"+          , Space+          , Code ( "" , [] , [] ) "quad"+          , Space+          , Str "for"+          , Space+          , Math InlineMath "\\rightarrow \\quad \\leftarrow"+          , Str ","+          , Space+          , Str "which"+          , Space+          , Str "is"+          , Space+          , Str "useful"+          , Space+          , Str "between"+          , Space+          , Str "parts"+          , Space+          , Str "of"+          , Space+          , Str "a"+          , Space+          , Str "display."+          , SoftBreak+          , Str "Get"+          , Space+          , Str "arbitrary"+          , Space+          , Str "space"+          , Space+          , Str "with"+          , Space+          , Str "the"+          , Space+          , Code ( "" , [] , [] ) "h"+          , Space+          , Str "function."+          , SoftBreak+          , Str "For"+          , Space+          , Str "example,"+          , Space+          , Str "use"+          , Space+          , Code ( "" , [] , [] ) "#h(2em)"+          , Space+          , Str "for"+          , Space+          , Code ( "" , [] , [] ) "\\qquad"+          , Space+          , Str "in"+          , Space+          , Span+              ( "" , [ "box" ] , [] )+              [ Str "L\8202A\8202"+              , Span ( "" , [ "box" ] , [] ) [ Str "T\8202E\8202X" ]+              ]+          , Space+          , Str "and"+          , Space+          , Code ( "" , [] , [] ) "#h(-0.1667em)"+          , Space+          , Str "for"+          , Space+          , Code ( "" , [] , [] ) "\\!"+          , Str "."+          ]+      , Para+          [ Strong+              [ Str "Displayed" , Space , Str "equations\8192\160" ]+          , Str "Display"+          , Space+          , Str "equations"+          , Space+          , Str "in"+          , Space+          , Str "a"+          , Space+          , Str "block"+          , Space+          , Str "level"+          , Space+          , Str "using"+          , Space+          , Code ( "" , [] , [] ) "$ ... $"+          , Space+          , Str "with"+          , Space+          , Str "at"+          , Space+          , Str "least"+          , Space+          , Str "one"+          , Space+          , Str "space"+          , Space+          , Str "separating"+          , Space+          , Str "the"+          , Space+          , Str "math"+          , Space+          , Str "content"+          , Space+          , Str "and"+          , Space+          , Str "the"+          , Space+          , Code ( "" , [] , [] ) "$"+          , Str "."+          ]+      , Div+          ( "" , [] , [ ( "align" , "center" ) ] )+          [ Table+              ( "" , [] , [] )+              (Caption Nothing [])+              [ ( AlignLeft , ColWidthDefault )+              , ( AlignLeft , ColWidthDefault )+              ]+              (TableHead ( "" , [] , [] ) [])+              [ TableBody+                  ( "" , [] , [] )+                  (RowHeadColumns 0)+                  []+                  [ Row+                      ( "" , [] , [] )+                      [ Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Math InlineMath "S = k \\cdot \\lg W" ]+                          ]+                      , Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ CodeBlock+                              ( "" , [] , [] ) "$ S = k dot lg W $\n  "+                          ]+                      ]+                  ]+              ]+              (TableFoot ( "" , [] , [] ) [])+          ]+      , Para+          [ Str "You"+          , Space+          , Str "can"+          , Space+          , Str "break"+          , Space+          , Str "into"+          , Space+          , Str "multiple"+          , Space+          , Str "lines."+          ]+      , Div+          ( "" , [] , [ ( "align" , "center" ) ] )+          [ Table+              ( "" , [] , [] )+              (Caption Nothing [])+              [ ( AlignLeft , ColWidthDefault )+              , ( AlignLeft , ColWidthDefault )+              ]+              (TableHead ( "" , [] , [] ) [])+              [ TableBody+                  ( "" , [] , [] )+                  (RowHeadColumns 0)+                  []+                  [ Row+                      ( "" , [] , [] )+                      [ Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Math+                                  InlineMath+                                  "\\begin{array}{r}\n\\sin(x) = x - \\frac{x^{3}}{3!} \\\\\n + \\frac{x^{5}}{5!} - \\cdots\n\\end{array}"+                              ]+                          ]+                      , Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ CodeBlock+                              ( "" , [] , [] )+                              "$ sin(x) = x - x^3 / 3! \\\n      + x^5 / 5! - dots.h.c $\n  "+                          ]+                      ]+                  ]+              ]+              (TableFoot ( "" , [] , [] ) [])+          ]+      , Para+          [ Str "Align"+          , Space+          , Str "equations"+          , Space+          , Str "using"+          , Space+          , Code ( "" , [] , [] ) "&"+          ]+      , Div+          ( "" , [] , [ ( "align" , "center" ) ] )+          [ Table+              ( "" , [] , [] )+              (Caption Nothing [])+              [ ( AlignLeft , ColWidthDefault )+              , ( AlignLeft , ColWidthDefault )+              ]+              (TableHead ( "" , [] , [] ) [])+              [ TableBody+                  ( "" , [] , [] )+                  (RowHeadColumns 0)+                  []+                  [ Row+                      ( "" , [] , [] )+                      [ Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Math+                                  InlineMath+                                  "\\begin{aligned}\n\\nabla \\cdot \\mathbf{D} & = \\rho \\\\\n\\nabla \\cdot \\mathbf{B} & = 0\n\\end{aligned}"+                              ]+                          ]+                      , Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ CodeBlock+                              ( "" , [] , [] )+                              "$ nabla dot bold(D) &= rho \\\n    nabla dot bold(B) &= 0 $\n  "+                          ]+                      ]+                  ]+              ]+              (TableFoot ( "" , [] , [] ) [])+          ]+      , Para+          [ Str "(the"+          , Space+          , Str "left"+          , Space+          , Str "or"+          , Space+          , Str "right"+          , Space+          , Str "side"+          , Space+          , Str "of"+          , Space+          , Str "an"+          , Space+          , Str "alignment"+          , Space+          , Str "can"+          , Space+          , Str "be"+          , Space+          , Str "empty)."+          , SoftBreak+          , Str "Get"+          , Space+          , Str "a"+          , Space+          , Str "numbered"+          , Space+          , Str "version"+          , Space+          , Str "by"+          , Space+          , Code ( "" , [] , [] ) "#set math.equation(numbering: ..)"+          , Str "."+          ]+      , Para+          [ Strong+              [ Str "Calculus" , Space , Str "examples\8192\160" ]+          , Str "The"+          , Space+          , Str "last"+          , Space+          , Str "three"+          , Space+          , Str "here"+          , Space+          , Str "are"+          , Space+          , Str "display"+          , Space+          , Str "style."+          ]+      , Div+          ( "" , [] , [ ( "align" , "center" ) ] )+          [ Table+              ( "" , [] , [] )+              (Caption Nothing [])+              [ ( AlignDefault , ColWidthDefault )+              , ( AlignDefault , ColWidthDefault )+              ]+              (TableHead ( "" , [] , [] ) [])+              [ TableBody+                  ( "" , [] , [] )+                  (RowHeadColumns 0)+                  []+                  [ Row+                      ( "" , [] , [] )+                      [ Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Div+                              ( "" , [] , [] )+                              [ Para+                                  [ Math+                                      InlineMath+                                      "f:{\\mathbb{R}} \\rightarrow {\\mathbb{R}}"+                                  ]+                              ]+                          ]+                      , Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ CodeBlock ( "" , [] , [] ) "f: RR -> RR\n  "+                          ]+                      ]+                  , Row+                      ( "" , [] , [] )+                      [ Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Div+                              ( "" , [] , [] )+                              [ Para+                                  [ Math+                                      InlineMath+                                      "9.8\\ \\text{ m/s}^{2}"+                                  ]+                              ]+                          ]+                      , Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Div+                              ( "" , [] , [] )+                              [ Para+                                  [ Code+                                      ( "" , [] , [] )+                                      "\"9.8\" \"m/s\"^2"+                                  , Space+                                  , Link+                                      ( "" , [ "ref" ] , [] )+                                      [ Str "[tricky]" ]+                                      ( "#tricky" , "" )+                                  ]+                              ]+                          ]+                      ]+                  , Row+                      ( "" , [] , [] )+                      [ Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Math+                                  InlineMath+                                  "\\lim\\limits_{h \\rightarrow 0}\\frac{f(x + h) - f(x)}{h}"+                              ]+                          ]+                      , Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ CodeBlock+                              ( "" , [] , [] )+                              "lim_(h -> 0) (f(x + h) - f(x)) / h\n  "+                          ]+                      ]+                  , Row+                      ( "" , [] , [] )+                      [ Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Math+                                  InlineMath+                                  "\\int x^{2}dx = x^{3}/3 + C"+                              ]+                          ]+                      , Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ CodeBlock+                              ( "" , [] , [] )+                              "integral x^2 dif x = x^3 \\/ 3 + C\n  "+                          ]+                      ]+                  , Row+                      ( "" , [] , [] )+                      [ Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Para+                              [ Math+                                  InlineMath+                                  "\\nabla = \\mathbf{i}\\frac{d}{dx} + \\mathbf{j}\\frac{d}{dy} + \\mathbf{k}\\frac{d}{dz}"+                              ]+                          ]+                      , Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ CodeBlock+                              ( "" , [] , [] )+                              "nabla = bold(i) dif / (dif x) + bold(j) dif / (dif y) + bold(k) dif / (dif z)\n  "+                          ]+                      ]+                  ]+              ]+              (TableFoot ( "" , [] , [] ) [])+          ]+      , Para+          [ Strong+              [ Str "Discrete"+              , Space+              , Str "mathematics"+              , Space+              , Str "examples\8192\160"+              ]+          , Str "For"+          , Space+          , Str "modulo,"+          , Space+          , Str "there"+          , Space+          , Str "is"+          , Space+          , Str "a"+          , Space+          , Str "symbol"+          , Space+          , Math InlineMath "\\equiv"+          , Space+          , Str "from"+          , Space+          , Code ( "" , [] , [] ) "ident"+          , Space+          , Str "and"+          , Space+          , Str "a"+          , Space+          , Str "text"+          , Space+          , Str "operator"+          , Space+          , Math InlineMath "\\operatorname{mod}"+          , Space+          , Str "from"+          , Space+          , Code ( "" , [] , [] ) "mod"+          , Str "."+          ]+      , Para+          [ Str "For"+          , Space+          , Str "combinations"+          , Space+          , Str "the"+          , Space+          , Str "binomial"+          , Space+          , Str "symbol"+          , Space+          , Math InlineMath "\\binom{n}{k}"+          , Space+          , Str "is"+          , Space+          , Str "from"+          , Space+          , Code ( "" , [] , [] ) "binom(n, k)"+          , Str "."+          , SoftBreak+          , Str "This"+          , Space+          , Str "resizes"+          , Space+          , Str "to"+          , Space+          , Str "be"+          , Space+          , Str "bigger"+          , Space+          , Str "in"+          , Space+          , Str "a"+          , Space+          , Str "display."+          ]+      , Para+          [ Str "For"+          , Space+          , Str "permutations"+          , Space+          , Str "use"+          , Space+          , Math InlineMath "n^{\\underline{r}}"+          , Space+          , Str "from"+          , Space+          , Code ( "" , [] , [] ) "n^(underline(r))"+          , Space+          , Str "(some"+          , Space+          , Str "authors"+          , Space+          , Str "use"+          , Space+          , Math InlineMath "P(n,r)"+          , Str ","+          , Space+          , Str "or"+          , Space+          , Math InlineMath "{}_{n}P_{r}"+          , Space+          , Str "from"+          , Space+          , Code ( "" , [] , [] ) "\"\"_n P_r"+          , Str ")."+          ]+      , Para+          [ Strong+              [ Str "Statistics" , Space , Str "examples\8192\160" ]+          ]+      , Div+          ( "" , [] , [ ( "align" , "center" ) ] )+          [ Table+              ( "" , [] , [] )+              (Caption Nothing [])+              [ ( AlignDefault , ColWidthDefault )+              , ( AlignDefault , ColWidthDefault )+              ]+              (TableHead ( "" , [] , [] ) [])+              [ TableBody+                  ( "" , [] , [] )+                  (RowHeadColumns 0)+                  []+                  [ Row+                      ( "" , [] , [] )+                      [ Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Div+                              ( "" , [] , [] )+                              [ Para+                                  [ Math+                                      InlineMath+                                      "\\sigma^{2} = \\sqrt{{\\sum(x_{i} - \\mu)}^{2}/N}"+                                  ]+                              ]+                          ]+                      , Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ CodeBlock+                              ( "" , [] , [] )+                              "sigma^2 = sqrt(sum(x_i - mu)^2 \\/ N)\n  "+                          ]+                      ]+                  , Row+                      ( "" , [] , [] )+                      [ Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ Div+                              ( "" , [] , [] )+                              [ Para+                                  [ Math+                                      InlineMath+                                      "E(X) = \\mu_{X} = \\sum(x_{i} - P\\left( x_{i} \\right))"+                                  ]+                              ]+                          ]+                      , Cell+                          ( "" , [] , [] )+                          AlignDefault+                          (RowSpan 1)+                          (ColSpan 1)+                          [ CodeBlock+                              ( "" , [] , [] )+                              "E(X) = mu_X = sum(x_i - P(x_i))\n  "+                          ]+                      ]+                  ]+              ]+              (TableFoot ( "" , [] , [] ) [])+          ]+      , Para+          [ Str "The"+          , Space+          , Str "probability"+          , Space+          , Str "density"+          , Space+          , Str "of"+          , Space+          , Str "the"+          , Space+          , Str "normal"+          , Space+          , Str "distribution"+          ]+      , Para+          [ Math+              InlineMath+              "\\frac{1}{\\sqrt{2\\sigma^{2}\\pi}}e^{- \\frac{(x - \\mu)^{2}}{2\\sigma^{2}}}"+          ]+      , Para+          [ Str "comes" , Space , Str "from" , Space , Str "this." ]+      , Table+          ( "" , [] , [] )+          (Caption Nothing [])+          [ ( AlignDefault , ColWidthDefault )+          , ( AlignDefault , ColWidthDefault )+          ]+          (TableHead ( "" , [] , [] ) [])+          [ TableBody+              ( "" , [] , [] )+              (RowHeadColumns 0)+              []+              [ Row+                  ( "" , [] , [] )+                  [ Cell+                      ( "" , [] , [] )+                      AlignDefault+                      (RowSpan 1)+                      (ColSpan 1)+                      [ Para [] ]+                  , Cell+                      ( "" , [] , [] )+                      AlignDefault+                      (RowSpan 1)+                      (ColSpan 1)+                      [ CodeBlock+                          ( "" , [] , [] )+                          "1 / sqrt(2 sigma^2 pi)\n    e^(- (x - mu)^2 / (2 sigma^2))\n  "+                      ]+                  ]+              ]+          ]+          (TableFoot ( "" , [] , [] ) [])+      , Para+          [ Strong [ Str "For" , Space , Str "more\8192\160" ]+          , Str "See"+          , Space+          , Str "also"+          , Space+          , Str "the"+          , Space+          , Str "Typst"+          , Space+          , Str "Documentation"+          , Space+          , Str "at"+          , Space+          , Underline+              [ Underline+                  [ Link+                      ( "" , [] , [] )+                      [ Str "https://typst.app/docs" ]+                      ( "https://typst.app/docs" , "" )+                  ]+              ]+          , Str "."+          ]+      , Para []+      , Div+          ( "" , [] , [] )+          [ HorizontalRule+          , Para+              [ Str "johanvx"+              , Space+              , Str "("+              , Underline+                  [ Underline+                      [ Underline+                          [ Link+                              ( "" , [] , [] )+                              [ Str "https://github.com/johanvx" ]+                              ( "https://github.com/johanvx" , "" )+                          ]+                      ]+                  ]+              , Str ")"+              , Space+              , Str "\8202\8193"+              , Space+              , Str "2023-05-22"+              ]+          ]+      ]+  ]
+ test/typst-reader.typ view
@@ -0,0 +1,28 @@+#set page(width: 10cm, height: auto)+#set heading(numbering: "1.")++= Fibonacci sequence+The Fibonacci sequence is defined through the+recurrence relation $F_n = F_(n-1) + F_(n-2)$.+It can also be expressed in _closed form:_++$ F_n = round(1 / sqrt(5) phi.alt^n), quad+  phi.alt = (1 + sqrt(5)) / 2 $++#let count = 8+#let nums = range(1, count + 1)+#let fib(n) = (+  if n <= 2 { 1 }+  else { fib(n - 1) + fib(n - 2) }+)++The first #count numbers of the sequence are:++#align(center, table(+  columns: count,+  ..nums.map(n => $F_#n$),+  ..nums.map(n => str(fib(n))),+))++#include "undergradmath.typ"+
+ test/undergradmath.typ view
@@ -0,0 +1,510 @@+// Licensed under the Creative Commons Attribution-ShareAlike 4.0 International License.+// https://creativecommons.org/licenses/by-sa/4.0/++// Meta data+#set document(title: "Typst Math for Undergrads", author: "johanvx")++// Margin+#set page(margin: 0.5in)++// Font size+#let scriptsize = 7pt+#let normalsize = 10pt+#let large = 12pt+#set text(size: normalsize, lang: "en")++// Some horizontal spacing+#let kern(length) = h(length, weak: true)+#let enspace = kern(0.5em)+#let qquad = h(2em)++// For table/grid, something like "lhs \enspace rhs"+#let cell(lhs, rhs) = box(lhs + enspace + rhs)+// Grid for code blocks+#set grid(columns: (2em, auto))+// Table for math-code listing+#set table(stroke: none, align: horizon + left, inset: 0pt, row-gutter: 0.45em)++// LaTeX and TeX logos+#let TeX = style(styles => {+  let e = measure(text(normalsize, "E"), styles)+  let T = "T"+  let E = text(normalsize, baseline: e.height / 2, "E")+  let X = "X"+  box(T + kern(-0.1667em) + E + kern(-0.125em) + X)+})+#let LaTeX = style(styles => {+  let l = measure(text(10pt, "L"), styles)+  let a = measure(text(7pt, "A"), styles)+  let L = "L"+  let A = text(7pt, baseline: a.height - l.height, "A")+  box(L + kern(-0.36em) + A + kern(-0.15em) + TeX)+})++// Update date+#let date = "2023-05-22"++// Unavailable (last check date)+#show "??": box(text(red, [#date #emoji.crossmark]))+// Tricky+#show "!!": box(text(blue, emoji.drops))+// No idea+#show "?!": box(text(orange, [No idea #emoji.face.unhappy]))+// Tricky figure numbering+#set figure(numbering: n => {+  ([??], [!!], [?!]).at(n - 1)+})+// No prefix+#set ref(supplement: "")++// Justified paragraphs+#set par(justify: true)++// Two-column body+#show: rest => columns(2, rest)++// headcolor+#let headcolor = rgb("004225")++// Run-in sections, like LaTeX \paragraph+#show heading.where(+  level: 1+): it => text(+  size: normalsize,+  weight: "bold",+  fill: headcolor,+  it.body + h(0.67em)+)++// Black raw code+// #show raw.where(block: false): it => { it.text }++// Title+#align(center, link("https://github.com/johanvx/typst-undergradmath")[+  #text(large, headcolor)[*Typst Math for Undergrads*]+])++// Put this here to avoid affecting the title+#show link: underline++This is a Typst port of _#LaTeX Math for Undergrads_ by Jim Hefferon.+The original version is available at #link("https://gitlab.com/jim.hefferon/undergradmath").++= Meaning of annotations+#figure(+  table(+    columns: (1fr, 2fr),+    [??], [This is unavailable. Last check date is #date.],+  )+) <unavailable>+#figure(+  table(+    columns: (1fr, 2fr),+    [!!], [Get this in a tricky way. Need a simpler method.],+  )+) <tricky>+#figure(+  table(+    columns: (1fr, 2fr),+    [?!], [Don't know how to get this.],+  )+) <noidea>++= Rule One+Any mathematics at all, even a single character, gets a mathematical setting.+Thus, for "the value of $x$ is $7$" enter `the value of $x$ is $7$`.++= Template+Your document should contain at least this.++#grid(+  "",+  ```+  -- document body here --+  ```+)++= Common constructs+#align(center, table(+  columns: 2,+  column-gutter: 1.5em,+  cell($x^2$, `x^2`),+  cell([$sqrt(2)$, $root(n, 3)$], [`sqrt(2)`, `root(n, 3)`]),+  cell($x_(i, j)$, `x_(i, j)`),+  cell([$2 / 3$, $2 \/ 3$], [`2 / 3`, `2 \/ 3` or `2 slash 3`]), // Maybe use `slash`?+))++= Calligraphic letters+Use as in `$cal(A)$`.++$ cal(A B C D E F G H I J K L M N O P Q R S T U V W X Y Z) $++Getting script letters is @unavailable.++= Greek+#align(center, table(+  columns: 2,+  column-gutter: 1em,+  cell($alpha$, `alpha`), cell([$xi$, $Xi$], [`xi`, `Xi`]),+  cell($beta$, `beta`), cell($omicron$, `omicron`),+  cell([$gamma$, $Gamma$], [`gamma`, `Gamma`]), cell([$pi$, $Pi$], [`pi`, `Pi`]),+  cell([$delta$, $Delta$], [`delta`, `Delta`]), cell($pi.alt$, `pi.alt`),+  cell($epsilon.alt$, `epsilon.alt`), cell($rho$, `rho`),+  cell($epsilon$, `epsilon`), cell($rho.alt$, `rho.alt`),+  cell($zeta$, `zeta`), cell([$sigma$, $Sigma$], [`sigma`, `Sigma`]),+  cell($eta$, `eta`), cell($\u{03C2}$, [`\u{03C2}` @tricky]),+  cell([$theta$, $Theta$], [`theta`, `Theta`]), cell($tau$, `tau`),+  cell($theta.alt$, `theta.alt`), cell([$upsilon$, $Upsilon$], [`upsilon`, `Upsilon`]),+  cell($iota$, `iota`), cell([$phi.alt$, $Phi$], [`phi.alt`, `Phi`]),+  cell($kappa$, $Kappa$), cell($phi$, `phi`),+  cell([$lambda$, $Lambda$], [`lambda`, `Lambda`]), cell($chi$, `chi`),+  cell($mu$, `mu`), cell([$psi$, $Psi$], [`psi`, `Psi`]),+  cell($nu$, `nu`), cell([$omega$, $Omega$], [`omega`, `Omega`]),+))++= Sets and logic+#align(center, table(+  columns: 3,+  column-gutter: 1em,+  cell($union$, `union`), cell($RR$, [`RR`, `bb(R)`]), cell($forall$, `forall`),+  cell($sect$, `sect`), cell($bb(Z)$, [`ZZ`, `bb(Z)`]), cell($exists$, `exists`),+  cell($subset$, `subset`), cell($bb(Q)$, [`QQ`, `bb(Q)`]), cell($not$, `not`),+  cell($subset.eq$, `subset.eq`), cell($bb(N)$, [`NN`, `bb(N)`]), cell($or$, `or`),+  cell($supset$, `supset`), cell($bb(C)$, [`CC`, `bb(C)`]), cell($and$, `and`),+  cell($supset.eq$, `supset.eq`), cell($diameter$, [`diameter`]), cell($tack.r$, `tack.r`),+  cell($in$, `in`), cell($nothing$, `nothing`), cell($models$, `models`),+  cell($in.not$, `in.not`), cell($alef$, `alef`), cell($without$, `without`),+))++Negate an operator, as in $subset.not$, with `subset.not`.+Get the set complement $A^(sans(c))$ with `A^(sans(c))` (or $A^(complement)$ with `A^(complement)`, or $overline(A)$ with `overline(A)`).++// https://www.ctan.org/tex-archive/fonts/newcomputermodern+//+// README+//+//     Version 3.93+//+//       Provides access to Russian and Greek guillemotleft and guillemotright+//     using the character variant tables cv3 and cv4 respectively.+//+//       The Math fonts provide the character \varnothing, an alternative to \emptyset,+//     through Character Variant cv01. The fontsetup package provides the option+//     'varnothing' to easily switch to the alternative character.++// https://mirrors.sustech.edu.cn/CTAN/fonts/newcomputermodern/doc/newcm-doc.pdf+// The NewComputerModern FontFamily §13.3+// The Math fonts provide the character \varnothing (⌀, U+2300), as an alternative to \emptyset (a slashed zero), through Character Variant cv01.+// The fontsetup package provides the option ‘varnothing’ to easily switch to the alternative character.++/ Remark: Using `diameter` for `\varnothing` may cause some confusion. However, #LaTeX also uses $diameter$ (`\u{2300}`) instead of $\u{2205}$ (`\u{2205}`), see #link("https://mirrors.sustech.edu.cn/CTAN/fonts/newcomputermodern/doc/newcm-doc.pdf")[newcm $section$13.3].+  Another solution is to use `text(font: "Fira Sans", nothing)`, but the resultant glyph $text(font: "Fira Sans", nothing)$ is subtly different from the widely used one.+  Ultimately, the choice is always *your decision*.++= Decorations+#align(center, table(+  columns: 3,+  column-gutter: 1em,+  cell($f'$, [`f'`, `f prime`]), cell($dot(a)$, `dot(a)`), cell($tilde(a)$, `tilde(a)`),+  cell($f prime.double$, `f prime.double`), cell($diaer(a)$, `diaer(a)`), cell($macron(a)$, `macron(a)`),+  cell($Sigma^*$, `Sigma^*`), cell($hat(a)$, `hat(a)`), cell($arrow(a)$, `arrow(a)`),+))++If the decorated letter is $i$ or $j$ then some decorations need `\u{1D6A4}` @tricky and `\u{1D6A5}` @tricky, as in $arrow(\u{1D6A4})$ with `arrow(\u{1D6A4})`.+Some authors use boldface for vectors: `bold(x)`.++Entering `overline(x + y)` produces $overline(x + y)$, and `hat(x + y)` gives $hat(x + y)$.+Comment on an expression as here (there is also `overbrace(..)`).++#align(center, cell(+  $underbrace(x + y, |A|)$,+  `underbrace(x + y, |A|)`,+))++= Dots+Use low dots in a list ${0, 1, 2, ...}$, entered as `{0, 1, 2, ...}`.+Use centered dots in a sum or product $1 + dots.h.c + 100$, entered as  `1 + dots.h.c + 100`.+You can also get vertical dots `dots.v`, diagonal dots `dots.down` and anti-diagonal dots `dots.up`.++= Roman names+Just type them!++#align(center, table(+  columns: 3,+  column-gutter: 1.5em,+  cell($sin$, `sin`), cell($sinh$, `sinh`), cell($arcsin$, `arcsin`),+  cell($cos$, `cos`), cell($cosh$, `cosh`), cell($arccos$, `arccos`),+  cell($tan$, `tan`), cell($tanh$, `tanh`), cell($arctan$, `arctan`),+  cell($sec$, `sec`), cell($coth$, `coth`), cell($min$, `min`),+  cell($csc$, `csc`), cell($det$, `det`), cell($max$, `max`),+  cell($cot$, `cot`), cell($dim$, `dim`), cell($inf$, `inf`),+  cell($exp$, `exp`), cell($ker$, `ker`), cell($sup$, `sup`),+  cell($log$, `log`), cell($deg$, `deg`), cell($liminf$, `liminf`),+  cell($ln$, `ln`), cell($arg$, `arg`), cell($limsup$, `limsup`),+  cell($lg$, `lg`), cell($gcd$, `gcd`), cell($lim$, `lim`),+))++= Other symbols+#align(center, table(+  columns: 3,+  column-gutter: 1.2em,+  cell($<$, [`<`, `lt`]), cell($angle$, `angle`), cell($dot$, [`dot`]),+  cell($<=$, [`<=`, `lt.eq`]), cell($angle.arc$, `angle.arc`), cell($plus.minus$, `plus.minus`),+  cell($>$, [`>`, `gt`]), cell($ell$, `ell`), cell($minus.plus$, `minus.plus`),+  cell($>=$, [`>=`, `gt.eq`]), cell($parallel$, `parallel`), cell($times$, `times`),+  cell($!=$, [`!=`, `eq.not`]), cell($45 degree$, `45 degree`), cell($div$, `div`),+  cell($<<$, [`<<`, `lt.double`]), cell($tilde.eqq$, `tilde.eqq`), cell($*$, [`*`, `ast`]),+  cell($>>$, [`>>`, `gt.double`]), cell($tilde.eqq.not$, `tilde.eqq.not`), cell($divides$, `divides`),+  cell($approx$, `approx`), cell($tilde$, `tilde`), cell($divides.not$, `divides.not`),+  cell($\u{224D}$, [`\u{224D}` @tricky]), cell($tilde.eq$, `tilde.eq`), cell($n!$, `n!`),+  cell($ident$, `ident`), cell($tilde.not$, `tilde.not`), cell($diff$, `diff`),+  cell($prec$, `prec`), cell($plus.circle$, `plus.circle`), cell($nabla$, `nabla`),+  cell($prec.eq$, `prec.eq`), cell($minus.circle$, `minus.cirle`), cell($planck.reduce$, `planck.reduce`),+  cell($succ$, `succ`), cell($dot.circle$, `dot.circle`), cell($circle.stroked.tiny$, `circle.stroked.tiny`),+  cell($succ.eq$, `succ.eq`), cell($times.circle$, `times.circle`), cell($star$, `star`),+  cell($prop$, `prop`), cell($\u{2298}$, [`\u{2298}` @tricky]), cell($sqrt("")$, `sqrt("")`),+  cell($\u{2250}$, [`\u{2250}` @tricky]), cell($harpoon.tr$, `harpoon.tr`), cell($checkmark$, `checkmark`),+))++Use `a divides b` for the divides relation, $a divides b$, and `a divides.not b` for the negation, $a divides.not b$.+Use `|` to get set builder notation ${a in S | a "is odd"}$ with `{a in S | a "is odd"}`.++= Arrows+#align(center, table(+  columns: 2,+  column-gutter: 1.5em,+  cell($->$, [`->`, `arrow.r`]), cell($|->$, [`|->`, `arrow.r.bar`]),+  cell($arrow.r.not$, `arrow.r.not`), cell($arrow.r.long.bar$, `arrow.r.long.bar`),+  cell($arrow.r.long$, `arrow.r.long`), cell($<-$, [`<-`, `arrow.l`]),+  cell($=>$, [`=>`, `arrow.r.double`]), cell($<->$, [`<->`, `arrow.l.r`]),+  cell($arrow.r.double.not$, `arrow.r.double.not`), cell($arrow.b$, `arrow.b`),+  cell($arrow.r.double.long$, `arrow.r.double.long`), cell($arrow.t$, `arrow.t`),+  cell($arrow.squiggly$, `arrow.squiggly`), cell($arrow.t.b$, `arrow.t.b`),+))++The right arrows in the first column have matching left arrows, such as `arrow.l.not`, and there are some other matches for down arrows, etc.++= Variable-sized operators+The summation $sum_(j = 0)^3 j^2$ `sum_(j = 0)^3 j^2` and the integral $integral_(x = 0)^3 x^2 dif x$ `integral_(x = 0)^3 x^2 dif x` expand when displayed.++$ sum_(j = 0)^3 j^2 qquad integral_(x = 0)^3 x^2 dif x $++These do the same.++#align(center, table(+  columns: 3,+  cell($integral$, `integral`), cell($integral.triple$, `integral.triple`), cell($union.big$, `union.big`),+  cell($integral.double$, `integral.double`), cell($integral.cont$, `integral.cont`), cell($sect.big$, `sect.big`),+))++= Fences+#align(center, table(+  columns: 3,+  column-gutter: 1.5em,+  cell($()$, `()`), cell($angle.l angle.r$, `angle.l angle.r`), cell($abs("")$, `abs("")`),+  cell($[]$, `[]`), cell($floor("")$, `floor("")`), cell($norm("")$, `norm("")`),+  cell(${}$, `{}`), cell($ceil("")$, `ceil("")`),+))++Fix the size with the `lr` function.++#align(center, table(+  columns: 2,+  column-gutter: 0.5em,+  $ lr([sum_(k = 0)^n e^(k^2)], size: #50%) $,+  ```+  lr([sum_(k = 0)^n e^(k^2)], size: #50%)+  ```,+))++To have them grow with the enclosed formula, also use the `lr` function.++#align(center, table(+  columns: 2,+  column-gutter: 1em,+  $ lr(angle.l i, 2^(2^i) angle.r) $,+  ```+  lr(angle.l i, 2^(2^i) angle.r)+  ```,+))++Fences scale by default if entered directly as codepoints, and don't scale automatically if entered as symbol notation.++#align(center, table(+  columns: 2,+  column-gutter: 1em,+  $ (1 / n^(alpha)) $,+  ```+  (1 / n^(alpha))+  ```,+  $ paren.l 1 / n^(alpha) paren.r $,+  ```+  paren.l 1 / n^(alpha) paren.r+  ```,+))++The `lr` function also allows to scale unmatched delimiters and one-side fences.++#align(center, table(+  columns: 2,+  column-gutter: 1em,+  $ lr(frac(dif f, dif x) |)_(x_0) $,+  ```+  lr(frac(dif f, dif x) |)_(x_0)+  ```,+))++= Arrays, Matrices+Get a matrix with the `mat` function. You can pass an array to it.++#align(center, table(+  columns: 2,+  column-gutter: 1em,+  $ mat(a, b; c, d) $,+  ```+  $ mat(a, b; c, d) $+  ```+))++In Typst, #link("https://typst.app/docs/reference/typst/array")[array] is a sequence of values,+while in #LaTeX, array is a matrix without fences, which is `$mat(delim: #none, ..)$` in Typst.++For the determinant use `|A|`, text operator $det$ `det` or `mat(delim: "|", ..)`.++Definition by cases can be easily obtained with the `cases` function.++#align(center, table(+  columns: 2,+  column-gutter: 1em,+  $ f_n = cases(+    a &"if" n = 0,+    r dot f_(n - 1) &"else"+  ) $,+  ```+  $ f_n = cases(+    a &"if" n = 0,+    r dot f_(n - 1) &"else"+  ) $+  ```+))++= Spacing in mathematics+Improve $sqrt(2) x$ to $sqrt(2) thin x$ with a thin space, as in `sqrt(2) thin x`.+Slightly wider are `medium` and `thick` (the three are in ratio $3 : 4 : 5$).+Bigger space is `quad` for $arrow.r quad arrow.l$, which is useful between parts of a display.+Get arbitrary space with the `h` function.+For example, use `#h(2em)` for `\qquad` in #LaTeX and `#h(-0.1667em)` for `\!`.++= Displayed equations+Display equations in a block level using `$ ... $` with at least one space separating the math content and the `$`.++#align(center, table(+  columns: 2,+  column-gutter: 1em,+  $ S = k dot lg W $,+  ```+  $ S = k dot lg W $+  ```,+))++You can break into multiple lines.++#align(center, table(+  columns: 2,+  column-gutter: 1em,+  $ sin(x) = x - x^3 / 3! \+      + x^5 / 5! - dots.h.c $,+  ```+  $ sin(x) = x - x^3 / 3! \+      + x^5 / 5! - dots.h.c $+  ```,+))++Align equations using `&`++#align(center, table(+  columns: 2,+  column-gutter: 1em,+  $ nabla dot bold(D) &= rho \+    nabla dot bold(B) &= 0 $,+  ```+  $ nabla dot bold(D) &= rho \+    nabla dot bold(B) &= 0 $+  ```,+))++(the left or right side of an alignment can be empty).+Get a numbered version by `#set math.equation(numbering: ..)`.++= Calculus examples+The last three here are display style.++#align(center, table(+  align: horizon,+  columns: 2,+  column-gutter: 1em,+  block($f: RR -> RR$),+  ```+  f: RR -> RR+  ```,+  block($"9.8" "m/s"^2$),+  block([`"9.8" "m/s"^2` @tricky]),+  $ lim_(h->0) (f(x+h)-f(x))/h $,+  ```+  lim_(h -> 0) (f(x + h) - f(x)) / h+  ```,+  $ integral x^2 dif x = x^3 \/ 3 + C $,+  ```+  integral x^2 dif x = x^3 \/ 3 + C+  ```,+  $ nabla = bold(i) dif / (dif x) + bold(j) dif / (dif y) + bold(k) dif / (dif z) $,+  ```+  nabla = bold(i) dif / (dif x) + bold(j) dif / (dif y) + bold(k) dif / (dif z)+  ```,+))++= Discrete mathematics examples+For modulo, there is a symbol $ident$ from `ident` and a text operator $mod$ from `mod`.++For combinations the binomial symbol $binom(n, k)$ is from `binom(n, k)`.+This resizes to be bigger in a display.++For permutations use $n^(underline(r))$ from `n^(underline(r))` (some authors use $P(n, r)$, or $""_n P_r$ from `""_n P_r`).++= Statistics examples+#align(center, table(+  align: horizon,+  columns: 2,+  block($sigma^2 = sqrt(sum(x_i - mu)^2 \/ N)$),+  ```+  sigma^2 = sqrt(sum(x_i - mu)^2 \/ N)+  ```,+  block($E(X) = mu_X = sum(x_i - P(x_i))$),+  ```+  E(X) = mu_X = sum(x_i - P(x_i))+  ```,+))++The probability density of the normal distribution++$ 1 / sqrt(2 sigma^2 pi) e^(- (x - mu)^2 / (2 sigma^2)) $++comes from this.++#grid(+  "",+  ```+  1 / sqrt(2 sigma^2 pi)+    e^(- (x - mu)^2 / (2 sigma^2))+  ```+)++= For more+See also the Typst Documentation at #link("https://typst.app/docs").++#v(1fr)++#block(+  line(length: 100%, stroke: headcolor) ++  text(headcolor)[johanvx (https://github.com/johanvx) #h(1fr) #date]+)
test/writer.asciidoc view
@@ -1,6 +1,7 @@ = Pandoc Test Suite John MacFarlane; Anonymous July 17, 2006+:stem: latexmath  This is a set of tests for pandoc. Most of them are adapted from John Gruber’s markdown test suite.@@ -423,9 +424,9 @@  So is *_this_* word. -This is code: `>`, `$`, `\`, `\$`, `<html>`.+This is code: `+>+`, `+$+`, `+\+`, `+\$+`, `+<html>+`. -[line-through]*This is _strikeout_.*+[line-through]#This is _strikeout_.#  Superscripts: a^bc^d a^_hello_^ a^hello there^. @@ -438,16 +439,16 @@  == Smart quotes, ellipses, dashes -``Hello,'' said the spider. ```Shelob' is my name.''+"`Hello,`" said the spider. "`'`Shelob`' is my name.`" -`A', `B', and `C' are letters.+'`A`', '`B`', and '`C`' are letters. -`Oak,' `elm,' and `beech' are names of trees. So is `pine.'+'`Oak,`' '`elm,`' and '`beech`' are names of trees. So is '`pine.`' -`He said, ``I want to go.''' Were you alive in the 70’s?+'`He said, "`I want to go.`"`' Were you alive in the 70’s? -Here is some quoted ``code`' and a ``http://example.com/?foo=1&bar=2[quoted-link]''.+Here is some quoted '``+code+``' and a "`http://example.com/?foo=1&bar=2[quoted+link]`".  Some dashes: one—two — three—four — five. @@ -460,27 +461,27 @@ == LaTeX  * -* latexmath:[$2+2=4$]-* latexmath:[$x \in y$]-* latexmath:[$\alpha \wedge \omega$]-* latexmath:[$223$]-* latexmath:[$p$]-Tree+* latexmath:[2+2=4]+* latexmath:[x \in y]+* latexmath:[\alpha \wedge \omega]+* latexmath:[223]+* latexmath:[p]-Tree * Here’s some display math: + [latexmath] ++++-\[\frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}\]+\frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h} ++++ * Here’s one that has a line break in it:-latexmath:[$\alpha + \omega \times x^2$].+latexmath:[\alpha + \omega \times x^2].  These shouldn’t be math: -* To get the famous equation, write `$e = mc^2$`.-* $22,000 is a _lot_ of money. So is $34,000. (It worked if ``lot'' is+* To get the famous equation, write `+$e = mc^2$+`.+* $22,000 is a _lot_ of money. So is $34,000. (It worked if "`lot`" is emphasized.) * Shoes ($20) and socks ($5).-* Escaped `$`: $73 _this should be emphasized_ 23$.+* Escaped `+$+`: $73 _this should be emphasized_ 23$.  Here’s a LaTeX table: @@ -610,7 +611,7 @@ Blockquoted: http://example.com/ ____ -Auto-links should not occur here: `<http://example.com/>`+Auto-links should not occur here: `+<http://example.com/>+`  .... or here: <http://example.com/>@@ -620,7 +621,7 @@  == Images -From ``Voyage dans la Lune'' by Georges Melies (1902):+From "`Voyage dans la Lune`" by Georges Melies (1902):  .lalune image::lalune.jpg[lalune,title="Voyage dans la Lune"]@@ -636,7 +637,7 @@ and another.[multiblock footnote omitted] This should _not_ be a footnote reference, because it contains a space.[^my note] Here is an inline note.footnote:[This is _easier_ to type. Inline notes may contain-http://google.com[links] and `]` verbatim characters, as well as [bracketed+http://google.com[links] and `+]+` verbatim characters, as well as [bracketed text].]  ____
+ test/writer.asciidoc_legacy view
@@ -0,0 +1,649 @@+= Pandoc Test Suite+John MacFarlane; Anonymous+July 17, 2006++This is a set of tests for pandoc. Most of them are adapted from John Gruber’s+markdown test suite.++'''''++== Headers++=== Level 2 with an link:/url[embedded link]++==== Level 3 with _emphasis_++===== Level 4++====== Level 5++== Level 1++=== Level 2 with _emphasis_++==== Level 3++with no blank line++=== Level 2++with no blank line++'''''++== Paragraphs++Here’s a regular paragraph.++In Markdown 1.0.0 and earlier. Version 8. This line turns into a list item.+Because a hard-wrapped line in the middle of a paragraph looked like a list+item.++Here’s one with a bullet. * criminey.++There should be a hard line break ++here.++'''''++== Block Quotes++E-mail style:++____+This is a block quote. It is pretty short.+____++____+--+Code in a block quote:++....+sub status {+    print "working";+}+....++A list:++[arabic]+. item one+. item two++Nested block quotes:++____+nested+____++____+nested+____++--+____++This should not be a block quote: 2 > 1.++And a following paragraph.++'''''++== Code Blocks++Code:++....+---- (should be four hyphens)++sub status {+    print "working";+}++this code block is indented by one tab+....++And:++....+    this code block is indented by two tabs++These should not be escaped:  \$ \\ \> \[ \{+....++'''''++== Lists++=== Unordered++Asterisks tight:++* asterisk 1+* asterisk 2+* asterisk 3++Asterisks loose:++* asterisk 1+* asterisk 2+* asterisk 3++Pluses tight:++* Plus 1+* Plus 2+* Plus 3++Pluses loose:++* Plus 1+* Plus 2+* Plus 3++Minuses tight:++* Minus 1+* Minus 2+* Minus 3++Minuses loose:++* Minus 1+* Minus 2+* Minus 3++=== Ordered++Tight:++[arabic]+. First+. Second+. Third++and:++[arabic]+. One+. Two+. Three++Loose using tabs:++[arabic]+. First+. Second+. Third++and using spaces:++[arabic]+. One+. Two+. Three++Multiple paragraphs:++[arabic]+. Item 1, graf one.+++Item 1. graf two. The quick brown fox jumped over the lazy dog’s back.+. Item 2.+. Item 3.++=== Nested++* Tab+** Tab+*** Tab++Here’s another:++[arabic]+. First+. Second:+* Fee+* Fie+* Foe+. Third++Same thing but with paragraphs:++[arabic]+. First+. Second:+* Fee+* Fie+* Foe+. Third++=== Tabs and spaces++* this is a list item indented with tabs+* this is a list item indented with spaces+** this is an example list item indented with tabs+** this is an example list item indented with spaces++=== Fancy list markers++[arabic, start=2]+. begins with 2+. and now 3+++with a continuation+[lowerroman, start=4]+.. sublist with roman numerals, starting with 4+.. more items+[upperalpha]+... a subsublist+... a subsublist++Nesting:++[upperalpha]+. Upper Alpha+[upperroman]+.. Upper Roman.+[arabic, start=6]+... Decimal start with 6+[loweralpha, start=3]+.... Lower alpha with paren++Autonumbering:++. Autonumber.+. More.+.. Nested.++Should not be a list item:++M.A. 2007++B. Williams++'''''++== Definition Lists++Tight using spaces:++apple::+  red fruit+orange::+  orange fruit+banana::+  yellow fruit++Tight using tabs:++apple::+  red fruit+orange::+  orange fruit+banana::+  yellow fruit++Loose:++apple::+  red fruit+orange::+  orange fruit+banana::+  yellow fruit++Multiple blocks with italics:++_apple_::+  red fruit+  ++  contains seeds, crisp, pleasant to taste+_orange_::+  orange fruit+  ++....+{ orange code block }+....+  ++  ____+  orange block quote+  ____++Multiple definitions, tight:++apple::+  red fruit+  ++  computer+orange::+  orange fruit+  ++  bank++Multiple definitions, loose:++apple::+  red fruit+  ++  computer+orange::+  orange fruit+  ++  bank++Blank line after term, indented marker, alternate markers:++apple::+  red fruit+  ++  computer+orange::+  orange fruit+  ++  [arabic]+  . sublist+  . sublist++== HTML Blocks++Simple block on one line:++foo++And nested without indentation:++foo++bar++Interpreted markdown in a table:++This is _emphasized_++And this is *strong*++Here’s a simple block:++foo++This should be a code block, though:++....+<div>+    foo+</div>+....++As should this:++....+<div>foo</div>+....++Now, nested:++foo++This should just be an HTML comment:++Multiline:++Code block:++....+<!-- Comment -->+....++Just plain comment, with trailing spaces on the line:++Code:++....+<hr />+....++Hr’s:++'''''++== Inline Markup++This is _emphasized_, and so _is this_.++This is *strong*, and so *is this*.++An _link:/url[emphasized link]_.++*_This is strong and em._*++So is *_this_* word.++*_This is strong and em._*++So is *_this_* word.++This is code: `>`, `$`, `\`, `\$`, `<html>`.++[line-through]#This is _strikeout_.#++Superscripts: a^bc^d a^_hello_^ a^hello there^.++Subscripts: H~2~O, H~23~O, H~many of them~O.++These should not be superscripts or subscripts, because of the unescaped spaces:+a^b c^d, a~b c~d.++'''''++== Smart quotes, ellipses, dashes++``Hello,'' said the spider. ```Shelob' is my name.''++`A', `B', and `C' are letters.++`Oak,' `elm,' and `beech' are names of trees. So is `pine.'++`He said, ``I want to go.''' Were you alive in the 70’s?++Here is some quoted ``code`' and a ``http://example.com/?foo=1&bar=2[quoted+link]''.++Some dashes: one—two — three—four — five.++Dashes between numbers: 5–7, 255–66, 1987–1999.++Ellipses…and…and….++'''''++== LaTeX++* +* latexmath:[$2+2=4$]+* latexmath:[$x \in y$]+* latexmath:[$\alpha \wedge \omega$]+* latexmath:[$223$]+* latexmath:[$p$]-Tree+* Here’s some display math:+++[latexmath]++++++\[\frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}\]++++++* Here’s one that has a line break in it:+latexmath:[$\alpha + \omega \times x^2$].++These shouldn’t be math:++* To get the famous equation, write `$e = mc^2$`.+* $22,000 is a _lot_ of money. So is $34,000. (It worked if ``lot'' is+emphasized.)+* Shoes ($20) and socks ($5).+* Escaped `$`: $73 _this should be emphasized_ 23$.++Here’s a LaTeX table:++'''''++== Special Characters++Here is some unicode:++* I hat: Î+* o umlaut: ö+* section: §+* set membership: ∈+* copyright: ©++AT&T has an ampersand in their name.++AT&T is another way to write it.++This & that.++4 < 5.++6 > 5.++Backslash: \++Backtick: `++Asterisk: *++Underscore: _++Left brace: \{++Right brace: }++Left bracket: [++Right bracket: ]++Left paren: (++Right paren: )++Greater-than: >++Hash: #++Period: .++Bang: !++Plus: +++Minus: -++'''''++== Links++=== Explicit++Just a link:/url/[URL].++link:/url/[URL and title].++link:/url/[URL and title].++link:/url/[URL and title].++link:/url/[URL and title]++link:/url/[URL and title]++link:/url/with_underscore[with_underscore]++mailto:nobody@nowhere.net[Email link]++link:[Empty].++=== Reference++Foo link:/url/[bar].++With link:/url/[embedded [brackets]].++link:/url/[b] by itself should be a link.++Indented link:/url[once].++Indented link:/url[twice].++Indented link:/url[thrice].++This should [not][] be a link.++....+[not]: /url+....++Foo link:/url/[bar].++Foo link:/url/[biz].++=== With ampersands++Here’s a http://example.com/?foo=1&bar=2[link with an ampersand in the URL].++Here’s a link with an amersand in the link text: http://att.com/[AT&T].++Here’s an link:/script?foo=1&bar=2[inline link].++Here’s an link:/script?foo=1&bar=2[inline link in pointy braces].++=== Autolinks++With an ampersand: http://example.com/?foo=1&bar=2++* In a list?+* http://example.com/+* It should.++An e-mail address: nobody@nowhere.net++____+Blockquoted: http://example.com/+____++Auto-links should not occur here: `<http://example.com/>`++....+or here: <http://example.com/>+....++'''''++== Images++From ``Voyage dans la Lune'' by Georges Melies (1902):++.lalune+image::lalune.jpg[lalune,title="Voyage dans la Lune"]++Here is a movie image:movie.jpg[movie] icon.++'''''++== Footnotes++Here is a footnote reference,footnote:[Here is the footnote. It can go anywhere+after the footnote reference. It need not be placed at the end of the document.]+and another.[multiblock footnote omitted] This should _not_ be a footnote+reference, because it contains a space.[^my note] Here is an inline+note.footnote:[This is _easier_ to type. Inline notes may contain+http://google.com[links] and `]` verbatim characters, as well as [bracketed+text].]++____+Notes can go in quotes.footnote:[In quote.]+____++[arabic]+. And in list items.footnote:[In list.]++This paragraph should not be part of the note, as it is not indented.
− test/writer.asciidoctor
@@ -1,650 +0,0 @@-= Pandoc Test Suite-John MacFarlane; Anonymous-July 17, 2006-:stem: latexmath--This is a set of tests for pandoc. Most of them are adapted from John Gruber’s-markdown test suite.--'''''--== Headers--=== Level 2 with an link:/url[embedded link]--==== Level 3 with _emphasis_--===== Level 4--====== Level 5--== Level 1--=== Level 2 with _emphasis_--==== Level 3--with no blank line--=== Level 2--with no blank line--'''''--== Paragraphs--Here’s a regular paragraph.--In Markdown 1.0.0 and earlier. Version 8. This line turns into a list item.-Because a hard-wrapped line in the middle of a paragraph looked like a list-item.--Here’s one with a bullet. * criminey.--There should be a hard line break +-here.--'''''--== Block Quotes--E-mail style:--____-This is a block quote. It is pretty short.-____--____----Code in a block quote:--....-sub status {-    print "working";-}-....--A list:--[arabic]-. item one-. item two--Nested block quotes:--____-nested-____--____-nested-____-----____--This should not be a block quote: 2 > 1.--And a following paragraph.--'''''--== Code Blocks--Code:--....----- (should be four hyphens)--sub status {-    print "working";-}--this code block is indented by one tab-....--And:--....-    this code block is indented by two tabs--These should not be escaped:  \$ \\ \> \[ \{-....--'''''--== Lists--=== Unordered--Asterisks tight:--* asterisk 1-* asterisk 2-* asterisk 3--Asterisks loose:--* asterisk 1-* asterisk 2-* asterisk 3--Pluses tight:--* Plus 1-* Plus 2-* Plus 3--Pluses loose:--* Plus 1-* Plus 2-* Plus 3--Minuses tight:--* Minus 1-* Minus 2-* Minus 3--Minuses loose:--* Minus 1-* Minus 2-* Minus 3--=== Ordered--Tight:--[arabic]-. First-. Second-. Third--and:--[arabic]-. One-. Two-. Three--Loose using tabs:--[arabic]-. First-. Second-. Third--and using spaces:--[arabic]-. One-. Two-. Three--Multiple paragraphs:--[arabic]-. Item 1, graf one.-+-Item 1. graf two. The quick brown fox jumped over the lazy dog’s back.-. Item 2.-. Item 3.--=== Nested--* Tab-** Tab-*** Tab--Here’s another:--[arabic]-. First-. Second:-* Fee-* Fie-* Foe-. Third--Same thing but with paragraphs:--[arabic]-. First-. Second:-* Fee-* Fie-* Foe-. Third--=== Tabs and spaces--* this is a list item indented with tabs-* this is a list item indented with spaces-** this is an example list item indented with tabs-** this is an example list item indented with spaces--=== Fancy list markers--[arabic, start=2]-. begins with 2-. and now 3-+-with a continuation-[lowerroman, start=4]-.. sublist with roman numerals, starting with 4-.. more items-[upperalpha]-... a subsublist-... a subsublist--Nesting:--[upperalpha]-. Upper Alpha-[upperroman]-.. Upper Roman.-[arabic, start=6]-... Decimal start with 6-[loweralpha, start=3]-.... Lower alpha with paren--Autonumbering:--. Autonumber.-. More.-.. Nested.--Should not be a list item:--M.A. 2007--B. Williams--'''''--== Definition Lists--Tight using spaces:--apple::-  red fruit-orange::-  orange fruit-banana::-  yellow fruit--Tight using tabs:--apple::-  red fruit-orange::-  orange fruit-banana::-  yellow fruit--Loose:--apple::-  red fruit-orange::-  orange fruit-banana::-  yellow fruit--Multiple blocks with italics:--_apple_::-  red fruit-  +-  contains seeds, crisp, pleasant to taste-_orange_::-  orange fruit-  +-....-{ orange code block }-....-  +-  ____-  orange block quote-  ____--Multiple definitions, tight:--apple::-  red fruit-  +-  computer-orange::-  orange fruit-  +-  bank--Multiple definitions, loose:--apple::-  red fruit-  +-  computer-orange::-  orange fruit-  +-  bank--Blank line after term, indented marker, alternate markers:--apple::-  red fruit-  +-  computer-orange::-  orange fruit-  +-  [arabic]-  . sublist-  . sublist--== HTML Blocks--Simple block on one line:--foo--And nested without indentation:--foo--bar--Interpreted markdown in a table:--This is _emphasized_--And this is *strong*--Here’s a simple block:--foo--This should be a code block, though:--....-<div>-    foo-</div>-....--As should this:--....-<div>foo</div>-....--Now, nested:--foo--This should just be an HTML comment:--Multiline:--Code block:--....-<!-- Comment -->-....--Just plain comment, with trailing spaces on the line:--Code:--....-<hr />-....--Hr’s:--'''''--== Inline Markup--This is _emphasized_, and so _is this_.--This is *strong*, and so *is this*.--An _link:/url[emphasized link]_.--*_This is strong and em._*--So is *_this_* word.--*_This is strong and em._*--So is *_this_* word.--This is code: `+>+`, `+$+`, `+\+`, `+\$+`, `+<html>+`.--[line-through]*This is _strikeout_.*--Superscripts: a^bc^d a^_hello_^ a^hello there^.--Subscripts: H~2~O, H~23~O, H~many of them~O.--These should not be superscripts or subscripts, because of the unescaped spaces:-a^b c^d, a~b c~d.--'''''--== Smart quotes, ellipses, dashes--"`Hello,`" said the spider. "`'`Shelob`' is my name.`"--'`A`', '`B`', and '`C`' are letters.--'`Oak,`' '`elm,`' and '`beech`' are names of trees. So is '`pine.`'--'`He said, "`I want to go.`"`' Were you alive in the 70’s?--Here is some quoted '``+code+``' and a "`http://example.com/?foo=1&bar=2[quoted-link]`".--Some dashes: one—two — three—four — five.--Dashes between numbers: 5–7, 255–66, 1987–1999.--Ellipses…and…and….--'''''--== LaTeX--* -* latexmath:[2+2=4]-* latexmath:[x \in y]-* latexmath:[\alpha \wedge \omega]-* latexmath:[223]-* latexmath:[p]-Tree-* Here’s some display math:-+-[latexmath]-++++-\frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}-++++-* Here’s one that has a line break in it:-latexmath:[\alpha + \omega \times x^2].--These shouldn’t be math:--* To get the famous equation, write `+$e = mc^2$+`.-* $22,000 is a _lot_ of money. So is $34,000. (It worked if "`lot`" is-emphasized.)-* Shoes ($20) and socks ($5).-* Escaped `+$+`: $73 _this should be emphasized_ 23$.--Here’s a LaTeX table:--'''''--== Special Characters--Here is some unicode:--* I hat: Î-* o umlaut: ö-* section: §-* set membership: ∈-* copyright: ©--AT&T has an ampersand in their name.--AT&T is another way to write it.--This & that.--4 < 5.--6 > 5.--Backslash: \--Backtick: `--Asterisk: *--Underscore: _--Left brace: \{--Right brace: }--Left bracket: [--Right bracket: ]--Left paren: (--Right paren: )--Greater-than: >--Hash: #--Period: .--Bang: !--Plus: +--Minus: ---'''''--== Links--=== Explicit--Just a link:/url/[URL].--link:/url/[URL and title].--link:/url/[URL and title].--link:/url/[URL and title].--link:/url/[URL and title]--link:/url/[URL and title]--link:/url/with_underscore[with_underscore]--mailto:nobody@nowhere.net[Email link]--link:[Empty].--=== Reference--Foo link:/url/[bar].--With link:/url/[embedded [brackets]].--link:/url/[b] by itself should be a link.--Indented link:/url[once].--Indented link:/url[twice].--Indented link:/url[thrice].--This should [not][] be a link.--....-[not]: /url-....--Foo link:/url/[bar].--Foo link:/url/[biz].--=== With ampersands--Here’s a http://example.com/?foo=1&bar=2[link with an ampersand in the URL].--Here’s a link with an amersand in the link text: http://att.com/[AT&T].--Here’s an link:/script?foo=1&bar=2[inline link].--Here’s an link:/script?foo=1&bar=2[inline link in pointy braces].--=== Autolinks--With an ampersand: http://example.com/?foo=1&bar=2--* In a list?-* http://example.com/-* It should.--An e-mail address: nobody@nowhere.net--____-Blockquoted: http://example.com/-____--Auto-links should not occur here: `+<http://example.com/>+`--....-or here: <http://example.com/>-....--'''''--== Images--From "`Voyage dans la Lune`" by Georges Melies (1902):--.lalune-image::lalune.jpg[lalune,title="Voyage dans la Lune"]--Here is a movie image:movie.jpg[movie] icon.--'''''--== Footnotes--Here is a footnote reference,footnote:[Here is the footnote. It can go anywhere-after the footnote reference. It need not be placed at the end of the document.]-and another.[multiblock footnote omitted] This should _not_ be a footnote-reference, because it contains a space.[^my note] Here is an inline-note.footnote:[This is _easier_ to type. Inline notes may contain-http://google.com[links] and `+]+` verbatim characters, as well as [bracketed-text].]--____-Notes can go in quotes.footnote:[In quote.]-____--[arabic]-. And in list items.footnote:[In list.]--This paragraph should not be part of the note, as it is not indented.
test/writer.typst view
@@ -737,8 +737,7 @@  == Autolinks <autolinks>-With an ampersand:-#link("http://example.com/?foo=1&bar=2")[http://example.com/?foo\=1&bar\=2]+With an ampersand: #link("http://example.com/?foo=1&bar=2")  - In a list? - #link("http://example.com/")