diff --git a/AUTHORS.md b/AUTHORS.md
--- a/AUTHORS.md
+++ b/AUTHORS.md
@@ -157,6 +157,7 @@
 - Ivar de Bruin
 - Ivo Clarysse
 - Jaap de Jong
+- James J Balamuta
 - J. B. Rainsberger
 - J. Lewis Muir
 - Jackson Schuster
@@ -190,6 +191,7 @@
 - John Luke Bentley
 - John MacFarlane
 - John Muccigrosso
+- John Purnell
 - Jonas Scholl
 - Jonas Smedegaard
 - Jonathan Daugherty
@@ -252,6 +254,7 @@
 - Michael Beaumont
 - Michael Chladek
 - Michael Hoffmann
+- Michael McClurg
 - Michael Peyton Jones
 - Michael Reed
 - Michael Snoyman
@@ -324,6 +327,7 @@
 - Sebastian Talmon
 - Sergei Trofimovich
 - Sergey Astanin
+- Seth Speaks
 - Shahbaz Youssefi
 - Shaun Attfield
 - Shim Myeongseob
@@ -334,6 +338,7 @@
 - Simon Schuster
 - Siphalor
 - Stefan Dresselhaus
+- Stephan Daus
 - Stephan Meijer
 - Stephen Altamirano
 - Sukil Etxenike
@@ -348,6 +353,7 @@
 - Thomas Hodgson
 - Thomas Weißschuh
 - Tim Lin
+- Tim Stewart
 - Tim Wisotzki
 - Timm Albers
 - Timothy Humphries
@@ -385,6 +391,7 @@
 - Yoan Blanc
 - Yuchen Pei
 - Zihang Chen
+- 3w36zj6
 - arcnmx
 - a-vrma
 - andrebauer
@@ -422,6 +429,8 @@
 - oquechy
 - pacien
 - perro tuerto
+- piq9117
+- priiduonu
 - qerub
 - quasicomputational
 - ricnorr
@@ -429,6 +438,7 @@
 - roblabla
 - rodja.trappe
 - rski
+- samuel-weinhardt
 - sdhoward
 - shreevatsa.public
 - takahashim
diff --git a/MANUAL.txt b/MANUAL.txt
--- a/MANUAL.txt
+++ b/MANUAL.txt
@@ -1,7 +1,7 @@
 ---
 title: Pandoc User's Guide
 author: John MacFarlane
-date: September 08, 2023
+date: October 27, 2023
 ---
 
 # Synopsis
