diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -55,28 +55,34 @@
 ----------------------------------
 
 Almost all the bugs on the issue tracker have one or more associated
-tags. These are used to indicate the *difficulty* and *nature* of a
+tags. These are used to indicate the *complexity* and *nature* of a
 bug. There is not yet a way to indicate priority. An up to date
 summary of issues can be found [here](https://github.com/jgm/pandoc/labels).
 
+* [beginner-friendly] — The perfect starting point for new contributors. The
+  issue is generic and can be resolved without deep knowledge of the code
+  base.
 * [enhancement] — A feature which would be desirable. We recommend
   you discuss any proposed enhancement on pandoc-discuss before
   writing code.
 * [bug] — A problem which needs to be fixed.
-* [minor] — The fix should only be a couple of lines.
-* [major] — The fix might require structural changes or in depth knowledge of
-the code base.
-* [reader] — A request to add a new input format.
-* [writer] — A request to add a new output format.
-* [docs]   — A discrepency or ambiguity in the documentation.
-* [inprogress] — Someone is actively working on or planning to work on the
+* [complexity:low] — The fix should only be a couple of lines.
+* [complexity:high] — The fix might require structural changes or in depth
+  knowledge of the code base.
+* [new:reader] — A request to add a new input format.
+* [new:writer] — A request to add a new output format.
+* [docs] — A discrepency,  or ambiguity in the documentation.
+* [status:in-progress] — Someone is actively working on or planning to work on the
   ticket.
-* [more discussion needed] — It is unclear what the correct approach
+* [status:more-discussion-needed] — It is unclear what the correct approach
   to solving the ticket is. Before starting on tickets such as this it
   would be advisable to post on the ticket.
-* [more info needed] — We require more information from a user before
+* [status:more-info-needed] — We require more information from a user before
   we can classify a report properly.
 
+Issues related to a specific format are tagged accordingly, e.g. feature request
+or bug reports related to Markdown are labelled with [format:markdown].
+
 Have an idea for a new feature?
 -------------------------------
 
@@ -242,7 +248,7 @@
     cabal flag is used.  It is generated from `src/Text/Pandoc/Data.hsb` using
     the preprocessor [hsb2hs].
   - `Text.Pandoc.Highlighting` contains the interface to the
-    highlighting-kate library, which is used for code syntax highlighting.
+    skylighting library, which is used for code syntax highlighting.
   - `Text.Pandoc.ImageSize` is a utility module containing functions for
     calculating image sizes from the contents of image files.
   - `Text.Pandoc.MIME` contains functions for associating MIME types
@@ -275,15 +281,17 @@
 [EditorConfig]: http://editorconfig.org/
 [Haskell platform]: http://www.haskell.org/platform/
 [hsb2hs]: http://hackage.haskell.org/package/hsb2hs
+[beginner-friendly]: https://github.com/jgm/pandoc/labels/beginner-friendly
 [enhancement]: https://github.com/jgm/pandoc/labels/enhancement
 [bug]: https://github.com/jgm/pandoc/labels/bug
-[minor]: https://github.com/jgm/pandoc/labels/Minor
-[major]: https://github.com/jgm/pandoc/labels/Major
-[reader]: https://github.com/jgm/pandoc/labels/Reader
-[writer]: https://github.com/jgm/pandoc/labels/Writer
+[complexity:low]: https://github.com/jgm/pandoc/labels/complexity:low
+[complexity:high]: https://github.com/jgm/pandoc/labels/complexity:high
 [docs]: https://github.com/jgm/pandoc/labels/docs
-[inprogress]: https://github.com/jgm/pandoc/labels/inprogress
-[more discussion needed]: https://github.com/jgm/pandoc/labels/More%20discussion%20needed
-[more info needed]: https://github.com/jgm/pandoc/labels/More%20info%20needed
+[format:markdown]: https://github.com/jgm/pandoc/labels/format:markdown
+[new:reader]: https://github.com/jgm/pandoc/labels/new:reader
+[new:writer]: https://github.com/jgm/pandoc/labels/new:writer
+[status:in-progress]: https://github.com/jgm/pandoc/labels/status:in-progress
+[status:more-discussion-needed]: https://github.com/jgm/pandoc/labels/status:more-discussion-needed
+[status:more-info-needed]: https://github.com/jgm/pandoc/labels/status:more-info-needed
 [stack]: https://github.com/commercialhaskell/stack
 
diff --git a/COPYRIGHT b/COPYRIGHT
--- a/COPYRIGHT
+++ b/COPYRIGHT
@@ -1,5 +1,5 @@
 Pandoc
-Copyright (C) 2006-2016 John MacFarlane <jgm at berkeley dot edu>
+Copyright (C) 2006-2017 John MacFarlane <jgm at berkeley dot edu>
 
 This code is released under the [GPL], version 2 or later:
 
diff --git a/INSTALL.md b/INSTALL.md
--- a/INSTALL.md
+++ b/INSTALL.md
@@ -7,6 +7,18 @@
   - For PDF output, you'll also need to install LaTeX.
     We recommend [MiKTeX](http://miktex.org/).
 
+  - If you'd prefer, you can extract the pandoc and pandoc-citeproc
+    executables from the MSI and copy them directly to any directory,
+    without running the installer.  Here is an example showing how to
+    extract the executables from the pandoc-1.19.1 installer and copy
+    them to `C:\Utils\Console\`:
+
+        mkdir "%TEMP%\pandoc\"
+        start /wait msiexec.exe /a pandoc-1.19.1-windows.msi /qn targetdir="%TEMP%\pandoc\"
+        copy /y "%TEMP%\pandoc\pandoc.exe" C:\Utils\Console\
+        copy /y "%TEMP%\pandoc\pandoc-citeproc.exe" C:\Utils\Console\
+        rmdir /s /q "%TEMP%\pandoc\"
+
 ## Mac OS X
 
   - There is a package installer at pandoc's [download page].
@@ -14,6 +26,16 @@
     by downloading [this script][uninstaller]
     and running it with `perl uninstall-pandoc.pl`.
 
+  - It is possible to extract the pandoc and pandoc-citeproc
+    executables from the osx pkg file, if you'd rather not run
+    the installer.  To do this (for the version 1.19.1 package):
+
+        mkdir pandoc-extract
+        cd pandoc-extract
+        xar -x ../pandoc-1.19.1-osx.pkg
+        cat pandoc.pkg/Payload | gunzip -dc | cpio -i
+        # executables are now in ./usr/bin/, man pages in ./usr/share/man
+
   - You can also install pandoc using
     [homebrew](http://brew.sh): `brew install pandoc`.
 
@@ -39,7 +61,7 @@
         sudo dpkg -i $DEB
 
     where `$DEB` is the path to the downloaded deb, will
-    will install the `pandoc` and `pandoc-citeproc` executables
+    install the `pandoc` and `pandoc-citeproc` executables
     and man pages.  If you use an RPM-based distro, you may be
     able to install this deb using `alien`, or try
 
@@ -55,7 +77,7 @@
 
   - If the version in your repository is too old and you cannot
     use the deb we provide, you can install from source, using the
-    instructions below under [Installing from source].
+    instructions below under [Compiling from source].
     Note that most distros have the Haskell platform in their
     package repositories.  For example, on Debian/Ubuntu,
     you can install it with `apt-get install haskell-platform`.
@@ -160,16 +182,16 @@
     use the locale-sensitive unicode collation algorithm instead,
     specify the `unicode_collation` flag:
 
-       cabal install pandoc-citeproc -funicode_collation
+        cabal install pandoc-citeproc -funicode_collation
 
     Note that this requires the `text-icu` library, which in turn
     depends on the C library `icu4c`.  Installation directions
     vary by platform.  Here is how it might work on OSX with homebrew:
 
-       brew install icu4c
-       cabal install --extra-lib-dirs=/usr/local/Cellar/icu4c/51.1/lib \
-         --extra-include-dirs=/usr/local/Cellar/icu4c/51.1/include \
-         -funicode_collation text-icu pandoc-citeproc
+        brew install icu4c
+        cabal install --extra-lib-dirs=/usr/local/Cellar/icu4c/51.1/lib \
+          --extra-include-dirs=/usr/local/Cellar/icu4c/51.1/include \
+          -funicode_collation text-icu pandoc-citeproc
 
 6.  The `pandoc.1` man page will be installed automatically.  cabal shows
     you where it is installed: you may need to set your `MANPATH`
diff --git a/MANUAL.txt b/MANUAL.txt
--- a/MANUAL.txt
+++ b/MANUAL.txt
@@ -1,6 +1,6 @@
 % Pandoc User's Guide
 % John MacFarlane
-% December 10, 2016
+% January 29, 2017
 
 Synopsis
 ========
@@ -67,7 +67,7 @@
 [LaTeX]: http://latex-project.org
 [`beamer`]: https://ctan.org/pkg/beamer
 [Beamer User's Guide]: http://ctan.math.utah.edu/ctan/tex-archive/macros/latex/contrib/beamer/doc/beameruserguide.pdf
-[ConTeXt]: http://contextgarden.net/
+[ConTeXt]: http://www.contextgarden.net/
 [RTF]: http://en.wikipedia.org/wiki/Rich_Text_Format
 [DocBook]: http://docbook.org
 [txt2tags]: http://txt2tags.org
@@ -81,13 +81,13 @@
 [ZimWiki markup]: http://zim-wiki.org/manual/Help/Wiki_Syntax.html
 [TWiki markup]: http://twiki.org/cgi-bin/view/TWiki/TextFormattingRules
 [Haddock markup]: https://www.haskell.org/haddock/doc/html/ch03s08.html
-[groff man]: http://developer.apple.com/DOCUMENTATION/Darwin/Reference/ManPages/man7/groff_man.7.html
+[groff man]: http://man7.org/linux/man-pages/man7/groff_man.7.html
 [Haskell]: https://www.haskell.org
 [GNU Texinfo]: http://www.gnu.org/software/texinfo/
 [Emacs Org mode]: http://orgmode.org
 [AsciiDoc]: http://www.methods.co.nz/asciidoc/
 [DZSlides]: http://paulrouget.com/dzslides/
-[Word docx]: http://www.microsoft.com/interop/openup/openxml/default.aspx
+[Word docx]: https://en.wikipedia.org/wiki/Office_Open_XML
 [PDF]: https://www.adobe.com/pdf/
 [reveal.js]: http://lab.hakim.se/reveal-js/
 [FictionBook2]: http://www.fictionbook.org/index.php/Eng:XML_Schema_Fictionbook_2.1
@@ -563,11 +563,12 @@
 :   Determine how text is wrapped in the output (the source
     code, not the rendered version).  With `auto` (the default),
     pandoc will attempt to wrap lines to the column width specified by
-    `--columns` (default 80).  With `none`, pandoc will not wrap
+    `--columns` (default 72).  With `none`, pandoc will not wrap
     lines at all.  With `preserve`, pandoc will attempt to
     preserve the wrapping from the source document (that is,
     where there are nonsemantic newlines in the source, there
     will be nonsemantic newlines in the output as well).
+    Automatic wrapping does not currently work in HTML output.
 
 `--no-wrap`
 
@@ -601,9 +602,10 @@
 
 :   Specifies the coloring style to be used in highlighted source code.
     Options are `pygments` (the default), `kate`, `monochrome`,
-    `espresso`, `zenburn`, `haddock`, and `tango`.  For more information
-    on syntax highlighting in pandoc, see [Syntax highlighting], below.
-    See also `--list-highlight-styles`.
+    `breezeDark`, `espresso`, `zenburn`, `haddock`, and `tango`.
+    For more information on syntax highlighting in pandoc, see
+    [Syntax highlighting], below.  See also
+    `--list-highlight-styles`.
 
 `-H` *FILE*, `--include-in-header=`*FILE*
 
@@ -1314,6 +1316,9 @@
 :   allows font encoding to be specified through `fontenc` package (with `pdflatex`);
     default is `T1` (see guide to [LaTeX font encodings])
 
+`microtypeoptions`
+:    options to pass to the microtype package
+
 `colorlinks`
 :   add color to link text; automatically enabled if any of `linkcolor`, `citecolor`,
     `urlcolor`, or `toccolor` are set
@@ -3194,7 +3199,9 @@
 
 The footnotes themselves need not be placed at the end of the
 document.  They may appear anywhere except inside other block elements
-(lists, block quotes, tables, etc.).
+(lists, block quotes, tables, etc.).  Each footnote should be
+separated from surrounding content (including other footnotes)
+by blank lines.
 
 #### Extension: `inline_notes` ####
 
@@ -3376,6 +3383,14 @@
 only, but the bibliography will contain entries for `item1`, `item2`, and
 `item3`.
 
+It is possible to create a bibliography with all the citations,
+whether or not they appear in the document, by using a wildcard:
+
+    ---
+    nocite: |
+      @*
+    ...
+
 For LaTeX or PDF output, you can also use [`natbib`] or [`biblatex`]
 to render bibliography. In order to do so, specify bibliography files as
 outlined above, and add `--natbib` or `--biblatex` argument to `pandoc`
@@ -4105,6 +4120,7 @@
 Jesse Rosenthal,
 Joe Hillenbrand,
 John MacFarlane,
+John Muccigrosso,
 Jonas Smedegaard,
 Jonathan Daugherty,
 Jose Luis Duran,
@@ -4115,7 +4131,6 @@
 Jérémy Bobbio,
 Kelsey Hightower,
 Kolen Cheung,
-KolenCheung,
 Konstantin Zudov,
 Kristof Bastiaensen,
 Lars-Dominik Braun,
@@ -4179,10 +4194,13 @@
 Václav Zeman,
 Viktor Kronvall,
 Vincent,
+Václav Haisman,
 Václav Zeman,
+Wandmalfarbe,
 Waldir Pimenta,
 Wikiwide,
 Xavier Olive,
+bumper314,
 csforste,
 infinity0x,
 nkalvi,
@@ -4193,6 +4211,7 @@
 rski,
 shreevatsa.public,
 takahashim,
+tgkokk,
 thsutton.
 
 [GPL]: http://www.gnu.org/copyleft/gpl.html "GNU General Public License"
diff --git a/README.md b/README.md
--- a/README.md
+++ b/README.md
@@ -1,12 +1,14 @@
 Pandoc
 ======
 
-[![license](https://img.shields.io/badge/license-GPLv2+-brightgreen.svg)](https://www.gnu.org/licenses/gpl.html)
-[![hackage release](https://img.shields.io/hackage/v/pandoc.svg?label=current+release)](http://hackage.haskell.org/package/pandoc)
+[![github release](https://img.shields.io/github/release/jgm/pandoc.svg?label=current+release)](https://github.com/jgm/pandoc/releases)
+[![hackage release](https://img.shields.io/hackage/v/pandoc.svg?label=hackage)](http://hackage.haskell.org/package/pandoc)
+[![homebrew](https://img.shields.io/homebrew/v/pandoc.svg)](http://brewformulas.org/Pandoc)
 [![stackage LTS package](http://stackage.org/package/pandoc/badge/lts)](http://stackage.org/lts/package/pandoc)
-[![github release](https://img.shields.io/github/release/jgm/pandoc.svg?label=github+release)](https://github.com/jgm/pandoc/releases)
-[![travis build status](https://img.shields.io/travis/jgm/pandoc.svg)](https://travis-ci.org/jgm/pandoc)
+[![travis build status](https://img.shields.io/travis/jgm/pandoc/master.svg?label=travis+build)](https://travis-ci.org/jgm/pandoc)
 [![appveyor build status](https://ci.appveyor.com/api/projects/status/nvqs4ct090igjiqc?svg=true)](https://ci.appveyor.com/project/jgm/pandoc)
+[![license](https://img.shields.io/badge/license-GPLv2+-lightgray.svg)](https://www.gnu.org/licenses/gpl.html)
+[![pandoc-discuss on google groups](https://img.shields.io/badge/pandoc-discuss-red.svg?style=social)](https://groups.google.com/forum/#!forum/pandoc-discuss)
 
 
 The universal markup converter
@@ -69,7 +71,7 @@
 [LaTeX]: http://latex-project.org
 [`beamer`]: https://ctan.org/pkg/beamer
 [Beamer User's Guide]: http://ctan.math.utah.edu/ctan/tex-archive/macros/latex/contrib/beamer/doc/beameruserguide.pdf
-[ConTeXt]: http://contextgarden.net/
+[ConTeXt]: http://www.contextgarden.net/
 [RTF]: http://en.wikipedia.org/wiki/Rich_Text_Format
 [DocBook]: http://docbook.org
 [txt2tags]: http://txt2tags.org
@@ -83,13 +85,13 @@
 [ZimWiki markup]: http://zim-wiki.org/manual/Help/Wiki_Syntax.html
 [TWiki markup]: http://twiki.org/cgi-bin/view/TWiki/TextFormattingRules
 [Haddock markup]: https://www.haskell.org/haddock/doc/html/ch03s08.html
-[groff man]: http://developer.apple.com/DOCUMENTATION/Darwin/Reference/ManPages/man7/groff_man.7.html
+[groff man]: http://man7.org/linux/man-pages/man7/groff_man.7.html
 [Haskell]: https://www.haskell.org
 [GNU Texinfo]: http://www.gnu.org/software/texinfo/
 [Emacs Org mode]: http://orgmode.org
 [AsciiDoc]: http://www.methods.co.nz/asciidoc/
 [DZSlides]: http://paulrouget.com/dzslides/
-[Word docx]: http://www.microsoft.com/interop/openup/openxml/default.aspx
+[Word docx]: https://en.wikipedia.org/wiki/Office_Open_XML
 [PDF]: https://www.adobe.com/pdf/
 [reveal.js]: http://lab.hakim.se/reveal-js/
 [FictionBook2]: http://www.fictionbook.org/index.php/Eng:XML_Schema_Fictionbook_2.1
diff --git a/changelog b/changelog
--- a/changelog
+++ b/changelog
@@ -1,3 +1,124 @@
+pandoc (1.19.2)
+
+  * Use skylighting library instead of highlighting-kate for syntax
+    highlighting. Skylighting is faster and more accurate (#3363).
+    Later we'll be able to add features like warning messages, dynamic
+    loading of xml syntax definitions, and dynamic loading of themes.
+
+  * Added a new highlight style, `breezeDark`.
+
+  * Text.Pandoc.Highlighting: Update list of `listings` languages (#3374).
+    This allows more languages to be used when using the `--listings`
+    option.
+
+  * OpenDocument writer:
+
+    + Small refactoring.  Removed separate 'parent' parameter in paraStyle.
+    + Don't profilerate text styles unnecessarily (#3371).
+      This change makes the writer create only as many temporary
+      text styles as are absolutely necessary. It also consolidates
+      adjacent nodes with the same style.
+
+  * Org reader (Albert Krewinkel):
+
+    + Allow short hand for single-line raw blocks (Albert Krewinkel,
+      #3366).  Single-line raw blocks can be given via `#+FORMAT: raw line`,
+      where `FORMAT` must be one of `latex`, `beamer`, `html`, or `texinfo`.
+    + Accept org-ref citations followed by commas (Albert Krewinkel).
+      Bugfix for an issue which, whenever the citation was immediately
+      followed by a comma, prevented correct parsing of org-ref citations.
+    + Ensure emphasis markup can be nested.  Nested emphasis markup (e.g.
+      `/*strong and emphasized*/`) was interpreted incorrectly in that the
+      inner markup was not recognized.
+    + Remove pipe char irking the haddock coverage tool (Albert Krewinkel).
+
+  * Docx reader: Empty header should be list of lists (Jesse Rosenthal).
+    In the past, the docx reader wrote an empty header as an empty list. It
+    should have the same width as a row (and be filled with empty cells).
+
+  * MediaWiki reader:
+
+    + Improved handling of display math (#3362).  Sometimes display math is
+      indented with more than one colon.  Previously we handled these cases
+      badly, generating definition lists and missing the math.
+    + Fix quotation mark parsing (#3336, tgkokk).  Change MediaWiki reader's
+      behavior when the smart option is parsed to match other readers'
+      behavior.
+
+  * Markdown reader:
+
+    + Fixed `-f markdown_github-hard_line_breaks+escaped_line_breaks`
+      (#3341).  Previously this did not properly enable escaped line breaks.
+    + Disallow space between inline code and attributes (#3326, #3323,
+      Mauro Bieg).
+
+  * DocBook5 writer: make id attribute xml:id, fixes #3329 (#3330, Mauro Bieg).
+
+  * Added some test cases for ODT reader (#3306, #3308, Hubert Plociniczak).
+
+  * LaTeX writer: allow tables with empty cells to count as "plain."
+    This addresses a problem of too-wide tables when empty cells
+    are used.  Thanks to Joost Kremers for reporting the issue.
+
+  * Org writer: prefix footnote numbers with `fn:` (Albert Krewinkel).
+    Unprefixed numbers where used by older org-mode versions, but are no
+    longer supported.
+
+  * HTML writer: don't process pars with empty RawInline, (#1040, #3327,
+    Mauro Bieg).
+
+  * Markdown writer: Fix display math with `--webtex` (#3298).
+
+  * Fix sample.lua so it properly handles raw blocks/inlines (#3358,
+    bumper314).
+
+  * Templates:
+
+    + default.latex: Moved geometry after hyperref (Václav Haisman).
+      Otherwise PDF sizes can be wrong in some circumstances.
+    + Copied a few changes from default.latex to default.beamer
+      (Wandmalfarbe).
+    + default.latex, default.beamer: Changed position of `\VerbatimNotes`
+      and `fancyvrb`.  This fixes hyperlinks on footnotes in documents
+      that contain verbatim in notes (#3361).  (Note: the beamer template
+      was updated to match the LaTeX template, but at this point verbatim
+      in notes seems not to work in beamer.)
+    + default.latex: Allow passing `microtypeoptions` to microtype
+      (Václav Haisman).
+    + default.latex: Add hyphen option to url package.
+    + default.docbook5: Fix namespace declarations (Mauro Bieg).
+
+  * Moved `make_osx_package.sh` to `osx/` directory.
+
+  * Travis continuous integration:
+
+    + Fix false positives with dist build.
+    + Speed improvements (Kolen Cheung, #3304, #3357).
+
+  * MANUAL.txt:
+
+    + Clarify that blank space is needed around footnotes (#3352).
+    + Fixed typo (#3351, Alexey Rogechev).
+    + Note that `--wrap=auto` does not work in HTML output.
+    + Default `--columns` width is 72, not 80.
+    + Fixed broken links (#3316, Kolen Cheung).
+    + Document usage of `@*` in nocite section (#3333, John Muccigrosso).
+
+  * INSTALL.md:
+
+    + Indent code so it's properly formatted (#3335, Bheesham Persaud).
+    + Added instructions for extracting binary from OSX, Windows packages.
+
+  * CONTRIBUTING.md: Describe labels currently used in issue tracker
+    (Albert Krewinkel).  The labels have changed over time, the list of
+    labels is updated to reflect the current set of labels used in the
+    issue tracker.
+
+  * Rearrange and extend badges in README (Albert Krewinkel, #3354)
+
+  * Bumped version bounds for dependencies.
+
+
 pandoc (1.19.1)
 
   * Set `PANDOC_VERSION` environment variable for filters (#2640).
diff --git a/data/sample.lua b/data/sample.lua
--- a/data/sample.lua
+++ b/data/sample.lua
@@ -173,6 +173,8 @@
 function RawInline(format, str)
   if format == "html" then
     return str
+  else
+    return ''
   end
 end
 
@@ -321,6 +323,8 @@
 function RawBlock(format, str)
   if format == "html" then
     return str
+  else
+    return ''
   end
 end
 
diff --git a/data/templates/default.beamer b/data/templates/default.beamer
--- a/data/templates/default.beamer
+++ b/data/templates/default.beamer
@@ -97,6 +97,9 @@
 \addbibresource{$bibliography$}
 $endfor$
 $endif$
+$if(verbatim-in-note)$
+\usepackage{fancyvrb}
+$endif$
 \hypersetup{
 $if(title-meta)$
             pdftitle={$title-meta$},
@@ -105,7 +108,7 @@
             pdfauthor={$author-meta$},
 $endif$
 $if(keywords)$
-            pdfkeywords={$for(keywords)$$keywords$$sep$; $endfor$},
+            pdfkeywords={$for(keywords)$$keywords$$sep$, $endfor$},
 $endif$
 $if(colorlinks)$
             colorlinks=true,
@@ -116,6 +119,10 @@
             pdfborder={0 0 0},
 $endif$
             breaklinks=true}
+\urlstyle{same}  % don't use monospace font for urls
+$if(verbatim-in-note)$
+\VerbatimFootnotes % allows verbatim text in footnotes
+$endif$
 $if(listings)$
 \usepackage{listings}
 $endif$
@@ -125,10 +132,6 @@
 $if(highlighting-macros)$
 $highlighting-macros$
 $endif$
-$if(verbatim-in-note)$
-\usepackage{fancyvrb}
-\VerbatimFootnotes % allows verbatim text in footnotes
-$endif$
 $if(tables)$
 \usepackage{longtable,booktabs}
 \usepackage{caption}
@@ -189,7 +192,7 @@
 \providecommand{\tightlist}{%
   \setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
 $if(numbersections)$
-\setcounter{secnumdepth}{5}
+\setcounter{secnumdepth}{$if(secnumdepth)$$secnumdepth$$else$5$endif$}
 $else$
 \setcounter{secnumdepth}{0}
 $endif$
diff --git a/data/templates/default.docbook5 b/data/templates/default.docbook5
--- a/data/templates/default.docbook5
+++ b/data/templates/default.docbook5
@@ -1,10 +1,11 @@
 <?xml version="1.0" encoding="utf-8" ?>
 <!DOCTYPE article>
+<article
+  xmlns="http://docbook.org/ns/docbook" version="5.0"
 $if(mathml)$
-<article xmlns="http://docbook.org/ns/docbook" version="5.0">
-$else$
-<article xmlns="http://docbook.org/ns/docbook" version="5.0">
+  xmlns:mml="http://www.w3.org/1998/Math/MathML"
 $endif$
+  xmlns:xlink="http://www.w3.org/1999/xlink" >
   <info>
     <title>$title$</title>
 $if(author)$
diff --git a/data/templates/default.latex b/data/templates/default.latex
--- a/data/templates/default.latex
+++ b/data/templates/default.latex
@@ -54,11 +54,12 @@
 \IfFileExists{upquote.sty}{\usepackage{upquote}}{}
 % use microtype if available
 \IfFileExists{microtype.sty}{%
-\usepackage{microtype}
+\usepackage[$for(microtypeoptions)$$microtypeoptions$$sep$,$endfor$]{microtype}
 \UseMicrotypeSet[protrusion]{basicmath} % disable protrusion for tt fonts
 }{}
-$if(geometry)$
-\usepackage[$for(geometry)$$geometry$$sep$,$endfor$]{geometry}
+\PassOptionsToPackage{hyphens}{url} % url is loaded by hyperref
+$if(verbatim-in-note)$
+\usepackage{fancyvrb}
 $endif$
 \usepackage[unicode=true]{hyperref}
 $if(colorlinks)$
@@ -84,6 +85,12 @@
 $endif$
             breaklinks=true}
 \urlstyle{same}  % don't use monospace font for urls
+$if(verbatim-in-note)$
+\VerbatimFootnotes % allows verbatim text in footnotes
+$endif$
+$if(geometry)$
+\usepackage[$for(geometry)$$geometry$$sep$,$endfor$]{geometry}
+$endif$
 $if(lang)$
 \ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex
   \usepackage[shorthands=off,$for(babel-otherlangs)$$babel-otherlangs$,$endfor$main=$babel-lang$]{babel}
@@ -116,10 +123,6 @@
 $endif$
 $if(highlighting-macros)$
 $highlighting-macros$
-$endif$
-$if(verbatim-in-note)$
-\usepackage{fancyvrb}
-\VerbatimFootnotes % allows verbatim text in footnotes
 $endif$
 $if(tables)$
 \usepackage{longtable,booktabs}
diff --git a/man/pandoc.1 b/man/pandoc.1
--- a/man/pandoc.1
+++ b/man/pandoc.1
@@ -1,10 +1,10 @@
 .\"t
-.TH PANDOC 1 "December 10, 2016" "pandoc 1.19.1"
+.TH PANDOC 1 "January 29, 2017" "pandoc 1.19.2"
 .SH NAME
 pandoc - general markup converter
 .SH SYNOPSIS
 .PP
-\f[C]pandoc\f[] [\f[I]options\f[]] [\f[I]input\-file\f[]]...
+\f[C]pandoc\f[] [\f[I]options\f[]] [\f[I]input\-file\f[]]\&...
 .SH DESCRIPTION
 .PP
 Pandoc is a Haskell library for converting from one markup format to
@@ -23,13 +23,13 @@
 It can also produce PDF output on systems where LaTeX, ConTeXt, or
 \f[C]wkhtmltopdf\f[] is installed.
 .PP
-Pandoc\[aq]s enhanced version of Markdown includes syntax for footnotes,
+Pandoc's enhanced version of Markdown includes syntax for footnotes,
 tables, flexible ordered lists, definition lists, fenced code blocks,
 superscripts and subscripts, strikeout, metadata blocks, automatic
 tables of contents, embedded LaTeX math, citations, and Markdown inside
 HTML block elements.
-(These enhancements, described further under Pandoc\[aq]s Markdown, can
-be disabled using the \f[C]markdown_strict\f[] input or output format.)
+(These enhancements, described further under Pandoc's Markdown, can be
+disabled using the \f[C]markdown_strict\f[] input or output format.)
 .PP
 In contrast to most existing tools for converting Markdown to HTML,
 which use regex substitutions, pandoc has a modular design: it consists
@@ -39,16 +39,16 @@
 Thus, adding an input or output format requires only adding a reader or
 writer.
 .PP
-Because pandoc\[aq]s intermediate representation of a document is less
+Because pandoc's intermediate representation of a document is less
 expressive than many of the formats it converts between, one should not
 expect perfect conversions between every format and every other.
 Pandoc attempts to preserve the structural elements of a document, but
 not formatting details such as margin size.
 And some document elements, such as complex tables, may not fit into
-pandoc\[aq]s simple document model.
-While conversions from pandoc\[aq]s Markdown to all formats aspire to be
-perfect, conversions from formats more expressive than pandoc\[aq]s
-Markdown can be expected to be lossy.
+pandoc's simple document model.
+While conversions from pandoc's Markdown to all formats aspire to be
+perfect, conversions from formats more expressive than pandoc's Markdown
+can be expected to be lossy.
 .SS Using \f[C]pandoc\f[]
 .PP
 If no \f[I]input\-file\f[] is specified, input is read from
@@ -137,11 +137,11 @@
 .PP
 will convert \f[C]hello.txt\f[] from Markdown to LaTeX.
 If no output file is specified (so that output goes to \f[I]stdout\f[]),
-or if the output file\[aq]s extension is unknown, the output format will
+or if the output file's extension is unknown, the output format will
 default to HTML.
 If no input file is specified (so that input comes from \f[I]stdin\f[]),
-or if the input files\[aq] extensions are unknown, the input format will
-be assumed to be Markdown unless explicitly specified.
+or if the input files' extensions are unknown, the input format will be
+assumed to be Markdown unless explicitly specified.
 .PP
 Pandoc uses the UTF\-8 character encoding for both input and output.
 If your local character encoding is not UTF\-8, you should pipe input
@@ -208,7 +208,7 @@
 .B \f[C]\-f\f[] \f[I]FORMAT\f[], \f[C]\-r\f[] \f[I]FORMAT\f[], \f[C]\-\-from=\f[]\f[I]FORMAT\f[], \f[C]\-\-read=\f[]\f[I]FORMAT\f[]
 Specify input format.
 \f[I]FORMAT\f[] can be \f[C]native\f[] (native Haskell), \f[C]json\f[]
-(JSON version of native AST), \f[C]markdown\f[] (pandoc\[aq]s extended
+(JSON version of native AST), \f[C]markdown\f[] (pandoc's extended
 Markdown), \f[C]markdown_strict\f[] (original unextended Markdown),
 \f[C]markdown_phpextra\f[] (PHP Markdown Extra),
 \f[C]markdown_github\f[] (GitHub\-Flavored Markdown),
@@ -227,10 +227,9 @@
 name.
 So, for example, \f[C]markdown_strict+footnotes+definition_lists\f[] is
 strict Markdown with footnotes and definition lists enabled, and
-\f[C]markdown\-pipe_tables+hard_line_breaks\f[] is pandoc\[aq]s Markdown
+\f[C]markdown\-pipe_tables+hard_line_breaks\f[] is pandoc's Markdown
 without pipe tables and with hard line breaks.
-See Pandoc\[aq]s Markdown, below, for a list of extensions and their
-names.
+See Pandoc's Markdown, below, for a list of extensions and their names.
 See \f[C]\-\-list\-input\-formats\f[] and \f[C]\-\-list\-extensions\f[],
 below.
 .RS
@@ -240,10 +239,9 @@
 Specify output format.
 \f[I]FORMAT\f[] can be \f[C]native\f[] (native Haskell), \f[C]json\f[]
 (JSON version of native AST), \f[C]plain\f[] (plain text),
-\f[C]markdown\f[] (pandoc\[aq]s extended Markdown),
-\f[C]markdown_strict\f[] (original unextended Markdown),
-\f[C]markdown_phpextra\f[] (PHP Markdown Extra),
-\f[C]markdown_github\f[] (GitHub\-Flavored Markdown),
+\f[C]markdown\f[] (pandoc's extended Markdown), \f[C]markdown_strict\f[]
+(original unextended Markdown), \f[C]markdown_phpextra\f[] (PHP Markdown
+Extra), \f[C]markdown_github\f[] (GitHub\-Flavored Markdown),
 \f[C]markdown_mmd\f[] (MultiMarkdown), \f[C]commonmark\f[] (CommonMark
 Markdown), \f[C]rst\f[] (reStructuredText), \f[C]html\f[] (XHTML),
 \f[C]html5\f[] (HTML5), \f[C]latex\f[] (LaTeX), \f[C]beamer\f[] (LaTeX
@@ -319,7 +317,7 @@
 at the output of \f[C]pandoc\ \-\-version\f[].
 A \f[C]reference.odt\f[], \f[C]reference.docx\f[], \f[C]epub.css\f[],
 \f[C]templates\f[], \f[C]slidy\f[], \f[C]slideous\f[], or \f[C]s5\f[]
-directory placed in this directory will override pandoc\[aq]s normal
+directory placed in this directory will override pandoc's normal
 defaults.
 .RE
 .TP
@@ -355,7 +353,7 @@
 .B \f[C]\-\-list\-extensions\f[]
 List supported Markdown extensions, one per line, followed by a
 \f[C]+\f[] or \f[C]\-\f[] indicating whether it is enabled by default in
-pandoc\[aq]s Markdown.
+pandoc's Markdown.
 .RS
 .RE
 .TP
@@ -401,8 +399,8 @@
 curly quotes, \f[C]\-\-\-\f[] to em\-dashes, \f[C]\-\-\f[] to
 en\-dashes, and \f[C]\&...\f[] to ellipses.
 Nonbreaking spaces are inserted after certain abbreviations, such as
-"Mr." (Note: This option is selected automatically when the output
-format is \f[C]latex\f[] or \f[C]context\f[], unless
+\[lq]Mr.\[rq] (Note: This option is selected automatically when the
+output format is \f[C]latex\f[] or \f[C]context\f[], unless
 \f[C]\-\-no\-tex\-ligatures\f[] is used.
 It has no effect for \f[C]latex\f[] input.)
 .RS
@@ -422,7 +420,7 @@
 .RE
 .TP
 .B \f[C]\-\-indented\-code\-classes=\f[]\f[I]CLASSES\f[]
-Specify classes to use for indented code blocks\-\-for example,
+Specify classes to use for indented code blocks\[en]for example,
 \f[C]perl,numberLines\f[] or \f[C]haskell\f[].
 Multiple classes may be separated by spaces or commas.
 .RS
@@ -450,7 +448,7 @@
 Specify an executable to be used as a filter transforming the pandoc AST
 after the input is parsed and before the output is written.
 The executable should read JSON from stdin and write JSON to stdout.
-The JSON must be formatted like pandoc\[aq]s own JSON input and output.
+The JSON must be formatted like pandoc's own JSON input and output.
 The name of the output format will be passed to the filter as the first
 argument.
 Hence,
@@ -524,7 +522,7 @@
 .TP
 .B \f[C]\-\-track\-changes=accept\f[]|\f[C]reject\f[]|\f[C]all\f[]
 Specifies what to do with insertions, deletions, and comments produced
-by the MS Word "Track Changes" feature.
+by the MS Word \[lq]Track Changes\[rq] feature.
 \f[C]accept\f[] (the default), inserts all insertions, and ignores all
 deletions.
 \f[C]reject\f[] inserts all deletions and ignores insertions.
@@ -550,8 +548,8 @@
 .SS General writer options
 .TP
 .B \f[C]\-s\f[], \f[C]\-\-standalone\f[]
-Produce output with an appropriate header and footer (e.g.
-a standalone HTML, LaTeX, TEI, or RTF file, not a fragment).
+Produce output with an appropriate header and footer (e.g.\ a standalone
+HTML, LaTeX, TEI, or RTF file, not a fragment).
 This option is set automatically for \f[C]pdf\f[], \f[C]epub\f[],
 \f[C]epub3\f[], \f[C]fb2\f[], \f[C]docx\f[], and \f[C]odt\f[] output.
 .RS
@@ -609,12 +607,13 @@
 Determine how text is wrapped in the output (the source code, not the
 rendered version).
 With \f[C]auto\f[] (the default), pandoc will attempt to wrap lines to
-the column width specified by \f[C]\-\-columns\f[] (default 80).
+the column width specified by \f[C]\-\-columns\f[] (default 72).
 With \f[C]none\f[], pandoc will not wrap lines at all.
 With \f[C]preserve\f[], pandoc will attempt to preserve the wrapping
 from the source document (that is, where there are nonsemantic newlines
 in the source, there will be nonsemantic newlines in the output as
 well).
+Automatic wrapping does not currently work in HTML output.
 .RS
 .RE
 .TP
@@ -659,8 +658,8 @@
 .B \f[C]\-\-highlight\-style=\f[]\f[I]STYLE\f[]
 Specifies the coloring style to be used in highlighted source code.
 Options are \f[C]pygments\f[] (the default), \f[C]kate\f[],
-\f[C]monochrome\f[], \f[C]espresso\f[], \f[C]zenburn\f[],
-\f[C]haddock\f[], and \f[C]tango\f[].
+\f[C]monochrome\f[], \f[C]breezeDark\f[], \f[C]espresso\f[],
+\f[C]zenburn\f[], \f[C]haddock\f[], and \f[C]tango\f[].
 For more information on syntax highlighting in pandoc, see Syntax
 highlighting, below.
 See also \f[C]\-\-list\-highlight\-styles\f[].
@@ -680,9 +679,8 @@
 .TP
 .B \f[C]\-B\f[] \f[I]FILE\f[], \f[C]\-\-include\-before\-body=\f[]\f[I]FILE\f[]
 Include contents of \f[I]FILE\f[], verbatim, at the beginning of the
-document body (e.g.
-after the \f[C]<body>\f[] tag in HTML, or the \f[C]\\begin{document}\f[]
-command in LaTeX).
+document body (e.g.\ after the \f[C]<body>\f[] tag in HTML, or the
+\f[C]\\begin{document}\f[] command in LaTeX).
 This can be used to include navigation bars or banners in HTML
 documents.
 This option can be used repeatedly to include multiple files.
@@ -706,9 +704,9 @@
 Produce a standalone HTML file with no external dependencies, using
 \f[C]data:\f[] URIs to incorporate the contents of linked scripts,
 stylesheets, images, and videos.
-The resulting file should be "self\-contained," in the sense that it
-needs no external files and no net access to be displayed properly by a
-browser.
+The resulting file should be \[lq]self\-contained,\[rq] in the sense
+that it needs no external files and no net access to be displayed
+properly by a browser.
 This option works only with HTML output formats, including
 \f[C]html\f[], \f[C]html5\f[], \f[C]html+lhs\f[], \f[C]html5+lhs\f[],
 \f[C]s5\f[], \f[C]slidy\f[], \f[C]slideous\f[], \f[C]dzslides\f[], and
@@ -719,9 +717,9 @@
 first source file is remote).
 Limitation: resources that are loaded dynamically through JavaScript
 cannot be incorporated; as a result, \f[C]\-\-self\-contained\f[] does
-not work with \f[C]\-\-mathjax\f[], and some advanced features (e.g.
-zoom or speaker notes) may not work in an offline "self\-contained"
-\f[C]reveal.js\f[] slide show.
+not work with \f[C]\-\-mathjax\f[], and some advanced features
+(e.g.\ zoom or speaker notes) may not work in an offline
+\[lq]self\-contained\[rq] \f[C]reveal.js\f[] slide show.
 .RS
 .RE
 .TP
@@ -792,15 +790,16 @@
 .RS
 .RE
 .TP
-.B \f[C]\-\-number\-offset=\f[]\f[I]NUMBER\f[][\f[C],\f[]\f[I]NUMBER\f[]\f[C],\f[]\f[I]...\f[]]
+.B \f[C]\-\-number\-offset=\f[]\f[I]NUMBER\f[][\f[C],\f[]\f[I]NUMBER\f[]\f[C],\f[]\f[I]\&...\f[]]
 Offset for section headings in HTML output (ignored in other output
 formats).
 The first number is added to the section number for top\-level headers,
 the second for second\-level headers, and so on.
 So, for example, if you want the first top\-level header in your
-document to be numbered "6", specify \f[C]\-\-number\-offset=5\f[].
+document to be numbered \[lq]6\[rq], specify
+\f[C]\-\-number\-offset=5\f[].
 If your document starts with a level\-2 header which you want to be
-numbered "1.5", specify \f[C]\-\-number\-offset=1,4\f[].
+numbered \[lq]1.5\[rq], specify \f[C]\-\-number\-offset=1,4\f[].
 Offsets are 0 by default.
 Implies \f[C]\-\-number\-sections\f[].
 .RS
@@ -1026,7 +1025,7 @@
 .TP
 .B \f[C]\-\-epub\-chapter\-level=\f[]\f[I]NUMBER\f[]
 Specify the header level at which to split the EPUB into separate
-"chapter" files.
+\[lq]chapter\[rq] files.
 The default is to split into chapters at level 1 headers.
 This option only affects the internal composition of the EPUB, not the
 way chapters and sections are displayed to users.
@@ -1055,7 +1054,7 @@
 .SS Citation rendering
 .TP
 .B \f[C]\-\-bibliography=\f[]\f[I]FILE\f[]
-Set the \f[C]bibliography\f[] field in the document\[aq]s metadata to
+Set the \f[C]bibliography\f[] field in the document's metadata to
 \f[I]FILE\f[], overriding any value set in the metadata, and process
 citations using \f[C]pandoc\-citeproc\f[].
 (This is equivalent to
@@ -1069,15 +1068,15 @@
 .RE
 .TP
 .B \f[C]\-\-csl=\f[]\f[I]FILE\f[]
-Set the \f[C]csl\f[] field in the document\[aq]s metadata to
-\f[I]FILE\f[], overriding any value set in the metadata.
+Set the \f[C]csl\f[] field in the document's metadata to \f[I]FILE\f[],
+overriding any value set in the metadata.
 (This is equivalent to \f[C]\-\-metadata\ csl=FILE\f[].) This option is
 only relevant with \f[C]pandoc\-citeproc\f[].
 .RS
 .RE
 .TP
 .B \f[C]\-\-citation\-abbreviations=\f[]\f[I]FILE\f[]
-Set the \f[C]citation\-abbreviations\f[] field in the document\[aq]s
+Set the \f[C]citation\-abbreviations\f[] field in the document's
 metadata to \f[I]FILE\f[], overriding any value set in the metadata.
 (This is equivalent to
 \f[C]\-\-metadata\ citation\-abbreviations=FILE\f[].) This option is
@@ -1164,7 +1163,7 @@
 The formula will be concatenated with the URL provided.
 If \f[I]URL\f[] is not specified, the CodeCogs will be used.
 Note: the \f[C]\-\-webtex\f[] option will affect Markdown output as well
-as HTML, which is useful if you\[aq]re targeting a version of Markdown
+as HTML, which is useful if you're targeting a version of Markdown
 without native math support.
 .RS
 .RE
@@ -1345,7 +1344,7 @@
 .RE
 .TP
 .B \f[C]meta\-json\f[]
-JSON representation of all of the document\[aq]s metadata
+JSON representation of all of the document's metadata
 .RS
 .RE
 .SS Language variables
@@ -1387,8 +1386,8 @@
 \f[C]div\f[]s with the \f[C]dir\f[] attribute (value \f[C]rtl\f[] or
 \f[C]ltr\f[]) can be used to override the base direction in some output
 formats.
-This may not always be necessary if the final renderer (e.g.
-the browser, when generating HTML) supports the Unicode Bidirectional
+This may not always be necessary if the final renderer (e.g.\ the
+browser, when generating HTML) supports the Unicode Bidirectional
 Algorithm.
 .PP
 When using LaTeX for bidirectional documents, only the \f[C]xelatex\f[]
@@ -1438,8 +1437,8 @@
 .RE
 .TP
 .B \f[C]section\-titles\f[]
-enables on "title pages" for new sections in \f[C]beamer\f[] documents
-(default = true).
+enables on \[lq]title pages\[rq] for new sections in \f[C]beamer\f[]
+documents (default = true).
 .RS
 .RE
 .TP
@@ -1548,6 +1547,11 @@
 .RS
 .RE
 .TP
+.B \f[C]microtypeoptions\f[]
+options to pass to the microtype package
+.RS
+.RE
+.TP
 .B \f[C]colorlinks\f[]
 add color to link text; automatically enabled if any of
 \f[C]linkcolor\f[], \f[C]citecolor\f[], \f[C]urlcolor\f[], or
@@ -1814,10 +1818,10 @@
 modifying your custom templates accordingly.
 An easy way to do this is to fork the pandoc\-templates repository and
 merge in changes after each pandoc release.
-.SH PANDOC\[aq]S MARKDOWN
+.SH PANDOC'S MARKDOWN
 .PP
 Pandoc understands an extended and slightly revised version of John
-Gruber\[aq]s Markdown syntax.
+Gruber's Markdown syntax.
 This document explains the syntax, noting differences from standard
 Markdown.
 Except where noted, these differences can be suppressed by using the
@@ -1826,7 +1830,7 @@
 name and disabled by adding \f[C]\-EXTENSION\f[].
 For example, \f[C]markdown_strict+footnotes\f[] is strict Markdown with
 footnotes enabled, while \f[C]markdown\-footnotes\-pipe_tables\f[] is
-pandoc\[aq]s Markdown without footnotes or pipe tables.
+pandoc's Markdown without footnotes or pipe tables.
 .SS Philosophy
 .PP
 Markdown is designed to be easy to write, and, even more importantly,
@@ -1834,16 +1838,16 @@
 .RS
 .PP
 A Markdown\-formatted document should be publishable as\-is, as plain
-text, without looking like it\[aq]s been marked up with tags or
-formatting instructions.
-\-\- John Gruber
+text, without looking like it's been marked up with tags or formatting
+instructions.
+\[en] John Gruber
 .RE
 .PP
-This principle has guided pandoc\[aq]s decisions in finding syntax for
+This principle has guided pandoc's decisions in finding syntax for
 tables, footnotes, and other extensions.
 .PP
-There is, however, one respect in which pandoc\[aq]s aims are different
-from the original aims of Markdown.
+There is, however, one respect in which pandoc's aims are different from
+the original aims of Markdown.
 Whereas Markdown was originally designed with HTML generation in mind,
 pandoc is designed for multiple output formats.
 Thus, while pandoc allows the embedding of raw HTML, it discourages it,
@@ -1867,8 +1871,8 @@
 There are two kinds of headers: Setext and ATX.
 .SS Setext\-style headers
 .PP
-A setext\-style header is a line of text "underlined" with a row of
-\f[C]=\f[] signs (for a level one header) or \f[C]\-\f[] signs (for a
+A setext\-style header is a line of text \[lq]underlined\[rq] with a row
+of \f[C]=\f[] signs (for a level one header) or \f[C]\-\f[] signs (for a
 level two header):
 .IP
 .nf
@@ -1950,7 +1954,7 @@
 (This syntax is compatible with PHP Markdown Extra.)
 .PP
 Note that although this syntax allows assignment of classes and
-key/value attributes, writers generally don\[aq]t use all of this
+key/value attributes, writers generally don't use all of this
 information.
 Identifiers, classes, and key/value attributes are used in HTML and
 HTML\-based formats such as EPUB and slidy.
@@ -2149,8 +2153,8 @@
 \f[]
 .fi
 .PP
-A "lazy" form, which requires the \f[C]>\f[] character only on the first
-line of each block, is also allowed:
+A \[lq]lazy\[rq] form, which requires the \f[C]>\f[] character only on
+the first line of each block, is also allowed:
 .IP
 .nf
 \f[C]
@@ -2378,8 +2382,8 @@
 \f[]
 .fi
 .PP
-This will produce a "compact" list.
-If you want a "loose" list, in which each item is formatted as a
+This will produce a \[lq]compact\[rq] list.
+If you want a \[lq]loose\[rq] list, in which each item is formatted as a
 paragraph, put spaces between the items:
 .IP
 .nf
@@ -2407,7 +2411,7 @@
 \f[]
 .fi
 .PP
-But Markdown also allows a "lazy" format:
+But Markdown also allows a \[lq]lazy\[rq] format:
 .IP
 .nf
 \f[C]
@@ -2456,8 +2460,8 @@
 \f[]
 .fi
 .PP
-As noted above, Markdown allows you to write list items "lazily,"
-instead of indenting continuation lines.
+As noted above, Markdown allows you to write list items
+\[lq]lazily,\[rq] instead of indenting continuation lines.
 However, if there are multiple paragraphs or other blocks in a list
 item, the first line of each must be indented.
 .IP
@@ -2523,8 +2527,8 @@
 and, if the list marker is a capital letter with a period, by at least
 two spaces.
 .PP
-The \f[C]fancy_lists\f[] extension also allows \[aq]\f[C]#\f[]\[aq] to
-be used as an ordered list marker in place of a numeral:
+The \f[C]fancy_lists\f[] extension also allows `\f[C]#\f[]' to be used
+as an ordered list marker in place of a numeral:
 .IP
 .nf
 \f[C]
@@ -2606,8 +2610,9 @@
 indented four spaces or one tab stop.
 The body of the definition (including the first line, aside from the
 colon or tilde) should be indented four spaces.
-However, as with other Markdown lists, you can "lazily" omit indentation
-except at the beginning of a paragraph or other block element:
+However, as with other Markdown lists, you can \[lq]lazily\[rq] omit
+indentation except at the beginning of a paragraph or other block
+element:
 .IP
 .nf
 \f[C]
@@ -2639,16 +2644,16 @@
 .fi
 .PP
 Note that space between items in a definition list is required.
-(A variant that loosens this requirement, but disallows "lazy" hard
-wrapping, can be activated with \f[C]compact_definition_lists\f[]: see
-Non\-pandoc extensions, below.)
+(A variant that loosens this requirement, but disallows \[lq]lazy\[rq]
+hard wrapping, can be activated with \f[C]compact_definition_lists\f[]:
+see Non\-pandoc extensions, below.)
 .SS Numbered example lists
 .SS Extension: \f[C]example_lists\f[]
 .PP
 The special list marker \f[C]\@\f[] can be used for sequentially
 numbered examples.
-The first list item with a \f[C]\@\f[] marker will be numbered
-\[aq]1\[aq], the next \[aq]2\[aq], and so on, throughout the document.
+The first list item with a \f[C]\@\f[] marker will be numbered `1', the
+next `2', and so on, throughout the document.
 The numbered examples need not occur in a single list; each new list
 using \f[C]\@\f[] will take up where the last stopped.
 So, for example:
@@ -2679,8 +2684,8 @@
 hyphens.
 .SS Compact and loose lists
 .PP
-Pandoc behaves differently from \f[C]Markdown.pl\f[] on some "edge
-cases" involving lists.
+Pandoc behaves differently from \f[C]Markdown.pl\f[] on some \[lq]edge
+cases\[rq] involving lists.
 Consider this source:
 .IP
 .nf
@@ -2695,14 +2700,15 @@
 \f[]
 .fi
 .PP
-Pandoc transforms this into a "compact list" (with no \f[C]<p>\f[] tags
-around "First", "Second", or "Third"), while Markdown puts \f[C]<p>\f[]
-tags around "Second" and "Third" (but not "First"), because of the blank
-space around "Third".
+Pandoc transforms this into a \[lq]compact list\[rq] (with no
+\f[C]<p>\f[] tags around \[lq]First\[rq], \[lq]Second\[rq], or
+\[lq]Third\[rq]), while Markdown puts \f[C]<p>\f[] tags around
+\[lq]Second\[rq] and \[lq]Third\[rq] (but not \[lq]First\[rq]), because
+of the blank space around \[lq]Third\[rq].
 Pandoc follows a simple rule: if the text is followed by a blank line,
 it is treated as a paragraph.
-Since "Second" is followed by a list, and not a blank line, it isn\[aq]t
-treated as a paragraph.
+Since \[lq]Second\[rq] is followed by a list, and not a blank line, it
+isn't treated as a paragraph.
 The fact that the list is followed by a blank line is irrelevant.
 (Note: Pandoc works this way even when the \f[C]markdown_strict\f[]
 format is specified.
@@ -2726,9 +2732,9 @@
 \f[C]{\ my\ code\ block\ }\f[] as the second paragraph of item two, and
 not as a code block.
 .PP
-To "cut off" the list after item two, you can insert some non\-indented
-content, like an HTML comment, which won\[aq]t produce visible output in
-any format:
+To \[lq]cut off\[rq] the list after item two, you can insert some
+non\-indented content, like an HTML comment, which won't produce visible
+output in any format:
 .IP
 .nf
 \f[C]
@@ -2992,7 +2998,7 @@
 separator lines.
 .PP
 Note: pandoc also recognizes pipe tables of the following form, as can
-be produced by Emacs\[aq] orgtbl\-mode:
+be produced by Emacs' orgtbl\-mode:
 .IP
 .nf
 \f[C]
@@ -3005,8 +3011,8 @@
 .PP
 The difference is that \f[C]+\f[] is used instead of \f[C]|\f[].
 Other orgtbl features are not supported.
-In particular, to get non\-default column alignment, you\[aq]ll need to
-add colons as above.
+In particular, to get non\-default column alignment, you'll need to add
+colons as above.
 .SS Metadata blocks
 .SS Extension: \f[C]pandoc_title_block\f[]
 .PP
@@ -3071,13 +3077,13 @@
 .PP
 Title blocks will always be parsed, but they will affect the output only
 when the \f[C]\-\-standalone\f[] (\f[C]\-s\f[]) option is chosen.
-In HTML output, titles will appear twice: once in the document head \-\-
-this is the title that will appear at the top of the window in a browser
-\-\- and once at the beginning of the document body.
+In HTML output, titles will appear twice: once in the document head
+\[en] this is the title that will appear at the top of the window in a
+browser \[en] and once at the beginning of the document body.
 The title in the document head can have an optional prefix attached
 (\f[C]\-\-title\-prefix\f[] or \f[C]\-T\f[] option).
-The title in the body appears as an H1 element with class "title", so it
-can be suppressed or reformatted with CSS.
+The title in the body appears as an H1 element with class
+\[lq]title\[rq], so it can be suppressed or reformatted with CSS.
 If a title prefix is specified with \f[C]\-T\f[] and no title block
 appears in the document, the title prefix will be used by itself as the
 HTML title.
@@ -3106,7 +3112,7 @@
 \f[]
 .fi
 .PP
-will also have "Pandoc User Manuals" in the footer.
+will also have \[lq]Pandoc User Manuals\[rq] in the footer.
 .IP
 .nf
 \f[C]
@@ -3114,7 +3120,7 @@
 \f[]
 .fi
 .PP
-will also have "Version 4.0" in the header.
+will also have \[lq]Version 4.0\[rq] in the header.
 .SS Extension: \f[C]yaml_metadata_block\f[]
 .PP
 A YAML metadata block is a valid YAML object, delimited by a line of
@@ -3253,7 +3259,7 @@
 \f[]
 .fi
 .PP
-This rule is easier to remember than standard Markdown\[aq]s rule, which
+This rule is easier to remember than standard Markdown's rule, which
 allows only the following characters to be backslash\-escaped:
 .IP
 .nf
@@ -3269,12 +3275,11 @@
 It will appear in TeX output as \f[C]~\f[] and in HTML and XML as
 \f[C]\\&#160;\f[] or \f[C]\\&nbsp;\f[].
 .PP
-A backslash\-escaped newline (i.e.
-a backslash occurring at the end of a line) is parsed as a hard line
-break.
+A backslash\-escaped newline (i.e.\ a backslash occurring at the end of
+a line) is parsed as a hard line break.
 It will appear in TeX output as \f[C]\\\\\f[] and in HTML as
 \f[C]<br\ />\f[].
-This is a nice alternative to Markdown\[aq]s "invisible" way of
+This is a nice alternative to Markdown's \[lq]invisible\[rq] way of
 indicating hard line breaks using two trailing spaces on a line.
 .PP
 Backslash escapes do not work in verbatim contexts.
@@ -3286,7 +3291,7 @@
 quotes, \f[C]\-\-\-\f[] to em\-dashes, \f[C]\-\-\f[] to en\-dashes, and
 \f[C]\&...\f[] to ellipses.
 Nonbreaking spaces are inserted after certain abbreviations, such as
-"Mr."
+\[lq]Mr.\[rq]
 .PP
 Note: if your LaTeX template or any included header file call for the
 \f[C]csquotes\f[] package, pandoc will detect this automatically and use
@@ -3362,8 +3367,8 @@
 must be escaped with backslashes.
 (This is to prevent accidental superscripting and subscripting through
 the ordinary use of \f[C]~\f[] and \f[C]^\f[].) Thus, if you want the
-letter P with \[aq]a cat\[aq] in subscripts, use \f[C]P~a\\\ cat~\f[],
-not \f[C]P~a\ cat~\f[].
+letter P with `a cat' in subscripts, use \f[C]P~a\\\ cat~\f[], not
+\f[C]P~a\ cat~\f[].
 .SS Verbatim
 .PP
 To make a short span of text verbatim, put it inside backticks:
@@ -3435,9 +3440,9 @@
 its right, while the closing \f[C]$\f[] must have a non\-space character
 immediately to its left, and must not be followed immediately by a
 digit.
-Thus, \f[C]$20,000\ and\ $30,000\f[] won\[aq]t parse as math.
+Thus, \f[C]$20,000\ and\ $30,000\f[] won't parse as math.
 If for some reason you need to enclose text in literal \f[C]$\f[]
-characters, backslash\-escape them and they won\[aq]t be treated as math
+characters, backslash\-escape them and they won't be treated as math
 delimiters.
 .PP
 TeX math will be printed in all output formats.
@@ -3464,7 +3469,7 @@
 .RE
 .TP
 .B groff man
-It will be rendered verbatim without \f[C]$\f[]\[aq]s.
+It will be rendered verbatim without \f[C]$\f[]'s.
 .RS
 .RE
 .TP
@@ -3578,9 +3583,9 @@
 suppressed in other formats.
 .SS Extension: \f[C]markdown_in_html_blocks\f[]
 .PP
-Standard Markdown allows you to include HTML "blocks": blocks of HTML
-between balanced tags that are separated from the surrounding text with
-blank lines, and start and end at the left margin.
+Standard Markdown allows you to include HTML \[lq]blocks\[rq]: blocks of
+HTML between balanced tags that are separated from the surrounding text
+with blank lines, and start and end at the left margin.
 Within these blocks, everything is interpreted as HTML, not Markdown; so
 (for example), \f[C]*\f[] does not signify emphasis.
 .PP
@@ -3848,7 +3853,7 @@
 .SS Images
 .PP
 A link immediately preceded by a \f[C]!\f[] will be treated as an image.
-The link text will be used as the image\[aq]s alt text:
+The link text will be used as the image's alt text:
 .IP
 .nf
 \f[C]
@@ -3865,7 +3870,7 @@
 with a caption. (In LaTeX, a figure environment will be used; in HTML,
 the image will be placed in a \f[C]div\f[] with class \f[C]figure\f[],
 together with a caption in a \f[C]p\f[] with class \f[C]caption\f[].)
-The image\[aq]s alt text will be used as the caption.
+The image's alt text will be used as the caption.
 .IP
 .nf
 \f[C]
@@ -3952,7 +3957,7 @@
 .SS Footnotes
 .SS Extension: \f[C]footnotes\f[]
 .PP
-Pandoc\[aq]s Markdown allows footnotes, using the following syntax:
+Pandoc's Markdown allows footnotes, using the following syntax:
 .IP
 .nf
 \f[C]
@@ -3984,6 +3989,8 @@
 The footnotes themselves need not be placed at the end of the document.
 They may appear anywhere except inside other block elements (lists,
 block quotes, tables, etc.).
+Each footnote should be separated from surrounding content (including
+other footnotes) by blank lines.
 .SS Extension: \f[C]inline_notes\f[]
 .PP
 Inline footnotes are also allowed (though, unlike regular notes, they
@@ -4134,7 +4141,7 @@
 As an alternative to specifying a bibliography file using
 \f[C]\-\-bibliography\f[] or the YAML metadata field
 \f[C]bibliography\f[], you can include the citation data directly in the
-\f[C]references\f[] field of the document\[aq]s YAML metadata.
+\f[C]references\f[] field of the document's YAML metadata.
 The field should contain an array of YAML\-encoded references, for
 example:
 .IP
@@ -4184,7 +4191,7 @@
 entries, add \f[C]link\-citations:\ true\f[] to your YAML metadata.
 .PP
 Citations go inside square brackets and are separated by semicolons.
-Each citation must have a key, composed of \[aq]\@\[aq] + the citation
+Each citation must have a key, composed of `\@' + the citation
 identifier from the database, and may optionally have a prefix, a
 locator, and a suffix.
 The citation key must begin with a letter, digit, or \f[C]_\f[], and may
@@ -4219,7 +4226,7 @@
 \f[C]s.v.\f[]/\f[C]s.vv.\f[]; \f[C]verse\f[], \f[C]v.\f[]/\f[C]vv.\f[];
 \f[C]volume\f[], \f[C]vol.\f[]/\f[C]vols.\f[]; \f[C]¶\f[]/\f[C]¶¶\f[];
 \f[C]§\f[]/\f[C]§§\f[].
-If no locator term is used, "page" is assumed.
+If no locator term is used, \[lq]page\[rq] is assumed.
 .PP
 A minus sign (\f[C]\-\f[]) before the \f[C]\@\f[] will suppress mention
 of the author in the citation.
@@ -4276,6 +4283,18 @@
 only, but the bibliography will contain entries for \f[C]item1\f[],
 \f[C]item2\f[], and \f[C]item3\f[].
 .PP
+It is possible to create a bibliography with all the citations, whether
+or not they appear in the document, by using a wildcard:
+.IP
+.nf
+\f[C]
+\-\-\-
+nocite:\ |
+\ \ \@*
+\&...
+\f[]
+.fi
+.PP
 For LaTeX or PDF output, you can also use \f[C]natbib\f[] or
 \f[C]biblatex\f[] to render bibliography.
 In order to do so, specify bibliography files as outlined above, and add
@@ -4296,7 +4315,7 @@
 .PP
 Allow \f[C]<\f[] and \f[C]>\f[] to be backslash\-escaped, as they can be
 in GitHub flavored Markdown but not original Markdown.
-This is implied by pandoc\[aq]s default \f[C]all_symbols_escapable\f[].
+This is implied by pandoc's default \f[C]all_symbols_escapable\f[].
 .SS Extension: \f[C]lists_without_preceding_blankline\f[]
 .PP
 Allow a list to occur right after a paragraph, with no intervening blank
@@ -4410,15 +4429,15 @@
 No blank line is required between consecutive items of the definition
 list.
 .IP \[bu] 2
-To get a "tight" or "compact" list, omit space between consecutive
-items; the space between a term and its definition does not affect
-anything.
+To get a \[lq]tight\[rq] or \[lq]compact\[rq] list, omit space between
+consecutive items; the space between a term and its definition does not
+affect anything.
 .IP \[bu] 2
 Lazy wrapping of paragraphs is not allowed: the entire definition must
 be indented four spaces.
 .SS Markdown variants
 .PP
-In addition to pandoc\[aq]s extended Markdown, the following Markdown
+In addition to pandoc's extended Markdown, the following Markdown
 variants are supported:
 .TP
 .B \f[C]markdown_phpextra\f[] (PHP Markdown Extra)
@@ -4475,8 +4494,7 @@
 reveal.js.
 You can also produce a PDF slide show using LaTeX \f[C]beamer\f[].
 .PP
-Here\[aq]s the Markdown source for a simple slide show,
-\f[C]habits.txt\f[]:
+Here's the Markdown source for a simple slide show, \f[C]habits.txt\f[]:
 .IP
 .nf
 \f[C]
@@ -4571,17 +4589,17 @@
 Headers \f[I]below\f[] the slide level in the hierarchy create headers
 \f[I]within\f[] a slide.
 .IP \[bu] 2
-Headers \f[I]above\f[] the slide level in the hierarchy create "title
-slides," which just contain the section title and help to break the
-slide show into sections.
+Headers \f[I]above\f[] the slide level in the hierarchy create
+\[lq]title slides,\[rq] which just contain the section title and help to
+break the slide show into sections.
 .IP \[bu] 2
-A title page is constructed automatically from the document\[aq]s title
+A title page is constructed automatically from the document's title
 block, if present.
 (In the case of beamer, this can be disabled by commenting out some
 lines in the default template.)
 .PP
 These rules are designed to support many different styles of slide show.
-If you don\[aq]t care about structuring your slides into sections and
+If you don't care about structuring your slides into sections and
 subsections, you can just use level 1 headers for all each slide.
 (In that case, level 1 will be the slide level.) But you can also
 structure the slide show into sections, as in the example above.
@@ -4593,9 +4611,9 @@
 reveal.js.
 .SS Incremental lists
 .PP
-By default, these writers produce lists that display "all at once." If
-you want your lists to display incrementally (one item at a time), use
-the \f[C]\-i\f[] option.
+By default, these writers produce lists that display \[lq]all at
+once.\[rq] If you want your lists to display incrementally (one item at
+a time), use the \f[C]\-i\f[] option.
 If you want a particular list to depart from the default (that is, to
 display incrementally without the \f[C]\-i\f[] option and all at once
 with the \f[C]\-i\f[] option), put it in a block quote:
@@ -4611,8 +4629,8 @@
 single document.
 .SS Inserting pauses
 .PP
-You can add "pauses" within a slide by including a paragraph containing
-three dots, separated by spaces:
+You can add \[lq]pauses\[rq] within a slide by including a paragraph
+containing three dots, separated by spaces:
 .IP
 .nf
 \f[C]
@@ -4632,8 +4650,8 @@
 Slidy), or \f[C]$DATADIR/slideous\f[] (for Slideous), where
 \f[C]$DATADIR\f[] is the user data directory (see
 \f[C]\-\-data\-dir\f[], above).
-The originals may be found in pandoc\[aq]s system data directory
-(generally \f[C]$CABALDIR/pandoc\-VERSION/s5/default\f[]).
+The originals may be found in pandoc's system data directory (generally
+\f[C]$CABALDIR/pandoc\-VERSION/s5/default\f[]).
 Pandoc will look there for any files it does not find in the user data
 directory.
 .PP
@@ -4712,7 +4730,7 @@
 .fi
 .PP
 All of the other frame attributes described in Section 8.1 of the Beamer
-User\[aq]s Guide may also be used: \f[C]allowdisplaybreaks\f[],
+User's Guide may also be used: \f[C]allowdisplaybreaks\f[],
 \f[C]allowframebreaks\f[], \f[C]b\f[], \f[C]c\f[], \f[C]t\f[],
 \f[C]environment\f[], \f[C]label\f[], \f[C]plain\f[], \f[C]shrink\f[].
 .SH CREATING EPUBS WITH PANDOC
@@ -4771,8 +4789,8 @@
 Either a string value, or an object with fields \f[C]role\f[],
 \f[C]file\-as\f[], and \f[C]text\f[], or a list of such objects.
 Valid values for \f[C]role\f[] are MARC relators, but pandoc will
-attempt to translate the human\-readable versions (like "author" and
-"editor") to the appropriate marc relators.
+attempt to translate the human\-readable versions (like \[lq]author\[rq]
+and \[lq]editor\[rq]) to the appropriate marc relators.
 .RS
 .RE
 .TP
@@ -4873,24 +4891,23 @@
 only), pandoc will treat the document as literate Haskell source.
 This means that
 .IP \[bu] 2
-In Markdown input, "bird track" sections will be parsed as Haskell code
-rather than block quotations.
+In Markdown input, \[lq]bird track\[rq] sections will be parsed as
+Haskell code rather than block quotations.
 Text between \f[C]\\begin{code}\f[] and \f[C]\\end{code}\f[] will also
 be treated as Haskell code.
-For ATX\-style headers the character \[aq]=\[aq] will be used instead of
-\[aq]#\[aq].
+For ATX\-style headers the character `=' will be used instead of `#'.
 .IP \[bu] 2
 In Markdown output, code blocks with classes \f[C]haskell\f[] and
 \f[C]literate\f[] will be rendered using bird tracks, and block
 quotations will be indented one space, so they will not be treated as
 Haskell code.
 In addition, headers will be rendered setext\-style (with underlines)
-rather than ATX\-style (with \[aq]#\[aq] characters).
-(This is because ghc treats \[aq]#\[aq] characters in column 1 as
-introducing line numbers.)
+rather than ATX\-style (with `#' characters).
+(This is because ghc treats `#' characters in column 1 as introducing
+line numbers.)
 .IP \[bu] 2
-In restructured text input, "bird track" sections will be parsed as
-Haskell code.
+In restructured text input, \[lq]bird track\[rq] sections will be parsed
+as Haskell code.
 .IP \[bu] 2
 In restructured text output, code blocks with class \f[C]haskell\f[]
 will be rendered using bird tracks.
@@ -4943,8 +4960,8 @@
 To disable highlighting, use the \f[C]\-\-no\-highlight\f[] option.
 .SH CUSTOM STYLES IN DOCX OUTPUT
 .PP
-By default, pandoc\[aq]s docx output applies a predefined set of styles
-for blocks such as paragraphs and block quotes, and uses largely default
+By default, pandoc's docx output applies a predefined set of styles for
+blocks such as paragraphs and block quotes, and uses largely default
 formatting (italics, bold) for inlines.
 This will work for most purposes, especially alongside a
 \f[C]reference.docx\f[] file.
@@ -4963,8 +4980,8 @@
 \f[]
 .fi
 .PP
-would produce a docx file with "Get out," styled with character style
-\f[C]Emphatically\f[].
+would produce a docx file with \[lq]Get out,\[rq] styled with character
+style \f[C]Emphatically\f[].
 Similarly,
 .IP
 .nf
@@ -5029,14 +5046,14 @@
 Contributors include Arata Mizuki, Aaron Wolen, Albert Krewinkel, Alex
 Ivkin, Alex Vong, Alexander Kondratskiy, Alexander Sulfrian, Alexander V
 Vershilov, Alfred Wechselberger, Andreas Lööw, Andrew Dunning, Antoine
-Latter, Arata Mizuki, Arlo O\[aq]Keeffe, Artyom Kazak, B.
+Latter, Arata Mizuki, Arlo O'Keeffe, Artyom Kazak, B.
 Scott Michel, Ben Gamari, Beni Cherniavsky\-Paskin, Benoit Schweblin,
-Bjorn Buckwalter, Bradley Kuhn, Brent Yorgey, Bryan O\[aq]Sullivan,
-Caleb McDaniel, Calvin Beck, Carlos Sosa, Chris Black, Christian Conkle,
+Bjorn Buckwalter, Bradley Kuhn, Brent Yorgey, Bryan O'Sullivan, Caleb
+McDaniel, Calvin Beck, Carlos Sosa, Chris Black, Christian Conkle,
 Christoffer Ackelman, Christoffer Sawicki, Clare Macrae, Clint Adams,
 Conal Elliott, Craig S.
 Bosma, Daniel Bergey, Daniel T.
-Staal, Daniele D\[aq]Orazio, David Lazar, David Röthlisberger, Denis
+Staal, Daniele D'Orazio, David Lazar, David Röthlisberger, Denis
 Laxalde, Douglas Calvert, Emanuel Evans, Emily Eisenberg, Eric Kow, Eric
 Seidel, Felix Yan, Florian Eitel, François Gannaz, Freiric Barral,
 Freirich Raabe, Frerich Raabe, Fyodor Sheremetyev, Gabor Pali, Gavin
@@ -5047,9 +5064,9 @@
 Lewis Muir, Jaime Marquínez Ferrándiz, Jakob Voß, James Aspnes, Jamie F.
 Olson, Jan Larres, Jan Schulz, Jason Ronallo, Jeff Arnold, Jeff
 Runningen, Jens Petersen, Jesse Rosenthal, Joe Hillenbrand, John
-MacFarlane, Jonas Smedegaard, Jonathan Daugherty, Jose Luis Duran, Josef
-Svenningsson, Julien Cretel, Juliusz Gonera, Justin Bogner, Jérémy
-Bobbio, Kelsey Hightower, Kolen Cheung, KolenCheung, Konstantin Zudov,
+MacFarlane, John Muccigrosso, Jonas Smedegaard, Jonathan Daugherty, Jose
+Luis Duran, Josef Svenningsson, Julien Cretel, Juliusz Gonera, Justin
+Bogner, Jérémy Bobbio, Kelsey Hightower, Kolen Cheung, Konstantin Zudov,
 Kristof Bastiaensen, Lars\-Dominik Braun, Luke Plant, Mark Szepieniec,
 Mark Wright, Martin Linn, Masayoshi Takahashi, Matej Kollar, Mathias
 Schenner, Mathieu Duponchelle, Matthew Eddey, Matthew Pickering,
@@ -5065,10 +5082,11 @@
 Sergey Astanin, Shahbaz Youssefi, Shaun Attfield, Sidarth Kapur,
 Sidharth Kapur, Simon Hengel, Sumit Sahrawat, Thomas Hodgson, Thomas
 Weißschuh, Tim Lin, Timothy Humphries, Tiziano Müller, Todd Sifleet, Tom
-Leese, Uli Köhler, Václav Zeman, Viktor Kronvall, Vincent, Václav Zeman,
-Waldir Pimenta, Wikiwide, Xavier Olive, csforste, infinity0x, nkalvi,
-qerub, robabla, roblabla, rodja.trappe, rski, shreevatsa.public,
-takahashim, thsutton.
+Leese, Uli Köhler, Václav Zeman, Viktor Kronvall, Vincent, Václav
+Haisman, Václav Zeman, Wandmalfarbe, Waldir Pimenta, Wikiwide, Xavier
+Olive, bumper314, csforste, infinity0x, nkalvi, qerub, robabla,
+roblabla, rodja.trappe, rski, shreevatsa.public, takahashim, tgkokk,
+thsutton.
 .PP
 The Pandoc source code and all documentation may be downloaded
 from <http://pandoc.org>.
diff --git a/pandoc.cabal b/pandoc.cabal
--- a/pandoc.cabal
+++ b/pandoc.cabal
@@ -1,10 +1,10 @@
 Name:            pandoc
-Version:         1.19.1
+Version:         1.19.2
 Cabal-Version:   >= 1.10
 Build-Type:      Custom
 License:         GPL
 License-File:    COPYING.md
-Copyright:       (c) 2006-2016 John MacFarlane
+Copyright:       (c) 2006-2017 John MacFarlane
 Author:          John MacFarlane <jgm@berkeley.edu>
 Maintainer:      John MacFarlane <jgm@berkeley.edu>
 Bug-Reports:     https://github.com/jgm/pandoc/issues
@@ -261,7 +261,7 @@
                  mtl >= 2.2 && < 2.3,
                  filepath >= 1.1 && < 1.5,
                  process >= 1 && < 1.5,
-                 directory >= 1 && < 1.3,
+                 directory >= 1 && < 1.4,
                  bytestring >= 0.9 && < 0.11,
                  text >= 0.11 && < 1.3,
                  zip-archive >= 0.2.3.4 && < 0.4,
@@ -271,18 +271,18 @@
                  random >= 1 && < 1.2,
                  extensible-exceptions >= 0.1 && < 0.2,
                  pandoc-types >= 1.17 && < 1.18,
-                 aeson >= 0.7 && < 1.1,
+                 aeson >= 0.7 && < 1.2,
                  tagsoup >= 0.13.7 && < 0.15,
                  base64-bytestring >= 0.1 && < 1.1,
                  zlib >= 0.5 && < 0.7,
-                 highlighting-kate >= 0.6.2 && < 0.7,
+                 skylighting >= 0.1.1.2 && < 0.2,
                  data-default >= 0.4 && < 0.8,
                  temporary >= 1.1 && < 1.3,
                  blaze-html >= 0.5 && < 0.9,
                  blaze-markup >= 0.5.1 && < 0.8,
                  yaml >= 0.8.8.2 && < 0.9,
                  scientific >= 0.2 && < 0.4,
-                 vector >= 0.10 && < 0.12,
+                 vector >= 0.10 && < 0.13,
                  hslua >= 0.3 && < 0.5,
                  binary >= 0.5 && < 0.9,
                  SHA >= 1.6 && < 1.7,
@@ -426,13 +426,13 @@
   Build-Depends: pandoc,
                  pandoc-types >= 1.17 && < 1.18,
                  base >= 4.2 && <5,
-                 directory >= 1.2 && < 1.3,
+                 directory >= 1.2 && < 1.4,
                  filepath >= 1.1 && < 1.5,
                  text >= 0.11 && < 1.3,
                  bytestring >= 0.9 && < 0.11,
                  extensible-exceptions >= 0.1 && < 0.2,
-                 highlighting-kate >= 0.6.2 && < 0.7,
-                 aeson >= 0.7.0.5 && < 1.1,
+                 skylighting >= 0.1.1.2 && < 0.2,
+                 aeson >= 0.7.0.5 && < 1.2,
                  yaml >= 0.8.8.2 && < 0.9,
                  containers >= 0.1 && < 0.6,
                  HTTP >= 4000.0.5 && < 4000.4
@@ -468,7 +468,7 @@
      Other-Modules:  Prelude
   default-language: Haskell2010
   if flag(trypandoc)
-    Build-Depends: base, aeson, pandoc, highlighting-kate,
+    Build-Depends: base, aeson, pandoc,
                    text, wai-extra, wai >= 0.3, http-types
     Buildable:     True
   else
@@ -503,10 +503,10 @@
                   pandoc-types >= 1.17 && < 1.18,
                   bytestring >= 0.9 && < 0.11,
                   text >= 0.11 && < 1.3,
-                  directory >= 1 && < 1.3,
+                  directory >= 1 && < 1.4,
                   filepath >= 1.1 && < 1.5,
                   process >= 1 && < 1.5,
-                  highlighting-kate >= 0.6.2 && < 0.7,
+                  skylighting >= 0.1.1.2 && < 0.2,
                   Diff >= 0.2 && < 0.4,
                   test-framework >= 0.3 && < 0.9,
                   test-framework-hunit >= 0.2 && < 0.4,
diff --git a/pandoc.hs b/pandoc.hs
--- a/pandoc.hs
+++ b/pandoc.hs
@@ -42,8 +42,8 @@
 import Text.Pandoc.XML ( toEntities )
 import Text.Pandoc.SelfContained ( makeSelfContained )
 import Text.Pandoc.Process (pipeProcess)
-import Text.Highlighting.Kate ( languages, Style, tango, pygments,
-         espresso, zenburn, kate, haddock, monochrome )
+import Skylighting ( defaultSyntaxMap, Syntax(..), Style, tango, pygments,
+         espresso, zenburn, kate, haddock, breezeDark, monochrome )
 import System.Environment ( getArgs, getProgName, getEnvironment )
 import System.Exit ( ExitCode (..), exitSuccess )
 import System.FilePath
@@ -92,7 +92,7 @@
 compileInfo :: String
 compileInfo =
   "\nCompiled with pandoc-types " ++ VERSION_pandoc_types ++ ", texmath " ++
-  VERSION_texmath ++ ", highlighting-kate " ++ VERSION_highlighting_kate
+  VERSION_texmath ++ ", skylighting " ++ VERSION_skylighting
 
 -- | Converts a list of strings into a single string with the items printed as
 -- comma separated words in lines with a maximum line length.
@@ -156,6 +156,7 @@
    ("zenburn", zenburn),
    ("kate", kate),
    ("monochrome", monochrome),
+   ("breezedark", breezeDark),
    ("haddock", haddock)]
 
 -- | Data structure for command line options.
@@ -950,8 +951,11 @@
     , Option "" ["list-highlight-languages"]
                  (NoArg
                   (\_ -> do
-                     let langs = [map toLower l | l <- languages,
-                                   l /= "Alert" && l /= "Alert_indent"]
+                     let langs = [ T.unpack (T.toLower (sShortname s))
+                                 | s <- M.elems defaultSyntaxMap
+                                 , sShortname s `notElem`
+                                    [T.pack "Alert", T.pack "Alert_indent"]
+                                 ]
                      mapM_ (UTF8.hPutStrLn stdout) langs
                      exitSuccess ))
                  ""
diff --git a/src/Text/Pandoc/Highlighting.hs b/src/Text/Pandoc/Highlighting.hs
--- a/src/Text/Pandoc/Highlighting.hs
+++ b/src/Text/Pandoc/Highlighting.hs
@@ -50,16 +50,20 @@
                                 ) where
 import Text.Pandoc.Definition
 import Text.Pandoc.Shared (safeRead)
-import Text.Highlighting.Kate
-import Data.List (find)
+import Skylighting
 import Data.Maybe (fromMaybe)
 import Data.Char (toLower)
 import qualified Data.Map as M
-import Control.Applicative ((<|>))
+import Control.Monad
+import qualified Data.Text as T
 
-lcLanguages :: [String]
-lcLanguages = map (map toLower) languages
+languages :: [String]
+languages = [T.unpack (T.toLower (sName s)) | s <- M.elems defaultSyntaxMap]
 
+languagesByExtension :: String -> [String]
+languagesByExtension ext =
+  [T.unpack (T.toLower (sName s)) | s <- syntaxesByExtension defaultSyntaxMap ext]
+
 highlight :: (FormatOptions -> [SourceLine] -> a) -- ^ Formatter
           -> Attr   -- ^ Attributes of the CodeBlock
           -> String -- ^ Raw contents of the CodeBlock
@@ -70,22 +74,27 @@
                   startNumber = firstNum,
                   numberLines = any (`elem`
                         ["number","numberLines", "number-lines"]) classes }
-      lcclasses = map (map toLower)
-                     (classes ++ concatMap languagesByExtension classes)
-  in  case find (`elem` lcLanguages) lcclasses of
+      tokenizeOpts = TokenizerConfig{ syntaxMap = defaultSyntaxMap
+                                    , traceOutput = False }
+      classes' = map T.pack classes
+      rawCode' = T.pack rawCode
+  in  case msum (map (\l -> lookupSyntax l defaultSyntaxMap) classes') of
             Nothing
               | numberLines fmtOpts -> Just
                               $ formatter fmtOpts{ codeClasses = [],
-                                                   containerClasses = classes }
-                              $ map (\ln -> [(NormalTok, ln)]) $ lines rawCode
+                                                   containerClasses = classes' }
+                              $ map (\ln -> [(NormalTok, ln)]) $ T.lines rawCode'
               | otherwise  -> Nothing
-            Just language  -> Just
-                              $ formatter fmtOpts{ codeClasses = [language],
-                                                   containerClasses = classes }
-                              $ highlightAs language rawCode
+            Just syntax  ->
+              case tokenize tokenizeOpts syntax rawCode' of
+                   Right slines -> Just $
+                         formatter fmtOpts{ codeClasses =
+                                               [T.toLower (sShortname syntax)],
+                                            containerClasses = classes' } slines
+                   Left _ -> Nothing
 
 -- Functions for correlating latex listings package's language names
--- with highlighting-kate language names:
+-- with skylighting language names:
 
 langToListingsMap :: M.Map String String
 langToListingsMap = M.fromList langsList
@@ -95,60 +104,108 @@
   where switch (a,b) = (b,a)
 
 langsList :: [(String, String)]
-langsList =    [("ada","Ada")
-               ,("java","Java")
-               ,("prolog","Prolog")
-               ,("python","Python")
-               ,("gnuassembler","Assembler")
-               ,("commonlisp","Lisp")
-               ,("r","R")
-               ,("awk","Awk")
-               ,("bash","bash")
-               ,("makefile","make")
-               ,("c","C")
-               ,("matlab","Matlab")
-               ,("ruby","Ruby")
-               ,("cpp","C++")
-               ,("ocaml","Caml")
-               ,("modula2","Modula-2")
-               ,("sql","SQL")
-               ,("eiffel","Eiffel")
-               ,("tcl","tcl")
-               ,("erlang","erlang")
-               ,("verilog","Verilog")
-               ,("fortran","Fortran")
-               ,("vhdl","VHDL")
-               ,("pascal","Pascal")
-               ,("perl","Perl")
-               ,("xml","XML")
-               ,("haskell","Haskell")
-               ,("php","PHP")
-               ,("xslt","XSLT")
-               ,("html","HTML")
-               ,("gap","GAP")
-               ]
-
-listingsLangs :: [String]
-listingsLangs = ["Ada","Java","Prolog","Algol","JVMIS","Promela",
-                 "Ant","ksh","Python","Assembler","Lisp","R","Awk",
-                 "Logo","Reduce","bash","make","Rexx","Basic",
-                 "Mathematica","RSL","C","Matlab","Ruby","C++",
-                 "Mercury","S","Caml","MetaPost","SAS","Clean",
-                 "Miranda","Scilab","Cobol","Mizar","sh","Comal",
-                 "ML","SHELXL","csh","Modula-2","Simula","Delphi",
-                 "MuPAD","SQL","Eiffel","NASTRAN","tcl","Elan",
-                 "Oberon-2","TeX","erlang","OCL","VBScript","Euphoria",
-                 "Octave","Verilog","Fortran","Oz","VHDL","GCL",
-                 "Pascal","VRML","Gnuplot","Perl","XML","Haskell",
-                 "PHP","XSLT","HTML","PL/I","GAP"]
+langsList =
+  [("abap","ABAP"),
+  ("acm","ACM"),
+  ("acmscript","ACMscript"),
+  ("acsl","ACSL"),
+  ("ada","Ada"),
+  ("algol","Algol"),
+  ("ant","Ant"),
+  ("assembler","Assembler"),
+  ("gnuassembler","Assembler"),
+  ("awk","Awk"),
+  ("bash","bash"),
+  ("monobasic","Basic"),
+  ("purebasic","Basic"),
+  ("c","C"),
+  ("cpp","C++"),
+  ("c++","C++"),
+  ("ocaml","Caml"),
+  ("cil","CIL"),
+  ("clean","Clean"),
+  ("cobol","Cobol"),
+  ("comal80","Comal80"),
+  ("command.com","command.com"),
+  ("comsol","Comsol"),
+  ("csh","csh"),
+  ("delphi","Delphi"),
+  ("elan","Elan"),
+  ("erlang","erlang"),
+  ("euphoria","Euphoria"),
+  ("fortran","Fortran"),
+  ("gap","GAP"),
+  ("gcl","GCL"),
+  ("gnuplot","Gnuplot"),
+  ("hansl","hansl"),
+  ("haskell","Haskell"),
+  ("html","HTML"),
+  ("idl","IDL"),
+  ("inform","inform"),
+  ("java","Java"),
+  ("jvmis","JVMIS"),
+  ("ksh","ksh"),
+  ("lingo","Lingo"),
+  ("lisp","Lisp"),
+  ("commonlisp","Lisp"),
+  ("llvm","LLVM"),
+  ("logo","Logo"),
+  ("lua","Lua"),
+  ("make","make"),
+  ("makefile","make"),
+  ("mathematica","Mathematica"),
+  ("matlab","Matlab"),
+  ("mercury","Mercury"),
+  ("metapost","MetaPost"),
+  ("miranda","Miranda"),
+  ("mizar","Mizar"),
+  ("ml","ML"),
+  ("modula2","Modula-2"),
+  ("mupad","MuPAD"),
+  ("nastran","NASTRAN"),
+  ("oberon2","Oberon-2"),
+  ("ocl","OCL"),
+  ("octave","Octave"),
+  ("oz","Oz"),
+  ("pascal","Pascal"),
+  ("perl","Perl"),
+  ("php","PHP"),
+  ("pli","PL/I"),
+  ("plasm","Plasm"),
+  ("postscript","PostScript"),
+  ("pov","POV"),
+  ("prolog","Prolog"),
+  ("promela","Promela"),
+  ("pstricks","PSTricks"),
+  ("python","Python"),
+  ("r","R"),
+  ("reduce","Reduce"),
+  ("rexx","Rexx"),
+  ("rsl","RSL"),
+  ("ruby","Ruby"),
+  ("s","S"),
+  ("sas","SAS"),
+  ("scala","Scala"),
+  ("scilab","Scilab"),
+  ("sh","sh"),
+  ("shelxl","SHELXL"),
+  ("simula","Simula"),
+  ("sparql","SPARQL"),
+  ("sql","SQL"),
+  ("tcl","tcl"),
+  ("tex","TeX"),
+  ("latex","TeX"),
+  ("vbscript","VBScript"),
+  ("verilog","Verilog"),
+  ("vhdl","VHDL"),
+  ("vrml","VRML"),
+  ("xml","XML"),
+  ("xslt","XSLT")]
 
--- Determine listings language name from highlighting-kate language name.
+-- | Determine listings language name from skylighting language name.
 toListingsLanguage :: String -> Maybe String
-toListingsLanguage lang = (if lang `elem` listingsLangs
-                              then Just lang
-                              else Nothing) <|>
-                             M.lookup (map toLower lang) langToListingsMap
+toListingsLanguage lang = M.lookup (map toLower lang) langToListingsMap
 
--- Determine highlighting-kate language name from listings language name.
+-- | Determine skylighting language name from listings language name.
 fromListingsLanguage :: String -> Maybe String
 fromListingsLanguage lang = M.lookup lang listingsToLangMap
diff --git a/src/Text/Pandoc/Readers/Docx.hs b/src/Text/Pandoc/Readers/Docx.hs
--- a/src/Text/Pandoc/Readers/Docx.hs
+++ b/src/Text/Pandoc/Readers/Docx.hs
@@ -571,23 +571,25 @@
         True | null rs -> (Nothing, [r])
              | otherwise -> (Just r, rs)
         False -> (Nothing, r:rs)
+
+  cells <- mapM rowToBlocksList rows        
+
+  let width = case cells of
+        r':_ -> length r'
+        -- shouldn't happen
+        []   -> 0               
+
   hdrCells <- case hdr of
     Just r' -> rowToBlocksList r'
-    Nothing -> return []
-
-  cells <- mapM rowToBlocksList rows
+    Nothing -> return $ replicate width mempty
 
-  let size = case null hdrCells of
-        True -> length $ head cells
-        False -> length $ hdrCells
-      --
       -- The two following variables (horizontal column alignment and
       -- relative column widths) go to the default at the
       -- moment. Width information is in the TblGrid field of the Tbl,
       -- so should be possible. Alignment might be more difficult,
       -- since there doesn't seem to be a column entity in docx.
-      alignments = replicate size AlignDefault
-      widths = replicate size 0 :: [Double]
+  let alignments = replicate width AlignDefault
+      widths = replicate width 0 :: [Double]
 
   return $ table caption (zip alignments widths) hdrCells cells
 bodyPartToBlocks (OMathPara e) = do
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
@@ -1515,6 +1515,7 @@
   (guardEnabled Ext_all_symbols_escapable >> satisfy (not . isAlphaNum))
      <|> (guardEnabled Ext_angle_brackets_escapable >>
             oneOf "\\`*_{}[]()>#+-.!~\"<>")
+     <|> (guardEnabled Ext_escaped_line_breaks >> char '\n')
      <|> oneOf "\\`*_{}[]()>#+-.!~\""
 
 escapedChar :: MarkdownParser (F Inlines)
@@ -1561,8 +1562,8 @@
                        (char '\n' >> notFollowedBy' blankline >> return " "))
                       (try (skipSpaces >> count (length starts) (char '`') >>
                       notFollowedBy (char '`')))
-  attr <- option ([],[],[]) (try $ guardEnabled Ext_inline_code_attributes >>
-                                   optional whitespace >> attributes)
+  attr <- option ([],[],[]) (try $ guardEnabled Ext_inline_code_attributes
+                                   >> attributes)
   return $ return $ B.codeWith attr $ trim $ concat result
 
 math :: MarkdownParser (F Inlines)
diff --git a/src/Text/Pandoc/Readers/MediaWiki.hs b/src/Text/Pandoc/Readers/MediaWiki.hs
--- a/src/Text/Pandoc/Readers/MediaWiki.hs
+++ b/src/Text/Pandoc/Readers/MediaWiki.hs
@@ -423,7 +423,8 @@
   terms <- mconcat . intersperse B.linebreak <$> many defListTerm
   -- we allow dd with no dt, or dt with no dd
   defs  <- if B.isNull terms
-              then notFollowedBy (try $ string ":<math>") *>
+              then notFollowedBy
+                    (try $ skipMany1 (char ':') >> string "<math>") *>
                        many1 (listItem ':')
               else many (listItem ':')
   return (terms, defs)
@@ -519,7 +520,7 @@
 str = B.str <$> many1 (noneOf $ specialChars ++ spaceChars)
 
 math :: MWParser Inlines
-math = (B.displayMath . trim <$> try (char ':' >> charsInTags "math"))
+math = (B.displayMath . trim <$> try (many1 (char ':') >> charsInTags "math"))
    <|> (B.math . trim <$> charsInTags "math")
    <|> (B.displayMath . trim <$> try (dmStart *> manyTill anyChar dmEnd))
    <|> (B.math . trim <$> try (mStart *> manyTill (satisfy (/='\n')) mEnd))
@@ -671,9 +672,6 @@
           end   = try $ sym "'''"
 
 doubleQuotes :: MWParser Inlines
-doubleQuotes = B.doubleQuoted . trimInlines . mconcat <$> try
- ((getState >>= guard . readerSmart . mwOptions) *>
-   openDoubleQuote *> manyTill inline closeDoubleQuote )
-    where openDoubleQuote = char '"' <* lookAhead alphaNum
-          closeDoubleQuote = char '"' <* notFollowedBy alphaNum
-
+doubleQuotes = B.doubleQuoted <$> nested (inlinesBetween openDoubleQuote closeDoubleQuote)
+    where openDoubleQuote = sym "\"" >> lookAhead nonspaceChar
+          closeDoubleQuote = try $ sym "\""
diff --git a/src/Text/Pandoc/Readers/Org/Blocks.hs b/src/Text/Pandoc/Readers/Org/Blocks.hs
--- a/src/Text/Pandoc/Readers/Org/Blocks.hs
+++ b/src/Text/Pandoc/Readers/Org/Blocks.hs
@@ -2,7 +2,7 @@
 {-# LANGUAGE RecordWildCards #-}
 {-# LANGUAGE ViewPatterns #-}
 {-
-Copyright (C) 2014-2016 Albert Krewinkel <tarleb+pandoc@moltkeplatz.de>
+Copyright (C) 2014-2017 Albert Krewinkel <tarleb+pandoc@moltkeplatz.de>
 
 This program is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
@@ -21,7 +21,7 @@
 
 {- |
    Module      : Text.Pandoc.Readers.Org.Options
-   Copyright   : Copyright (C) 2014-2016 Albert Krewinkel
+   Copyright   : Copyright (C) 2014-2017 Albert Krewinkel
    License     : GNU GPL, version 2 or above
 
    Maintainer  : Albert Krewinkel <tarleb+pandoc@moltkeplatz.de>
@@ -35,7 +35,7 @@
 
 import           Text.Pandoc.Readers.Org.BlockStarts
 import           Text.Pandoc.Readers.Org.Inlines
-import           Text.Pandoc.Readers.Org.Meta ( metaExport, metaLine )
+import           Text.Pandoc.Readers.Org.Meta ( metaExport, metaKey, metaLine )
 import           Text.Pandoc.Readers.Org.ParserState
 import           Text.Pandoc.Readers.Org.Parsing
 import           Text.Pandoc.Readers.Org.Shared
@@ -679,7 +679,15 @@
 --
 
 specialLine :: OrgParser (F Blocks)
-specialLine = fmap return . try $ metaLine <|> commentLine
+specialLine = fmap return . try $ rawExportLine <|> metaLine <|> commentLine
+
+rawExportLine :: OrgParser Blocks
+rawExportLine = try $ do
+  metaLineStart
+  key <- metaKey
+  if key `elem` ["latex", "html", "texinfo", "beamer"]
+    then B.rawBlock key <$> anyLine
+    else mzero
 
 commentLine :: OrgParser Blocks
 commentLine = commentLineStart *> anyLine *> pure mempty
diff --git a/src/Text/Pandoc/Readers/Org/Inlines.hs b/src/Text/Pandoc/Readers/Org/Inlines.hs
--- a/src/Text/Pandoc/Readers/Org/Inlines.hs
+++ b/src/Text/Pandoc/Readers/Org/Inlines.hs
@@ -198,21 +198,22 @@
 normalOrgRefCite :: OrgParser (F [Citation])
 normalOrgRefCite = try $ do
   mode <- orgRefCiteMode
-  sequence <$> sepBy1 (orgRefCiteList mode) (char ',')
- where
-   -- | A list of org-ref style citation keys, parsed as citation of the given
-   -- citation mode.
-   orgRefCiteList :: CitationMode -> OrgParser (F Citation)
-   orgRefCiteList citeMode = try $ do
-     key <- orgRefCiteKey
-     returnF $ Citation
-      { citationId      = key
-      , citationPrefix  = mempty
-      , citationSuffix  = mempty
-      , citationMode    = citeMode
-      , citationNoteNum = 0
-      , citationHash    = 0
-      }
+  -- org-ref style citation key, parsed into a citation of the given mode
+  let orgRefCiteItem :: OrgParser (F Citation)
+      orgRefCiteItem = try $ do
+        key <- orgRefCiteKey
+        returnF $ Citation
+          { citationId      = key
+          , citationPrefix  = mempty
+          , citationSuffix  = mempty
+          , citationMode    = mode
+          , citationNoteNum = 0
+          , citationHash    = 0
+          }
+  firstCitation <- orgRefCiteItem
+  moreCitations <- many (try $ char ',' *> orgRefCiteItem)
+  return . sequence $ firstCitation : moreCitations
+    where
 
 -- | Read an Berkeley-style Org-mode citation.  Berkeley citation style was
 -- develop and adjusted to Org-mode style by John MacFarlane and Richard
@@ -647,6 +648,9 @@
   char c
   lookAhead (noneOf emphasisForbiddenBorderChars)
   pushToInlineCharStack c
+  -- nested inlines are allowed, so mark this position as one which might be
+  -- followed by another inline.
+  updateLastPreCharPos
   return c
 
 -- | Parses the closing character of emphasis
diff --git a/src/Text/Pandoc/Readers/Org/Meta.hs b/src/Text/Pandoc/Readers/Org/Meta.hs
--- a/src/Text/Pandoc/Readers/Org/Meta.hs
+++ b/src/Text/Pandoc/Readers/Org/Meta.hs
@@ -1,7 +1,7 @@
 {-# LANGUAGE FlexibleContexts #-}
 {-# LANGUAGE TupleSections #-}
 {-
-Copyright (C) 2014-2016 Albert Krewinkel <tarleb+pandoc@moltkeplatz.de>
+Copyright (C) 2014-2017 Albert Krewinkel <tarleb+pandoc@moltkeplatz.de>
 
 This program is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
@@ -20,7 +20,7 @@
 
 {- |
    Module      : Text.Pandoc.Readers.Org.Meta
-   Copyright   : Copyright (C) 2014-2016 Albert Krewinkel
+   Copyright   : Copyright (C) 2014-2017 Albert Krewinkel
    License     : GNU GPL, version 2 or above
 
    Maintainer  : Albert Krewinkel <tarleb+pandoc@moltkeplatz.de>
@@ -28,8 +28,9 @@
 Parsers for Org-mode meta declarations.
 -}
 module Text.Pandoc.Readers.Org.Meta
-  ( metaLine
-  , metaExport
+  ( metaExport
+  , metaKey
+  , metaLine
   ) where
 
 import           Text.Pandoc.Readers.Org.BlockStarts
diff --git a/src/Text/Pandoc/Writers/Docbook.hs b/src/Text/Pandoc/Writers/Docbook.hs
--- a/src/Text/Pandoc/Writers/Docbook.hs
+++ b/src/Text/Pandoc/Writers/Docbook.hs
@@ -123,7 +123,10 @@
                                               then "section"
                                               else "sect" ++ show n
                  _                    -> "simplesect"
-      idAttr = [("id", writerIdentifierPrefix opts ++ id') | not (null id')]
+      idName = if writerDocbook5 opts
+                 then "xml:id"
+                 else "id"
+      idAttr = [(idName, writerIdentifierPrefix opts ++ id') | not (null id')]
       nsAttr = if writerDocbook5 opts && lvl == 0 then [("xmlns", "http://docbook.org/ns/docbook"),("xmlns:xlink", "http://www.w3.org/1999/xlink")]
                                       else []
       attribs = nsAttr ++ idAttr
diff --git a/src/Text/Pandoc/Writers/Docx.hs b/src/Text/Pandoc/Writers/Docx.hs
--- a/src/Text/Pandoc/Writers/Docx.hs
+++ b/src/Text/Pandoc/Writers/Docx.hs
@@ -49,19 +49,19 @@
 import Text.Pandoc.Readers.TeXMath
 import Text.Pandoc.Highlighting ( highlight )
 import Text.Pandoc.Walk
-import Text.Highlighting.Kate.Types ()
 import Text.XML.Light as XML
 import Text.TeXMath
 import Text.Pandoc.Readers.Docx.StyleMap
 import Text.Pandoc.Readers.Docx.Util (elemName)
 import Control.Monad.Reader
 import Control.Monad.State
-import Text.Highlighting.Kate
+import Skylighting
 import Data.Unique (hashUnique, newUnique)
 import System.Random (randomRIO)
 import Text.Printf (printf)
 import qualified Control.Exception as E
 import Data.Monoid ((<>))
+import qualified Data.Text as T
 import Text.Pandoc.MIME (MimeType, getMimeType, getMimeTypeDef,
                          extensionFromMimeType)
 import Control.Applicative ((<|>))
@@ -1127,7 +1127,7 @@
       toHlTok (toktype,tok) = mknode "w:r" []
                                [ mknode "w:rPr" []
                                  [ rCustomStyle (show toktype) ]
-                               , mknode "w:t" [("xml:space","preserve")] tok ]
+                               , mknode "w:t" [("xml:space","preserve")] (T.unpack tok) ]
   withTextProp (rCustomStyle "VerbatimChar")
     $ if writerHighlight opts
          then case highlight formatOpenXML attrs str of
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
@@ -451,9 +451,14 @@
                     [nl opts, img, capt, nl opts]
               else H.div ! A.class_ "figure" $ mconcat
                     [nl opts, img, nl opts, capt, nl opts]
-blockToHtml opts (Para lst) = do
-  contents <- inlineListToHtml opts lst
-  return $ H.p contents
+blockToHtml opts (Para lst)
+  | isEmptyRaw lst = return mempty
+  | otherwise = do
+      contents <- inlineListToHtml opts lst
+      return $ H.p contents
+  where
+    isEmptyRaw [RawInline f _] = f /= (Format "html")
+    isEmptyRaw _                 = False
 blockToHtml opts (LineBlock lns) =
   if writerWrapText opts == WrapNone
   then blockToHtml opts $ linesToPara lns
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
@@ -508,7 +508,7 @@
         case highlight formatLaTeXBlock ("",classes,keyvalAttr) str of
                Nothing -> rawCodeBlock
                Just  h -> modify (\st -> st{ stHighlighting = True }) >>
-                          return (flush $ linkAnchor $$ text h)
+                          return (flush $ linkAnchor $$ text (T.unpack h))
   case () of
      _ | isEnabled Ext_literate_haskell opts && "haskell" `elem` classes &&
          "literate" `elem` classes                      -> lhsCodeBlock
@@ -640,6 +640,7 @@
   let scaleFactor = 0.97 ** fromIntegral (length aligns)
   let isSimple [Plain _] = True
       isSimple [Para  _] = True
+      isSimple []        = True
       isSimple _         = False
   -- simple tables have to have simple cells:
   let widths' = if not (all isSimple cols)
@@ -915,7 +916,7 @@
            case highlight formatLaTeXInline ("",classes,[]) str of
                   Nothing -> rawCode
                   Just  h -> modify (\st -> st{ stHighlighting = True }) >>
-                             return (text h)
+                             return (text (T.unpack h))
          rawCode = liftM (text . (\s -> "\\texttt{" ++ escapeSpaces s ++ "}"))
                           $ stringToLaTeX CodeString str
            where
diff --git a/src/Text/Pandoc/Writers/Markdown.hs b/src/Text/Pandoc/Writers/Markdown.hs
--- a/src/Text/Pandoc/Writers/Markdown.hs
+++ b/src/Text/Pandoc/Writers/Markdown.hs
@@ -979,15 +979,19 @@
              inlineListToMarkdown opts $
                (if plain then makeMathPlainer else id) $
                texMathToInlines InlineMath str
-inlineToMarkdown opts (Math DisplayMath str)
-  | isEnabled Ext_tex_math_dollars opts =
-      return $ "$$" <> text str <> "$$"
-  | isEnabled Ext_tex_math_single_backslash opts =
-      return $ "\\[" <> text str <> "\\]"
-  | isEnabled Ext_tex_math_double_backslash opts =
-      return $ "\\\\[" <> text str <> "\\\\]"
-  | otherwise = (\x -> cr <> x <> cr) `fmap`
-        inlineListToMarkdown opts (texMathToInlines DisplayMath str)
+inlineToMarkdown opts (Math DisplayMath str) =
+  case writerHTMLMathMethod opts of
+      WebTeX url -> (\x -> blankline <> x <> blankline) `fmap`
+             inlineToMarkdown opts (Image nullAttr [Str str]
+                    (url ++ urlEncode str, str))
+      _ | isEnabled Ext_tex_math_dollars opts ->
+            return $ "$$" <> text str <> "$$"
+        | isEnabled Ext_tex_math_single_backslash opts ->
+            return $ "\\[" <> text str <> "\\]"
+        | isEnabled Ext_tex_math_double_backslash opts ->
+            return $ "\\\\[" <> text str <> "\\\\]"
+        | otherwise -> (\x -> cr <> x <> cr) `fmap`
+              inlineListToMarkdown opts (texMathToInlines DisplayMath str)
 inlineToMarkdown opts (RawInline f str) = do
   plain <- asks envPlain
   if not plain &&
diff --git a/src/Text/Pandoc/Writers/OpenDocument.hs b/src/Text/Pandoc/Writers/OpenDocument.hs
--- a/src/Text/Pandoc/Writers/OpenDocument.hs
+++ b/src/Text/Pandoc/Writers/OpenDocument.hs
@@ -41,8 +41,11 @@
 import Control.Arrow ( (***), (>>>) )
 import Control.Monad.State hiding ( when )
 import Data.Char (chr)
+import qualified Data.Set as Set
 import qualified Data.Map as Map
 import Text.Pandoc.Writers.Shared
+import Data.List (sortBy)
+import Data.Ord (comparing)
 
 -- | Auxiliary function to convert Plain block to Para.
 plainToPara :: Block -> Block
@@ -58,8 +61,8 @@
                 , stTableStyles   :: [Doc]
                 , stParaStyles    :: [Doc]
                 , stListStyles    :: [(Int, [Doc])]
-                , stTextStyles    :: [Doc]
-                , stTextStyleAttr :: Map.Map TextStyle [(String,String)]
+                , stTextStyles    :: Map.Map (Set.Set TextStyle) (String, Doc)
+                , stTextStyleAttr :: Set.Set TextStyle
                 , stIndentPara    :: Int
                 , stInDefinition  :: Bool
                 , stTight         :: Bool
@@ -73,8 +76,8 @@
                 , stTableStyles   = []
                 , stParaStyles    = []
                 , stListStyles    = []
-                , stTextStyles    = []
-                , stTextStyleAttr = Map.empty
+                , stTextStyles    = Map.empty
+                , stTextStyleAttr = Set.empty
                 , stIndentPara    = 0
                 , stInDefinition  = False
                 , stTight         = False
@@ -94,14 +97,13 @@
 addParaStyle :: Doc -> State WriterState ()
 addParaStyle i = modify $ \s -> s { stParaStyles = i : stParaStyles s }
 
-addTextStyle :: Doc -> State WriterState ()
-addTextStyle i = modify $ \s -> s { stTextStyles = i : stTextStyles s }
-
-addTextStyleAttr :: (TextStyle, [(String,String)]) -> State WriterState ()
-addTextStyleAttr (ts, xs) = modify $ \s -> s { stTextStyleAttr = Map.insert ts xs (stTextStyleAttr s) }
+addTextStyle :: Set.Set TextStyle -> (String, Doc) -> State WriterState ()
+addTextStyle attrs i = modify $ \s ->
+  s { stTextStyles = Map.insert attrs i (stTextStyles s) }
 
-rmTextStyleAttr :: TextStyle -> State WriterState ()
-rmTextStyleAttr ts = modify $ \s -> s { stTextStyleAttr = Map.delete ts (stTextStyleAttr s) }
+addTextStyleAttr :: TextStyle -> State WriterState ()
+addTextStyleAttr t = modify $ \s ->
+  s { stTextStyleAttr = Set.insert t (stTextStyleAttr s) }
 
 increaseIndent :: State WriterState ()
 increaseIndent = modify $ \s -> s { stIndentPara = 1 + stIndentPara s }
@@ -136,20 +138,33 @@
 inSpanTags s = inTags False "text:span" [("text:style-name",s)]
 
 withTextStyle :: TextStyle -> State WriterState a -> State WriterState a
-withTextStyle s f = addTextStyleAttr (s,textStyleAttr s) >>
-                    f >>= \r -> rmTextStyleAttr s >> return r
+withTextStyle s f = do
+  oldTextStyleAttr <- gets stTextStyleAttr
+  addTextStyleAttr s
+  res <- f
+  modify $ \st -> st{ stTextStyleAttr = oldTextStyleAttr }
+  return res
 
 inTextStyle :: Doc -> State WriterState Doc
 inTextStyle d = do
   at <- gets stTextStyleAttr
-  if Map.null at
+  if Set.null at
      then return d
      else do
-       tn <- (+) 1 . length  <$> gets stTextStyles
-       addTextStyle $ inTags False "style:style" [("style:name"  , "T" ++ show tn)
-                                                 ,("style:family", "text"        )]
-                    $ selfClosingTag "style:text-properties" (concatMap snd $ Map.toList at)
-       return $ inTags False "text:span" [("text:style-name","T" ++ show tn)] d
+       styles <- gets stTextStyles
+       case Map.lookup at styles of
+            Just (styleName, _) -> return $
+              inTags False "text:span" [("text:style-name",styleName)] d
+            Nothing -> do
+              let styleName = "T" ++ show (Map.size styles + 1)
+              addTextStyle at (styleName,
+                     inTags False "style:style"
+                       [("style:name", styleName)
+                       ,("style:family", "text")]
+                    $ selfClosingTag "style:text-properties"
+                       (concatMap textStyleAttr (Set.toList at)))
+              return $ inTags False
+                  "text:span" [("text:style-name",styleName)] d
 
 inHeaderTags :: Int -> Doc -> State WriterState Doc
 inHeaderTags i d =
@@ -188,7 +203,9 @@
                   meta
            b <- render' `fmap` blocksToOpenDocument opts blocks
            return (b, m)
-      styles   = stTableStyles s ++ stParaStyles s ++ stTextStyles s
+      styles   = stTableStyles s ++ stParaStyles s ++
+                     map snd (reverse $ sortBy (comparing fst) $
+                        Map.elems (stTextStyles s))
       listStyle (n,l) = inTags True "text:list-style"
                           [("style:name", "L" ++ show n)] (vcat l)
       listStyles  = map listStyle (stListStyles s)
@@ -209,7 +226,7 @@
 
 inPreformattedTags :: String -> State WriterState Doc
 inPreformattedTags s = do
-  n <- paraStyle "Preformatted_20_Text" []
+  n <- paraStyle [("style:parent-style-name","Preformatted_20_Text")]
   return . inParagraphTagsWithStyle ("P" ++ show n) . handleSpaces $ s
 
 orderedListToOpenDocument :: WriterOptions -> Int -> [[Block]] -> State WriterState Doc
@@ -270,7 +287,8 @@
 inBlockQuote :: WriterOptions -> Int -> [Block] -> State WriterState Doc
 inBlockQuote  o i (b:bs)
     | BlockQuote l <- b = do increaseIndent
-                             ni <- paraStyle "Quotations" []
+                             ni <- paraStyle
+                                   [("style:parent-style-name","Quotations")]
                              go =<< inBlockQuote o ni (map plainToPara l)
     | Para       l <- b = do go =<< inParagraphTagsWithStyle ("P" ++ show  i) <$> inlinesToOpenDocument o l
     | otherwise         = do go =<< blockToOpenDocument o b
@@ -316,7 +334,8 @@
                            return r
       preformatted  s = (flush . vcat) <$> mapM (inPreformattedTags . escapeStringForXML) (lines s)
       mkBlockQuote  b = do increaseIndent
-                           i <- paraStyle "Quotations" []
+                           i <- paraStyle
+                                 [("style:parent-style-name","Quotations")]
                            inBlockQuote o i (map plainToPara b)
       orderedList a b = do (ln,pn) <- newOrderedListStyle (isTightList b) a
                            inTags True "text:list" [ ("text:style-name", "L" ++ show ln)]
@@ -371,20 +390,40 @@
 
 -- | Convert a list of inline elements to OpenDocument.
 inlinesToOpenDocument :: WriterOptions -> [Inline] -> State WriterState Doc
-inlinesToOpenDocument o l = hcat <$> mapM (inlineToOpenDocument o) l
+inlinesToOpenDocument o l = hcat <$> toChunks o l
 
+toChunks :: WriterOptions -> [Inline] -> State WriterState [Doc]
+toChunks _ [] = return []
+toChunks o (x : xs)
+  | isChunkable x = do
+        contents <- (inTextStyle . hcat) =<<
+                     mapM (inlineToOpenDocument o) (x:ys)
+        rest <- toChunks o zs
+        return (contents : rest)
+  | otherwise     = do
+        contents <- inlineToOpenDocument o x
+        rest <- toChunks o xs
+        return (contents : rest)
+  where (ys, zs) = span isChunkable xs
+
+isChunkable :: Inline -> Bool
+isChunkable (Str _) = True
+isChunkable Space   = True
+isChunkable SoftBreak = True
+isChunkable _ = False
+
 -- | Convert an inline element to OpenDocument.
 inlineToOpenDocument :: WriterOptions -> Inline -> State WriterState Doc
 inlineToOpenDocument o ils
   = case ils of
-    Space         -> inTextStyle space
+    Space         -> return space
     SoftBreak
      | writerWrapText o == WrapPreserve
-                  -> inTextStyle (preformatted "\n")
-     | otherwise  -> inTextStyle space
+                  -> return $ preformatted "\n"
+     | otherwise  -> return $ space
     Span _ xs     -> inlinesToOpenDocument o xs
     LineBreak     -> return $ selfClosingTag "text:line-break" []
-    Str         s -> inTextStyle $ handleSpaces $ escapeStringForXML s
+    Str         s -> return $ handleSpaces $ escapeStringForXML s
     Emph        l -> withTextStyle Italic $ inlinesToOpenDocument o l
     Strong      l -> withTextStyle Bold   $ inlinesToOpenDocument o l
     Strikeout   l -> withTextStyle Strike $ inlinesToOpenDocument o l
@@ -499,15 +538,14 @@
         columnStyles   = map colStyle wcs
     in  table $$ vcat columnStyles $$ cellStyle
 
-paraStyle :: String -> [(String,String)] -> State WriterState Int
-paraStyle parent attrs = do
+paraStyle :: [(String,String)] -> State WriterState Int
+paraStyle attrs = do
   pn <- (+)   1 . length       <$> gets stParaStyles
   i  <- (*) 0.5 . fromIntegral <$> gets stIndentPara :: State WriterState Double
   b  <- gets stInDefinition
   t  <- gets stTight
   let styleAttr = [ ("style:name"             , "P" ++ show pn)
-                  , ("style:family"           , "paragraph"   )
-                  , ("style:parent-style-name", parent        )]
+                  , ("style:family"           , "paragraph"   )]
       indentVal = flip (++) "in" . show $ if b then (max 0.5 i) else i
       tight     = if t then [ ("fo:margin-top"          , "0in"    )
                             , ("fo:margin-bottom"       , "0in"    )]
@@ -525,7 +563,9 @@
   return pn
 
 paraListStyle :: Int -> State WriterState Int
-paraListStyle l = paraStyle "Text_20_body" [("style:list-style-name", "L" ++ show l )]
+paraListStyle l = paraStyle
+  [("style:parent-style-name","Text_20_body")
+  ,("style:list-style-name", "L" ++ show l )]
 
 paraTableStyles :: String -> Int -> [Alignment] -> [(String, Doc)]
 paraTableStyles _ _ [] = []
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
@@ -92,7 +92,7 @@
 noteToOrg :: Int -> [Block] -> State WriterState Doc
 noteToOrg num note = do
   contents <- blockListToOrg note
-  let marker = "[" ++ show num ++ "] "
+  let marker = "[fn:" ++ show num ++ "] "
   return $ hang (length marker) (text marker) contents
 
 -- | Escape special characters for Org.
@@ -373,7 +373,7 @@
   notes <- get >>= (return . stNotes)
   modify $ \st -> st { stNotes = contents:notes }
   let ref = show $ (length notes) + 1
-  return $ "[" <> text ref <> "]"
+  return $ "[fn:" <> text ref <> "]"
 
 orgPath :: String -> String
 orgPath src =
diff --git a/stack.yaml b/stack.yaml
--- a/stack.yaml
+++ b/stack.yaml
@@ -11,4 +11,5 @@
 - texmath-0.9
 - doctemplates-0.1.0.2
 - pandoc-types-1.17.0.4
-resolver: lts-7.9
+- skylighting-0.1.1.2
+resolver: lts-7.14
diff --git a/tests/Tests/Readers/Markdown.hs b/tests/Tests/Readers/Markdown.hs
--- a/tests/Tests/Readers/Markdown.hs
+++ b/tests/Tests/Readers/Markdown.hs
@@ -149,7 +149,8 @@
                 (codeWith ("",["javascript"],[]) "document.write(\"Hello\");")
           , "with attribute space" =:
             "`*` {.haskell .special x=\"7\"}"
-            =?> para (codeWith ("",["haskell","special"],[("x","7")]) "*")
+            =?> para (code "*" <> space <> str "{.haskell" <> space <>
+                      str ".special" <> space <> str "x=\"7\"}")
           ]
         , testGroup "emph and strong"
           [ "two strongs in emph" =:
diff --git a/tests/Tests/Readers/Odt.hs b/tests/Tests/Readers/Odt.hs
--- a/tests/Tests/Readers/Odt.hs
+++ b/tests/Tests/Readers/Odt.hs
@@ -159,6 +159,8 @@
                                   , "simpleTable"
                                   , "simpleTableWithCaption"
 --                                , "table"
+                                  , "textMixedStyles"
+                                  , "tableWithContents"
                                   , "unicode"
                                   , "unorderedList"
                                   ]
diff --git a/tests/Tests/Readers/Org.hs b/tests/Tests/Readers/Org.hs
--- a/tests/Tests/Readers/Org.hs
+++ b/tests/Tests/Readers/Org.hs
@@ -47,6 +47,10 @@
           "/*strength*/" =?>
           para (emph . strong $ "strength")
 
+      , "Emphasized Strong preceded by space" =:
+          " */super/*" =?>
+          para (strong . emph $ "super")
+
       , "Strikeout" =:
           "+Kill Bill+" =?>
           para (strikeout . spcSep $ [ "Kill", "Bill" ])
@@ -330,6 +334,18 @@
                        }
         in (para $ cite [citation] "cite:pandoc")
 
+      , "Org-ref simple citation succeeded by comma" =:
+        "cite:pandoc," =?>
+        let citation = Citation
+                       { citationId = "pandoc"
+                       , citationPrefix = mempty
+                       , citationSuffix = mempty
+                       , citationMode = AuthorInText
+                       , citationNoteNum = 0
+                       , citationHash = 0
+                       }
+        in (para $ cite [citation] "cite:pandoc" <> str ",")
+
       , "Org-ref simple citep citation" =:
         "citep:pandoc" =?>
         let citation = Citation
@@ -1588,6 +1604,18 @@
                   , "#+END_LaTeX"
                   ] =?>
           rawBlock "latex" "The category $\\cat{Set}$ is adhesive.\n"
+
+      , "Raw LaTeX line" =:
+          "#+LATEX: \\let\\foo\\bar" =?>
+          rawBlock "latex" "\\let\\foo\\bar"
+
+      , "Raw Beamer line" =:
+          "#+beamer: \\pause" =?>
+          rawBlock "beamer" "\\pause"
+
+      , "Raw HTML line" =:
+          "#+HTML: <aside>not important</aside>" =?>
+          rawBlock "html" "<aside>not important</aside>"
 
       , "Export block HTML" =:
           unlines [ "#+BEGIN_export html"
diff --git a/tests/docx/table_one_row.native b/tests/docx/table_one_row.native
--- a/tests/docx/table_one_row.native
+++ b/tests/docx/table_one_row.native
@@ -1,5 +1,7 @@
 [Table [] [AlignDefault,AlignDefault,AlignDefault] [0.0,0.0,0.0]
- []
+ [[]
+ ,[]
+ ,[]]
  [[[Plain [Str "One"]]
   ,[Plain [Str "Row"]]
   ,[Plain [Str "Table"]]]]]
diff --git a/tests/docx/tables.native b/tests/docx/tables.native
--- a/tests/docx/tables.native
+++ b/tests/docx/tables.native
@@ -17,13 +17,15 @@
   ,[Plain [Str "High"]]
   ,[Plain [Str "Tacky",Space,Str "uniform"]]]]
 ,Table [] [AlignDefault,AlignDefault] [0.0,0.0]
- []
+ [[]
+ ,[]]
  [[[Plain [Str "Sinple"]]
   ,[Plain [Str "Table"]]]
  ,[[Plain [Str "Without"]]
   ,[Plain [Str "Header"]]]]
 ,Table [] [AlignDefault,AlignDefault] [0.0,0.0]
- []
+ [[]
+ ,[]]
  [[[Para [Str "Simple"]
    ,Para [Str "Multiparagraph"]]
   ,[Para [Str "Table"]
diff --git a/tests/lhs-test.latex b/tests/lhs-test.latex
--- a/tests/lhs-test.latex
+++ b/tests/lhs-test.latex
@@ -18,9 +18,10 @@
 \IfFileExists{upquote.sty}{\usepackage{upquote}}{}
 % use microtype if available
 \IfFileExists{microtype.sty}{%
-\usepackage{microtype}
+\usepackage[]{microtype}
 \UseMicrotypeSet[protrusion]{basicmath} % disable protrusion for tt fonts
 }{}
+\PassOptionsToPackage{hyphens}{url} % url is loaded by hyperref
 \usepackage[unicode=true]{hyperref}
 \hypersetup{
             pdfborder={0 0 0},
@@ -101,8 +102,8 @@
 
 \begin{Shaded}
 \begin{Highlighting}[]
-\OtherTok{unsplit ::} \NormalTok{(}\DataTypeTok{Arrow} \NormalTok{a) }\OtherTok{=>} \NormalTok{(b }\OtherTok{->} \NormalTok{c }\OtherTok{->} \NormalTok{d) }\OtherTok{->} \NormalTok{a (b, c) d}
-\NormalTok{unsplit }\FunctionTok{=} \NormalTok{arr }\FunctionTok{.} \NormalTok{uncurry}
+\OtherTok{unsplit ::}\NormalTok{ (}\DataTypeTok{Arrow}\NormalTok{ a) }\OtherTok{=>}\NormalTok{ (b }\OtherTok{->}\NormalTok{ c }\OtherTok{->}\NormalTok{ d) }\OtherTok{->}\NormalTok{ a (b, c) d}
+\NormalTok{unsplit }\FunctionTok{=}\NormalTok{ arr }\FunctionTok{.}\NormalTok{ uncurry}
           \CommentTok{-- arr (\textbackslash{}op (x,y) -> x `op` y)}
 \end{Highlighting}
 \end{Shaded}
diff --git a/tests/lhs-test.latex+lhs b/tests/lhs-test.latex+lhs
--- a/tests/lhs-test.latex+lhs
+++ b/tests/lhs-test.latex+lhs
@@ -18,9 +18,10 @@
 \IfFileExists{upquote.sty}{\usepackage{upquote}}{}
 % use microtype if available
 \IfFileExists{microtype.sty}{%
-\usepackage{microtype}
+\usepackage[]{microtype}
 \UseMicrotypeSet[protrusion]{basicmath} % disable protrusion for tt fonts
 }{}
+\PassOptionsToPackage{hyphens}{url} % url is loaded by hyperref
 \usepackage[unicode=true]{hyperref}
 \hypersetup{
             pdfborder={0 0 0},
diff --git a/tests/odt/native/tableWithContents.native b/tests/odt/native/tableWithContents.native
new file mode 100644
--- /dev/null
+++ b/tests/odt/native/tableWithContents.native
@@ -0,0 +1,1 @@
+[Table [] [AlignDefault,AlignDefault] [0.0,0.0] [[],[]]  [[[Plain [Str "A"]],[Plain [Str "B"]]],[[Plain [Str "C"]],[Plain [Str "D"]]]],Para []]
diff --git a/tests/odt/native/textMixedStyles.native b/tests/odt/native/textMixedStyles.native
new file mode 100644
--- /dev/null
+++ b/tests/odt/native/textMixedStyles.native
@@ -0,0 +1,5 @@
+[Para [Str "This",Space,Str "is",Space,Str "a",Space,Str "simple",Space,Str "text"]
+,Para []
+,Para [Str "that",Space,Str "is",Space,Str "both",Space,Emph [Str "italic",Space],Strong [Str "bold",Space],Emph [Str "underlined",Space],Str "and",Space,Str "the",Space,Emph [Strong [Str "first",Space,Str "two"]],Space,Str "and",Space,Str "the",Space,Emph [Strong [Str "last",Space,Str "two",Space]],Space,Str "and",Space,Strong [Strikeout [Str "bold",Space,Str "and",Space,Str "line",Space,Str "through"]]]
+,Para []
+,Para [Str "And",Space,Str "with",Space,Superscript [Emph [Str "superscripts"]]]]
diff --git a/tests/odt/odt/tableWithContents.odt b/tests/odt/odt/tableWithContents.odt
new file mode 100644
Binary files /dev/null and b/tests/odt/odt/tableWithContents.odt differ
diff --git a/tests/odt/odt/textMixedStyles.odt b/tests/odt/odt/textMixedStyles.odt
new file mode 100644
Binary files /dev/null and b/tests/odt/odt/textMixedStyles.odt differ
diff --git a/tests/writer.docbook5 b/tests/writer.docbook5
--- a/tests/writer.docbook5
+++ b/tests/writer.docbook5
@@ -1,6 +1,8 @@
 <?xml version="1.0" encoding="utf-8" ?>
 <!DOCTYPE article>
-<article xmlns="http://docbook.org/ns/docbook" version="5.0">
+<article
+  xmlns="http://docbook.org/ns/docbook" version="5.0"
+  xmlns:xlink="http://www.w3.org/1999/xlink" >
   <info>
     <title>Pandoc Test Suite</title>
     <authorgroup>
@@ -19,16 +21,16 @@
   This is a set of tests for pandoc. Most of them are adapted from John
   Gruber’s markdown test suite.
 </para>
-<section id="headers">
+<section xml:id="headers">
   <title>Headers</title>
-  <section id="level-2-with-an-embedded-link">
+  <section xml:id="level-2-with-an-embedded-link">
     <title>Level 2 with an <link xlink:href="/url">embedded
     link</link></title>
-    <section id="level-3-with-emphasis">
+    <section xml:id="level-3-with-emphasis">
       <title>Level 3 with <emphasis>emphasis</emphasis></title>
-      <section id="level-4">
+      <section xml:id="level-4">
         <title>Level 4</title>
-        <section id="level-5">
+        <section xml:id="level-5">
           <title>Level 5</title>
           <para>
           </para>
@@ -37,25 +39,25 @@
     </section>
   </section>
 </section>
-<section id="level-1">
+<section xml:id="level-1">
   <title>Level 1</title>
-  <section id="level-2-with-emphasis">
+  <section xml:id="level-2-with-emphasis">
     <title>Level 2 with <emphasis>emphasis</emphasis></title>
-    <section id="level-3">
+    <section xml:id="level-3">
       <title>Level 3</title>
       <para>
         with no blank line
       </para>
     </section>
   </section>
-  <section id="level-2">
+  <section xml:id="level-2">
     <title>Level 2</title>
     <para>
       with no blank line
     </para>
   </section>
 </section>
-<section id="paragraphs">
+<section xml:id="paragraphs">
   <title>Paragraphs</title>
   <para>
     Here’s a regular paragraph.
@@ -71,7 +73,7 @@
 <literallayout>There should be a hard line break
 here.</literallayout>
 </section>
-<section id="block-quotes">
+<section xml:id="block-quotes">
   <title>Block Quotes</title>
   <para>
     E-mail style:
@@ -126,7 +128,7 @@
     And a following paragraph.
   </para>
 </section>
-<section id="code-blocks">
+<section xml:id="code-blocks">
   <title>Code Blocks</title>
   <para>
     Code:
@@ -149,9 +151,9 @@
 These should not be escaped:  \$ \\ \&gt; \[ \{
 </programlisting>
 </section>
-<section id="lists">
+<section xml:id="lists">
   <title>Lists</title>
-  <section id="unordered">
+  <section xml:id="unordered">
     <title>Unordered</title>
     <para>
       Asterisks tight:
@@ -274,7 +276,7 @@
       </listitem>
     </itemizedlist>
   </section>
-  <section id="ordered">
+  <section xml:id="ordered">
     <title>Ordered</title>
     <para>
       Tight:
@@ -381,7 +383,7 @@
       </listitem>
     </orderedlist>
   </section>
-  <section id="nested">
+  <section xml:id="nested">
     <title>Nested</title>
     <itemizedlist spacing="compact">
       <listitem>
@@ -479,7 +481,7 @@
       </listitem>
     </orderedlist>
   </section>
-  <section id="tabs-and-spaces">
+  <section xml:id="tabs-and-spaces">
     <title>Tabs and spaces</title>
     <itemizedlist>
       <listitem>
@@ -506,7 +508,7 @@
       </listitem>
     </itemizedlist>
   </section>
-  <section id="fancy-list-markers">
+  <section xml:id="fancy-list-markers">
     <title>Fancy list markers</title>
     <orderedlist numeration="arabic">
       <listitem override="2">
@@ -611,7 +613,7 @@
     </para>
   </section>
 </section>
-<section id="definition-lists">
+<section xml:id="definition-lists">
   <title>Definition Lists</title>
   <para>
     Tight using spaces:
@@ -857,7 +859,7 @@
     </varlistentry>
   </variablelist>
 </section>
-<section id="html-blocks">
+<section xml:id="html-blocks">
   <title>HTML Blocks</title>
   <para>
     Simple block on one line:
@@ -930,7 +932,7 @@
     Hr’s:
   </para>
 </section>
-<section id="inline-markup">
+<section xml:id="inline-markup">
   <title>Inline Markup</title>
   <para>
     This is <emphasis>emphasized</emphasis>, and so <emphasis>is
@@ -980,7 +982,7 @@
     spaces: a^b c^d, a~b c~d.
   </para>
 </section>
-<section id="smart-quotes-ellipses-dashes">
+<section xml:id="smart-quotes-ellipses-dashes">
   <title>Smart quotes, ellipses, dashes</title>
   <para>
     <quote>Hello,</quote> said the spider. <quote><quote>Shelob</quote> is my
@@ -1012,7 +1014,7 @@
     Ellipses…and…and….
   </para>
 </section>
-<section id="latex">
+<section xml:id="latex">
   <title>LaTeX</title>
   <itemizedlist spacing="compact">
     <listitem>
@@ -1088,7 +1090,7 @@
     Here’s a LaTeX table:
   </para>
 </section>
-<section id="special-characters">
+<section xml:id="special-characters">
   <title>Special Characters</title>
   <para>
     Here is some unicode:
@@ -1184,9 +1186,9 @@
     Minus: -
   </para>
 </section>
-<section id="links">
+<section xml:id="links">
   <title>Links</title>
-  <section id="explicit">
+  <section xml:id="explicit">
     <title>Explicit</title>
     <para>
       Just a <link xlink:href="/url/">URL</link>.
@@ -1216,7 +1218,7 @@
       <link xlink:href="">Empty</link>.
     </para>
   </section>
-  <section id="reference">
+  <section xml:id="reference">
     <title>Reference</title>
     <para>
       Foo <link xlink:href="/url/">bar</link>.
@@ -1255,7 +1257,7 @@
       Foo <link xlink:href="/url/">biz</link>.
     </para>
   </section>
-  <section id="with-ampersands">
+  <section xml:id="with-ampersands">
     <title>With ampersands</title>
     <para>
       Here’s a <link xlink:href="http://example.com/?foo=1&amp;bar=2">link
@@ -1273,7 +1275,7 @@
       pointy braces</link>.
     </para>
   </section>
-  <section id="autolinks">
+  <section xml:id="autolinks">
     <title>Autolinks</title>
     <para>
       With an ampersand:
@@ -1314,7 +1316,7 @@
 </programlisting>
   </section>
 </section>
-<section id="images">
+<section xml:id="images">
   <title>Images</title>
   <para>
     From <quote>Voyage dans la Lune</quote> by Georges Melies (1902):
@@ -1336,7 +1338,7 @@
     </inlinemediaobject> icon.
   </para>
 </section>
-<section id="footnotes">
+<section xml:id="footnotes">
   <title>Footnotes</title>
   <para>
     Here is a footnote reference,<footnote>
diff --git a/tests/writer.latex b/tests/writer.latex
--- a/tests/writer.latex
+++ b/tests/writer.latex
@@ -18,9 +18,11 @@
 \IfFileExists{upquote.sty}{\usepackage{upquote}}{}
 % use microtype if available
 \IfFileExists{microtype.sty}{%
-\usepackage{microtype}
+\usepackage[]{microtype}
 \UseMicrotypeSet[protrusion]{basicmath} % disable protrusion for tt fonts
 }{}
+\PassOptionsToPackage{hyphens}{url} % url is loaded by hyperref
+\usepackage{fancyvrb}
 \usepackage[unicode=true]{hyperref}
 \hypersetup{
             pdftitle={Pandoc Test Suite},
@@ -28,7 +30,6 @@
             pdfborder={0 0 0},
             breaklinks=true}
 \urlstyle{same}  % don't use monospace font for urls
-\usepackage{fancyvrb}
 \VerbatimFootnotes % allows verbatim text in footnotes
 \usepackage{graphicx,grffile}
 \makeatletter
diff --git a/tests/writer.opendocument b/tests/writer.opendocument
--- a/tests/writer.opendocument
+++ b/tests/writer.opendocument
@@ -632,73 +632,13 @@
       </text:list-level-style-number>
     </text:list-style>
     <style:style style:name="T1" style:family="text"><style:text-properties fo:font-style="italic" style:font-style-asian="italic" style:font-style-complex="italic" /></style:style>
-    <style:style style:name="T2" style:family="text"><style:text-properties fo:font-style="italic" style:font-style-asian="italic" style:font-style-complex="italic" /></style:style>
-    <style:style style:name="T3" style:family="text"><style:text-properties fo:font-style="italic" style:font-style-asian="italic" style:font-style-complex="italic" /></style:style>
-    <style:style style:name="T4" style:family="text"><style:text-properties fo:font-style="italic" style:font-style-asian="italic" style:font-style-complex="italic" /></style:style>
-    <style:style style:name="T5" style:family="text"><style:text-properties fo:font-style="italic" style:font-style-asian="italic" style:font-style-complex="italic" /></style:style>
-    <style:style style:name="T6" style:family="text"><style:text-properties fo:font-weight="bold" style:font-weight-asian="bold" style:font-weight-complex="bold" /></style:style>
-    <style:style style:name="T7" style:family="text"><style:text-properties fo:font-style="italic" style:font-style-asian="italic" style:font-style-complex="italic" /></style:style>
-    <style:style style:name="T8" style:family="text"><style:text-properties fo:font-style="italic" style:font-style-asian="italic" style:font-style-complex="italic" /></style:style>
-    <style:style style:name="T9" style:family="text"><style:text-properties fo:font-style="italic" style:font-style-asian="italic" style:font-style-complex="italic" /></style:style>
-    <style:style style:name="T10" style:family="text"><style:text-properties fo:font-style="italic" style:font-style-asian="italic" style:font-style-complex="italic" /></style:style>
-    <style:style style:name="T11" style:family="text"><style:text-properties fo:font-weight="bold" style:font-weight-asian="bold" style:font-weight-complex="bold" /></style:style>
-    <style:style style:name="T12" style:family="text"><style:text-properties fo:font-weight="bold" style:font-weight-asian="bold" style:font-weight-complex="bold" /></style:style>
-    <style:style style:name="T13" style:family="text"><style:text-properties fo:font-weight="bold" style:font-weight-asian="bold" style:font-weight-complex="bold" /></style:style>
-    <style:style style:name="T14" style:family="text"><style:text-properties fo:font-weight="bold" style:font-weight-asian="bold" style:font-weight-complex="bold" /></style:style>
-    <style:style style:name="T15" style:family="text"><style:text-properties fo:font-style="italic" style:font-style-asian="italic" style:font-style-complex="italic" /></style:style>
-    <style:style style:name="T16" style:family="text"><style:text-properties fo:font-style="italic" style:font-style-asian="italic" style:font-style-complex="italic" /></style:style>
-    <style:style style:name="T17" style:family="text"><style:text-properties fo:font-style="italic" style:font-style-asian="italic" style:font-style-complex="italic" /></style:style>
-    <style:style style:name="T18" style:family="text"><style:text-properties fo:font-style="italic" style:font-style-asian="italic" style:font-style-complex="italic" fo:font-weight="bold" style:font-weight-asian="bold" style:font-weight-complex="bold" /></style:style>
-    <style:style style:name="T19" style:family="text"><style:text-properties fo:font-style="italic" style:font-style-asian="italic" style:font-style-complex="italic" fo:font-weight="bold" style:font-weight-asian="bold" style:font-weight-complex="bold" /></style:style>
-    <style:style style:name="T20" style:family="text"><style:text-properties fo:font-style="italic" style:font-style-asian="italic" style:font-style-complex="italic" fo:font-weight="bold" style:font-weight-asian="bold" style:font-weight-complex="bold" /></style:style>
-    <style:style style:name="T21" style:family="text"><style:text-properties fo:font-style="italic" style:font-style-asian="italic" style:font-style-complex="italic" fo:font-weight="bold" style:font-weight-asian="bold" style:font-weight-complex="bold" /></style:style>
-    <style:style style:name="T22" style:family="text"><style:text-properties fo:font-style="italic" style:font-style-asian="italic" style:font-style-complex="italic" fo:font-weight="bold" style:font-weight-asian="bold" style:font-weight-complex="bold" /></style:style>
-    <style:style style:name="T23" style:family="text"><style:text-properties fo:font-style="italic" style:font-style-asian="italic" style:font-style-complex="italic" fo:font-weight="bold" style:font-weight-asian="bold" style:font-weight-complex="bold" /></style:style>
-    <style:style style:name="T24" style:family="text"><style:text-properties fo:font-style="italic" style:font-style-asian="italic" style:font-style-complex="italic" fo:font-weight="bold" style:font-weight-asian="bold" style:font-weight-complex="bold" /></style:style>
-    <style:style style:name="T25" style:family="text"><style:text-properties fo:font-style="italic" style:font-style-asian="italic" style:font-style-complex="italic" fo:font-weight="bold" style:font-weight-asian="bold" style:font-weight-complex="bold" /></style:style>
-    <style:style style:name="T26" style:family="text"><style:text-properties fo:font-style="italic" style:font-style-asian="italic" style:font-style-complex="italic" fo:font-weight="bold" style:font-weight-asian="bold" style:font-weight-complex="bold" /></style:style>
-    <style:style style:name="T27" style:family="text"><style:text-properties fo:font-style="italic" style:font-style-asian="italic" style:font-style-complex="italic" fo:font-weight="bold" style:font-weight-asian="bold" style:font-weight-complex="bold" /></style:style>
-    <style:style style:name="T28" style:family="text"><style:text-properties fo:font-style="italic" style:font-style-asian="italic" style:font-style-complex="italic" fo:font-weight="bold" style:font-weight-asian="bold" style:font-weight-complex="bold" /></style:style>
-    <style:style style:name="T29" style:family="text"><style:text-properties fo:font-style="italic" style:font-style-asian="italic" style:font-style-complex="italic" fo:font-weight="bold" style:font-weight-asian="bold" style:font-weight-complex="bold" /></style:style>
-    <style:style style:name="T30" style:family="text"><style:text-properties fo:font-style="italic" style:font-style-asian="italic" style:font-style-complex="italic" fo:font-weight="bold" style:font-weight-asian="bold" style:font-weight-complex="bold" /></style:style>
-    <style:style style:name="T31" style:family="text"><style:text-properties fo:font-style="italic" style:font-style-asian="italic" style:font-style-complex="italic" fo:font-weight="bold" style:font-weight-asian="bold" style:font-weight-complex="bold" /></style:style>
-    <style:style style:name="T32" style:family="text"><style:text-properties fo:font-style="italic" style:font-style-asian="italic" style:font-style-complex="italic" fo:font-weight="bold" style:font-weight-asian="bold" style:font-weight-complex="bold" /></style:style>
-    <style:style style:name="T33" style:family="text"><style:text-properties fo:font-style="italic" style:font-style-asian="italic" style:font-style-complex="italic" fo:font-weight="bold" style:font-weight-asian="bold" style:font-weight-complex="bold" /></style:style>
-    <style:style style:name="T34" style:family="text"><style:text-properties fo:font-style="italic" style:font-style-asian="italic" style:font-style-complex="italic" fo:font-weight="bold" style:font-weight-asian="bold" style:font-weight-complex="bold" /></style:style>
-    <style:style style:name="T35" style:family="text"><style:text-properties fo:font-style="italic" style:font-style-asian="italic" style:font-style-complex="italic" fo:font-weight="bold" style:font-weight-asian="bold" style:font-weight-complex="bold" /></style:style>
-    <style:style style:name="T36" style:family="text"><style:text-properties fo:font-style="italic" style:font-style-asian="italic" style:font-style-complex="italic" fo:font-weight="bold" style:font-weight-asian="bold" style:font-weight-complex="bold" /></style:style>
-    <style:style style:name="T37" style:family="text"><style:text-properties fo:font-style="italic" style:font-style-asian="italic" style:font-style-complex="italic" fo:font-weight="bold" style:font-weight-asian="bold" style:font-weight-complex="bold" /></style:style>
-    <style:style style:name="T38" style:family="text"><style:text-properties style:text-line-through-style="solid" /></style:style>
-    <style:style style:name="T39" style:family="text"><style:text-properties style:text-line-through-style="solid" /></style:style>
-    <style:style style:name="T40" style:family="text"><style:text-properties style:text-line-through-style="solid" /></style:style>
-    <style:style style:name="T41" style:family="text"><style:text-properties style:text-line-through-style="solid" /></style:style>
-    <style:style style:name="T42" style:family="text"><style:text-properties fo:font-style="italic" style:font-style-asian="italic" style:font-style-complex="italic" style:text-line-through-style="solid" /></style:style>
-    <style:style style:name="T43" style:family="text"><style:text-properties style:text-line-through-style="solid" /></style:style>
-    <style:style style:name="T44" style:family="text"><style:text-properties style:text-position="super 58%" /></style:style>
-    <style:style style:name="T45" style:family="text"><style:text-properties fo:font-style="italic" style:font-style-asian="italic" style:font-style-complex="italic" style:text-position="super 58%" /></style:style>
-    <style:style style:name="T46" style:family="text"><style:text-properties style:text-position="super 58%" /></style:style>
-    <style:style style:name="T47" style:family="text"><style:text-properties style:text-position="sub 58%" /></style:style>
-    <style:style style:name="T48" style:family="text"><style:text-properties style:text-position="sub 58%" /></style:style>
-    <style:style style:name="T49" style:family="text"><style:text-properties style:text-position="sub 58%" /></style:style>
-    <style:style style:name="T50" style:family="text"><style:text-properties fo:font-style="italic" style:font-style-asian="italic" style:font-style-complex="italic" /></style:style>
-    <style:style style:name="T51" style:family="text"><style:text-properties fo:font-style="italic" style:font-style-asian="italic" style:font-style-complex="italic" /></style:style>
-    <style:style style:name="T52" style:family="text"><style:text-properties fo:font-style="italic" style:font-style-asian="italic" style:font-style-complex="italic" /></style:style>
-    <style:style style:name="T53" style:family="text"><style:text-properties fo:font-style="italic" style:font-style-asian="italic" style:font-style-complex="italic" /></style:style>
-    <style:style style:name="T54" style:family="text"><style:text-properties fo:font-style="italic" style:font-style-asian="italic" style:font-style-complex="italic" /></style:style>
-    <style:style style:name="T55" style:family="text"><style:text-properties fo:font-style="italic" style:font-style-asian="italic" style:font-style-complex="italic" /></style:style>
-    <style:style style:name="T56" style:family="text"><style:text-properties fo:font-style="italic" style:font-style-asian="italic" style:font-style-complex="italic" /></style:style>
-    <style:style style:name="T57" style:family="text"><style:text-properties fo:font-style="italic" style:font-style-asian="italic" style:font-style-complex="italic" /></style:style>
-    <style:style style:name="T58" style:family="text"><style:text-properties style:text-position="super 58%" /></style:style>
-    <style:style style:name="T59" style:family="text"><style:text-properties fo:font-style="italic" style:font-style-asian="italic" style:font-style-complex="italic" /></style:style>
-    <style:style style:name="T60" style:family="text"><style:text-properties fo:font-style="italic" style:font-style-asian="italic" style:font-style-complex="italic" /></style:style>
-    <style:style style:name="T61" style:family="text"><style:text-properties fo:font-style="italic" style:font-style-asian="italic" style:font-style-complex="italic" /></style:style>
-    <style:style style:name="T62" style:family="text"><style:text-properties fo:font-style="italic" style:font-style-asian="italic" style:font-style-complex="italic" /></style:style>
-    <style:style style:name="T63" style:family="text"><style:text-properties fo:font-style="italic" style:font-style-asian="italic" style:font-style-complex="italic" /></style:style>
-    <style:style style:name="T64" style:family="text"><style:text-properties fo:font-style="italic" style:font-style-asian="italic" style:font-style-complex="italic" /></style:style>
-    <style:style style:name="T65" style:family="text"><style:text-properties fo:font-style="italic" style:font-style-asian="italic" style:font-style-complex="italic" /></style:style>
-    <style:style style:name="T66" style:family="text"><style:text-properties fo:font-style="italic" style:font-style-asian="italic" style:font-style-complex="italic" /></style:style>
-    <style:style style:name="T67" style:family="text"><style:text-properties fo:font-style="italic" style:font-style-asian="italic" style:font-style-complex="italic" /></style:style>
-    <style:style style:name="T68" style:family="text"><style:text-properties fo:font-style="italic" style:font-style-asian="italic" style:font-style-complex="italic" /></style:style>
+    <style:style style:name="T2" style:family="text"><style:text-properties fo:font-weight="bold" style:font-weight-asian="bold" style:font-weight-complex="bold" /></style:style>
+    <style:style style:name="T3" style:family="text"><style:text-properties fo:font-style="italic" style:font-style-asian="italic" style:font-style-complex="italic" fo:font-weight="bold" style:font-weight-asian="bold" style:font-weight-complex="bold" /></style:style>
+    <style:style style:name="T4" style:family="text"><style:text-properties style:text-line-through-style="solid" /></style:style>
+    <style:style style:name="T5" style:family="text"><style:text-properties fo:font-style="italic" style:font-style-asian="italic" style:font-style-complex="italic" style:text-line-through-style="solid" /></style:style>
+    <style:style style:name="T6" style:family="text"><style:text-properties style:text-position="super 58%" /></style:style>
+    <style:style style:name="T7" style:family="text"><style:text-properties fo:font-style="italic" style:font-style-asian="italic" style:font-style-complex="italic" style:text-position="super 58%" /></style:style>
+    <style:style style:name="T8" style:family="text"><style:text-properties style:text-position="sub 58%" /></style:style>
     <style:style style:name="P1" style:family="paragraph" style:parent-style-name="Quotations">
       <style:paragraph-properties fo:margin-left="0.5in" fo:margin-right="0in" fo:text-indent="0in" style:auto-text-indent="false" />
     </style:style>
@@ -871,7 +811,7 @@
 <text:h text:style-name="Heading_20_5" text:outline-level="5">Level 5</text:h>
 <text:h text:style-name="Heading_20_1" text:outline-level="1">Level 1</text:h>
 <text:h text:style-name="Heading_20_2" text:outline-level="2">Level 2 with
-<text:span text:style-name="T2">emphasis</text:span></text:h>
+<text:span text:style-name="T1">emphasis</text:span></text:h>
 <text:h text:style-name="Heading_20_3" text:outline-level="3">Level 3</text:h>
 <text:p text:style-name="First_20_paragraph">with no blank line</text:p>
 <text:h text:style-name="Heading_20_2" text:outline-level="2">Level 2</text:h>
@@ -1244,11 +1184,11 @@
 <text:p text:style-name="Definition_20_Definition">yellow fruit</text:p>
 <text:p text:style-name="First_20_paragraph">Multiple blocks with
 italics:</text:p>
-<text:p text:style-name="Definition_20_Term"><text:span text:style-name="T3">apple</text:span></text:p>
+<text:p text:style-name="Definition_20_Term"><text:span text:style-name="T1">apple</text:span></text:p>
 <text:p text:style-name="Definition_20_Definition">red
 fruit</text:p><text:p text:style-name="Definition_20_Definition">contains
 seeds, crisp, pleasant to taste</text:p>
-<text:p text:style-name="Definition_20_Term"><text:span text:style-name="T4">orange</text:span></text:p>
+<text:p text:style-name="Definition_20_Term"><text:span text:style-name="T1">orange</text:span></text:p>
 <text:p text:style-name="Definition_20_Definition">orange fruit</text:p><text:p text:style-name="P42">{ orange code block }</text:p><text:p text:style-name="P43">orange
 block quote</text:p>
 <text:p text:style-name="First_20_paragraph">Multiple definitions,
@@ -1295,9 +1235,9 @@
 <text:p text:style-name="Text_20_body">Interpreted markdown in a
 table:</text:p>
 <text:p text:style-name="Text_20_body">This is
-<text:span text:style-name="T5">emphasized</text:span></text:p>
+<text:span text:style-name="T1">emphasized</text:span></text:p>
 <text:p text:style-name="Text_20_body">And this is
-<text:span text:style-name="T6">strong</text:span></text:p>
+<text:span text:style-name="T2">strong</text:span></text:p>
 <text:p text:style-name="Text_20_body">Here’s a simple block:</text:p>
 <text:p text:style-name="Text_20_body">foo</text:p>
 <text:p text:style-name="Text_20_body">This should be a code block,
@@ -1323,47 +1263,38 @@
 <text:h text:style-name="Heading_20_1" text:outline-level="1">Inline
 Markup</text:h>
 <text:p text:style-name="First_20_paragraph">This is
-<text:span text:style-name="T7">emphasized</text:span>, and so
-<text:span text:style-name="T8">is</text:span><text:span text:style-name="T9">
-</text:span><text:span text:style-name="T10">this</text:span>.</text:p>
+<text:span text:style-name="T1">emphasized</text:span>, and so
+<text:span text:style-name="T1">is this</text:span>.</text:p>
 <text:p text:style-name="Text_20_body">This is
-<text:span text:style-name="T11">strong</text:span>, and so
-<text:span text:style-name="T12">is</text:span><text:span text:style-name="T13">
-</text:span><text:span text:style-name="T14">this</text:span>.</text:p>
+<text:span text:style-name="T2">strong</text:span>, and so
+<text:span text:style-name="T2">is this</text:span>.</text:p>
 <text:p text:style-name="Text_20_body">An
-<text:a xlink:type="simple" xlink:href="/url" office:name=""><text:span text:style-name="Definition"><text:span text:style-name="T15">emphasized</text:span><text:span text:style-name="T16">
-</text:span><text:span text:style-name="T17">link</text:span></text:span></text:a>.</text:p>
-<text:p text:style-name="Text_20_body"><text:span text:style-name="T18">This</text:span><text:span text:style-name="T19">
-</text:span><text:span text:style-name="T20">is</text:span><text:span text:style-name="T21">
-</text:span><text:span text:style-name="T22">strong</text:span><text:span text:style-name="T23">
-</text:span><text:span text:style-name="T24">and</text:span><text:span text:style-name="T25">
-</text:span><text:span text:style-name="T26">em.</text:span></text:p>
+<text:a xlink:type="simple" xlink:href="/url" office:name=""><text:span text:style-name="Definition"><text:span text:style-name="T1">emphasized
+link</text:span></text:span></text:a>.</text:p>
+<text:p text:style-name="Text_20_body"><text:span text:style-name="T3">This is
+strong and em.</text:span></text:p>
 <text:p text:style-name="Text_20_body">So is
-<text:span text:style-name="T27">this</text:span> word.</text:p>
-<text:p text:style-name="Text_20_body"><text:span text:style-name="T28">This</text:span><text:span text:style-name="T29">
-</text:span><text:span text:style-name="T30">is</text:span><text:span text:style-name="T31">
-</text:span><text:span text:style-name="T32">strong</text:span><text:span text:style-name="T33">
-</text:span><text:span text:style-name="T34">and</text:span><text:span text:style-name="T35">
-</text:span><text:span text:style-name="T36">em.</text:span></text:p>
+<text:span text:style-name="T3">this</text:span> word.</text:p>
+<text:p text:style-name="Text_20_body"><text:span text:style-name="T3">This is
+strong and em.</text:span></text:p>
 <text:p text:style-name="Text_20_body">So is
-<text:span text:style-name="T37">this</text:span> word.</text:p>
+<text:span text:style-name="T3">this</text:span> word.</text:p>
 <text:p text:style-name="Text_20_body">This is code:
 <text:span text:style-name="Source_Text">&gt;</text:span>,
 <text:span text:style-name="Source_Text">$</text:span>,
 <text:span text:style-name="Source_Text">\</text:span>,
 <text:span text:style-name="Source_Text">\$</text:span>,
 <text:span text:style-name="Source_Text">&lt;html&gt;</text:span>.</text:p>
-<text:p text:style-name="Text_20_body"><text:span text:style-name="T38">This</text:span><text:span text:style-name="T39">
-</text:span><text:span text:style-name="T40">is</text:span><text:span text:style-name="T41">
-</text:span><text:span text:style-name="T42">strikeout</text:span><text:span text:style-name="T43">.</text:span></text:p>
+<text:p text:style-name="Text_20_body"><text:span text:style-name="T4">This is
+</text:span><text:span text:style-name="T5">strikeout</text:span><text:span text:style-name="T4">.</text:span></text:p>
 <text:p text:style-name="Text_20_body">Superscripts:
-a<text:span text:style-name="T44">bc</text:span>d
-a<text:span text:style-name="T45">hello</text:span>
-a<text:span text:style-name="T46">hello there</text:span>.</text:p>
+a<text:span text:style-name="T6">bc</text:span>d
+a<text:span text:style-name="T7">hello</text:span>
+a<text:span text:style-name="T6">hello there</text:span>.</text:p>
 <text:p text:style-name="Text_20_body">Subscripts:
-H<text:span text:style-name="T47">2</text:span>O,
-H<text:span text:style-name="T48">23</text:span>O,
-H<text:span text:style-name="T49">many of them</text:span>O.</text:p>
+H<text:span text:style-name="T8">2</text:span>O,
+H<text:span text:style-name="T8">23</text:span>O,
+H<text:span text:style-name="T8">many of them</text:span>O.</text:p>
 <text:p text:style-name="Text_20_body">These should not be superscripts or
 subscripts, because of the unescaped spaces: a^b c^d, a~b c~d.</text:p>
 <text:p text:style-name="Horizontal_20_Line" />
@@ -1395,16 +1326,16 @@
     <text:p text:style-name="P51">2 + 2 = 4</text:p>
   </text:list-item>
   <text:list-item>
-    <text:p text:style-name="P51"><text:span text:style-name="T50">x</text:span> ∈ <text:span text:style-name="T51">y</text:span></text:p>
+    <text:p text:style-name="P51"><text:span text:style-name="T1">x</text:span> ∈ <text:span text:style-name="T1">y</text:span></text:p>
   </text:list-item>
   <text:list-item>
-    <text:p text:style-name="P51"><text:span text:style-name="T52">α</text:span> ∧ <text:span text:style-name="T53">ω</text:span></text:p>
+    <text:p text:style-name="P51"><text:span text:style-name="T1">α</text:span> ∧ <text:span text:style-name="T1">ω</text:span></text:p>
   </text:list-item>
   <text:list-item>
     <text:p text:style-name="P51">223</text:p>
   </text:list-item>
   <text:list-item>
-    <text:p text:style-name="P51"><text:span text:style-name="T54">p</text:span>-Tree</text:p>
+    <text:p text:style-name="P51"><text:span text:style-name="T1">p</text:span>-Tree</text:p>
   </text:list-item>
   <text:list-item>
     <text:p text:style-name="P51">Here’s some display math:
@@ -1412,7 +1343,7 @@
   </text:list-item>
   <text:list-item>
     <text:p text:style-name="P51">Here’s one that has a line break in it:
-    <text:span text:style-name="T55">α</text:span> + <text:span text:style-name="T56">ω</text:span> × <text:span text:style-name="T57">x</text:span><text:span text:style-name="T58">2</text:span>.</text:p>
+    <text:span text:style-name="T1">α</text:span> + <text:span text:style-name="T1">ω</text:span> × <text:span text:style-name="T1">x</text:span><text:span text:style-name="T6">2</text:span>.</text:p>
   </text:list-item>
 </text:list>
 <text:p text:style-name="First_20_paragraph">These shouldn’t be math:</text:p>
@@ -1423,7 +1354,7 @@
   </text:list-item>
   <text:list-item>
     <text:p text:style-name="P52">$22,000 is a
-    <text:span text:style-name="T59">lot</text:span> of money. So is $34,000.
+    <text:span text:style-name="T1">lot</text:span> of money. So is $34,000.
     (It worked if “lot” is emphasized.)</text:p>
   </text:list-item>
   <text:list-item>
@@ -1432,10 +1363,7 @@
   <text:list-item>
     <text:p text:style-name="P52">Escaped
     <text:span text:style-name="Source_Text">$</text:span>: $73
-    <text:span text:style-name="T60">this</text:span><text:span text:style-name="T61">
-    </text:span><text:span text:style-name="T62">should</text:span><text:span text:style-name="T63">
-    </text:span><text:span text:style-name="T64">be</text:span><text:span text:style-name="T65">
-    </text:span><text:span text:style-name="T66">emphasized</text:span>
+    <text:span text:style-name="T1">this should be emphasized</text:span>
     23$.</text:p>
   </text:list-item>
 </text:list>
@@ -1585,10 +1513,10 @@
 items).</text:p><text:p text:style-name="P58"><text:s text:c="2" />{ &lt;code&gt; }</text:p><text:p text:style-name="Footnote">If
 you want, you can indent every line, but you can also be lazy and just indent
 the first line of each block.</text:p></text:note-body></text:note> This
-should <text:span text:style-name="T67">not</text:span> be a footnote
+should <text:span text:style-name="T1">not</text:span> be a footnote
 reference, because it contains a space.[^my note] Here is an inline
 note.<text:note text:id="ftn2" text:note-class="footnote"><text:note-citation>3</text:note-citation><text:note-body><text:p text:style-name="Footnote">This
-is <text:span text:style-name="T68">easier</text:span> to type. Inline notes
+is <text:span text:style-name="T1">easier</text:span> to type. Inline notes
 may contain
 <text:a xlink:type="simple" xlink:href="http://google.com" office:name=""><text:span text:style-name="Definition">links</text:span></text:a>
 and <text:span text:style-name="Source_Text">]</text:span> verbatim
diff --git a/tests/writer.org b/tests/writer.org
--- a/tests/writer.org
+++ b/tests/writer.org
@@ -819,37 +819,37 @@
   :CUSTOM_ID: footnotes
   :END:
 
-Here is a footnote reference,[1] and another.[2] This should /not/ be a
+Here is a footnote reference,[fn:1] and another.[fn:2] This should /not/ be a
 footnote reference, because it contains a space.[\^my note] Here is an inline
-note.[3]
+note.[fn:3]
 
 #+BEGIN_QUOTE
-  Notes can go in quotes.[4]
+  Notes can go in quotes.[fn:4]
 #+END_QUOTE
 
-1. And in list items.[5]
+1. And in list items.[fn:5]
 
 This paragraph should not be part of the note, as it is not indented.
 
-[1] Here is the footnote. It can go anywhere after the footnote reference. It
-    need not be placed at the end of the document.
+[fn:1] Here is the footnote. It can go anywhere after the footnote reference.
+       It need not be placed at the end of the document.
 
-[2] Here's the long note. This one contains multiple blocks.
+[fn:2] 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).
 
-    #+BEGIN_EXAMPLE
-          { <code> }
-    #+END_EXAMPLE
+       #+BEGIN_EXAMPLE
+             { <code> }
+       #+END_EXAMPLE
 
-    If you want, you can indent every line, but you can also be lazy and just
-    indent the first line of each block.
+       If you want, you can indent every line, but you can also be lazy and
+       just indent the first line of each block.
 
-[3] This is /easier/ to type. Inline notes may contain
-    [[http://google.com][links]] and =]= verbatim characters, as well as
-    [bracketed text].
+[fn:3] This is /easier/ to type. Inline notes may contain
+       [[http://google.com][links]] and =]= verbatim characters, as well as
+       [bracketed text].
 
-[4] In quote.
+[fn:4] In quote.
 
-[5] In list.
+[fn:5] In list.
diff --git a/tests/writers-lang-and-dir.latex b/tests/writers-lang-and-dir.latex
--- a/tests/writers-lang-and-dir.latex
+++ b/tests/writers-lang-and-dir.latex
@@ -18,9 +18,10 @@
 \IfFileExists{upquote.sty}{\usepackage{upquote}}{}
 % use microtype if available
 \IfFileExists{microtype.sty}{%
-\usepackage{microtype}
+\usepackage[]{microtype}
 \UseMicrotypeSet[protrusion]{basicmath} % disable protrusion for tt fonts
 }{}
+\PassOptionsToPackage{hyphens}{url} % url is loaded by hyperref
 \usepackage[unicode=true]{hyperref}
 \hypersetup{
             pdfborder={0 0 0},
diff --git a/trypandoc/trypandoc.hs b/trypandoc/trypandoc.hs
--- a/trypandoc/trypandoc.hs
+++ b/trypandoc/trypandoc.hs
@@ -10,7 +10,6 @@
 import Text.Pandoc
 import Text.Pandoc.Error (PandocError)
 import Text.Pandoc.Shared (tabFilter)
-import Text.Highlighting.Kate (pygments)
 import Data.Aeson
 import qualified Data.Text as T
 import Data.Text (Text)
@@ -51,8 +50,7 @@
 writerOpts = def { writerReferenceLinks = True,
                    writerEmailObfuscation = NoObfuscation,
                    writerHTMLMathMethod = MathJax "http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML",
-                   writerHighlight = True,
-                   writerHighlightStyle = pygments }
+                   writerHighlight = True }
 
 readerOpts :: ReaderOptions
 readerOpts = def { readerParseRaw = True,