@@ -227,6 +227,7 @@
     ::: {#input-formats}
     - `bibtex` ([BibTeX] bibliography)
     - `biblatex` ([BibLaTeX] bibliography)
+    - `bits` ([BITS] XML, alias for `jats`)
     - `commonmark` ([CommonMark] Markdown)
     - `commonmark_x` ([CommonMark] Markdown with extensions)
     - `creole` ([Creole 1.0])
@@ -480,6 +481,7 @@
 [Rich Text Format]: https://en.wikipedia.org/wiki/Rich_Text_Format
 [DocBook]: https://docbook.org
 [JATS]: https://jats.nlm.nih.gov
+[BITS]: https://jats.nlm.nih.gov/extensions/bits/
 [Jira]: https://jira.atlassian.com/secure/WikiRendererHelpAction.jspa?section=all
 [txt2tags]: https://txt2tags.org
 [EPUB]: http://idpf.org/epub
@@ -1755,8 +1757,8 @@
 | ```                              | ```                               |
 +----------------------------------+-----------------------------------+
 | ```                              | ``` yaml                          |
-| --filter pandoc-citeproc \       | filters:                          |
-|  --lua-filter count-words.lua \  |   - pandoc-citeproc               |
+| --citeproc \                     | filters:                          |
+|  --lua-filter count-words.lua \  |   - citeproc                      |
 |  --filter special.lua            |   - count-words.lua               |
 |                                  |   - type: json                    |
 |                                  |     path: special.lua             |
@@ -2076,7 +2078,7 @@
 
 If you need control over when the citeproc processing is done relative
 to other filters, you should instead use `citeproc` in the list
-of `filters` (see above).
+of `filters` (see [Reader options](#reader-options-1)).
 
 ## Math rendering in HTML
 
@@ -3405,6 +3407,7 @@
 ## Math Input
 
 The extensions [`tex_math_dollars`](#extension-tex_math_dollars),
+[`tex_math_gfm`](#extension-tex_math_gfm),
 [`tex_math_single_backslash`](#extension-tex_math_single_backslash), and
 [`tex_math_double_backslash`](#extension-tex_math_double_backslash)
 are described in the section about Pandoc's Markdown.
@@ -4024,8 +4027,9 @@
     | 200 Main St.
     | Berkeley, CA 94718
 
-Inline formatting (such as emphasis) is allowed in the content,
-but not block-level formatting (such as block quotes or lists).
+Inline formatting (such as emphasis) is allowed in the content
+(though it can't cross line boundaries). Block-level formatting
+(such as block quotes or lists) is not recognized.
 
 This syntax is borrowed from [reStructuredText].
 
@@ -5508,9 +5512,9 @@
     isn't indented.
 
 The identifiers in footnote references may not contain spaces, tabs,
-or newlines.  These identifiers are used only to correlate the
-footnote reference with the note itself; in the output, footnotes
-will be numbered sequentially.
+newlines, or the characters `^`, `[`, or `]`. These identifiers
+are used only to correlate the footnote reference with the note
+itself; in the output, footnotes will be numbered sequentially.
 
 The footnotes themselves need not be placed at the end of the
 document.  They may appear anywhere except inside other block elements
@@ -5764,6 +5768,19 @@
 #### Extension: `emoji` ####
 
 Parses textual emojis like `:smile:` as Unicode emoticons.
+
+#### Extension: `tex_math_gfm` ####
+
+Supports two GitHub-specific formats for math.
+Inline math: ``$`e=mc^2`$``.
+
+Display math:
+
+````
+``` math
+e=mc^2
+```
+````
 
 #### Extension: `tex_math_single_backslash` ####
 
diff --git a/README.md b/README.md
--- a/README.md
+++ b/README.md
@@ -30,6 +30,8 @@
 
 - `bibtex` ([BibTeX](https://ctan.org/pkg/bibtex) bibliography)
 - `biblatex` ([BibLaTeX](https://ctan.org/pkg/biblatex) bibliography)
+- `bits` ([BITS](https://jats.nlm.nih.gov/extensions/bits/) XML, alias
+  for `jats`)
 - `commonmark` ([CommonMark](https://commonmark.org) Markdown)
 - `commonmark_x` ([CommonMark](https://commonmark.org) Markdown with
   extensions)
diff --git a/changelog.md b/changelog.md
--- a/changelog.md
+++ b/changelog.md
@@ -1,5 +1,179 @@
 # Revision history for pandoc
 
+## pandoc 3.1.9 (2023-10-27)
+
+  * Make `reference-section-title` work with `jats+element_citations`
+    (#9021).
+
+  * Add `bits` as synonym of `jats` as input format.
+
+  * JATS reader:
+
+    + Modify JATS reader to handle BITS too (#9138, Julia Diaz).
+      Add provision for title-group, book, book-part-wrapper, book-meta,
+      book-part-meta, book-title, book-title-group, index, toc, legend,
+      title, collection-meta
+    + Fix handling of alt-text (#9130, Julia Diaz). Previously we were
+      looking for an attribute that doesn't exist in JATS; alt-text is
+      provided by a child element.
+
+  * CommonMark reader:
+
+    + Handle `Ext_tex_math_gfm` (#9121). Parse GFM-specific math
+      constructions when `tex_math_gfm` enabled.
+
+  * DokuWiki reader:
+
+    + Allow autolinks to be avoided using e.g. `https:%%//%%...` (#9153).
+    + Parse `<code>` and `<file>` as block-level code (#9154).
+      Previously we treated them as inline code in some contexts,
+      but that is not how DokuWiki works.
+
+  * LaTeX reader:
+
+    + Better handle spacing commands `\hfill`, `\vfill`, `\hskip`,
+      `\vskip`, etc. (#9150).
+    + Fix incorrect abbreviation for astronomical unit (#9125,
+      Michael McClurg).
+
+  * Markdown reader:
+
+    + Fix blindspot with superscript in links (#8981).
+      Previously `[^super^](#ref)` wasn't parsed as a link, due to
+      code that was meant to prevent footnote markers from being
+      recognized as reference links.  This commit tightens up that
+      code to avoid this bad effect. We have also added a new
+      restriction on footnote labels: they cannot contain the characters
+      `^`, `[`, or `]`. Though this is technically a breaking change, we
+      suspect that the impact will be minimal, as it's very unlikely
+      people would be using these characters in their note labels.
+    + Don't apply `--default-image-extension` to data URIs (#9118).
+    + More accurate check that a normalCite is not a link,
+      bracketed span, or reference (#9080).
+
+  * HTML reader:
+
+    + Allow th to close td and vice versa (#9090).
+    + Parse task lists using input elements (#9047, Seth Speaks).
+
+  * Creole reader:
+
+    + Handle empty cells correctly (#9141, Sascha Wilde).
+
+  * Org writer:
+
+    + Escape literal `*`, `|`, `#` at beginning of line with ZWS (#9159).
+
+  * ICML writer:
+
+    + Prevent doubled attributes (#9158).
+
+  * Powerpoint writer:
+
+    + Fix a corruption error caused when the document used both a
+      regular png and a png in a data URI (#9113). (Similarly for any
+      other image format.) The problem was that duplicate entries in
+      `[Content Types].xml` were being created, one for the mime type
+      `image/png`, one for `image/png;base64`.
+
+  * LaTeX writer:
+
+    + Fix rowspans in tables so they use the width of
+      the column (`=` as the width parameter) (#9140).
+    + Don't treat table as "simple" if they have col widths.
+      This should help fix a problem wherein some grid tables with
+      colspans were overly wide (#9140).
+    + Fix uneven indents in line block output (#9088).
+
+  * JATS writer: fix 3.1.4 regression in handling block-level metadata
+    (#9092).
+
+  * Ms writer: improvements in image handling (#4475).
+
+    + PDFPIC is now used for PDF images in figures.
+    + Inline images that are postscript or PDF are rendered using
+      PSPIC or PDFPIC. This isn't ideal, because they will still be
+      rendered as if in a separate paragraph, but it's probably
+      better than just printing the image name.
+    + Units are included in height.
+
+  * HTML writer:
+
+    + If raw format is an HTML side deck format, emit it (James J Balamuta).
+
+  * Typst writer:
+
+    + Add `#box` around image to make it inline. (#9104)
+      An `#image` by itself in typst is a block-level element.
+      To force images to be inline (as they are in pandoc), we need
+      to add a box with an explicit width. When a width is not given
+      in image attributes, we compute one from the image itself, when
+      possible.
+    + Don't allow long heading to wrap (#9132).
+    + Escape `(` (#9137). If unescaped `(` occurs in
+      certain contexts, it can be parsed as function application.
+
+  * Man writer:
+
+    + Fix some spacing issues around links (#9120).
+      We need to use `\c` before a `.UR` or `.MT`, to avoid
+      an extra space, and also after.  To ensure that a space
+      at the beginning of the following line doesn't get swallowed
+      up, we escape it with `\`.
+    + Use UR, MT macros for URLs, emails (#9120).
+
+  * Text.Pandoc.Extensions:
+
+    + Add `Ext_tex_math_gfm` constructor to Extension (#9121).
+      [API change]. This handles two GitHub-specific syntaxes for math.
+      This is now default for `gfm`, in addition to `tex_math_dollars`.
+    + Remove duplicates for `Ext_raw_html` and `Ext_pipe_tables`
+      in some of the lists (Tim Stewart).
+
+  * Text.Pandoc.Metadata: Add helpful message on some metadata
+    YAML errors (#9155).
+
+  * Text.Pandoc.Shared:
+
+    + `splitSentences`: don't split after initials.
+      This improves the man and ms writer output, preventing
+      sentence breaks after initials.
+    + Add `addPandocAttributes` function [API change].
+      This is meant to simplify addition of attributes to Pandoc
+      elements: for elements that don't have a slot for attributes, an
+      enclosing Div or Span is added to hold the attributes.
+
+  * MANUAL.txt:
+
+    + Clarify that formatting can't cross line boundaries
+      in line blocks (#9119).
+    + Fix legacy option for citation (#8737, 3w36zj6)
+
+  * Update `et` translations (priiduonu).
+
+  * Updated `no` translations (Stephan Daus).
+    Renamed no.yaml (macrolanguage Norwegian) to nb.yaml (Norwegian Bokmål).
+    Created soft symbolic link from no.yaml pointing to nb.yaml.
+
+  * Lua subsystem: Use the newest LPeg version (lpeg-1.1.*) (#9107,
+    Albert Krewinkel).
+
+  * Default `epub.css`: Apply style to h6, format styles, and
+    combine identical styles under shared selectors (samuel-weinhardt).
+
+  * Update nix flake with dependencies (piq9117).
+
+  * LaTeX template: fix `\CSLBlock` vertical space (John Purnell).
+
+  * Allow tasty 1.5 and Diff 0.5.
+
+  * Require commonmark-extensions 0.2.4, commonmark 0.2.4.
+
+  * Require texmath 0.12.8.4. This should improve math in
+    powerpoint, fixing empty boxes around roots in some cases.
+
+  * Require typst 0.3.2.1
+
 ## pandoc 3.1.8 (2023-09-08)
 
   * JATS reader:
@@ -13,9 +187,9 @@
     + Fix regression with CSL `display="block"` (#7363).
       This restores the line break before the block.
     + Rewrite `CSLReferences` environment to avoid depending on
-	  `enumitem`, which plays badly with beamer.  Instead we use
-	  a regular list environment. Thanks to @jpcirrus for the
-	  concept (#9053).
+      `enumitem`, which plays badly with beamer.  Instead we use
+      a regular list environment. Thanks to @jpcirrus for the
+      concept (#9053).
     + Restore the pre-3.1.7 format of the `CSLReferences`
       environment, which again has two parameters. The first
       determines whether a hanging indent is used (1 = yes, 0 = no),
diff --git a/data/epub.css b/data/epub.css
--- a/data/epub.css
+++ b/data/epub.css
@@ -2,14 +2,13 @@
 @page {
   margin: 10px;
 }
-html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, embed, figure, figcaption, footer, header, hgroup, menu, nav, output, ruby, section, summary, time, mark, audio, video {
-  margin: 0;
-  padding: 0;
-  border: 0;
-  font-size: 100%;
-  vertical-align: baseline;
-}
-ol, ul, li, dl, dt, dd {
+html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p,
+blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, img,
+ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center,
+fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td,
+article, aside, canvas, details, embed, figure, figcaption, footer, header,
+hgroup, menu, nav, output, ruby, section, summary, time, mark, audio, video, ol,
+ul, li, dl, dt, dd {
   margin: 0;
   padding: 0;
   border: 0;
@@ -28,60 +27,42 @@
   widows: 2;
   orphans: 2;
 }
-a {
-  color: #1a1a1a;
-}
-a:visited {
+a, a:visited {
   color: #1a1a1a;
 }
 img {
   max-width: 100%;
 }
 h1 {
-  text-indent: 0;
-  text-align: left;
   margin: 3em 0 0 0;
   font-size: 2em;
-  font-weight: bold;
   page-break-before: always;
   line-height: 150%;
 }
 h2 {
-  text-indent: 0;
-  text-align: left;
   margin: 1.5em 0 0 0;
   font-size: 1.5em;
-  font-weight: bold;
   line-height: 135%;
 }
 h3 {
-  text-indent: 0;
-  text-align: left;
   margin: 1.3em 0 0 0;
   font-size: 1.3em;
-  font-weight: bold;
 }
 h4 {
-  text-indent: 0;
-  text-align: left;
   margin: 1.2em 0 0 0;
   font-size: 1.2em;
-  font-weight: bold;
 }
 h5 {
-  text-indent: 0;
-  text-align: left;
   margin: 1.1em 0 0 0;
   font-size: 1.1em;
-  font-weight: bold;
 }
-h5 {
-  text-indent: 0;
-  text-align: left;
+h6 {
   font-size: 1em;
-  font-weight: bold;
 }
 h1, h2, h3, h4, h5, h6 {
+  text-indent: 0;
+  text-align: left;
+  font-weight: bold;
   page-break-after: avoid;
   page-break-inside: avoid;
 }
@@ -111,8 +92,8 @@
   overflow-wrap: normal;
 }
 .sourceCode {
- background-color: transparent;
- overflow: visible;
+  background-color: transparent;
+  overflow: visible;
 }
 hr {
   background-color: #1a1a1a;
@@ -135,12 +116,11 @@
   border-top: 1px solid #1a1a1a;
   border-bottom: 1px solid #1a1a1a;
 }
-th {
-  border-top: 1px solid #1a1a1a;
+th, td {
   padding: 0.25em 0.5em 0.25em 0.5em;
 }
-td {
-  padding: 0.125em 0.5em 0.25em 0.5em;
+th {
+  border-top: 1px solid #1a1a1a;
 }
 header {
   margin-bottom: 4em;
@@ -158,40 +138,73 @@
 #TOC a:not(:hover) {
   text-decoration: none;
 }
-code{white-space: pre-wrap;}
-span.smallcaps{font-variant: small-caps;}
+code {
+  white-space: pre-wrap;
+}
+span.smallcaps {
+  font-variant: small-caps;
+}
 
 /* This is the most compatible CSS, but it only allows two columns: */
-div.column{ display: inline-block; vertical-align: top; width: 50%; }
-/* If you can rely on CSS3 support, use this instead:
-div.columns{display: flex; gap: min(4vw, 1.5em);}
-div.column{flex: auto; overflow-x: auto;}
-*/
+div.column {
+  display: inline-block;
+  vertical-align: top;
+  width: 50%;
+}
+/* If you can rely on CSS3 support, use this instead: */
+/* div.columns {
+  display: flex;
+  gap: min(4vw, 1.5em);
+}
+div.column {
+  flex: auto;
+  overflow-x: auto;
+} */
 
-div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;}
-ul.task-list{list-style: none;}
+div.hanging-indent {
+  margin-left: 1.5em;
+  text-indent: -1.5em;
+}
+ul.task-list {
+  list-style: none;
+}
 ul.task-list li input[type="checkbox"] {
   width: 0.8em;
   margin: 0 0.8em 0.2em -1.6em;
   vertical-align: middle;
 }
-.display.math{
+.display.math {
   display: block;
   text-align: center;
   margin: 0.5rem auto;
 }
+
 /* For title, author, and date on the cover page */
 h1.title { }
 p.author { }
 p.date { }
-nav#toc ol,
-nav#landmarks ol { padding: 0; margin-left: 1em; }
-nav#toc ol li,
-nav#landmarks ol li { list-style-type: none; margin: 0; padding: 0; }
-a.footnote-ref { vertical-align: super; }
-em, em em em, em em em em em { font-style: italic;}
-em em, em em em em { font-style: normal; }
-q { quotes: "“" "”" "‘" "’"; }
+
+nav#toc ol, nav#landmarks ol {
+  padding: 0;
+  margin-left: 1em;
+}
+nav#toc ol li, nav#landmarks ol li {
+  list-style-type: none;
+  margin: 0;
+  padding: 0;
+}
+a.footnote-ref {
+  vertical-align: super;
+}
+em, em em em, em em em em em {
+  font-style: italic;
+}
+em em, em em em em {
+  font-style: normal;
+}
+q {
+  quotes: "“" "”" "‘" "’";
+}
 @media screen { /* Workaround for iBooks issue; see #6242 */
   .sourceCode {
     overflow: visible !important;
diff --git a/data/templates/default.latex b/data/templates/default.latex
--- a/data/templates/default.latex
+++ b/data/templates/default.latex
@@ -364,7 +364,7 @@
   \setlength{\itemsep}{#2\baselineskip}}}
  {\end{list}}
 \usepackage{calc}
-\newcommand{\CSLBlock}[1]{\hfill\break#1\hfill\break}
+\newcommand{\CSLBlock}[1]{\hfill\break\parbox[t]{\linewidth}{\strut\ignorespaces#1\strut}}
 \newcommand{\CSLLeftMargin}[1]{\parbox[t]{\csllabelwidth}{\strut#1\strut}}
 \newcommand{\CSLRightInline}[1]{\parbox[t]{\linewidth - \csllabelwidth}{\strut#1\strut}}
 \newcommand{\CSLIndent}[1]{\hspace{\cslhangindent}#1}
diff --git a/data/translations/et.yaml b/data/translations/et.yaml
--- a/data/translations/et.yaml
+++ b/data/translations/et.yaml
@@ -6,8 +6,9 @@
 Contents: Sisukord
 Encl: Lisa(d)
 Figure: Joonis
-Glossary: Glossary
+Glossary: Sõnastik
 Index: Indeks
+Listing: Kood
 ListOfFigures: Joonised
 ListOfTables: Tabelid
 Page: Lk.
@@ -18,3 +19,4 @@
 See: vt.
 SeeAlso: vt. ka
 Table: Tabel
+To: Saaja
diff --git a/data/translations/nb.yaml b/data/translations/nb.yaml
new file mode 100644
--- /dev/null
+++ b/data/translations/nb.yaml
@@ -0,0 +1,21 @@
+Abstract: Sammendrag
+Appendix: Tillegg
+Bibliography: Bibliografi
+Cc: Kopi sendt
+Chapter: Kapittel
+Contents: Innhold
+Encl: Vedlegg
+Figure: Figur
+Glossary: Ordliste
+Index: Register
+ListOfFigures: Figurer
+ListOfTables: Tabeller
+Page: Side
+Part: Del
+Preface: Forord
+Proof: Bevis
+References: Referanser
+See: Se
+SeeAlso: Se også
+Table: Tabell
+To: Til
diff --git a/man/pandoc.1 b/man/pandoc.1
--- a/man/pandoc.1
+++ b/man/pandoc.1
@@ -1,6 +1,6 @@
 .\" Automatically generated by Pandoc 3.1.7
 .\"
-.TH "pandoc" "1" "September 08, 2023" "pandoc 3.1.8" "Pandoc User\[cq]s Guide"
+.TH "pandoc" "1" "October 27, 2023" "pandoc 3.1.9" "Pandoc User\[cq]s Guide"
 .SH NAME
 pandoc - general markup converter
 .SH SYNOPSIS
@@ -204,6 +204,8 @@
 .IP \[bu] 2
 \f[CR]biblatex\f[R] (BibLaTeX bibliography)
 .IP \[bu] 2
+\f[CR]bits\f[R] (BITS XML, alias for \f[CR]jats\f[R])
+.IP \[bu] 2
 \f[CR]commonmark\f[R] (CommonMark Markdown)
 .IP \[bu] 2
 \f[CR]commonmark_x\f[R] (CommonMark Markdown with extensions)
@@ -1808,8 +1810,8 @@
 
  --file-scope                      file-scope: true              
 
- --filter pandoc-citeproc \[rs]        filters:                      
-                                     - pandoc-citeproc           
+ --citeproc \[rs]                      filters:                      
+                                     - citeproc                  
    --lua-filter count-words.lua \[rs]        - count-words.lua           
   --filter special.lua               - type: json                
                                        path: special.lua         
@@ -2017,7 +2019,7 @@
 .PP
 If you need control over when the citeproc processing is done relative
 to other filters, you should instead use \f[CR]citeproc\f[R] in the list
-of \f[CR]filters\f[R] (see above).
+of \f[CR]filters\f[R] (see Reader options).
 .SS Math rendering in HTML
 .RS -14n
 .IP
@@ -3356,7 +3358,7 @@
 and \f[CR]_\f[R] are removed.
 Emojis are replaced by their names.
 .SS Math Input
-The extensions \f[CR]tex_math_dollars\f[R],
+The extensions \f[CR]tex_math_dollars\f[R], \f[CR]tex_math_gfm\f[R],
 \f[CR]tex_math_single_backslash\f[R], and
 \f[CR]tex_math_double_backslash\f[R] are described in the section about
 Pandoc\[cq]s Markdown.
@@ -4003,8 +4005,10 @@
 | Berkeley, CA 94718
 .EE
 .PP
-Inline formatting (such as emphasis) is allowed in the content, but not
-block-level formatting (such as block quotes or lists).
+Inline formatting (such as emphasis) is allowed in the content (though
+it can\[cq]t cross line boundaries).
+Block-level formatting (such as block quotes or lists) is not
+recognized.
 .PP
 This syntax is borrowed from reStructuredText.
 .SS Lists
@@ -5636,8 +5640,9 @@
 isn\[aq]t indented.
 .EE
 .PP
-The identifiers in footnote references may not contain spaces, tabs, or
-newlines.
+The identifiers in footnote references may not contain spaces, tabs,
+newlines, or the characters \f[CR]\[ha]\f[R], \f[CR][\f[R], or
+\f[CR]]\f[R].
 These identifiers are used only to correlate the footnote reference with
 the note itself; in the output, footnotes will be numbered sequentially.
 .PP
@@ -5902,6 +5907,17 @@
 that include a mix of East Asian wide characters and other characters.
 .SS Extension: \f[CR]emoji\f[R]
 Parses textual emojis like \f[CR]:smile:\f[R] as Unicode emoticons.
+.SS Extension: \f[CR]tex_math_gfm\f[R]
+Supports two GitHub-specific formats for math.
+Inline math: \f[CR]$\[ga]e=mc\[ha]2\[ga]$\f[R].
+.PP
+Display math:
+.IP
+.EX
+\[ga]\[ga]\[ga] math
+e=mc\[ha]2
+\[ga]\[ga]\[ga]
+.EE
 .SS Extension: \f[CR]tex_math_single_backslash\f[R]
 Causes anything between \f[CR]\[rs](\f[R] and \f[CR]\[rs])\f[R] to be
 interpreted as inline TeX math, and anything between \f[CR]\[rs][\f[R]
diff --git a/pandoc.cabal b/pandoc.cabal
--- a/pandoc.cabal
+++ b/pandoc.cabal
@@ -1,6 +1,6 @@
 cabal-version:   2.4
 name:            pandoc
-version:         3.1.8
+version:         3.1.9
 build-type:      Simple
 license:         GPL-2.0-or-later
 license-file:    COPYING.md
@@ -474,8 +474,8 @@
                  bytestring            >= 0.9      && < 0.13,
                  case-insensitive      >= 1.2      && < 1.3,
                  citeproc              >= 0.8.1    && < 0.9,
-                 commonmark            >= 0.2.3    && < 0.3,
-                 commonmark-extensions >= 0.2.3.5  && < 0.3,
+                 commonmark            >= 0.2.4    && < 0.3,
+                 commonmark-extensions >= 0.2.4    && < 0.3,
                  commonmark-pandoc     >= 0.2.1.3  && < 0.3,
                  containers            >= 0.6.0.1  && < 0.7,
                  crypton-connection    >= 0.3.1    && < 0.4,
@@ -514,7 +514,7 @@
                  syb                   >= 0.1      && < 0.8,
                  tagsoup               >= 0.14.6   && < 0.15,
                  temporary             >= 1.1      && < 1.4,
-                 texmath               >= 0.12.8.2 && < 0.13,
+                 texmath               >= 0.12.8.4 && < 0.13,
                  text                  >= 1.1.1.0  && < 2.2,
                  text-conversions      >= 0.3      && < 0.4,
                  time                  >= 1.5      && < 1.14,
@@ -524,7 +524,7 @@
                  zip-archive           >= 0.4.3    && < 0.5,
                  zlib                  >= 0.5      && < 0.7,
                  xml                   >= 1.3.12   && < 1.4,
-                 typst                 >= 0.3.2.0  && < 0.3.3,
+                 typst                 >= 0.3.2.1  && < 0.3.3,
                  vector                >= 0.12     && < 0.14
 
   if !os(windows)
@@ -751,7 +751,7 @@
   main-is:        test-pandoc.hs
   hs-source-dirs: test
   build-depends:  pandoc,
-                  Diff              >= 0.2     && < 0.5,
+                  Diff              >= 0.2     && < 0.6,
                   Glob              >= 0.7     && < 0.11,
                   bytestring        >= 0.9     && < 0.13,
                   containers        >= 0.4.2.1 && < 0.7,
@@ -761,7 +761,7 @@
                   mtl               >= 2.2     && < 2.4,
                   pandoc-types      >= 1.23.1  && < 1.24,
                   process           >= 1.2.3   && < 1.7,
-                  tasty             >= 0.11    && < 1.5,
+                  tasty             >= 0.11    && < 1.6,
                   tasty-golden      >= 2.3     && < 2.4,
                   tasty-hunit       >= 0.9     && < 0.11,
                   tasty-quickcheck  >= 0.8     && < 0.11,
diff --git a/src/Text/Pandoc/Extensions.hs b/src/Text/Pandoc/Extensions.hs
--- a/src/Text/Pandoc/Extensions.hs
+++ b/src/Text/Pandoc/Extensions.hs
@@ -133,6 +133,7 @@
     | Ext_task_lists          -- ^ Parse certain list items as task list items
     | Ext_table_captions      -- ^ Pandoc-style table captions
     | Ext_tex_math_dollars    -- ^ TeX math between $..$ or $$..$$
+    | Ext_tex_math_gfm        -- ^ Additional TeX math style used in GFM
     | Ext_tex_math_double_backslash  -- ^ TeX math btw \\(..\\) \\[..\\]
     | Ext_tex_math_single_backslash  -- ^ TeX math btw \(..\) \[..\]
     | Ext_wikilinks_title_after_pipe -- ^ Support wikilinks of style
@@ -398,6 +399,7 @@
   , Ext_yaml_metadata_block
   , Ext_footnotes
   , Ext_tex_math_dollars
+  , Ext_tex_math_gfm
   ]
 getDefaultExtensions "commonmark"      = extensionsFromList
                                           [Ext_raw_html]
@@ -408,8 +410,6 @@
   , Ext_strikeout
   , Ext_task_lists
   , Ext_emoji
-  , Ext_pipe_tables
-  , Ext_raw_html
   , Ext_smart
   , Ext_tex_math_dollars
   , Ext_superscript
@@ -553,6 +553,7 @@
     , Ext_hard_line_breaks
     , Ext_smart
     , Ext_tex_math_dollars
+    , Ext_tex_math_gfm
     , Ext_superscript
     , Ext_subscript
     , Ext_definition_lists
diff --git a/src/Text/Pandoc/PDF.hs b/src/Text/Pandoc/PDF.hs
--- a/src/Text/Pandoc/PDF.hs
+++ b/src/Text/Pandoc/PDF.hs
@@ -108,6 +108,7 @@
               Nothing -> []
       let args   = ["-ms", "-mpdfmark", "-mspdf",
                     "-e", "-t", "-k", "-KUTF-8", "-i"] ++
+                   ["-U" | ".PDFPIC" `T.isInfixOf` source] ++
                     paperargs ++ pdfargs
       generic2pdf program args source
     baseProg -> do
diff --git a/src/Text/Pandoc/Readers.hs b/src/Text/Pandoc/Readers.hs
--- a/src/Text/Pandoc/Readers.hs
+++ b/src/Text/Pandoc/Readers.hs
@@ -140,6 +140,7 @@
           ,("org"          , TextReader readOrg)
           ,("textile"      , TextReader readTextile) -- TODO : textile+lhs
           ,("html"         , TextReader readHtml)
+          ,("bits"         , TextReader readJATS)
           ,("jats"         , TextReader readJATS)
           ,("jira"         , TextReader readJira)
           ,("latex"        , TextReader readLaTeX)
diff --git a/src/Text/Pandoc/Readers/CommonMark.hs b/src/Text/Pandoc/Readers/CommonMark.hs
--- a/src/Text/Pandoc/Readers/CommonMark.hs
+++ b/src/Text/Pandoc/Readers/CommonMark.hs
@@ -100,6 +100,9 @@
   (if isEnabled Ext_implicit_figures opts
       then walk makeFigures
       else id) .
+  (if isEnabled Ext_tex_math_gfm opts
+      then walk handleGfmMath
+      else id) .
   (if readerStripComments opts
       then walk stripBlockComments . walk stripInlineComments
       else id) <$>
@@ -110,6 +113,21 @@
      else case runIdentity (parseCommonmarkWith (specFor opts) toks) of
             Left err -> throwError $ fromParsecError s err
             Right (Cm bls :: Cm () Blocks) -> return $ B.doc bls
+
+handleGfmMath :: Block -> Block
+handleGfmMath (CodeBlock ("",["math"],[]) raw) = Para [Math DisplayMath raw]
+handleGfmMath x = walk handleGfmMathInline x
+
+handleGfmMathInline :: Inline -> Inline
+handleGfmMathInline (Math InlineMath math') =
+  let (ticks, rest) = T.span (== '`') math'
+  in  if T.null ticks
+         then Math InlineMath math'
+         else case T.stripSuffix ticks rest of
+                Just middle | not (T.null middle) && (T.last middle /= '`')
+                             -> Math InlineMath middle
+                _ -> Math InlineMath math'
+handleGfmMathInline x = x
 
 stripBlockComments :: Block -> Block
 stripBlockComments (RawBlock (B.Format "html") s) =
diff --git a/src/Text/Pandoc/Readers/Creole.hs b/src/Text/Pandoc/Readers/Creole.hs
--- a/src/Text/Pandoc/Readers/Creole.hs
+++ b/src/Text/Pandoc/Readers/Creole.hs
@@ -149,7 +149,7 @@
                  <$> (string "|=" >> many1Till inline cellEnd)
     row = try $ skipSpaces >> many1Till cell rowEnd
     cell = B.plain . B.trimInlines . mconcat
-           <$> (char '|' >> many1Till inline cellEnd)
+           <$> (char '|' >> manyTill inline cellEnd)
     rowEnd = try $ optional (char '|') >> skipSpaces >> newline
     cellEnd = lookAhead $ try $ char '|' <|> rowEnd
 
diff --git a/src/Text/Pandoc/Readers/DokuWiki.hs b/src/Text/Pandoc/Readers/DokuWiki.hs
--- a/src/Text/Pandoc/Readers/DokuWiki.hs
+++ b/src/Text/Pandoc/Readers/DokuWiki.hs
@@ -105,8 +105,6 @@
       <|> superscript
       <|> deleted
       <|> footnote
-      <|> inlineCode
-      <|> inlineFile
       <|> inlineRaw
       <|> math
       <|> autoLink
@@ -193,12 +191,6 @@
 footnote :: PandocMonad m => DWParser m B.Inlines
 footnote = try $ B.note . B.para <$> between (string "((") (try $ string "))") nestedInlines
 
-inlineCode :: PandocMonad m => DWParser m B.Inlines
-inlineCode = codeTag B.codeWith "code"
-
-inlineFile :: PandocMonad m => DWParser m B.Inlines
-inlineFile = codeTag B.codeWith "file"
-
 inlineRaw :: PandocMonad m => DWParser m B.Inlines
 inlineRaw = try $ do
   char '<'
@@ -230,6 +222,7 @@
   state <- getState
   guard $ stateAllowLinks state
   (text, url) <- uri
+  guard $ not $ T.isInfixOf "%%//%%" text  -- see #9153
   guard $ checkLink (T.last url)
   return $ makeLink (text, url)
   where
@@ -247,7 +240,7 @@
 str = B.str <$> (many1Char alphaNum <|> characterReference)
 
 symbol :: PandocMonad m => DWParser m B.Inlines
-symbol = B.str <$> countChar 1 nonspaceChar
+symbol = B.str <$> (notFollowedBy' blockCode *> countChar 1 nonspaceChar)
 
 link :: PandocMonad m => DWParser m B.Inlines
 link = try $ do
@@ -414,7 +407,6 @@
             <|> indentedCode
             <|> quote
             <|> blockCode
-            <|> blockFile
             <|> blockRaw
             <|> table
 
@@ -448,8 +440,10 @@
   many1 ((<>) <$> item <*> fmap mconcat (many continuation))
   where
     continuation = try $ list ("  " <> prefix)
-    item = try $ textStr prefix *> char marker *> char ' ' *> itemContents
-    itemContents = B.plain . mconcat <$> many1Till inline' eol
+    item = try $ textStr prefix *> char marker *> char ' ' *>
+                   (mconcat <$> many1 itemContents <* eol)
+    itemContents = (B.plain . mconcat <$> many1 inline') <|>
+                   blockCode
 
 indentedCode :: PandocMonad m => DWParser m B.Blocks
 indentedCode = try $ B.codeBlock . T.unlines <$> many1 indentedLine
@@ -533,10 +527,8 @@
 
 
 blockCode :: PandocMonad m => DWParser m B.Blocks
-blockCode = codeTag B.codeBlockWith "code"
-
-blockFile :: PandocMonad m => DWParser m B.Blocks
-blockFile = codeTag B.codeBlockWith "file"
+blockCode = codeTag B.codeBlockWith "code" <|>
+            codeTag B.codeBlockWith "file"
 
 para :: PandocMonad m => DWParser m B.Blocks
 para = result . mconcat <$> many1Till inline endOfParaElement
@@ -544,7 +536,8 @@
    endOfParaElement = lookAhead $ endOfInput <|> endOfPara <|> newBlockElement
    endOfInput       = try $ skipMany blankline >> skipSpaces >> eof
    endOfPara        = try $ blankline >> skipMany1 blankline
-   newBlockElement  = try $ blankline >> void blockElements
+   newBlockElement  = try (blankline >> void blockElements)
+                       <|> lookAhead (void blockCode)
    result content   = if F.all (==Space) content
                       then mempty
                       else B.para $ B.trimInlines content
diff --git a/src/Text/Pandoc/Readers/HTML.hs b/src/Text/Pandoc/Readers/HTML.hs
--- a/src/Text/Pandoc/Readers/HTML.hs
+++ b/src/Text/Pandoc/Readers/HTML.hs
@@ -129,6 +129,10 @@
 setInPlain :: PandocMonad m => HTMLParser m s a -> HTMLParser m s a
 setInPlain = local (\s -> s {inPlain = True})
 
+-- Some items should be handled differently when in a list item tag, e.g. checkbox
+setInListItem :: PandocMonad m => HTMLParser m s a -> HTMLParser m s a
+setInListItem = local (\s -> s {inListItem = True})
+
 pHtml :: PandocMonad m => TagParser m Blocks
 pHtml = do
   (TagOpen "html" attr) <- lookAhead pAny
@@ -334,7 +338,7 @@
   return $ B.bulletList $ map (fixPlains True) items
 
 pListItem :: PandocMonad m => TagParser m Blocks
-pListItem = do
+pListItem = setInListItem $ do
   TagOpen _ attr' <- lookAhead $ pSatisfy (matchTagOpen "li" [])
   let attr = toStringAttr attr'
   let addId ident bs = case B.toList bs of
@@ -344,6 +348,16 @@
   maybe id addId (lookup "id" attr) <$>
     pInTags "li" block
 
+pCheckbox :: PandocMonad m => TagParser m Inlines
+pCheckbox = do
+  TagOpen _ attr' <- pSatisfy $ matchTagOpen "input" [("type","checkbox")]
+  TagClose _ <- pSatisfy (matchTagClose "input")
+  let attr = toStringAttr attr'
+  let isChecked = isJust $ lookup "checked" attr
+  let escapeSequence = B.str $ if isChecked then "\9746" else "\9744"
+  return $ escapeSequence <> B.space
+
+
 -- | Parses a list item just like 'pListItem', but allows sublists outside of
 -- @li@ tags to be treated as items.
 pListItem' :: PandocMonad m => TagParser m a -> TagParser m Blocks
@@ -673,6 +687,9 @@
         "var" -> pCodeWithClass "var" "variable"
         "span" -> pSpan
         "math" -> pMath False
+        "input"
+          | lookup "type" attr == Just "checkbox"
+          -> asks inListItem >>= guard >> pCheckbox
         "script"
           | Just x <- lookup "type" attr
           , "math/tex" `T.isPrefixOf` x -> pScriptMath
diff --git a/src/Text/Pandoc/Readers/HTML/Parsing.hs b/src/Text/Pandoc/Readers/HTML/Parsing.hs
--- a/src/Text/Pandoc/Readers/HTML/Parsing.hs
+++ b/src/Text/Pandoc/Readers/HTML/Parsing.hs
@@ -104,6 +104,8 @@
   t <- lookAhead $ pSatisfy $ \tag -> isTagClose tag || isTagOpen tag
   case t of
        (TagClose t') | t' == tagtype -> void pAny
+       (TagClose "th") | tagtype == "td" -> void pAny -- see #9090
+       (TagClose "td") | tagtype == "th" -> void pAny
        (TagOpen t' _) | t' `closes` tagtype -> return ()
        (TagClose "ul") | tagtype == "li" -> return ()
        (TagClose "ol") | tagtype == "li" -> return ()
diff --git a/src/Text/Pandoc/Readers/HTML/Types.hs b/src/Text/Pandoc/Readers/HTML/Types.hs
--- a/src/Text/Pandoc/Readers/HTML/Types.hs
+++ b/src/Text/Pandoc/Readers/HTML/Types.hs
@@ -60,6 +60,7 @@
   { quoteContext :: QuoteContext
   , inChapter    :: Bool -- ^ Set if in chapter section
   , inPlain      :: Bool -- ^ Set if in pPlain
+  , inListItem   :: Bool -- ^ Set if in <li> tag
   }
 
 
@@ -91,7 +92,7 @@
   deleteMeta s st = st {parserState = deleteMeta s $ parserState st}
 
 instance Default HTMLLocal where
-  def = HTMLLocal NoQuote False False
+  def = HTMLLocal NoQuote False False False
 
 instance HasLastStrPosition HTMLState where
   setLastStrPos s st = st {parserState = setLastStrPos s (parserState st)}
diff --git a/src/Text/Pandoc/Readers/JATS.hs b/src/Text/Pandoc/Readers/JATS.hs
--- a/src/Text/Pandoc/Readers/JATS.hs
+++ b/src/Text/Pandoc/Readers/JATS.hs
@@ -138,18 +138,16 @@
 
 -- function that is used by both graphic (in parseBlock)
 -- and inline-graphic (in parseInline)
-getGraphic :: PandocMonad m
-           => Maybe (Inlines, Text) -> Element -> JATS m Inlines
-getGraphic mbfigdata e = do
+getGraphic :: PandocMonad m => Element -> JATS m Inlines
+getGraphic e = do
   let atVal a = attrValue a e
-      (ident, title, capt) =
-         case mbfigdata of
-           Just (capt', i) -> (i, "fig:" <> atVal "title", capt')
-           Nothing        -> (atVal "id", atVal "title",
-                              text (atVal "alt-text"))
+  let altText = case filterElement (named "alt-text") e of
+         Just alt -> textContent alt
+         Nothing -> mempty
+      (ident, title, altText') = (atVal "id", atVal "title", text altText)
       attr = (ident, T.words $ atVal "role", [])
       imageUrl = atVal "href"
-  return $ imageWith attr imageUrl title capt
+  return $ imageWith attr imageUrl title altText'
 
 getBlocks :: PandocMonad m => Element -> JATS m Blocks
 getBlocks e =  mconcat <$>
@@ -167,6 +165,8 @@
   let parseBlockWithHeader = wrapWithHeader (sectionLevel+1) (getBlocks e)
 
   case qName (elName e) of
+        "book" -> parseBook
+        "book-part-wrapper" -> parseBook
         "p" -> parseMixed para (elContent e)
         "code" -> codeBlockWithLang
         "preformat" -> codeBlockWithLang
@@ -198,11 +198,12 @@
         "table-wrap-foot" -> parseBlockWithHeader
         "trans-abstract" -> parseBlockWithHeader
         "verse-group" -> parseBlockWithHeader
-        "graphic" -> para <$> getGraphic Nothing e
+        "graphic" -> para <$> getGraphic e
         "journal-meta" -> parseMetadata e
         "article-meta" -> parseMetadata e
         "custom-meta" -> parseMetadata e
         "processing-meta" -> return mempty
+        "book-meta" -> parseMetadata e
         "title" -> return mempty -- processed by header
         "label" -> return mempty -- processed by header
         "table" -> parseTable
@@ -225,6 +226,19 @@
                             then blockFormula displayMath e
                             else divWith (attrValue "id" e, ["disp-formula"], [])
                                     <$> getBlocks e
+        "index" -> parseBlockWithHeader
+        "index-div" -> parseBlockWithHeader
+        "index-group" -> parseBlockWithHeader
+        "index-title-group" -> return mempty -- handled by index and index-div
+        "toc" -> parseBlockWithHeader
+        "toc-div" -> parseBlockWithHeader
+        "toc-entry" -> parseBlockWithHeader
+        "toc-group" -> parseBlockWithHeader
+        "toc-title-group" -> return mempty -- handled by toc
+        "legend" -> parseBlockWithHeader
+        "dedication" -> parseBlockWithHeader
+        "foreword" -> parseBlockWithHeader
+        "preface" -> parseBlockWithHeader
         "?xml"  -> return mempty
         _       -> getBlocks e
    where parseMixed container conts = do
@@ -370,19 +384,35 @@
          parseElement = filterChildren isEntry
          wrapWithHeader n mBlocks = do
                       isBook <- gets jatsBook
-                      let n' = if isBook || n == 0 then n + 1 else n
+                      let n' = case (filterChild (named "title") e >>= maybeAttrValue "display-as") of
+                                  Just t -> read $ T.unpack t
+                                  Nothing -> if isBook || n == 0 then n + 1 else n
                       headerText <- case filterChild (named "title") e of
-                                        Just t  -> getInlines t
-                                        Nothing -> return mempty
+                                       Just t  -> case maybeAttrValue "supress" t of
+                                                     Just s -> if s == "no"
+                                                                 then getInlines t
+                                                                 else return mempty
+                                                     Nothing -> getInlines t
+                                       Nothing -> do
+                                           let name = qName (elName e)
+                                           if (name == "dedication" || name == "foreword" || name == "preface")
+                                             then return $ str $ T.toTitle name
+                                             else case filterChild (named "index-title-group") e >>= filterChild (named "title") of
+                                                     Just i -> getInlines i
+                                                     Nothing -> case filterChild (named "toc-title-group") e >>= filterChild (named "title") of
+                                                                   Just t -> getInlines t
+                                                                   Nothing -> return mempty
                       oldN <- gets jatsSectionLevel
                       modify $ \st -> st{ jatsSectionLevel = n }
                       blocks <- mBlocks
                       let ident = attrValue "id" e
                       modify $ \st -> st{ jatsSectionLevel = oldN }
-                      return $ (if
-                        headerText == mempty
-                      then mempty
-                      else headerWith (ident,[],[]) n' headerText) <> blocks
+                      return $ (if headerText == mempty
+                                  then mempty
+                                  else headerWith (ident,[],[]) n' headerText) <> blocks
+         parseBook = do
+           modify $ \st -> st{ jatsBook = True }
+           getBlocks e
 
 getInlines :: PandocMonad m => Element -> JATS m Inlines
 getInlines e' = trimInlines . mconcat <$>
@@ -390,16 +420,17 @@
 
 parseMetadata :: PandocMonad m => Element -> JATS m Blocks
 parseMetadata e = do
-  getTitle e
-  getAuthors e
+  isBook <- gets jatsBook
+  if isBook then getBookTitle e else getArticleTitle e
+  if isBook then getBookAuthors e else getArticleAuthors e
   getAffiliations e
   getAbstract e
   getPubDate e
   getPermissions e
   return mempty
 
-getTitle :: PandocMonad m => Element -> JATS m ()
-getTitle e = do
+getArticleTitle :: PandocMonad m => Element -> JATS m ()
+getArticleTitle e = do
   tit <-  case filterElement (named "article-title") e of
                Just s  -> getInlines s
                Nothing -> return mempty
@@ -410,8 +441,21 @@
   when (tit /= mempty) $ addMeta "title" tit
   when (subtit /= mempty) $ addMeta "subtitle" subtit
 
-getAuthors :: PandocMonad m => Element -> JATS m ()
-getAuthors e = do
+
+getBookTitle :: PandocMonad m => Element -> JATS m ()
+getBookTitle e = do
+  tit <-  case (filterElement (named "book-title-group") e >>= filterElement (named "book-title")) of
+               Just s  -> getInlines s
+               Nothing -> return mempty
+  subtit <-  case (filterElement (named "book-title-group") e >>= filterElement (named "subtitle")) of
+               Just s  -> (text ": " <>) <$>
+                           getInlines s
+               Nothing -> return mempty
+  when (tit /= mempty) $ addMeta "title" tit
+  when (subtit /= mempty) $ addMeta "subtitle" subtit
+
+getArticleAuthors :: PandocMonad m => Element -> JATS m ()
+getArticleAuthors e = do
   authors <- mapM getContrib $ filterElements
               (\x -> named "contrib" x &&
                      attrValue "contrib-type" x == "author") e
@@ -422,6 +466,18 @@
                    (a:as, ns) -> reverse as ++ [a <> mconcat ns]
   unless (null authors) $ addMeta "author" authors'
 
+getBookAuthors :: PandocMonad m => Element -> JATS m ()
+getBookAuthors e = do
+  authors <- mapM getContrib $ filterElements (\x -> named "contrib-group" x) e
+              >>= filterElements (\x -> named "contrib" x &&
+                     attrValue "contrib-type" x == "author")
+  authorNotes <- mapM getInlines $ filterElements (named "author-notes") e
+  let authors' = case (reverse authors, authorNotes) of
+                   ([], _)    -> []
+                   (_, [])    -> authors
+                   (a:as, ns) -> reverse as ++ [a <> mconcat ns]
+  unless (null authors) $ addMeta "author" authors'
+
 getAffiliations :: PandocMonad m => Element -> JATS m ()
 getAffiliations x = do
   affs <- mapM getInlines $ filterChildren (named "aff") x
@@ -622,7 +678,7 @@
         "code" -> codeWithLang
         "monospace" -> codeWithLang
 
-        "inline-graphic" -> getGraphic Nothing e
+        "inline-graphic" -> getGraphic e
         "disp-quote" -> do
             qt <- gets jatsQuoteType
             let qt' = if qt == SingleQuote then DoubleQuote else SingleQuote
diff --git a/src/Text/Pandoc/Readers/LaTeX/Parsing.hs b/src/Text/Pandoc/Readers/LaTeX/Parsing.hs
--- a/src/Text/Pandoc/Readers/LaTeX/Parsing.hs
+++ b/src/Text/Pandoc/Readers/LaTeX/Parsing.hs
@@ -983,6 +983,18 @@
              void (manyTill anyTok braced) <|>
                 void (satisfyTok isPreTok) -- see #7531
            _ | isFontSizeCommand name -> return ()
+             | name `elem` ["hfil", "hfill", "vfil", "vfill",
+                            "hfilneg", "vfilneg"] -> return ()
+             | name `elem` ["hskip", "vskip", "mskip"] -> do
+                 dimenarg
+                 skipMany $ try $ do
+                   sp
+                   satisfyTok $
+                     \case
+                       Tok _ Word "plus" -> True
+                       Tok _ Word "minus" -> True
+                       _ -> False
+                   dimenarg
              | otherwise -> do
                skipopts
                option "" (try dimenarg)
diff --git a/src/Text/Pandoc/Readers/LaTeX/SIunitx.hs b/src/Text/Pandoc/Readers/LaTeX/SIunitx.hs
--- a/src/Text/Pandoc/Readers/LaTeX/SIunitx.hs
+++ b/src/Text/Pandoc/Readers/LaTeX/SIunitx.hs
@@ -409,7 +409,7 @@
   , ("arcmin", str "′")
   , ("arcminute", str "′")
   , ("arcsecond", str "″")
-  , ("astronomicalunit", str "ua")
+  , ("astronomicalunit", str "au")
   , ("atomicmassunit", str "u")
   , ("bar", str "bar")
   , ("barn", str "b")
diff --git a/src/Text/Pandoc/Readers/Markdown.hs b/src/Text/Pandoc/Readers/Markdown.hs
--- a/src/Text/Pandoc/Readers/Markdown.hs
+++ b/src/Text/Pandoc/Readers/Markdown.hs
@@ -142,12 +142,6 @@
 setextHChars :: [Char]
 setextHChars = "=-"
 
-isBlank :: Char -> Bool
-isBlank ' '  = True
-isBlank '\t' = True
-isBlank '\n' = True
-isBlank _    = False
-
 --
 -- auxiliary functions
 --
@@ -416,7 +410,9 @@
     return $ return mempty
 
 noteMarker :: PandocMonad m => MarkdownParser m Text
-noteMarker = string "[^" >> many1TillChar (satisfy $ not . isBlank) (char ']')
+noteMarker = string "[^" >>
+  many1TillChar (satisfy (`notElem` ['\r','\n','\t',' ','^','[',']']))
+                (char ']')
 
 rawLine :: PandocMonad m => MarkdownParser m Text
 rawLine = try $ do
@@ -1815,7 +1811,7 @@
 -- a reference label for a link
 reference :: PandocMonad m => MarkdownParser m (F Inlines, Text)
 reference = do
-  guardDisabled Ext_footnotes <|> notFollowedBy' (string "[^")
+  guardDisabled Ext_footnotes <|> notFollowedBy' noteMarker
   withRaw $ trimInlinesF <$> inlinesInBalancedBrackets
 
 parenthesizedChars :: PandocMonad m => MarkdownParser m Text
@@ -2020,11 +2016,13 @@
   wikilink B.imageWith <|>
     do (lab,raw) <- reference
        defaultExt <- getOption readerDefaultImageExtension
-       let constructor attr' src =
-              case takeExtension (T.unpack src) of
-                 "" -> B.imageWith attr' (T.pack $ addExtension (T.unpack src)
-                                                 $ T.unpack defaultExt)
-                 _  -> B.imageWith attr' src
+       let constructor attr' src
+             | "data:" `T.isPrefixOf` src = B.imageWith attr' src  -- see #9118
+             | otherwise =
+                case takeExtension (T.unpack src) of
+                   "" -> B.imageWith attr' (T.pack $ addExtension (T.unpack src)
+                                                   $ T.unpack defaultExt)
+                   _  -> B.imageWith attr' src
        regLink constructor lab <|> referenceLink constructor (lab, "!" <> raw)
 
 note :: PandocMonad m => MarkdownParser m (F Inlines)
@@ -2256,7 +2254,10 @@
   citations <- citeList
   spnl
   char ']'
-  notFollowedBy (oneOf "{([")  -- not a link or a bracketed span
+  -- not a link or a bracketed span
+  notFollowedBy (try (void source) <|>
+                  (guardEnabled Ext_bracketed_spans *> void attributes) <|>
+                  void reference)
   return citations
 
 suffix :: PandocMonad m => MarkdownParser m (F Inlines)
diff --git a/src/Text/Pandoc/Readers/Metadata.hs b/src/Text/Pandoc/Readers/Metadata.hs
--- a/src/Text/Pandoc/Readers/Metadata.hs
+++ b/src/Text/Pandoc/Readers/Metadata.hs
@@ -31,7 +31,6 @@
 import Text.Pandoc.Definition
 import Text.Pandoc.Error
 import Text.Pandoc.Parsing hiding (tableWith, parse)
-
 import qualified Text.Pandoc.UTF8 as UTF8
 
 yamlBsToMeta :: (PandocMonad m, HasLastStrPosition st)
@@ -45,8 +44,12 @@
        Right [Null] -> return . return $ mempty
        Right _  -> Prelude.fail "expected YAML object"
        Left err' -> do
-         throwError $ PandocParseError
-                    $ T.pack $ Yaml.prettyPrintParseException err'
+         let msg = T.pack $ Yaml.prettyPrintParseException err'
+         throwError $ PandocParseError $
+           if "did not find expected key" `T.isInfixOf` msg
+              then msg <>
+                   "\nConsider enclosing the entire field in 'single quotes'"
+              else msg
 
 -- Returns filtered list of references.
 yamlBsToRefs :: (PandocMonad m, HasLastStrPosition st)
@@ -69,9 +72,8 @@
                  mapM (yamlToMetaValue pMetaValue) (filter hasSelectedId refs)
            _ -> return $ return []
        Right _ -> return . return $ []
-       Left err' -> do
-         throwError $ PandocParseError
-                    $ T.pack $ Yaml.prettyPrintParseException err'
+       Left err' -> throwError $ PandocParseError
+                               $ T.pack $ Yaml.prettyPrintParseException err'
 
 normalizeMetaValue :: (PandocMonad m, HasLastStrPosition st)
                    => ParsecT Sources st m (Future st MetaValue)
diff --git a/src/Text/Pandoc/Shared.hs b/src/Text/Pandoc/Shared.hs
--- a/src/Text/Pandoc/Shared.hs
+++ b/src/Text/Pandoc/Shared.hs
@@ -38,6 +38,7 @@
                      -- * Date/time
                      normalizeDate,
                      -- * Pandoc block and inline list processing
+                     addPandocAttributes,
                      orderedListMarkers,
                      extractSpaces,
                      removeFormatting,
@@ -113,6 +114,9 @@
 import Text.Pandoc.Generic (bottomUp)
 import Text.DocLayout (charWidth)
 import Text.Pandoc.Walk
+-- for addPandocAttributes:
+import Commonmark.Pandoc (Cm(..))
+import Commonmark (HasAttributes(..))
 
 --
 -- List processing
@@ -287,6 +291,14 @@
 --
 -- Pandoc block and inline list processing
 --
+
+-- | Add key-value attributes to a pandoc element. If the element
+-- does not have a slot for attributes, create an enclosing Span
+-- (for Inlines) or Div (for Blocks).  Note that both 'Cm () Inlines'
+-- and 'Cm () Blocks' are instances of 'HasAttributes'.
+addPandocAttributes
+  :: forall b . HasAttributes (Cm () b) => [(T.Text, T.Text)] -> b -> b
+addPandocAttributes kvs bs = unCm . addAttributes kvs $ (Cm bs :: Cm () b)
 
 -- | Generate infinite lazy list of markers for an ordered list,
 -- depending on list attributes.
diff --git a/src/Text/Pandoc/Writers/HTML.hs b/src/Text/Pandoc/Writers/HTML.hs
--- a/src/Text/Pandoc/Writers/HTML.hs
+++ b/src/Text/Pandoc/Writers/HTML.hs
@@ -1731,11 +1731,20 @@
   [ "onclick", "ondblclick", "onmousedown", "onmouseup", "onmouseover"
   , "onmouseout", "onmouseout", "onkeypress", "onkeydown", "onkeyup"]
 
+
+-- | Check to see if Format is valid HTML
 isRawHtml :: PandocMonad m => Format -> StateT WriterState m Bool
 isRawHtml f = do
   html5 <- gets stHtml5
   return $ f == Format "html" ||
-           ((html5 && f == Format "html5") || f == Format "html4")
+           ((html5 && f == Format "html5") || f == Format "html4") ||
+           isSlideVariant f
+
+-- | Check to see if Format matches with an HTML slide variant
+isSlideVariant :: Format -> Bool
+isSlideVariant f = f `elem` [Format "s5", Format "slidy", Format "slideous",
+                             Format "dzslides", Format "revealjs"]
+
 
 -- We need to remove links from link text, because an <a> element is
 -- not allowed inside another <a> element.
diff --git a/src/Text/Pandoc/Writers/ICML.hs b/src/Text/Pandoc/Writers/ICML.hs
--- a/src/Text/Pandoc/Writers/ICML.hs
+++ b/src/Text/Pandoc/Writers/ICML.hs
@@ -157,9 +157,13 @@
        Just tpl -> renderTemplate tpl context
 
 -- | Auxiliary functions for parStylesToDoc and charStylesToDoc.
-contains :: Text -> (Text, (Text, Text)) -> [(Text, Text)]
-contains s rule =
-  [snd rule | fst rule `Text.isInfixOf` s]
+contains :: Text -> (Text, (Text, Text)) -> [(Text, Text)] -> [(Text, Text)]
+contains s (t, (k,v)) attrs =
+  if t `Text.isInfixOf` s
+     then case lookup k attrs of -- avoid duplicates, #9158
+            Nothing -> (k, v) : attrs
+            Just _ -> attrs
+     else attrs
 
 -- | The monospaced font to use as default.
 monospacedFont :: Doc Text
@@ -183,7 +187,7 @@
   where
     makeStyle s =
       let countSubStrs sub str = length $ Text.breakOnAll sub str
-          attrs = concatMap (contains s) [
+          attrs = foldr (contains s) [] [
                                (defListTermName, ("BulletsAndNumberingListType", "BulletList"))
                              , (defListTermName, ("FontStyle", "Bold"))
                              , (tableHeaderName, ("FontStyle", "Bold"))
@@ -248,7 +252,7 @@
 charStylesToDoc st = vcat $ map makeStyle $ Set.toAscList $ inlineStyles st
   where
     makeStyle s =
-      let attrs = concatMap (contains s) [
+      let attrs = foldr (contains s) [] [
                                (strikeoutName,   ("StrikeThru", "true"))
                              , (superscriptName, ("Position", "Superscript"))
                              , (subscriptName,   ("Position", "Subscript"))
diff --git a/src/Text/Pandoc/Writers/JATS.hs b/src/Text/Pandoc/Writers/JATS.hs
--- a/src/Text/Pandoc/Writers/JATS.hs
+++ b/src/Text/Pandoc/Writers/JATS.hs
@@ -124,7 +124,7 @@
                     then Just $ writerColumns opts
                     else Nothing
   metadata <- metaToContext opts
-                 (blocksToJATS opts)
+                 (blocksToJATS opts . makeSections False (Just startLvl))
                  (fmap chomp . inlinesToJATS opts)
                  meta
   main <- blocksToJATS opts bodyblocks
@@ -292,7 +292,13 @@
   refs <- asks jatsReferences
   contents <- if null refs
               then blocksToJATS opts xs
-              else referencesToJATS opts refs
+              else do
+                titleElement <- case xs of
+                  (Header _ _ title:_) ->
+                    inTagsSimple "title" <$> inlinesToJATS opts title
+                  _ -> return mempty
+                elementRefs <- referencesToJATS opts refs
+                return $ titleElement $$ elementRefs
   return $ inTagsIndented "ref-list" contents
 blockToJATS opts (Div (ident,[cls],kvs) bs) | cls `elem` ["fig", "caption", "table-wrap"] = do
   contents <- blocksToJATS opts bs
diff --git a/src/Text/Pandoc/Writers/LaTeX.hs b/src/Text/Pandoc/Writers/LaTeX.hs
--- a/src/Text/Pandoc/Writers/LaTeX.hs
+++ b/src/Text/Pandoc/Writers/LaTeX.hs
@@ -744,16 +744,13 @@
 inlineListToLaTeX lst = hcat <$>
   mapM inlineToLaTeX (fixLineInitialSpaces . fixInitialLineBreaks $ lst)
     -- nonbreaking spaces (~) in LaTeX don't work after line breaks,
-    -- so we turn nbsps after hard breaks to \hspace commands.
-    -- this is mostly used in verse.
+    -- so we insert a strut: this is mostly used in verse.
  where fixLineInitialSpaces [] = []
        fixLineInitialSpaces (LineBreak : Str s : xs)
          | Just ('\160', _) <- T.uncons s
-         = LineBreak : fixNbsps s <> fixLineInitialSpaces xs
+         = LineBreak : RawInline "latex" "\\strut " : Str s
+            : fixLineInitialSpaces xs
        fixLineInitialSpaces (x:xs) = x : fixLineInitialSpaces xs
-       fixNbsps s = let (ys,zs) = T.span (=='\160') s
-                    in  replicate (T.length ys) hspace <> [Str zs]
-       hspace = RawInline "latex" "\\hspace*{0.333em}"
        -- We need \hfill\break for a line break at the start
        -- of a paragraph. See #5591.
        fixInitialLineBreaks (LineBreak:xs) =
diff --git a/src/Text/Pandoc/Writers/LaTeX/Table.hs b/src/Text/Pandoc/Writers/LaTeX/Table.hs
--- a/src/Text/Pandoc/Writers/LaTeX/Table.hs
+++ b/src/Text/Pandoc/Writers/LaTeX/Table.hs
@@ -47,11 +47,13 @@
 tableToLaTeX inlnsToLaTeX blksToLaTeX tbl = do
   let (Ann.Table (ident, _, _) caption specs thead tbodies tfoot) = tbl
   CaptionDocs capt captNotes <- captionToLaTeX inlnsToLaTeX caption ident
-  let isSimpleTable = all (all isSimpleCell) $ mconcat
-                      [ headRows thead
-                      , concatMap bodyRows tbodies
-                      , footRows tfoot
-                      ]
+  let isSimpleTable =
+        all ((== ColWidthDefault) . snd) specs &&
+        all (all isSimpleCell)
+          (mconcat [ headRows thead
+                   , concatMap bodyRows tbodies
+                   , footRows tfoot
+                   ])
   let removeNote (Note _) = Span ("", [], []) []
       removeNote x        = x
   let colCount = ColumnCount $ length specs
@@ -111,12 +113,14 @@
 isSimpleCell :: Ann.Cell -> Bool
 isSimpleCell (Ann.Cell _ _ (Cell _attr _align _rowspan _colspan blocks)) =
   case blocks of
-    [Para _]  -> True
-    [Plain _] -> True
+    [Para _]  -> not (hasLineBreak blocks)
+    [Plain _] -> not (hasLineBreak blocks)
     []        -> True
     _         -> False
-
-
+  where
+    hasLineBreak = getAny . query isLineBreak
+    isLineBreak LineBreak = Any True
+    isLineBreak _         = Any False
 
 -- | Total number of columns in a table.
 newtype ColumnCount = ColumnCount Int
@@ -354,7 +358,8 @@
                        (RowSpan 1) -> x
                        (RowSpan n) -> let nrows = literal (tshow n)
                                       in "\\multirow" <> braces nrows
-                                         <> braces "*" <> braces x
+                                         <> braces "=" -- width of column
+                                         <> braces x
   return . inMultiColumn . inMultiRow $ result
 
 -- | Returns the width of a cell spanning @n@ columns.
diff --git a/src/Text/Pandoc/Writers/Man.hs b/src/Text/Pandoc/Writers/Man.hs
--- a/src/Text/Pandoc/Writers/Man.hs
+++ b/src/Text/Pandoc/Writers/Man.hs
@@ -311,18 +311,22 @@
       return empty
 inlineToMan _ LineBreak = return $
   cr <> literal ".PD 0" $$ literal ".P" $$ literal ".PD" <> cr
-inlineToMan _ SoftBreak = return space
-inlineToMan _ Space = return space
+inlineToMan _ SoftBreak = return $ afterBreak "\\" <> space
+inlineToMan _ Space = return $ afterBreak "\\" <> space
 inlineToMan opts (Link _ txt (src, _))
   | not (isURI src) = inlineListToMan opts txt -- skip relative links
   | otherwise       = do
-  linktext <- inlineListToMan opts txt
   let srcSuffix = fromMaybe src (T.stripPrefix "mailto:" src)
-  return $ case txt of
-           [Str s]
-             | escapeURI s == srcSuffix ->
-                                 char '<' <> literal srcSuffix <> char '>'
-           _                  -> linktext <> literal " (" <> literal src <> char ')'
+  linktext <- case txt of
+                [Str s] | escapeURI s == srcSuffix -> pure mempty
+                _ -> inlineListToMan opts txt
+  let (start, end) = if "mailto:" `T.isPrefixOf` src
+                        then (".MT", ".ME")
+                        else (".UR", ".UE")
+  return $ "\\c" <> cr -- \c avoids extra space
+        $$ (start <+> literal srcSuffix)
+        $$ linktext
+        $$ (end <+> "\\c" <> cr)  -- \c avoids space after
 inlineToMan opts (Image attr alternate (source, tit)) = do
   let txt = if null alternate || (alternate == [Str ""]) ||
                (alternate == [Str source]) -- to prevent autolinks
diff --git a/src/Text/Pandoc/Writers/Ms.hs b/src/Text/Pandoc/Writers/Ms.hs
--- a/src/Text/Pandoc/Writers/Ms.hs
+++ b/src/Text/Pandoc/Writers/Ms.hs
@@ -302,24 +302,17 @@
   return (vcat contents)
 blockToMs opts (Figure figattr (Caption _ caption) body) =
   case body of
-    [Plain [ Image attr _alt (src, _tit) ]]
-     | let ext = takeExtension (T.unpack src)
-        in (ext == ".ps" || ext == ".eps")
-      -> do
-         let (mbW,mbH) = (inPoints opts <$> dimension Width attr,
-                          inPoints opts <$> dimension Height attr)
-         let sizeAttrs = case (mbW, mbH) of
-                              (Just wp, Nothing) -> space <> doubleQuotes
-                                     (literal (tshow (floor wp :: Int) <> "p"))
-                              (Just wp, Just hp) -> space <> doubleQuotes
-                                     (literal (tshow (floor wp :: Int) <> "p"))
-                                     <> space <>
-                                     doubleQuotes
-                                      (literal (tshow (floor hp :: Int)))
-                              _ -> empty
-         capt <- blockToMs opts (Div figattr caption)
-         let captlines = height capt
-         return $ nowrap (literal ".PSPIC " <>
+    [Plain [ Image attr _alt (src, _tit) ]] -> do
+       let ext = takeExtension (T.unpack src)
+       let sizeAttrs = getSizeAttrs opts attr
+       capt <- blockToMs opts (Div figattr caption)
+       let captlines = height capt
+       let cmd = case ext of
+                   ".ps" -> ".PSPIC"
+                   ".eps" -> ".PSPIC"
+                   ".pdf" -> ".PDFPIC"
+                   _ -> "\\\" .IMAGE"
+       return $ nowrap (literal cmd <+>
                     doubleQuotes (literal (escapeStr opts src)) <>
                     sizeAttrs) $$
                   literal (".ce " <> tshow captlines) $$
@@ -497,10 +490,20 @@
        doubleQuotes (literal (escapeUri src)) <> literal " -A " <>
        doubleQuotes (literal "\\c") <> space <> literal "\\") <> cr <>
        literal " -- " <> doubleQuotes (nowrap contents) <> cr <> literal "\\&"
-inlineToMs opts (Image _ alternate (_, _)) =
-  return $ char '[' <> literal "IMAGE: " <>
-           literal (escapeStr opts (stringify alternate))
-             <> char ']'
+inlineToMs opts (Image attr alternate (src, _)) = do
+  let desc = literal "[IMAGE: " <>
+             literal (escapeStr opts (stringify alternate)) <> char ']'
+  let sizeAttrs = getSizeAttrs opts attr
+  let ext = takeExtension (T.unpack src)
+  let cmd = case ext of
+             ".ps" -> ".PSPIC"
+             ".eps" -> ".PSPIC"
+             ".pdf" -> ".PDFPIC"
+             _ -> ""
+  return $ cr <> nowrap
+    (if T.null cmd
+        then desc <> " \\\" " <> doubleQuotes (literal src) <> sizeAttrs
+        else literal cmd <+> doubleQuotes (literal src) <> sizeAttrs) <> cr
 inlineToMs _ (Note contents) = do
   modify $ \st -> st{ stNotes = contents : stNotes st }
   return $ literal "\\**"
@@ -638,3 +641,18 @@
               Nothing -> "_u" <> tshow (ord c) <> "_"
               Just '/' -> "_u" <> tshow (ord c) <> "_" -- see #4515
               Just c' -> T.singleton c')
+
+getSizeAttrs :: WriterOptions -> Attr -> Doc Text
+getSizeAttrs opts attr =
+  case (mbW, mbH) of
+     (Just wp, Nothing) -> space <> doubleQuotes
+            (literal (tshow (floor wp :: Int) <> "p"))
+     (Just wp, Just hp) -> space <> doubleQuotes
+            (literal (tshow (floor wp :: Int) <> "p"))
+            <> space <>
+            doubleQuotes
+             (literal (tshow (floor hp :: Int) <> "p"))
+     _ -> empty
+ where
+  mbW = inPoints opts <$> dimension Width attr
+  mbH = inPoints opts <$> dimension Height attr
diff --git a/src/Text/Pandoc/Writers/Org.hs b/src/Text/Pandoc/Writers/Org.hs
--- a/src/Text/Pandoc/Writers/Org.hs
+++ b/src/Text/Pandoc/Writers/Org.hs
@@ -90,16 +90,19 @@
   return $ hang (length marker) (text marker) contents
 
 -- | Escape special characters for Org.
-escapeString :: Text -> Text
+escapeString :: Text -> Doc Text
 escapeString t
-  | T.all (\c -> c < '\x2013' || c > '\x2026') t = t
-  | otherwise = T.concatMap escChar t
+  | T.all isAlphaNum t = literal t
+  | otherwise = mconcat $ map escChar (T.unpack t)
   where
    escChar '\x2013' = "--"
    escChar '\x2014' = "---"
    escChar '\x2019' = "'"
    escChar '\x2026' = "..."
-   escChar c        = T.singleton c
+   escChar c
+     -- escape special chars with ZERO WIDTH SPACE as org manual suggests
+     | c == '*' || c == '#' || c == '|' = afterBreak "\x200B" <> char c
+     | otherwise = char c
 
 isRawFormat :: Format -> Bool
 isRawFormat f =
@@ -489,7 +492,7 @@
        return $ "[cite" <> sty <> ":" <> citeItems <> "]"
      else inlineListToOrg lst
 inlineToOrg (Code _ str) = return $ "=" <> literal str <> "="
-inlineToOrg (Str str) = return . literal $ escapeString str
+inlineToOrg (Str str) = return $ escapeString str
 inlineToOrg (Math t str) = do
   modify $ \st -> st{ stHasMath = True }
   return $ if t == InlineMath
diff --git a/src/Text/Pandoc/Writers/Powerpoint/Output.hs b/src/Text/Pandoc/Writers/Powerpoint/Output.hs
--- a/src/Text/Pandoc/Writers/Powerpoint/Output.hs
+++ b/src/Text/Pandoc/Writers/Powerpoint/Output.hs
@@ -923,7 +923,12 @@
   let mediaInfo = MediaInfo { mInfoFilePath = fp
                             , mInfoLocalId = maxLocalId + 1
                             , mInfoGlobalId = newGlobalId
-                            , mInfoMimeType = mbMt
+                            , mInfoMimeType =
+                                case mbMt of
+                                  -- see #9113
+                                  Just t | ";base64" `T.isSuffixOf` t
+                                     -> T.stripSuffix ";base64" t
+                                  x -> x
                             , mInfoExt = imgExt
                             , mInfoCaption = (not . null) caption
                             }
diff --git a/src/Text/Pandoc/Writers/Shared.hs b/src/Text/Pandoc/Writers/Shared.hs
--- a/src/Text/Pandoc/Writers/Shared.hs
+++ b/src/Text/Pandoc/Writers/Shared.hs
@@ -50,7 +50,7 @@
 import qualified Data.ByteString.Lazy as BL
 import Control.Monad (zipWithM)
 import Data.Aeson (ToJSON (..), encode)
-import Data.Char (chr, ord, isSpace, isLetter)
+import Data.Char (chr, ord, isSpace, isLetter, isUpper)
 import Data.List (groupBy, intersperse, transpose, foldl')
 import Data.List.NonEmpty (NonEmpty(..), nonEmpty)
 import Data.Text.Conversions (FromText(..))
@@ -552,10 +552,10 @@
 splitSentences = go . toList
  where
   go [] = mempty
-  go (Text len t : BreakingSpace : xs) =
-     if isSentenceEnding t
-        then Text len t <> NewLine <> go xs
-        else Text len t <> BreakingSpace <> go xs
+  go (Text len t : AfterBreak _ : BreakingSpace : xs)
+    | isSentenceEnding t = Text len t <> NewLine <> go xs
+  go (Text len t : BreakingSpace : xs)
+    | isSentenceEnding t = Text len t <> NewLine <> go xs
   go (x:xs) = x <> go xs
 
   toList (Concat (Concat a b) c) = toList (Concat a (Concat b c))
@@ -565,12 +565,16 @@
   isSentenceEnding t =
     case T.unsnoc t of
       Just (t',c)
-        | c == '.' || c == '!' || c == '?' -> True
+        | c == '.' || c == '!' || c == '?'
+        , not (isInitial t') -> True
         | c == ')' || c == ']' || c == '"' || c == '\x201D' ->
            case T.unsnoc t' of
-             Just (_,d) -> d == '.' || d == '!' || d == '?'
+             Just (t'',d) -> d == '.' || d == '!' || d == '?' &&
+                             not (isInitial t'')
              _ -> False
       _ -> False
+   where
+    isInitial x = T.length x == 1 && T.all isUpper x
 
 -- | Ensure that all identifiers start with a letter,
 -- and modify internal links accordingly. (Yes, XML allows an
diff --git a/src/Text/Pandoc/Writers/Typst.hs b/src/Text/Pandoc/Writers/Typst.hs
--- a/src/Text/Pandoc/Writers/Typst.hs
+++ b/src/Text/Pandoc/Writers/Typst.hs
@@ -17,7 +17,8 @@
     writeTypst
   ) where
 import Text.Pandoc.Definition
-import Text.Pandoc.Class.PandocMonad ( PandocMonad )
+import Text.Pandoc.Class ( PandocMonad, fetchItem )
+import Text.Pandoc.ImageSize (imageSize, sizeInPoints)
 import Text.Pandoc.Options ( WriterOptions(..), WrapOption(..), isEnabled )
 import Data.Text (Text)
 import Data.List (intercalate, intersperse)
@@ -30,6 +31,7 @@
 import qualified Text.TeXMath as TM
 import Text.DocLayout
 import Text.DocTemplates (renderTemplate)
+import Control.Monad.Except (catchError)
 import Text.Pandoc.Extensions (Extension(..))
 import Text.Collate.Lang (Lang(..), parseLang)
 
@@ -98,7 +100,8 @@
         if "unlisted" `elem` cls
            then literal "#heading(outlined: false)" <> brackets contents <>
                  cr <> lab
-           else literal (T.replicate level "=") <> space <> contents <>
+           else nowrap
+                 (literal (T.replicate level "=") <> space <> contents) <>
                  cr <> lab
     RawBlock fmt str ->
       case fmt of
@@ -279,10 +282,31 @@
                    then mempty
                    else nowrap $ brackets contents
     Image (_,_,kvs) _inlines (src,_tit) -> do
-      let width' = maybe mempty ((", width: " <>) . literal) $ lookup "width" kvs
-      let height' = maybe mempty ((", height: " <>) . literal) $
-                    lookup "height" kvs
-      return $ "#image(" <> doubleQuoted src <> width' <> height' <> ")"
+      opts <- gets stOptions
+      let mbHeight = lookup "height" kvs
+      let mdWidth = lookup "width" kvs
+      let coreImage = "image" <>
+              parens (doubleQuoted src <>
+                 maybe mempty (\w -> ", width: " <> literal w) mdWidth <>
+                 maybe mempty (\h -> ", height: " <> literal h) mbHeight)
+      -- see #9104; we need a box or the image is treated as block-level:
+      case (mdWidth, mbHeight) of
+        (Nothing, Nothing) -> do
+          realWidth <- catchError
+                  (do (bs, _mt) <- fetchItem src
+                      case imageSize opts bs of
+                        Right x -> pure $ Just $ T.pack $
+                                      show (fst (sizeInPoints x)) <> "pt"
+                        Left _ -> pure Nothing)
+                    (\_ -> pure Nothing)
+          case realWidth of
+            Just w -> return $ "#box" <>
+                        parens ("width: " <> literal w <> ", " <> coreImage)
+            Nothing -> return $ "#" <> coreImage
+        (Just w, _) -> return $ "#box" <>
+                        parens ("width: " <> literal w <> ", " <> coreImage)
+        (_, Just h) -> return $ "#box" <>
+                        parens ("height: " <> literal h <> ", " <> coreImage)
     Note blocks -> do
       contents <- blocksToTypst blocks
       return $ "#footnote" <> brackets (chomp contents)
@@ -304,6 +328,7 @@
     needsEscape '\160' = True
     needsEscape '[' = True
     needsEscape ']' = True
+    needsEscape '(' = True -- see #9137
     needsEscape '#' = True
     needsEscape '<' = True
     needsEscape '>' = True
diff --git a/test/Tests/Readers/DokuWiki.hs b/test/Tests/Readers/DokuWiki.hs
--- a/test/Tests/Readers/DokuWiki.hs
+++ b/test/Tests/Readers/DokuWiki.hs
@@ -71,10 +71,11 @@
             para (strikeout "deleted")
           , "Inline code" =:
             "foo <code java>public static void main</code> bar" =?>
-            para (text "foo " <> codeWith ("", ["java"], []) "public static void main" <> text " bar")
+            para (text "foo") <> codeBlockWith ("", ["java"], []) "public static void main"
+              <> para (text "bar")
           , "Inline file" =:
             "foo <file></code></file> bar" =?>
-            para (text "foo " <> code "</code>" <> text " bar")
+            para (text "foo") <> codeBlock "</code>" <> para (text "bar")
           , "Inline HTML" =:
             "<html>\nThis is some <span style=\"color:red;font-size:150%;\">inline HTML</span>\n</html>" =?>
             para (rawInline "html" "\nThis is some <span style=\"color:red;font-size:150%;\">inline HTML</span>\n")
@@ -245,7 +246,7 @@
                       ] =?>
             orderedList [ plain "first item"
                         , plain ("second item with linebreak" <> linebreak <> " second line")
-                        , plain ("third item with code: " <> code "some code\ncomes here\n")
+                        , plain "third item with code: " <> codeBlock "some code\ncomes here\n"
                         , plain "fourth item"
                         ]
           ]
diff --git a/test/Tests/Readers/JATS.hs b/test/Tests/Readers/JATS.hs
--- a/test/Tests/Readers/JATS.hs
+++ b/test/Tests/Readers/JATS.hs
@@ -35,6 +35,42 @@
         , testGroup "images"
           [ test jats "basic" $ "<graphic mimetype=\"image\" mime-subtype=\"\" xlink:href=\"/url\" xlink:title=\"title\" />"
             =?> para (image "/url" "title" mempty)
+            , test jats "alt-text" $ 
+                          "<graphic id=\"graphic001\"\n\
+                          \ xlink:href=\"https://lh3.googleusercontent.com/dB7iirJ3ncQaVMBGE2YX-WCeoAVIChb6NAzoFcKCFChMsrixJvD7ZRbvcaC-ceXEzXYaoH4K5vaoRDsUyBHFkpIDPnsn3bnzovbvi0a2Gg=s660\"\n\
+                          \ xlink:title=\"This is the title of the graphic\"\n\
+                          \ xlink:role=\"This is the role of the graphic\">\n\
+                          \ <alt-text>Alternative text of the graphic</alt-text>\n\
+                          \ <caption>\n\
+                          \ <title>This is the title of the caption</title>\n\
+                          \ <p>Google doodle from 14 March 2003</p></caption>\n\
+                          \ </graphic>"
+            =?> Para [ Image
+              ( "graphic001"
+              , [ "This"
+                , "is"
+                , "the"
+                , "role"
+                , "of"
+                , "the"
+                , "graphic"
+                ]
+              , []
+              )
+              [ Str "Alternative"
+              , Space
+              , Str "text"
+              , Space
+              , Str "of"
+              , Space
+              , Str "the"
+              , Space
+              , Str "graphic"
+              ]
+              ( "https://lh3.googleusercontent.com/dB7iirJ3ncQaVMBGE2YX-WCeoAVIChb6NAzoFcKCFChMsrixJvD7ZRbvcaC-ceXEzXYaoH4K5vaoRDsUyBHFkpIDPnsn3bnzovbvi0a2Gg=s660"
+              , "This is the title of the graphic"
+              )
+              ]
           ]
         , test jats "bullet list" $
                             "<list list-type=\"bullet\">\n\
diff --git a/test/command/5321.md b/test/command/5321.md
--- a/test/command/5321.md
+++ b/test/command/5321.md
@@ -4,7 +4,9 @@
   <caption>
     <p>bar</p>
   </caption>
-  <graphic xlink:href="foo.png" xlink:alt-text="baz" />
+  <graphic xlink:href="foo.png">
+    <alt-text>baz</alt-text>
+  </graphic>
 </fig>
 ^D
 [ Figure
@@ -23,7 +25,9 @@
     <title>foo</title>
     <p>bar</p>
   </caption>
-  <graphic xlink:href="foo.png" xlink:alt-text="baz" />
+    <graphic xlink:href="foo.png">
+      <alt-text>baz</alt-text>
+    </graphic>
 </fig>
 ^D
 [ Figure
diff --git a/test/command/7042.md b/test/command/7042.md
--- a/test/command/7042.md
+++ b/test/command/7042.md
@@ -81,6 +81,7 @@
 </body>
 <back>
 <ref-list>
+  <title></title>
   <ref id="ref-year-month">
     <element-citation publication-type="article-journal">
       <person-group person-group-type="author">
diff --git a/test/command/8508.md b/test/command/8508.md
--- a/test/command/8508.md
+++ b/test/command/8508.md
@@ -8,7 +8,13 @@
 ^D
 .SH SEE ALSO
 .IP \[bu] 2
-Milk (https://en.wikipedia.org/wiki/Milk)
+\c
+.UR https://en.wikipedia.org/wiki/Milk
+Milk
+.UE \c
 .IP \[bu] 2
-EBNF (https://en.wikipedia.org/wiki/Extended_Backus–Naur_form)
+\c
+.UR https://en.wikipedia.org/wiki/Extended_Backus–Naur_form
+EBNF
+.UE \c
 ```
diff --git a/test/command/8867.md b/test/command/8867.md
new file mode 100644
--- /dev/null
+++ b/test/command/8867.md
@@ -0,0 +1,49 @@
+```
+% pandoc -f jats -t native -s
+<article-meta>
+      <title-group>
+        <article-title></article-title>
+      </title-group>
+      <permissions>
+        <copyright-statement>© 2023, Ellerman et al</copyright-statement>
+        <copyright-year>2023</copyright-year>
+        <copyright-holder>Ellerman et al</copyright-holder>
+        <license license-type="open-access">
+          <ali:license_ref xmlns:ali="http://www.niso.org/schemas/ali/1.0/">https://creativecommons.org/licenses/by/4.0/</ali:license_ref>
+          <license-p>This document is distributed under a Creative Commons Attribution 4.0 International license.</license-p>
+        </license>
+      </permissions>
+</article-meta>
+^D
+Pandoc
+  Meta
+    { unMeta =
+        fromList
+          [ ( "copyright"
+            , MetaMap
+                (fromList
+                   [ ( "holder" , MetaString "Ellerman et al" )
+                   , ( "statement"
+                     , MetaString "\169 2023, Ellerman et al"
+                     )
+                   , ( "year" , MetaString "2023" )
+                   ])
+            )
+          , ( "license"
+            , MetaMap
+                (fromList
+                   [ ( "link"
+                     , MetaString
+                         "https://creativecommons.org/licenses/by/4.0/"
+                     )
+                   , ( "text"
+                     , MetaString
+                         "This document is distributed under a Creative Commons Attribution 4.0 International license."
+                     )
+                   , ( "type" , MetaString "open-access" )
+                   ])
+            )
+          ]
+    }
+  []
+```
diff --git a/test/command/8981.md b/test/command/8981.md
new file mode 100644
--- /dev/null
+++ b/test/command/8981.md
@@ -0,0 +1,6 @@
+```
+% pandoc --wrap=none
+consectetur [^\[link\]^](#ref "Title")
+^D
+<p>consectetur <a href="#ref" title="Title"><sup>[link]</sup></a></p>
+```
diff --git a/test/command/9021.md b/test/command/9021.md
new file mode 100644
--- /dev/null
+++ b/test/command/9021.md
@@ -0,0 +1,61 @@
+```
+% pandoc -t jats+element_citations --citeproc -s
+---
+references:
+- author: DeGroot
+  id: degroot_probability
+  title: Probability
+  issued: 2002
+title: Doc example with single reference
+reference-section-title: Ref Title
+---
+
+# I like
+
+[@degroot_probability].
+^D
+<?xml version="1.0" encoding="utf-8" ?>
+<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.2 20190208//EN"
+                  "JATS-archivearticle1.dtd">
+<article xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink" dtd-version="1.2" article-type="other">
+<front>
+<journal-meta>
+<journal-id></journal-id>
+<journal-title-group>
+</journal-title-group>
+<issn></issn>
+<publisher>
+<publisher-name></publisher-name>
+</publisher>
+</journal-meta>
+<article-meta>
+<title-group>
+<article-title>Doc example with single reference</article-title>
+</title-group>
+<permissions>
+</permissions>
+</article-meta>
+</front>
+<body>
+<sec id="i-like">
+  <title>I like</title>
+  <p>(DeGroot 2002).</p>
+</sec>
+</body>
+<back>
+<ref-list>
+  <title>Ref Title</title>
+  <ref id="ref-degroot_probability">
+    <element-citation>
+      <person-group person-group-type="author">
+        <string-name>DeGroot</string-name>
+      </person-group>
+      <article-title>Probability</article-title>
+      <year iso-8601-date="2002">2002</year>
+    </element-citation>
+  </ref>
+</ref-list>
+</back>
+</article>
+
+```
diff --git a/test/command/9047.md b/test/command/9047.md
new file mode 100644
--- /dev/null
+++ b/test/command/9047.md
@@ -0,0 +1,47 @@
+tests meant to test the fixes of bug [#9047](https://github.com/jgm/pandoc/issues/9047)
+
+```
+% pandoc -f html -t html
+<ul class="task-list">
+<li><label><input type="checkbox" />foo</label></li>
+<li><label><input type="checkbox" checked="" />bar</label></li>
+<li><label><input type="button" checked="" />foobar</label></li>
+<li><input id="hello" type="checkbox" checked/><label for="hello">hello</label></li>
+</ul>
+^D
+<ul>
+<li><label><input type="checkbox" />foo</label></li>
+<li><label><input type="checkbox" checked="" />bar</label></li>
+<li>foobar</li>
+<li><label><input type="checkbox" checked="" />hello</label></li>
+</ul>
+```
+
+w/ rawHTML extension a checkbox by itself is kept
+```
+% pandoc -f html+raw_html -t html+raw_html
+<input type="checkbox" checked="" />
+^D
+<input type="checkbox" checked>
+</input>
+```
+
+w/ rawHTML extension, a checkbox in an `li` is handled properly
+```
+% pandoc -f html+raw_html -t html+raw_html
+<ul>
+<li><input type="checkbox" checked/>foo</li>
+</ul>
+^D
+<ul class="task-list">
+<li><label><input type="checkbox" checked="" />foo</label></li>
+</ul>
+```
+
+w/o rawHTML extension, a checkbox outside of an `li` is properly ignored
+```
+% pandoc -f html -t html
+<p><input type="checkbox" checked/>foo</p>
+^D
+foo
+```
diff --git a/test/command/9088.md b/test/command/9088.md
new file mode 100644
--- /dev/null
+++ b/test/command/9088.md
@@ -0,0 +1,10 @@
+```
+% pandoc -t latex
+|    0 - A
+|    1 - B
+|    2 - C
+^D
+~~~0 - A\\
+\strut ~~~1 - B\\
+\strut ~~~2 - C
+```
diff --git a/test/command/9090.md b/test/command/9090.md
new file mode 100644
--- /dev/null
+++ b/test/command/9090.md
@@ -0,0 +1,15 @@
+```
+% pandoc -f html -t gfm
+<table>
+  <tr>
+    <th>invalid head cell</td>
+  </tr>
+  <tr>
+    <td>body cell</td>
+  </tr>
+</table>
+^D
+| invalid head cell |
+|-------------------|
+| body cell         |
+```
diff --git a/test/command/9150.md b/test/command/9150.md
new file mode 100644
--- /dev/null
+++ b/test/command/9150.md
@@ -0,0 +1,51 @@
+```
+% pandoc -f latex -t native
+\hfill  {\Large \textbf{Theoretische Grundlagen der Informatik}}
+^D
+[ Para
+    [ Span
+        ( "" , [] , [] )
+        [ Strong
+            [ Str "Theoretische"
+            , Space
+            , Str "Grundlagen"
+            , Space
+            , Str "der"
+            , Space
+            , Str "Informatik"
+            ]
+        ]
+    ]
+]
+```
+
+```
+% pandoc -f latex+raw_tex -t native
+\hfill  {\Large \textbf{Theoretische Grundlagen der Informatik}}
+^D
+[ Para
+    [ RawInline (Format "latex") "\\hfill  "
+    , Span
+        ( "" , [] , [] )
+        [ RawInline (Format "latex") "\\Large "
+        , Strong
+            [ Str "Theoretische"
+            , Space
+            , Str "Grundlagen"
+            , Space
+            , Str "der"
+            , Space
+            , Str "Informatik"
+            ]
+        ]
+    ]
+]
+```
+
+```
+% pandoc -f latex+raw_tex -t native
+\hskip 2pt plus 1pt minus 1pt
+^D
+[ RawBlock (Format "latex") "\\hskip 2pt plus 1pt minus 1pt"
+]
+```
diff --git a/test/command/9159.md b/test/command/9159.md
new file mode 100644
--- /dev/null
+++ b/test/command/9159.md
@@ -0,0 +1,15 @@
+```
+% pandoc -t org -f markdown
+\* See Blah
+
+\# not comment
+
+\| not table \|
+^D
+​* See Blah
+
+​# not comment
+
+​| not table |
+
+```
diff --git a/test/command/bits-book-meta.md b/test/command/bits-book-meta.md
new file mode 100644
--- /dev/null
+++ b/test/command/bits-book-meta.md
@@ -0,0 +1,104 @@
+```
+% pandoc -f jats -t native -s
+<book>
+    <book-meta>
+		<book-id book-id-type="publisher">handbook-648</book-id>
+  		<book-title-group>
+   			<book-title>The NCBI Handbook</book-title>
+  		</book-title-group>
+  		<contrib-group>
+   			<contrib contrib-type="author">
+    			<name><surname>McEntyre</surname>
+     			<given-names>Jo</given-names></name>
+    			<xref ref-type="aff" rid="bid.m.1"/>
+   			</contrib>
+   			<contrib contrib-type="editor">
+    			<name><surname>Ostell</surname>
+     			<given-names>Jim</given-names></name>
+    			<xref ref-type="aff" rid="bid.m.1"/>
+   			</contrib>
+  		</contrib-group>
+  		<aff id="bid.m.1">
+   			<institution>National Center for Biotechnology Information (NCBI), National Library of Medicine, National Institutes of Health</institution>, <addr-line>Bethesda, MD 20892-6510</addr-line>
+  		</aff>
+  		<pub-date iso-8601-date="2002-11">
+   			<month>11</month>
+   			<year>2002</year>
+  		</pub-date>
+  		<publisher>
+   			<publisher-name>National Center for Biotechnology Information (NCBI), National Library of Medicine, National Institutes of Health</publisher-name>
+   			<publisher-loc>Bethesda, MD</publisher-loc>
+  		</publisher>
+  		<edition>1</edition>
+  		<counts>
+   			<book-fig-count count="98"/>
+   			<book-table-count count="40"/>
+   			<book-equation-count count="0"/>
+   			<book-ref-count count="115"/>
+   			<book-page-count count="532"/>
+   			<book-word-count count="149852"/>
+  		</counts>
+ 	</book-meta>
+</book>
+^D
+Pandoc
+  Meta
+    { unMeta =
+        fromList
+          [ ( "author"
+            , MetaList
+                [ MetaInlines [ Str "Jo" , Space , Str "McEntyre" ] ]
+            )
+          , ( "date" , MetaInlines [ Str "2002-11" ] )
+          , ( "institute"
+            , MetaList
+                [ MetaInlines
+                    [ Str "National"
+                    , Space
+                    , Str "Center"
+                    , Space
+                    , Str "for"
+                    , Space
+                    , Str "Biotechnology"
+                    , Space
+                    , Str "Information"
+                    , Space
+                    , Str "(NCBI),"
+                    , Space
+                    , Str "National"
+                    , Space
+                    , Str "Library"
+                    , Space
+                    , Str "of"
+                    , Space
+                    , Str "Medicine,"
+                    , Space
+                    , Str "National"
+                    , Space
+                    , Str "Institutes"
+                    , Space
+                    , Str "of"
+                    , Space
+                    , Str "Health,"
+                    , Space
+                    , Str "Bethesda,"
+                    , Space
+                    , Str "MD"
+                    , Space
+                    , Str "20892-6510"
+                    ]
+                ]
+            )
+          , ( "title"
+            , MetaInlines
+                [ Str "The"
+                , Space
+                , Str "NCBI"
+                , Space
+                , Str "Handbook"
+                ]
+            )
+          ]
+    }
+  []
+```
diff --git a/test/command/bits-book-part-wrapper-meta.md b/test/command/bits-book-part-wrapper-meta.md
new file mode 100644
--- /dev/null
+++ b/test/command/bits-book-part-wrapper-meta.md
@@ -0,0 +1,95 @@
+```
+% pandoc -f jats -t native -s
+<book-part-wrapper 
+  dtd-version="2.1"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xmlns:xi="http://www.w3.org/2001/XInclude"
+  xmlns:mml="http://www.w3.org/1998/Math/MathML"
+  xmlns:xlink="http://www.w3.org/1999/xlink">
+
+ <collection-meta>
+  <title-group>
+   <title>Balisage Series on Markup Technologies</title>
+  </title-group>
+ 
+  <abstract>
+   <p>The <italic>Balisage Series on Markup Technologies</italic> 
+    is an occasional series...</p>
+  </abstract>
+ </collection-meta>
+
+ <book-meta>
+  <book-title-group>
+   <book-title>Proceedings of Balisage: The Markup Conference 
+    2013</book-title>
+  </book-title-group>
+ 
+  <abstract>
+   <p>Balisage is a peer-reviewed conference...</p></abstract>
+ 
+ </book-meta>
+</book-part-wrapper>
+^D
+Pandoc
+  Meta
+    { unMeta =
+        fromList
+          [ ( "abstract"
+            , MetaBlocks
+                [ Para
+                    [ Str "Balisage"
+                    , Space
+                    , Str "is"
+                    , Space
+                    , Str "a"
+                    , Space
+                    , Str "peer-reviewed"
+                    , Space
+                    , Str "conference..."
+                    ]
+                ]
+            )
+          , ( "title"
+            , MetaInlines
+                [ Str "Proceedings"
+                , Space
+                , Str "of"
+                , Space
+                , Str "Balisage:"
+                , Space
+                , Str "The"
+                , Space
+                , Str "Markup"
+                , Space
+                , Str "Conference"
+                , SoftBreak
+                , Str "2013"
+                ]
+            )
+          ]
+    }
+  [ Para
+      [ Str "The"
+      , Space
+      , Emph
+          [ Str "Balisage"
+          , Space
+          , Str "Series"
+          , Space
+          , Str "on"
+          , Space
+          , Str "Markup"
+          , Space
+          , Str "Technologies"
+          ]
+      , SoftBreak
+      , Str "is"
+      , Space
+      , Str "an"
+      , Space
+      , Str "occasional"
+      , Space
+      , Str "series..."
+      ]
+  ]
+```
diff --git a/test/command/bits-book-part-wrapper.md b/test/command/bits-book-part-wrapper.md
new file mode 100644
--- /dev/null
+++ b/test/command/bits-book-part-wrapper.md
@@ -0,0 +1,149 @@
+```
+% pandoc -f jats -t native
+<book-part-wrapper 
+  dtd-version="2.1"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xmlns:xi="http://www.w3.org/2001/XInclude"
+  xmlns:mml="http://www.w3.org/1998/Math/MathML"
+  xmlns:xlink="http://www.w3.org/1999/xlink">
+
+ <collection-meta>
+  <title-group>
+   <title>Balisage Series on Markup Technologies</title>
+  </title-group>
+ 
+  <abstract>
+   <p>The <italic>Balisage Series on Markup Technologies</italic> 
+    is an occasional series...</p>
+  </abstract>
+ </collection-meta>
+
+ <book-meta>
+  <book-title-group>
+   <book-title>Proceedings of Balisage: The Markup Conference 
+    2013</book-title>
+  </book-title-group>
+ 
+  <abstract>
+   <p>Balisage is a peer-reviewed conference...</p></abstract>
+ 
+ </book-meta>
+
+ <book-part id="bid.1" book-part-type="part">
+   			<book-part-meta>
+    			<title-group>
+     				<label>Part 1</label>
+     				<title>The Databases</title>
+    			</title-group>
+   			</book-part-meta>
+   			<body>
+    			<sec id="bid.3">
+     				<title>History</title>
+     				<p>Initially, GenBank was built and maintained at Los Alamos 
+      				National Laboratory.</p>
+    			</sec>
+   			</body>
+   			<back>
+                <title>Back matter of book part</title>
+  				<ref-list>
+   					<title>References</title>
+   					<ref id="bid.41">
+    					<label>1</label>
+    					<element-citation>
+     						<person-group>
+      							<string-name>
+									<surname>Olson</surname>
+       								<given-names>M</given-names>
+								</string-name>
+      							<string-name>
+									<surname>Hood</surname>
+       								<given-names>L</given-names>
+								</string-name>
+      							<string-name>
+									<surname>Cantor</surname>
+       								<given-names>C</given-names>
+								</string-name>
+      							<string-name>
+									<surname>Botstein</surname>
+       								<given-names>D</given-names>
+								</string-name>
+     						</person-group>
+     						<article-title>A common language for physical mapping of the human genome</article-title>
+     						<source>Science</source>
+     						<year iso-8601-date="1989">1989</year>
+     						<volume>245</volume>
+     						<issue>4925</issue>
+     						<fpage>1434</fpage>
+     						<lpage>1435</lpage>
+     						<pub-id pub-id-type="pmid">2781285</pub-id>
+    					</element-citation>
+   					</ref>
+  				</ref-list>
+ 			</back>
+  	</book-part>
+</book-part-wrapper>
+^D
+[ Para
+    [ Str "The"
+    , Space
+    , Emph
+        [ Str "Balisage"
+        , Space
+        , Str "Series"
+        , Space
+        , Str "on"
+        , Space
+        , Str "Markup"
+        , Space
+        , Str "Technologies"
+        ]
+    , SoftBreak
+    , Str "is"
+    , Space
+    , Str "an"
+    , Space
+    , Str "occasional"
+    , Space
+    , Str "series..."
+    ]
+, Header 2 ( "bid.3" , [] , [] ) [ Str "History" ]
+, Para
+    [ Str "Initially,"
+    , Space
+    , Str "GenBank"
+    , Space
+    , Str "was"
+    , Space
+    , Str "built"
+    , Space
+    , Str "and"
+    , Space
+    , Str "maintained"
+    , Space
+    , Str "at"
+    , Space
+    , Str "Los"
+    , Space
+    , Str "Alamos"
+    , SoftBreak
+    , Str "National"
+    , Space
+    , Str "Laboratory."
+    ]
+, Header
+    2
+    ( "" , [] , [] )
+    [ Str "Back"
+    , Space
+    , Str "matter"
+    , Space
+    , Str "of"
+    , Space
+    , Str "book"
+    , Space
+    , Str "part"
+    ]
+, Header 1 ( "" , [] , [] ) [ Str "References" ]
+, Div ( "refs" , [] , [] ) []
+]
+```
diff --git a/test/command/bits-book.md b/test/command/bits-book.md
new file mode 100644
--- /dev/null
+++ b/test/command/bits-book.md
@@ -0,0 +1,186 @@
+```
+% pandoc -f jats -t native
+<book dtd-version="2.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:mml="http://www.w3.org/1998/Math/MathML">
+ 	<front-matter>
+  		<front-matter-part>
+   			<book-part-meta>
+    			<title-group>
+     				<title>About this book</title>
+    			</title-group>
+   			</book-part-meta>
+   			<named-book-part-body>
+    			<sec sec-type="miscinfo">
+     				<title>The NCBI Handbook</title>
+     				<p>Bioinformatics consists of a computational approach
+      				to biomedical information management and analysis.</p>
+    			</sec>
+   			</named-book-part-body>
+  		</front-matter-part>
+ 	</front-matter>
+ 	<book-body>
+  		<book-part id="bid.1" book-part-type="part">
+   			<book-part-meta>
+    			<title-group>
+     				<label>Part 1</label>
+     				<title>The Databases</title>
+    			</title-group>
+   			</book-part-meta>
+   			<body>
+    			<sec id="bid.3">
+     				<title>History</title>
+     				<p>Initially, GenBank was built and maintained at Los Alamos 
+      				National Laboratory.</p>
+    			</sec>
+   			</body>
+   			<back>
+                <title>Back matter of book part</title>
+  				<ref-list>
+   					<title>References</title>
+   					<ref id="bid.41">
+    					<label>1</label>
+    					<element-citation>
+     						<person-group>
+      							<string-name>
+									<surname>Olson</surname>
+       								<given-names>M</given-names>
+								</string-name>
+      							<string-name>
+									<surname>Hood</surname>
+       								<given-names>L</given-names>
+								</string-name>
+      							<string-name>
+									<surname>Cantor</surname>
+       								<given-names>C</given-names>
+								</string-name>
+      							<string-name>
+									<surname>Botstein</surname>
+       								<given-names>D</given-names>
+								</string-name>
+     						</person-group>
+     						<article-title>A common language for physical mapping of the human genome</article-title>
+     						<source>Science</source>
+     						<year iso-8601-date="1989">1989</year>
+     						<volume>245</volume>
+     						<issue>4925</issue>
+     						<fpage>1434</fpage>
+     						<lpage>1435</lpage>
+     						<pub-id pub-id-type="pmid">2781285</pub-id>
+    					</element-citation>
+   					</ref>
+  				</ref-list>
+ 			</back>
+  		</book-part>
+ 	</book-body>
+ 	<book-back>
+  		<ack id="bid.394">
+   		<title>Acknowledgments</title>
+   		<p>We gratefully acknowledge the work of Vladimir Soussov,
+    	as well as the entire NCBI Entrez team...</p>
+  		</ack>
+ 	</book-back>
+</book>
+^D
+[ Header
+    2
+    ( "" , [] , [] )
+    [ Str "The" , Space , Str "NCBI" , Space , Str "Handbook" ]
+, Para
+    [ Str "Bioinformatics"
+    , Space
+    , Str "consists"
+    , Space
+    , Str "of"
+    , Space
+    , Str "a"
+    , Space
+    , Str "computational"
+    , Space
+    , Str "approach"
+    , SoftBreak
+    , Str "to"
+    , Space
+    , Str "biomedical"
+    , Space
+    , Str "information"
+    , Space
+    , Str "management"
+    , Space
+    , Str "and"
+    , Space
+    , Str "analysis."
+    ]
+, Header 2 ( "bid.3" , [] , [] ) [ Str "History" ]
+, Para
+    [ Str "Initially,"
+    , Space
+    , Str "GenBank"
+    , Space
+    , Str "was"
+    , Space
+    , Str "built"
+    , Space
+    , Str "and"
+    , Space
+    , Str "maintained"
+    , Space
+    , Str "at"
+    , Space
+    , Str "Los"
+    , Space
+    , Str "Alamos"
+    , SoftBreak
+    , Str "National"
+    , Space
+    , Str "Laboratory."
+    ]
+, Header
+    2
+    ( "" , [] , [] )
+    [ Str "Back"
+    , Space
+    , Str "matter"
+    , Space
+    , Str "of"
+    , Space
+    , Str "book"
+    , Space
+    , Str "part"
+    ]
+, Header 1 ( "" , [] , [] ) [ Str "References" ]
+, Div ( "refs" , [] , [] ) []
+, Header 2 ( "bid.394" , [] , [] ) [ Str "Acknowledgments" ]
+, Para
+    [ Str "We"
+    , Space
+    , Str "gratefully"
+    , Space
+    , Str "acknowledge"
+    , Space
+    , Str "the"
+    , Space
+    , Str "work"
+    , Space
+    , Str "of"
+    , Space
+    , Str "Vladimir"
+    , Space
+    , Str "Soussov,"
+    , SoftBreak
+    , Str "as"
+    , Space
+    , Str "well"
+    , Space
+    , Str "as"
+    , Space
+    , Str "the"
+    , Space
+    , Str "entire"
+    , Space
+    , Str "NCBI"
+    , Space
+    , Str "Entrez"
+    , Space
+    , Str "team..."
+    ]
+]
+```
diff --git a/test/command/bits-index-elements.md b/test/command/bits-index-elements.md
new file mode 100644
--- /dev/null
+++ b/test/command/bits-index-elements.md
@@ -0,0 +1,83 @@
+```
+% pandoc -f jats -t native
+<index-group>
+	<index-title-group>
+		<title>Index group</title>
+	</index-title-group>
+	<p>Content of index group</p>
+	<index>
+		<index-title-group>
+			<title>Index</title>
+		</index-title-group>
+		<p>Content of index</p>
+  		<index-div>
+   			<index-title-group>
+    			<title>N</title>
+   			</index-title-group>
+   			<p>Content of index div</p>
+   			<index-entry>
+    			<term>Navy</term>
+    			<x>.</x>
+    			<see-entry>Armed forces</see-entry>
+    			<x>.</x>
+   			</index-entry>
+   			<index-entry>
+    			<term>Necessary and proper clause, congressional power</term>
+   			</index-entry>
+   			<index-entry>
+    			<term>Newsgathering as commerce</term>
+   			</index-entry>
+  		</index-div>
+	</index>
+</index-group>
+^D
+[ Header
+    1 ( "" , [] , [] ) [ Str "Index" , Space , Str "group" ]
+, Para
+    [ Str "Content"
+    , Space
+    , Str "of"
+    , Space
+    , Str "index"
+    , Space
+    , Str "group"
+    ]
+, Header 2 ( "" , [] , [] ) [ Str "Index" ]
+, Para
+    [ Str "Content" , Space , Str "of" , Space , Str "index" ]
+, Header 3 ( "" , [] , [] ) [ Str "N" ]
+, Para
+    [ Str "Content"
+    , Space
+    , Str "of"
+    , Space
+    , Str "index"
+    , Space
+    , Str "div"
+    ]
+, Plain [ Str "Navy" ]
+, Plain [ Str "." ]
+, Plain [ Str "Armed" , Space , Str "forces" ]
+, Plain [ Str "." ]
+, Plain
+    [ Str "Necessary"
+    , Space
+    , Str "and"
+    , Space
+    , Str "proper"
+    , Space
+    , Str "clause,"
+    , Space
+    , Str "congressional"
+    , Space
+    , Str "power"
+    ]
+, Plain
+    [ Str "Newsgathering"
+    , Space
+    , Str "as"
+    , Space
+    , Str "commerce"
+    ]
+]
+```
diff --git a/test/command/bits-legend.md b/test/command/bits-legend.md
new file mode 100644
--- /dev/null
+++ b/test/command/bits-legend.md
@@ -0,0 +1,45 @@
+```
+% pandoc -f jats -t native
+<fig id="fig_A.1" orientation="portrait">
+ <label>Figure A.1</label>
+ <caption>
+  <title>Field of Application</title>
+ </caption>
+ <legend>
+  <title>Key</title>
+  <def-list>
+   <def-item>
+    <term>I</term>
+    <def><p>input</p></def>
+   </def-item>
+   <def-item>
+    <term>O</term>
+    <def><p>output</p></def>
+   </def-item>
+   ...
+  </def-list>
+ </legend>
+ <graphic xlink:href="1234"/>
+</fig>
+^D
+[ Figure
+    ( "fig_A.1" , [] , [] )
+    (Caption
+       Nothing
+       [ Plain
+           [ Str "Field"
+           , Space
+           , Str "of"
+           , Space
+           , Str "Application"
+           ]
+       ])
+    [ Header 1 ( "" , [] , [] ) [ Str "Key" ]
+    , DefinitionList
+        [ ( [ Str "I" ] , [ [ Para [ Str "input" ] ] ] )
+        , ( [ Str "O" ] , [ [ Para [ Str "output" ] ] ] )
+        ]
+    , Para [ Image ( "" , [] , [] ) [] ( "1234" , "" ) ]
+    ]
+]
+```
diff --git a/test/command/bits-named-boook-parts.md b/test/command/bits-named-boook-parts.md
new file mode 100644
--- /dev/null
+++ b/test/command/bits-named-boook-parts.md
@@ -0,0 +1,68 @@
+```
+% pandoc -f jats -t native
+<dedication>
+	<named-book-part-body>
+		<p>This is the dedication text.</p>
+	</named-book-part-body>
+</dedication>
+^D
+[ Header 1 ( "" , [] , [] ) [ Str "Dedication" ]
+, Para
+    [ Str "This"
+    , Space
+    , Str "is"
+    , Space
+    , Str "the"
+    , Space
+    , Str "dedication"
+    , Space
+    , Str "text."
+    ]
+]
+```
+
+```
+% pandoc -f jats -t native
+<foreword>
+	<named-book-part-body>
+		<p>This is the foreword text.</p>
+	</named-book-part-body>
+</foreword>
+^D
+[ Header 1 ( "" , [] , [] ) [ Str "Foreword" ]
+, Para
+    [ Str "This"
+    , Space
+    , Str "is"
+    , Space
+    , Str "the"
+    , Space
+    , Str "foreword"
+    , Space
+    , Str "text."
+    ]
+]
+```
+
+```
+% pandoc -f jats -t native
+<preface>
+	<named-book-part-body>
+		<p>This is the preface text.</p>
+	</named-book-part-body>
+</preface>
+^D
+[ Header 1 ( "" , [] , [] ) [ Str "Preface" ]
+, Para
+    [ Str "This"
+    , Space
+    , Str "is"
+    , Space
+    , Str "the"
+    , Space
+    , Str "preface"
+    , Space
+    , Str "text."
+    ]
+]
+```
diff --git a/test/command/bits-title-display-as.md b/test/command/bits-title-display-as.md
new file mode 100644
--- /dev/null
+++ b/test/command/bits-title-display-as.md
@@ -0,0 +1,175 @@
+```
+% pandoc -f jats -t native
+<sec>
+	<title>THE EUROPEAN UNION  EXPLAINED</title>
+</sec>
+^D
+[ Header
+    1
+    ( "" , [] , [] )
+    [ Str "THE"
+    , Space
+    , Str "EUROPEAN"
+    , Space
+    , Str "UNION"
+    , Space
+    , Str "EXPLAINED"
+    ]
+]
+```
+
+```
+% pandoc -f jats -t native
+<sec>
+	<title display-as="3">THE EUROPEAN UNION  EXPLAINED</title>
+</sec>
+^D
+[ Header
+    3
+    ( "" , [] , [] )
+    [ Str "THE"
+    , Space
+    , Str "EUROPEAN"
+    , Space
+    , Str "UNION"
+    , Space
+    , Str "EXPLAINED"
+    ]
+]
+```
+
+```
+% pandoc -f jats -t native
+<body>
+	<sec>
+		<title>The European Parliament</title>
+		<p>Members of the European Parliament (MEPs) are directly elected by EU citizens.</p>
+		<sec>
+		    <title display-as="3">Composition of the European Parliament</title>
+			<p>The seats in the European Parliament are allocated among the Member States.</p>
+		</sec>
+        <sec>
+            <title>Composition of the European Parliament - II </title>
+            <p>Most MEPs are associated with a national political party in their home country.</p>
+		</sec>
+    </sec>
+</body>
+^D
+[ Header
+    1
+    ( "" , [] , [] )
+    [ Str "The"
+    , Space
+    , Str "European"
+    , Space
+    , Str "Parliament"
+    ]
+, Para
+    [ Str "Members"
+    , Space
+    , Str "of"
+    , Space
+    , Str "the"
+    , Space
+    , Str "European"
+    , Space
+    , Str "Parliament"
+    , Space
+    , Str "(MEPs)"
+    , Space
+    , Str "are"
+    , Space
+    , Str "directly"
+    , Space
+    , Str "elected"
+    , Space
+    , Str "by"
+    , Space
+    , Str "EU"
+    , Space
+    , Str "citizens."
+    ]
+, Header
+    3
+    ( "" , [] , [] )
+    [ Str "Composition"
+    , Space
+    , Str "of"
+    , Space
+    , Str "the"
+    , Space
+    , Str "European"
+    , Space
+    , Str "Parliament"
+    ]
+, Para
+    [ Str "The"
+    , Space
+    , Str "seats"
+    , Space
+    , Str "in"
+    , Space
+    , Str "the"
+    , Space
+    , Str "European"
+    , Space
+    , Str "Parliament"
+    , Space
+    , Str "are"
+    , Space
+    , Str "allocated"
+    , Space
+    , Str "among"
+    , Space
+    , Str "the"
+    , Space
+    , Str "Member"
+    , Space
+    , Str "States."
+    ]
+, Header
+    2
+    ( "" , [] , [] )
+    [ Str "Composition"
+    , Space
+    , Str "of"
+    , Space
+    , Str "the"
+    , Space
+    , Str "European"
+    , Space
+    , Str "Parliament"
+    , Space
+    , Str "-"
+    , Space
+    , Str "II"
+    ]
+, Para
+    [ Str "Most"
+    , Space
+    , Str "MEPs"
+    , Space
+    , Str "are"
+    , Space
+    , Str "associated"
+    , Space
+    , Str "with"
+    , Space
+    , Str "a"
+    , Space
+    , Str "national"
+    , Space
+    , Str "political"
+    , Space
+    , Str "party"
+    , Space
+    , Str "in"
+    , Space
+    , Str "their"
+    , Space
+    , Str "home"
+    , Space
+    , Str "country."
+    ]
+]
+```
diff --git a/test/command/bits-title-supress.md b/test/command/bits-title-supress.md
new file mode 100644
--- /dev/null
+++ b/test/command/bits-title-supress.md
@@ -0,0 +1,122 @@
+```
+% pandoc -f jats -t native
+<sec>
+	<title>The European Parliament</title>
+	<p>Members of the European Parliament (MEPs) are directly elected by EU citizens.</p>
+</sec>
+^D
+[ Header
+    1
+    ( "" , [] , [] )
+    [ Str "The"
+    , Space
+    , Str "European"
+    , Space
+    , Str "Parliament"
+    ]
+, Para
+    [ Str "Members"
+    , Space
+    , Str "of"
+    , Space
+    , Str "the"
+    , Space
+    , Str "European"
+    , Space
+    , Str "Parliament"
+    , Space
+    , Str "(MEPs)"
+    , Space
+    , Str "are"
+    , Space
+    , Str "directly"
+    , Space
+    , Str "elected"
+    , Space
+    , Str "by"
+    , Space
+    , Str "EU"
+    , Space
+    , Str "citizens."
+    ]
+]
+```
+
+```
+% pandoc -f jats -t native
+<sec>
+	<title supress="no">The European Parliament</title>
+	<p>Members of the European Parliament (MEPs) are directly elected by EU citizens.</p>
+</sec>
+^D
+[ Header
+    1
+    ( "" , [] , [] )
+    [ Str "The"
+    , Space
+    , Str "European"
+    , Space
+    , Str "Parliament"
+    ]
+, Para
+    [ Str "Members"
+    , Space
+    , Str "of"
+    , Space
+    , Str "the"
+    , Space
+    , Str "European"
+    , Space
+    , Str "Parliament"
+    , Space
+    , Str "(MEPs)"
+    , Space
+    , Str "are"
+    , Space
+    , Str "directly"
+    , Space
+    , Str "elected"
+    , Space
+    , Str "by"
+    , Space
+    , Str "EU"
+    , Space
+    , Str "citizens."
+    ]
+]
+```
+
+```
+% pandoc -f jats -t native
+<sec>
+	<title supress="yes">The European Parliament</title>
+	<p>Members of the European Parliament (MEPs) are directly elected by EU citizens.</p>
+</sec>
+^D
+[ Para
+    [ Str "Members"
+    , Space
+    , Str "of"
+    , Space
+    , Str "the"
+    , Space
+    , Str "European"
+    , Space
+    , Str "Parliament"
+    , Space
+    , Str "(MEPs)"
+    , Space
+    , Str "are"
+    , Space
+    , Str "directly"
+    , Space
+    , Str "elected"
+    , Space
+    , Str "by"
+    , Space
+    , Str "EU"
+    , Space
+    , Str "citizens."
+    ]
+]
+```
diff --git a/test/command/bits-toc-elements.md b/test/command/bits-toc-elements.md
new file mode 100644
--- /dev/null
+++ b/test/command/bits-toc-elements.md
@@ -0,0 +1,69 @@
+```
+% pandoc -f jats -t native
+<toc-group>
+	<toc-title-group>
+		<title>TOC group</title>
+	</toc-title-group>
+	<p>Content of toc group</p>
+	<toc>
+		<toc-title-group>
+			<title>TOC</title>
+		</toc-title-group>
+		<p>Content of TOC</p>
+  		<toc-div content-type="sections">
+   			<toc-title-group>
+                <title>Mental Health Services</title>
+            </toc-title-group>
+            <toc-entry>
+                <label>Section 1</label>
+                <title>Introduction</title>
+                <nav-pointer rid="tc3"/>
+            </toc-entry>
+            <toc-entry>
+                <label>Section 2</label>
+                <title>Mental Health of the Population</title>
+                <nav-pointer rid="tc4"/>
+            </toc-entry>
+  		</toc-div>
+	</toc>
+</toc-group>
+^D
+[ Header
+    1 ( "" , [] , [] ) [ Str "TOC" , Space , Str "group" ]
+, Para
+    [ Str "Content"
+    , Space
+    , Str "of"
+    , Space
+    , Str "toc"
+    , Space
+    , Str "group"
+    ]
+, Header 2 ( "" , [] , [] ) [ Str "TOC" ]
+, Para
+    [ Str "Content" , Space , Str "of" , Space , Str "TOC" ]
+, Header
+    3
+    ( "" , [] , [] )
+    [ Str "Mental"
+    , Space
+    , Str "Health"
+    , Space
+    , Str "Services"
+    ]
+, Header 4 ( "" , [] , [] ) [ Str "Introduction" ]
+, Header
+    4
+    ( "" , [] , [] )
+    [ Str "Mental"
+    , Space
+    , Str "Health"
+    , Space
+    , Str "of"
+    , Space
+    , Str "the"
+    , Space
+    , Str "Population"
+    ]
+]
+```
diff --git a/test/command/jats-figure-alt-text.md b/test/command/jats-figure-alt-text.md
--- a/test/command/jats-figure-alt-text.md
+++ b/test/command/jats-figure-alt-text.md
@@ -5,8 +5,11 @@
     <p>bar</p>
   </caption>
   <alt-text>alternative-decription</alt-text>
-  <graphic xlink:href="foo.png" xlink:alt-text="baz" />
+  <graphic xlink:href="foo.png">
+    <alt-text>baz</alt-text> 
+  </graphic>
 </fig>
+
 ^D
 [ Figure
     ( "fig-1" , [] , [] )
diff --git a/test/command/tasklist.md b/test/command/tasklist.md
--- a/test/command/tasklist.md
+++ b/test/command/tasklist.md
diff --git a/test/jats-reader.native b/test/jats-reader.native
--- a/test/jats-reader.native
+++ b/test/jats-reader.native
@@ -745,6 +745,8 @@
   , Para
       [ Str "Einstein"
       , Space
+      , Str "definitely"
+      , Space
       , Str "showed"
       , Space
       , Str "that"
@@ -754,10 +756,29 @@
       [ Para [ Str "Abstract" , Space , Str "text" ]
       , Para
           [ Image
-              ( "" , [] , [] )
-              []
+              ( "graphic001"
+              , [ "This"
+                , "is"
+                , "the"
+                , "role"
+                , "of"
+                , "the"
+                , "graphic"
+                ]
+              , []
+              )
+              [ Str "Alternative"
+              , Space
+              , Str "text"
+              , Space
+              , Str "of"
+              , Space
+              , Str "the"
+              , Space
+              , Str "graphic"
+              ]
               ( "https://lh3.googleusercontent.com/dB7iirJ3ncQaVMBGE2YX-WCeoAVIChb6NAzoFcKCFChMsrixJvD7ZRbvcaC-ceXEzXYaoH4K5vaoRDsUyBHFkpIDPnsn3bnzovbvi0a2Gg=s660"
-              , ""
+              , "This is the title of the graphic"
               )
           ]
       , Para [ Math DisplayMath "e=mc^2" ]
@@ -802,11 +823,14 @@
       [ Para [ Str "Abstract" , Space , Str "text" ]
       , Para
           [ Image
-              ( "" , [] , [] )
-              []
-              ( "https://lh3.googleusercontent.com/dB7iirJ3ncQaVMBGE2YX-WCeoAVIChb6NAzoFcKCFChMsrixJvD7ZRbvcaC-ceXEzXYaoH4K5vaoRDsUyBHFkpIDPnsn3bnzovbvi0a2Gg=s660"
-              , ""
-              )
+              ( "graphic003" , [] , [] )
+              [ Str "Alternative"
+              , Space
+              , Str "text"
+              , Space
+              , Str "1"
+              ]
+              ( "Title 3" , "" )
           ]
       , Para [ Math DisplayMath "e=mc^2" ]
       ]
@@ -820,6 +844,12 @@
       , Str "important"
       , Space
       , Str "because\8230"
+      ]
+  , Figure
+      ( "fig-1" , [] , [] )
+      (Caption Nothing [ Plain [ Str "bar" ] ])
+      [ Plain [ Str "alternative-decription" ]
+      , Para [ Image ( "" , [] , [] ) [] ( "foo.png" , "" ) ]
       ]
   , Header
       1
diff --git a/test/jats-reader.xml b/test/jats-reader.xml
--- a/test/jats-reader.xml
+++ b/test/jats-reader.xml
@@ -193,19 +193,26 @@
     <title>Formulae with miscelaneus elements</title>
     <p>Regardless of whether or not they are inside a paragraph, should be wrapped in a div, and displayed in a block:</p>
     <p><bold>Inside a paragraph:</bold></p>
-    <p>Einstein showed that 
+    <p>Einstein definitely showed that 
       <disp-formula>
         <abstract>
           <p>Abstract text</p>
         </abstract>
-        <graphic xlink:href="https://lh3.googleusercontent.com/dB7iirJ3ncQaVMBGE2YX-WCeoAVIChb6NAzoFcKCFChMsrixJvD7ZRbvcaC-ceXEzXYaoH4K5vaoRDsUyBHFkpIDPnsn3bnzovbvi0a2Gg=s660">
-          <alt-text>Alternative text 1</alt-text>
-          <caption><p>Google doodle from 14 March 2003</p></caption>
+        <graphic id="graphic001"
+        xlink:href="https://lh3.googleusercontent.com/dB7iirJ3ncQaVMBGE2YX-WCeoAVIChb6NAzoFcKCFChMsrixJvD7ZRbvcaC-ceXEzXYaoH4K5vaoRDsUyBHFkpIDPnsn3bnzovbvi0a2Gg=s660"
+        xlink:title="This is the title of the graphic"
+        xlink:role="This is the role of the graphic">
+          <alt-text>Alternative text of the graphic</alt-text>
+          <caption>
+            <title>This is the title of the caption</title>
+            <p>Google doodle from 14 March 2003</p></caption>
         </graphic>
         <alternatives>
           <tex-math><![CDATA[e=mc^2]]></tex-math>
           <mml:math display="block" xmlns:mml="http://www.w3.org/1998/Math/MathML"><mml:mrow><mml:mi>e</mml:mi><mml:mo>=</mml:mo><mml:mi>m</mml:mi><mml:msup><mml:mi>c</mml:mi><mml:mn>2</mml:mn></mml:msup></mml:mrow></mml:math>
-          <graphic xlink:href="https://lh3.googleusercontent.com/dB7iirJ3ncQaVMBGE2YX-WCeoAVIChb6NAzoFcKCFChMsrixJvD7ZRbvcaC-ceXEzXYaoH4K5vaoRDsUyBHFkpIDPnsn3bnzovbvi0a2Gg=s660">
+          <graphic id="graphic001"
+          xlink:href="https://lh3.googleusercontent.com/dB7iirJ3ncQaVMBGE2YX-WCeoAVIChb6NAzoFcKCFChMsrixJvD7ZRbvcaC-ceXEzXYaoH4K5vaoRDsUyBHFkpIDPnsn3bnzovbvi0a2Gg=s660"
+          xlink:title="Title 2">
             <alt-text>Alternative text 2</alt-text>
             <caption><p>Google doodle from 14 March 2003</p></caption>
           </graphic>
@@ -218,14 +225,18 @@
       <abstract>
         <p>Abstract text</p>
       </abstract>
-      <graphic xlink:href="https://lh3.googleusercontent.com/dB7iirJ3ncQaVMBGE2YX-WCeoAVIChb6NAzoFcKCFChMsrixJvD7ZRbvcaC-ceXEzXYaoH4K5vaoRDsUyBHFkpIDPnsn3bnzovbvi0a2Gg=s660">
+      <graphic id="graphic003"
+      xlink:href="https://lh3.googleusercontent.com/dB7iirJ3ncQaVMBGE2YX-WCeoAVIChb6NAzoFcKCFChMsrixJvD7ZRbvcaC-ceXEzXYaoH4K5vaoRDsUyBHFkpIDPnsn3bnzovbvi0a2Gg=s660"
+      xlink:href="Title 3">
         <alt-text>Alternative text 1</alt-text>
         <caption><p>Google doodle from 14 March 2003</p></caption>
       </graphic>
       <alternatives>
         <tex-math><![CDATA[e=mc^2]]></tex-math>
         <mml:math display="block" xmlns:mml="http://www.w3.org/1998/Math/MathML"><mml:mrow><mml:mi>e</mml:mi><mml:mo>=</mml:mo><mml:mi>m</mml:mi><mml:msup><mml:mi>c</mml:mi><mml:mn>2</mml:mn></mml:msup></mml:mrow></mml:math>
-        <graphic xlink:href="https://lh3.googleusercontent.com/dB7iirJ3ncQaVMBGE2YX-WCeoAVIChb6NAzoFcKCFChMsrixJvD7ZRbvcaC-ceXEzXYaoH4K5vaoRDsUyBHFkpIDPnsn3bnzovbvi0a2Gg=s660">
+        <graphic id="graphic004"
+        xlink:href="https://lh3.googleusercontent.com/dB7iirJ3ncQaVMBGE2YX-WCeoAVIChb6NAzoFcKCFChMsrixJvD7ZRbvcaC-ceXEzXYaoH4K5vaoRDsUyBHFkpIDPnsn3bnzovbvi0a2Gg=s660"
+        xlink:href="Title 4">
           <alt-text>Alternative text 2</alt-text>
           <caption><p>Google doodle from 14 March 2003</p></caption>
         </graphic>
@@ -233,6 +244,15 @@
     </disp-formula>
     <p>This formula is important because…</p>
   </sec>
+</sec>
+<sec id="figures">
+  <fig id="fig-1">
+    <caption>
+      <p>bar</p>
+    </caption>
+    <alt-text>alternative-decription</alt-text>
+    <graphic xlink:href="foo.png" xlink:alt-text="baz" />
+  </fig>
 </sec>
 <sec id="code-blocks">
   <title>Code Blocks</title>
diff --git a/test/tables/planets.latex b/test/tables/planets.latex
--- a/test/tables/planets.latex
+++ b/test/tables/planets.latex
@@ -17,16 +17,16 @@
 \bottomrule\noalign{}
 \endlastfoot
 \multicolumn{2}{@{}c}{%
-\multirow{4}{*}{Terrestrial planets}} & Mercury & 0.330 & 4,879 & 5427 & 3.7 &
+\multirow{4}{=}{Terrestrial planets}} & Mercury & 0.330 & 4,879 & 5427 & 3.7 &
 4222.6 & 57.9 & 167 & 0 & Closest to the Sun \\
 & & Venus & 4.87 & 12,104 & 5243 & 8.9 & 2802.0 & 108.2 & 464 & 0 & \\
 & & Earth & 5.97 & 12,756 & 5514 & 9.8 & 24.0 & 149.6 & 15 & 1 & Our world \\
 & & Mars & 0.642 & 6,792 & 3933 & 3.7 & 24.7 & 227.9 & -65 & 2 & The red
 planet \\
-\multirow{4}{*}{Jovian planets} & \multirow{2}{*}{Gas giants} & Jupiter & 1898 &
+\multirow{4}{=}{Jovian planets} & \multirow{2}{=}{Gas giants} & Jupiter & 1898 &
 142,984 & 1326 & 23.1 & 9.9 & 778.6 & -110 & 67 & The largest planet \\
 & & Saturn & 568 & 120,536 & 687 & 9.0 & 10.7 & 1433.5 & -140 & 62 & \\
-& \multirow{2}{*}{Ice giants} & Uranus & 86.8 & 51,118 & 1271 & 8.7 & 17.2 &
+& \multirow{2}{=}{Ice giants} & Uranus & 86.8 & 51,118 & 1271 & 8.7 & 17.2 &
 2872.5 & -195 & 27 & \\
 & & Neptune & 102 & 49,528 & 1638 & 11.0 & 16.1 & 4495.1 & -200 & 14 & \\
 \multicolumn{2}{@{}c}{%
diff --git a/test/tables/students.latex b/test/tables/students.latex
--- a/test/tables/students.latex
+++ b/test/tables/students.latex
@@ -20,15 +20,15 @@
 \endhead
 \bottomrule\noalign{}
 \endlastfoot
-\multicolumn{2}{@{}l@{}}{%
+\multicolumn{2}{@{}>{\raggedright\arraybackslash}p{(\columnwidth - 2\tabcolsep) * \real{1.0000} + 2\tabcolsep}@{}}{%
 Computer Science} \\
 3741255 & Jones, Martha \\
 4077830 & Pierce, Benjamin \\
 5151701 & Kirk, James \\
-\multicolumn{2}{@{}l@{}}{%
+\multicolumn{2}{@{}>{\raggedright\arraybackslash}p{(\columnwidth - 2\tabcolsep) * \real{1.0000} + 2\tabcolsep}@{}}{%
 Russian Literature} \\
 3971244 & Nim, Victor \\
-\multicolumn{2}{@{}l@{}}{%
+\multicolumn{2}{@{}>{\raggedright\arraybackslash}p{(\columnwidth - 2\tabcolsep) * \real{1.0000} + 2\tabcolsep}@{}}{%
 Astrophysics} \\
 4100332 & Petrov, Alexandra \\
 4100332 & Toyota, Hiroko \\
diff --git a/test/typst-reader.native b/test/typst-reader.native
--- a/test/typst-reader.native
+++ b/test/typst-reader.native
@@ -3710,7 +3710,7 @@
                           [ Para
                               [ Span
                                   ( "" , [ "box" ] , [] )
-                                  [ Math InlineMath "\8668"
+                                  [ Math InlineMath "\\rightsquigarrow"
                                   , Str "\8192"
                                   , Code
                                       ( "" , [] , [] ) "arrow.squiggly"
diff --git a/test/writer.man b/test/writer.man
--- a/test/writer.man
+++ b/test/writer.man
@@ -296,8 +296,7 @@
 .PP
 M.A.\ 2007
 .PP
-B.
-Williams
+B. Williams
 .PP
    *   *   *   *   *
 .SH Definition Lists
@@ -484,8 +483,11 @@
 .PP
 `He said, \[lq]I want to go.\[rq]' Were you alive in the 70\[cq]s?
 .PP
-Here is some quoted `\f[CR]code\f[R]' and a \[lq]quoted
-link (http://example.com/?foo=1&bar=2)\[rq].
+Here is some quoted `\f[CR]code\f[R]' and a \[lq]\c
+.UR http://example.com/?foo=1&bar=2
+quoted link
+.UE \c
+\[rq].
 .PP
 Some dashes: one\[em]two \[em] three\[em]four \[em] five.
 .PP
@@ -602,7 +604,10 @@
 .PP
 with_underscore
 .PP
-Email link (mailto:nobody@nowhere.net)
+\c
+.MT nobody@nowhere.net
+Email link
+.ME \c
 .PP
 Empty.
 .SS Reference
@@ -628,27 +633,42 @@
 .PP
 Foo biz.
 .SS With ampersands
-Here\[cq]s a link with an ampersand in the
-URL (http://example.com/?foo=1&bar=2).
+Here\[cq]s a \c
+.UR http://example.com/?foo=1&bar=2
+link with an ampersand in the URL
+.UE \c
+\&.
 .PP
-Here\[cq]s a link with an amersand in the link text: AT&T (http://att.com/).
+Here\[cq]s a link with an amersand in the link text: \c
+.UR http://att.com/
+AT&T
+.UE \c
+\&.
 .PP
 Here\[cq]s an inline link.
 .PP
 Here\[cq]s an inline link in pointy braces.
 .SS Autolinks
-With an ampersand: <http://example.com/?foo=1&bar=2>
+With an ampersand: \c
+.UR http://example.com/?foo=1&bar=2
+.UE \c
 .IP \[bu] 2
 In a list?
 .IP \[bu] 2
-<http://example.com/>
+\c
+.UR http://example.com/
+.UE \c
 .IP \[bu] 2
 It should.
 .PP
-An e-mail address: <nobody@nowhere.net>
+An e-mail address: \c
+.MT nobody@nowhere.net
+.ME \c
 .RS
 .PP
-Blockquoted: <http://example.com/>
+Blockquoted: \c
+.UR http://example.com/
+.UE \c
 .RE
 .PP
 Auto-links should not occur here: \f[CR]<http://example.com/>\f[R]
@@ -701,8 +721,11 @@
 .SS [3]
 .PP
 This is \f[I]easier\f[R] to type.
-Inline notes may contain links (http://google.com) and \f[CR]]\f[R] verbatim
-characters, as well as [bracketed text].
+Inline notes may contain \c
+.UR http://google.com
+links
+.UE \c
+\ and \f[CR]]\f[R] verbatim characters, as well as [bracketed text].
 .SS [4]
 .PP
 In quote.
diff --git a/test/writer.ms b/test/writer.ms
--- a/test/writer.ms
+++ b/test/writer.ms
@@ -436,8 +436,7 @@
 .PP
 M.A.\ 2007
 .PP
-B.
-Williams
+B. Williams
 .HLINE
 .SH 1
 Definition Lists
@@ -952,9 +951,14 @@
 .pdfhref M "images"
 .LP
 From \[lq]Voyage dans la Lune\[rq] by Georges Melies (1902):
-[IMAGE: lalune]
+\" .IMAGE "lalune.jpg"
+.ce 1
+lalune
+.sp 1
 .LP
-Here is a movie [IMAGE: movie] icon.
+Here is a movie
+[IMAGE: movie] \" "movie.jpg"
+icon.
 .HLINE
 .SH 1
 Footnotes
diff --git a/test/writer.typst b/test/writer.typst
--- a/test/writer.typst
+++ b/test/writer.typst
@@ -633,9 +633,9 @@
 These shouldn’t be math:
 
 - To get the famous equation, write `$e = mc^2$`.
-- \$22,000 is a #emph[lot] of money. So is \$34,000. (It worked if "lot" is
+- \$22,000 is a #emph[lot] of money. So is \$34,000. \(It worked if "lot" is
   emphasized.)
-- Shoes (\$20) and socks (\$5).
+- Shoes \(\$20) and socks \(\$5).
 - Escaped `$`: \$73 #emph[this should be emphasized] 23\$.
 
 Here’s a LaTeX table:
@@ -678,7 +678,7 @@
 
 Right bracket: \]
 
-Left paren: (
+Left paren: \(
 
 Right paren: )
 
@@ -777,15 +777,15 @@
 
 = Images
 <images>
-From "Voyage dans la Lune" by Georges Melies (1902):
+From "Voyage dans la Lune" by Georges Melies \(1902):
 
-#figure([#image("lalune.jpg")],
+#figure([#box(width: 150.0pt, image("lalune.jpg"))],
   caption: [
     lalune
   ]
 )
 
-Here is a movie #image("movie.jpg") icon.
+Here is a movie #box(width: 20.0pt, image("movie.jpg")) icon.
 
 #horizontalrule
 
@@ -795,8 +795,8 @@
 after the footnote reference. It need not be placed at the end of the document.]
 and another.#footnote[Here’s the long note. This one contains multiple blocks.
 
-Subsequent blocks are indented to show that they belong to the footnote (as with
-list items).
+Subsequent blocks are indented to show that they belong to the footnote \(as
+with list items).
 
 ```
   { <code> }
