packages feed

pandoc 1.13.2.1 → 1.14

raw patch · 171 files changed

+6896/−1757 lines, 171 filesdep +cmarkdep +css-textdep +filemanipdep ~QuickCheckdep ~criteriondep ~highlighting-katesetup-changednew-component:exe:make-reference-filesbinary-addedPVP ok

version bump matches the API change (PVP)

Dependencies added: cmark, css-text, filemanip

Dependency ranges changed: QuickCheck, criterion, highlighting-kate, texmath, zlib

API changes (from Hackage documentation)

- Text.Pandoc.Writers.Custom: instance [overlap ok] StackValue ByteString
- Text.Pandoc.Writers.EPUB: instance Read IdentState
- Text.Pandoc.Writers.EPUB: instance Show IdentState
+ Text.Pandoc: readCommonMark :: ReaderOptions -> String -> Either PandocError Pandoc
+ Text.Pandoc: writeCommonMark :: WriterOptions -> Pandoc -> String
+ Text.Pandoc.Error: ParseFailure :: String -> PandocError
+ Text.Pandoc.Error: ParsecError :: Input -> ParseError -> PandocError
+ Text.Pandoc.Error: data PandocError
+ Text.Pandoc.Error: handleError :: Either PandocError a -> a
+ Text.Pandoc.Error: instance Error PandocError
+ Text.Pandoc.Error: instance Show PandocError
+ Text.Pandoc.MediaBag: instance Data MediaBag
+ Text.Pandoc.MediaBag: instance Typeable MediaBag
+ Text.Pandoc.Options: Ext_shortcut_reference_links :: Extension
+ Text.Pandoc.Options: instance Data CiteMethod
+ Text.Pandoc.Options: instance Data EPUBVersion
+ Text.Pandoc.Options: instance Data Extension
+ Text.Pandoc.Options: instance Data HTMLMathMethod
+ Text.Pandoc.Options: instance Data HTMLSlideVariant
+ Text.Pandoc.Options: instance Data ObfuscationMethod
+ Text.Pandoc.Options: instance Data ReaderOptions
+ Text.Pandoc.Options: instance Data TrackChanges
+ Text.Pandoc.Options: instance Data WriterOptions
+ Text.Pandoc.Options: instance Typeable CiteMethod
+ Text.Pandoc.Options: instance Typeable EPUBVersion
+ Text.Pandoc.Options: instance Typeable Extension
+ Text.Pandoc.Options: instance Typeable HTMLMathMethod
+ Text.Pandoc.Options: instance Typeable HTMLSlideVariant
+ Text.Pandoc.Options: instance Typeable ObfuscationMethod
+ Text.Pandoc.Options: instance Typeable ReaderOptions
+ Text.Pandoc.Options: instance Typeable TrackChanges
+ Text.Pandoc.Options: instance Typeable WriterOptions
+ Text.Pandoc.Options: writerLaTeXArgs :: WriterOptions -> [String]
+ Text.Pandoc.Options: writerVerbose :: WriterOptions -> Bool
+ Text.Pandoc.Readers.CommonMark: readCommonMark :: ReaderOptions -> String -> Either PandocError Pandoc
+ Text.Pandoc.Readers.DocBook: instance Default DBState
+ Text.Pandoc.Readers.OPML: instance Default OPMLState
+ Text.Pandoc.Readers.Org: instance Default OrgParserLocal
+ Text.Pandoc.Readers.Org: instance HasQuoteContext st (Reader OrgParserLocal)
+ Text.Pandoc.Shared: hush :: Either a b -> Maybe b
+ Text.Pandoc.Shared: mapLeft :: (a -> b) -> Either a c -> Either b c
+ Text.Pandoc.Writers.CommonMark: writeCommonMark :: WriterOptions -> Pandoc -> String
+ Text.Pandoc.Writers.Custom: instance [overlap ok] Exception PandocLuaException
+ Text.Pandoc.Writers.Custom: instance [overlap ok] Show PandocLuaException
+ Text.Pandoc.Writers.Custom: instance [overlap ok] Typeable PandocLuaException
- Text.Pandoc: ByteStringReader :: (ReaderOptions -> ByteString -> IO (Pandoc, MediaBag)) -> Reader
+ Text.Pandoc: ByteStringReader :: (ReaderOptions -> ByteString -> IO (Either PandocError (Pandoc, MediaBag))) -> Reader
- Text.Pandoc: StringReader :: (ReaderOptions -> String -> IO Pandoc) -> Reader
+ Text.Pandoc: StringReader :: (ReaderOptions -> String -> IO (Either PandocError Pandoc)) -> Reader
- Text.Pandoc: mkStringReader :: (ReaderOptions -> String -> Pandoc) -> Reader
+ Text.Pandoc: mkStringReader :: (ReaderOptions -> String -> (Either PandocError Pandoc)) -> Reader
- Text.Pandoc: readDocBook :: ReaderOptions -> String -> Pandoc
+ Text.Pandoc: readDocBook :: ReaderOptions -> String -> Either PandocError Pandoc
- Text.Pandoc: readDocx :: ReaderOptions -> ByteString -> (Pandoc, MediaBag)
+ Text.Pandoc: readDocx :: ReaderOptions -> ByteString -> Either PandocError (Pandoc, MediaBag)
- Text.Pandoc: readEPUB :: ReaderOptions -> ByteString -> (Pandoc, MediaBag)
+ Text.Pandoc: readEPUB :: ReaderOptions -> ByteString -> Either PandocError (Pandoc, MediaBag)
- Text.Pandoc: readHaddock :: ReaderOptions -> String -> Pandoc
+ Text.Pandoc: readHaddock :: ReaderOptions -> String -> Either PandocError Pandoc
- Text.Pandoc: readHtml :: ReaderOptions -> String -> Pandoc
+ Text.Pandoc: readHtml :: ReaderOptions -> String -> Either PandocError Pandoc
- Text.Pandoc: readJSON :: ReaderOptions -> String -> Pandoc
+ Text.Pandoc: readJSON :: ReaderOptions -> String -> Either PandocError Pandoc
- Text.Pandoc: readLaTeX :: ReaderOptions -> String -> Pandoc
+ Text.Pandoc: readLaTeX :: ReaderOptions -> String -> Either PandocError Pandoc
- Text.Pandoc: readMarkdown :: ReaderOptions -> String -> Pandoc
+ Text.Pandoc: readMarkdown :: ReaderOptions -> String -> Either PandocError Pandoc
- Text.Pandoc: readMediaWiki :: ReaderOptions -> String -> Pandoc
+ Text.Pandoc: readMediaWiki :: ReaderOptions -> String -> Either PandocError Pandoc
- Text.Pandoc: readNative :: String -> Pandoc
+ Text.Pandoc: readNative :: String -> Either PandocError Pandoc
- Text.Pandoc: readOPML :: ReaderOptions -> String -> Pandoc
+ Text.Pandoc: readOPML :: ReaderOptions -> String -> Either PandocError Pandoc
- Text.Pandoc: readOrg :: ReaderOptions -> String -> Pandoc
+ Text.Pandoc: readOrg :: ReaderOptions -> String -> Either PandocError Pandoc
- Text.Pandoc: readRST :: ReaderOptions -> String -> Pandoc
+ Text.Pandoc: readRST :: ReaderOptions -> String -> Either PandocError Pandoc
- Text.Pandoc: readTWiki :: ReaderOptions -> String -> Pandoc
+ Text.Pandoc: readTWiki :: ReaderOptions -> String -> Either PandocError Pandoc
- Text.Pandoc: readTextile :: ReaderOptions -> String -> Pandoc
+ Text.Pandoc: readTextile :: ReaderOptions -> String -> Either PandocError Pandoc
- Text.Pandoc: readTxt2Tags :: T2TMeta -> ReaderOptions -> String -> Pandoc
+ Text.Pandoc: readTxt2Tags :: T2TMeta -> ReaderOptions -> String -> Either PandocError Pandoc
- Text.Pandoc: readTxt2TagsNoMacros :: ReaderOptions -> String -> Pandoc
+ Text.Pandoc: readTxt2TagsNoMacros :: ReaderOptions -> String -> Either PandocError Pandoc
- Text.Pandoc.Options: WriterOptions :: Bool -> String -> [(String, String)] -> Int -> Bool -> HTMLSlideVariant -> Bool -> HTMLMathMethod -> Bool -> Bool -> [Int] -> Bool -> Set Extension -> Bool -> Bool -> Int -> ObfuscationMethod -> String -> Maybe String -> Maybe FilePath -> CiteMethod -> Bool -> Bool -> Bool -> Maybe Int -> Bool -> Bool -> Bool -> Style -> Bool -> Bool -> Maybe EPUBVersion -> String -> Maybe String -> [FilePath] -> Int -> Int -> Maybe FilePath -> Maybe FilePath -> MediaBag -> WriterOptions
+ Text.Pandoc.Options: WriterOptions :: Bool -> String -> [(String, String)] -> Int -> Bool -> HTMLSlideVariant -> Bool -> HTMLMathMethod -> Bool -> Bool -> [Int] -> Bool -> Set Extension -> Bool -> Bool -> Int -> ObfuscationMethod -> String -> Maybe String -> Maybe FilePath -> CiteMethod -> Bool -> Bool -> Bool -> Maybe Int -> Bool -> Bool -> Bool -> Style -> Bool -> Bool -> Maybe EPUBVersion -> String -> Maybe String -> [FilePath] -> Int -> Int -> Maybe FilePath -> Maybe FilePath -> MediaBag -> Bool -> [String] -> WriterOptions
- Text.Pandoc.Readers.DocBook: readDocBook :: ReaderOptions -> String -> Pandoc
+ Text.Pandoc.Readers.DocBook: readDocBook :: ReaderOptions -> String -> Either PandocError Pandoc
- Text.Pandoc.Readers.Docx: readDocx :: ReaderOptions -> ByteString -> (Pandoc, MediaBag)
+ Text.Pandoc.Readers.Docx: readDocx :: ReaderOptions -> ByteString -> Either PandocError (Pandoc, MediaBag)
- Text.Pandoc.Readers.EPUB: readEPUB :: ReaderOptions -> ByteString -> (Pandoc, MediaBag)
+ Text.Pandoc.Readers.EPUB: readEPUB :: ReaderOptions -> ByteString -> Either PandocError (Pandoc, MediaBag)
- Text.Pandoc.Readers.HTML: readHtml :: ReaderOptions -> String -> Pandoc
+ Text.Pandoc.Readers.HTML: readHtml :: ReaderOptions -> String -> Either PandocError Pandoc
- Text.Pandoc.Readers.Haddock: readHaddock :: ReaderOptions -> String -> Pandoc
+ Text.Pandoc.Readers.Haddock: readHaddock :: ReaderOptions -> String -> Either PandocError Pandoc
- Text.Pandoc.Readers.LaTeX: handleIncludes :: String -> IO String
+ Text.Pandoc.Readers.LaTeX: handleIncludes :: String -> IO (Either PandocError String)
- Text.Pandoc.Readers.LaTeX: rawLaTeXBlock :: Parser [Char] ParserState String
+ Text.Pandoc.Readers.LaTeX: rawLaTeXBlock :: LP String
- Text.Pandoc.Readers.LaTeX: rawLaTeXInline :: Parser [Char] ParserState Inline
+ Text.Pandoc.Readers.LaTeX: rawLaTeXInline :: LP Inline
- Text.Pandoc.Readers.LaTeX: readLaTeX :: ReaderOptions -> String -> Pandoc
+ Text.Pandoc.Readers.LaTeX: readLaTeX :: ReaderOptions -> String -> Either PandocError Pandoc
- Text.Pandoc.Readers.Markdown: readMarkdown :: ReaderOptions -> String -> Pandoc
+ Text.Pandoc.Readers.Markdown: readMarkdown :: ReaderOptions -> String -> Either PandocError Pandoc
- Text.Pandoc.Readers.Markdown: readMarkdownWithWarnings :: ReaderOptions -> String -> (Pandoc, [String])
+ Text.Pandoc.Readers.Markdown: readMarkdownWithWarnings :: ReaderOptions -> String -> Either PandocError (Pandoc, [String])
- Text.Pandoc.Readers.MediaWiki: readMediaWiki :: ReaderOptions -> String -> Pandoc
+ Text.Pandoc.Readers.MediaWiki: readMediaWiki :: ReaderOptions -> String -> Either PandocError Pandoc
- Text.Pandoc.Readers.Native: readNative :: String -> Pandoc
+ Text.Pandoc.Readers.Native: readNative :: String -> Either PandocError Pandoc
- Text.Pandoc.Readers.OPML: readOPML :: ReaderOptions -> String -> Pandoc
+ Text.Pandoc.Readers.OPML: readOPML :: ReaderOptions -> String -> Either PandocError Pandoc
- Text.Pandoc.Readers.Org: readOrg :: ReaderOptions -> String -> Pandoc
+ Text.Pandoc.Readers.Org: readOrg :: ReaderOptions -> String -> Either PandocError Pandoc
- Text.Pandoc.Readers.RST: readRST :: ReaderOptions -> String -> Pandoc
+ Text.Pandoc.Readers.RST: readRST :: ReaderOptions -> String -> Either PandocError Pandoc
- Text.Pandoc.Readers.RST: readRSTWithWarnings :: ReaderOptions -> String -> (Pandoc, [String])
+ Text.Pandoc.Readers.RST: readRSTWithWarnings :: ReaderOptions -> String -> Either PandocError (Pandoc, [String])
- Text.Pandoc.Readers.TWiki: readTWiki :: ReaderOptions -> String -> Pandoc
+ Text.Pandoc.Readers.TWiki: readTWiki :: ReaderOptions -> String -> Either PandocError Pandoc
- Text.Pandoc.Readers.TWiki: readTWikiWithWarnings :: ReaderOptions -> String -> (Pandoc, [String])
+ Text.Pandoc.Readers.TWiki: readTWikiWithWarnings :: ReaderOptions -> String -> Either PandocError (Pandoc, [String])
- Text.Pandoc.Readers.Textile: readTextile :: ReaderOptions -> String -> Pandoc
+ Text.Pandoc.Readers.Textile: readTextile :: ReaderOptions -> String -> Either PandocError Pandoc
- Text.Pandoc.Readers.Txt2Tags: readTxt2Tags :: T2TMeta -> ReaderOptions -> String -> Pandoc
+ Text.Pandoc.Readers.Txt2Tags: readTxt2Tags :: T2TMeta -> ReaderOptions -> String -> Either PandocError Pandoc
- Text.Pandoc.Readers.Txt2Tags: readTxt2TagsNoMacros :: ReaderOptions -> String -> Pandoc
+ Text.Pandoc.Readers.Txt2Tags: readTxt2TagsNoMacros :: ReaderOptions -> String -> Either PandocError Pandoc
- Text.Pandoc.Shared: safeRead :: (Monad m, Read a) => String -> m a
+ Text.Pandoc.Shared: safeRead :: (MonadPlus m, Read a) => String -> m a

Files

CONTRIBUTING.md view
@@ -25,6 +25,32 @@ A small test case (just a few lines) is ideal.  If your input is large, try to whittle it down to the minimum necessary to illustrate the problem. +Fixing bugs from the issue tracker+----------------------------------++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+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).++* [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+  ticket.+* [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+  we can classify a report properly.+ Have an idea for a new feature? ------------------------------- @@ -122,7 +148,7 @@ `tests/`, and the source for the benchmarks is in `benchmark/`.  The modules `Text.Pandoc.Definition`, `Text.Pandoc.Builder`, and-`Text.Pandoc.Generics` are in a separate library `pandoc-types`.  The code can+`Text.Pandoc.Generic` are in a separate library `pandoc-types`.  The code can be found in a <http://github.com/jgm/pandoc-types>.  To build pandoc, you will need a working installation of the@@ -182,3 +208,13 @@ [EditorConfig]: http://editorconfig.org/ [Haskell platform]: http://www.haskell.org/platform/ [hsb2hs]: http://hackage.haskell.org/package/hsb2hs+[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+[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
@@ -1,5 +1,5 @@ Pandoc-Copyright (C) 2006-2014 John MacFarlane <jgm at berkeley dot edu>+Copyright (C) 2006-2015 John MacFarlane <jgm at berkeley dot edu>  This code is released under the [GPL], version 2 or later: @@ -33,32 +33,32 @@  ---------------------------------------------------------------------- src/Text/Pandoc/Writers/Texinfo.hs-Copyright (C) 2008-2014 John MacFarlane and Peter Wang+Copyright (C) 2008-2015 John MacFarlane and Peter Wang  Released under the GNU General Public License version 2 or later.  ---------------------------------------------------------------------- src/Text/Pandoc/Writers/OpenDocument.hs-Copyright (C) 2008-2014 Andrea Rossato and John MacFarlane+Copyright (C) 2008-2015 Andrea Rossato and John MacFarlane  Released under the GNU General Public License version 2 or later.  ---------------------------------------------------------------------- src/Text/Pandoc/Writers/Org.hs-Copyright (C) 2010-2014 Puneeth Chaganti and JohnMacFarlane+Copyright (C) 2010-2015 Puneeth Chaganti and John MacFarlane  Released under the GNU General Public License version 2 or later.  ---------------------------------------------------------------------- src/Text/Pandoc/Readers/Textile.hs-Copyright (C) 2010-2014 Paul Rivier and John MacFarlane+Copyright (C) 2010-2015 Paul Rivier and John MacFarlane  Released under the GNU General Public License version 2 or later.  ---------------------------------------------------------------------- src/Text/Pandoc/Readers/Org.hs tests/Tests/Readers/Org.hs-Copyright (C) 2014 Albert Krewinkel+Copyright (C) 2014-2015 Albert Krewinkel  Released under the GNU General Public License version 2 or later. @@ -79,6 +79,30 @@ ------------------------------------------------------------------------ The dzslides template contains javascript and CSS from Paul Rouget's dzslides template.-http://github.com/apulrouget/dzslides+http://github.com/paulrouget/dzslides  Released under the Do What the Fuck You Want To Public License.++------------------------------------------------------------------------+Pandoc embeds a lua interpreter (via hslua).++Copyright © 1994–2015 Lua.org, PUC-Rio.++Permission is hereby granted, free of charge, to any person obtaining+a copy of this software and associated documentation files (the+"Software"), to deal in the Software without restriction, including+without limitation the rights to use, copy, modify, merge, publish,+distribute, sublicense, and/or sell copies of the Software, and to+permit persons to whom the Software is furnished to do so, subject to+the following conditions:++The above copyright notice and this permission notice shall be+included in all copies or substantial portions of the Software.++THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
INSTALL view
@@ -24,6 +24,15 @@      This procedure will install the released version of pandoc,     which will be downloaded automatically from HackageDB.++    If this step fails, and you are using an older version+    of the Haskell Platform, e.g. on Debian stable, you may need to+    upgrade your version of cabal:++        cabal install cabal-install+        ~/.cabal/bin/cabal update+        ~/.cabal/bin/cabal install pandoc+     If you want to install a modified or development version     of pandoc instead, switch to the source directory and do     as above, but without the 'pandoc':@@ -66,11 +75,7 @@          --extra-include-dirs=/usr/local/Cellar/icu4c/51.1/include \          -funicode_collation text-icu pandoc-citeproc -The cabal installation procedure does not generate man pages.-To build the `pandoc` man pages, build pandoc with the-`make-pandoc-man-pages` flag, and then use the command-`make-pandoc-man-pages` from the pandoc source directory.-This will create the man pages in `man/man1` and `man/man5`.+The build process will create man pages in `man/man1` and `man/man5`.  To build the `pandoc-citeproc` man pages, go to the pandoc-citeproc build directory, and@@ -209,4 +214,3 @@ To run just the markdown benchmarks:      cabal bench --benchmark-options='markdown'-
Makefile view
@@ -1,10 +1,5 @@ version=$(shell grep '^Version:' pandoc.cabal | awk '{print $$2;}')-makemanpages=$(shell find dist -type f -name make-pandoc-man-pages)-ifeq "${makemanpages}" ""-	makemanpages=@echo "You need to 'cabal configure -fmake-pandoc-man-pages && cabal build'" && exit 1-endif setup=dist/setup/setup-MANPAGES=man/man1/pandoc.1 man/man5/pandoc_markdown.5 PREFIX ?= /usr/local  quick:@@ -43,8 +38,6 @@ debpkg: 	./make_deb.sh -man: $(MANPAGES)- osxpkg: 	./make_osx_package.sh @@ -56,7 +49,6 @@  clean: 	cabal clean-	-rm $(MANPAGES) 	-rm -rf $(BINDIST) $(BINDIST).tar.gz  .PHONY: deps quick full install man clean test bench haddock osxpkg dist bindist prof
README view
@@ -1,28 +1,29 @@ % Pandoc User's Guide % John MacFarlane-% August 30, 2014+% May 27, 2015  Synopsis ======== -pandoc [*options*] [*input-file*]...+`pandoc` [*options*] [*input-file*]...  Description ===========  Pandoc is a [Haskell] library for converting from one markup format to another, and a command-line tool that uses this library. It can read-[markdown] and (subsets of) [Textile], [reStructuredText], [HTML],-[LaTeX], [MediaWiki markup], [TWiki markup], [Haddock markup], [OPML],-[Emacs Org-mode], [DocBook], [txt2tags], [EPUB] and [Word docx]; and-it can write plain text, [markdown], [reStructuredText], [XHTML],-[HTML 5], [LaTeX] (including [beamer] slide shows), [ConTeXt], [RTF],-[OPML], [DocBook], [OpenDocument], [ODT], [Word docx], [GNU Texinfo],-[MediaWiki markup], [DokuWiki markup], [Haddock markup], [EPUB] (v2 or v3),-[FictionBook2], [Textile], [groff man] pages, [Emacs Org-Mode], [AsciiDoc],-[InDesign ICML], and [Slidy], [Slideous], [DZSlides], [reveal.js] or-[S5] HTML slide shows. It can also produce [PDF] output on systems where-LaTeX is installed.+[Markdown], [CommonMark], and (subsets of) [Textile],+[reStructuredText], [HTML], [LaTeX], [MediaWiki markup], [TWiki+markup], [Haddock markup], [OPML], [Emacs Org-mode], [DocBook],+[txt2tags], [EPUB] and [Word docx]; and it can write plain text,+[Markdown], [reStructuredText], [XHTML], [HTML 5], [LaTeX] (including+[beamer] slide shows), [ConTeXt], [RTF], [OPML], [DocBook],+[OpenDocument], [ODT], [Word docx], [GNU Texinfo], [MediaWiki markup],+[DokuWiki markup], [Haddock markup], [EPUB] (v2 or v3),+[FictionBook2], [Textile], [groff man] pages, [Emacs Org-Mode],+[AsciiDoc], [InDesign ICML], and [Slidy], [Slideous], [DZSlides],+[reveal.js] or [S5] HTML slide shows. It can also produce [PDF] output+on systems where LaTeX is installed.  Pandoc's enhanced version of markdown includes syntax for footnotes, tables, flexible ordered lists, definition lists, fenced code blocks,@@ -126,7 +127,8 @@ `--latex-engine`, below), and assumes that the following LaTeX packages are available: `amssymb`, `amsmath`, `ifxetex`, `ifluatex`, `listings` (if the `--listings` option is used), `fancyvrb`, `longtable`, `booktabs`, `url`,-`graphicx`, `hyperref`, `ulem`, `babel` (if the `lang` variable is set),+`graphicx` and `grffile` (if the document contains images),+ `hyperref`, `ulem`, `babel` (if the `lang` variable is set), `fontspec` (if `xelatex` or `lualatex` is used as the LaTeX engine), `xltxtra` and `xunicode` (if `xelatex` is used). @@ -154,62 +156,70 @@ ---------------  `-f` *FORMAT*, `-r` *FORMAT*, `--from=`*FORMAT*, `--read=`*FORMAT*+ :   Specify input format.  *FORMAT* can be `native` (native Haskell),     `json` (JSON version of native AST), `markdown` (pandoc's-    extended markdown), `markdown_strict` (original unextended markdown),-    `markdown_phpextra` (PHP Markdown Extra extended markdown),-    `markdown_github` (github extended markdown),-    `textile` (Textile), `rst` (reStructuredText), `html` (HTML),-    `docbook` (DocBook), `t2t` (txt2tags), `docx` (docx), `epub` (EPUB),-    `opml` (OPML), `org` (Emacs Org-mode), `mediawiki` (MediaWiki markup),-    `twiki` (TWiki markup), `haddock` (Haddock markup), or `latex` (LaTeX).-    If `+lhs` is appended to `markdown`, `rst`,-    `latex`, or `html`, the input will be treated as literate Haskell-    source: see [Literate Haskell support](#literate-haskell-support),-    below. Markdown syntax extensions can be individually enabled or-    disabled by appending `+EXTENSION` or `-EXTENSION` to the format-    name. So, for example, `markdown_strict+footnotes+definition_lists`-    is strict markdown with footnotes and definition lists enabled,-    and `markdown-pipe_tables+hard_line_breaks` is pandoc's markdown+    extended markdown), `markdown_strict` (original unextended+    markdown), `markdown_phpextra` (PHP Markdown Extra extended+    markdown), `markdown_github` (github extended markdown),+    `commonmark` (CommonMark markdown), `textile` (Textile), `rst`+    (reStructuredText), `html` (HTML), `docbook` (DocBook), `t2t`+    (txt2tags), `docx` (docx), `epub` (EPUB), `opml` (OPML), `org`+    (Emacs Org-mode), `mediawiki` (MediaWiki markup), `twiki` (TWiki+    markup), `haddock` (Haddock markup), or `latex` (LaTeX).  If+    `+lhs` is appended to `markdown`, `rst`, `latex`, or `html`, the+    input will be treated as literate Haskell source: see [Literate+    Haskell support](#literate-haskell-support), below. Markdown+    syntax extensions can be individually enabled or disabled by+    appending `+EXTENSION` or `-EXTENSION` to the format name. So, for+    example, `markdown_strict+footnotes+definition_lists` is strict+    markdown with footnotes and definition lists enabled, and+    `markdown-pipe_tables+hard_line_breaks` is pandoc's markdown     without pipe tables and with hard line breaks. See [Pandoc's     markdown](#pandocs-markdown), below, for a list of extensions and     their names.  `-t` *FORMAT*, `-w` *FORMAT*, `--to=`*FORMAT*, `--write=`*FORMAT*+ :   Specify output format.  *FORMAT* can be `native` (native Haskell),     `json` (JSON version of native AST), `plain` (plain text),-    `markdown` (pandoc's extended markdown), `markdown_strict` (original-    unextended markdown), `markdown_phpextra` (PHP Markdown extra-    extended markdown), `markdown_github` (github extended markdown),-    `rst` (reStructuredText), `html` (XHTML 1), `html5` (HTML 5),-    `latex` (LaTeX), `beamer` (LaTeX beamer slide show),-    `context` (ConTeXt), `man` (groff man), `mediawiki` (MediaWiki markup),-    `dokuwiki` (DokuWiki markup),-    `textile` (Textile), `org` (Emacs Org-Mode), `texinfo` (GNU Texinfo),-    `opml` (OPML), `docbook` (DocBook), `opendocument` (OpenDocument), `odt`-    (OpenOffice text document), `docx` (Word docx), `haddock` (Haddock-    markup), `rtf` (rich text format), `epub` (EPUB v2 book), `epub3`-    (EPUB v3), `fb2` (FictionBook2 e-book), `asciidoc` (AsciiDoc),-    `icml` (InDesign ICML), `slidy` (Slidy HTML and javascript slide show),-    `slideous` (Slideous HTML and javascript slide show), `dzslides`-    (DZSlides HTML5 + javascript slide show), `revealjs` (reveal.js-    HTML5 + javascript slide show), `s5` (S5 HTML and javascript slide show),-    or the path of a custom lua writer (see [Custom writers](#custom-writers),-    below). Note that `odt`, `epub`, and `epub3` output will not be directed-    to *stdout*; an output filename must be specified using the `-o/--output`-    option. If `+lhs` is appended to `markdown`, `rst`, `latex`, `beamer`,-    `html`, or `html5`, the output will be rendered as literate Haskell-    source: see [Literate Haskell support](#literate-haskell-support), below.-    Markdown syntax extensions can be individually enabled or disabled by-    appending `+EXTENSION` or `-EXTENSION` to the format name, as described+    `markdown` (pandoc's extended markdown), `markdown_strict`+    (original unextended markdown), `markdown_phpextra` (PHP Markdown+    extra extended markdown), `markdown_github` (github extended+    markdown), `commonmark` (CommonMark markdown), `rst`+    (reStructuredText), `html` (XHTML 1), `html5` (HTML 5), `latex`+    (LaTeX), `beamer` (LaTeX beamer slide show), `context` (ConTeXt),+    `man` (groff man), `mediawiki` (MediaWiki markup), `dokuwiki`+    (DokuWiki markup), `textile` (Textile), `org` (Emacs Org-Mode),+    `texinfo` (GNU Texinfo), `opml` (OPML), `docbook` (DocBook),+    `opendocument` (OpenDocument), `odt` (OpenOffice text document),+    `docx` (Word docx), `haddock` (Haddock markup), `rtf` (rich text+    format), `epub` (EPUB v2 book), `epub3` (EPUB v3), `fb2`+    (FictionBook2 e-book), `asciidoc` (AsciiDoc), `icml` (InDesign+    ICML), `slidy` (Slidy HTML and javascript slide show), `slideous`+    (Slideous HTML and javascript slide show), `dzslides` (DZSlides+    HTML5 + javascript slide show), `revealjs` (reveal.js HTML5 ++    javascript slide show), `s5` (S5 HTML and javascript slide show),+    or the path of a custom lua writer (see [Custom+    writers](#custom-writers), below). Note that `odt`, `epub`, and+    `epub3` output will not be directed to *stdout*; an output+    filename must be specified using the `-o/--output` option. If+    `+lhs` is appended to `markdown`, `rst`, `latex`, `beamer`,+    `html`, or `html5`, the output will be rendered as literate+    Haskell source: see [Literate Haskell+    support](#literate-haskell-support), below.  Markdown syntax+    extensions can be individually enabled or disabled by appending+    `+EXTENSION` or `-EXTENSION` to the format name, as described     above under `-f`.  `-o` *FILE*, `--output=`*FILE*+ :   Write output to *FILE* instead of *stdout*.  If *FILE* is     `-`, output will go to *stdout*.  (Exception: if the output     format is `odt`, `docx`, `epub`, or `epub3`, output to stdout is disabled.)  `--data-dir=`*DIRECTORY*+ :   Specify the user data directory to search for pandoc data files.     If this option is not specified, the default user data directory     will be used.  This is@@ -230,16 +240,24 @@     `epub.css`, `templates`, `slidy`, `slideous`, or `s5` directory     placed in this directory will override pandoc's normal defaults. +`--verbose`++:   Give verbose debugging output.  Currently this only has an effect+    with PDF output.+ `-v`, `--version`+ :   Print version.  `-h`, `--help`+ :   Show usage message.  Reader options --------------  `-R`, `--parse-raw`+ :   Parse untranslatable HTML codes and LaTeX environments as raw HTML     or LaTeX, instead of ignoring them.  Affects only HTML and LaTeX     input. Raw HTML can be printed in markdown, reStructuredText, HTML,@@ -250,6 +268,7 @@     LaTeX *commands*, even if `-R` is not specified.)  `-S`, `--smart`+ :   Produce typographically correct output, converting straight quotes     to curly quotes, `---` to em-dashes, `--` to en-dashes, and     `...` to ellipses. Nonbreaking spaces are inserted after certain@@ -260,25 +279,30 @@     is used.)  `--old-dashes`+ :   Selects the pandoc <= 1.8.2.1 behavior for parsing smart dashes: `-` before     a numeral is an en-dash, and `--` is an em-dash.  This option is selected     automatically for `textile` input.  `--base-header-level=`*NUMBER*+ :   Specify the base level for headers (defaults to 1).  `--indented-code-classes=`*CLASSES*+ :   Specify classes to use for indented code blocks--for example,     `perl,numberLines` or `haskell`. Multiple classes may be separated     by spaces or commas.  `--default-image-extension=`*EXTENSION*+ :   Specify a default extension to use when image paths/URLs have no     extension.  This allows you to use the same source for formats that     require different kinds of images.  Currently this option only affects     the markdown and LaTeX readers.  `--filter=`*EXECUTABLE*+ :   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@@ -299,12 +323,18 @@     Those who would prefer to write filters in python can use the     module `pandocfilters`, installable from PyPI. See     <http://github.com/jgm/pandocfilters> for the module and several-    examples.  Note that the *EXECUTABLE* will be sought in the user's+    examples. There are also pandoc filter libraries in+    [PHP](https://github.com/vinai/pandocfilters-php),+    [perl](https://metacpan.org/pod/Pandoc::Filter), and+    [javascript/node.js](https://github.com/mvhenderson/pandoc-filter-node).++    Note that the *EXECUTABLE* will be sought in the user's     `PATH`, and not in the working directory, if no directory is     provided.  If you want to run a script in the working directory,     preface the filename with `./`. -`-M` *KEY[=VAL]*, `--metadata=`*KEY[:VAL]*+`-M` *KEY*[`=`*VAL*], `--metadata=`*KEY*[`:`*VAL*]+ :   Set the metadata field *KEY* to the value *VAL*.  A value specified     on the command line overrides a value specified in the document.     Values will be parsed as YAML boolean or string values. If no value is@@ -315,29 +345,34 @@     printed in some output formats).  `--normalize`+ :   Normalize the document after reading:  merge adjacent     `Str` or `Emph` elements, for example, and remove repeated `Space`s.  `-p`, `--preserve-tabs`+ :   Preserve tabs instead of converting them to spaces (the default).     Note that this will only affect tabs in literal code spans and code     blocks; tabs in regular text will be treated as spaces.  `--tab-stop=`*NUMBER*+ :   Specify the number of spaces per tab (default is 4). -`--track-changes=`*accept|reject|all*+`--track-changes=accept`|`reject`|`all`+ :   Specifies what to do with insertions and deletions produced by the MS-    Word "track-changes" feature.  *accept* (the default), inserts all-    insertions, and ignores all deletions. *reject* inserts all-    deletions and ignores insertions. *all* puts in both insertions+    Word "track-changes" feature.  `accept` (the default), inserts all+    insertions, and ignores all deletions. `reject` inserts all+    deletions and ignores insertions. `all` puts in both insertions     and deletions, wrapped in spans with `insertion` and `deletion`     classes, respectively. The author and time of change is-    included. *all* is useful for scripting: only accepting changes+    included. `all` is useful for scripting: only accepting changes     from a certain reviewer, say, or before a certain date. This     option only affects the docx reader.  `--extract-media=`*DIR*+ :   Extract images and other media contained in a docx or epub container     to the path *DIR*, creating it if necessary, and adjust the images     references in the document so they point to the extracted files.@@ -347,12 +382,14 @@ ----------------------  `-s`, `--standalone`+ :   Produce output with an appropriate header and footer (e.g. a     standalone HTML, LaTeX, or RTF file, not a fragment).  This option     is set automatically for `pdf`, `epub`, `epub3`, `fb2`, `docx`, and `odt`     output.  `--template=`*FILE*+ :   Use *FILE* as a custom template for the generated document. Implies     `--standalone`. See [Templates](#templates) below for a description     of template syntax. If no extension is specified, an extension@@ -363,7 +400,8 @@     template appropriate for the output format will be used (see     `-D/--print-default-template`). -`-V` *KEY[=VAL]*, `--variable=`*KEY[:VAL]*+`-V` *KEY*[`=`*VAL*], `--variable=`*KEY*[`:`*VAL*]+ :   Set the template variable *KEY* to the value *VAL* when rendering the     document in standalone mode. This is generally only useful when the     `--template` option is used to specify a custom template, since@@ -372,40 +410,50 @@     value `true`.  `-D` *FORMAT*, `--print-default-template=`*FORMAT*+ :   Print the default template for an output *FORMAT*. (See `-t`     for a list of possible *FORMAT*s.)  `--print-default-data-file=`*FILE*+ :   Print a default data file.  `--no-wrap`+ :   Disable text wrapping in output. By default, text is wrapped     appropriately for the output format. -`--columns`=*NUMBER*+`--columns=`*NUMBER*+ :   Specify length of lines in characters (for text wrapping).  `--toc`, `--table-of-contents`+ :   Include an automatically generated table of contents (or, in     the case of `latex`, `context`, and `rst`, an instruction to create     one) in the output document. This option has no effect on `man`,     `docbook`, `slidy`, `slideous`, `s5`, `docx`, or `odt` output.  `--toc-depth=`*NUMBER*+ :   Specify the number of section levels to include in the table     of contents.  The default is 3 (which means that level 1, 2, and 3     headers will be listed in the contents).  `--no-highlight`+ :   Disables syntax highlighting for code blocks and inlines, even when     a language attribute is given. -`--highlight-style`=*STYLE*+`--highlight-style=`*STYLE*+ :   Specifies the coloring style to be used in highlighted source code.     Options are `pygments` (the default), `kate`, `monochrome`,-    `espresso`, `zenburn`, `haddock`, and `tango`.+    `espresso`, `zenburn`, `haddock`, and `tango`.  For more information+    on syntax highlighting in pandoc, see [Syntax highlighting], below.  `-H` *FILE*, `--include-in-header=`*FILE*+ :   Include contents of *FILE*, verbatim, at the end of the header.     This can be used, for example, to include special     CSS or javascript in HTML documents.  This option can be used@@ -413,6 +461,7 @@     included in the order specified.  Implies `--standalone`.  `-B` *FILE*, `--include-before-body=`*FILE*+ :   Include contents of *FILE*, verbatim, at the beginning of the     document body (e.g. after the `<body>` tag in HTML, or the     `\begin{document}` command in LaTeX). This can be used to include@@ -421,6 +470,7 @@     the order specified.  Implies `--standalone`.  `-A` *FILE*, `--include-after-body=`*FILE*+ :   Include contents of *FILE*, verbatim, at the end of the document     body (before the `</body>` tag in HTML, or the     `\end{document}` command in LaTeX). This option can be be used@@ -431,6 +481,7 @@ ----------------------------------  `--self-contained`+ :   Produce a standalone HTML file with no external dependencies, using     `data:` URIs to incorporate the contents of linked scripts, stylesheets,     images, and videos. The resulting file should be "self-contained,"@@ -444,41 +495,50 @@     file is remote).  `--self-contained` does not work with `--mathjax`.  `--offline`+ :   Deprecated synonym for `--self-contained`.  `-5`, `--html5`+ :   Produce HTML5 instead of HTML4.  This option has no effect for writers     other than `html`. (*Deprecated:*  Use the `html5` output format instead.)  `--html-q-tags`+ :   Use `<q>` tags for quotes in HTML.  `--ascii`+ :   Use only ascii characters in output.  Currently supported only     for HTML output (which uses numerical entities instead of     UTF-8 when this option is selected).  `--reference-links`+ :   Use reference-style links, rather than inline links, in writing markdown     or reStructuredText.  By default inline links are used.  `--atx-headers`+ :   Use ATX style headers in markdown and asciidoc output. The default is     to use setext-style headers for levels 1-2, and then ATX headers.  `--chapters`+ :   Treat top-level headers as chapters in LaTeX, ConTeXt, and DocBook     output.  When the LaTeX template uses the report, book, or     memoir class, this option is implied.  If `beamer` is the output     format, top-level headers will become `\part{..}`.  `-N`, `--number-sections`+ :   Number section headings in LaTeX, ConTeXt, HTML, or EPUB output.     By default, sections are not numbered.  Sections with class     `unnumbered` will never be numbered, even if `--number-sections`     is specified. -`--number-offset`=*NUMBER[,NUMBER,...]*,+`--number-offset=`*NUMBER*[`,`*NUMBER*`,`*...*]+ :   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.@@ -489,6 +549,7 @@     Offsets are 0 by default.  Implies `--number-sections`.  `--no-tex-ligatures`+ :   Do not convert quotation marks, apostrophes, and dashes to     the TeX ligatures when writing LaTeX or ConTeXt. Instead, just     use literal unicode characters. This is needed for using advanced@@ -500,13 +561,16 @@     without `--smart`.  `--listings`+ :   Use listings package for LaTeX code blocks  `-i`, `--incremental`+ :   Make list items in slide shows display incrementally (one by one).     The default is for lists to be displayed all at once. -`--slide-level`=*NUMBER*+`--slide-level=`*NUMBER*+ :   Specifies that headers with the specified level create     slides (for `beamer`, `s5`, `slidy`, `slideous`, `dzslides`).  Headers     above this level in the hierarchy are used to divide the@@ -516,34 +580,40 @@     [Structuring the slide show](#structuring-the-slide-show), below.  `--section-divs`+ :   Wrap sections in `<div>` tags (or `<section>` tags in HTML5),     and attach identifiers to the enclosing `<div>` (or `<section>`)     rather than the header itself.     See [Section identifiers](#header-identifiers-in-html-latex-and-context), below. -`--email-obfuscation=`*none|javascript|references*+`--email-obfuscation=none`|`javascript`|`references`+ :   Specify a method for obfuscating `mailto:` links in HTML documents.-    *none* leaves `mailto:` links as they are.  *javascript* obfuscates-    them using javascript. *references* obfuscates them by printing their+    `none` leaves `mailto:` links as they are.  `javascript` obfuscates+    them using javascript. `references` obfuscates them by printing their     letters as decimal or hexadecimal character references. -`--id-prefix`=*STRING*+`--id-prefix=`*STRING*+ :   Specify a prefix to be added to all automatically generated identifiers     in HTML and DocBook output, and to footnote numbers in markdown output.     This is useful for preventing duplicate identifiers when generating     fragments to be included in other pages.  `-T` *STRING*, `--title-prefix=`*STRING*+ :   Specify *STRING* as a prefix at the beginning of the title     that appears in the HTML header (but not in the title as it     appears at the beginning of the HTML body).  Implies     `--standalone`.  `-c` *URL*, `--css=`*URL*+ :   Link to a CSS style sheet. This option can be be used repeatedly to     include multiple files. They will be included in the order specified.  `--reference-odt=`*FILE*+ :   Use the specified file as a style reference in producing an ODT.     For best results, the reference ODT should be a modified version     of an ODT produced using pandoc.  The contents of the reference ODT@@ -554,6 +624,7 @@     used.  `--reference-docx=`*FILE*+ :   Use the specified file as a style reference in producing a docx file.     For best results, the reference docx should be a modified version     of a docx file produced using pandoc.  The contents of the reference docx@@ -564,24 +635,28 @@     `--data-dir`). If this is not found either, sensible defaults will be     used. The following styles are used by pandoc: [paragraph]     Normal, Compact, Title, Subtitle, Authors, Date, Abstract, Heading 1,-    Heading 2, Heading 3, Heading 4, Heading 5, Block Quote, Definition Term,-    Definition, Bibliography, Body Text, Table Caption, Image Caption;+    Heading 2, Heading 3, Heading 4, Heading 5, Block Text, Definition Term,+    Definition, Bibliography, Body Text, Table Caption, Image Caption,+    Figure, FigureWithCaption;     [character] Default Paragraph Font, Body Text Char, Verbatim Char,-    Footnote Ref, Link.+    Footnote Reference, Hyperlink.  `--epub-stylesheet=`*FILE*+ :   Use the specified CSS file to style the EPUB.  If no stylesheet     is specified, pandoc will look for a file `epub.css` in the     user data directory (see `--data-dir`).  If it is not     found there, sensible defaults will be used.  `--epub-cover-image=`*FILE*+ :   Use the specified image as the EPUB cover.  It is recommended     that the image be less than 1000px in width and height. Note that     in a markdown source document you can also specify `cover-image`     in a YAML metadata block (see [EPUB Metadata], below).  `--epub-metadata=`*FILE*+ :   Look in the specified XML file for metadata for the EPUB.     The file should contain a series of Dublin Core elements,     as documented at <http://dublincore.org/documents/dces/>.@@ -603,10 +678,14 @@     [EPUB Metadata].  `--epub-embed-font=`*FILE*+ :   Embed the specified font in the EPUB. This option can be repeated-    to embed multiple fonts.  To use embedded fonts, you-    will need to add declarations like the following to your CSS (see-    `--epub-stylesheet`):+    to embed multiple fonts.  Wildcards can also be used: for example,+    `DejaVuSans-*.ttf`.  However, if you use wildcards on the command+    line, be sure to escape them or put the whole filename in single quotes,+    to prevent them from being interpreted by the shell. To use the+    embedded fonts, you will need to add declarations like the following+    to your CSS (see `--epub-stylesheet`):          @font-face {         font-family: DejaVuSans;@@ -635,6 +714,7 @@         body { font-family: "DejaVuSans"; }  `--epub-chapter-level=`*NUMBER*+ :   Specify the header level at which to split the EPUB into separate     "chapter" files. The default is to split into chapters at level 1     headers. This option only affects the internal composition of the@@ -643,37 +723,55 @@     documents with few level 1 headers, one might want to use a chapter     level of 2 or 3. -`--latex-engine=`*pdflatex|lualatex|xelatex*+`--latex-engine=pdflatex`|`lualatex`|`xelatex`+ :   Use the specified LaTeX engine when producing PDF output.     The default is `pdflatex`.  If the engine is not in your PATH,     the full path of the engine may be specified here. +`--latex-engine-opt=`*STRING*++:   Use the given string as a command-line argument to the `latex-engine`.+    If used multiple times, the arguments are provided with spaces between+    them. Note that no check for duplicate options is done.+ Citation rendering ------------------  `--bibliography=`*FILE*+ :   Set the `bibliography` field in the document's metadata to *FILE*,     overriding any value set in the metadata, and process citations     using `pandoc-citeproc`. (This is equivalent to     `--metadata bibliography=FILE --filter pandoc-citeproc`.)+    If `--natbib` or `--biblatex` is also supplied, `pandoc-citeproc` is not+    used, making this equivalent to `--metadata bibliography=FILE`.+    If you supply this argument multiple times, each *FILE* will be added+    to bibliography.  `--csl=`*FILE*+ :   Set the `csl` field in the document's metadata to *FILE*,     overriding any value set in the metadata.  (This is equivalent to     `--metadata csl=FILE`.)+    This option is only relevant with `pandoc-citeproc`.  `--citation-abbreviations=`*FILE*+ :   Set the `citation-abbreviations` field in the document's metadata to     *FILE*, overriding any value set in the metadata.  (This is equivalent to     `--metadata citation-abbreviations=FILE`.)+    This option is only relevant with `pandoc-citeproc`.  `--natbib`+ :   Use natbib for citations in LaTeX output.  This option is not for use     with the `pandoc-citeproc` filter or with PDF output.  It is intended for     use in producing a LaTeX file that can be processed with pdflatex and     bibtex.  `--biblatex`+ :   Use biblatex for citations in LaTeX output.  This option is not for use     with the `pandoc-citeproc` filter or with PDF output. It is intended for     use in producing a LaTeX file that can be processed with pdflatex and@@ -682,7 +780,8 @@ Math rendering in HTML ---------------------- -`-m` [*URL*], `--latexmathml`[=*URL*]+`-m` [*URL*], `--latexmathml`[`=`*URL*]+ :   Use the [LaTeXMathML] script to display embedded TeX math in HTML output.     To insert a link to a local copy of the `LaTeXMathML.js` script,     provide a *URL*. If no *URL* is provided, the contents of the@@ -691,13 +790,15 @@     several pages, it is much better to link to a copy of the script,     so it can be cached. -`--mathml`[=*URL*]+`--mathml`[`=`*URL*]+ :   Convert TeX math to MathML (in `docbook` as well as `html` and `html5`).     In standalone `html` output, a small javascript (or a link to such a     script if a *URL* is supplied) will be inserted that allows the MathML to     be viewed on some browsers. -`--jsmath`[=*URL*]+`--jsmath`[`=`*URL*]+ :   Use [jsMath] to display embedded TeX math in HTML output.     The *URL* should point to the jsMath load script (e.g.     `jsMath/easy/load.js`); if provided, it will be linked to in@@ -705,40 +806,47 @@     no link to the jsMath load script will be inserted; it is then     up to the author to provide such a link in the HTML template. -`--mathjax`[=*URL*]+`--mathjax`[`=`*URL*]+ :   Use [MathJax] to display embedded TeX math in HTML output.     The *URL* should point to the `MathJax.js` load script.     If a *URL* is not provided, a link to the MathJax CDN will     be inserted.  `--gladtex`+ :   Enclose TeX math in `<eq>` tags in HTML output.  These can then     be processed by [gladTeX] to produce links to images of the typeset     formulas. -`--mimetex`[=*URL*]+`--mimetex`[`=`*URL*]+ :   Render TeX math using the [mimeTeX] CGI script.  If *URL* is not     specified, it is assumed that the script is at `/cgi-bin/mimetex.cgi`. -`--webtex`[=*URL*]+`--webtex`[`=`*URL*]+ :   Render TeX formulas using an external script that converts TeX     formulas to images. The formula will be concatenated with the URL     provided. If *URL* is not specified, the Google Chart API will be used. -`--katex`[=*URL*]-:  Use [KaTeX] to display embedded TeX math in HTML output.-   The *URL* should point to the `katex.js` load script. If a *URL* is-   not provided, a link to the KaTeX CDN will be inserted.+`--katex`[`=`*URL*] -`--katex-stylesheet=*URL*`-:  The *URL* should point to the `katex.css` stylesheet. If this option is-   not specified, a link to the KaTeX CDN will be inserted. Note that this-   option does not imply `--katex`.+:   Use [KaTeX] to display embedded TeX math in HTML output.+    The *URL* should point to the `katex.js` load script. If a *URL* is+    not provided, a link to the KaTeX CDN will be inserted. +`--katex-stylesheet=`*URL*++:   The *URL* should point to the `katex.css` stylesheet. If this option is+    not specified, a link to the KaTeX CDN will be inserted. Note that this+    option does not imply `--katex`.+ Options for wrapper scripts ---------------------------  `--dump-args`+ :   Print information about command-line arguments to *stdout*, then exit.     This option is intended primarily for use in wrapper scripts.     The first line of output contains the name of the output file specified@@ -749,6 +857,7 @@     after a `--` separator at the end of the line.  `--ignore-args`+ :   Ignore command-line arguments (for use in wrapper scripts).     Regular Pandoc options are not ignored.  Thus, for example, @@ -876,6 +985,9 @@ :   color for internal links in LaTeX documents (`red`, `green`,     `magenta`, `cyan`, `blue`, `black`) +`toccolor`+:    color for links in table of contents in LaTeX documents+ `urlcolor` :   color for external links in LaTeX documents @@ -891,18 +1003,21 @@ `toc-depth` :   level of section to include in table of contents in LaTeX documents +`toc-title`+:   title of table of contents (works only with EPUB and docx)+ `lof` :   include list of figures in LaTeX documents  `lot` :   include list of tables in LaTeX documents +`bibliography`+:   bibliography to use for resolving references+ `biblio-style` :   bibliography style in LaTeX, when used with `--natbib` -`biblio-files`-:   bibliography files to use in LaTeX, with `--natbib` or `--biblatex`- `section` :   section number in man pages @@ -991,7 +1106,7 @@ Paragraphs ---------- -A paragraph is one or more lines of text followed by one or more blank line.+A paragraph is one or more lines of text followed by one or more blank lines. Newlines are treated as spaces, so you can reflow your paragraphs as you like. If you need a hard line break, put two or more spaces at the end of a line. @@ -1158,11 +1273,18 @@ reference will link to the first one only, and you will need to use explicit links to link to the others, as described above. -Unlike regular reference links, these references are case-sensitive.+Like regular reference links, these references are case-insensitive. -Note:  if you have defined an explicit identifier for a header,-then implicit references to it will not work.+Explicit link reference definitions always take priority over+implicit header references.  So, in the following example, the+link will point to `bar`, not to `#foo`: +    # Foo++    [foo]: bar++    See [foo]+ Block quotations ---------------- @@ -1232,9 +1354,9 @@  In addition to standard indented code blocks, Pandoc supports *fenced* code blocks.  These begin with a row of three or more-tildes (`~`) or backticks (`` ` ``) and end with a row of tildes or-backticks that must be at least as long as the starting row. Everything-between these lines is treated as code. No indentation is necessary:+tildes (`~`) and end with a row of tildes that must be at least as long as+the starting row. Everything between these lines is treated as code. No+indentation is necessary:      ~~~~~~~     if (a > 3) {@@ -1254,9 +1376,14 @@     ~~~~~~~~~~     ~~~~~~~~~~~~~~~~ +#### Extension: `backtick_code_blocks` ####++Same as `fenced_code_blocks`, but uses backticks (`` ` ``) instead of tildes+(`~`).+ #### Extension: `fenced_code_attributes` #### -Optionally, you may attach attributes to the code block using+Optionally, you may attach attributes to fenced or backtick code block using this syntax:      ~~~~ {#mycode .haskell .numberLines startFrom="100"}@@ -1299,6 +1426,8 @@  To prevent all highlighting, use the `--no-highlight` flag. To set the highlighting style, use `--highlight-style`.+For more information on highlighting, see [Syntax highlighting],+below.  Line blocks -----------@@ -1815,8 +1944,8 @@ The syntax is [the same as in PHP markdown extra].  The beginning and ending pipe characters are optional, but pipes are required between all columns.  The colons indicate column alignment as shown.  The header-can be omitted, but the horizontal line must still be included, as-it defines column alignments.+cannot be omitted.  To simulate a headerless table, include a header+with blank cells.  Since the pipes indicate column boundaries, columns need not be vertically aligned, as they are in the above example.  So, this is a perfectly@@ -1838,7 +1967,7 @@     http://michelf.ca/projects/php-markdown/extra/#table  Note:  Pandoc also recognizes pipe tables of the following-form, as can produced by Emacs' orgtbl-mode:+form, as can be produced by Emacs' orgtbl-mode:      | One | Two   |     |-----+-------|@@ -2276,19 +2405,19 @@ Thus, for example, Pandoc will turn      <table>-    	<tr>-    		<td>*one*</td>-    		<td>[a link](http://google.com)</td>-    	</tr>+    <tr>+    <td>*one*</td>+    <td>[a link](http://google.com)</td>+    </tr>     </table>  into      <table>-    	<tr>-    		<td><em>one</em></td>-    		<td><a href="http://google.com">a link</a></td>-    	</tr>+    <tr>+    <td><em>one</em></td>+    <td><a href="http://google.com">a link</a></td>+    </tr>     </table>  whereas `Markdown.pl` will preserve it as is.@@ -2427,9 +2556,9 @@     [Foo]: /bar/baz  In an *implicit* reference link, the second pair of brackets is-empty, or omitted entirely:+empty: -    See [my website][], or [my website].+    See [my website][].      [my website]: http://foo.bar.baz @@ -2443,6 +2572,15 @@     >     > [quote]: /foo +#### Extension: `shortcut_reference_links` ####++In a *shortcut* reference link, the second pair of brackets may+be omitted entirely:++    See [my website].++    [my website]: http://foo.bar.baz+ ### Internal links ###  To link to another section of the same document, use the automatically@@ -2551,25 +2689,38 @@     pandoc --filter pandoc-citeproc myinput.txt  In order to use this feature, you will need to specify a bibliography file-using the `bibliography` metadata field in a YAML metadata section.+using the `bibliography` metadata field in a YAML metadata section, or+`--bibliography` command line argument. You can supply multiple `--bibliography`+arguments or set `bibliography` metadata field to YAML array, if you want to+use multiple bibliography files. The bibliography may have any of these formats:    Format            File extension   ------------      ---------------  MODS              .mods   BibLaTeX          .bib   BibTeX            .bibtex-  RIS               .ris+  Copac             .copac+  CSL JSON          .json+  CSL YAML          .yaml   EndNote           .enl   EndNote XML       .xml   ISI               .wos   MEDLINE           .medline-  Copac             .copac-  JSON citeproc     .json+  MODS              .mods+  RIS               .ris  Note that `.bib` can generally be used with both BibTeX and BibLaTeX files, but you can use `.bibtex` to force BibTeX. +Note that `pandoc-citeproc --bib2json` and `pandoc-citeproc --bib2yaml`+can produce `.json` and `.yaml` files from any of the supported formats.++In-field markup: In bibtex and biblatex databases, pandoc-citeproc parses+(a subset of) LaTeX markup; in CSL JSON databases, an HTML-like markup+([specs](http://docs.citationstyles.org/en/1.0/release-notes.html#rich-text-markup-within-fields));+and in CSL YAML databases, pandoc markdown. `pandoc-citeproc -j` and `-y`+interconvert these markup formats as far as possible.+ As an alternative to specifying a bibliography file, you can include the citation data directly in the `references` field of the document's YAML metadata. The field should contain an array of@@ -2577,39 +2728,45 @@      ---     references:-    - id: fenner2012a-      title: One-click science marketing+    - type: article-journal+      id: WatsonCrick1953       author:-      - family: Fenner-        given: Martin-      container-title: Nature Materials-      volume: 11-      URL: 'http://dx.doi.org/10.1038/nmat3283'-      DOI: 10.1038/nmat3283-      issue: 4-      publisher: Nature Publishing Group-      page: 261-263-      type: article-journal+      - family: Watson+        given: J. D.+      - family: Crick+        given: F. H. C.       issued:-        year: 2012-        month: 3+        date-parts:+        - - 1953+          - 4+          - 25+      title: 'Molecular structure of nucleic acids: a structure for deoxyribose+        nucleic acid'+      title-short: Molecular structure of nucleic acids+      container-title: Nature+      volume: 171+      issue: 4356+      page: 737-738+      DOI: 10.1038/171737a0+      URL: http://www.nature.com/nature/journal/v171/n4356/abs/171737a0.html+      language: en-GB     ... -(The program `mods2yaml`, which comes with `pandoc-citeproc`, can help produce-these from a MODS reference collection.)+(`pandoc-citeproc --bib2yaml` can produce these from a bibliography file in one+of the supported formats.) -By default, `pandoc-citeproc` will use a Chicago author-date format for-citations and references.  To use another style, you will need to specify-a [CSL] 1.0 style file in the `csl` metadata field.  A primer on creating and+By default, `pandoc-citeproc` will use the Chicago Manual of Style author-date+format for citations and references.  To use another style, you will need to+specify a [CSL] 1.0 style file in the `csl` metadata field.  A repository of CSL+styles can be found at <https://github.com/citation-style-language/styles>.  See+also <http://zotero.org/styles> for easy browsing. A primer on creating and modifying CSL styles can be found at-<http://citationstyles.org/downloads/primer.html>.  A repository of CSL styles-can be found at <https://github.com/citation-style-language/styles>.  See also-<http://zotero.org/styles> for easy browsing.+<http://citationstyles.org/downloads/primer.html>.  Citations go inside square brackets and are separated by semicolons. 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+a locator, and a suffix.  The citation key must begin with a letter, digit, or `_`, and may contain alphanumerics, `_`, and internal punctuation characters (`:.#$%&-+?<>~/`).  Here are some examples: @@ -2658,6 +2815,12 @@ only, but the bibliography will contain entries for `item1`, `item2`, and `item3`. +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`+invocation. Bear in mind that bibliography files have to be in respective+format (either BibTeX or BibLaTeX).+ Non-pandoc extensions --------------------- @@ -2787,20 +2950,22 @@ `markdown_phpextra` (PHP Markdown Extra) :   `footnotes`, `pipe_tables`, `raw_html`, `markdown_attribute`,     `fenced_code_blocks`, `definition_lists`, `intraword_underscores`,-    `header_attributes`, `abbreviations`.+    `header_attributes`, `abbreviations`, `shortcut_reference_links`. -`markdown_github` (Github-flavored Markdown)+`markdown_github` (GitHub-flavored Markdown) :   `pipe_tables`, `raw_html`, `tex_math_single_backslash`,     `fenced_code_blocks`, `auto_identifiers`,     `ascii_identifiers`, `backtick_code_blocks`, `autolink_bare_uris`,-    `intraword_underscores`, `strikeout`, `hard_line_breaks`+    `intraword_underscores`, `strikeout`, `hard_line_breaks`,+    `shortcut_reference_links`.  `markdown_mmd` (MultiMarkdown) :   `pipe_tables` `raw_html`, `markdown_attribute`, `link_attributes`,     `raw_tex`, `tex_math_double_backslash`, `intraword_underscores`,     `mmd_title_block`, `footnotes`, `definition_lists`,     `all_symbols_escapable`, `implicit_header_references`,-    `auto_identifiers`, `mmd_header_identifiers`+    `auto_identifiers`, `mmd_header_identifiers`,+    `shortcut_reference_links`.  `markdown_strict` (Markdown.pl) :   `raw_html`@@ -2929,7 +3094,7 @@ Incremental lists ----------------- -By default, these writers produces lists that display "all at once."+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 `-i` option. If you want a particular list to depart from the default (that is, to display incrementally without the `-i` option and@@ -3009,6 +3174,16 @@ Notes are not yet supported for other slide formats, but the notes will not appear on the slides themselves. +Marking frames "fragile" in beamer+----------------------------------++Sometimes it is necessary to add the LaTeX `[fragile]` option to+a frame in beamer (for example, when using the `minted` environment).+This can be forced by adding the `fragile` class to the header+introducing the slide:++    # Fragile slide {.fragile}+ EPUB Metadata ============= @@ -3143,6 +3318,24 @@ writes HTML with the Haskell code in bird tracks, so it can be copied and pasted as literate Haskell source. +Syntax highlighting+===================++Pandoc will automatically highlight syntax in fenced code blocks that+are marked with a language name.  (See [Extension:+`inline_code_attributes`] and [Extension: `fenced_code_attributes`],+above.)  The Haskell library [highlighting-kate] is used for+highlighting, which works in HTML, Docx, and LaTeX/PDF output.+The color scheme can be selected using the `--highlight-style` option.+The default color scheme is `pygments`, which imitates the default color+scheme used by the Python library pygments, but pygments is not actually+used to do the highlighting.++To see a list of language names that pandoc will recognize, type+`pandoc --version`.++To disable highlighting, use the `--no-highlight` option.+ Custom writers ============== @@ -3163,19 +3356,131 @@ Authors ======= -© 2006-2013 John MacFarlane (jgm at berkeley dot edu). Released under the+© 2006-2015 John MacFarlane (jgm@berkeley.edu). Released under the [GPL], version 2 or greater.  This software carries no warranty of any kind.  (See COPYRIGHT for full copyright and warranty notices.)-Other contributors include Recai Oktaş, Paulo Tanimoto, Peter Wang,-Andrea Rossato, Eric Kow, infinity0x, Luke Plant, shreevatsa.public,-Puneeth Chaganti, Paul Rivier, rodja.trappe, Bradley Kuhn, thsutton,-Nathan Gass, Jonathan Daugherty, Jérémy Bobbio, Justin Bogner, qerub,-Christopher Sawicki, Kelsey Hightower, Masayoshi Takahashi, Antoine-Latter, Ralf Stephan, Eric Seidel, B. Scott Michel, Gavin Beatty,-Sergey Astanin, Arlo O'Keeffe, Denis Laxalde, Brent Yorgey, David Lazar,-Jamie F. Olson, Matthew Pickering, Albert Krewinkel, mb21, Jesse-Rosenthal. +Contributors include+Aaron Wolen,+Albert Krewinkel,+Alexander Kondratskiy,+Alexander Sulfrian,+Alexander V Vershilov,+Alfred Wechselberger,+Andreas Lööw,+Antoine Latter,+Arlo O'Keeffe,+Artyom Kazak,+Ben Gamari,+Beni Cherniavsky-Paskin,+Bjorn Buckwalter,+Bradley Kuhn,+Brent Yorgey,+Bryan O'Sullivan,+B. Scott Michel,+Caleb McDaniel,+Calvin Beck,+Christoffer Ackelman,+Christoffer Sawicki,+Clare Macrae,+Clint Adams,+Conal Elliott,+Craig S. Bosma,+Daniel Bergey,+Daniel T. Staal,+David Lazar,+David Röthlisberger,+Denis Laxalde,+Douglas Calvert,+Douglas F. Calvert,+Eric Kow,+Eric Seidel,+Florian Eitel,+François Gannaz,+Freiric Barral,+Fyodor Sheremetyev,+Gabor Pali,+Gavin Beatty,+Greg Maslov,+Grégory Bataille,+Greg Rundlett,+gwern,+Gwern Branwen,+Hans-Peter Deifel,+Henry de Valence,+Ilya V. Portnov,+infinity0x,+Jaime Marquínez Ferrándiz,+James Aspnes,+Jamie F. Olson,+Jason Ronallo,+Jeff Arnold,+Jeff Runningen,+Jens Petersen,+Jérémy Bobbio,+Jesse Rosenthal,+J. Lewis Muir,+Joe Hillenbrand,+John MacFarlane,+Jonas Smedegaard,+Jonathan Daugherty,+Josef Svenningsson,+Jose Luis Duran,+Julien Cretel,+Justin Bogner,+Kelsey Hightower,+Konstantin Zudov,+Luke Plant,+Mark Szepieniec,+Mark Wright,+Masayoshi Takahashi,+Matej Kollar,+Mathias Schenner,+Matthew Pickering,+Matthias C. M. Troffaes,+Max Bolingbroke,+Max Rydahl Andersen,+mb21,+Merijn Verstraaten,+Michael Snoyman,+Michael Thompson,+MinRK,+Nathan Gass,+Neil Mayhew,+Nick Bart,+Nicolas Kaiser,+Nikolay Yakimov,+Paulo Tanimoto,+Paul Rivier,+Peter Wang,+Philippe Ombredanne,+Phillip Alday,+Puneeth Chaganti,+qerub,+Ralf Stephan,+Recai Oktaş,+rodja.trappe,+RyanGlScott,+Scott Morrison,+Sergei Trofimovich,+Sergey Astanin,+Shahbaz Youssefi,+Shaun Attfield,+shreevatsa.public,+Simon Hengel,+Sumit Sahrawat,+takahashim,+thsutton,+Tim Lin,+Timothy Humphries,+Todd Sifleet,+Tom Leese,+Uli Köhler,+Václav Zeman,+Viktor Kronvall,+Vincent, and+Wikiwide.+ [markdown]: http://daringfireball.net/projects/markdown/ [reStructuredText]: http://docutils.sourceforge.net/docs/ref/rst/introduction.html [S5]: http://meyerweb.com/eric/tools/s5/@@ -3217,3 +3522,5 @@ [EPUB]: http://idpf.org/epub [EPUBspine]: http://www.idpf.org/epub/301/spec/epub-publications.html#sec-spine-elem [KaTeX]: https://github.com/Khan/KaTeX+[CommonMark]: http://commonmark.org+[highlighting-kate]: http://github.com/jgm/highlighting-kate
Setup.hs view
@@ -1,5 +1,5 @@ {--Copyright (C) 2006-2014 John MacFarlane <jgm@berkeley.edu>+Copyright (C) 2006-2015 John MacFarlane <jgm@berkeley.edu>  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@@ -22,7 +22,10 @@ import System.Process ( rawSystem ) import System.FilePath ( (</>) ) import System.Directory ( findExecutable )-import Distribution.Simple.Utils (info)+import Distribution.Simple.Utils (info, rawSystemExit)+import Distribution.Simple.Setup+import Distribution.Simple.LocalBuildInfo+import Distribution.Verbosity  main :: IO () main = defaultMainWithHooks $ simpleUserHooks {@@ -30,12 +33,17 @@       hookedPreProcessors = [ppBlobSuffixHandler]       -- ensure that make-pandoc-man-pages doesn't get installed to bindir     , copyHook = \pkgdescr ->-         (copyHook simpleUserHooks) pkgdescr{ executables =-            [x | x <- executables pkgdescr, exeName x /= "make-pandoc-man-pages"] }+         copyHook simpleUserHooks pkgdescr{ executables =+            [x | x <- executables pkgdescr, exeName x `notElem` noInstall] }     , instHook = \pkgdescr ->-         (instHook simpleUserHooks) pkgdescr{ executables =-            [x | x <- executables pkgdescr, exeName x /= "make-pandoc-man-pages"] }+         instHook simpleUserHooks pkgdescr{ executables =+            [x | x <- executables pkgdescr, exeName x `notElem` noInstall] }+    , postBuild = \args bf pkgdescr lbi -> do+            makeManPages args bf pkgdescr lbi+            makeReferenceFiles args bf pkgdescr lbi     }+  where+    noInstall = ["make-pandoc-man-pages","make-reference-files"]  ppBlobSuffixHandler :: PPSuffixHandler ppBlobSuffixHandler = ("hsb", \_ _ ->@@ -49,3 +57,20 @@             Nothing -> error "hsb2hs is needed to build this program: cabal install hsb2hs"          return ()   })++makeManPages :: Args -> BuildFlags -> PackageDescription -> LocalBuildInfo -> IO ()+makeManPages _ bf _ LocalBuildInfo{buildDir=buildDir}+  = rawSystemExit verbosity progPath []+  where+    verbosity = fromFlagOrDefault normal $ buildVerbosity bf+    progPath = buildDir </> "make-pandoc-man-pages" </> "make-pandoc-man-pages"++makeReferenceFiles :: Args -> BuildFlags -> PackageDescription -> LocalBuildInfo -> IO ()+makeReferenceFiles _ bf _ LocalBuildInfo{buildDir=buildDir}+  = mapM_+      (rawSystemExit verbosity progPath . return)+      referenceFormats+  where+    verbosity = fromFlagOrDefault normal $ buildVerbosity bf+    progPath = buildDir </> "make-reference-files" </> "make-reference-files"+    referenceFormats = ["docx", "odt"]
benchmark/benchmark-pandoc.hs view
@@ -22,16 +22,19 @@ import Data.Monoid import Data.Maybe (mapMaybe) import Debug.Trace (trace)+import Text.Pandoc.Error+import Control.Applicative  readerBench :: Pandoc-            -> (String, ReaderOptions -> String -> IO Pandoc)+            -> (String, ReaderOptions -> String -> IO (Either PandocError Pandoc))             -> Maybe Benchmark-readerBench doc (name, reader) = case lookup name writers of-  Just (PureStringWriter writer) ->-    let inp = writer def{ writerWrapText = True} doc-    in return $ bench (name ++ " reader") $ nfIO $-                 (reader def{ readerSmart = True }) inp-  _ -> trace ("\nCould not find writer for " ++ name ++ "\n") Nothing+readerBench doc (name, reader) =+  case lookup name writers of+       Just (PureStringWriter writer) ->+         let inp = writer def{ writerWrapText = True} doc+         in return $ bench (name ++ " reader") $ nfIO $+                 (fmap handleError <$> reader def{ readerSmart = True }) inp+       _ -> trace ("\nCould not find writer for " ++ name ++ "\n") Nothing  writerBench :: Pandoc             -> (String, WriterOptions -> Pandoc -> String)@@ -46,7 +49,7 @@                         defaultOptions args   inp <- readFile "tests/testsuite.txt"   let opts = def{ readerSmart = True }-  let doc = readMarkdown opts inp+  let doc = handleError $ readMarkdown opts inp   let readers' = [(n,r) | (n, StringReader r) <- readers]   let readerBs = mapMaybe (readerBench doc)                  $ filter (\(n,_) -> n /="haddock") readers'
changelog view
@@ -1,8 +1,553 @@+pandoc (1.14)++  [new features]++  * Added `commonmark` as input and output format.++  * Added `--verbose` flag for debugging output in PDF production (#1840,+    #1653).++  * Allow wildcards in `--epub-embed-font` arguments (#1939).++  * Added `--latex-engine-opt` option (#969, #1779, Sumit Sahrawat).++  * Added `shortcut_reference_links` extension (Konstantin Zudov, #1977).+    This is enabled by default for those markdown flavors that+    support reading shortcut reference links, namely: `markdown`,+    `markdown_strict`, `markdown_github`, `markdown_php`.+    If the extension is enabled, the reader parses shortcut reference+    links like `[foo]`, and the writer creates such links unless doing+    so would cause problems.  Users of markdown flavors that support+    shortcut reference links should not notice a difference in reading+    markdown, but the markdown pandoc produces may differ.+    If shortcut links are not desired, the extension can be disabled+    in the normal way.++  [behavior changes]++  * `--toc` is now supported for `docx` output (#458, Nikolay Yakimov).+    A "dirty" TOC is created at the beginning of document.+    It can be regenerated after the document has been opened.++  * An implicit `--filter pandoc-citeproc` is now triggered only when the+    `--bibliography` option is used, and not when the `bibliography`+    field in metadata is specified (#1849).++  * Markdown reader:++    + Reference links with `implicit_header_references` are no longer+      case-sensitive (#1606).+    + Definition lists no longer require indentation for first line (#2087).+      Previously the body of the definition (after the `:` or `~` marker)+      needed to be in column 4.  This commit relaxes that requirement,+      to better match the behavior of PHP Markdown Extra.  So, now+      this is a valid definition list:++            foo+            : bar+    + Resolve a potentially ambiguity with table captions:++            foo++              : bar++              -----+              table+              -----++      Is "bar" a definition, or the caption for the table?  We'll count+      it as a caption for the table.+    + Disallow headerless pipe tables (#1996), to conform to GFM and PHP+      Markdown Extra.  Note:  If you have been using headerless pipe tables,+      this change may cause existing tables to break.+    + Allow pipe tables with header but no body (#2017).+    + Allow a digit as first character of a citation key (Matthias Troffaes).+      See https://github.com/jgm/pandoc-citeproc/issues/97++  * LaTeX reader:++    + Don't limit includes to `.tex` extension (#1882).+      If the extension is not `.tex`, it must be given explicitly in+      the `\input` or `\include`.++  * Docx reader:++    + Allow numbering in the style file.  This allows inherited styles+      with numbering (lists) (Jesse Rosenthal).++  * Org reader:++    + Support smart punctuation (Craig Bosma).+    + Drop trees with a :noexport: tag (Albert Krewinkel). Trees having a+      `:noexport:` tag set are not exported.  This mirrors org-mode.+    + Put header tags into empty spans (Albert Krewinkel, #2160).+      Org mode allows headers to be tagged: `* Headline  :TAG1:TAG2`.+      Instead of being interpreted as part of the headline, the tags are now+      put into the attributes of empty spans.  Spans without textual content+      won't be visible by default, but they are detectable by filters.  They+      can also be styled using CSS when written as HTML.+    + Generalize code block result parsing (Albert Krewinkel).+      Previously, only code blocks were recognized as result blocks;+      now, any kind of block can be the result.++  * Append newline to the LineBreak in Dokuwiki, HTML, EPUB,+    LaTeX, MediaWiki, OpenDocument, Texinfo writers (#1924, Tim Lin).++  * HTML writer:++    + Add "inline" or "display" class to math spans (#1914).+      This allows inline and display math to be styled differently.+    + Include raw latex blocks if `--mathjax` specified (#1938).+    + Require highlighting-kate >= 0.5.14 (#1903).+      This ensures that all code blocks will be wrapped in a `div`+      with class `sourceCode`.  Also, the default highlighting CSS+      now adds `div.sourceCode { x-overflow: auto; }`, which means+      that code blocks (even with line numbers) will acquire a scroll+      bar on screens too small to display them (e.g. mobile phones).+      See also jgm/highlighting-kate#65.++  * LaTeX writer:++    + Use a declaration for tight lists (Jose Luis Duran, Joseph+      Harriott). Previously, pandoc hard-coded some commands to make+      tight lists in LaTeX.  Now we use a custom command instead,+      allowing the styling to be changed in a macro in the header.+      (Note:  existing templates may need to be modified to include+      the definition of this macro.  See the current template.)+    + Beamer output: if the header introducing a slide has the+      class `fragile`, add the `[fragile]` option to the slide (#2119).++  * MediaWiki writer:++    + Use `File:` instead of the deprecated `Image:` for images and+      other media files (Greg Rundlett).++  * DocBook writer:++    + Render a `Div (id,_,_) [Para _]` element as a `para` element+      with an `id` attribute.  This makes links to citations work in+      DocBook with pandoc-citeproc.++  * RST writer:++    + Normalize headings to sequential levels (Nikolay Yakimov).+      This is pretty much required by docutils.+    + Treat headings in block quotes, etc as rubrics (Nikolay Yakimov).+    + Better handling of raw latex inline (#1961).  We use+      `` :raw-latex:`...` `` and add a definition for this role to+      the template.++  * EPUB writer:++    + Remove `linear=no` from cover `itemref` (#1609).+    + Don't use `sup` element for epub footnotes (#1995).+      Instead, just use an a element with class `footnoteRef`.+      This allows more styling options, and provides better results+      in some readers (e.g. iBooks, where anything inside the a+      tag breaks popup footnotes).+    + Take TOC title from `toc-title` metadata field.++  * Docx writer:++    + Implemented `FirstParagraph` style (Jesse Rosenthal).+      Following the ODT writer, we add the `FirstParagraph` style to the+      first text paragraph following an image, blockquote, table, heading,+      or beginning of document.  This allows it to be styled differently.+      The default is for it to be the same as `Normal`.+    + Added `BodyText` style (Jesse Rosenthal).+      We apply a `BodyText` style to all unstyled paragraphs. This is,+      essentially, the same as `Normal`, except that since not everything+      inherits from `BodyText` (the metadata won't, for example, or+      the headers or footnote numbers), we can change the text in the body+      without having to make exceptions for everything.  If we do want to+      change *everything*, we can still do it through `Normal`.+    + Altered `Blockquote` style slightly (Jesse Rosenthal).+      Since `BlockQuote` derives from `BodyText`, we just want to specify+      by default that it won't indent, regardless of what `BodyText` does.+      Note that this will not produce any visible difference in the default+      configuration.+    + Take TOC title from `toc-title` metadata field (Nikolay Yakimov).+    + Added a style to figure images (Nikolay Yakimov).+      Figures with empty captions use style `Figure`.+      Figures with nonempty captions use style `Figure with Caption`, which+      is based on `Figure`, and additionally has `keepNext` set.++  * ODT writer:++    + Added figure captions (Nikolay Yakimov). The following styles are+      used for figures:+      `Figure` -- for figure with empty caption),+      `FigureWithCaption` (based on `Figure`) -- for figure with caption,+      `FigureCaption` (based on `Caption`) -- for figure captions.+      Also, `TableCaption` (based on `Caption`) is used for table captions.++  [API changes]++  * New `Text.Pandoc.Error` module with `PandocError` type+    (Matthew Pickering).++  * All readers now return `Either PandocError Pandoc` instead of `Pandoc`+    (Matthew Pickering).  This allows better handling of errors.++  * Added `Text.Pandoc.Writers.CommonMark`, exporting `writeCommonMark`.++  * Added `Text.Pandoc.Readers.CommonMark`, exporting `readCommonMark`.++  * Derive `Data` and `Typeable` instances for `MediaBag`, `Extension`,+    `ReaderOptions`, `EPUBVersion`, `CiteMethod`, `ObfuscationMethod`,+    `HTMLSlideVariant`, `TrackChanges`, `WriterOptions` (Shabbaz+    Youssefi).++  * New `Ext_shortcut_reference_links` constructor for `Extension`+    (Konstantin Zudov).++  [bug fixes]++  * Markdown reader:++    + Allow smart `'` after inline math (#1909, Nikolay Yakimov).+    + Check for tex macros after indented code (#1973).+    + Rewrote `charsInBalancedBrackets` for efficiency.+    + Make sure a closing `</div>` doesn't get included in a+      definition list item (#2127).+    + Don't parse bracketed text as citation if it might be a link,+      image, or footnote (Nikolay Yakimov).+    + Require space after key in mmd title block (#2026, Nikolay+      Yakimov).  Require space after key-value delimiter colon in mmd title+      block.+    + Require nonempty value in mmd title block (Nikolay Yakimov).+    + Disable all metadata block extensions when parsing+      metadata field values (#2026, Nikolay Yakimov).  Otherwise we+      could get a mmd title block inside YAML metadata, for example.++  * HTML reader:++    + Improve self-closing tag detection in `htmlInBalanced` (#2146).+    + Handle tables with `<th>` in body rows (#1859, mb21).+    + Fixed `htmlTag` (#1820).  If the tag parses as a comment, we check+      to see if the input starts with `<!--`. If not, it's bogus comment+      mode and we fail `htmlTag`.+    + Handle `base` tag; if it has an `href` value, this is added to+      all relative URLs in links and images.++  * DocBook reader:++    + Look inside "info" elements for section titles (#1931).++  * Docx reader:++    + Parse images in deprecated vml format (Jesse Rosenthal).+    + Allow sub/superscript verbatims (Jesse Rosenthal).+      Verbatim usually shuts off all other run styles, but we don't want it+      to shut off sub/superscript.++  * LaTeX reader:++    + Handle `tabular*` environment (#1850).+      Note that the table width is not actually parsed or taken into+      account, but pandoc no longer chokes on it.+    + Ignore options in `\lstinline` rather than raising error (#1997).+    + Add some test cases for simple tables (Mathias Schenner).+    + Handle valign argument in tables (Mathias Schenner) (currently+      we just ignore this).+    + Allow non-empty colsep in tables (Mathias Schenner).+      The `tabular` environment allows non-empty column separators+      with the "@{...}" syntax. Previously, pandoc would fail to+      parse tables if a non-empty colsep was present. With this+      commit, these separators are still ignored, but the table gets+      parsed. A test case is included.+    + Recognize `\newpage` as a block command.+    + Allow block content in \title{} (#2001).+    + Check for block-level newcommand aliases in blockCommand (Nikolay+      Yakimov).+    + Guard against paragraph starting with inline macro (Nikolay Yakimov).+    + Properly gobble spaces after `\\` (#2007).++  * Textile reader:++    +  Handle newlines in table cells, and empty cells (#1919).++  * Org reader:++    + Allow image links with non-image targets (Hans-Peter Deifel).+      This matches behavior of Org-Mode for links like+      `[[http://example.com][https://www.haskell.org/static/img/logo.png]]`.++  * Docbook writer:++    + Don't print empty id attributes (thanks to Steve Horne).++  * HTML writer:++    + Fixed list-style-type for numbered example lists.+      Should be "decimal," not "example" (#1902).+    + Do not omit missing `alt` attribute on `img` tag (#1131,+      Konstantin Zudov).+    + Allow multiple colgroups in table (#2122).+    + In revealjs, ensure that lists in speaker notes don't add "fragment"+      classes, which can cause additional keypresses to be needed to+      advance a slide (#1394).++  * LaTeX writer:++    + Don't escape `$` in URL (#1913).+    + Don't use listings in headers (Matthew Pickering, #1963).+    + Recognize book documentclass if set in metadata (#1971).+      This sets `--chapters` implicitly if the documentclass in metadata+      is a book documentclass.  Previously this was done only if a book+      documentclass was set in a variable.+    + Add a `\label` in `\hyperdef` for Div, Span (or links don't work).+    + Make `mainlang` work when `lang` is in metadata (#2174).++  * Texinfo writer:++    + Fix wrapping by using breakable spaces (Tim Lin).++  * RST writer:++    + Fixed toc depth in RST writer.  Previously the depth was being+      rendered as a floating point number with a decimal point.++  * Markdown writer:++    + Improved escaping (#2086).  `<` should not be escaped as `\<`, for+      compatibility with original Markdown.  We now escape `<` and `>`+      with entities.  Also, we now backslash-escape square brackets.+    + Avoid introducing spurious list items through wrapping (#1946).+    + Don't emit span tags if plain or raw HTML disabled.++  * MediaWiki writer:++    + Convert spaces to underscores in wikilink URL (#1982), like MediaWiki.++  * AsciiDoc writer:++    + Insert some needed blank lines (#1860).+    + Avoid wrapping after list marker (#1858).++  * EPUB writer:++    + Properly handle internal links to IDs in spans, divs (#1884).+    + Use plain writer for metadata dc: fields (#2121).+      This gives better results when we have, e.g. multiple paragraphs.+      Note that tags aren't allowed in these fields.+    + Properly handle image links without an extension (#1855).+    + Improved chapter splitting and internal link rewriting (#1887,+      #2162, #2163).  This will ensure that internal links work and+      that the references section produced by pandoc-citeproc is+      in its own chapter.+    + Fixed handling of svg images (#2183).++  * ICML writer:++    + Better handling of raw blocks and inlines (#1951).+      Previously these were always escaped and printed verbatim.+      Now they are ignored unless the format is `icml`, in which+      case they are passed through unescaped.+    + Fixed image URIs in ICML output (gohai).++  * Custom writer:++    + Raise error if loadstring returns an error status.+    + Raise `PandocLuaException` instead of using 'error'.+      Eventually we'll change the return type so that no exception+      is involved, but at least this can be trapped.+    + Use UTF-8 aware bytestring conversion.+    + Set foreign encoding to UTF-8 (Nikolay Yakimov, #2101, #1634).+      Also factored out ByteString, since it's only used as an intermediate+      representation.++  * Docx writer:++    + Copy hyphenation settings from reference.docx (Nikolay Yakimov).+    + Filter out illegal XML characters (#1992, Matthew Pickering).+    + Added `noProof` to docx syntax highlighting `SourceCode` style.+    + Added footnotes id -1 and 0 (Jesse Rosenthal).+      Word uses, by default, footnotes with id -1 and 0 for separators. If a+      user modifies `reference.docx`, they will end up with a `settings.xml`+      file that references these footnotes, but no such footnotes in the+      document. This will produce a corruption error. Here we add these to the+      document and `settings.xml` file, so future modifications won't break+      the file.+    + Handle lists correctly inside table cells (Jesse Rosenthal).+      Previously we didn't transform lists inside table cells.+    + Set firstRow information in tables (Nikolay Yakimov).+    + Don't replace `SourceCode` style in `reference.docx` if it is defined+      there (Nikolay Yakimov, #1872).  If `--no-highlight` specified, remove+      any `SourceCode` and `*Tok` styles in `reference.docx`.+    + Attempt to match international style names (#1607, Nikolay Yakimov).+    + Set these styles as custom (Nikolay Yakimov): `Author`, `Abstract`,+      `Compact`, `Image Caption`, `Table Caption`, `Definition Term`,+      `Definition`, `First Paragraph`.+    + Rename these styles to correspond with Word `Normal.dotm` (Nikolay+      Yakimov): `Block Quote -> Block Text`, `Link -> Hyperlink`,+      `Footnote Ref -> Footnote Reference`.+    + Added `Caption` style (Nikolay Yakimov).+    + Changed these styles' inheritance (Nikolay Yakimov):+      `Image Caption <- Caption`, `Table Caption <- Caption`.+    + Remove `SourceCode` style from `reference.docx` (#1872).+      This is added automatically by the docx writer.+    + Added toc heading style to `reference.docx` (Nikolay Yakimov).++  * `Text.Pandoc.PDF`++    + Don't suggest "Try xelatex" if xelatex already in use (mb21, #1832).+    + More comprehensible errors on image conversion (#2067).+      EPS can't be supported without shelling out to something like+      ImageMagick, but at least we can avoid mysterious error messages.++  * `Text.Pandoc.Shared`:++    + Make safeRead safe (#1801, Matthew Pickering).+    + Addded `mapLeft`, `hush` (Matthew Pickering).++  * `Text.Pandoc.Pretty`:++    + Remove partial function (Matthew Pickering).++  * `Text.Pandoc.SelfContained`:++    + Add `;charset=utf-8` to script mime type if missing (#1842).+    + Improved building of data URIs (#1940).  Now base64 is used except+      for `text/*` mime types.+    + `cssURLs` no longer tries to fetch fragment URLs (#2121).+    + Properly handle data URIs in css urls (#2129).+      Use a proper CSS parser (adds dependency on `text-css`).++  * `Text.Pandoc.UTF8`:++    + Better handling of bare CRs in input files (#2132).+      Previously we just stripped them out; now we convert+      other line ending styles to LF line endings.++  * `Text.Pandoc.ImageSize`:++    + Fixed some exif header parsing bugs (#1834).+    + Make imageSize return an Either, not a Maybe (#1834).+      Use `runGetOrFail` (with `binary >= 0.7`) to return `Left` on+      parse failure (rather than `error`).+    + Improved warnings when image size can't be determined.+    + Removed error landmines (Matthew Pickering).++  * Added woff2 to MIME types (Alfred Wechselberger).++  * pandoc:  When a binary input format is used, warn that file+    arguments past the first one are being ignored (Matthew Pickering).++  [template changes]++  * LaTeX template:++    + Degrade gracefully if `\paragraph` not defined.+    + Include `grffile` together with `graphicx` (#2074).+      This properly handles filenames containing spaces and dots.+    + Redefine `\paragraph`, `\subparagraph`...  to behave more+      like section headers (#1658).+    + Import hyperref before polyglossia to avoid an error with xelatex,+      "please load package hyperref before bidi package" (Nick Bart).+    + Added `toccolor` variable to control link color in toc (Kaixhin).++  * LaTeX, Beamer templates:++    + Provide `\tightlist`, which is now used by the LaTeX writer.+    + Use polyglossia in beamer (#85).+    + Use `bibliography` instead of `biblio-files`+      (#1661).  Also use `\addbibresource` instead of `\bibliography` for+      biblatex.+    + Added `setotherlanguages` in polyglossia. This uses an `otherlang`+      variable that is derived from a comma-separated list in `lang`;+      the last language is `mainlang` and the others are `otherlang`.++  * EPUB templates:++    + Use `div`, not `p`, for "rights" on title page.+    + Added header-includes, include-before, include-after (#1987).++  * OpenDocument template:++    + Use `text:p` instead of `text:h` for title.+      Using `text:h` causes problems with numbering.  Closes #2059.+      Thansk to @nkalvi for diagnosing this.++  * reveal.js template:++    + Link to non-minified css, js.  The minified versions no longer+      ship with the library.+    + Correctly include style CSS (#1949).+    + New configurable options options: `center`, `maxScale`, `slideNuber`+      (Dmitry Smirnov, pandoc-templates#89).+    + Moved custom CSS after theme.  This allows custom CSS to modify+      themes, instead of being replaced by them.+    + Allow `center` to be set to false.++  [under the hood improvements]++  * Removed pre-built `reference.docx` and `reference.odt` (Nikolay+    Yakimov).  Instead the repository now includes the component text files,+    and the zipped binaries are built from these using a helper+    program, `make-reference-files`.  This should make maintenance of+    these components easier going forward.++  * `Text.Pandoc.Parsing`:++    + Added new `<+?>` combinator (Nikolay Yakimov).+    + Added `stateHeaderKeys` to `ParserState`.++  * `make_deb.sh` fixes:++    + Detect architecture.+    + Add Installed-Size to debian package control file (#1900).+    + Use `fakeroot` to get permissions right.+    + Use `mkdir` and `cp` instead of `install`.+    + Set permissions of directories to 755.+    + Install in `/usr` rather than `/usr/local`.+    + Compress man pages.+    + Combine copyright files for `pandoc`, `pandoc-citeproc`.++  * Added `Text.Pandoc.Compat.Locale` and `old-locale` flag+    to assist with transition to `time` 1.5.++  * Updated CONTRIBUTING.md with information about issue tags (Matthew+    Pickering).++  * Updated travis installs to the new sudo-less syntax (Tim Lin).++  * Updated dependency version bounds.++  * EPUB tests:  don't use `joinPath`, which varies across platforms.+    Instead, use a forward-slash to join paths, regardless of the+    platform. This matches the way `MediaBag` now works.++  * Clarify JSON input and output in usage message (Caleb McDaniel).++  * Improved INSTALL instructions.++  * Always build man pages.  Removed make-pandoc-man-pages flag.++  * Makefile:  removed man target, now that we generate man pages by default.++  * README:++    + Fixed typos (J. Lewis Muir).+    + Added documentation on backtick_code_blocks (#2135, Nikolay Yakimov).+    + Added note on in-field markup in biblio databases (Nick Bart).+    + Fixed misleading example of raw HTML block.+    + Various minor formatting and consistency fixes for the program+      options (Andreas Lööw).+    + Made definition lists for options all "loose" for consistency.+    + Added YAML biblio format to table, and note on `pandoc-citeproc`'s+      `--bib2json` and `--bib2yaml` options (Nick Bart).+    + Removed obsolete reference to `mods2yaml` (Nick Bart).+    + Added section on syntax highlighting.+    + Documented `toccolor` variable.+ pandoc (1.13.2.1) -  * Updates to build with ghc 7.10.1.-  * Bumped package upper bounds for filepath, blaze-html, blaze-markup.+  * Updated to build with ghc 7.10.1. +  * Bumped package upper bounds for filepath, blaze-html,+    blaze-markup.+ pandoc (1.13.2)    * TWiki Reader: add new new twiki reader (API chaneg, Alexander Sulfrian).@@ -3980,7 +4525,7 @@      These constructions are now supported now by `rst2latex.py`. -  * Github syntax for fenced code blocks is supported in pandoc's+  * GitHub syntax for fenced code blocks is supported in pandoc's     markdown.  You can now write          ```ruby
+ data/docx/[Content_Types].xml view
@@ -0,0 +1,2 @@+<?xml version="1.0" encoding="UTF-8"?>+<Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types"><Default Extension="xml" ContentType="application/xml" /><Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml" /><Override PartName="/word/webSettings.xml" ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.webSettings+xml" /><Override PartName="/word/numbering.xml" ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml" /><Override PartName="/word/settings.xml" ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml" /><Override PartName="/word/theme/theme1.xml" ContentType="application/vnd.openxmlformats-officedocument.theme+xml" /><Override PartName="/word/fontTable.xml" ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.fontTable+xml" /><Override PartName="/docProps/app.xml" ContentType="application/vnd.openxmlformats-officedocument.extended-properties+xml" /><Override PartName="/docProps/core.xml" ContentType="application/vnd.openxmlformats-package.core-properties+xml" /><Override PartName="/word/styles.xml" ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml" /><Override PartName="/word/document.xml" ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml" /><Override PartName="/word/footnotes.xml" ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml" /></Types>
+ data/docx/_rels/.rels view
@@ -0,0 +1,2 @@+<?xml version="1.0" encoding="UTF-8"?>+<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument" Target="word/document.xml" /><Relationship Id="rId4" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties" Target="docProps/app.xml" /><Relationship Id="rId3" Type="http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties" Target="docProps/core.xml" /></Relationships>
+ data/docx/docProps/app.xml view
@@ -0,0 +1,18 @@+<?xml version="1.0" encoding="UTF-8"?>+<Properties xmlns="http://schemas.openxmlformats.org/officeDocument/2006/extended-properties" xmlns:vt="http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes">+  <Words>83</Words>+  <SharedDoc>false</SharedDoc>+  <HyperlinksChanged>false</HyperlinksChanged>+  <Lines>12</Lines>+  <AppVersion>12.0000</AppVersion>+  <LinksUpToDate>false</LinksUpToDate>+  <Application>Microsoft Word 12.0.0</Application>+  <CharactersWithSpaces>583</CharactersWithSpaces>+  <Template>Normal.dotm</Template>+  <DocSecurity>0</DocSecurity>+  <TotalTime>6</TotalTime>+  <ScaleCrop>false</ScaleCrop>+  <Characters>475</Characters>+  <Paragraphs>8</Paragraphs>+  <Pages>1</Pages>+</Properties>
+ data/docx/docProps/core.xml view
@@ -0,0 +1,2 @@+<?xml version="1.0" encoding="UTF-8"?>+<cp:coreProperties xmlns:cp="http://schemas.openxmlformats.org/package/2006/metadata/core-properties" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:dcmitype="http://purl.org/dc/dcmitype/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><dc:title></dc:title><dc:creator></dc:creator></cp:coreProperties>
+ data/docx/word/_rels/document.xml.rels view
@@ -0,0 +1,2 @@+<?xml version="1.0" encoding="UTF-8"?>+<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/numbering" Id="rId1" Target="numbering.xml" /><Relationship Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles" Id="rId2" Target="styles.xml" /><Relationship Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/settings" Id="rId3" Target="settings.xml" /><Relationship Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/webSettings" Id="rId4" Target="webSettings.xml" /><Relationship Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/fontTable" Id="rId5" Target="fontTable.xml" /><Relationship Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme" Id="rId6" Target="theme/theme1.xml" /><Relationship Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/footnotes" Id="rId7" Target="footnotes.xml" /></Relationships>
+ data/docx/word/_rels/footnotes.xml.rels view
@@ -0,0 +1,2 @@+<?xml version="1.0" encoding="UTF-8"?>+<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships" />
+ data/docx/word/document.xml view
@@ -0,0 +1,2 @@+<?xml version="1.0" encoding="UTF-8"?>+<w:document xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main" xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:w10="urn:schemas-microsoft-com:office:word" xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture" xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing"><w:body><w:p><w:r><w:t xml:space="preserve">Hello world.</w:t></w:r></w:p></w:body></w:document>
+ data/docx/word/fontTable.xml view
@@ -0,0 +1,52 @@+<?xml version="1.0" encoding="UTF-8"?>+<w:fonts xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main">+&#9;<w:font w:name="Symbol">+&#9;&#9;<w:panose1 w:val="02000500000000000000" />+&#9;&#9;<w:charset w:val="02" />+&#9;&#9;<w:family w:val="auto" />+&#9;&#9;<w:pitch w:val="variable" />+&#9;&#9;<w:sig w:usb0="00000000" w:usb1="00000000" w:usb2="00010000" w:usb3="00000000" w:csb0="80000000" w:csb1="00000000" />+&#9;</w:font>+&#9;<w:font w:name="Times New Roman">+&#9;&#9;<w:panose1 w:val="02020603050405020304" />+&#9;&#9;<w:charset w:val="00" />+&#9;&#9;<w:family w:val="auto" />+&#9;&#9;<w:pitch w:val="variable" />+&#9;&#9;<w:sig w:usb0="00000003" w:usb1="00000000" w:usb2="00000000" w:usb3="00000000" w:csb0="00000001" w:csb1="00000000" />+&#9;</w:font>+&#9;<w:font w:name="Courier New">+&#9;&#9;<w:panose1 w:val="02070309020205020404" />+&#9;&#9;<w:charset w:val="00" />+&#9;&#9;<w:family w:val="auto" />+&#9;&#9;<w:pitch w:val="variable" />+&#9;&#9;<w:sig w:usb0="00000003" w:usb1="00000000" w:usb2="00000000" w:usb3="00000000" w:csb0="00000001" w:csb1="00000000" />+&#9;</w:font>+&#9;<w:font w:name="Wingdings">+&#9;&#9;<w:panose1 w:val="05020102010804080708" />+&#9;&#9;<w:charset w:val="02" />+&#9;&#9;<w:family w:val="auto" />+&#9;&#9;<w:pitch w:val="variable" />+&#9;&#9;<w:sig w:usb0="00000000" w:usb1="00000000" w:usb2="00010000" w:usb3="00000000" w:csb0="80000000" w:csb1="00000000" />+&#9;</w:font>+&#9;<w:font w:name="Cambria">+&#9;&#9;<w:panose1 w:val="02040503050406030204" />+&#9;&#9;<w:charset w:val="00" />+&#9;&#9;<w:family w:val="auto" />+&#9;&#9;<w:pitch w:val="variable" />+&#9;&#9;<w:sig w:usb0="00000003" w:usb1="00000000" w:usb2="00000000" w:usb3="00000000" w:csb0="00000001" w:csb1="00000000" />+&#9;</w:font>+&#9;<w:font w:name="Calibri">+&#9;&#9;<w:panose1 w:val="020F0502020204030204" />+&#9;&#9;<w:charset w:val="00" />+&#9;&#9;<w:family w:val="auto" />+&#9;&#9;<w:pitch w:val="variable" />+&#9;&#9;<w:sig w:usb0="00000003" w:usb1="00000000" w:usb2="00000000" w:usb3="00000000" w:csb0="00000001" w:csb1="00000000" />+&#9;</w:font>+&#9;<w:font w:name="Arial">+&#9;&#9;<w:panose1 w:val="020B0604020202020204" />+&#9;&#9;<w:charset w:val="00" />+&#9;&#9;<w:family w:val="auto" />+&#9;&#9;<w:pitch w:val="variable" />+&#9;&#9;<w:sig w:usb0="00000003" w:usb1="00000000" w:usb2="00000000" w:usb3="00000000" w:csb0="00000001" w:csb1="00000000" />+&#9;</w:font>+</w:fonts>
+ data/docx/word/footnotes.xml view
@@ -0,0 +1,26 @@+<?xml version="1.0" encoding="utf-8"?>+<w:footnotes xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"+xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math"+xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"+xmlns:o="urn:schemas-microsoft-com:office:office"+xmlns:v="urn:schemas-microsoft-com:vml"+xmlns:w10="urn:schemas-microsoft-com:office:word"+xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"+xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture"+xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing">++  <w:footnote w:type="continuationSeparator" w:id="0">+    <w:p>+      <w:r>+        <w:continuationSeparator />+      </w:r>+    </w:p>+  </w:footnote>+  <w:footnote w:type="separator" w:id="-1">+    <w:p>+      <w:r>+        <w:separator />+      </w:r>+    </w:p>+  </w:footnote>+</w:footnotes>
+ data/docx/word/numbering.xml view
@@ -0,0 +1,2 @@+<?xml version="1.0" encoding="UTF-8"?>+<w:numbering xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"><w:abstractNum w:abstractNumId="0"><w:nsid w:val="e17f69ba" /><w:multiLevelType w:val="multilevel" /><w:lvl w:ilvl="0"><w:numFmt w:val="bullet" /><w:lvlText w:val=" " /><w:lvlJc w:val="left" /><w:pPr><w:tabs><w:tab w:val="num" w:pos="0" /></w:tabs><w:ind w:left="480" w:hanging="480" /></w:pPr></w:lvl><w:lvl w:ilvl="1"><w:numFmt w:val="bullet" /><w:lvlText w:val=" " /><w:lvlJc w:val="left" /><w:pPr><w:tabs><w:tab w:val="num" w:pos="720" /></w:tabs><w:ind w:left="1200" w:hanging="480" /></w:pPr></w:lvl><w:lvl w:ilvl="2"><w:numFmt w:val="bullet" /><w:lvlText w:val=" " /><w:lvlJc w:val="left" /><w:pPr><w:tabs><w:tab w:val="num" w:pos="1440" /></w:tabs><w:ind w:left="1920" w:hanging="480" /></w:pPr></w:lvl><w:lvl w:ilvl="3"><w:numFmt w:val="bullet" /><w:lvlText w:val=" " /><w:lvlJc w:val="left" /><w:pPr><w:tabs><w:tab w:val="num" w:pos="2160" /></w:tabs><w:ind w:left="2640" w:hanging="480" /></w:pPr></w:lvl><w:lvl w:ilvl="4"><w:numFmt w:val="bullet" /><w:lvlText w:val=" " /><w:lvlJc w:val="left" /><w:pPr><w:tabs><w:tab w:val="num" w:pos="2880" /></w:tabs><w:ind w:left="3360" w:hanging="480" /></w:pPr></w:lvl><w:lvl w:ilvl="5"><w:numFmt w:val="bullet" /><w:lvlText w:val=" " /><w:lvlJc w:val="left" /><w:pPr><w:tabs><w:tab w:val="num" w:pos="3600" /></w:tabs><w:ind w:left="4080" w:hanging="480" /></w:pPr></w:lvl><w:lvl w:ilvl="6"><w:numFmt w:val="bullet" /><w:lvlText w:val=" " /><w:lvlJc w:val="left" /><w:pPr><w:tabs><w:tab w:val="num" w:pos="4320" /></w:tabs><w:ind w:left="4800" w:hanging="480" /></w:pPr></w:lvl></w:abstractNum><w:num w:numId="1"><w:abstractNumId w:val="0" /></w:num></w:numbering>
+ data/docx/word/settings.xml view
@@ -0,0 +1,47 @@+<?xml version="1.0" encoding="UTF-8"?>+<w:settings xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:w10="urn:schemas-microsoft-com:office:word" xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main" xmlns:sl="http://schemas.openxmlformats.org/schemaLibrary/2006/main">+  <w:zoom w:percent="90" />+  <w:embedSystemFonts />+  <w:proofState w:spelling="clean" w:grammar="clean" />+  <w:stylePaneFormatFilter w:val="0004" />+  <w:footnotePr>+    <w:footnote w:id="-1" />+    <w:footnote w:id="0" />+  </w:footnotePr>+  <w:doNotTrackMoves />+  <w:defaultTabStop w:val="720" />+  <w:drawingGridHorizontalSpacing w:val="360" />+  <w:drawingGridVerticalSpacing w:val="360" />+  <w:displayHorizontalDrawingGridEvery w:val="0" />+  <w:displayVerticalDrawingGridEvery w:val="0" />+  <w:characterSpacingControl w:val="doNotCompress" />+  <w:savePreviewPicture />+  <w:rsids>+    <w:rsidRoot w:val="00590D07" />+    <w:rsid w:val="00011C8B" />+    <w:rsid w:val="004E29B3" />+    <w:rsid w:val="00590D07" />+    <w:rsid w:val="00784D58" />+    <w:rsid w:val="008D6863" />+    <w:rsid w:val="00B86B75" />+    <w:rsid w:val="00BC48D5" />+    <w:rsid w:val="00C36279" />+    <w:rsid w:val="00E315A3" />+  </w:rsids>+  <m:mathPr>+    <m:mathFont m:val="Lucida Grande" />+    <m:brkBin m:val="before" />+    <m:brkBinSub m:val="--" />+    <m:smallFrac m:val="false" />+    <m:dispDef m:val="false" />+    <m:lMargin m:val="0" />+    <m:rMargin m:val="0" />+    <m:wrapRight />+    <m:intLim m:val="subSup" />+    <m:naryLim m:val="subSup" />+  </m:mathPr>+  <w:themeFontLang w:val="en-US" />+  <w:clrSchemeMapping w:bg1="light1" w:t1="dark1" w:bg2="light2" w:t2="dark2" w:accent1="accent1" w:accent2="accent2" w:accent3="accent3" w:accent4="accent4" w:accent5="accent5" w:accent6="accent6" w:hyperlink="hyperlink" w:followedHyperlink="followedHyperlink" />+  <w:decimalSymbol w:val="." />+  <w:listSeparator w:val="," />+</w:settings>
+ data/docx/word/styles.xml view
@@ -0,0 +1,376 @@+<?xml version="1.0" encoding="UTF-8"?>+<w:styles xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main">+  <w:docDefaults>+    <w:rPrDefault>+      <w:rPr>+        <w:rFonts w:asciiTheme="minorHAnsi" w:eastAsiaTheme="minorHAnsi" w:hAnsiTheme="minorHAnsi" w:cstheme="minorBidi" />+        <w:sz w:val="24" />+        <w:szCs w:val="24" />+        <w:lang w:val="en-US" w:eastAsia="en-US" w:bidi="ar-SA" />+      </w:rPr>+    </w:rPrDefault>+    <w:pPrDefault>+      <w:pPr>+        <w:spacing w:after="200" />+      </w:pPr>+    </w:pPrDefault>+  </w:docDefaults>+  <w:latentStyles w:defLockedState="0" w:defUIPriority="0" w:defSemiHidden="0" w:defUnhideWhenUsed="0" w:defQFormat="0" w:count="276" />+  <w:style w:type="paragraph" w:default="1" w:styleId="Normal">+    <w:name w:val="Normal" />+    <w:qFormat />+  </w:style>+    <w:style w:type="paragraph" w:styleId="BodyText">+    <w:name w:val="Body Text" />+    <w:basedOn w:val="Normal" />+    <w:link w:val="BodyTextChar" />+    <w:pPr>+      <w:spacing w:before="180" w:after="180" />+    </w:pPr>+    <w:qFormat />+  </w:style>+  <w:style w:type="paragraph" w:customStyle="1" w:styleId="FirstParagraph">+    <w:name w:val="First Paragraph" />+    <w:basedOn w:val="BodyText" />+    <w:next w:val="BodyText" />+    <w:qFormat />+  </w:style>+  <w:style w:type="paragraph" w:customStyle="1" w:styleId="Compact">+    <w:name w:val="Compact" />+    <w:basedOn w:val="BodyText" />+    <w:qFormat />+    <w:pPr>+      <w:spacing w:before="36" w:after="36" />+    </w:pPr>+  </w:style>+  <w:style w:type="paragraph" w:styleId="Title">+    <w:name w:val="Title" />+    <w:basedOn w:val="Normal" />+    <w:next w:val="BodyText" />+    <w:qFormat />+    <w:pPr>+      <w:keepNext />+      <w:keepLines />+      <w:spacing w:before="480" w:after="240" />+      <w:jc w:val="center" />+    </w:pPr>+    <w:rPr>+      <w:rFonts w:asciiTheme="majorHAnsi" w:eastAsiaTheme="majorEastAsia" w:hAnsiTheme="majorHAnsi" w:cstheme="majorBidi" />+      <w:b />+      <w:bCs />+      <w:color w:val="345A8A" w:themeColor="accent1" w:themeShade="B5" />+      <w:sz w:val="36" />+      <w:szCs w:val="36" />+    </w:rPr>+  </w:style>+ <w:style w:type="paragraph" w:styleId="Subtitle">+    <w:name w:val="Subtitle" />+    <w:basedOn w:val="Title" />+    <w:next w:val="BodyText" />+    <w:qFormat />+    <w:pPr>+      <w:keepNext />+      <w:keepLines />+      <w:spacing w:before="240" w:after="240" />+      <w:jc w:val="center" />+    </w:pPr>+    <w:rPr>+      <w:sz w:val="30" />+      <w:szCs w:val="30" />+    </w:rPr>+ </w:style>+  <w:style w:type="paragraph" w:customStyle="1" w:styleId="Author">+    <w:name w:val="Author" />+    <w:next w:val="BodyText" />+    <w:qFormat />+    <w:pPr>+      <w:keepNext />+      <w:keepLines />+      <w:jc w:val="center" />+    </w:pPr>+  </w:style>+  <w:style w:type="paragraph" w:styleId="Date">+    <w:name w:val="Date" />+    <w:next w:val="BodyText" />+    <w:qFormat />+    <w:pPr>+      <w:keepNext />+      <w:keepLines />+      <w:jc w:val="center" />+    </w:pPr>+  </w:style>+  <w:style w:type="paragraph" w:customStyle="1" w:styleId="Abstract">+    <w:name w:val="Abstract" />+    <w:basedOn w:val="Normal" />+    <w:next w:val="BodyText" />+    <w:qFormat />+    <w:pPr>+      <w:keepNext />+      <w:keepLines />+      <w:spacing w:before="300" w:after="300" />+    </w:pPr>+    <w:rPr>+      <w:sz w:val="20" />+      <w:szCs w:val="20" />+    </w:rPr>+  </w:style>+  <w:style w:type="paragraph" w:styleId="Bibliography">+    <w:name w:val="Bibliography" />+    <w:basedOn w:val="Normal" />+    <w:next w:val="Bibliography" />+    <w:qFormat />+    <w:pPr />+    <w:rPr />+  </w:style>+  <w:style w:type="paragraph" w:styleId="Heading1">+    <w:name w:val="Heading 1" />+    <w:basedOn w:val="Normal" />+    <w:next w:val="BodyText" />+    <w:uiPriority w:val="9" />+    <w:qFormat />+    <w:pPr>+      <w:keepNext />+      <w:keepLines />+      <w:spacing w:before="480" w:after="0" />+      <w:outlineLvl w:val="0" />+    </w:pPr>+    <w:rPr>+      <w:rFonts w:asciiTheme="majorHAnsi" w:eastAsiaTheme="majorEastAsia" w:hAnsiTheme="majorHAnsi" w:cstheme="majorBidi" />+      <w:b />+      <w:bCs />+      <w:color w:val="345A8A" w:themeColor="accent1" w:themeShade="B5" />+      <w:sz w:val="32" />+      <w:szCs w:val="32" />+    </w:rPr>+  </w:style>+  <w:style w:type="paragraph" w:styleId="Heading2">+    <w:name w:val="Heading 2" />+    <w:basedOn w:val="Normal" />+    <w:next w:val="BodyText" />+    <w:uiPriority w:val="9" />+    <w:unhideWhenUsed />+    <w:qFormat />+    <w:pPr>+      <w:keepNext />+      <w:keepLines />+      <w:spacing w:before="200" w:after="0" />+      <w:outlineLvl w:val="1" />+    </w:pPr>+    <w:rPr>+      <w:rFonts w:asciiTheme="majorHAnsi" w:eastAsiaTheme="majorEastAsia" w:hAnsiTheme="majorHAnsi" w:cstheme="majorBidi" />+      <w:b />+      <w:bCs />+      <w:color w:val="4F81BD" w:themeColor="accent1" />+      <w:sz w:val="32" />+      <w:szCs w:val="32" />+    </w:rPr>+  </w:style>+  <w:style w:type="paragraph" w:styleId="Heading3">+    <w:name w:val="Heading 3" />+    <w:basedOn w:val="Normal" />+    <w:next w:val="BodyText" />+    <w:uiPriority w:val="9" />+    <w:unhideWhenUsed />+    <w:qFormat />+    <w:pPr>+      <w:keepNext />+      <w:keepLines />+      <w:spacing w:before="200" w:after="0" />+      <w:outlineLvl w:val="1" />+    </w:pPr>+    <w:rPr>+      <w:rFonts w:asciiTheme="majorHAnsi" w:eastAsiaTheme="majorEastAsia" w:hAnsiTheme="majorHAnsi" w:cstheme="majorBidi" />+      <w:b />+      <w:bCs />+      <w:color w:val="4F81BD" w:themeColor="accent1" />+      <w:sz w:val="28" />+      <w:szCs w:val="28" />+    </w:rPr>+  </w:style>+  <w:style w:type="paragraph" w:styleId="Heading4">+    <w:name w:val="Heading 4" />+    <w:basedOn w:val="Normal" />+    <w:next w:val="BodyText" />+    <w:uiPriority w:val="9" />+    <w:unhideWhenUsed />+    <w:qFormat />+    <w:pPr>+      <w:keepNext />+      <w:keepLines />+      <w:spacing w:before="200" w:after="0" />+      <w:outlineLvl w:val="1" />+    </w:pPr>+    <w:rPr>+      <w:rFonts w:asciiTheme="majorHAnsi" w:eastAsiaTheme="majorEastAsia" w:hAnsiTheme="majorHAnsi" w:cstheme="majorBidi" />+      <w:b />+      <w:bCs />+      <w:color w:val="4F81BD" w:themeColor="accent1" />+      <w:sz w:val="24" />+      <w:szCs w:val="24" />+    </w:rPr>+  </w:style>+  <w:style w:type="paragraph" w:styleId="Heading5">+    <w:name w:val="Heading 5" />+    <w:basedOn w:val="Normal" />+    <w:next w:val="BodyText" />+    <w:uiPriority w:val="9" />+    <w:unhideWhenUsed />+    <w:qFormat />+    <w:pPr>+      <w:keepNext />+      <w:keepLines />+      <w:spacing w:before="200" w:after="0" />+      <w:outlineLvl w:val="1" />+    </w:pPr>+    <w:rPr>+      <w:rFonts w:asciiTheme="majorHAnsi" w:eastAsiaTheme="majorEastAsia" w:hAnsiTheme="majorHAnsi" w:cstheme="majorBidi" />+      <w:i />+      <w:iCs />+      <w:color w:val="4F81BD" w:themeColor="accent1" />+      <w:sz w:val="24" />+      <w:szCs w:val="24" />+    </w:rPr>+  </w:style>+  <w:style w:type="paragraph" w:styleId="BlockText">+    <w:name w:val="Block Text" />+    <w:basedOn w:val="BodyText" />+    <w:next w:val="BodyText" />+    <w:uiPriority w:val="9" />+    <w:unhideWhenUsed />+    <w:qFormat />+    <w:pPr>+      <w:spacing w:before="100" w:after="100" />+      <w:ind w:firstLine="0" />+    </w:pPr>+    <w:rPr>+      <w:rFonts w:asciiTheme="majorHAnsi" w:eastAsiaTheme="majorEastAsia" w:hAnsiTheme="majorHAnsi" w:cstheme="majorBidi" />+      <w:bCs />+      <w:sz w:val="20" />+      <w:szCs w:val="20" />+    </w:rPr>+  </w:style>+  <w:style w:type="paragraph" w:styleId="FootnoteText">+    <w:name w:val="Footnote Text" />+    <w:basedOn w:val="Normal" />+    <w:next w:val="FootnoteText" />+    <w:uiPriority w:val="9" />+    <w:unhideWhenUsed />+    <w:qFormat />+  </w:style>+  <w:style w:type="character" w:default="1" w:styleId="DefaultParagraphFont">+    <w:name w:val="Default Paragraph Font" />+    <w:semiHidden />+    <w:unhideWhenUsed />+  </w:style>+  <w:style w:type="table" w:default="1" w:styleId="TableNormal">+    <w:name w:val="Normal Table" />+    <w:semiHidden />+    <w:unhideWhenUsed />+    <w:qFormat />+    <w:tblPr>+      <w:tblInd w:w="0" w:type="dxa" />+      <w:tblCellMar>+        <w:top w:w="0" w:type="dxa" />+        <w:left w:w="108" w:type="dxa" />+        <w:bottom w:w="0" w:type="dxa" />+        <w:right w:w="108" w:type="dxa" />+      </w:tblCellMar>+    </w:tblPr>+  </w:style>+  <w:style w:type="paragraph" w:customStyle="1" w:styleId="DefinitionTerm">+    <w:name w:val="Definition Term" />+    <w:basedOn w:val="Normal" />+    <w:next w:val="Definition" />+    <w:pPr>+      <w:keepNext />+      <w:keepLines />+      <w:spacing w:after="0" />+    </w:pPr>+    <w:rPr>+      <w:b />+    </w:rPr>+  </w:style>+  <w:style w:type="paragraph" w:customStyle="1" w:styleId="Definition">+    <w:name w:val="Definition" />+    <w:basedOn w:val="Normal" />+  </w:style>+  <w:style w:type="paragraph" w:styleId="Caption">+    <w:name w:val="Caption" />+    <w:basedOn w:val="Normal" />+    <w:link w:val="BodyTextChar" />+    <w:pPr>+      <w:spacing w:before="0" w:after="120" />+    </w:pPr>+    <w:rPr>+      <w:i />+    </w:rPr>+  </w:style>+  <w:style w:type="paragraph" w:customStyle="1" w:styleId="TableCaption">+    <w:name w:val="Table Caption" />+    <w:basedOn w:val="Caption" />+    <w:pPr>+      <w:keepNext />+    </w:pPr>+  </w:style>+  <w:style w:type="paragraph" w:customStyle="1" w:styleId="ImageCaption">+    <w:name w:val="Image Caption" />+    <w:basedOn w:val="Caption" />+  </w:style>+  <w:style w:type="paragraph" w:customStyle="1" w:styleId="Figure">+    <w:name w:val="Figure" />+    <w:basedOn w:val="Normal" />+  </w:style>+  <w:style w:type="paragraph" w:customStyle="1" w:styleId="FigureWithCaption">+    <w:name w:val="Figure with Caption" />+    <w:basedOn w:val="Figure" />+    <w:pPr>+      <w:keepNext />+    </w:pPr>+  </w:style>+  <w:style w:type="character" w:customStyle="1" w:styleId="BodyTextChar">+    <w:name w:val="Body Text Char" />+    <w:basedOn w:val="DefaultParagraphFont" />+    <w:link w:val="BodyText" />+  </w:style>+  <w:style w:type="character" w:customStyle="1" w:styleId="VerbatimChar">+    <w:name w:val="Verbatim Char" />+    <w:basedOn w:val="BodyTextChar" />+    <w:rPr>+      <w:rFonts w:ascii="Consolas" w:hAnsi="Consolas" />+      <w:sz w:val="22" />+    </w:rPr>+  </w:style>+  <w:style w:type="character" w:styleId="FootnoteReference">+    <w:name w:val="Footnote Reference" />+    <w:basedOn w:val="BodyTextChar" />+    <w:rPr>+      <w:vertAlign w:val="superscript" />+    </w:rPr>+  </w:style>+  <w:style w:type="character" w:styleId="Hyperlink">+    <w:name w:val="Hyperlink" />+    <w:basedOn w:val="BodyTextChar" />+    <w:rPr>+      <w:color w:val="4F81BD" w:themeColor="accent1" />+    </w:rPr>+  </w:style>+  <w:style w:type="paragraph" w:styleId="TOCHeading">+    <w:name w:val="TOC Heading" />+    <w:basedOn w:val="Heading1" />+    <w:next w:val="BodyText" />+    <w:uiPriority w:val="39" />+    <w:unhideWhenUsed />+    <w:qFormat />+    <w:pPr>+      <w:spacing w:before="240" w:line="259" w:lineRule="auto" />+      <w:outlineLvl w:val="9" />+    </w:pPr>+    <w:rPr>+      <w:rFonts w:asciiTheme="majorHAnsi" w:eastAsiaTheme="majorEastAsia" w:hAnsiTheme="majorHAnsi" w:cstheme="majorBidi" />+      <w:b w:val="0" />+      <w:bCs w:val="0" />+      <w:color w:val="365F91" w:themeColor="accent1"+      w:themeShade="BF" />+    </w:rPr>+  </w:style>+</w:styles>
+ data/docx/word/theme/theme1.xml view
@@ -0,0 +1,2 @@+<?xml version="1.0" encoding="UTF-8"?>+<a:theme xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" name="Office Theme"><a:themeElements><a:clrScheme name="Office"><a:dk1><a:sysClr val="windowText" lastClr="000000" /></a:dk1><a:lt1><a:sysClr val="window" lastClr="FFFFFF" /></a:lt1><a:dk2><a:srgbClr val="1F497D" /></a:dk2><a:lt2><a:srgbClr val="EEECE1" /></a:lt2><a:accent1><a:srgbClr val="4F81BD" /></a:accent1><a:accent2><a:srgbClr val="C0504D" /></a:accent2><a:accent3><a:srgbClr val="9BBB59" /></a:accent3><a:accent4><a:srgbClr val="8064A2" /></a:accent4><a:accent5><a:srgbClr val="4BACC6" /></a:accent5><a:accent6><a:srgbClr val="F79646" /></a:accent6><a:hlink><a:srgbClr val="0000FF" /></a:hlink><a:folHlink><a:srgbClr val="800080" /></a:folHlink></a:clrScheme><a:fontScheme name="Office"><a:majorFont><a:latin typeface="Calibri" /><a:ea typeface="" /><a:cs typeface="" /><a:font script="Jpan" typeface="MS ゴシック" /><a:font script="Hang" typeface="맑은 고딕" /><a:font script="Hans" typeface="宋体" /><a:font script="Hant" typeface="新細明體" /><a:font script="Arab" typeface="Times New Roman" /><a:font script="Hebr" typeface="Times New Roman" /><a:font script="Thai" typeface="Angsana New" /><a:font script="Ethi" typeface="Nyala" /><a:font script="Beng" typeface="Vrinda" /><a:font script="Gujr" typeface="Shruti" /><a:font script="Khmr" typeface="MoolBoran" /><a:font script="Knda" typeface="Tunga" /><a:font script="Guru" typeface="Raavi" /><a:font script="Cans" typeface="Euphemia" /><a:font script="Cher" typeface="Plantagenet Cherokee" /><a:font script="Yiii" typeface="Microsoft Yi Baiti" /><a:font script="Tibt" typeface="Microsoft Himalaya" /><a:font script="Thaa" typeface="MV Boli" /><a:font script="Deva" typeface="Mangal" /><a:font script="Telu" typeface="Gautami" /><a:font script="Taml" typeface="Latha" /><a:font script="Syrc" typeface="Estrangelo Edessa" /><a:font script="Orya" typeface="Kalinga" /><a:font script="Mlym" typeface="Kartika" /><a:font script="Laoo" typeface="DokChampa" /><a:font script="Sinh" typeface="Iskoola Pota" /><a:font script="Mong" typeface="Mongolian Baiti" /><a:font script="Viet" typeface="Times New Roman" /><a:font script="Uigh" typeface="Microsoft Uighur" /></a:majorFont><a:minorFont><a:latin typeface="Cambria" /><a:ea typeface="" /><a:cs typeface="" /><a:font script="Jpan" typeface="MS 明朝" /><a:font script="Hang" typeface="맑은 고딕" /><a:font script="Hans" typeface="宋体" /><a:font script="Hant" typeface="新細明體" /><a:font script="Arab" typeface="Arial" /><a:font script="Hebr" typeface="Arial" /><a:font script="Thai" typeface="Cordia New" /><a:font script="Ethi" typeface="Nyala" /><a:font script="Beng" typeface="Vrinda" /><a:font script="Gujr" typeface="Shruti" /><a:font script="Khmr" typeface="DaunPenh" /><a:font script="Knda" typeface="Tunga" /><a:font script="Guru" typeface="Raavi" /><a:font script="Cans" typeface="Euphemia" /><a:font script="Cher" typeface="Plantagenet Cherokee" /><a:font script="Yiii" typeface="Microsoft Yi Baiti" /><a:font script="Tibt" typeface="Microsoft Himalaya" /><a:font script="Thaa" typeface="MV Boli" /><a:font script="Deva" typeface="Mangal" /><a:font script="Telu" typeface="Gautami" /><a:font script="Taml" typeface="Latha" /><a:font script="Syrc" typeface="Estrangelo Edessa" /><a:font script="Orya" typeface="Kalinga" /><a:font script="Mlym" typeface="Kartika" /><a:font script="Laoo" typeface="DokChampa" /><a:font script="Sinh" typeface="Iskoola Pota" /><a:font script="Mong" typeface="Mongolian Baiti" /><a:font script="Viet" typeface="Arial" /><a:font script="Uigh" typeface="Microsoft Uighur" /></a:minorFont></a:fontScheme><a:fmtScheme name="Office"><a:fillStyleLst><a:solidFill><a:schemeClr val="phClr" /></a:solidFill><a:gradFill rotWithShape="1"><a:gsLst><a:gs pos="0"><a:schemeClr val="phClr"><a:tint val="50000" /><a:satMod val="300000" /></a:schemeClr></a:gs><a:gs pos="35000"><a:schemeClr val="phClr"><a:tint val="37000" /><a:satMod val="300000" /></a:schemeClr></a:gs><a:gs pos="100000"><a:schemeClr val="phClr"><a:tint val="15000" /><a:satMod val="350000" /></a:schemeClr></a:gs></a:gsLst><a:lin ang="16200000" scaled="1" /></a:gradFill><a:gradFill rotWithShape="1"><a:gsLst><a:gs pos="0"><a:schemeClr val="phClr"><a:tint val="100000" /><a:shade val="100000" /><a:satMod val="130000" /></a:schemeClr></a:gs><a:gs pos="100000"><a:schemeClr val="phClr"><a:tint val="50000" /><a:shade val="100000" /><a:satMod val="350000" /></a:schemeClr></a:gs></a:gsLst><a:lin ang="16200000" scaled="0" /></a:gradFill></a:fillStyleLst><a:lnStyleLst><a:ln w="9525" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="phClr"><a:shade val="95000" /><a:satMod val="105000" /></a:schemeClr></a:solidFill><a:prstDash val="solid" /></a:ln><a:ln w="25400" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="phClr" /></a:solidFill><a:prstDash val="solid" /></a:ln><a:ln w="38100" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="phClr" /></a:solidFill><a:prstDash val="solid" /></a:ln></a:lnStyleLst><a:effectStyleLst><a:effectStyle><a:effectLst><a:outerShdw blurRad="40000" dist="20000" dir="5400000" rotWithShape="0"><a:srgbClr val="000000"><a:alpha val="38000" /></a:srgbClr></a:outerShdw></a:effectLst></a:effectStyle><a:effectStyle><a:effectLst><a:outerShdw blurRad="40000" dist="23000" dir="5400000" rotWithShape="0"><a:srgbClr val="000000"><a:alpha val="35000" /></a:srgbClr></a:outerShdw></a:effectLst></a:effectStyle><a:effectStyle><a:effectLst><a:outerShdw blurRad="40000" dist="23000" dir="5400000" rotWithShape="0"><a:srgbClr val="000000"><a:alpha val="35000" /></a:srgbClr></a:outerShdw></a:effectLst><a:scene3d><a:camera prst="orthographicFront"><a:rot lat="0" lon="0" rev="0" /></a:camera><a:lightRig rig="threePt" dir="t"><a:rot lat="0" lon="0" rev="1200000" /></a:lightRig></a:scene3d><a:sp3d><a:bevelT w="63500" h="25400" /></a:sp3d></a:effectStyle></a:effectStyleLst><a:bgFillStyleLst><a:solidFill><a:schemeClr val="phClr" /></a:solidFill><a:gradFill rotWithShape="1"><a:gsLst><a:gs pos="0"><a:schemeClr val="phClr"><a:tint val="40000" /><a:satMod val="350000" /></a:schemeClr></a:gs><a:gs pos="40000"><a:schemeClr val="phClr"><a:tint val="45000" /><a:shade val="99000" /><a:satMod val="350000" /></a:schemeClr></a:gs><a:gs pos="100000"><a:schemeClr val="phClr"><a:shade val="20000" /><a:satMod val="255000" /></a:schemeClr></a:gs></a:gsLst><a:path path="circle"><a:fillToRect l="50000" t="-80000" r="50000" b="180000" /></a:path></a:gradFill><a:gradFill rotWithShape="1"><a:gsLst><a:gs pos="0"><a:schemeClr val="phClr"><a:tint val="80000" /><a:satMod val="300000" /></a:schemeClr></a:gs><a:gs pos="100000"><a:schemeClr val="phClr"><a:shade val="30000" /><a:satMod val="200000" /></a:schemeClr></a:gs></a:gsLst><a:path path="circle"><a:fillToRect l="50000" t="50000" r="50000" b="50000" /></a:path></a:gradFill></a:bgFillStyleLst></a:fmtScheme></a:themeElements><a:objectDefaults><a:spDef><a:spPr /><a:bodyPr /><a:lstStyle /><a:style><a:lnRef idx="1"><a:schemeClr val="accent1" /></a:lnRef><a:fillRef idx="3"><a:schemeClr val="accent1" /></a:fillRef><a:effectRef idx="2"><a:schemeClr val="accent1" /></a:effectRef><a:fontRef idx="minor"><a:schemeClr val="lt1" /></a:fontRef></a:style></a:spDef><a:lnDef><a:spPr /><a:bodyPr /><a:lstStyle /><a:style><a:lnRef idx="2"><a:schemeClr val="accent1" /></a:lnRef><a:fillRef idx="0"><a:schemeClr val="accent1" /></a:fillRef><a:effectRef idx="1"><a:schemeClr val="accent1" /></a:effectRef><a:fontRef idx="minor"><a:schemeClr val="tx1" /></a:fontRef></a:style></a:lnDef></a:objectDefaults><a:extraClrSchemeLst /></a:theme>
+ data/docx/word/webSettings.xml view
@@ -0,0 +1,5 @@+<?xml version="1.0" encoding="UTF-8"?>+<ns0:webSettings xmlns:ns0="http://schemas.openxmlformats.org/wordprocessingml/2006/main">+  <ns0:allowPNG />+  <ns0:doNotSaveAsSingleFile />+</ns0:webSettings>
data/epub.css view
@@ -12,3 +12,4 @@ h3.date { } ol.toc { padding: 0; margin-left: 1em; } ol.toc li { list-style-type: none; margin: 0; padding: 0; }+a.footnoteRef { vertical-align: super; }
+ data/make-reference-files.hs view
@@ -0,0 +1,26 @@+import System.Environment+import System.Directory+import Codec.Archive.Zip+import qualified Data.ByteString.Lazy as BS+import qualified Control.Exception as E+import System.IO.Error (isDoesNotExistError)++mkzip :: String -> IO ()+mkzip fmt = do+  let dir    = "data/"++fmt+      output = "data/reference."++fmt+  cd <- getCurrentDirectory+  setCurrentDirectory dir+  archive <- addFilesToArchive [OptRecursive] emptyArchive ["."]+  setCurrentDirectory cd+  removeIfExists output+  BS.writeFile output $ fromArchive archive++removeIfExists :: FilePath -> IO ()+removeIfExists fileName = removeFile fileName `E.catch` handleExists+  where handleExists e+          | isDoesNotExistError e = return ()+          | otherwise = E.throwIO e++main :: IO ()+main = getArgs >>= mkzip . (!!0)
+ data/odt/Configurations2/accelerator/current.xml view
+ data/odt/META-INF/manifest.xml view
@@ -0,0 +1,12 @@+<?xml version="1.0" encoding="UTF-8"?>+<manifest:manifest xmlns:manifest="urn:oasis:names:tc:opendocument:xmlns:manifest:1.0" manifest:version="1.2">+ <manifest:file-entry manifest:full-path="/" manifest:version="1.2" manifest:media-type="application/vnd.oasis.opendocument.text"/>+ <manifest:file-entry manifest:full-path="meta.xml" manifest:media-type="text/xml"/>+ <manifest:file-entry manifest:full-path="settings.xml" manifest:media-type="text/xml"/>+ <manifest:file-entry manifest:full-path="content.xml" manifest:media-type="text/xml"/>+ <manifest:file-entry manifest:full-path="Thumbnails/thumbnail.png" manifest:media-type="image/png"/>+ <manifest:file-entry manifest:full-path="manifest.rdf" manifest:media-type="application/rdf+xml"/>+ <manifest:file-entry manifest:full-path="Configurations2/accelerator/current.xml" manifest:media-type=""/>+ <manifest:file-entry manifest:full-path="Configurations2/" manifest:media-type="application/vnd.sun.xml.ui.configuration"/>+ <manifest:file-entry manifest:full-path="styles.xml" manifest:media-type="text/xml"/>+</manifest:manifest>
+ data/odt/Thumbnails/thumbnail.png view

binary file changed (absent → 785 bytes)

+ data/odt/content.xml view
@@ -0,0 +1,2 @@+<?xml version="1.0" encoding="UTF-8"?>+<office:document-content xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" xmlns:math="http://www.w3.org/1998/Math/MathML" xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0" xmlns:ooo="http://openoffice.org/2004/office" xmlns:ooow="http://openoffice.org/2004/writer" xmlns:oooc="http://openoffice.org/2004/calc" xmlns:dom="http://www.w3.org/2001/xml-events" xmlns:xforms="http://www.w3.org/2002/xforms" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:rpt="http://openoffice.org/2005/report" xmlns:of="urn:oasis:names:tc:opendocument:xmlns:of:1.2" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:grddl="http://www.w3.org/2003/g/data-view#" xmlns:officeooo="http://openoffice.org/2009/office" xmlns:tableooo="http://openoffice.org/2009/table" xmlns:drawooo="http://openoffice.org/2010/draw" xmlns:calcext="urn:org:documentfoundation:names:experimental:calc:xmlns:calcext:1.0" xmlns:field="urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0" xmlns:formx="urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form:1.0" xmlns:css3t="http://www.w3.org/TR/css3-text/" office:version="1.2"><office:scripts/><office:font-face-decls><style:font-face style:name="StarSymbol" svg:font-family="StarSymbol"/><style:font-face style:name="Tahoma1" svg:font-family="Tahoma"/><style:font-face style:name="Courier New" svg:font-family="&apos;Courier New&apos;" style:font-family-generic="modern" style:font-pitch="fixed"/><style:font-face style:name="Times New Roman" svg:font-family="&apos;Times New Roman&apos;" style:font-family-generic="roman" style:font-pitch="variable"/><style:font-face style:name="Arial" svg:font-family="Arial" style:font-family-generic="swiss" style:font-pitch="variable"/><style:font-face style:name="Lucida Sans Unicode" svg:font-family="&apos;Lucida Sans Unicode&apos;" style:font-family-generic="system" style:font-pitch="variable"/><style:font-face style:name="Tahoma" svg:font-family="Tahoma" style:font-family-generic="system" style:font-pitch="variable"/></office:font-face-decls><office:automatic-styles><style:style style:name="P1" style:family="paragraph" style:parent-style-name="Footer"><style:paragraph-properties fo:text-align="center" style:justify-single-word="false"/></style:style></office:automatic-styles><office:body><office:text><text:sequence-decls><text:sequence-decl text:display-outline-level="0" text:name="Illustration"/><text:sequence-decl text:display-outline-level="0" text:name="Table"/><text:sequence-decl text:display-outline-level="0" text:name="Text"/><text:sequence-decl text:display-outline-level="0" text:name="Drawing"/></text:sequence-decls><text:p text:style-name="Standard">Hello World!</text:p></office:text></office:body></office:document-content>
+ data/odt/manifest.rdf view
@@ -0,0 +1,18 @@+<?xml version="1.0" encoding="utf-8"?>+<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">+  <rdf:Description rdf:about="styles.xml">+    <rdf:type rdf:resource="http://docs.oasis-open.org/ns/office/1.2/meta/odf#StylesFile"/>+  </rdf:Description>+  <rdf:Description rdf:about="">+    <ns0:hasPart xmlns:ns0="http://docs.oasis-open.org/ns/office/1.2/meta/pkg#" rdf:resource="styles.xml"/>+  </rdf:Description>+  <rdf:Description rdf:about="content.xml">+    <rdf:type rdf:resource="http://docs.oasis-open.org/ns/office/1.2/meta/odf#ContentFile"/>+  </rdf:Description>+  <rdf:Description rdf:about="">+    <ns0:hasPart xmlns:ns0="http://docs.oasis-open.org/ns/office/1.2/meta/pkg#" rdf:resource="content.xml"/>+  </rdf:Description>+  <rdf:Description rdf:about="">+    <rdf:type rdf:resource="http://docs.oasis-open.org/ns/office/1.2/meta/pkg#Document"/>+  </rdf:Description>+</rdf:RDF>
+ data/odt/meta.xml view
@@ -0,0 +1,18 @@+<?xml version="1.0" encoding="UTF-8"?>+<office:document-meta+    xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0"+    xmlns:xlink="http://www.w3.org/1999/xlink"+    xmlns:dc="http://purl.org/dc/elements/1.1/"+    xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0"+    xmlns:ooo="http://openoffice.org/2004/office"+    xmlns:grddl="http://www.w3.org/2003/g/data-view#"+    office:version="1.2">+  <office:meta>+    <meta:document-statistic+      meta:table-count="0" meta:image-count="0" meta:object-count="0"+      meta:page-count="1" meta:paragraph-count="2" meta:word-count="3"+      meta:character-count="14"+      meta:non-whitespace-character-count="12"/>+    <meta:generator>Pandoc</meta:generator>+  </office:meta>+</office:document-meta>
+ data/odt/mimetype view
@@ -0,0 +1,1 @@+application/vnd.oasis.opendocument.text
+ data/odt/settings.xml view
@@ -0,0 +1,2 @@+<?xml version="1.0" encoding="UTF-8"?>+<office:document-settings xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:config="urn:oasis:names:tc:opendocument:xmlns:config:1.0" xmlns:ooo="http://openoffice.org/2004/office" office:version="1.2"><office:settings><config:config-item-set config:name="ooo:view-settings"><config:config-item config:name="ViewAreaTop" config:type="int">0</config:config-item><config:config-item config:name="ViewAreaLeft" config:type="int">0</config:config-item><config:config-item config:name="ViewAreaWidth" config:type="int">21747</config:config-item><config:config-item config:name="ViewAreaHeight" config:type="int">10874</config:config-item><config:config-item config:name="ShowRedlineChanges" config:type="boolean">true</config:config-item><config:config-item config:name="InBrowseMode" config:type="boolean">false</config:config-item><config:config-item-map-indexed config:name="Views"><config:config-item-map-entry><config:config-item config:name="ViewId" config:type="string">view2</config:config-item><config:config-item config:name="ViewLeft" config:type="int">3041</config:config-item><config:config-item config:name="ViewTop" config:type="int">3041</config:config-item><config:config-item config:name="VisibleLeft" config:type="int">0</config:config-item><config:config-item config:name="VisibleTop" config:type="int">0</config:config-item><config:config-item config:name="VisibleRight" config:type="int">21745</config:config-item><config:config-item config:name="VisibleBottom" config:type="int">10873</config:config-item><config:config-item config:name="ZoomType" config:type="short">0</config:config-item><config:config-item config:name="ViewLayoutColumns" config:type="short">0</config:config-item><config:config-item config:name="ViewLayoutBookMode" config:type="boolean">false</config:config-item><config:config-item config:name="ZoomFactor" config:type="short">100</config:config-item><config:config-item config:name="IsSelectedFrame" config:type="boolean">false</config:config-item></config:config-item-map-entry></config:config-item-map-indexed></config:config-item-set><config:config-item-set config:name="ooo:configuration-settings"><config:config-item config:name="ChartAutoUpdate" config:type="boolean">true</config:config-item><config:config-item config:name="IsLabelDocument" config:type="boolean">false</config:config-item><config:config-item config:name="MathBaselineAlignment" config:type="boolean">false</config:config-item><config:config-item config:name="Rsid" config:type="int">1473719</config:config-item><config:config-item config:name="OutlineLevelYieldsNumbering" config:type="boolean">false</config:config-item><config:config-item config:name="PrintLeftPages" config:type="boolean">true</config:config-item><config:config-item config:name="DoNotJustifyLinesWithManualBreak" config:type="boolean">false</config:config-item><config:config-item config:name="ClippedPictures" config:type="boolean">false</config:config-item><config:config-item config:name="AlignTabStopPosition" config:type="boolean">true</config:config-item><config:config-item config:name="PrintTextPlaceholder" config:type="boolean">false</config:config-item><config:config-item config:name="UseOldNumbering" config:type="boolean">false</config:config-item><config:config-item config:name="CurrentDatabaseCommand" config:type="string"/><config:config-item config:name="ProtectForm" config:type="boolean">false</config:config-item><config:config-item config:name="PrintBlackFonts" config:type="boolean">false</config:config-item><config:config-item config:name="PrintProspectRTL" config:type="boolean">false</config:config-item><config:config-item config:name="BackgroundParaOverDrawings" config:type="boolean">false</config:config-item><config:config-item config:name="FloattableNomargins" config:type="boolean">false</config:config-item><config:config-item config:name="SmallCapsPercentage66" config:type="boolean">false</config:config-item><config:config-item config:name="PrintControls" config:type="boolean">true</config:config-item><config:config-item config:name="EmbedSystemFonts" config:type="boolean">false</config:config-item><config:config-item config:name="CharacterCompressionType" config:type="short">0</config:config-item><config:config-item config:name="PrintHiddenText" config:type="boolean">false</config:config-item><config:config-item config:name="UseFormerTextWrapping" config:type="boolean">false</config:config-item><config:config-item config:name="IsKernAsianPunctuation" config:type="boolean">false</config:config-item><config:config-item config:name="PrintProspect" config:type="boolean">false</config:config-item><config:config-item config:name="PrintEmptyPages" config:type="boolean">false</config:config-item><config:config-item config:name="UnbreakableNumberings" config:type="boolean">false</config:config-item><config:config-item config:name="UseFormerObjectPositioning" config:type="boolean">false</config:config-item><config:config-item config:name="ConsiderTextWrapOnObjPos" config:type="boolean">false</config:config-item><config:config-item config:name="TableRowKeep" config:type="boolean">false</config:config-item><config:config-item config:name="PrintReversed" config:type="boolean">false</config:config-item><config:config-item config:name="TabsRelativeToIndent" config:type="boolean">true</config:config-item><config:config-item config:name="PrintRightPages" config:type="boolean">true</config:config-item><config:config-item config:name="PrintPaperFromSetup" config:type="boolean">false</config:config-item><config:config-item config:name="AddFrameOffsets" config:type="boolean">false</config:config-item><config:config-item config:name="AddParaSpacingToTableCells" config:type="boolean">true</config:config-item><config:config-item config:name="UpdateFromTemplate" config:type="boolean">true</config:config-item><config:config-item config:name="AddExternalLeading" config:type="boolean">true</config:config-item><config:config-item config:name="PrintSingleJobs" config:type="boolean">false</config:config-item><config:config-item config:name="PrinterIndependentLayout" config:type="string">high-resolution</config:config-item><config:config-item config:name="RsidRoot" config:type="int">1473719</config:config-item><config:config-item config:name="LinkUpdateMode" config:type="short">1</config:config-item><config:config-item config:name="PrintAnnotationMode" config:type="short">0</config:config-item><config:config-item config:name="TabOverMargin" config:type="boolean">false</config:config-item><config:config-item config:name="UseOldPrinterMetrics" config:type="boolean">false</config:config-item><config:config-item config:name="RedlineProtectionKey" config:type="base64Binary"/><config:config-item config:name="PrinterSetup" config:type="base64Binary"/><config:config-item config:name="IgnoreFirstLineIndentInNumbering" config:type="boolean">false</config:config-item><config:config-item config:name="CollapseEmptyCellPara" config:type="boolean">true</config:config-item><config:config-item config:name="PrinterName" config:type="string"/><config:config-item config:name="EmbedFonts" config:type="boolean">false</config:config-item><config:config-item config:name="InvertBorderSpacing" config:type="boolean">false</config:config-item><config:config-item config:name="PrintPageBackground" config:type="boolean">true</config:config-item><config:config-item config:name="DoNotCaptureDrawObjsOnPage" config:type="boolean">false</config:config-item><config:config-item config:name="TabOverflow" config:type="boolean">true</config:config-item><config:config-item config:name="ApplyUserData" config:type="boolean">true</config:config-item><config:config-item config:name="TabAtLeftIndentForParagraphsInList" config:type="boolean">false</config:config-item><config:config-item config:name="UnxForceZeroExtLeading" config:type="boolean">false</config:config-item><config:config-item config:name="SaveVersionOnClose" config:type="boolean">false</config:config-item><config:config-item config:name="PrintFaxName" config:type="string"/><config:config-item config:name="StylesNoDefault" config:type="boolean">false</config:config-item><config:config-item config:name="AddParaTableSpacing" config:type="boolean">true</config:config-item><config:config-item config:name="PrintDrawings" config:type="boolean">true</config:config-item><config:config-item config:name="LoadReadonly" config:type="boolean">false</config:config-item><config:config-item config:name="PrintGraphics" config:type="boolean">true</config:config-item><config:config-item config:name="FieldAutoUpdate" config:type="boolean">true</config:config-item><config:config-item config:name="AllowPrintJobCancel" config:type="boolean">true</config:config-item><config:config-item config:name="UseFormerLineSpacing" config:type="boolean">false</config:config-item><config:config-item config:name="SaveGlobalDocumentLinks" config:type="boolean">false</config:config-item><config:config-item config:name="CurrentDatabaseDataSource" config:type="string"/><config:config-item config:name="IgnoreTabsAndBlanksForLineCalculation" config:type="boolean">false</config:config-item><config:config-item config:name="CurrentDatabaseCommandType" config:type="int">0</config:config-item><config:config-item config:name="DoNotResetParaAttrsForNumFont" config:type="boolean">false</config:config-item><config:config-item config:name="ClipAsCharacterAnchoredWriterFlyFrames" config:type="boolean">false</config:config-item><config:config-item config:name="PrintTables" config:type="boolean">true</config:config-item><config:config-item config:name="AddParaTableSpacingAtStart" config:type="boolean">true</config:config-item></config:config-item-set></office:settings></office:document-settings>
+ data/odt/styles.xml view
@@ -0,0 +1,1096 @@+<?xml version="1.0" encoding="utf-8"?>+<office:document-styles xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0"+xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0"+xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0"+xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0"+xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0"+xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0"+xmlns:xlink="http://www.w3.org/1999/xlink"+xmlns:dc="http://purl.org/dc/elements/1.1/"+xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0"+xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0"+xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0"+xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0"+xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0"+xmlns:math="http://www.w3.org/1998/Math/MathML"+xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0"+xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0"+xmlns:ooo="http://openoffice.org/2004/office"+xmlns:ooow="http://openoffice.org/2004/writer"+xmlns:oooc="http://openoffice.org/2004/calc"+xmlns:dom="http://www.w3.org/2001/xml-events"+xmlns:rpt="http://openoffice.org/2005/report"+xmlns:of="urn:oasis:names:tc:opendocument:xmlns:of:1.2"+xmlns:xhtml="http://www.w3.org/1999/xhtml"+xmlns:grddl="http://www.w3.org/2003/g/data-view#"+xmlns:officeooo="http://openoffice.org/2009/office"+xmlns:tableooo="http://openoffice.org/2009/table"+xmlns:drawooo="http://openoffice.org/2010/draw"+xmlns:calcext="urn:org:documentfoundation:names:experimental:calc:xmlns:calcext:1.0"+xmlns:css3t="http://www.w3.org/TR/css3-text/" office:version="1.2">+  <office:font-face-decls>+    <style:font-face style:name="StarSymbol"+    svg:font-family="StarSymbol" />+    <style:font-face style:name="Tahoma1"+    svg:font-family="Tahoma" />+    <style:font-face style:name="Courier New"+    svg:font-family="'Courier New'"+    style:font-family-generic="modern" style:font-pitch="fixed" />+    <style:font-face style:name="Times New Roman"+    svg:font-family="'Times New Roman'"+    style:font-family-generic="roman"+    style:font-pitch="variable" />+    <style:font-face style:name="Arial" svg:font-family="Arial"+    style:font-family-generic="swiss"+    style:font-pitch="variable" />+    <style:font-face style:name="Lucida Sans Unicode"+    svg:font-family="'Lucida Sans Unicode'"+    style:font-family-generic="system"+    style:font-pitch="variable" />+    <style:font-face style:name="Tahoma" svg:font-family="Tahoma"+    style:font-family-generic="system"+    style:font-pitch="variable" />+  </office:font-face-decls>+  <office:styles>+    <style:default-style style:family="graphic">+      <style:graphic-properties fo:wrap-option="wrap"+      draw:shadow-offset-x="0.1181in"+      draw:shadow-offset-y="0.1181in"+      draw:start-line-spacing-horizontal="0.1114in"+      draw:start-line-spacing-vertical="0.1114in"+      draw:end-line-spacing-horizontal="0.1114in"+      draw:end-line-spacing-vertical="0.1114in"+      style:flow-with-text="false" />+      <style:paragraph-properties style:text-autospace="ideograph-alpha"+      style:line-break="strict" style:writing-mode="lr-tb"+      style:font-independent-line-spacing="false">+        <style:tab-stops />+      </style:paragraph-properties>+      <style:text-properties style:use-window-font-color="true"+      fo:font-size="12pt" fo:language="en" fo:country="US"+      style:letter-kerning="true" style:font-size-asian="12pt"+      style:language-asian="zxx" style:country-asian="none"+      style:font-size-complex="12pt" style:language-complex="zxx"+      style:country-complex="none" />+    </style:default-style>+    <style:default-style style:family="paragraph">+      <style:paragraph-properties fo:hyphenation-ladder-count="no-limit"+      style:text-autospace="ideograph-alpha"+      style:punctuation-wrap="hanging" style:line-break="strict"+      style:tab-stop-distance="0.4925in"+      style:writing-mode="page" />+      <style:text-properties style:use-window-font-color="true"+      style:font-name="Times New Roman" fo:font-size="12pt"+      fo:language="en" fo:country="US" style:letter-kerning="true"+      style:font-name-asian="Lucida Sans Unicode"+      style:font-size-asian="12pt" style:language-asian="zxx"+      style:country-asian="none" style:font-name-complex="Tahoma"+      style:font-size-complex="12pt" style:language-complex="zxx"+      style:country-complex="none" fo:hyphenate="false"+      fo:hyphenation-remain-char-count="2"+      fo:hyphenation-push-char-count="2" />+    </style:default-style>+    <style:default-style style:family="table">+      <style:table-properties table:border-model="collapsing" />+    </style:default-style>+    <style:default-style style:family="table-row">+      <style:table-row-properties fo:keep-together="auto" />+    </style:default-style>+    <style:style style:name="Standard" style:family="paragraph"+    style:class="text" />+    <style:style style:name="Heading" style:family="paragraph"+    style:parent-style-name="Standard"+    style:next-style-name="Text_20_body" style:class="text">+      <style:paragraph-properties fo:margin-top="0.1665in"+      fo:margin-bottom="0.0835in" style:contextual-spacing="false"+      fo:keep-with-next="always" />+      <style:text-properties style:font-name="Arial"+      fo:font-size="14pt"+      style:font-name-asian="Lucida Sans Unicode"+      style:font-size-asian="14pt" style:font-name-complex="Tahoma"+      style:font-size-complex="14pt" />+    </style:style>+    <style:style style:name="Text_20_body"+    style:display-name="Text body" style:family="paragraph"+    style:parent-style-name="Standard" style:class="text">+      <style:paragraph-properties fo:margin-top="0.0598in"+      fo:margin-bottom="0.0598in"+      style:contextual-spacing="false" />+    </style:style>+    <style:style style:name="List" style:family="paragraph"+    style:parent-style-name="Text_20_body" style:class="list">+      <style:text-properties style:font-name-complex="Tahoma1" />+    </style:style>+    <style:style style:name="Caption" style:family="paragraph"+    style:parent-style-name="Standard" style:class="extra">+      <style:paragraph-properties fo:margin-top="0.0835in"+      fo:margin-bottom="0.0835in" style:contextual-spacing="false"+      text:number-lines="false" text:line-number="0" />+      <style:text-properties fo:font-size="12pt"+      fo:font-style="italic" style:font-size-asian="12pt"+      style:font-style-asian="italic"+      style:font-name-complex="Tahoma1"+      style:font-size-complex="12pt"+      style:font-style-complex="italic" />+    </style:style>+    <style:style style:name="TableCaption" style:family="paragraph"+    style:parent-style-name="Caption" style:class="extra">+    </style:style>+    <style:style style:name="FigureCaption" style:family="paragraph"+    style:parent-style-name="Caption" style:class="extra">+    </style:style>+    <style:style style:name="Figure" style:family="paragraph"+    style:parent-style-name="Standard" style:class="extra">+      <style:paragraph-properties text:number-lines="false"+      text:line-number="0" />+    </style:style>+    <style:style style:name="FigureWithCaption" style:family="paragraph"+    style:parent-style-name="Figure" style:class="extra">+      <style:paragraph-properties text:number-lines="false"+      text:line-number="0" fo:keep-with-next="always" />+    </style:style>+    <style:style style:name="Index" style:family="paragraph"+    style:parent-style-name="Standard" style:class="index">+      <style:paragraph-properties text:number-lines="false"+      text:line-number="0" />+      <style:text-properties style:font-name-complex="Tahoma1" />+    </style:style>+    <style:style style:name="Heading_20_1"+    style:display-name="Heading 1" style:family="paragraph"+    style:parent-style-name="Heading"+    style:next-style-name="Text_20_body"+    style:default-outline-level="1" style:class="text">+      <style:text-properties fo:font-size="115%"+      fo:font-weight="bold" style:font-size-asian="115%"+      style:font-weight-asian="bold" style:font-size-complex="115%"+      style:font-weight-complex="bold" />+    </style:style>+    <style:style style:name="Heading_20_2"+    style:display-name="Heading 2" style:family="paragraph"+    style:parent-style-name="Heading"+    style:next-style-name="Text_20_body"+    style:default-outline-level="2" style:class="text">+      <style:text-properties fo:font-size="14pt"+      fo:font-style="italic" fo:font-weight="bold"+      style:font-size-asian="14pt" style:font-style-asian="italic"+      style:font-weight-asian="bold" style:font-size-complex="14pt"+      style:font-style-complex="italic"+      style:font-weight-complex="bold" />+    </style:style>+    <style:style style:name="Heading_20_3"+    style:display-name="Heading 3" style:family="paragraph"+    style:parent-style-name="Heading"+    style:next-style-name="Text_20_body"+    style:default-outline-level="3" style:class="text">+      <style:text-properties fo:font-size="14pt"+      fo:font-weight="bold" style:font-size-asian="14pt"+      style:font-weight-asian="bold" style:font-size-complex="14pt"+      style:font-weight-complex="bold" />+    </style:style>+    <style:style style:name="Heading_20_4"+    style:display-name="Heading 4" style:family="paragraph"+    style:parent-style-name="Heading"+    style:next-style-name="Text_20_body"+    style:default-outline-level="4" style:class="text">+      <style:text-properties fo:font-size="85%"+      fo:font-style="italic" fo:font-weight="bold"+      style:font-size-asian="85%" style:font-style-asian="italic"+      style:font-weight-asian="bold" style:font-size-complex="85%"+      style:font-style-complex="italic"+      style:font-weight-complex="bold" />+    </style:style>+    <style:style style:name="Heading_20_5"+    style:display-name="Heading 5" style:family="paragraph"+    style:parent-style-name="Heading"+    style:next-style-name="Text_20_body"+    style:default-outline-level="5" style:class="text">+      <style:text-properties fo:font-size="85%"+      fo:font-weight="bold" style:font-size-asian="85%"+      style:font-weight-asian="bold" style:font-size-complex="85%"+      style:font-weight-complex="bold" />+    </style:style>+    <style:style style:name="Heading_20_6"+    style:display-name="Heading 6" style:family="paragraph"+    style:parent-style-name="Heading"+    style:next-style-name="Text_20_body"+    style:default-outline-level="6" style:class="text">+      <style:text-properties fo:font-size="75%"+      fo:font-weight="bold" style:font-size-asian="75%"+      style:font-weight-asian="bold" style:font-size-complex="75%"+      style:font-weight-complex="bold" />+    </style:style>+    <style:style style:name="Quotations" style:family="paragraph"+    style:parent-style-name="Standard" style:class="html">+      <style:paragraph-properties fo:margin-left="0.3937in"+      fo:margin-right="0.3937in" fo:margin-top="0.1in"+      fo:margin-bottom="0.1in" style:contextual-spacing="false"+      fo:text-indent="0in" style:auto-text-indent="false" />+    </style:style>+    <style:style style:name="Preformatted_20_Text"+    style:display-name="Preformatted Text" style:family="paragraph"+    style:parent-style-name="Standard" style:class="html">+      <style:paragraph-properties fo:margin-top="0in"+      fo:margin-bottom="0in" style:contextual-spacing="false" />+      <style:text-properties style:font-name="Courier New"+      fo:font-size="10pt" style:font-name-asian="Courier New"+      style:font-size-asian="10pt"+      style:font-name-complex="Courier New"+      style:font-size-complex="10pt" />+    </style:style>+    <style:style style:name="Definition_20_Term"+    style:display-name="Definition Term" style:family="paragraph"+    style:parent-style-name="Standard"+    style:next-style-name="Definition_20_Definition">+      <style:paragraph-properties fo:margin-top="0.0598in"+      fo:margin-bottom="0.0598in"+      style:contextual-spacing="false" />+    </style:style>+    <style:style style:name="Definition_20_Definition"+    style:display-name="Definition Definition"+    style:family="paragraph" style:parent-style-name="Standard"+    style:next-style-name="Text_20_body">+      <style:paragraph-properties fo:margin-left="0.5in"+      fo:margin-right="0in" fo:text-indent="0in"+      style:auto-text-indent="false" />+    </style:style>+    <style:style style:name="Table_20_Contents"+    style:display-name="Table Contents" style:family="paragraph"+    style:parent-style-name="Standard" style:class="extra">+      <style:paragraph-properties fo:margin-left="0.0299in"+      fo:margin-right="0.0299in" fo:text-indent="0in"+      style:auto-text-indent="false" text:number-lines="false"+      text:line-number="0" />+    </style:style>+    <style:style style:name="Table_20_Heading"+    style:display-name="Table Heading" style:family="paragraph"+    style:parent-style-name="Table_20_Contents"+    style:class="extra">+      <style:paragraph-properties fo:margin-left="0.0299in"+      fo:margin-right="0.0299in" fo:text-align="start"+      style:justify-single-word="false" fo:text-indent="0in"+      style:auto-text-indent="false" style:shadow="none"+      text:number-lines="false" text:line-number="0" />+      <style:text-properties fo:font-weight="bold"+      style:font-weight-asian="bold"+      style:font-weight-complex="bold" />+    </style:style>+    <style:style style:name="Footnote" style:family="paragraph"+    style:parent-style-name="Standard" style:class="extra">+      <style:paragraph-properties fo:margin-left="0.1965in"+      fo:margin-right="0in" fo:text-indent="-0.1965in"+      style:auto-text-indent="false" text:number-lines="false"+      text:line-number="0" />+      <style:text-properties fo:font-size="10pt"+      style:font-size-asian="10pt"+      style:font-size-complex="10pt" />+    </style:style>+    <style:style style:name="Footer" style:family="paragraph"+    style:parent-style-name="Standard" style:class="extra">+      <style:paragraph-properties text:number-lines="false"+      text:line-number="0">+        <style:tab-stops>+          <style:tab-stop style:position="3.25in"+          style:type="center" />+          <style:tab-stop style:position="6.5in"+          style:type="right" />+        </style:tab-stops>+      </style:paragraph-properties>+    </style:style>+    <style:style style:name="Definition_20_Term_20_Tight"+    style:display-name="Definition Term Tight"+    style:family="paragraph" style:parent-style-name="Standard"+    style:next-style-name="Definition_20_Definition_20_Tight">+      <style:paragraph-properties fo:margin-top="0.0799in"+      fo:margin-bottom="0.0799in"+      style:contextual-spacing="false" />+    </style:style>+    <style:style style:name="Definition_20_Definition_20_Tight"+    style:display-name="Definition Definition Tight"+    style:family="paragraph" style:parent-style-name="Standard">+      <style:paragraph-properties fo:margin-left="0.5in"+      fo:margin-right="0in" fo:margin-top="0in"+      fo:margin-bottom="0in" style:contextual-spacing="false"+      fo:text-indent="0in" style:auto-text-indent="false" />+    </style:style>+    <style:style style:name="Date" style:family="paragraph"+    style:parent-style-name="Standard"+    style:next-style-name="Text_20_body">+      <style:text-properties fo:font-style="italic" />+    </style:style>+    <style:style style:name="Author" style:family="paragraph"+    style:parent-style-name="Standard" style:next-style-name="Date"+    style:master-page-name="">+      <style:paragraph-properties style:page-number="auto" />+      <style:text-properties fo:font-style="italic" />+    </style:style>+    <style:style style:name="Horizontal_20_Line"+    style:display-name="Horizontal Line" style:family="paragraph"+    style:parent-style-name="Standard"+    style:next-style-name="Text_20_body" style:class="html">+      <style:paragraph-properties fo:margin-top="0in"+      fo:margin-bottom="0.1965in" style:contextual-spacing="false"+      style:border-line-width-bottom="0.0008in 0.0138in 0.0008in"+      fo:padding="0in" fo:border-left="none" fo:border-right="none"+      fo:border-top="none" fo:border-bottom="1.11pt double #808080"+      text:number-lines="false" text:line-number="0"+      style:join-border="false" />+      <style:text-properties fo:font-size="6pt"+      style:font-size-asian="6pt" style:font-size-complex="6pt" />+    </style:style>+    <style:style style:name="First_20_paragraph"+    style:display-name="First paragraph" style:family="paragraph"+    style:parent-style-name="Standard"+    style:next-style-name="Text_20_body" style:class="text" />+    <style:style style:name="Numbering_20_Symbols"+    style:display-name="Numbering Symbols" style:family="text" />+    <style:style style:name="Bullet_20_Symbols"+    style:display-name="Bullet Symbols" style:family="text">+      <style:text-properties style:font-name="StarSymbol"+      fo:font-size="9pt" style:font-name-asian="StarSymbol"+      style:font-size-asian="9pt"+      style:font-name-complex="StarSymbol"+      style:font-size-complex="9pt" />+    </style:style>+    <style:style style:name="Emphasis" 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="Strong_20_Emphasis"+    style:display-name="Strong Emphasis" 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="Strikeout" style:family="text">+      <style:text-properties style:text-line-through-style="solid" />+    </style:style>+    <style:style style:name="Superscript" style:family="text">+      <style:text-properties style:text-position="super 58%" />+    </style:style>+    <style:style style:name="Subscript" style:family="text">+      <style:text-properties style:text-position="sub 58%" />+    </style:style>+    <style:style style:name="Citation" 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="Teletype" style:family="text">+      <style:text-properties style:font-name="Courier New"+      style:font-name-asian="Courier New"+      style:font-name-complex="Courier New" />+    </style:style>+    <style:style style:name="Internet_20_link"+    style:display-name="Internet link" style:family="text">+      <style:text-properties fo:color="#000080"+      style:text-underline-style="solid"+      style:text-underline-width="auto"+      style:text-underline-color="font-color" />+    </style:style>+    <style:style style:name="Footnote_20_Symbol"+    style:display-name="Footnote Symbol" style:family="text" />+    <style:style style:name="Footnote_20_anchor"+    style:display-name="Footnote anchor" style:family="text">+      <style:text-properties style:text-position="super 58%" />+    </style:style>+    <style:style style:name="Definition" style:family="text" />+    <text:outline-style style:name="Outline">+      <text:outline-level-style text:level="1" style:num-format="">+        <style:list-level-properties text:min-label-distance="0.15in" />+      </text:outline-level-style>+      <text:outline-level-style text:level="2" style:num-format="">+        <style:list-level-properties text:min-label-distance="0.15in" />+      </text:outline-level-style>+      <text:outline-level-style text:level="3" style:num-format="">+        <style:list-level-properties text:min-label-distance="0.15in" />+      </text:outline-level-style>+      <text:outline-level-style text:level="4" style:num-format="">+        <style:list-level-properties text:min-label-distance="0.15in" />+      </text:outline-level-style>+      <text:outline-level-style text:level="5" style:num-format="">+        <style:list-level-properties text:min-label-distance="0.15in" />+      </text:outline-level-style>+      <text:outline-level-style text:level="6" style:num-format="">+        <style:list-level-properties text:min-label-distance="0.15in" />+      </text:outline-level-style>+      <text:outline-level-style text:level="7" style:num-format="">+        <style:list-level-properties text:min-label-distance="0.15in" />+      </text:outline-level-style>+      <text:outline-level-style text:level="8" style:num-format="">+        <style:list-level-properties text:min-label-distance="0.15in" />+      </text:outline-level-style>+      <text:outline-level-style text:level="9" style:num-format="">+        <style:list-level-properties text:min-label-distance="0.15in" />+      </text:outline-level-style>+      <text:outline-level-style text:level="10"+      style:num-format="">+        <style:list-level-properties text:min-label-distance="0.15in" />+      </text:outline-level-style>+    </text:outline-style>+    <text:list-style style:name="Numbering_20_1"+    style:display-name="Numbering 1">+      <text:list-level-style-number text:level="1"+      text:style-name="Numbering_20_Symbols" style:num-suffix="."+      style:num-format="1">+        <style:list-level-properties text:min-label-width="0.1965in" />+      </text:list-level-style-number>+      <text:list-level-style-number text:level="2"+      text:style-name="Numbering_20_Symbols" style:num-suffix="."+      style:num-format="1">+        <style:list-level-properties text:space-before="0.1972in"+        text:min-label-width="0.1965in" />+      </text:list-level-style-number>+      <text:list-level-style-number text:level="3"+      text:style-name="Numbering_20_Symbols" style:num-suffix="."+      style:num-format="1">+        <style:list-level-properties text:space-before="0.3937in"+        text:min-label-width="0.1965in" />+      </text:list-level-style-number>+      <text:list-level-style-number text:level="4"+      text:style-name="Numbering_20_Symbols" style:num-suffix="."+      style:num-format="1">+        <style:list-level-properties text:space-before="0.5909in"+        text:min-label-width="0.1965in" />+      </text:list-level-style-number>+      <text:list-level-style-number text:level="5"+      text:style-name="Numbering_20_Symbols" style:num-suffix="."+      style:num-format="1">+        <style:list-level-properties text:space-before="0.7874in"+        text:min-label-width="0.1965in" />+      </text:list-level-style-number>+      <text:list-level-style-number text:level="6"+      text:style-name="Numbering_20_Symbols" style:num-suffix="."+      style:num-format="1">+        <style:list-level-properties text:space-before="0.9846in"+        text:min-label-width="0.1965in" />+      </text:list-level-style-number>+      <text:list-level-style-number text:level="7"+      text:style-name="Numbering_20_Symbols" style:num-suffix="."+      style:num-format="1">+        <style:list-level-properties text:space-before="1.1815in"+        text:min-label-width="0.1965in" />+      </text:list-level-style-number>+      <text:list-level-style-number text:level="8"+      text:style-name="Numbering_20_Symbols" style:num-suffix="."+      style:num-format="1">+        <style:list-level-properties text:space-before="1.3787in"+        text:min-label-width="0.1965in" />+      </text:list-level-style-number>+      <text:list-level-style-number text:level="9"+      text:style-name="Numbering_20_Symbols" style:num-suffix="."+      style:num-format="1">+        <style:list-level-properties text:space-before="1.5752in"+        text:min-label-width="0.1965in" />+      </text:list-level-style-number>+      <text:list-level-style-number text:level="10"+      text:style-name="Numbering_20_Symbols" style:num-suffix="."+      style:num-format="1">+        <style:list-level-properties text:space-before="1.7724in"+        text:min-label-width="0.1965in" />+      </text:list-level-style-number>+    </text:list-style>+    <text:list-style style:name="Numbering_20_2"+    style:display-name="Numbering 2">+      <text:list-level-style-number text:level="1"+      text:style-name="Numbering_20_Symbols" style:num-format="1">+        <style:list-level-properties text:min-label-width="0.1965in" />+      </text:list-level-style-number>+      <text:list-level-style-number text:level="2"+      text:style-name="Numbering_20_Symbols" style:num-format="1"+      text:start-value="2">+        <style:list-level-properties text:space-before="0.1965in"+        text:min-label-width="0.1965in" />+      </text:list-level-style-number>+      <text:list-level-style-number text:level="3"+      text:style-name="Numbering_20_Symbols" style:num-format="1"+      text:start-value="3">+        <style:list-level-properties text:space-before="0.3929in"+        text:min-label-width="0.3937in" />+      </text:list-level-style-number>+      <text:list-level-style-number text:level="4"+      text:style-name="Numbering_20_Symbols" style:num-format="1"+      text:start-value="4">+        <style:list-level-properties text:space-before="0.7866in"+        text:min-label-width="0.4925in" />+      </text:list-level-style-number>+      <text:list-level-style-number text:level="5"+      text:style-name="Numbering_20_Symbols" style:num-format="1"+      text:start-value="5">+        <style:list-level-properties text:space-before="1.2791in"+        text:min-label-width="0.5902in" />+      </text:list-level-style-number>+      <text:list-level-style-number text:level="6"+      text:style-name="Numbering_20_Symbols" style:num-format="1"+      text:start-value="6">+        <style:list-level-properties text:space-before="1.8693in"+        text:min-label-width="0.7091in" />+      </text:list-level-style-number>+      <text:list-level-style-number text:level="7"+      text:style-name="Numbering_20_Symbols" style:num-format="1"+      text:start-value="7">+        <style:list-level-properties text:space-before="2.5783in"+        text:min-label-width="0.9055in" />+      </text:list-level-style-number>+      <text:list-level-style-number text:level="8"+      text:style-name="Numbering_20_Symbols" style:num-format="1"+      text:start-value="8">+        <style:list-level-properties text:space-before="3.4839in"+        text:min-label-width="1.0236in" />+      </text:list-level-style-number>+      <text:list-level-style-number text:level="9"+      text:style-name="Numbering_20_Symbols" style:num-format="1"+      text:start-value="9">+        <style:list-level-properties text:space-before="4.5075in"+        text:min-label-width="1.1028in" />+      </text:list-level-style-number>+      <text:list-level-style-number text:level="10"+      text:style-name="Numbering_20_Symbols" style:num-format="1"+      text:start-value="10">+        <style:list-level-properties text:space-before="5.6102in"+        text:min-label-width="1.2209in" />+      </text:list-level-style-number>+    </text:list-style>+    <text:list-style style:name="Numbering_20_3"+    style:display-name="Numbering 3">+      <text:list-level-style-number text:level="1"+      text:style-name="Numbering_20_Symbols" style:num-format="1">+        <style:list-level-properties text:min-label-width="1.1811in" />+      </text:list-level-style-number>+      <text:list-level-style-number text:level="2"+      text:style-name="Numbering_20_Symbols" style:num-format="1"+      text:start-value="2">+        <style:list-level-properties text:space-before="1.1815in"+        text:min-label-width="1.1811in" />+      </text:list-level-style-number>+      <text:list-level-style-number text:level="3"+      text:style-name="Numbering_20_Symbols" style:num-format="1"+      text:start-value="3">+        <style:list-level-properties text:space-before="2.3626in"+        text:min-label-width="1.1811in" />+      </text:list-level-style-number>+      <text:list-level-style-number text:level="4"+      text:style-name="Numbering_20_Symbols" style:num-format="1"+      text:start-value="4">+        <style:list-level-properties text:space-before="3.5441in"+        text:min-label-width="1.1811in" />+      </text:list-level-style-number>+      <text:list-level-style-number text:level="5"+      text:style-name="Numbering_20_Symbols" style:num-format="1"+      text:start-value="5">+        <style:list-level-properties text:space-before="4.7252in"+        text:min-label-width="1.1811in" />+      </text:list-level-style-number>+      <text:list-level-style-number text:level="6"+      text:style-name="Numbering_20_Symbols" style:num-format="1"+      text:start-value="6">+        <style:list-level-properties text:space-before="5.9063in"+        text:min-label-width="1.1811in" />+      </text:list-level-style-number>+      <text:list-level-style-number text:level="7"+      text:style-name="Numbering_20_Symbols" style:num-format="1"+      text:start-value="7">+        <style:list-level-properties text:space-before="7.0878in"+        text:min-label-width="1.1811in" />+      </text:list-level-style-number>+      <text:list-level-style-number text:level="8"+      text:style-name="Numbering_20_Symbols" style:num-format="1"+      text:start-value="8">+        <style:list-level-properties text:space-before="8.2689in"+        text:min-label-width="1.1811in" />+      </text:list-level-style-number>+      <text:list-level-style-number text:level="9"+      text:style-name="Numbering_20_Symbols" style:num-format="1"+      text:start-value="9">+        <style:list-level-properties text:space-before="9.45in"+        text:min-label-width="1.1811in" />+      </text:list-level-style-number>+      <text:list-level-style-number text:level="10"+      text:style-name="Numbering_20_Symbols" style:num-format="1"+      text:start-value="10">+        <style:list-level-properties text:space-before="10.6315in"+        text:min-label-width="1.1811in" />+      </text:list-level-style-number>+    </text:list-style>+    <text:list-style style:name="Numbering_20_4"+    style:display-name="Numbering 4">+      <text:list-level-style-number text:level="1"+      text:style-name="Numbering_20_Symbols" style:num-suffix="."+      style:num-format="I">+        <style:list-level-properties text:min-label-width="0.1965in" />+      </text:list-level-style-number>+      <text:list-level-style-number text:level="2"+      text:style-name="Numbering_20_Symbols" style:num-suffix="."+      style:num-format="I" text:start-value="2">+        <style:list-level-properties text:space-before="0.1972in"+        text:min-label-width="0.1965in" />+      </text:list-level-style-number>+      <text:list-level-style-number text:level="3"+      text:style-name="Numbering_20_Symbols" style:num-suffix="."+      style:num-format="I" text:start-value="3">+        <style:list-level-properties text:space-before="0.3937in"+        text:min-label-width="0.1965in" />+      </text:list-level-style-number>+      <text:list-level-style-number text:level="4"+      text:style-name="Numbering_20_Symbols" style:num-suffix="."+      style:num-format="I" text:start-value="4">+        <style:list-level-properties text:space-before="0.5909in"+        text:min-label-width="0.1965in" />+      </text:list-level-style-number>+      <text:list-level-style-number text:level="5"+      text:style-name="Numbering_20_Symbols" style:num-suffix="."+      style:num-format="I" text:start-value="5">+        <style:list-level-properties text:space-before="0.7874in"+        text:min-label-width="0.1965in" />+      </text:list-level-style-number>+      <text:list-level-style-number text:level="6"+      text:style-name="Numbering_20_Symbols" style:num-suffix="."+      style:num-format="I" text:start-value="6">+        <style:list-level-properties text:space-before="0.9846in"+        text:min-label-width="0.1965in" />+      </text:list-level-style-number>+      <text:list-level-style-number text:level="7"+      text:style-name="Numbering_20_Symbols" style:num-suffix="."+      style:num-format="I" text:start-value="7">+        <style:list-level-properties text:space-before="1.1815in"+        text:min-label-width="0.1965in" />+      </text:list-level-style-number>+      <text:list-level-style-number text:level="8"+      text:style-name="Numbering_20_Symbols" style:num-suffix="."+      style:num-format="I" text:start-value="8">+        <style:list-level-properties text:space-before="1.3787in"+        text:min-label-width="0.1965in" />+      </text:list-level-style-number>+      <text:list-level-style-number text:level="9"+      text:style-name="Numbering_20_Symbols" style:num-suffix="."+      style:num-format="I" text:start-value="9">+        <style:list-level-properties text:space-before="1.5752in"+        text:min-label-width="0.1965in" />+      </text:list-level-style-number>+      <text:list-level-style-number text:level="10"+      text:style-name="Numbering_20_Symbols" style:num-suffix="."+      style:num-format="I" text:start-value="10">+        <style:list-level-properties text:space-before="1.7724in"+        text:min-label-width="0.1965in" />+      </text:list-level-style-number>+    </text:list-style>+    <text:list-style style:name="Numbering_20_5"+    style:display-name="Numbering 5">+      <text:list-level-style-number text:level="1"+      text:style-name="Numbering_20_Symbols" style:num-suffix="."+      style:num-format="1">+        <style:list-level-properties text:min-label-width="0.1575in" />+      </text:list-level-style-number>+      <text:list-level-style-number text:level="2"+      text:style-name="Numbering_20_Symbols" style:num-suffix="."+      style:num-format="1" text:start-value="2"+      text:display-levels="2">+        <style:list-level-properties text:space-before="0.1772in"+        text:min-label-width="0.2563in" />+      </text:list-level-style-number>+      <text:list-level-style-number text:level="3"+      text:style-name="Numbering_20_Symbols" style:num-suffix=")"+      style:num-format="a" text:start-value="3">+        <style:list-level-properties text:space-before="0.4331in"+        text:min-label-width="0.1772in" />+      </text:list-level-style-number>+      <text:list-level-style-bullet text:level="4"+      text:style-name="Numbering_20_Symbols" text:bullet-char="•">+        <style:list-level-properties text:space-before="0.6319in"+        text:min-label-width="0.1555in" />+        <style:text-properties style:font-name="StarSymbol" />+      </text:list-level-style-bullet>+      <text:list-level-style-bullet text:level="5"+      text:style-name="Numbering_20_Symbols" text:bullet-char="•">+        <style:list-level-properties text:space-before="0.7874in"+        text:min-label-width="0.1555in" />+        <style:text-properties style:font-name="StarSymbol" />+      </text:list-level-style-bullet>+      <text:list-level-style-bullet text:level="6"+      text:style-name="Numbering_20_Symbols" text:bullet-char="•">+        <style:list-level-properties text:space-before="0.9429in"+        text:min-label-width="0.1555in" />+        <style:text-properties style:font-name="StarSymbol" />+      </text:list-level-style-bullet>+      <text:list-level-style-bullet text:level="7"+      text:style-name="Numbering_20_Symbols" text:bullet-char="•">+        <style:list-level-properties text:space-before="1.0988in"+        text:min-label-width="0.1555in" />+        <style:text-properties style:font-name="StarSymbol" />+      </text:list-level-style-bullet>+      <text:list-level-style-bullet text:level="8"+      text:style-name="Numbering_20_Symbols" text:bullet-char="•">+        <style:list-level-properties text:space-before="1.2543in"+        text:min-label-width="0.1555in" />+        <style:text-properties style:font-name="StarSymbol" />+      </text:list-level-style-bullet>+      <text:list-level-style-bullet text:level="9"+      text:style-name="Numbering_20_Symbols" text:bullet-char="•">+        <style:list-level-properties text:space-before="1.4098in"+        text:min-label-width="0.1555in" />+        <style:text-properties style:font-name="StarSymbol" />+      </text:list-level-style-bullet>+      <text:list-level-style-bullet text:level="10"+      text:style-name="Numbering_20_Symbols" text:bullet-char="•">+        <style:list-level-properties text:space-before="1.5654in"+        text:min-label-width="0.1555in" />+        <style:text-properties style:font-name="StarSymbol" />+      </text:list-level-style-bullet>+    </text:list-style>+    <text:list-style style:name="List_20_1"+    style:display-name="List 1">+      <text:list-level-style-bullet text:level="1"+      text:style-name="Numbering_20_Symbols" text:bullet-char="•">+        <style:list-level-properties text:min-label-width="0.1575in" />+        <style:text-properties style:font-name="StarSymbol" />+      </text:list-level-style-bullet>+      <text:list-level-style-bullet text:level="2"+      text:style-name="Numbering_20_Symbols" text:bullet-char="•">+        <style:list-level-properties text:space-before="0.1579in"+        text:min-label-width="0.1575in" />+        <style:text-properties style:font-name="StarSymbol" />+      </text:list-level-style-bullet>+      <text:list-level-style-bullet text:level="3"+      text:style-name="Numbering_20_Symbols" text:bullet-char="•">+        <style:list-level-properties text:space-before="0.3146in"+        text:min-label-width="0.1575in" />+        <style:text-properties style:font-name="StarSymbol" />+      </text:list-level-style-bullet>+      <text:list-level-style-bullet text:level="4"+      text:style-name="Numbering_20_Symbols" text:bullet-char="•">+        <style:list-level-properties text:space-before="0.4724in"+        text:min-label-width="0.1575in" />+        <style:text-properties style:font-name="StarSymbol" />+      </text:list-level-style-bullet>+      <text:list-level-style-bullet text:level="5"+      text:style-name="Numbering_20_Symbols" text:bullet-char="•">+        <style:list-level-properties text:space-before="0.6299in"+        text:min-label-width="0.1575in" />+        <style:text-properties style:font-name="StarSymbol" />+      </text:list-level-style-bullet>+      <text:list-level-style-bullet text:level="6"+      text:style-name="Numbering_20_Symbols" text:bullet-char="•">+        <style:list-level-properties text:space-before="0.7878in"+        text:min-label-width="0.1575in" />+        <style:text-properties style:font-name="StarSymbol" />+      </text:list-level-style-bullet>+      <text:list-level-style-bullet text:level="7"+      text:style-name="Numbering_20_Symbols" text:bullet-char="•">+        <style:list-level-properties text:space-before="0.9445in"+        text:min-label-width="0.1575in" />+        <style:text-properties style:font-name="StarSymbol" />+      </text:list-level-style-bullet>+      <text:list-level-style-bullet text:level="8"+      text:style-name="Numbering_20_Symbols" text:bullet-char="•">+        <style:list-level-properties text:space-before="1.1024in"+        text:min-label-width="0.1575in" />+        <style:text-properties style:font-name="StarSymbol" />+      </text:list-level-style-bullet>+      <text:list-level-style-bullet text:level="9"+      text:style-name="Numbering_20_Symbols" text:bullet-char="•">+        <style:list-level-properties text:space-before="1.2598in"+        text:min-label-width="0.1575in" />+        <style:text-properties style:font-name="StarSymbol" />+      </text:list-level-style-bullet>+      <text:list-level-style-bullet text:level="10"+      text:style-name="Numbering_20_Symbols" text:bullet-char="•">+        <style:list-level-properties text:space-before="1.4177in"+        text:min-label-width="0.1575in" />+        <style:text-properties style:font-name="StarSymbol" />+      </text:list-level-style-bullet>+    </text:list-style>+    <text:list-style style:name="List_20_2"+    style:display-name="List 2">+      <text:list-level-style-bullet text:level="1"+      text:style-name="Numbering_20_Symbols" text:bullet-char="–">+        <style:list-level-properties text:min-label-width="0.1181in" />+        <style:text-properties style:font-name="StarSymbol" />+      </text:list-level-style-bullet>+      <text:list-level-style-bullet text:level="2"+      text:style-name="Numbering_20_Symbols" text:bullet-char="–">+        <style:list-level-properties text:space-before="0.1181in"+        text:min-label-width="0.1181in" />+        <style:text-properties style:font-name="StarSymbol" />+      </text:list-level-style-bullet>+      <text:list-level-style-bullet text:level="3"+      text:style-name="Numbering_20_Symbols" text:bullet-char="–">+        <style:list-level-properties text:space-before="0.2362in"+        text:min-label-width="0.1181in" />+        <style:text-properties style:font-name="StarSymbol" />+      </text:list-level-style-bullet>+      <text:list-level-style-bullet text:level="4"+      text:style-name="Numbering_20_Symbols" text:bullet-char="–">+        <style:list-level-properties text:space-before="0.3539in"+        text:min-label-width="0.1181in" />+        <style:text-properties style:font-name="StarSymbol" />+      </text:list-level-style-bullet>+      <text:list-level-style-bullet text:level="5"+      text:style-name="Numbering_20_Symbols" text:bullet-char="–">+        <style:list-level-properties text:space-before="0.472in"+        text:min-label-width="0.1181in" />+        <style:text-properties style:font-name="StarSymbol" />+      </text:list-level-style-bullet>+      <text:list-level-style-bullet text:level="6"+      text:style-name="Numbering_20_Symbols" text:bullet-char="–">+        <style:list-level-properties text:space-before="0.5902in"+        text:min-label-width="0.1181in" />+        <style:text-properties style:font-name="StarSymbol" />+      </text:list-level-style-bullet>+      <text:list-level-style-bullet text:level="7"+      text:style-name="Numbering_20_Symbols" text:bullet-char="–">+        <style:list-level-properties text:space-before="0.7091in"+        text:min-label-width="0.1181in" />+        <style:text-properties style:font-name="StarSymbol" />+      </text:list-level-style-bullet>+      <text:list-level-style-bullet text:level="8"+      text:style-name="Numbering_20_Symbols" text:bullet-char="–">+        <style:list-level-properties text:space-before="0.8272in"+        text:min-label-width="0.1181in" />+        <style:text-properties style:font-name="StarSymbol" />+      </text:list-level-style-bullet>+      <text:list-level-style-bullet text:level="9"+      text:style-name="Numbering_20_Symbols" text:bullet-char="–">+        <style:list-level-properties text:space-before="0.9453in"+        text:min-label-width="0.1181in" />+        <style:text-properties style:font-name="StarSymbol" />+      </text:list-level-style-bullet>+      <text:list-level-style-bullet text:level="10"+      text:style-name="Numbering_20_Symbols" text:bullet-char="–">+        <style:list-level-properties text:space-before="1.063in"+        text:min-label-width="0.1181in" />+        <style:text-properties style:font-name="StarSymbol" />+      </text:list-level-style-bullet>+    </text:list-style>+    <text:list-style style:name="List_20_3"+    style:display-name="List 3">+      <text:list-level-style-bullet text:level="1"+      text:style-name="Numbering_20_Symbols" text:bullet-char="☑">+        <style:list-level-properties text:min-label-width="0.1555in" />+        <style:text-properties style:font-name="StarSymbol" />+      </text:list-level-style-bullet>+      <text:list-level-style-bullet text:level="2"+      text:style-name="Numbering_20_Symbols" text:bullet-char="□">+        <style:list-level-properties text:space-before="0.1555in"+        text:min-label-width="0.1555in" />+        <style:text-properties style:font-name="StarSymbol" />+      </text:list-level-style-bullet>+      <text:list-level-style-bullet text:level="3"+      text:style-name="Numbering_20_Symbols" text:bullet-char="☑">+        <style:list-level-properties text:min-label-width="0.1555in" />+        <style:text-properties style:font-name="StarSymbol" />+      </text:list-level-style-bullet>+      <text:list-level-style-bullet text:level="4"+      text:style-name="Numbering_20_Symbols" text:bullet-char="□">+        <style:list-level-properties text:space-before="0.1555in"+        text:min-label-width="0.1555in" />+        <style:text-properties style:font-name="StarSymbol" />+      </text:list-level-style-bullet>+      <text:list-level-style-bullet text:level="5"+      text:style-name="Numbering_20_Symbols" text:bullet-char="☑">+        <style:list-level-properties text:min-label-width="0.1555in" />+        <style:text-properties style:font-name="StarSymbol" />+      </text:list-level-style-bullet>+      <text:list-level-style-bullet text:level="6"+      text:style-name="Numbering_20_Symbols" text:bullet-char="□">+        <style:list-level-properties text:space-before="0.1555in"+        text:min-label-width="0.1555in" />+        <style:text-properties style:font-name="StarSymbol" />+      </text:list-level-style-bullet>+      <text:list-level-style-bullet text:level="7"+      text:style-name="Numbering_20_Symbols" text:bullet-char="☑">+        <style:list-level-properties text:min-label-width="0.1555in" />+        <style:text-properties style:font-name="StarSymbol" />+      </text:list-level-style-bullet>+      <text:list-level-style-bullet text:level="8"+      text:style-name="Numbering_20_Symbols" text:bullet-char="□">+        <style:list-level-properties text:space-before="0.1555in"+        text:min-label-width="0.1555in" />+        <style:text-properties style:font-name="StarSymbol" />+      </text:list-level-style-bullet>+      <text:list-level-style-bullet text:level="9"+      text:style-name="Numbering_20_Symbols" text:bullet-char="☑">+        <style:list-level-properties text:min-label-width="0.1555in" />+        <style:text-properties style:font-name="StarSymbol" />+      </text:list-level-style-bullet>+      <text:list-level-style-bullet text:level="10"+      text:style-name="Numbering_20_Symbols" text:bullet-char="□">+        <style:list-level-properties text:space-before="0.1555in"+        text:min-label-width="0.1555in" />+        <style:text-properties style:font-name="StarSymbol" />+      </text:list-level-style-bullet>+    </text:list-style>+    <text:list-style style:name="List_20_4"+    style:display-name="List 4">+      <text:list-level-style-bullet text:level="1"+      text:style-name="Numbering_20_Symbols" text:bullet-char="➢">+        <style:list-level-properties text:min-label-width="0.1575in" />+        <style:text-properties style:font-name="StarSymbol" />+      </text:list-level-style-bullet>+      <text:list-level-style-bullet text:level="2"+      text:style-name="Numbering_20_Symbols" text:bullet-char="">+        <style:list-level-properties text:space-before="0.1579in"+        text:min-label-width="0.1575in" />+        <style:text-properties style:font-name="StarSymbol" />+      </text:list-level-style-bullet>+      <text:list-level-style-bullet text:level="3"+      text:style-name="Numbering_20_Symbols" text:bullet-char="">+        <style:list-level-properties text:space-before="0.3146in"+        text:min-label-width="0.1575in" />+        <style:text-properties style:font-name="StarSymbol" />+      </text:list-level-style-bullet>+      <text:list-level-style-bullet text:level="4"+      text:style-name="Numbering_20_Symbols" text:bullet-char="">+        <style:list-level-properties text:space-before="0.4724in"+        text:min-label-width="0.1575in" />+        <style:text-properties style:font-name="StarSymbol" />+      </text:list-level-style-bullet>+      <text:list-level-style-bullet text:level="5"+      text:style-name="Numbering_20_Symbols" text:bullet-char="">+        <style:list-level-properties text:space-before="0.6299in"+        text:min-label-width="0.1575in" />+        <style:text-properties style:font-name="StarSymbol" />+      </text:list-level-style-bullet>+      <text:list-level-style-bullet text:level="6"+      text:style-name="Numbering_20_Symbols" text:bullet-char="">+        <style:list-level-properties text:space-before="0.7878in"+        text:min-label-width="0.1575in" />+        <style:text-properties style:font-name="StarSymbol" />+      </text:list-level-style-bullet>+      <text:list-level-style-bullet text:level="7"+      text:style-name="Numbering_20_Symbols" text:bullet-char="">+        <style:list-level-properties text:space-before="0.9445in"+        text:min-label-width="0.1575in" />+        <style:text-properties style:font-name="StarSymbol" />+      </text:list-level-style-bullet>+      <text:list-level-style-bullet text:level="8"+      text:style-name="Numbering_20_Symbols" text:bullet-char="">+        <style:list-level-properties text:space-before="1.1024in"+        text:min-label-width="0.1575in" />+        <style:text-properties style:font-name="StarSymbol" />+      </text:list-level-style-bullet>+      <text:list-level-style-bullet text:level="9"+      text:style-name="Numbering_20_Symbols" text:bullet-char="">+        <style:list-level-properties text:space-before="1.2598in"+        text:min-label-width="0.1575in" />+        <style:text-properties style:font-name="StarSymbol" />+      </text:list-level-style-bullet>+      <text:list-level-style-bullet text:level="10"+      text:style-name="Numbering_20_Symbols" text:bullet-char="">+        <style:list-level-properties text:space-before="1.4177in"+        text:min-label-width="0.1575in" />+        <style:text-properties style:font-name="StarSymbol" />+      </text:list-level-style-bullet>+    </text:list-style>+    <text:list-style style:name="List_20_5"+    style:display-name="List 5">+      <text:list-level-style-bullet text:level="1"+      text:style-name="Numbering_20_Symbols" text:bullet-char="✗">+        <style:list-level-properties text:min-label-width="0.1575in" />+        <style:text-properties style:font-name="StarSymbol" />+      </text:list-level-style-bullet>+      <text:list-level-style-bullet text:level="2"+      text:style-name="Numbering_20_Symbols" text:bullet-char="✗">+        <style:list-level-properties text:space-before="0.1579in"+        text:min-label-width="0.1575in" />+        <style:text-properties style:font-name="StarSymbol" />+      </text:list-level-style-bullet>+      <text:list-level-style-bullet text:level="3"+      text:style-name="Numbering_20_Symbols" text:bullet-char="✗">+        <style:list-level-properties text:space-before="0.3146in"+        text:min-label-width="0.1575in" />+        <style:text-properties style:font-name="StarSymbol" />+      </text:list-level-style-bullet>+      <text:list-level-style-bullet text:level="4"+      text:style-name="Numbering_20_Symbols" text:bullet-char="✗">+        <style:list-level-properties text:space-before="0.4724in"+        text:min-label-width="0.1575in" />+        <style:text-properties style:font-name="StarSymbol" />+      </text:list-level-style-bullet>+      <text:list-level-style-bullet text:level="5"+      text:style-name="Numbering_20_Symbols" text:bullet-char="✗">+        <style:list-level-properties text:space-before="0.6299in"+        text:min-label-width="0.1575in" />+        <style:text-properties style:font-name="StarSymbol" />+      </text:list-level-style-bullet>+      <text:list-level-style-bullet text:level="6"+      text:style-name="Numbering_20_Symbols" text:bullet-char="✗">+        <style:list-level-properties text:space-before="0.7878in"+        text:min-label-width="0.1575in" />+        <style:text-properties style:font-name="StarSymbol" />+      </text:list-level-style-bullet>+      <text:list-level-style-bullet text:level="7"+      text:style-name="Numbering_20_Symbols" text:bullet-char="✗">+        <style:list-level-properties text:space-before="0.9445in"+        text:min-label-width="0.1575in" />+        <style:text-properties style:font-name="StarSymbol" />+      </text:list-level-style-bullet>+      <text:list-level-style-bullet text:level="8"+      text:style-name="Numbering_20_Symbols" text:bullet-char="✗">+        <style:list-level-properties text:space-before="1.1024in"+        text:min-label-width="0.1575in" />+        <style:text-properties style:font-name="StarSymbol" />+      </text:list-level-style-bullet>+      <text:list-level-style-bullet text:level="9"+      text:style-name="Numbering_20_Symbols" text:bullet-char="✗">+        <style:list-level-properties text:space-before="1.2598in"+        text:min-label-width="0.1575in" />+        <style:text-properties style:font-name="StarSymbol" />+      </text:list-level-style-bullet>+      <text:list-level-style-bullet text:level="10"+      text:style-name="Numbering_20_Symbols" text:bullet-char="✗">+        <style:list-level-properties text:space-before="1.4177in"+        text:min-label-width="0.1575in" />+        <style:text-properties style:font-name="StarSymbol" />+      </text:list-level-style-bullet>+    </text:list-style>+    <text:notes-configuration text:note-class="footnote"+    text:citation-style-name="Footnote_20_Symbol"+    text:citation-body-style-name="Footnote_20_anchor"+    style:num-format="1" text:start-value="0"+    text:footnotes-position="page"+    text:start-numbering-at="document" />+    <text:notes-configuration text:note-class="endnote"+    style:num-format="i" text:start-value="0" />+    <text:linenumbering-configuration text:number-lines="false"+    text:offset="0.1965in" style:num-format="1"+    text:number-position="left" text:increment="5" />+  </office:styles>+  <office:automatic-styles>+    <style:style style:name="MP1" style:family="paragraph"+    style:parent-style-name="Footer">+      <style:paragraph-properties fo:text-align="center"+      style:justify-single-word="false" />+    </style:style>+    <style:page-layout style:name="Mpm1">+      <style:page-layout-properties fo:page-width="8.5in"+      fo:page-height="11in" style:num-format="1"+      style:print-orientation="portrait" fo:margin-top="1in"+      fo:margin-bottom="1in" fo:margin-left="1in"+      fo:margin-right="1in" style:writing-mode="lr-tb"+      style:footnote-max-height="0in">+        <style:footnote-sep style:width="0.0071in"+        style:distance-before-sep="0.0398in"+        style:distance-after-sep="0.0398in" style:line-style="none"+        style:adjustment="left" style:rel-width="25%"+        style:color="#000000" />+      </style:page-layout-properties>+      <style:header-style />+      <style:footer-style>+        <style:header-footer-properties fo:min-height="0.4in"+        fo:margin-left="0in" fo:margin-right="0in"+        fo:margin-top="0.2in" style:dynamic-spacing="false" />+      </style:footer-style>+    </style:page-layout>+  </office:automatic-styles>+  <office:master-styles>+    <style:master-page style:name="Standard"+    style:page-layout-name="Mpm1">+      <style:footer>+        <text:p text:style-name="MP1">+          <text:page-number text:select-page="current">+          1</text:page-number>+        </text:p>+      </style:footer>+    </style:master-page>+  </office:master-styles>+</office:document-styles>
data/reference.docx view

binary file changed (8619 → 8881 bytes)

data/reference.odt view

binary file changed (10890 → 9643 bytes)

data/templates/default.beamer view
@@ -42,9 +42,9 @@ $endif$ $if(biblatex)$ \usepackage{biblatex}-$if(biblio-files)$-\bibliography{$biblio-files$}-$endif$+$for(bibliography)$+\addbibresource{$bibliography$}+$endfor$ $endif$ $if(listings)$ \usepackage{listings}@@ -107,6 +107,8 @@ \setlength{\parindent}{0pt} \setlength{\parskip}{6pt plus 2pt minus 1pt} \setlength{\emergencystretch}{3em}  % prevent overfull lines+\providecommand{\tightlist}{%+  \setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}} $if(numbersections)$ $else$ \setcounter{secnumdepth}{0}@@ -115,7 +117,13 @@ \VerbatimFootnotes % allows verbatim text in footnotes $endif$ $if(lang)$-\usepackage[$lang$]{babel}+\ifxetex+  \usepackage{polyglossia}+  \setmainlanguage{$mainlang$}+  \setotherlanguages{$for(otherlang)$$otherlang$$sep$,$endfor$}+\else+  \usepackage[shorthands=off,$lang$]{babel}+\fi $endif$ $for(header-includes)$ $header-includes$@@ -150,7 +158,7 @@ $body$  $if(natbib)$-$if(biblio-files)$+$if(bibliography)$ $if(biblio-title)$ $if(book-class)$ \renewcommand\bibname{$biblio-title$}@@ -159,7 +167,7 @@ $endif$ $endif$ \begin{frame}[allowframebreaks]{$biblio-title$}-\bibliography{$biblio-files$}+\bibliography{$for(bibliography)$$bibliography$$sep$,$endfor$} \end{frame}  $endif$
data/templates/default.epub view
@@ -14,6 +14,9 @@ $for(css)$   <link rel="stylesheet" type="text/css" href="$css$" /> $endfor$+$for(header-includes)$+  $header-includes$+$endfor$ </head> <body$if(coverpage)$ id="cover"$endif$> $if(titlepage)$@@ -40,10 +43,16 @@   <p class="date">$date$</p> $endif$ $if(rights)$-  <p class="rights">$rights$</p>+  <div class="rights">$rights$</div> $endif$ $else$+$for(include-before)$+$include-before$+$endfor$ $body$+$for(include-after)$+$include-after$+$endfor$ $endif$ </body> </html>
data/templates/default.epub3 view
@@ -18,6 +18,9 @@ $for(css)$   <link rel="stylesheet" type="text/css" href="$css$" /> $endfor$+$for(header-includes)$+  $header-includes$+$endfor$ </head> <body$if(coverpage)$ id="cover"$endif$> $if(titlepage)$@@ -45,11 +48,17 @@   <p class="date">$date$</p> $endif$ $if(rights)$-  <p class="rights">$rights$</p>+  <div class="rights">$rights$</div> $endif$ </section> $else$+$for(include-before)$+$include-before$+$endfor$ $body$+$for(include-after)$+$include-after$+$endfor$ $endif$ </body> </html>
data/templates/default.latex view
@@ -49,10 +49,28 @@ $if(geometry)$ \usepackage[$for(geometry)$$geometry$$sep$,$endfor$]{geometry} $endif$+\ifxetex+  \usepackage[setpagesize=false, % page size defined by xetex+              unicode=false, % unicode breaks when used with xetex+              xetex]{hyperref}+\else+  \usepackage[unicode=true]{hyperref}+\fi+\hypersetup{breaklinks=true,+            bookmarks=true,+            pdfauthor={$author-meta$},+            pdftitle={$title-meta$},+            colorlinks=true,+            citecolor=$if(citecolor)$$citecolor$$else$blue$endif$,+            urlcolor=$if(urlcolor)$$urlcolor$$else$blue$endif$,+            linkcolor=$if(linkcolor)$$linkcolor$$else$magenta$endif$,+            pdfborder={0 0 0}}+\urlstyle{same}  % don't use monospace font for urls $if(lang)$ \ifxetex   \usepackage{polyglossia}   \setmainlanguage{$mainlang$}+  \setotherlanguages{$for(otherlang)$$otherlang$$sep$,$endfor$} \else   \usepackage[shorthands=off,$lang$]{babel} \fi@@ -63,9 +81,9 @@ $endif$ $if(biblatex)$ \usepackage{biblatex}-$if(biblio-files)$-\bibliography{$biblio-files$}-$endif$+$for(bibliography)$+\addbibresource{$bibliography$}+$endfor$ $endif$ $if(listings)$ \usepackage{listings}@@ -84,7 +102,7 @@ \usepackage{longtable,booktabs} $endif$ $if(graphics)$-\usepackage{graphicx}+\usepackage{graphicx,grffile} \makeatletter \def\maxwidth{\ifdim\Gin@nat@width>\linewidth\linewidth\else\Gin@nat@width\fi} \def\maxheight{\ifdim\Gin@nat@height>\textheight\textheight\else\Gin@nat@height\fi}@@ -94,23 +112,6 @@ % using explicit options in \includegraphics[width, height, ...]{} \setkeys{Gin}{width=\maxwidth,height=\maxheight,keepaspectratio} $endif$-\ifxetex-  \usepackage[setpagesize=false, % page size defined by xetex-              unicode=false, % unicode breaks when used with xetex-              xetex]{hyperref}-\else-  \usepackage[unicode=true]{hyperref}-\fi-\hypersetup{breaklinks=true,-            bookmarks=true,-            pdfauthor={$author-meta$},-            pdftitle={$title-meta$},-            colorlinks=true,-            citecolor=$if(citecolor)$$citecolor$$else$blue$endif$,-            urlcolor=$if(urlcolor)$$urlcolor$$else$blue$endif$,-            linkcolor=$if(linkcolor)$$linkcolor$$else$magenta$endif$,-            pdfborder={0 0 0}}-\urlstyle{same}  % don't use monospace font for urls $if(links-as-notes)$ % Make links footnotes instead of hotlinks: \renewcommand{\href}[2]{#2\footnote{\url{#1}}}@@ -123,6 +124,8 @@ \setlength{\parindent}{0pt} \setlength{\parskip}{6pt plus 2pt minus 1pt} \setlength{\emergencystretch}{3em}  % prevent overfull lines+\providecommand{\tightlist}{%+  \setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}} $if(numbersections)$ \setcounter{secnumdepth}{5} $else$@@ -143,6 +146,16 @@ $header-includes$ $endfor$ +% Redefines (sub)paragraphs to behave more like sections+\ifx\paragraph\undefined\else+\let\oldparagraph\paragraph+\renewcommand{\paragraph}[1]{\oldparagraph{#1}\mbox{}}+\fi+\ifx\subparagraph\undefined\else+\let\oldsubparagraph\subparagraph+\renewcommand{\subparagraph}[1]{\oldsubparagraph{#1}\mbox{}}+\fi+ \begin{document} $if(title)$ \maketitle@@ -159,7 +172,7 @@ $endfor$ $if(toc)$ {-\hypersetup{linkcolor=black}+\hypersetup{linkcolor=$if(toccolor)$$toccolor$$else$black$endif$} \setcounter{tocdepth}{$toc-depth$} \tableofcontents }@@ -173,7 +186,7 @@ $body$  $if(natbib)$-$if(biblio-files)$+$if(bibliography)$ $if(biblio-title)$ $if(book-class)$ \renewcommand\bibname{$biblio-title$}@@ -181,7 +194,7 @@ \renewcommand\refname{$biblio-title$} $endif$ $endif$-\bibliography{$biblio-files$}+\bibliography{$for(bibliography)$$bibliography$$sep$,$endfor$}  $endif$ $endif$
data/templates/default.opendocument view
@@ -10,7 +10,7 @@ <office:body> <office:text> $if(title)$-<text:h text:style-name="Title">$title$</text:h>+<text:p text:style-name="Title">$title$</text:p> $endif$ $for(author)$ <text:p text:style-name="Author">$author$</text:p>
data/templates/default.revealjs view
@@ -13,38 +13,39 @@   <meta name="apple-mobile-web-app-capable" content="yes" />   <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />   <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">-  <link rel="stylesheet" href="$revealjs-url$/css/reveal.min.css"/>-    <style type="text/css">code{white-space: pre;}</style>+  <link rel="stylesheet" href="$revealjs-url$/css/reveal.css"/>+  <style type="text/css">code{white-space: pre;}</style> $if(highlighting-css)$-    <style type="text/css">+  <style type="text/css"> $highlighting-css$-    </style>+  </style> $endif$-$if(css)$-$for(css)$-    <link rel="stylesheet" href="$css$"/>-$endfor$+$if(theme)$+  <link rel="stylesheet" href="$revealjs-url$/css/theme/$theme$.css" id="theme"> $else$-    <link rel="stylesheet" href="$revealjs-url$/css/theme/simple.css" id="theme">+  <link rel="stylesheet" href="$revealjs-url$/css/theme/black.css" id="theme"> $endif$-    <!-- If the query includes 'print-pdf', include the PDF print sheet -->-    <script>-      if( window.location.search.match( /print-pdf/gi ) ) {-        var link = document.createElement( 'link' );-        link.rel = 'stylesheet';-        link.type = 'text/css';-        link.href = '$revealjs-url$/css/print/pdf.css';-        document.getElementsByTagName( 'head' )[0].appendChild( link );-      }-    </script>-    <!--[if lt IE 9]>-    <script src="$revealjs-url$/lib/js/html5shiv.js"></script>-    <![endif]-->+$for(css)$+  <link rel="stylesheet" href="$css$"/>+$endfor$+  <!-- If the query includes 'print-pdf', include the PDF print sheet -->+  <script>+    if( window.location.search.match( /print-pdf/gi ) ) {+      var link = document.createElement( 'link' );+      link.rel = 'stylesheet';+      link.type = 'text/css';+      link.href = '$revealjs-url$/css/print/pdf.css';+      document.getElementsByTagName( 'head' )[0].appendChild( link );+    }+  </script>+  <!--[if lt IE 9]>+  <script src="$revealjs-url$/lib/js/html5shiv.js"></script>+  <![endif]--> $if(math)$-    $math$+  $math$ $endif$ $for(header-includes)$-    $header-includes$+  $header-includes$ $endfor$ </head> <body>@@ -78,17 +79,19 @@     <script src="$revealjs-url$/lib/js/head.min.js"></script>-  <script src="$revealjs-url$/js/reveal.min.js"></script>+  <script src="$revealjs-url$/js/reveal.js"></script>    <script>        // Full list of configuration options available here:       // https://github.com/hakimel/reveal.js#configuration       Reveal.initialize({-        controls: true,-        progress: true,-        history: true,-        center: true,+        controls: true,         // Display controls in the bottom right corner+        progress: true,         // Display a presentation progress bar+        history: true,          // Push each slide change to the browser history+        center: $if(center)$$center$$else$false$endif$,                       // Vertical centering of slides+        maxScale: $if(maxScale)$$maxScale$$else$1.5$endif$,                  // Bounds for smallest/largest possible content scale+        slideNumber: $if(slideNumber)$true$else$false$endif$,                // Display the page number of the current slide         theme: $if(theme)$'$theme$'$else$Reveal.getQueryHash().theme$endif$, // available themes are in /css/theme         transition: $if(transition)$'$transition$'$else$Reveal.getQueryHash().transition || 'default'$endif$, // default/cube/page/concave/zoom/linear/fade/none 
data/templates/default.rst view
@@ -21,6 +21,12 @@ ..  $endif$+$if(rawtex)$+.. role:: raw-latex(raw)+   :format: latex+..++$endif$ $for(include-before)$ $include-before$ 
− dist/build/Text/Pandoc/Data.hs
@@ -1,8 +0,0 @@-# 1 "src/Text/Pandoc/Data.hsb"-{-# LANGUAGE OverloadedStrings #-}--- to be processed using hsb2hs-module Text.Pandoc.Data (dataFiles) where-import qualified Data.ByteString as B--dataFiles :: [(FilePath, B.ByteString)]-dataFiles = [("LaTeXMathML.js","/*\nLaTeXMathML.js from http://math.etsu.edu/LaTeXMathML/\nAdapted by Jeff Knisely and Douglas Woodall from ASCIIMathML.js v. 1.4.7,\n(c) 2005 Peter Jipsen http://www.chapman.edu/~jipsen.\nReleased under the GNU General Public License version 2 or later.\nSee the GNU General Public License (at http://www.gnu.org/copyleft/gpl.html)\nfor more details.\n*/\nvar checkForMathML=true;var notifyIfNoMathML=true;var alertIfNoMathML=false;var mathcolor=\"\";var mathfontfamily=\"\";var showasciiformulaonhover=true;var isIE=document.createElementNS==null;if(document.getElementById==null)\nalert(\"This webpage requires a recent browser such as \\nMozilla/Netscape 7+ or Internet Explorer 6+MathPlayer\")\nfunction AMcreateElementXHTML(t){if(isIE)return document.createElement(t);else return document.createElementNS(\"http://www.w3.org/1999/xhtml\",t);}\nfunction AMnoMathMLNote(){var nd=AMcreateElementXHTML(\"h3\");nd.setAttribute(\"align\",\"center\")\nnd.appendChild(AMcreateElementXHTML(\"p\"));nd.appendChild(document.createTextNode(\"To view the \"));var an=AMcreateElementXHTML(\"a\");an.appendChild(document.createTextNode(\"LaTeXMathML\"));an.setAttribute(\"href\",\"http://www.maths.nott.ac.uk/personal/drw/lm.html\");nd.appendChild(an);nd.appendChild(document.createTextNode(\" notation use Internet Explorer 6+\"));an=AMcreateElementXHTML(\"a\");an.appendChild(document.createTextNode(\"MathPlayer\"));an.setAttribute(\"href\",\"http://www.dessci.com/en/products/mathplayer/download.htm\");nd.appendChild(an);nd.appendChild(document.createTextNode(\" or Netscape/Mozilla/Firefox\"));nd.appendChild(AMcreateElementXHTML(\"p\"));return nd;}\nfunction AMisMathMLavailable(){if(navigator.appName.slice(0,8)==\"Netscape\")\nif(navigator.appVersion.slice(0,1)>=\"5\")return null;else return AMnoMathMLNote();else if(navigator.appName.slice(0,9)==\"Microsoft\")\ntry{var ActiveX=new ActiveXObject(\"MathPlayer.Factory.1\");return null;}catch(e){return AMnoMathMLNote();}\nelse return AMnoMathMLNote();}\nvar AMcal=[0xEF35,0x212C,0xEF36,0xEF37,0x2130,0x2131,0xEF38,0x210B,0x2110,0xEF39,0xEF3A,0x2112,0x2133,0xEF3B,0xEF3C,0xEF3D,0xEF3E,0x211B,0xEF3F,0xEF40,0xEF41,0xEF42,0xEF43,0xEF44,0xEF45,0xEF46];var AMfrk=[0xEF5D,0xEF5E,0x212D,0xEF5F,0xEF60,0xEF61,0xEF62,0x210C,0x2111,0xEF63,0xEF64,0xEF65,0xEF66,0xEF67,0xEF68,0xEF69,0xEF6A,0x211C,0xEF6B,0xEF6C,0xEF6D,0xEF6E,0xEF6F,0xEF70,0xEF71,0x2128];var AMbbb=[0xEF8C,0xEF8D,0x2102,0xEF8E,0xEF8F,0xEF90,0xEF91,0x210D,0xEF92,0xEF93,0xEF94,0xEF95,0xEF96,0x2115,0xEF97,0x2119,0x211A,0x211D,0xEF98,0xEF99,0xEF9A,0xEF9B,0xEF9C,0xEF9D,0xEF9E,0x2124];var CONST=0,UNARY=1,BINARY=2,INFIX=3,LEFTBRACKET=4,RIGHTBRACKET=5,SPACE=6,UNDEROVER=7,DEFINITION=8,TEXT=9,BIG=10,LONG=11,STRETCHY=12,MATRIX=13;var AMsqrt={input:\"\\\\sqrt\",tag:\"msqrt\",output:\"sqrt\",ttype:UNARY},AMroot={input:\"\\\\root\",tag:\"mroot\",output:\"root\",ttype:BINARY},AMfrac={input:\"\\\\frac\",tag:\"mfrac\",output:\"/\",ttype:BINARY},AMover={input:\"\\\\stackrel\",tag:\"mover\",output:\"stackrel\",ttype:BINARY},AMatop={input:\"\\\\atop\",tag:\"mfrac\",output:\"\",ttype:INFIX},AMchoose={input:\"\\\\choose\",tag:\"mfrac\",output:\"\",ttype:INFIX},AMsub={input:\"_\",tag:\"msub\",output:\"_\",ttype:INFIX},AMsup={input:\"^\",tag:\"msup\",output:\"^\",ttype:INFIX},AMtext={input:\"\\\\mathrm\",tag:\"mtext\",output:\"text\",ttype:TEXT},AMmbox={input:\"\\\\mbox\",tag:\"mtext\",output:\"mbox\",ttype:TEXT};var AMsymbols=[{input:\"\\\\alpha\",tag:\"mi\",output:\"\\u03B1\",ttype:CONST},{input:\"\\\\beta\",tag:\"mi\",output:\"\\u03B2\",ttype:CONST},{input:\"\\\\gamma\",tag:\"mi\",output:\"\\u03B3\",ttype:CONST},{input:\"\\\\delta\",tag:\"mi\",output:\"\\u03B4\",ttype:CONST},{input:\"\\\\epsilon\",tag:\"mi\",output:\"\\u03B5\",ttype:CONST},{input:\"\\\\varepsilon\",tag:\"mi\",output:\"\\u025B\",ttype:CONST},{input:\"\\\\zeta\",tag:\"mi\",output:\"\\u03B6\",ttype:CONST},{input:\"\\\\eta\",tag:\"mi\",output:\"\\u03B7\",ttype:CONST},{input:\"\\\\theta\",tag:\"mi\",output:\"\\u03B8\",ttype:CONST},{input:\"\\\\vartheta\",tag:\"mi\",output:\"\\u03D1\",ttype:CONST},{input:\"\\\\iota\",tag:\"mi\",output:\"\\u03B9\",ttype:CONST},{input:\"\\\\kappa\",tag:\"mi\",output:\"\\u03BA\",ttype:CONST},{input:\"\\\\lambda\",tag:\"mi\",output:\"\\u03BB\",ttype:CONST},{input:\"\\\\mu\",tag:\"mi\",output:\"\\u03BC\",ttype:CONST},{input:\"\\\\nu\",tag:\"mi\",output:\"\\u03BD\",ttype:CONST},{input:\"\\\\xi\",tag:\"mi\",output:\"\\u03BE\",ttype:CONST},{input:\"\\\\pi\",tag:\"mi\",output:\"\\u03C0\",ttype:CONST},{input:\"\\\\varpi\",tag:\"mi\",output:\"\\u03D6\",ttype:CONST},{input:\"\\\\rho\",tag:\"mi\",output:\"\\u03C1\",ttype:CONST},{input:\"\\\\varrho\",tag:\"mi\",output:\"\\u03F1\",ttype:CONST},{input:\"\\\\varsigma\",tag:\"mi\",output:\"\\u03C2\",ttype:CONST},{input:\"\\\\sigma\",tag:\"mi\",output:\"\\u03C3\",ttype:CONST},{input:\"\\\\tau\",tag:\"mi\",output:\"\\u03C4\",ttype:CONST},{input:\"\\\\upsilon\",tag:\"mi\",output:\"\\u03C5\",ttype:CONST},{input:\"\\\\phi\",tag:\"mi\",output:\"\\u03C6\",ttype:CONST},{input:\"\\\\varphi\",tag:\"mi\",output:\"\\u03D5\",ttype:CONST},{input:\"\\\\chi\",tag:\"mi\",output:\"\\u03C7\",ttype:CONST},{input:\"\\\\psi\",tag:\"mi\",output:\"\\u03C8\",ttype:CONST},{input:\"\\\\omega\",tag:\"mi\",output:\"\\u03C9\",ttype:CONST},{input:\"\\\\Gamma\",tag:\"mo\",output:\"\\u0393\",ttype:CONST},{input:\"\\\\Delta\",tag:\"mo\",output:\"\\u0394\",ttype:CONST},{input:\"\\\\Theta\",tag:\"mo\",output:\"\\u0398\",ttype:CONST},{input:\"\\\\Lambda\",tag:\"mo\",output:\"\\u039B\",ttype:CONST},{input:\"\\\\Xi\",tag:\"mo\",output:\"\\u039E\",ttype:CONST},{input:\"\\\\Pi\",tag:\"mo\",output:\"\\u03A0\",ttype:CONST},{input:\"\\\\Sigma\",tag:\"mo\",output:\"\\u03A3\",ttype:CONST},{input:\"\\\\Upsilon\",tag:\"mo\",output:\"\\u03A5\",ttype:CONST},{input:\"\\\\Phi\",tag:\"mo\",output:\"\\u03A6\",ttype:CONST},{input:\"\\\\Psi\",tag:\"mo\",output:\"\\u03A8\",ttype:CONST},{input:\"\\\\Omega\",tag:\"mo\",output:\"\\u03A9\",ttype:CONST},{input:\"\\\\frac12\",tag:\"mo\",output:\"\\u00BD\",ttype:CONST},{input:\"\\\\frac14\",tag:\"mo\",output:\"\\u00BC\",ttype:CONST},{input:\"\\\\frac34\",tag:\"mo\",output:\"\\u00BE\",ttype:CONST},{input:\"\\\\frac13\",tag:\"mo\",output:\"\\u2153\",ttype:CONST},{input:\"\\\\frac23\",tag:\"mo\",output:\"\\u2154\",ttype:CONST},{input:\"\\\\frac15\",tag:\"mo\",output:\"\\u2155\",ttype:CONST},{input:\"\\\\frac25\",tag:\"mo\",output:\"\\u2156\",ttype:CONST},{input:\"\\\\frac35\",tag:\"mo\",output:\"\\u2157\",ttype:CONST},{input:\"\\\\frac45\",tag:\"mo\",output:\"\\u2158\",ttype:CONST},{input:\"\\\\frac16\",tag:\"mo\",output:\"\\u2159\",ttype:CONST},{input:\"\\\\frac56\",tag:\"mo\",output:\"\\u215A\",ttype:CONST},{input:\"\\\\frac18\",tag:\"mo\",output:\"\\u215B\",ttype:CONST},{input:\"\\\\frac38\",tag:\"mo\",output:\"\\u215C\",ttype:CONST},{input:\"\\\\frac58\",tag:\"mo\",output:\"\\u215D\",ttype:CONST},{input:\"\\\\frac78\",tag:\"mo\",output:\"\\u215E\",ttype:CONST},{input:\"\\\\pm\",tag:\"mo\",output:\"\\u00B1\",ttype:CONST},{input:\"\\\\mp\",tag:\"mo\",output:\"\\u2213\",ttype:CONST},{input:\"\\\\triangleleft\",tag:\"mo\",output:\"\\u22B2\",ttype:CONST},{input:\"\\\\triangleright\",tag:\"mo\",output:\"\\u22B3\",ttype:CONST},{input:\"\\\\cdot\",tag:\"mo\",output:\"\\u22C5\",ttype:CONST},{input:\"\\\\star\",tag:\"mo\",output:\"\\u22C6\",ttype:CONST},{input:\"\\\\ast\",tag:\"mo\",output:\"\\u002A\",ttype:CONST},{input:\"\\\\times\",tag:\"mo\",output:\"\\u00D7\",ttype:CONST},{input:\"\\\\div\",tag:\"mo\",output:\"\\u00F7\",ttype:CONST},{input:\"\\\\circ\",tag:\"mo\",output:\"\\u2218\",ttype:CONST},{input:\"\\\\bullet\",tag:\"mo\",output:\"\\u2022\",ttype:CONST},{input:\"\\\\oplus\",tag:\"mo\",output:\"\\u2295\",ttype:CONST},{input:\"\\\\ominus\",tag:\"mo\",output:\"\\u2296\",ttype:CONST},{input:\"\\\\otimes\",tag:\"mo\",output:\"\\u2297\",ttype:CONST},{input:\"\\\\bigcirc\",tag:\"mo\",output:\"\\u25CB\",ttype:CONST},{input:\"\\\\oslash\",tag:\"mo\",output:\"\\u2298\",ttype:CONST},{input:\"\\\\odot\",tag:\"mo\",output:\"\\u2299\",ttype:CONST},{input:\"\\\\land\",tag:\"mo\",output:\"\\u2227\",ttype:CONST},{input:\"\\\\wedge\",tag:\"mo\",output:\"\\u2227\",ttype:CONST},{input:\"\\\\lor\",tag:\"mo\",output:\"\\u2228\",ttype:CONST},{input:\"\\\\vee\",tag:\"mo\",output:\"\\u2228\",ttype:CONST},{input:\"\\\\cap\",tag:\"mo\",output:\"\\u2229\",ttype:CONST},{input:\"\\\\cup\",tag:\"mo\",output:\"\\u222A\",ttype:CONST},{input:\"\\\\sqcap\",tag:\"mo\",output:\"\\u2293\",ttype:CONST},{input:\"\\\\sqcup\",tag:\"mo\",output:\"\\u2294\",ttype:CONST},{input:\"\\\\uplus\",tag:\"mo\",output:\"\\u228E\",ttype:CONST},{input:\"\\\\amalg\",tag:\"mo\",output:\"\\u2210\",ttype:CONST},{input:\"\\\\bigtriangleup\",tag:\"mo\",output:\"\\u25B3\",ttype:CONST},{input:\"\\\\bigtriangledown\",tag:\"mo\",output:\"\\u25BD\",ttype:CONST},{input:\"\\\\dag\",tag:\"mo\",output:\"\\u2020\",ttype:CONST},{input:\"\\\\dagger\",tag:\"mo\",output:\"\\u2020\",ttype:CONST},{input:\"\\\\ddag\",tag:\"mo\",output:\"\\u2021\",ttype:CONST},{input:\"\\\\ddagger\",tag:\"mo\",output:\"\\u2021\",ttype:CONST},{input:\"\\\\lhd\",tag:\"mo\",output:\"\\u22B2\",ttype:CONST},{input:\"\\\\rhd\",tag:\"mo\",output:\"\\u22B3\",ttype:CONST},{input:\"\\\\unlhd\",tag:\"mo\",output:\"\\u22B4\",ttype:CONST},{input:\"\\\\unrhd\",tag:\"mo\",output:\"\\u22B5\",ttype:CONST},{input:\"\\\\sum\",tag:\"mo\",output:\"\\u2211\",ttype:UNDEROVER},{input:\"\\\\prod\",tag:\"mo\",output:\"\\u220F\",ttype:UNDEROVER},{input:\"\\\\bigcap\",tag:\"mo\",output:\"\\u22C2\",ttype:UNDEROVER},{input:\"\\\\bigcup\",tag:\"mo\",output:\"\\u22C3\",ttype:UNDEROVER},{input:\"\\\\bigwedge\",tag:\"mo\",output:\"\\u22C0\",ttype:UNDEROVER},{input:\"\\\\bigvee\",tag:\"mo\",output:\"\\u22C1\",ttype:UNDEROVER},{input:\"\\\\bigsqcap\",tag:\"mo\",output:\"\\u2A05\",ttype:UNDEROVER},{input:\"\\\\bigsqcup\",tag:\"mo\",output:\"\\u2A06\",ttype:UNDEROVER},{input:\"\\\\coprod\",tag:\"mo\",output:\"\\u2210\",ttype:UNDEROVER},{input:\"\\\\bigoplus\",tag:\"mo\",output:\"\\u2A01\",ttype:UNDEROVER},{input:\"\\\\bigotimes\",tag:\"mo\",output:\"\\u2A02\",ttype:UNDEROVER},{input:\"\\\\bigodot\",tag:\"mo\",output:\"\\u2A00\",ttype:UNDEROVER},{input:\"\\\\biguplus\",tag:\"mo\",output:\"\\u2A04\",ttype:UNDEROVER},{input:\"\\\\int\",tag:\"mo\",output:\"\\u222B\",ttype:CONST},{input:\"\\\\oint\",tag:\"mo\",output:\"\\u222E\",ttype:CONST},{input:\":=\",tag:\"mo\",output:\":=\",ttype:CONST},{input:\"\\\\lt\",tag:\"mo\",output:\"<\",ttype:CONST},{input:\"\\\\gt\",tag:\"mo\",output:\">\",ttype:CONST},{input:\"\\\\ne\",tag:\"mo\",output:\"\\u2260\",ttype:CONST},{input:\"\\\\neq\",tag:\"mo\",output:\"\\u2260\",ttype:CONST},{input:\"\\\\le\",tag:\"mo\",output:\"\\u2264\",ttype:CONST},{input:\"\\\\leq\",tag:\"mo\",output:\"\\u2264\",ttype:CONST},{input:\"\\\\leqslant\",tag:\"mo\",output:\"\\u2264\",ttype:CONST},{input:\"\\\\ge\",tag:\"mo\",output:\"\\u2265\",ttype:CONST},{input:\"\\\\geq\",tag:\"mo\",output:\"\\u2265\",ttype:CONST},{input:\"\\\\geqslant\",tag:\"mo\",output:\"\\u2265\",ttype:CONST},{input:\"\\\\equiv\",tag:\"mo\",output:\"\\u2261\",ttype:CONST},{input:\"\\\\ll\",tag:\"mo\",output:\"\\u226A\",ttype:CONST},{input:\"\\\\gg\",tag:\"mo\",output:\"\\u226B\",ttype:CONST},{input:\"\\\\doteq\",tag:\"mo\",output:\"\\u2250\",ttype:CONST},{input:\"\\\\prec\",tag:\"mo\",output:\"\\u227A\",ttype:CONST},{input:\"\\\\succ\",tag:\"mo\",output:\"\\u227B\",ttype:CONST},{input:\"\\\\preceq\",tag:\"mo\",output:\"\\u227C\",ttype:CONST},{input:\"\\\\succeq\",tag:\"mo\",output:\"\\u227D\",ttype:CONST},{input:\"\\\\subset\",tag:\"mo\",output:\"\\u2282\",ttype:CONST},{input:\"\\\\supset\",tag:\"mo\",output:\"\\u2283\",ttype:CONST},{input:\"\\\\subseteq\",tag:\"mo\",output:\"\\u2286\",ttype:CONST},{input:\"\\\\supseteq\",tag:\"mo\",output:\"\\u2287\",ttype:CONST},{input:\"\\\\sqsubset\",tag:\"mo\",output:\"\\u228F\",ttype:CONST},{input:\"\\\\sqsupset\",tag:\"mo\",output:\"\\u2290\",ttype:CONST},{input:\"\\\\sqsubseteq\",tag:\"mo\",output:\"\\u2291\",ttype:CONST},{input:\"\\\\sqsupseteq\",tag:\"mo\",output:\"\\u2292\",ttype:CONST},{input:\"\\\\sim\",tag:\"mo\",output:\"\\u223C\",ttype:CONST},{input:\"\\\\simeq\",tag:\"mo\",output:\"\\u2243\",ttype:CONST},{input:\"\\\\approx\",tag:\"mo\",output:\"\\u2248\",ttype:CONST},{input:\"\\\\cong\",tag:\"mo\",output:\"\\u2245\",ttype:CONST},{input:\"\\\\Join\",tag:\"mo\",output:\"\\u22C8\",ttype:CONST},{input:\"\\\\bowtie\",tag:\"mo\",output:\"\\u22C8\",ttype:CONST},{input:\"\\\\in\",tag:\"mo\",output:\"\\u2208\",ttype:CONST},{input:\"\\\\ni\",tag:\"mo\",output:\"\\u220B\",ttype:CONST},{input:\"\\\\owns\",tag:\"mo\",output:\"\\u220B\",ttype:CONST},{input:\"\\\\propto\",tag:\"mo\",output:\"\\u221D\",ttype:CONST},{input:\"\\\\vdash\",tag:\"mo\",output:\"\\u22A2\",ttype:CONST},{input:\"\\\\dashv\",tag:\"mo\",output:\"\\u22A3\",ttype:CONST},{input:\"\\\\models\",tag:\"mo\",output:\"\\u22A8\",ttype:CONST},{input:\"\\\\perp\",tag:\"mo\",output:\"\\u22A5\",ttype:CONST},{input:\"\\\\smile\",tag:\"mo\",output:\"\\u2323\",ttype:CONST},{input:\"\\\\frown\",tag:\"mo\",output:\"\\u2322\",ttype:CONST},{input:\"\\\\asymp\",tag:\"mo\",output:\"\\u224D\",ttype:CONST},{input:\"\\\\notin\",tag:\"mo\",output:\"\\u2209\",ttype:CONST},{input:\"\\\\begin{eqnarray}\",output:\"X\",ttype:MATRIX,invisible:true},{input:\"\\\\begin{array}\",output:\"X\",ttype:MATRIX,invisible:true},{input:\"\\\\\\\\\",output:\"}&{\",ttype:DEFINITION},{input:\"\\\\end{eqnarray}\",output:\"}}\",ttype:DEFINITION},{input:\"\\\\end{array}\",output:\"}}\",ttype:DEFINITION},{input:\"\\\\big\",tag:\"mo\",output:\"X\",atval:\"1.2\",ieval:\"2.2\",ttype:BIG},{input:\"\\\\Big\",tag:\"mo\",output:\"X\",atval:\"1.6\",ieval:\"2.6\",ttype:BIG},{input:\"\\\\bigg\",tag:\"mo\",output:\"X\",atval:\"2.2\",ieval:\"3.2\",ttype:BIG},{input:\"\\\\Bigg\",tag:\"mo\",output:\"X\",atval:\"2.9\",ieval:\"3.9\",ttype:BIG},{input:\"\\\\left\",tag:\"mo\",output:\"X\",ttype:LEFTBRACKET},{input:\"\\\\right\",tag:\"mo\",output:\"X\",ttype:RIGHTBRACKET},{input:\"{\",output:\"{\",ttype:LEFTBRACKET,invisible:true},{input:\"}\",output:\"}\",ttype:RIGHTBRACKET,invisible:true},{input:\"(\",tag:\"mo\",output:\"(\",atval:\"1\",ttype:STRETCHY},{input:\"[\",tag:\"mo\",output:\"[\",atval:\"1\",ttype:STRETCHY},{input:\"\\\\lbrack\",tag:\"mo\",output:\"[\",atval:\"1\",ttype:STRETCHY},{input:\"\\\\{\",tag:\"mo\",output:\"{\",atval:\"1\",ttype:STRETCHY},{input:\"\\\\lbrace\",tag:\"mo\",output:\"{\",atval:\"1\",ttype:STRETCHY},{input:\"\\\\langle\",tag:\"mo\",output:\"\\u2329\",atval:\"1\",ttype:STRETCHY},{input:\"\\\\lfloor\",tag:\"mo\",output:\"\\u230A\",atval:\"1\",ttype:STRETCHY},{input:\"\\\\lceil\",tag:\"mo\",output:\"\\u2308\",atval:\"1\",ttype:STRETCHY},{input:\")\",tag:\"mo\",output:\")\",rtag:\"mi\",atval:\"1\",ttype:STRETCHY},{input:\"]\",tag:\"mo\",output:\"]\",rtag:\"mi\",atval:\"1\",ttype:STRETCHY},{input:\"\\\\rbrack\",tag:\"mo\",output:\"]\",rtag:\"mi\",atval:\"1\",ttype:STRETCHY},{input:\"\\\\}\",tag:\"mo\",output:\"}\",rtag:\"mi\",atval:\"1\",ttype:STRETCHY},{input:\"\\\\rbrace\",tag:\"mo\",output:\"}\",rtag:\"mi\",atval:\"1\",ttype:STRETCHY},{input:\"\\\\rangle\",tag:\"mo\",output:\"\\u232A\",rtag:\"mi\",atval:\"1\",ttype:STRETCHY},{input:\"\\\\rfloor\",tag:\"mo\",output:\"\\u230B\",rtag:\"mi\",atval:\"1\",ttype:STRETCHY},{input:\"\\\\rceil\",tag:\"mo\",output:\"\\u2309\",rtag:\"mi\",atval:\"1\",ttype:STRETCHY},{input:\"|\",tag:\"mo\",output:\"\\u2223\",atval:\"1\",ttype:STRETCHY},{input:\"\\\\|\",tag:\"mo\",output:\"\\u2225\",atval:\"1\",ttype:STRETCHY},{input:\"\\\\vert\",tag:\"mo\",output:\"\\u2223\",atval:\"1\",ttype:STRETCHY},{input:\"\\\\Vert\",tag:\"mo\",output:\"\\u2225\",atval:\"1\",ttype:STRETCHY},{input:\"\\\\mid\",tag:\"mo\",output:\"\\u2223\",atval:\"1\",ttype:STRETCHY},{input:\"\\\\parallel\",tag:\"mo\",output:\"\\u2225\",atval:\"1\",ttype:STRETCHY},{input:\"/\",tag:\"mo\",output:\"/\",atval:\"1.01\",ttype:STRETCHY},{input:\"\\\\backslash\",tag:\"mo\",output:\"\\u2216\",atval:\"1\",ttype:STRETCHY},{input:\"\\\\setminus\",tag:\"mo\",output:\"\\\\\",ttype:CONST},{input:\"\\\\!\",tag:\"mspace\",atname:\"width\",atval:\"-0.167em\",ttype:SPACE},{input:\"\\\\,\",tag:\"mspace\",atname:\"width\",atval:\"0.167em\",ttype:SPACE},{input:\"\\\\>\",tag:\"mspace\",atname:\"width\",atval:\"0.222em\",ttype:SPACE},{input:\"\\\\:\",tag:\"mspace\",atname:\"width\",atval:\"0.222em\",ttype:SPACE},{input:\"\\\\;\",tag:\"mspace\",atname:\"width\",atval:\"0.278em\",ttype:SPACE},{input:\"~\",tag:\"mspace\",atname:\"width\",atval:\"0.333em\",ttype:SPACE},{input:\"\\\\quad\",tag:\"mspace\",atname:\"width\",atval:\"1em\",ttype:SPACE},{input:\"\\\\qquad\",tag:\"mspace\",atname:\"width\",atval:\"2em\",ttype:SPACE},{input:\"\\\\prime\",tag:\"mo\",output:\"\\u2032\",ttype:CONST},{input:\"'\",tag:\"mo\",output:\"\\u02B9\",ttype:CONST},{input:\"''\",tag:\"mo\",output:\"\\u02BA\",ttype:CONST},{input:\"'''\",tag:\"mo\",output:\"\\u2034\",ttype:CONST},{input:\"''''\",tag:\"mo\",output:\"\\u2057\",ttype:CONST},{input:\"\\\\ldots\",tag:\"mo\",output:\"\\u2026\",ttype:CONST},{input:\"\\\\cdots\",tag:\"mo\",output:\"\\u22EF\",ttype:CONST},{input:\"\\\\vdots\",tag:\"mo\",output:\"\\u22EE\",ttype:CONST},{input:\"\\\\ddots\",tag:\"mo\",output:\"\\u22F1\",ttype:CONST},{input:\"\\\\forall\",tag:\"mo\",output:\"\\u2200\",ttype:CONST},{input:\"\\\\exists\",tag:\"mo\",output:\"\\u2203\",ttype:CONST},{input:\"\\\\Re\",tag:\"mo\",output:\"\\u211C\",ttype:CONST},{input:\"\\\\Im\",tag:\"mo\",output:\"\\u2111\",ttype:CONST},{input:\"\\\\aleph\",tag:\"mo\",output:\"\\u2135\",ttype:CONST},{input:\"\\\\hbar\",tag:\"mo\",output:\"\\u210F\",ttype:CONST},{input:\"\\\\ell\",tag:\"mo\",output:\"\\u2113\",ttype:CONST},{input:\"\\\\wp\",tag:\"mo\",output:\"\\u2118\",ttype:CONST},{input:\"\\\\emptyset\",tag:\"mo\",output:\"\\u2205\",ttype:CONST},{input:\"\\\\infty\",tag:\"mo\",output:\"\\u221E\",ttype:CONST},{input:\"\\\\surd\",tag:\"mo\",output:\"\\\\sqrt{}\",ttype:DEFINITION},{input:\"\\\\partial\",tag:\"mo\",output:\"\\u2202\",ttype:CONST},{input:\"\\\\nabla\",tag:\"mo\",output:\"\\u2207\",ttype:CONST},{input:\"\\\\triangle\",tag:\"mo\",output:\"\\u25B3\",ttype:CONST},{input:\"\\\\therefore\",tag:\"mo\",output:\"\\u2234\",ttype:CONST},{input:\"\\\\angle\",tag:\"mo\",output:\"\\u2220\",ttype:CONST},{input:\"\\\\diamond\",tag:\"mo\",output:\"\\u22C4\",ttype:CONST},{input:\"\\\\Diamond\",tag:\"mo\",output:\"\\u25C7\",ttype:CONST},{input:\"\\\\neg\",tag:\"mo\",output:\"\\u00AC\",ttype:CONST},{input:\"\\\\lnot\",tag:\"mo\",output:\"\\u00AC\",ttype:CONST},{input:\"\\\\bot\",tag:\"mo\",output:\"\\u22A5\",ttype:CONST},{input:\"\\\\top\",tag:\"mo\",output:\"\\u22A4\",ttype:CONST},{input:\"\\\\square\",tag:\"mo\",output:\"\\u25AB\",ttype:CONST},{input:\"\\\\Box\",tag:\"mo\",output:\"\\u25A1\",ttype:CONST},{input:\"\\\\wr\",tag:\"mo\",output:\"\\u2240\",ttype:CONST},{input:\"\\\\arccos\",tag:\"mi\",output:\"arccos\",ttype:UNARY,func:true},{input:\"\\\\arcsin\",tag:\"mi\",output:\"arcsin\",ttype:UNARY,func:true},{input:\"\\\\arctan\",tag:\"mi\",output:\"arctan\",ttype:UNARY,func:true},{input:\"\\\\arg\",tag:\"mi\",output:\"arg\",ttype:UNARY,func:true},{input:\"\\\\cos\",tag:\"mi\",output:\"cos\",ttype:UNARY,func:true},{input:\"\\\\cosh\",tag:\"mi\",output:\"cosh\",ttype:UNARY,func:true},{input:\"\\\\cot\",tag:\"mi\",output:\"cot\",ttype:UNARY,func:true},{input:\"\\\\coth\",tag:\"mi\",output:\"coth\",ttype:UNARY,func:true},{input:\"\\\\csc\",tag:\"mi\",output:\"csc\",ttype:UNARY,func:true},{input:\"\\\\deg\",tag:\"mi\",output:\"deg\",ttype:UNARY,func:true},{input:\"\\\\det\",tag:\"mi\",output:\"det\",ttype:UNARY,func:true},{input:\"\\\\dim\",tag:\"mi\",output:\"dim\",ttype:UNARY,func:true},{input:\"\\\\exp\",tag:\"mi\",output:\"exp\",ttype:UNARY,func:true},{input:\"\\\\gcd\",tag:\"mi\",output:\"gcd\",ttype:UNARY,func:true},{input:\"\\\\hom\",tag:\"mi\",output:\"hom\",ttype:UNARY,func:true},{input:\"\\\\inf\",tag:\"mo\",output:\"inf\",ttype:UNDEROVER},{input:\"\\\\ker\",tag:\"mi\",output:\"ker\",ttype:UNARY,func:true},{input:\"\\\\lg\",tag:\"mi\",output:\"lg\",ttype:UNARY,func:true},{input:\"\\\\lim\",tag:\"mo\",output:\"lim\",ttype:UNDEROVER},{input:\"\\\\liminf\",tag:\"mo\",output:\"liminf\",ttype:UNDEROVER},{input:\"\\\\limsup\",tag:\"mo\",output:\"limsup\",ttype:UNDEROVER},{input:\"\\\\ln\",tag:\"mi\",output:\"ln\",ttype:UNARY,func:true},{input:\"\\\\log\",tag:\"mi\",output:\"log\",ttype:UNARY,func:true},{input:\"\\\\max\",tag:\"mo\",output:\"max\",ttype:UNDEROVER},{input:\"\\\\min\",tag:\"mo\",output:\"min\",ttype:UNDEROVER},{input:\"\\\\Pr\",tag:\"mi\",output:\"Pr\",ttype:UNARY,func:true},{input:\"\\\\sec\",tag:\"mi\",output:\"sec\",ttype:UNARY,func:true},{input:\"\\\\sin\",tag:\"mi\",output:\"sin\",ttype:UNARY,func:true},{input:\"\\\\sinh\",tag:\"mi\",output:\"sinh\",ttype:UNARY,func:true},{input:\"\\\\sup\",tag:\"mo\",output:\"sup\",ttype:UNDEROVER},{input:\"\\\\tan\",tag:\"mi\",output:\"tan\",ttype:UNARY,func:true},{input:\"\\\\tanh\",tag:\"mi\",output:\"tanh\",ttype:UNARY,func:true},{input:\"\\\\gets\",tag:\"mo\",output:\"\\u2190\",ttype:CONST},{input:\"\\\\leftarrow\",tag:\"mo\",output:\"\\u2190\",ttype:CONST},{input:\"\\\\to\",tag:\"mo\",output:\"\\u2192\",ttype:CONST},{input:\"\\\\rightarrow\",tag:\"mo\",output:\"\\u2192\",ttype:CONST},{input:\"\\\\leftrightarrow\",tag:\"mo\",output:\"\\u2194\",ttype:CONST},{input:\"\\\\uparrow\",tag:\"mo\",output:\"\\u2191\",ttype:CONST},{input:\"\\\\downarrow\",tag:\"mo\",output:\"\\u2193\",ttype:CONST},{input:\"\\\\updownarrow\",tag:\"mo\",output:\"\\u2195\",ttype:CONST},{input:\"\\\\Leftarrow\",tag:\"mo\",output:\"\\u21D0\",ttype:CONST},{input:\"\\\\Rightarrow\",tag:\"mo\",output:\"\\u21D2\",ttype:CONST},{input:\"\\\\Leftrightarrow\",tag:\"mo\",output:\"\\u21D4\",ttype:CONST},{input:\"\\\\iff\",tag:\"mo\",output:\"~\\\\Longleftrightarrow~\",ttype:DEFINITION},{input:\"\\\\Uparrow\",tag:\"mo\",output:\"\\u21D1\",ttype:CONST},{input:\"\\\\Downarrow\",tag:\"mo\",output:\"\\u21D3\",ttype:CONST},{input:\"\\\\Updownarrow\",tag:\"mo\",output:\"\\u21D5\",ttype:CONST},{input:\"\\\\mapsto\",tag:\"mo\",output:\"\\u21A6\",ttype:CONST},{input:\"\\\\longleftarrow\",tag:\"mo\",output:\"\\u2190\",ttype:LONG},{input:\"\\\\longrightarrow\",tag:\"mo\",output:\"\\u2192\",ttype:LONG},{input:\"\\\\longleftrightarrow\",tag:\"mo\",output:\"\\u2194\",ttype:LONG},{input:\"\\\\Longleftarrow\",tag:\"mo\",output:\"\\u21D0\",ttype:LONG},{input:\"\\\\Longrightarrow\",tag:\"mo\",output:\"\\u21D2\",ttype:LONG},{input:\"\\\\Longleftrightarrow\",tag:\"mo\",output:\"\\u21D4\",ttype:LONG},{input:\"\\\\longmapsto\",tag:\"mo\",output:\"\\u21A6\",ttype:CONST},AMsqrt,AMroot,AMfrac,AMover,AMsub,AMsup,AMtext,AMmbox,AMatop,AMchoose,{input:\"\\\\acute\",tag:\"mover\",output:\"\\u00B4\",ttype:UNARY,acc:true},{input:\"\\\\grave\",tag:\"mover\",output:\"\\u0060\",ttype:UNARY,acc:true},{input:\"\\\\breve\",tag:\"mover\",output:\"\\u02D8\",ttype:UNARY,acc:true},{input:\"\\\\check\",tag:\"mover\",output:\"\\u02C7\",ttype:UNARY,acc:true},{input:\"\\\\dot\",tag:\"mover\",output:\".\",ttype:UNARY,acc:true},{input:\"\\\\ddot\",tag:\"mover\",output:\"..\",ttype:UNARY,acc:true},{input:\"\\\\mathring\",tag:\"mover\",output:\"\\u00B0\",ttype:UNARY,acc:true},{input:\"\\\\vec\",tag:\"mover\",output:\"\\u20D7\",ttype:UNARY,acc:true},{input:\"\\\\overrightarrow\",tag:\"mover\",output:\"\\u20D7\",ttype:UNARY,acc:true},{input:\"\\\\overleftarrow\",tag:\"mover\",output:\"\\u20D6\",ttype:UNARY,acc:true},{input:\"\\\\hat\",tag:\"mover\",output:\"\\u005E\",ttype:UNARY,acc:true},{input:\"\\\\widehat\",tag:\"mover\",output:\"\\u0302\",ttype:UNARY,acc:true},{input:\"\\\\tilde\",tag:\"mover\",output:\"~\",ttype:UNARY,acc:true},{input:\"\\\\widetilde\",tag:\"mover\",output:\"\\u02DC\",ttype:UNARY,acc:true},{input:\"\\\\bar\",tag:\"mover\",output:\"\\u203E\",ttype:UNARY,acc:true},{input:\"\\\\overbrace\",tag:\"mover\",output:\"\\uFE37\",ttype:UNARY,acc:true},{input:\"\\\\overbracket\",tag:\"mover\",output:\"\\u23B4\",ttype:UNARY,acc:true},{input:\"\\\\overline\",tag:\"mover\",output:\"\\u00AF\",ttype:UNARY,acc:true},{input:\"\\\\underbrace\",tag:\"munder\",output:\"\\uFE38\",ttype:UNARY,acc:true},{input:\"\\\\underbracket\",tag:\"munder\",output:\"\\u23B5\",ttype:UNARY,acc:true},{input:\"\\\\underline\",tag:\"munder\",output:\"\\u00AF\",ttype:UNARY,acc:true},{input:\"\\\\displaystyle\",tag:\"mstyle\",atname:\"displaystyle\",atval:\"true\",ttype:UNARY},{input:\"\\\\textstyle\",tag:\"mstyle\",atname:\"displaystyle\",atval:\"false\",ttype:UNARY},{input:\"\\\\scriptstyle\",tag:\"mstyle\",atname:\"scriptlevel\",atval:\"1\",ttype:UNARY},{input:\"\\\\scriptscriptstyle\",tag:\"mstyle\",atname:\"scriptlevel\",atval:\"2\",ttype:UNARY},{input:\"\\\\textrm\",tag:\"mstyle\",output:\"\\\\mathrm\",ttype:DEFINITION},{input:\"\\\\mathbf\",tag:\"mstyle\",atname:\"mathvariant\",atval:\"bold\",ttype:UNARY},{input:\"\\\\textbf\",tag:\"mstyle\",atname:\"mathvariant\",atval:\"bold\",ttype:UNARY},{input:\"\\\\mathit\",tag:\"mstyle\",atname:\"mathvariant\",atval:\"italic\",ttype:UNARY},{input:\"\\\\textit\",tag:\"mstyle\",atname:\"mathvariant\",atval:\"italic\",ttype:UNARY},{input:\"\\\\mathtt\",tag:\"mstyle\",atname:\"mathvariant\",atval:\"monospace\",ttype:UNARY},{input:\"\\\\texttt\",tag:\"mstyle\",atname:\"mathvariant\",atval:\"monospace\",ttype:UNARY},{input:\"\\\\mathsf\",tag:\"mstyle\",atname:\"mathvariant\",atval:\"sans-serif\",ttype:UNARY},{input:\"\\\\mathbb\",tag:\"mstyle\",atname:\"mathvariant\",atval:\"double-struck\",ttype:UNARY,codes:AMbbb},{input:\"\\\\mathcal\",tag:\"mstyle\",atname:\"mathvariant\",atval:\"script\",ttype:UNARY,codes:AMcal},{input:\"\\\\mathfrak\",tag:\"mstyle\",atname:\"mathvariant\",atval:\"fraktur\",ttype:UNARY,codes:AMfrk},{input:\"\\\\textcolor\",tag:\"mstyle\",atname:\"mathvariant\",atval:\"mathcolor\",ttype:BINARY},{input:\"\\\\colorbox\",tag:\"mstyle\",atname:\"mathvariant\",atval:\"background\",ttype:BINARY}];function compareNames(s1,s2){if(s1.input>s2.input)return 1\nelse return-1;}\nvar AMnames=[];function AMinitSymbols(){AMsymbols.sort(compareNames);for(i=0;i<AMsymbols.length;i++)AMnames[i]=AMsymbols[i].input;}\nvar AMmathml=\"http://www.w3.org/1998/Math/MathML\";function AMcreateElementMathML(t){if(isIE)return document.createElement(\"m:\"+t);else return document.createElementNS(AMmathml,t);}\nfunction AMcreateMmlNode(t,frag){if(isIE)var node=document.createElement(\"m:\"+t);else var node=document.createElementNS(AMmathml,t);node.appendChild(frag);return node;}\nfunction newcommand(oldstr,newstr){AMsymbols=AMsymbols.concat([{input:oldstr,tag:\"mo\",output:newstr,ttype:DEFINITION}]);}\nfunction AMremoveCharsAndBlanks(str,n){var st;st=str.slice(n);for(var i=0;i<st.length&&st.charCodeAt(i)<=32;i=i+1);return st.slice(i);}\nfunction AMposition(arr,str,n){if(n==0){var h,m;n=-1;h=arr.length;while(n+1<h){m=(n+h)>>1;if(arr[m]<str)n=m;else h=m;}\nreturn h;}else\nfor(var i=n;i<arr.length&&arr[i]<str;i++);return i;}\nfunction AMgetSymbol(str){var k=0;var j=0;var mk;var st;var tagst;var match=\"\";var more=true;for(var i=1;i<=str.length&&more;i++){st=str.slice(0,i);j=k;k=AMposition(AMnames,st,j);if(k<AMnames.length&&str.slice(0,AMnames[k].length)==AMnames[k]){match=AMnames[k];mk=k;i=match.length;}\nmore=k<AMnames.length&&str.slice(0,AMnames[k].length)>=AMnames[k];}\nAMpreviousSymbol=AMcurrentSymbol;if(match!=\"\"){AMcurrentSymbol=AMsymbols[mk].ttype;return AMsymbols[mk];}\nAMcurrentSymbol=CONST;k=1;st=str.slice(0,1);if(\"0\"<=st&&st<=\"9\")tagst=\"mn\";else tagst=((\"A\">st||st>\"Z\")&&(\"a\">st||st>\"z\")?\"mo\":\"mi\");return{input:st,tag:tagst,output:st,ttype:CONST};}\nvar AMpreviousSymbol,AMcurrentSymbol;function AMparseSexpr(str){var symbol,node,result,result2,i,st,newFrag=document.createDocumentFragment();str=AMremoveCharsAndBlanks(str,0);symbol=AMgetSymbol(str);if(symbol==null||symbol.ttype==RIGHTBRACKET)\nreturn[null,str,null];if(symbol.ttype==DEFINITION){str=symbol.output+AMremoveCharsAndBlanks(str,symbol.input.length);symbol=AMgetSymbol(str);if(symbol==null||symbol.ttype==RIGHTBRACKET)\nreturn[null,str,null];}\nstr=AMremoveCharsAndBlanks(str,symbol.input.length);switch(symbol.ttype){case SPACE:node=AMcreateElementMathML(symbol.tag);node.setAttribute(symbol.atname,symbol.atval);return[node,str,symbol.tag];case UNDEROVER:if(isIE){if(symbol.input.substr(0,4)==\"\\\\big\"){str=\"\\\\\"+symbol.input.substr(4)+str;symbol=AMgetSymbol(str);symbol.ttype=UNDEROVER;str=AMremoveCharsAndBlanks(str,symbol.input.length);}}\nreturn[AMcreateMmlNode(symbol.tag,document.createTextNode(symbol.output)),str,symbol.tag];case CONST:var output=symbol.output;if(isIE){if(symbol.input==\"'\")\noutput=\"\\u2032\";else if(symbol.input==\"''\")\noutput=\"\\u2033\";else if(symbol.input==\"'''\")\noutput=\"\\u2033\\u2032\";else if(symbol.input==\"''''\")\noutput=\"\\u2033\\u2033\";else if(symbol.input==\"\\\\square\")\noutput=\"\\u25A1\";else if(symbol.input.substr(0,5)==\"\\\\frac\"){var denom=symbol.input.substr(6,1);if(denom==\"5\"||denom==\"6\"){str=symbol.input.replace(/\\\\frac/,\"\\\\frac \")+str;return[node,str,symbol.tag];}}}\nnode=AMcreateMmlNode(symbol.tag,document.createTextNode(output));return[node,str,symbol.tag];case LONG:node=AMcreateMmlNode(symbol.tag,document.createTextNode(symbol.output));node.setAttribute(\"minsize\",\"1.5\");node.setAttribute(\"maxsize\",\"1.5\");node=AMcreateMmlNode(\"mover\",node);node.appendChild(AMcreateElementMathML(\"mspace\"));return[node,str,symbol.tag];case STRETCHY:if(isIE&&symbol.input==\"\\\\backslash\")\nsymbol.output=\"\\\\\";node=AMcreateMmlNode(symbol.tag,document.createTextNode(symbol.output));if(symbol.input==\"|\"||symbol.input==\"\\\\vert\"||symbol.input==\"\\\\|\"||symbol.input==\"\\\\Vert\"){node.setAttribute(\"lspace\",\"0em\");node.setAttribute(\"rspace\",\"0em\");}\nnode.setAttribute(\"maxsize\",symbol.atval);if(symbol.rtag!=null)\nreturn[node,str,symbol.rtag];else\nreturn[node,str,symbol.tag];case BIG:var atval=symbol.atval;if(isIE)\natval=symbol.ieval;symbol=AMgetSymbol(str);if(symbol==null)\nreturn[null,str,null];str=AMremoveCharsAndBlanks(str,symbol.input.length);node=AMcreateMmlNode(symbol.tag,document.createTextNode(symbol.output));if(isIE){var space=AMcreateElementMathML(\"mspace\");space.setAttribute(\"height\",atval+\"ex\");node=AMcreateMmlNode(\"mrow\",node);node.appendChild(space);}else{node.setAttribute(\"minsize\",atval);node.setAttribute(\"maxsize\",atval);}\nreturn[node,str,symbol.tag];case LEFTBRACKET:if(symbol.input==\"\\\\left\"){symbol=AMgetSymbol(str);if(symbol!=null){if(symbol.input==\".\")\nsymbol.invisible=true;str=AMremoveCharsAndBlanks(str,symbol.input.length);}}\nresult=AMparseExpr(str,true,false);if(symbol==null||(typeof symbol.invisible==\"boolean\"&&symbol.invisible))\nnode=AMcreateMmlNode(\"mrow\",result[0]);else{node=AMcreateMmlNode(\"mo\",document.createTextNode(symbol.output));node=AMcreateMmlNode(\"mrow\",node);node.appendChild(result[0]);}\nreturn[node,result[1],result[2]];case MATRIX:if(symbol.input==\"\\\\begin{array}\"){var mask=\"\";symbol=AMgetSymbol(str);str=AMremoveCharsAndBlanks(str,0);if(symbol==null)\nmask=\"l\";else{str=AMremoveCharsAndBlanks(str,symbol.input.length);if(symbol.input!=\"{\")\nmask=\"l\";else do{symbol=AMgetSymbol(str);if(symbol!=null){str=AMremoveCharsAndBlanks(str,symbol.input.length);if(symbol.input!=\"}\")\nmask=mask+symbol.input;}}while(symbol!=null&&symbol.input!=\"\"&&symbol.input!=\"}\");}\nresult=AMparseExpr(\"{\"+str,true,true);node=AMcreateMmlNode(\"mtable\",result[0]);mask=mask.replace(/l/g,\"left \");mask=mask.replace(/r/g,\"right \");mask=mask.replace(/c/g,\"center \");node.setAttribute(\"columnalign\",mask);node.setAttribute(\"displaystyle\",\"false\");if(isIE)\nreturn[node,result[1],null];var lspace=AMcreateElementMathML(\"mspace\");lspace.setAttribute(\"width\",\"0.167em\");var rspace=AMcreateElementMathML(\"mspace\");rspace.setAttribute(\"width\",\"0.167em\");var node1=AMcreateMmlNode(\"mrow\",lspace);node1.appendChild(node);node1.appendChild(rspace);return[node1,result[1],null];}else{result=AMparseExpr(\"{\"+str,true,true);node=AMcreateMmlNode(\"mtable\",result[0]);if(isIE)\nnode.setAttribute(\"columnspacing\",\"0.25em\");else\nnode.setAttribute(\"columnspacing\",\"0.167em\");node.setAttribute(\"columnalign\",\"right center left\");node.setAttribute(\"displaystyle\",\"true\");node=AMcreateMmlNode(\"mrow\",node);return[node,result[1],null];}\ncase TEXT:if(str.charAt(0)==\"{\")i=str.indexOf(\"}\");else i=0;if(i==-1)\ni=str.length;st=str.slice(1,i);if(st.charAt(0)==\" \"){node=AMcreateElementMathML(\"mspace\");node.setAttribute(\"width\",\"0.33em\");newFrag.appendChild(node);}\nnewFrag.appendChild(AMcreateMmlNode(symbol.tag,document.createTextNode(st)));if(st.charAt(st.length-1)==\" \"){node=AMcreateElementMathML(\"mspace\");node.setAttribute(\"width\",\"0.33em\");newFrag.appendChild(node);}\nstr=AMremoveCharsAndBlanks(str,i+1);return[AMcreateMmlNode(\"mrow\",newFrag),str,null];case UNARY:result=AMparseSexpr(str);if(result[0]==null)return[AMcreateMmlNode(symbol.tag,document.createTextNode(symbol.output)),str];if(typeof symbol.func==\"boolean\"&&symbol.func){st=str.charAt(0);if(st==\"^\"||st==\"_\"||st==\",\"){return[AMcreateMmlNode(symbol.tag,document.createTextNode(symbol.output)),str,symbol.tag];}else{node=AMcreateMmlNode(\"mrow\",AMcreateMmlNode(symbol.tag,document.createTextNode(symbol.output)));if(isIE){var space=AMcreateElementMathML(\"mspace\");space.setAttribute(\"width\",\"0.167em\");node.appendChild(space);}\nnode.appendChild(result[0]);return[node,result[1],symbol.tag];}}\nif(symbol.input==\"\\\\sqrt\"){if(isIE){var space=AMcreateElementMathML(\"mspace\");space.setAttribute(\"height\",\"1.2ex\");space.setAttribute(\"width\",\"0em\");node=AMcreateMmlNode(symbol.tag,result[0])\nnode.appendChild(space);return[node,result[1],symbol.tag];}else\nreturn[AMcreateMmlNode(symbol.tag,result[0]),result[1],symbol.tag];}else if(typeof symbol.acc==\"boolean\"&&symbol.acc){node=AMcreateMmlNode(symbol.tag,result[0]);var output=symbol.output;if(isIE){if(symbol.input==\"\\\\hat\")\noutput=\"\\u0302\";else if(symbol.input==\"\\\\widehat\")\noutput=\"\\u005E\";else if(symbol.input==\"\\\\bar\")\noutput=\"\\u00AF\";else if(symbol.input==\"\\\\grave\")\noutput=\"\\u0300\";else if(symbol.input==\"\\\\tilde\")\noutput=\"\\u0303\";}\nvar node1=AMcreateMmlNode(\"mo\",document.createTextNode(output));if(symbol.input==\"\\\\vec\"||symbol.input==\"\\\\check\")\nnode1.setAttribute(\"maxsize\",\"1.2\");if(isIE&&symbol.input==\"\\\\bar\")\nnode1.setAttribute(\"maxsize\",\"0.5\");if(symbol.input==\"\\\\underbrace\"||symbol.input==\"\\\\underline\")\nnode1.setAttribute(\"accentunder\",\"true\");else\nnode1.setAttribute(\"accent\",\"true\");node.appendChild(node1);if(symbol.input==\"\\\\overbrace\"||symbol.input==\"\\\\underbrace\")\nnode.ttype=UNDEROVER;return[node,result[1],symbol.tag];}else{if(!isIE&&typeof symbol.codes!=\"undefined\"){for(i=0;i<result[0].childNodes.length;i++)\nif(result[0].childNodes[i].nodeName==\"mi\"||result[0].nodeName==\"mi\"){st=(result[0].nodeName==\"mi\"?result[0].firstChild.nodeValue:result[0].childNodes[i].firstChild.nodeValue);var newst=[];for(var j=0;j<st.length;j++)\nif(st.charCodeAt(j)>64&&st.charCodeAt(j)<91)newst=newst+\nString.fromCharCode(symbol.codes[st.charCodeAt(j)-65]);else newst=newst+st.charAt(j);if(result[0].nodeName==\"mi\")\nresult[0]=AMcreateElementMathML(\"mo\").appendChild(document.createTextNode(newst));else result[0].replaceChild(AMcreateElementMathML(\"mo\").appendChild(document.createTextNode(newst)),result[0].childNodes[i]);}}\nnode=AMcreateMmlNode(symbol.tag,result[0]);node.setAttribute(symbol.atname,symbol.atval);if(symbol.input==\"\\\\scriptstyle\"||symbol.input==\"\\\\scriptscriptstyle\")\nnode.setAttribute(\"displaystyle\",\"false\");return[node,result[1],symbol.tag];}\ncase BINARY:result=AMparseSexpr(str);if(result[0]==null)return[AMcreateMmlNode(\"mo\",document.createTextNode(symbol.input)),str,null];result2=AMparseSexpr(result[1]);if(result2[0]==null)return[AMcreateMmlNode(\"mo\",document.createTextNode(symbol.input)),str,null];if(symbol.input==\"\\\\textcolor\"||symbol.input==\"\\\\colorbox\"){var tclr=str.match(/\\{\\s*([#\\w]+)\\s*\\}/);str=str.replace(/\\{\\s*[#\\w]+\\s*\\}/,\"\");if(tclr!=null){if(IsColorName.test(tclr[1].toLowerCase())){tclr=LaTeXColor[tclr[1].toLowerCase()];}else{tclr=tclr[1];}\nnode=AMcreateElementMathML(\"mstyle\");node.setAttribute(symbol.atval,tclr);node.appendChild(result2[0]);return[node,result2[1],symbol.tag];}}\nif(symbol.input==\"\\\\root\"||symbol.input==\"\\\\stackrel\")newFrag.appendChild(result2[0]);newFrag.appendChild(result[0]);if(symbol.input==\"\\\\frac\")newFrag.appendChild(result2[0]);return[AMcreateMmlNode(symbol.tag,newFrag),result2[1],symbol.tag];case INFIX:str=AMremoveCharsAndBlanks(str,symbol.input.length);return[AMcreateMmlNode(\"mo\",document.createTextNode(symbol.output)),str,symbol.tag];default:return[AMcreateMmlNode(symbol.tag,document.createTextNode(symbol.output)),str,symbol.tag];}}\nfunction AMparseIexpr(str){var symbol,sym1,sym2,node,result,tag,underover;str=AMremoveCharsAndBlanks(str,0);sym1=AMgetSymbol(str);result=AMparseSexpr(str);node=result[0];str=result[1];tag=result[2];symbol=AMgetSymbol(str);if(symbol.ttype==INFIX){str=AMremoveCharsAndBlanks(str,symbol.input.length);result=AMparseSexpr(str);if(result[0]==null)\nresult[0]=AMcreateMmlNode(\"mo\",document.createTextNode(\"\\u25A1\"));str=result[1];tag=result[2];if(symbol.input==\"_\"||symbol.input==\"^\"){sym2=AMgetSymbol(str);tag=null;underover=((sym1.ttype==UNDEROVER)||(node.ttype==UNDEROVER));if(symbol.input==\"_\"&&sym2.input==\"^\"){str=AMremoveCharsAndBlanks(str,sym2.input.length);var res2=AMparseSexpr(str);str=res2[1];tag=res2[2];node=AMcreateMmlNode((underover?\"munderover\":\"msubsup\"),node);node.appendChild(result[0]);node.appendChild(res2[0]);}else if(symbol.input==\"_\"){node=AMcreateMmlNode((underover?\"munder\":\"msub\"),node);node.appendChild(result[0]);}else{node=AMcreateMmlNode((underover?\"mover\":\"msup\"),node);node.appendChild(result[0]);}\nnode=AMcreateMmlNode(\"mrow\",node);}else{node=AMcreateMmlNode(symbol.tag,node);if(symbol.input==\"\\\\atop\"||symbol.input==\"\\\\choose\")\nnode.setAttribute(\"linethickness\",\"0ex\");node.appendChild(result[0]);if(symbol.input==\"\\\\choose\")\nnode=AMcreateMmlNode(\"mfenced\",node);}}\nreturn[node,str,tag];}\nfunction AMparseExpr(str,rightbracket,matrix){var symbol,node,result,i,tag,newFrag=document.createDocumentFragment();do{str=AMremoveCharsAndBlanks(str,0);result=AMparseIexpr(str);node=result[0];str=result[1];tag=result[2];symbol=AMgetSymbol(str);if(node!=undefined){if((tag==\"mn\"||tag==\"mi\")&&symbol!=null&&typeof symbol.func==\"boolean\"&&symbol.func){var space=AMcreateElementMathML(\"mspace\");space.setAttribute(\"width\",\"0.167em\");node=AMcreateMmlNode(\"mrow\",node);node.appendChild(space);}\nnewFrag.appendChild(node);}}while((symbol.ttype!=RIGHTBRACKET)&&symbol!=null&&symbol.output!=\"\");tag=null;if(symbol.ttype==RIGHTBRACKET){if(symbol.input==\"\\\\right\"){str=AMremoveCharsAndBlanks(str,symbol.input.length);symbol=AMgetSymbol(str);if(symbol!=null&&symbol.input==\".\")\nsymbol.invisible=true;if(symbol!=null)\ntag=symbol.rtag;}\nif(symbol!=null)\nstr=AMremoveCharsAndBlanks(str,symbol.input.length);var len=newFrag.childNodes.length;if(matrix&&len>0&&newFrag.childNodes[len-1].nodeName==\"mrow\"&&len>1&&newFrag.childNodes[len-2].nodeName==\"mo\"&&newFrag.childNodes[len-2].firstChild.nodeValue==\"&\"){var pos=[];var m=newFrag.childNodes.length;for(i=0;matrix&&i<m;i=i+2){pos[i]=[];node=newFrag.childNodes[i];for(var j=0;j<node.childNodes.length;j++)\nif(node.childNodes[j].firstChild.nodeValue==\"&\")\npos[i][pos[i].length]=j;}\nvar row,frag,n,k,table=document.createDocumentFragment();for(i=0;i<m;i=i+2){row=document.createDocumentFragment();frag=document.createDocumentFragment();node=newFrag.firstChild;n=node.childNodes.length;k=0;for(j=0;j<n;j++){if(typeof pos[i][k]!=\"undefined\"&&j==pos[i][k]){node.removeChild(node.firstChild);row.appendChild(AMcreateMmlNode(\"mtd\",frag));k++;}else frag.appendChild(node.firstChild);}\nrow.appendChild(AMcreateMmlNode(\"mtd\",frag));if(newFrag.childNodes.length>2){newFrag.removeChild(newFrag.firstChild);newFrag.removeChild(newFrag.firstChild);}\ntable.appendChild(AMcreateMmlNode(\"mtr\",row));}\nreturn[table,str];}\nif(typeof symbol.invisible!=\"boolean\"||!symbol.invisible){node=AMcreateMmlNode(\"mo\",document.createTextNode(symbol.output));newFrag.appendChild(node);}}\nreturn[newFrag,str,tag];}\nfunction AMparseMath(str){var result,node=AMcreateElementMathML(\"mstyle\");var cclr=str.match(/\\\\color\\s*\\{\\s*([#\\w]+)\\s*\\}/);str=str.replace(/\\\\color\\s*\\{\\s*[#\\w]+\\s*\\}/g,\"\");if(cclr!=null){if(IsColorName.test(cclr[1].toLowerCase())){cclr=LaTeXColor[cclr[1].toLowerCase()];}else{cclr=cclr[1];}\nnode.setAttribute(\"mathcolor\",cclr);}else{if(mathcolor!=\"\")node.setAttribute(\"mathcolor\",mathcolor);};if(mathfontfamily!=\"\")node.setAttribute(\"fontfamily\",mathfontfamily);node.appendChild(AMparseExpr(str.replace(/^\\s+/g,\"\"),false,false)[0]);node=AMcreateMmlNode(\"math\",node);if(showasciiformulaonhover)\nnode.setAttribute(\"title\",str.replace(/\\s+/g,\" \"));if(false){var fnode=AMcreateElementXHTML(\"font\");fnode.setAttribute(\"face\",mathfontfamily);fnode.appendChild(node);return fnode;}\nreturn node;}\nfunction AMstrarr2docFrag(arr,linebreaks){var newFrag=document.createDocumentFragment();var expr=false;for(var i=0;i<arr.length;i++){if(expr)newFrag.appendChild(AMparseMath(arr[i]));else{var arri=(linebreaks?arr[i].split(\"\\n\\n\"):[arr[i]]);newFrag.appendChild(AMcreateElementXHTML(\"span\").appendChild(document.createTextNode(arri[0])));for(var j=1;j<arri.length;j++){newFrag.appendChild(AMcreateElementXHTML(\"p\"));newFrag.appendChild(AMcreateElementXHTML(\"span\").appendChild(document.createTextNode(arri[j])));}}\nexpr=!expr;}\nreturn newFrag;}\nfunction AMprocessNodeR(n,linebreaks){var mtch,str,arr,frg,i;if(n.childNodes.length==0){if((n.nodeType!=8||linebreaks)&&n.parentNode.nodeName!=\"form\"&&n.parentNode.nodeName!=\"FORM\"&&n.parentNode.nodeName!=\"textarea\"&&n.parentNode.nodeName!=\"TEXTAREA\"&&n.parentNode.nodeName!=\"pre\"&&n.parentNode.nodeName!=\"PRE\"){str=n.nodeValue;if(!(str==null)){str=str.replace(/\\r\\n\\r\\n/g,\"\\n\\n\");str=str.replace(/\\x20+/g,\" \");str=str.replace(/\\s*\\r\\n/g,\" \");mtch=(str.indexOf(\"\\$\")==-1?false:true);str=str.replace(/([^\\\\])\\$/g,\"$1 \\$\");str=str.replace(/^\\$/,\" \\$\");arr=str.split(\" \\$\");for(i=0;i<arr.length;i++)\narr[i]=arr[i].replace(/\\\\\\$/g,\"\\$\");if(arr.length>1||mtch){if(checkForMathML){checkForMathML=false;var nd=AMisMathMLavailable();AMnoMathML=nd!=null;if(AMnoMathML&&notifyIfNoMathML)\nif(alertIfNoMathML)\nalert(\"To view the ASCIIMathML notation use Internet Explorer 6 +\\nMathPlayer (free from www.dessci.com)\\nor Firefox/Mozilla/Netscape\");else AMbody.insertBefore(nd,AMbody.childNodes[0]);}\nif(!AMnoMathML){frg=AMstrarr2docFrag(arr,n.nodeType==8);var len=frg.childNodes.length;n.parentNode.replaceChild(frg,n);return len-1;}else return 0;}}}else return 0;}else if(n.nodeName!=\"math\"){for(i=0;i<n.childNodes.length;i++)\ni+=AMprocessNodeR(n.childNodes[i],linebreaks);}\nreturn 0;}\nfunction AMprocessNode(n,linebreaks,spanclassAM){var frag,st;if(spanclassAM!=null){frag=document.getElementsByTagName(\"span\")\nfor(var i=0;i<frag.length;i++)\nif(frag[i].className==\"AM\")\nAMprocessNodeR(frag[i],linebreaks);}else{try{st=n.innerHTML;}catch(err){}\nif(st==null||st.indexOf(\"\\$\")!=-1)\nAMprocessNodeR(n,linebreaks);}\nif(isIE){frag=document.getElementsByTagName('math');for(var i=0;i<frag.length;i++)frag[i].update()}}\nvar inAppendix=false;var sectionCntr=0;var IEcommentWarning=true;var biblist=[];var bibcntr=0;var LaTeXCounter=[];LaTeXCounter[\"definition\"]=0;LaTeXCounter[\"proposition\"]=0;LaTeXCounter[\"lemma\"]=0;LaTeXCounter[\"theorem\"]=0;LaTeXCounter[\"corollary\"]=0;LaTeXCounter[\"example\"]=0;LaTeXCounter[\"exercise\"]=0;LaTeXCounter[\"subsection\"]=0;LaTeXCounter[\"subsubsection\"]=0;LaTeXCounter[\"figure\"]=0;LaTeXCounter[\"equation\"]=0;LaTeXCounter[\"table\"]=0;var LaTeXColor=[];LaTeXColor[\"greenyellow\"]=\"#D9FF4F\";LaTeXColor[\"yellow\"]=\"#FFFF00\";LaTeXColor[\"goldenrod\"]=\"#FFE529\";LaTeXColor[\"dandelion\"]=\"#FFB529\";LaTeXColor[\"apricot\"]=\"#FFAD7A\";LaTeXColor[\"peach\"]=\"#FF804D\";LaTeXColor[\"melon\"]=\"#FF8A80\";LaTeXColor[\"yelloworange\"]=\"#FF9400\";LaTeXColor[\"orange\"]=\"#FF6321\";LaTeXColor[\"burntorange\"]=\"#FF7D00\";LaTeXColor[\"bittersweet\"]=\"#C20300\";LaTeXColor[\"redorange\"]=\"#FF3B21\";LaTeXColor[\"mahogany\"]=\"#A60000\";LaTeXColor[\"maroon\"]=\"#AD0000\";LaTeXColor[\"brickred\"]=\"#B80000\";LaTeXColor[\"red\"]=\"#FF0000\";LaTeXColor[\"orangered\"]=\"#FF0080\";LaTeXColor[\"rubinered\"]=\"#FF00DE\";LaTeXColor[\"wildstrawberry\"]=\"#FF0A9C\";LaTeXColor[\"salmon\"]=\"#FF789E\";LaTeXColor[\"carnationpink\"]=\"#FF5EFF\";LaTeXColor[\"magenta\"]=\"#FF00FF\";LaTeXColor[\"violetred\"]=\"#FF30FF\";LaTeXColor[\"rhodamine\"]=\"#FF2EFF\";LaTeXColor[\"mulberry\"]=\"#A314FA\";LaTeXColor[\"redviolet\"]=\"#9600A8\";LaTeXColor[\"fuchsia\"]=\"#7303EB\";LaTeXColor[\"lavender\"]=\"#FF85FF\";LaTeXColor[\"thistle\"]=\"#E069FF\";LaTeXColor[\"orchid\"]=\"#AD5CFF\";LaTeXColor[\"darkorchid\"]=\"#9933CC\";LaTeXColor[\"purple\"]=\"#8C24FF\";LaTeXColor[\"plum\"]=\"#8000FF\";LaTeXColor[\"violet\"]=\"#361FFF\";LaTeXColor[\"royalpurple\"]=\"#401AFF\";LaTeXColor[\"blueviolet\"]=\"#1A0DF5\";LaTeXColor[\"periwinkle\"]=\"#6E73FF\";LaTeXColor[\"cadetblue\"]=\"#616EC4\";LaTeXColor[\"cornflowerblue\"]=\"#59DEFF\";LaTeXColor[\"midnightblue\"]=\"#007091\";LaTeXColor[\"navyblue\"]=\"#0F75FF\";LaTeXColor[\"royalblue\"]=\"#0080FF\";LaTeXColor[\"blue\"]=\"#0000FF\";LaTeXColor[\"cerulean\"]=\"#0FE3FF\";LaTeXColor[\"cyan\"]=\"#00FFFF\";LaTeXColor[\"processblue\"]=\"#0AFFFF\";LaTeXColor[\"skyblue\"]=\"#61FFE0\";LaTeXColor[\"turquoise\"]=\"#26FFCC\";LaTeXColor[\"tealblue\"]=\"#1FFAA3\";LaTeXColor[\"aquamarine\"]=\"#2EFFB2\";LaTeXColor[\"bluegreen\"]=\"#26FFAB\";LaTeXColor[\"emerald\"]=\"#00FF80\";LaTeXColor[\"junglegreen\"]=\"#03FF7A\";LaTeXColor[\"seagreen\"]=\"#4FFF80\";LaTeXColor[\"green\"]=\"#00FF00\";LaTeXColor[\"forestgreen\"]=\"#00E000\";LaTeXColor[\"pinegreen\"]=\"#00BF29\";LaTeXColor[\"limegreen\"]=\"#80FF00\";LaTeXColor[\"yellowgreen\"]=\"#8FFF42\";LaTeXColor[\"springgreen\"]=\"#BDFF3D\";LaTeXColor[\"olivegreen\"]=\"#009900\";LaTeXColor[\"rawsienna\"]=\"#8C0000\";LaTeXColor[\"sepia\"]=\"#4D0000\";LaTeXColor[\"brown\"]=\"#660000\";LaTeXColor[\"tan\"]=\"#DB9470\";LaTeXColor[\"gray\"]=\"#808080\";LaTeXColor[\"grey\"]=\"#808080\";LaTeXColor[\"black\"]=\"#000000\";LaTeXColor[\"white\"]=\"#FFFFFF\";var IsColorName=/^(?:greenyellow|yellow|goldenrod|dandelion|apricot|peach|melon|yelloworange|orange|burntorange|bittersweet|redorange|mahogany|maroon|brickred|red|orangered|rubinered|wildstrawberry|salmon|carnationpink|magenta|violetred|rhodamine|mulberry|redviolet|fuchsia|lavender|thistle|orchid|darkorchid|purple|plum|violet|royalpurple|blueviolet|periwinkle|cadetblue|cornflowerblue|midnightblue|navyblue|royalblue|blue|cerulean|cyan|processblue|skyblue|turquoise|tealblue|aquamarine|bluegreen|emerald|junglegreen|seagreen|green|forestgreen|pinegreen|limegreen|yellowgreen|springgreen|olivegreen|rawsienna|sepia|brown|tan|gray|grey|black|white)$/;var IsCounter=/^(?:definition|proposition|lemma|theorem|corollary|example|exercise|subsection|subsubsection|figure|equation|table)$/;var IsLaTeXElement=/^(?:displayequation|title|author|address|date|abstract|keyword|section|subsection|subsubsection|ref|cite|thebibliography|definition|proposition|lemma|theorem|corollary|example|exercise|itemize|enumerate|enddefinition|endproposition|endlemma|endtheorem|endcorollary|endexample|endexercise|enditemize|endenumerate|LaTeXMathMLlabel|LaTeXMathML|smallskip|medskip|bigskip|quote|quotation|endquote|endquotation|center|endcenter|description|enddescription|inlinemath)$/;var IsTextOnlyArea=/^(?:form|textarea|pre)$/i;var tableid=0;function makeNumberString(cntr){if(sectionCntr>0){if(inAppendix){return\"A\"+sectionCntr+\".\"+cntr;}else{return sectionCntr+\".\"+cntr;}}else{return\"\"+cntr;}};function LaTeXpreProcess(thebody){var TheBody=thebody;if(TheBody.hasChildNodes()){if(!(IsLaTeXElement.test(TheBody.className)))\n{for(var i=0;i<TheBody.childNodes.length;i++){LaTeXpreProcess(TheBody.childNodes[i])}}}\nelse{if(TheBody.nodeType==3&&!(IsTextOnlyArea.test(TheBody.parentNode.nodeName)))\n{var str=TheBody.nodeValue;if(!(str==null)){str=str.replace(/\\\\%/g,\"<per>\");str=str.replace(/%[^\\n]*(?=\\n)/g,\"\");str=str.replace(/%[^\\r]*(?=\\r)/g,\"\");str=str.replace(/%[^\\n]*$/,\"\")\nif(isIE&&str.match(/%/g)!=null&&IEcommentWarning){alert(\"Comments may not have parsed properly.  Try putting in <pre class='LaTeX><div>..</div></pre> structure.\");IEcommentWarning=false;}\nstr=str.replace(/<per>/g,\"%\");if(str.match(/XXX[\\s\\S]*/)!=null){var tmp=str.match(/XXX[\\s\\S]*/)[0];var tmpstr=tmp.charCodeAt(7)+\"::\"+tmp.charCodeAt(8)+\"::\"+tmp.charCodeAt(9)+\"::\"+tmp.charCodeAt(10)+\"::\"+tmp.charCodeAt(11)+\"::\"+tmp.charCodeAt(12)+\"::\"+tmp.charCodeAt(13);alert(tmpstr);}\nstr=str.replace(/([^\\\\])\\\\(\\s)/g,\"$1\\u00A0$2\");str=str.replace(/\\\\quad/g,\"\\u2001\");str=str.replace(/\\\\qquad/g,\"\\u2001\\u2001\");str=str.replace(/\\\\enspace/g,\"\\u2002\");str=str.replace(/\\\\;/g,\"\\u2004\");str=str.replace(/\\\\:/g,\"\\u2005\");str=str.replace(/\\\\,/g,\"\\u2006\");str=str.replace(/\\\\thinspace/g,\"\\u200A\");str=str.replace(/([^\\\\])~/g,\"$1\\u00A0\");str=str.replace(/\\\\~/g,\"~\");str=str.replace(/\\\\\\[/g,\" <DEQ> $\\\\displaystyle{\");str=str.replace(/\\\\\\]/g,\"}$ <DEQ> \");str=str.replace(/\\$\\$/g,\"${$<DEQ>$}$\");str=str.replace(/\\\\begin\\s*\\{\\s*array\\s*\\}/g,\"\\\\begin{array}\");str=str.replace(/\\\\end\\s*\\{\\s*array\\s*\\}/g,\"\\\\end{array}\");str=str.replace(/\\\\begin\\s*\\{\\s*eqnarray\\s*\\}/g,\"  <DEQ>eqno$\\\\begin{eqnarray}\");str=str.replace(/\\\\end\\s*\\{\\s*eqnarray\\s*\\}/g,\"\\\\end{eqnarray}$<DEQ>  \");str=str.replace(/\\\\begin\\s*\\{\\s*eqnarray\\*\\s*\\}/g,\"  <DEQ>$\\\\begin{eqnarray}\");str=str.replace(/\\\\end\\s*\\{\\s*eqnarray\\*\\s*\\}/g,\"\\\\end{eqnarray}$<DEQ>  \");str=str.replace(/\\\\begin\\s*\\{\\s*displaymath\\s*\\}/g,\" <DEQ> $\\\\displaystyle{\");str=str.replace(/\\\\end\\s*\\{\\s*displaymath\\s*\\}/g,\"}$ <DEQ> \");str=str.replace(/\\\\begin\\s*\\{\\s*equation\\s*\\*\\s*\\}/g,\" <DEQ> $\\\\displaystyle{\");str=str.replace(/\\\\end\\s*\\{\\s*equation\\s*\\*\\s*\\}/g,\"}$ <DEQ> \");str=str.replace(/\\\\begin\\s*\\{\\s*equation\\s*\\}/g,\" <DEQ>eqno$\\\\displaystyle{\");str=str.replace(/\\\\end\\s*\\{\\s*equation\\s*\\}/g,\"}$ <DEQ> \");str=str.split(\"<DEQ>\");var newFrag=document.createDocumentFragment();for(var i=0;i<str.length;i++){if(i%2){var DEQtable=document.createElement(\"table\");DEQtable.className='displayequation';var DEQtbody=document.createElement(\"tbody\");var DEQtr=document.createElement(\"tr\");var DEQtdeq=document.createElement(\"td\");DEQtdeq.className='eq';str[i]=str[i].replace(/\\$\\}\\$/g,\"$\\\\displaystyle{\");str[i]=str[i].replace(/\\$\\{\\$/g,\"}\");var lbl=str[i].match(/\\\\label\\s*\\{\\s*(\\w+)\\s*\\}/);var ISeqno=str[i].match(/^eqno/);str[i]=str[i].replace(/^eqno/,\" \");str[i]=str[i].replace(/\\\\label\\s*\\{\\s*\\w+\\s*\\}/,\" \");DEQtdeq.appendChild(document.createTextNode(str[i]));DEQtr.appendChild(DEQtdeq);str[i]=str[i].replace(/\\\\nonumber/g,\"\");if(ISeqno!=null||lbl!=null){var DEQtdno=document.createElement(\"td\");DEQtdno.className='eqno';LaTeXCounter[\"equation\"]++;var eqnoString=makeNumberString(LaTeXCounter[\"equation\"]);var DEQanchor=document.createElement(\"a\");if(lbl!=null){DEQanchor.id=lbl[1]};DEQanchor.className=\"eqno\";var anchorSpan=document.createElement(\"span\");anchorSpan.className=\"eqno\";anchorSpan.style.display=\"none\";anchorSpan.appendChild(document.createTextNode(eqnoString));DEQanchor.appendChild(anchorSpan);DEQtdno.appendChild(DEQanchor);var DEQspan=document.createElement(\"span\");DEQspan.className=\"eqno\";DEQspan.appendChild(document.createTextNode(\"(\"+eqnoString+\")\"));DEQtdno.appendChild(DEQspan);DEQtr.appendChild(DEQtdno);}\nDEQtbody.appendChild(DEQtr);DEQtable.appendChild(DEQtbody);newFrag.appendChild(DEQtable);}\nelse{str[i]=str[i].replace(/\\$\\}\\$/g,\"\");str[i]=str[i].replace(/\\$\\{\\$/g,\"\");str[i]=str[i].replace(/\\\\maketitle/g,\"\");str[i]=str[i].replace(/\\\\begin\\s*\\{\\s*document\\s*\\}/g,\"\");str[i]=str[i].replace(/\\\\end\\s*\\{\\s*document\\s*\\}/g,\"\");str[i]=str[i].replace(/\\\\documentclass[^\\}]*?\\}/g,\"\");str[i]=str[i].replace(/\\\\usepackage[^\\}]*?\\}/g,\"\");str[i]=str[i].replace(/\\\\noindent/g,\"\");str[i]=str[i].replace(/\\\\notag/g,\"\");str[i]=str[i].replace(/\\\\ref\\s*\\{\\s*(\\w+)\\}/g,\" \\\\[ref\\\\]$1\\\\[ \");str[i]=str[i].replace(/\\\\url\\s*\\{\\s*([^\\}\\n]+)\\}/g,\" \\\\[url\\\\]$1\\\\[ \");str[i]=str[i].replace(/\\\\href\\s*\\{\\s*([^\\}]+)\\}\\s*\\{\\s*([^\\}]+)\\}/g,\" \\\\[href\\\\]$1\\\\]$2\\\\[ \");str[i]=str[i].replace(/\\\\cite\\s*\\{\\s*(\\w+)\\}/g,\" \\\\[cite\\\\]$1\\\\[ \");str[i]=str[i].replace(/\\\\qed/g,\"\\u220E\");str[i]=str[i].replace(/\\\\endproof/g,\"\\u220E\");str[i]=str[i].replace(/\\\\proof/g,\"\\\\textbf{Proof: }\");str[i]=str[i].replace(/\\\\n(?=\\s)/g,\" \\\\[br\\\\] \\\\[ \");str[i]=str[i].replace(/\\\\newline/g,\" \\\\[br\\\\] \\\\[ \");str[i]=str[i].replace(/\\\\linebreak/g,\" \\\\[br\\\\] \\\\[ \");str[i]=str[i].replace(/\\\\smallskip/g,\" \\\\[logicalbreak\\\\]smallskip\\\\[ \");str[i]=str[i].replace(/\\\\medskip/g,\" \\\\[logicalbreak\\\\]medskip\\\\[ \");str[i]=str[i].replace(/\\\\bigskip/g,\" \\\\[logicalbreak\\\\]bigskip\\\\[ \");str[i]=str[i].replace(/[\\n\\r]+[ \\f\\n\\r\\t\\v\\u2028\\u2029]*[\\n\\r]+/g,\" \\\\[logicalbreak\\\\]LaTeXMathML\\\\[ \");if(isIE){str[i]=str[i].replace(/\\r/g,\" \");}\nstr[i]=str[i].replace(/\\\\bibitem\\s*([^\\{]*\\{\\s*\\w*\\s*\\})/g,\" \\\\[bibitem\\\\]$1\\\\[ \");str[i]=str[i].replace(/\\\\bibitem\\s*/g,\" \\\\[bibitem\\\\] \\\\[ \");str[i]=str[i].replace(/\\\\item\\s*\\[\\s*(\\w+)\\s*\\]/g,\" \\\\[alistitem\\\\]$1\\\\[ \");str[i]=str[i].replace(/\\\\item\\s*/g,\" \\\\[alistitem\\\\] \\\\[ \");str[i]=str[i].replace(/\\\\appendix/g,\" \\\\[appendix\\\\] \\\\[ \");str[i]=str[i].replace(/\\\\begin\\s*\\{\\s*figure\\s*\\}([\\s\\S]+?)\\\\end\\s*\\{\\s*figure\\s*\\}/g,\" \\\\[figure\\\\]$1\\\\[ \");str[i]=str[i].replace(/\\\\begin\\s*\\{\\s*table\\s*\\}([\\s\\S]+?)\\\\end\\s*\\{\\s*table\\s*\\}/g,\" \\\\[table\\\\]$1\\\\[ \");str[i]=str[i].replace(/\\\\begin\\s*\\{\\s*theorem\\s*\\}/g,\" \\\\[theorem\\\\]Theorem \\\\[ \");str[i]=str[i].replace(/\\\\end\\s*\\{\\s*theorem\\s*\\}/g,\" \\\\[endtheorem\\\\] \\\\[ \");str[i]=str[i].replace(/\\\\begin\\s*\\{\\s*definition\\s*\\}/g,\" \\\\[definition\\\\]Definition \\\\[ \");str[i]=str[i].replace(/\\\\end\\s*\\{\\s*definition\\s*\\}/g,\" \\\\[enddefinition\\\\] \\\\[ \");str[i]=str[i].replace(/\\\\begin\\s*\\{\\s*lemma\\s*\\}/g,\" \\\\[lemma\\\\]Lemma \\\\[ \");str[i]=str[i].replace(/\\\\end\\s*\\{\\s*lemma\\s*\\}/g,\" \\\\[endlemma\\\\] \\\\[ \");str[i]=str[i].replace(/\\\\begin\\s*\\{\\s*corollary\\s*\\}/g,\" \\\\[corollary\\\\]Corollary \\\\[ \");str[i]=str[i].replace(/\\\\end\\s*\\{\\s*corollary\\s*\\}/g,\" \\\\[endcorollary\\\\] \\\\[ \");str[i]=str[i].replace(/\\\\begin\\s*\\{\\s*proposition\\s*\\}/g,\" \\\\[proposition\\\\]Proposition \\\\[ \");str[i]=str[i].replace(/\\\\end\\s*\\{\\s*proposition\\s*\\}/g,\" \\\\[endproposition\\\\] \\\\[ \");str[i]=str[i].replace(/\\\\begin\\s*\\{\\s*example\\s*\\}/g,\" \\\\[example\\\\]Example \\\\[ \");str[i]=str[i].replace(/\\\\end\\s*\\{\\s*example\\s*\\}/g,\" \\\\[endexample\\\\] \\\\[ \");str[i]=str[i].replace(/\\\\begin\\s*\\{\\s*exercise\\s*\\}/g,\" \\\\[exercise\\\\]Exercise \\\\[ \");str[i]=str[i].replace(/\\\\end\\s*\\{\\s*exercise\\s*\\}/g,\" \\\\[endexercise\\\\] \\\\[ \");str[i]=str[i].replace(/\\\\begin\\s*\\{\\s*thebibliography\\s*\\}\\s*\\{\\s*\\w+\\s*\\}/g,\" \\\\[thebibliography\\\\]References \\\\[ \");str[i]=str[i].replace(/\\\\begin\\s*\\{\\s*thebibliography\\s*\\}/g,\" \\\\[thebibliography\\\\]References \\\\[ \");str[i]=str[i].replace(/\\\\end\\s*\\{\\s*thebibliography\\s*\\}/g,\" \\\\[endthebibliography\\\\]References \\\\[ \");str[i]=str[i].replace(/\\\\begin\\s*\\{\\s*proof\\s*\\}/g,\" \\\\[proof\\\\]Proof: \\\\[ \");if(isIE){str[i]=str[i].replace(/\\\\end\\s*\\{\\s*proof\\s*\\}/g,\"\\u220E \\\\[endproof\\\\] \\\\[ \");}else{str[i]=str[i].replace(/\\\\end\\s*\\{\\s*proof\\s*\\}/g,\" \\\\[endproof\\\\] \\\\[ \");}\nstr[i]=str[i].replace(/\\\\title\\s*\\{\\s*([^\\}]+)\\}/g,\" \\\\[title\\\\] \\\\[$1 \\\\[endtitle\\\\] \\\\[ \");str[i]=str[i].replace(/\\\\author\\s*\\{\\s*([^\\}]+)\\}/g,\" \\\\[author\\\\] \\\\[$1 \\\\[endauthor\\\\] \\\\[ \");str[i]=str[i].replace(/\\\\address\\s*\\{\\s*([^\\}]+)\\}/g,\" \\\\[address\\\\] \\\\[$1 \\\\[endaddress\\\\] \\\\[ \");str[i]=str[i].replace(/\\\\date\\s*\\{\\s*([^\\}]+)\\}/g,\" \\\\[date\\\\] \\\\[$1 \\\\[enddate\\\\] \\\\[ \");str[i]=str[i].replace(/\\\\begin\\s*\\{\\s*keyword\\s*\\}/g,\" \\\\[keyword\\\\] \\\\[ \");str[i]=str[i].replace(/\\\\end\\s*\\{\\s*keyword\\s*\\}/g,\" \\\\[endkeyword\\\\] \\\\[ \");str[i]=str[i].replace(/\\\\begin\\s*\\{\\s*abstract\\s*\\}/g,\" \\\\[abstract\\\\] \\\\[ \");str[i]=str[i].replace(/\\\\end\\s*\\{\\s*abstract\\s*\\}/g,\" \\\\[endabstract\\\\] \\\\[ \");str[i]=str[i].replace(/\\\\begin\\s*\\{\\s*(?!array|tabular)(\\w+)\\s*\\}/g,\" \\\\[$1\\\\] \\\\[ \");str[i]=str[i].replace(/\\\\end\\s*\\{\\s*(?!array|tabular)(\\w+)\\s*\\}/g,\" \\\\[end$1\\\\] \\\\[ \");var sectionIndex=str[i].search(/\\\\section\\s*\\{\\s*[\\s\\S]+\\}/);while(sectionIndex>=0){str[i]=str[i].replace(/\\\\section\\s*\\{/,\" \\\\[section\\\\]\");var delimcnt=1;for(var ii=sectionIndex;ii<str[i].length;ii++){if(str[i].charAt(ii)==\"{\"){delimcnt++};if(str[i].charAt(ii)==\"}\"){delimcnt--};if(delimcnt==0){str[i]=str[i].substring(0,ii)+\"\\\\[ \"+str[i].substring(ii+1,str[i].length);break;}};sectionIndex=str[i].search(/\\\\section\\s*\\{\\s*[\\s\\S]+\\}/);}\nsectionIndex=str[i].search(/\\\\subsection\\s*\\{\\s*[\\s\\S]+\\}/);while(sectionIndex>=0){str[i]=str[i].replace(/\\\\subsection\\s*\\{/,\" \\\\[subsection\\\\]\");var delimcnt=1;for(var ii=sectionIndex;ii<str[i].length;ii++){if(str[i].charAt(ii)==\"{\"){delimcnt++};if(str[i].charAt(ii)==\"}\"){delimcnt--};if(delimcnt==0){str[i]=str[i].substring(0,ii)+\"\\\\[ \"+str[i].substring(ii+1,str[i].length);break;}};sectionIndex=str[i].search(/\\\\subsection\\s*\\{\\s*[\\s\\S]+\\}/);}\nsectionIndex=str[i].search(/\\\\subsubsection\\s*\\{\\s*[\\s\\S]+\\}/);while(sectionIndex>=0){str[i]=str[i].replace(/\\\\subsubsection\\s*\\{/,\" \\\\[subsubsection\\\\]\");var delimcnt=1;for(var ii=sectionIndex;ii<str[i].length;ii++){if(str[i].charAt(ii)==\"{\"){delimcnt++};if(str[i].charAt(ii)==\"}\"){delimcnt--};if(delimcnt==0){str[i]=str[i].substring(0,ii)+\"\\\\[ \"+str[i].substring(ii+1,str[i].length);break;}};sectionIndex=str[i].search(/\\\\subsubsection\\s*\\{\\s*[\\s\\S]+\\}/);}\nvar CatToNextEven=\"\";var strtmp=str[i].split(\"\\\\[\");for(var j=0;j<strtmp.length;j++){if(j%2){var strtmparray=strtmp[j].split(\"\\\\]\");switch(strtmparray[0]){case\"section\":var nodeTmp=document.createElement(\"H2\");nodeTmp.className='section';sectionCntr++;for(var div in LaTeXCounter){LaTeXCounter[div]=0};var nodeAnchor=document.createElement(\"a\");if(inAppendix){nodeAnchor.className='appendixsection';}else{nodeAnchor.className='section';}\nvar nodeNumString=makeNumberString(\"\");var anchorSpan=document.createElement(\"span\");anchorSpan.className=\"section\";anchorSpan.style.display=\"none\";anchorSpan.appendChild(document.createTextNode(nodeNumString));nodeAnchor.appendChild(anchorSpan);nodeTmp.appendChild(nodeAnchor);var nodeSpan=document.createElement(\"span\");nodeSpan.className='section';nodeSpan.appendChild(document.createTextNode(nodeNumString+\" \"));nodeTmp.appendChild(nodeSpan);nodeTmp.appendChild(document.createTextNode(strtmparray[1]));newFrag.appendChild(nodeTmp);break;case\"subsection\":var nodeTmp=document.createElement(\"H3\");nodeTmp.className='subsection';LaTeXCounter[\"subsection\"]++;LaTeXCounter[\"subsubsection\"]=0;var nodeAnchor=document.createElement(\"a\");nodeAnchor.className='subsection';var nodeNumString=makeNumberString(LaTeXCounter[\"subsection\"]);var anchorSpan=document.createElement(\"span\");anchorSpan.className=\"subsection\";anchorSpan.style.display=\"none\";anchorSpan.appendChild(document.createTextNode(nodeNumString));nodeAnchor.appendChild(anchorSpan);nodeTmp.appendChild(nodeAnchor);var nodeSpan=document.createElement(\"span\");nodeSpan.className='subsection';nodeSpan.appendChild(document.createTextNode(nodeNumString+\". \"));nodeTmp.appendChild(nodeSpan);nodeTmp.appendChild(document.createTextNode(strtmparray[1]));newFrag.appendChild(nodeTmp);break;case\"subsubsection\":var nodeTmp=document.createElement(\"H4\");nodeTmp.className='subsubsection';LaTeXCounter[\"subsubsection\"]++;var nodeAnchor=document.createElement(\"a\");nodeAnchor.className='subsubsection';var nodeNumString=makeNumberString(LaTeXCounter[\"subsection\"]+\".\"+LaTeXCounter[\"subsubsection\"]);var anchorSpan=document.createElement(\"span\");anchorSpan.className=\"subsubsection\";anchorSpan.style.display=\"none\";anchorSpan.appendChild(document.createTextNode(nodeNumString));nodeAnchor.appendChild(anchorSpan);nodeTmp.appendChild(nodeAnchor);var nodeSpan=document.createElement(\"span\");nodeSpan.className='subsubsection';nodeSpan.appendChild(document.createTextNode(nodeNumString+\". \"));nodeTmp.appendChild(nodeSpan);nodeTmp.appendChild(document.createTextNode(strtmparray[1]));newFrag.appendChild(nodeTmp);break;case\"href\":var nodeTmp=document.createElement(\"a\");nodeTmp.className='LaTeXMathML';nodeTmp.href=strtmparray[1];nodeTmp.appendChild(document.createTextNode(strtmparray[2]));newFrag.appendChild(nodeTmp);break;case\"url\":var nodeTmp=document.createElement(\"a\");nodeTmp.className='LaTeXMathML';nodeTmp.href=strtmparray[1];nodeTmp.appendChild(document.createTextNode(strtmparray[1]));newFrag.appendChild(nodeTmp);break;case\"figure\":var nodeTmp=document.createElement(\"table\");nodeTmp.className='figure';var FIGtbody=document.createElement(\"tbody\");var FIGlbl=strtmparray[1].match(/\\\\label\\s*\\{\\s*(\\w+)\\s*\\}/);strtmparray[1]=strtmparray[1].replace(/\\\\label\\s*\\{\\w+\\}/g,\"\");var capIndex=strtmparray[1].search(/\\\\caption\\s*\\{[\\s\\S]+\\}/);var FIGcap=\"\";if(capIndex>=0){var tmp=strtmparray[1];var delimcnt=0;var capstart=-1;for(var pos=capIndex;pos<tmp.length;pos++){if(tmp.charAt(pos)==\"{\"){delimcnt++};if(tmp.charAt(pos)==\"}\"){delimcnt--};if(delimcnt==1&&capstart<0){capstart=pos+1};if(delimcnt==0&&capstart>0){capend=pos-1;FIGcap=tmp.substring(capstart,pos);break}}}\nvar FIGtr2=document.createElement(\"tr\");var FIGtd2=document.createElement(\"td\");FIGtd2.className=\"caption\";var FIGanchor=document.createElement(\"a\");FIGanchor.className=\"figure\";if(FIGlbl!=null){FIGanchor.id=FIGlbl[1];}\nLaTeXCounter[\"figure\"]++;var fignmbr=makeNumberString(LaTeXCounter[\"figure\"]);var anchorSpan=document.createElement(\"span\");anchorSpan.className=\"figure\";anchorSpan.style.display=\"none\";anchorSpan.appendChild(document.createTextNode(fignmbr));FIGanchor.appendChild(anchorSpan);FIGtd2.appendChild(FIGanchor);var FIGspan=document.createElement(\"span\");FIGspan.className=\"figure\";FIGspan.appendChild(document.createTextNode(\"Figure \"+fignmbr+\". \"));FIGtd2.appendChild(FIGspan);FIGtd2.appendChild(document.createTextNode(\"\"+FIGcap));FIGtr2.appendChild(FIGtd2);FIGtbody.appendChild(FIGtr2);var IsSpecial=false;var FIGinfo=strtmparray[1].match(/\\\\includegraphics\\s*\\{([^\\}]+)\\}/);if(FIGinfo==null){FIGinfo=strtmparray[1].match(/\\\\includegraphics\\s*\\[[^\\]]*\\]\\s*\\{\\s*([^\\}]+)\\s*\\}/);}\nif(FIGinfo==null){FIGinfo=strtmparray[1].match(/\\\\special\\s*\\{\\s*([^\\}]+)\\}/);IsSpecial=true};if(FIGinfo!=null){var FIGtr1=document.createElement(\"tr\");var FIGtd1=document.createElement(\"td\");FIGtd1.className=\"image\";var FIGimg=document.createElement(\"img\");var FIGsrc=FIGinfo[1];FIGimg.src=FIGsrc;FIGimg.alt=\"Figure \"+FIGsrc+\" did not load\";FIGimg.title=\"Figure \"+fignmbr+\". \"+FIGcap;FIGimg.id=\"figure\"+fignmbr;FIGtd1.appendChild(FIGimg);FIGtr1.appendChild(FIGtd1);FIGtbody.appendChild(FIGtr1);}\nnodeTmp.appendChild(FIGtbody);newFrag.appendChild(nodeTmp);break;case\"table\":var nodeTmp=document.createElement(\"table\");if(strtmparray[1].search(/\\\\centering/)>=0){nodeTmp.className='LaTeXtable centered';nodeTmp.align=\"center\";}else{nodeTmp.className='LaTeXtable';};tableid++;nodeTmp.id=\"LaTeXtable\"+tableid;var TABlbl=strtmparray[1].match(/\\\\label\\s*\\{\\s*(\\w+)\\s*\\}/);strtmparray[1]=strtmparray[1].replace(/\\\\label\\s*\\{\\w+\\}/g,\"\");var capIndex=strtmparray[1].search(/\\\\caption\\s*\\{[\\s\\S]+\\}/);var TABcap=\"\";if(capIndex>=0){var tmp=strtmparray[1];var delimcnt=0;var capstart=-1;for(var pos=capIndex;pos<tmp.length;pos++){if(tmp.charAt(pos)==\"{\"){delimcnt++};if(tmp.charAt(pos)==\"}\"){delimcnt--};if(delimcnt==1&&capstart<0){capstart=pos+1};if(delimcnt==0&&capstart>0){capend=pos-1;TABcap=tmp.substring(capstart,pos);break}}}\nif(TABcap!=\"\"){var TABtbody=document.createElement(\"tbody\");var TABcaption=document.createElement(\"caption\");TABcaption.className=\"LaTeXtable centered\";var TABanchor=document.createElement(\"a\");TABanchor.className=\"LaTeXtable\";if(TABlbl!=null){TABanchor.id=TABlbl[1];}\nLaTeXCounter[\"table\"]++;var tabnmbr=makeNumberString(LaTeXCounter[\"table\"]);var anchorSpan=document.createElement(\"span\");anchorSpan.className=\"LaTeXtable\";anchorSpan.style.display=\"none\";anchorSpan.appendChild(document.createTextNode(tabnmbr));TABanchor.appendChild(anchorSpan);TABcaption.appendChild(TABanchor);var TABspan=document.createElement(\"span\");TABspan.className=\"LaTeXtable\";TABspan.appendChild(document.createTextNode(\"Table \"+tabnmbr+\". \"));TABcaption.appendChild(TABspan);TABcaption.appendChild(document.createTextNode(\"\"+TABcap));nodeTmp.appendChild(TABcaption);}\nvar TABinfo=strtmparray[1].match(/\\\\begin\\s*\\{\\s*tabular\\s*\\}([\\s\\S]+)\\\\end\\s*\\{\\s*tabular\\s*\\}/);if(TABinfo!=null){var TABtbody=document.createElement('tbody');var TABrow=null;var TABcell=null;var row=0;var col=0;var TABalign=TABinfo[1].match(/^\\s*\\{([^\\}]+)\\}/);TABinfo=TABinfo[1].replace(/^\\s*\\{[^\\}]+\\}/,\"\");TABinfo=TABinfo.replace(/\\\\hline/g,\"\");TABalign[1]=TABalign[1].replace(/\\|/g,\"\");TABalign[1]=TABalign[1].replace(/\\s/g,\"\");TABinfo=TABinfo.split(\"\\\\\\\\\");for(row=0;row<TABinfo.length;row++){TABrow=document.createElement(\"tr\");TABinfo[row]=TABinfo[row].split(\"&\");for(col=0;col<TABinfo[row].length;col++){TABcell=document.createElement(\"td\");switch(TABalign[1].charAt(col)){case\"l\":TABcell.align=\"left\";break;case\"c\":TABcell.align=\"center\";break;case\"r\":TABcell.align=\"right\";break;default:TABcell.align=\"left\";};TABcell.appendChild(document.createTextNode(TABinfo[row][col]));TABrow.appendChild(TABcell);}\nTABtbody.appendChild(TABrow);}\nnodeTmp.appendChild(TABtbody);}\nnewFrag.appendChild(nodeTmp);break;case\"logicalbreak\":var nodeTmp=document.createElement(\"p\");nodeTmp.className=strtmparray[1];nodeTmp.appendChild(document.createTextNode(\"\\u00A0\"));newFrag.appendChild(nodeTmp);break;case\"appendix\":inAppendix=true;sectionCntr=0;break;case\"alistitem\":var EndDiv=document.createElement(\"div\");EndDiv.className=\"endlistitem\";newFrag.appendChild(EndDiv);var BegDiv=document.createElement(\"div\");BegDiv.className=\"listitem\";if(strtmparray[1]!=\" \"){var BegSpan=document.createElement(\"span\");BegSpan.className=\"listitemmarker\";var boldBegSpan=document.createElement(\"b\");boldBegSpan.appendChild(document.createTextNode(strtmparray[1]+\" \"));BegSpan.appendChild(boldBegSpan);BegDiv.appendChild(BegSpan);}\nnewFrag.appendChild(BegDiv);break;case\"br\":newFrag.appendChild(document.createElement(\"br\"));break;case\"bibitem\":newFrag.appendChild(document.createElement(\"br\"));var nodeTmp=document.createElement(\"a\");nodeTmp.className='bibitem';var nodeSpan=document.createElement(\"span\");nodeSpan.className='bibitem';bibcntr++;var lbl=strtmparray[1].match(/\\{\\s*(\\w+)\\s*\\}/);strtmparray[1]=strtmparray[1].replace(/\\s*\\{\\s*\\w+\\s*\\}/g,\"\");strtmparray[1]=strtmparray[1].replace(/^\\s*\\[/,\"\");strtmparray[1]=strtmparray[1].replace(/\\s*\\]$/,\"\");strtmparray[1]=strtmparray[1].replace(/^\\s+|\\s+$/g,\"\");if(lbl==null){biblist[bibcntr]=\"bibitem\"+bibcntr}else{biblist[bibcntr]=lbl[1];};nodeTmp.name=biblist[bibcntr];nodeTmp.id=biblist[bibcntr];if(strtmparray[1]!=\"\"){nodeSpan.appendChild(document.createTextNode(strtmparray[1]));}else{nodeSpan.appendChild(document.createTextNode(\"[\"+bibcntr+\"]\"));}\nnodeTmp.appendChild(nodeSpan);newFrag.appendChild(nodeTmp);break;case\"cite\":var nodeTmp=document.createElement(\"a\");nodeTmp.className='cite';nodeTmp.name='cite';nodeTmp.href=\"#\"+strtmparray[1];newFrag.appendChild(nodeTmp);break;case\"ref\":var nodeTmp=document.createElement(\"a\");nodeTmp.className='ref';nodeTmp.name='ref';nodeTmp.href=\"#\"+strtmparray[1];newFrag.appendChild(nodeTmp);break;default:var nodeTmp=document.createElement(\"div\");nodeTmp.className=strtmparray[0];if(IsCounter.test(strtmparray[0])){LaTeXCounter[strtmparray[0]]++;var nodeAnchor=document.createElement(\"a\");nodeAnchor.className=strtmparray[0];var divnum=makeNumberString(LaTeXCounter[strtmparray[0]]);var anchorSpan=document.createElement(\"span\");anchorSpan.className=strtmparray[0];anchorSpan.appendChild(document.createTextNode(divnum));anchorSpan.style.display=\"none\";nodeAnchor.appendChild(anchorSpan);nodeTmp.appendChild(nodeAnchor);var nodeSpan=document.createElement(\"span\");nodeSpan.className=strtmparray[0];nodeSpan.appendChild(document.createTextNode(strtmparray[1]+\" \"+divnum+\". \"));nodeTmp.appendChild(nodeSpan);}\nif(isIE){if(strtmparray[0]==(\"thebibliography\"||\"abstract\"||\"keyword\"||\"proof\")){var nodeSpan=document.createElement(\"span\");nodeSpan.className=strtmparray[0];nodeSpan.appendChild(document.createTextNode(strtmparray[1]));nodeTmp.appendChild(nodeSpan);}}\nif(strtmparray[0]==\"endenumerate\"||strtmparray[0]==\"enditemize\"||strtmparray[0]==\"enddescription\"){var endDiv=document.createElement(\"div\");endDiv.className=\"endlistitem\";newFrag.appendChild(endDiv);}\nnewFrag.appendChild(nodeTmp);if(strtmparray[0]==\"enumerate\"||strtmparray[0]==\"itemize\"||strtmparray[0]==\"description\"){var endDiv=document.createElement(\"div\");endDiv.className=\"listitem\";newFrag.appendChild(endDiv);}}}else{strtmp[j]=strtmp[j].replace(/\\\\\\$/g,\"<per>\");strtmp[j]=strtmp[j].replace(/\\$([^\\$]+)\\$/g,\" \\\\[$1\\\\[ \");strtmp[j]=strtmp[j].replace(/<per>/g,\"\\\\$\");strtmp[j]=strtmp[j].replace(/\\\\begin\\s*\\{\\s*math\\s*\\}([\\s\\S]+?)\\\\end\\s*\\{\\s*math\\s*\\}/g,\" \\\\[$1\\\\[ \");var strtmptmp=strtmp[j].split(\"\\\\[\");for(var jjj=0;jjj<strtmptmp.length;jjj++){if(jjj%2){var nodeTmp=document.createElement(\"span\");nodeTmp.className='inlinemath';nodeTmp.appendChild(document.createTextNode(\"$\"+strtmptmp[jjj]+\"$\"));newFrag.appendChild(nodeTmp);}else{var TagIndex=strtmptmp[jjj].search(/\\\\\\w+/);var tmpIndex=TagIndex;while(tmpIndex>-1){if(/^\\\\textcolor/.test(strtmptmp[jjj].substring(TagIndex,strtmptmp[jjj].length))){strtmptmp[jjj]=strtmptmp[jjj].replace(/\\\\textcolor\\s*\\{\\s*(\\w+)\\s*\\}\\s*/,\" \\\\[textcolor\\\\]$1\\\\]|\");}else{if(/^\\\\colorbox/.test(strtmptmp[jjj].substring(TagIndex,strtmptmp[jjj].length))){strtmptmp[jjj]=strtmptmp[jjj].replace(/\\\\colorbox\\s*\\{\\s*(\\w+)\\s*\\}\\s*/,\" \\\\[colorbox\\\\]$1\\\\]|\");}else{strtmptmp[jjj]=strtmptmp[jjj].substring(0,TagIndex)+strtmptmp[jjj].substring(TagIndex,strtmptmp[jjj].length).replace(/\\\\\\s*(\\w+)\\s*/,\" \\\\[$1\\\\]|\");}}\nTagIndex+=strtmptmp[jjj].substring(TagIndex,strtmptmp[jjj].length).search(/\\|/);TagIndex++;strtmptmp[jjj]=strtmptmp[jjj].replace(/\\\\\\]\\|/,\"\\\\] \");if(strtmptmp[jjj].charAt(TagIndex)==\"{\"){strtmptmp[jjj]=strtmptmp[jjj].substring(0,TagIndex)+strtmptmp[jjj].substring(TagIndex+1,strtmptmp[jjj].length);var delimcnt=1;for(var kk=TagIndex;kk<strtmptmp[jjj].length;kk++){if(strtmptmp[jjj].charAt(kk)==\"{\"){delimcnt++};if(strtmptmp[jjj].charAt(kk)==\"}\"){delimcnt--};if(delimcnt==0){break;}}\nstrtmptmp[jjj]=strtmptmp[jjj].substring(0,kk)+\"\\\\[ \"+strtmptmp[jjj].substring(kk+1,strtmptmp[jjj].length);TagIndex=kk+3;}else{strtmptmp[jjj]=strtmptmp[jjj].substring(0,TagIndex)+\"\\\\[ \"+strtmptmp[jjj].substring(TagIndex+1,strtmptmp[jjj].length);TagIndex=TagIndex+3;}\nif(TagIndex<strtmptmp[jjj].length){tmpIndex=strtmptmp[jjj].substring(TagIndex,strtmptmp[jjj].length).search(/\\\\\\w+/);}\nelse{tmpIndex=-1};TagIndex+=tmpIndex;}\nstrtmptmp[jjj]=strtmptmp[jjj].replace(/\\\\\\\\\\s*\\\\\\\\/g,\"\\\\\\\\\");strtmptmp[jjj]=strtmptmp[jjj].replace(/\\\\\\\\/g,\" \\\\[br\\\\] \\\\[ \");strtmptmp[jjj]=strtmptmp[jjj].replace(/\\\\label\\s*\\{\\s*(\\w+)\\s*\\}/g,\" \\\\[a\\\\]$1\\\\[ \");var strlbls=strtmptmp[jjj].split(\"\\\\[\");for(var jj=0;jj<strlbls.length;jj++){if(jj%2){var strtmparray=strlbls[jj].split(\"\\\\]\");switch(strtmparray[0]){case\"textcolor\":var nodeTmp=document.createElement(\"span\");nodeTmp.className='LaTeXColor';if(IsColorName.test(strtmparray[1].toLowerCase())){nodeTmp.style.color=LaTeXColor[strtmparray[1].toLowerCase()];}else{nodeTmp.style.color=strtmparray[1];};nodeTmp.appendChild(document.createTextNode(strtmparray[2]));newFrag.appendChild(nodeTmp);break;case\"colorbox\":var nodeTmp=document.createElement(\"span\");nodeTmp.className='LaTeXColor';if(IsColorName.test(strtmparray[1].toLowerCase())){nodeTmp.style.background=LaTeXColor[strtmparray[1].toLowerCase()];}else{nodeTmp.style.background=strtmparray[1];};nodeTmp.appendChild(document.createTextNode(strtmparray[2]));newFrag.appendChild(nodeTmp);break;case\"br\":newFrag.appendChild(document.createElement(\"br\"));break;case\"a\":var nodeTmp=document.createElement(\"a\");nodeTmp.className='LaTeXMathMLlabel';nodeTmp.id=strtmparray[1];nodeTmp.style.display=\"none\";newFrag.appendChild(nodeTmp);break;default:var nodeTmp=document.createElement(\"span\");nodeTmp.className=strtmparray[0];nodeTmp.appendChild(document.createTextNode(strtmparray[1]))\nnewFrag.appendChild(nodeTmp);}}else{newFrag.appendChild(document.createTextNode(strlbls[jj]));}}}}}}}};TheBody.parentNode.replaceChild(newFrag,TheBody);}}}\nreturn TheBody;}\nfunction LaTeXDivsAndRefs(thebody){var TheBody=thebody;var EndDivClass=null;var AllDivs=TheBody.getElementsByTagName(\"div\");var lbl2id=\"\";var lblnode=null;for(var i=AllDivs.length-1;i>=0;i--){EndDivClass=AllDivs[i].className.match(/end\\w+/);if(EndDivClass!=null){EndDivClass=EndDivClass[0];var DivClass=EndDivClass.substring(3,EndDivClass.length);var EndDivNode=AllDivs[i];break;}}\nwhile(EndDivClass!=null){var newFrag=document.createDocumentFragment();var RootNode=EndDivNode.parentNode;var ClassCount=1;while(EndDivNode.previousSibling!=null&&ClassCount>0){switch(EndDivNode.previousSibling.className){case EndDivClass:ClassCount++;newFrag.insertBefore(EndDivNode.previousSibling,newFrag.firstChild);break;case DivClass:if(EndDivNode.previousSibling.nodeName==\"DIV\"){ClassCount--;if(lbl2id!=\"\"){EndDivNode.previousSibling.id=lbl2id;lbl2id=\"\"}\nif(ClassCount==0){RootNode=EndDivNode.previousSibling;}else{newFrag.insertBefore(EndDivNode.previousSibling,newFrag.firstChild);}};break;case'LaTeXMathMLlabel':lbl2id=EndDivNode.previousSibling.id;EndDivNode.parentNode.removeChild(EndDivNode.previousSibling);break;default:newFrag.insertBefore(EndDivNode.previousSibling,newFrag.firstChild);}}\nRootNode.appendChild(newFrag);EndDivNode.parentNode.removeChild(EndDivNode);AllDivs=TheBody.getElementsByTagName(\"DIV\");for(i=AllDivs.length-1;i>=0;i--){EndDivClass=AllDivs[i].className.match(/end\\w+/);if(EndDivClass!=null){ClassCount=0;EndDivClass=EndDivClass[0];DivClass=EndDivClass.substring(3,EndDivClass.length);EndDivNode=AllDivs[i];RootNode=EndDivNode.parentNode;break;}}}\nvar AllDivs=TheBody.getElementsByTagName(\"div\");var DIV2LI=null;for(var i=0;i<AllDivs.length;i++){if(AllDivs[i].className==\"itemize\"||AllDivs[i].className==\"enumerate\"||AllDivs[i].className==\"description\"){if(AllDivs[i].className==\"itemize\"){RootNode=document.createElement(\"UL\");}else{RootNode=document.createElement(\"OL\");}\nRootNode.className='LaTeXMathML';if(AllDivs[i].hasChildNodes()){AllDivs[i].removeChild(AllDivs[i].firstChild)};while(AllDivs[i].hasChildNodes()){if(AllDivs[i].firstChild.hasChildNodes()){DIV2LI=document.createElement(\"LI\");while(AllDivs[i].firstChild.hasChildNodes()){DIV2LI.appendChild(AllDivs[i].firstChild.firstChild);}\nif(DIV2LI.firstChild.className==\"listitemmarker\"){DIV2LI.style.listStyleType=\"none\";}\nRootNode.appendChild(DIV2LI)}\nAllDivs[i].removeChild(AllDivs[i].firstChild);}\nAllDivs[i].appendChild(RootNode);}}\nvar AllAnchors=TheBody.getElementsByTagName(\"a\");for(var i=0;i<AllAnchors.length;i++){if(AllAnchors[i].className==\"ref\"||AllAnchors[i].className==\"cite\"){var label=AllAnchors[i].href.match(/\\#(\\w+)/);if(label!=null){var labelNode=document.getElementById(label[1]);if(labelNode!=null){var TheSpans=labelNode.getElementsByTagName(\"SPAN\");if(TheSpans!=null){var refNode=TheSpans[0].cloneNode(true);refNode.style.display=\"inline\"\nrefNode.className=AllAnchors[i].className;AllAnchors[i].appendChild(refNode);}}}}}\nreturn TheBody;}\nvar AMbody;var AMnoMathML=false,AMtranslated=false;function translate(spanclassAM){if(!AMtranslated){AMtranslated=true;AMinitSymbols();var LaTeXContainers=[];var AllContainers=document.getElementsByTagName('*');var ExtendName=\"\";for(var k=0,l=0;k<AllContainers.length;k++){ExtendName=\" \"+AllContainers[k].className+\" \";if(ExtendName.match(/\\sLaTeX\\s/)!=null){LaTeXContainers[l]=AllContainers[k];l++;}};if(LaTeXContainers.length>0){for(var m=0;m<LaTeXContainers.length;m++){AMbody=LaTeXContainers[m];try{AMbody=LaTeXDivsAndRefs(LaTeXpreProcess(AMbody));}catch(err){alert(\"Unknown Error: Defaulting to Original LaTeXMathML\");}\nif(AMbody.tagName==\"PRE\"){var PreChilds=document.createDocumentFragment();var DivChilds=document.createElement(\"DIV\");while(AMbody.hasChildNodes()){DivChilds.appendChild(AMbody.firstChild);}\nPreChilds.appendChild(DivChilds);AMbody.parentNode.replaceChild(PreChilds,AMbody);AMbody=DivChilds;}\nAMprocessNode(AMbody,false,spanclassAM);}}else{AMbody=document.getElementsByTagName(\"body\")[0];try{AMbody=LaTeXDivsAndRefs(LaTeXpreProcess(AMbody));}catch(err){alert(\"Unknown Error: Defaulting to Original LaTeXMathML\");}\nAMprocessNode(AMbody,false,spanclassAM);}}}\nif(isIE){document.write(\"<object id=\\\"mathplayer\\\" classid=\\\"clsid:32F66A20-7614-11D4-BD11-00104BD3F987\\\"></object>\");document.write(\"<?import namespace=\\\"m\\\" implementation=\\\"#mathplayer\\\"?>\");}\nfunction generic()\n{translate();};if(typeof window.addEventListener!='undefined')\n{window.addEventListener('load',generic,false);}\nelse if(typeof document.addEventListener!='undefined')\n{document.addEventListener('load',generic,false);}\nelse if(typeof window.attachEvent!='undefined')\n{window.attachEvent('onload',generic);}\nelse\n{if(typeof window.onload=='function')\n{var existing=onload;window.onload=function()\n{existing();generic();};}\nelse\n{window.onload=generic;}}\n"),("reference.odt","PK\ETX\EOT\DC4\NUL\NUL\b\NUL\NUL\186\186\vC^\198\&2\f'\NUL\NUL\NUL'\NUL\NUL\NUL\b\NUL\NUL\NULmimetypeapplication/vnd.oasis.opendocument.textPK\ETX\EOT\DC4\NUL\NUL\NUL\b\NUL;\138\vC\163\159\SOHAJ\SOH\NUL\NUL\STX\ETX\NUL\NUL\b\NUL\FS\NULmeta.xmlUT\t\NUL\ETX\177)\bR\177)\bRux\v\NUL\SOH\EOT\245\SOH\NUL\NUL\EOT\DC4\NUL\NUL\NUL\141R\203v\131 \DLE\221\231+<t\173\168\201\162\225\168\217u\221E\251\SOH\EOT'J\171\224\SOH\140\249\252\STXF\139I\ETBu\199}\204\220\153\177\&8\221\250.\186\130\210\\\138\DC2eI\138\"\DLEL\214\\4%\250\252x\139_\209\169\218\NAK\242r\225\fH-\217\216\131\&0q\SI\134\238\"\251Y\187\208d\166K4*A$\213\\\DC3A{\208\196\&0\"\a\DLE\139\141\132j\226\154\ENQ5n\GS\ETB\223%j\141\EM\b\198\211\&4%\211>\145\170\193\217\241x\196\158\r\229\&5[\181\195\168:\175\172\EM\134\SO\\'\141\179$\195\161\222%\254o@\167}\140'\165\\\ESC:\203<\132o\155\167\233\SOH\207\239\208\209\168\186\238\254\SUB\200\234\247\216\166\165\134\198W\SO\211\203\236\186\175%8F\142*\203,\203w\169*\175,|\192\245\CAN\218P\195\181\225\204\147Q\228YC\207\GS\196L\142\194\148\200^\213\131\188\167\205\DC3(\207_\192\204/\SUBV\EM\STX}\134\SYNL\209F\209\161]\136\252NLR\213\v\182\223\148a\173\245\&0\ETXj\173u\216\240B\138xj\185\SOH=Pf\ESC>\201s\132\195\209\ESC\DLE\160\168\145\170z\167\238x\ENQ~\128\221\218\240fo\235s\243\SIW\187\USPK\ETX\EOT\DC4\NUL\NUL\b\b\NUL\186\186\vC\"\STX\240\214\207\ENQ\NUL\NUL\138&\NUL\NUL\f\NUL\NUL\NULsettings.xml\181Z]s\218:\DLE}\191\191\"\227\247\148\144\228\&67LB\aHiiI`\128\&6s\251&\236\ENQt#k=\146\FS\224\223\223\149\fi\n8\165\182\245\148\137?v\165\213\238\158s\214\220|X\197\226\228\EM\148\230(o\131\250\187\179\224\EOTd\136\DC1\151\243\219\224\219\164{\250O\240\161\249\215\r\206f<\132F\132a\SUB\131\&4\167\SUB\140\161G\244\t\189.u#\187}\ESC\164J6\144i\174\ESC\146\197\160\ESC&l`\STXr\251Z\227\245\211\r\231,\187\178\DC2\\>\221\ACK\vc\146F\173\182\\.\223-/\222\161\154\215\234\215\215\215\&5ww\251h\136r\198\231\199\186\202\158~\237\n\DC1_\FS\217\ETB\178\197\&8g\231gg\151\181\236\255\224d\179\200W\161\&9\SI\154\219\&8l\183\223\188\217\&8\200\254\156r\ETX\177\141\205\201\230\178]\218m@.\ESC\207\FS\150/Q\v\SO\189\247\235;\223\233\249\150\STX6\193$\216\222\&1\235\132\238pi\130\230\217Mm\223\194\241V\251\&03\RS\204>\242\200,\SO\217=\175_]^\149\179\253\EM\248|qp\209\245\179\DEL\174.\139\EM\US/p9\130\136\242\v:\v&\231\160w\FSL\DC1\ENQ0\EM4\141J\161\152\143\158l+\\j\184\199\b\242\172\207\152\208G\155?\141Yr\202e\EOT+\136\246cu8\185\220;T\SYNj}\\\196{\209\206R\181Q\148\185A\211\230\241y\241\147\204K\188\139\179\203zq\171\&9ER\198\168\230S\SOH\149\151\137\179ZuI;\163\163\188\234\176\165\247w)\211m4\ACK\227\188\202\187(f\251\ab<!K\187i\182@U\174\SI\245\217\SUBS\211A\145\198r\183\154\171\178\222F|\170\172\156\247\227\210e\161Aux\237\245\179\130\171\239\233\&1\b\b\rD]E\ETB\n,\253\192\197\215m%\239\246\166S\GS~\128\DLE\241x\f\205.\164\138\EMB\228?\SOHS\234\237\202\180R\131\223\146\136\153\220\189\151\232\241\186\207\166 \238\&6\228\195C^\220\&3\179h3\r\SYN\170Z\130\207\165'?#\205w[\DELV\234\151W\ETBW\245\235bF\a\169\177\235\238\195\&3\136\DEL9\136H?\164\241\DC4\FS\162T\191\133!\217\&5\182u\SI\153\ETB@\191\195\a4_Rm\248l\221\167m\233Gn\SYN\247L\166L\180\137\168<y\216RG\240$\129h\200C\147\170\252=\149\240\224rj\194\166c\131\201\DLE5\183%V}\232\220\209L`e\134\130\133\176@\DC1\193n\159\171b3\223\&4\fD\228\&3\199:\169RT\128w\204\176)Ue\a\227\152\201\FS\206T;&.h\168\&7wQ\237\226le\ENQ\209\166\136?uQ\SUB\US\217\227<\208&tB\187\CANM\250\RS\\\180i\249s\133\169\140\134L\177\SOH\233\178;\197\150\SO\NUL\170w\214\NAK\200\f\GS\173\128\a\140\153\154\243=*Q\133\151q\204\132\232\176D\SIA\133\148M\212\174\222\191\247u:\GS:z\133\194C?\252He\SYN\141\215\154n\248\202/\v\224D\138@Q\161%\212\NUL\173$\175\156=\186\&0}\230Q\EOT\210\182(?}\201\150\&8(k\255Q\177$\241\211\157z\250+(\217\210\156\201a*\t3\216[\237\188\170\186\247e\255c\156\152\245\155X^\230H\228\212b\182+\245-^x\241\179=\250\193\244?\138\213\SYNb=\161\DC3J\162q?\211l \201+\185\244\224jb#7\194\229W\128]U[Y\STX\140\192N\225`\ETB^+Z\190\RS\129\160\250x&]\222#\169\146\207\170K\210\RS\167\208=Q\210\172\SOY\STX\170\171\&0\RS\131I}\FSF+\202\180\227`6#\241\229\133\133F\SO\221\199\t\v\169\&2&\232\178\171\ETX\194\aleZ\208\198k\STXq\"\188\232B\218\207\199\NAK\193\150d\162\SI,z\163\218K\158\253\152L\v\248\130So\236\SO\148\173\SO;a\167\DC2\201\198 9#\194\ENQ%\250)\129\&4\138\212\182\184\226:t\132xx\224[F\139\146b{\202\142\254\192\EOTg;d)\DC1\167\150\148h\FS\222\230\219/HP\168\SUB,\239\189w\132\212\155l\218\156\246=\208q\134>\210i3p\223h\RS\n\212WX\239\186!M\245\254\178\205%S\235\227\244\147[\243\193\198\247\135\166zs\137\n\186\\ic\197}\ACK\t=\233UL\162\DLE\164\STX\192\DC1\GS\219\237l\SI\244\212(@=\236O\255\142\ETB\170\142\235\251b\249=I\217m\218\168\136\186l \192\ESCg%\FS\254\169(=\205\136H\218\217q\141\213\169\196\191\244@Z\175~H\140\237\v3\129K\SI\DLE\150$bM\157A\217YG\245\230i\237-7\172\203\n\141\&8\178M\254\&9\145\214\133\238\201>\215^t\152\\\145\163\DLE~\128B\194\231\223@s\EM\133\207\158\225{\246\ENQy ;\STX\181\143\227w\t\221e\171R\133=6k\SOH\250\SOH\239`\198R\225#\232\ESCn\231(\221o\170\187d\143\251\221`\168\184\249>\178hD\217\130R\236AVU'\249\201\230\254\ESC\200[|\245];z\247\249\EM\164%\168\ENQ\185M\DLE\DC3\237\&0\EM\130\240\192\219\183J\218\194\179?\152\176\165\251I\224\148\189|\213\177\204\209\203p\235\215Y\178\253;\198T\133\197\139\&9\227\&0V\219\182d\212\SYN\140\214M!\179\241\234\&0\DC1\166\194\215\&8\232\240T\252\192\160\174\204\ao\a\173# \ENQj\219I\203\CANe7G\252\204\210\DC2O\223^Z\250e\STX\217\146!\145x\136\RS\NAK=\170\186b\237$\177\&7\217\229\218\165\135^p\160\ESC\183\204\216\&0U`\252\145\251a\183\182\247s\169Z\222\SI\201\154\255\ETXPK\ETX\EOT\DC4\NUL\NUL\b\b\NUL\186\186\vC\250+^\183\175\ETX\NUL\NUL+\SO\NUL\NUL\v\NUL\NUL\NULcontent.xml\165W\223o\219\&6\DLE~\223_\161i@\223\CAN\198\241\ACK4j\236bhQl@2\fM\138\245\149!)\155\ESCE\170$e\217\255\253\142\164EK\142e\v\240\139l\241\190\239\238x\191H=|\220V2\219pc\133V\139|vs\155g\\Q\205\132Z-\242o/_\208\251\252\227\242\167\a]\150\130\242\130i\218T\\9D\181r\240\155\SOH[\217\"J\ETBycT\161\137\NAK\182P\164\226\182p\180\208\&5W\GS\171\232\163\139`+\174X\183\147\147\233\SOH\220g;\190uS\201\RS;\224\146\215\233\150\ETX\184\207f\134\180S\201\RS\vA\237\211K=\149\188\181\DC2\149\SUB\162^\213\196\137#/\182R\168\255\SYN\249\218\185\186\192\184m\219\155v~\163\205\n\207\238\239\239q\144&\135i\194\213\141\145\SOH\197(\230\146{c\SYN\207nf\184\195V\220\145\169\254yl\223%\213T\175\220L\SO\rq\228MV\237f5\185\"6\171\145\208\208\&51\147k#\128\135\233\157\179\233\233\157\179>\183\"n=\146\147\247\248\t\132\225\241\244x\168\ENQSM\181\229\177\131PQ#\234\201\219\140\232>_k\157\\\245\132\216\160\193\221\187\219\219_q|\239\161\219\179\240\214\b\199M\SIN\207\194)\145\&4E\\W\167\130\ACK\184\EM\ACK\EOT\226\ESC_\166\169\240} \236\b\225\SOGq\STX[6\170\250\251\211\227\&3]\243\138\FS\192\226\&2\CAN\te\GSQ\135\200\CAN\159\132\209\157\254\134\r\175\181q)0\229\244\129\t\217\186K\190\173]%\199\219\221K;\232\202\&0v\DC2\n\238\204\&1\180>4\RS\218\b\222\254\146\SI&\249\249\130\184?*\136\&0\SYN/Q\STX\168?7\207\DC2f\183\216cR\ESCC\137\FS\134\188Y\165s\168\212\141\130M\192\217\181\SI \223\214\220\b/\"2\208\138\129\134\193\244\NAK\\v\237\157\236\159R\ETX\158\162\202B\182\161\170u]\244\216\195an\170\237\&4u\190\146\&5+\143\&5\RSu5\181v\238N%\239\229+\246\&2\228\207\&2\152\214{K\189\&3\252._v\avlv\139\211B\t\a7*\t\229\136q*\237\242!\SO\222\180\156\197w\239\247\"\DELv\196<\239\170W\r\NAK\ENQC\182CUB\238\ACKB|^\205\vY\235\138\204N\232\136\146K\252O\186\&1\130\155\236/\222\158\208\241\142\212\218~\232a\226B\158\rTz,Zq\ENQy\128qTi\198\141\SUB@j\225(L\236Rl9\187\184!\200\165\245\166\178\175\224\190\SUBu\234\b7\193\&1\179\215\247\198\175\r1\"\180\208\ENQ\215~\a\216\169lu\235\227\166m+\172\189\198\244cC\ENQ#\217\&3Q6\251\166\EOT\\\"\249hdN`'D\199\238\172\227\213\&5>\238\vn\180\DC2\175\183\142\199\SUBm\191N\SUB\a\134\156\160(\232I\GS\CAN\158\ETX_\255\158%[{'kb\200\202\144z\221\t`\193\223\198\195\v\138\172/Z\251\211\183S\155(\168\134Q\195\141\DC3P\145\165\SO\ETBaD\164X\193\196\160\\\133\ETX;2\254m\172\DC3\229\SOY\184\173\130\214V\ESC\152\146%\145\&6n\175\231\237a\179o7\181\ETB\188j\182K/\222\230\242!\\\193-\255\209\192wF\n\206\219\197,,1akIvH7\SO\238\177\FSI\184\SOH\192\137\ACKC2\136\227\150\255\148\DC2|6\225\FS\240>^\165\236\165K\228uZ\224\239\213J>\199O\134\DLE\246\241\168\213\145\210\175\SOH\CAN\205p,\SUB\150/\255\224R\234\236\USm$\251y\175\164>\164-&\EOT\SIr\133G>\245\150\255\ETXPK\ETX\EOT\DC4\NUL\NUL\b\NUL\NUL\186\186\vCq\197\131\202\DC1\ETX\NUL\NUL\DC1\ETX\NUL\NUL\CAN\NUL\NUL\NULThumbnails/thumbnail.png\137PNG\r\n\SUB\n\NUL\NUL\NUL\rIHDR\NUL\NUL\NUL\198\NUL\NUL\SOH\NUL\b\STX\NUL\NUL\NULg?\158\ETB\NUL\NUL\STX\216IDATx\156\237\214A\n\194\&0\DC4\NULQ\ETX\222\255\202_\161 E\DLE\186\CANQ\235{\139\240\179j\SYNC\210\235\204\\\160s\253\244\SOH8\ESCI\DC1\147\DC41I\DC1\147\DC41I\DC1\147\DC41I\DC1\147\DC41I\DC1\147\DC41I\DC1\147\DC41I\DC1\147\DC41I\DC1\147\DC41I\DC1\147\DC41I\DC1\147\DC41I\DC1\147\DC4\177,\169\181\214\204\220\215m\251\152\183\225i\173>\202\ETB*o\169GO\251y\ESC\246+\231\246\222\135o\DELo\241'\178\164^=g\158\185\DEL\227\247\156\152\164\136I\138\152\164\136I\138\152\164\136I\138\152\164\136I\138\152\164\136I\138\152\164\136I\138\152\164\136I\138\152\164\136I\138\152\164\136I\138\152\164\136I\138\152\164\136I\138\152\164\136I\138\152\164\136I\138\152\164\136I\138\152\164\136I\138\152\164\136I\138\152\164\136I\138\152\164\136I\138\152\164\136I\138\152\164\136I\138\152\164\136I\138\152\164\136I\138\152\164\136I\138\152\164\136I\138\152\164\136I\138\152\164\136I\138\152\164\136I\138\152\164\136I\138\152\164\136I\138\152\164\136I\138\152\164\136I\138\152\164\136I\138\152\164\136I\138\152\164\136I\138\152\164\136I\138\152\164\136I\138\152\164\136I\138\152\164\136I\138\152\164\136I\138\152\164\136I\138\152\164\136I\138\152\164\136I\138\152\164\136I\138\152\164\136I\138\152\164\136I\138\152\164\136I\138\152\164\136I\138\152\164\136I\138\152\164\136I\138\152\164\136I\138\152\164\136I\138\152\164\136I\138\152\164\136I\138\152\164\136I\138\152\164\136I\138\152\164\136I\138\152\164\136I\138\152\164\136I\138\152\164\136I\138\152\164\136I\138\152\164\136I\138\152\164\136I\138\152\164\136I\138\152\164\136I\138\152\164\136I\138\152\164\136I\138\152\164\136I\138\152\164\136I\138\152\164\136I\138\152\164\136I\138\152\164\136I\138\152\164\136I\138\152\164\136I\138\152\164\136I\138\152\164\136I\138\152\164\136I\138\152\164\136I\138\152\164\136I\138\152\164\136I\138\152\164\136I\138\152\164\136I\138\152\164\136I\138\152\164\136I\138\152\164\136I\138\152\164\136I\138\152\164\136I\138\152\164\136I\138\152\164\136I\138\152\164\136I\138\152\164\136I\138\152\164\136I\138\152\164\136I\138\152\164\136I\138\152\164\136I\138\152\164\136I\138\152\164\136I\138\152\164\136I\138\152\164\136I\138\152\164\136I\138\152\164\136I\138\152\164\136I\234\144\181\214\204|\250\DC4\191AR\135\232\233\&8I\DC1\147\DC41I\DC1\147\DC41I\DC1\147\DC41I\DC1\147\DC41I\DC1\147\DC41I\DC1\147\DC41I\DC1\147\DC41I\DC1\147\DC41I\DC1\147\DC41I\DC1\147\DC41I\DC1\147\DC41I\DC1\147\DC4\177\ESC\b\SUB(\EOTp\211\ESCp\NUL\NUL\NUL\NULIEND\174B`\130PK\ETX\EOT\DC4\NUL\NUL\b\b\NUL\186\186\vC\180\247h\210\ENQ\SOH\NUL\NUL\131\ETX\NUL\NUL\f\NUL\NUL\NULmanifest.rdf\205\147\205n\131\&0\DLE\132\239<\133e\206\216@/\ENQ\ENQr(\202\185j\159\192\&5\134X\ENQ/\242\154\DC2\222\190\142\147VQ\164\170\234\159\212\227\174F3\223\142\180\155\237a\FS\200\139\178\168\193T4c)%\202Hh\181\233+:\187.\185\165\219:\218\216\182+\US\154\GS\241j\131\165\159*\186wn*9_\150\133-7\fl\207\179\162(x\154\243<O\188\"\193\213\&8qH\f\198\180\142\b\t\RS\141Bi\245\228|\SUB9\206\226\tfWQt\235\160\144y\247 =\139\221:\169\160\178\na\182R\189\135\182 \145\129@\141\tL\202\132t\131\FS\186NK\197\&3\150\243Q9\193\161\237\226\199`\189\211\131\162<`\240+\142\207\216\222\136\f\166\229^\224\189\176\238\\\131\223|\149hz\238czu\211\197\241\223#\148`\156\&2\238O\234\187;y\255\231\254.\207\255\EM\226\175\180vDl@\206\163g\250\144\231\180\242\USUG\175PK\ETX\EOT\DC4\NUL\NUL\b\NUL\NUL\186\186\vC\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\US\NUL\NUL\NULConfigurations2/images/Bitmaps/PK\ETX\EOT\DC4\NUL\NUL\b\NUL\NUL\186\186\vC\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\SUB\NUL\NUL\NULConfigurations2/popupmenu/PK\ETX\EOT\DC4\NUL\NUL\b\NUL\NUL\186\186\vC\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\SUB\NUL\NUL\NULConfigurations2/toolpanel/PK\ETX\EOT\DC4\NUL\NUL\b\NUL\NUL\186\186\vC\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\SUB\NUL\NUL\NULConfigurations2/statusbar/PK\ETX\EOT\DC4\NUL\NUL\b\NUL\NUL\186\186\vC\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\FS\NUL\NUL\NULConfigurations2/progressbar/PK\ETX\EOT\DC4\NUL\NUL\b\NUL\NUL\186\186\vC\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\CAN\NUL\NUL\NULConfigurations2/toolbar/PK\ETX\EOT\DC4\NUL\NUL\b\NUL\NUL\186\186\vC\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\CAN\NUL\NUL\NULConfigurations2/menubar/PK\ETX\EOT\DC4\NUL\NUL\b\b\NUL\186\186\vC\NUL\NUL\NUL\NUL\STX\NUL\NUL\NUL\NUL\NUL\NUL\NUL'\NUL\NUL\NULConfigurations2/accelerator/current.xml\ETX\NULPK\ETX\EOT\DC4\NUL\NUL\b\NUL\NUL\186\186\vC\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\CAN\NUL\NUL\NULConfigurations2/floater/PK\ETX\EOT\DC4\NUL\NUL\NUL\b\NUL\205f\"DQ}\226,\EM\DC2\NUL\NUL;\213\NUL\NUL\n\NUL\FS\NULstyles.xmlUT\t\NUL\ETX\STX\210\197R\STX\210\197Rux\v\NUL\SOH\EOT\245\SOH\NUL\NUL\EOT\DC4\NUL\NUL\NUL\237]\205\142\235\182\NAK\222\231)\f_\EOTE\ETB\178%\249\DEL\144i\144\166-R\224\166Mso\214\ENQ-\209\182\SUBY\DC4(j<\147U\SYNE\247E\129\182\139\162@\251h}\128<CI\234\143\250\&5m\209c\206\140\DC3 \185\SYN\SI\201\195\239\FS\RS\158\143\"u?\251\252q\239\SI\RS \142<\DC4\220\SI\173\145\&9\FS\192\192A\174\ETBl\239\135\&1\217\CAN\203\225\231\191\248\228\&3\180\217x\SO\188s\145\DC3\239a@\140\136<\249\&0\SUB\208\202At\151\DC4Rq\FS\220!\DLEy\209]\NUL\246\&0\186#\206\GS\na\144U\186\DC3\165\239XW\159$Oxc\178\213\185\176X\155\192G\"[\153\201\150\234\130\181|\207\\X\172\237bp\144\173\204d)\166b\245\r\146\173\252\CAN\249\198\ACK\EM\SO\218\135\128x\NAK-\RS}/\248\254~\184#$\188\ESC\143\SI\135\195\232\&0\EM!\188\GS[\171\213j\204Ks\133\157\\.\140\177\207\165\\g\f}\200:\139\198\214\200\SUBg\178{H\128\172~LVT)\136\247k\136\165\161\SOH\EOT\212\172\SUB=l\165=\226a\219\STX\141\179\ETXX\218\&7\184p\217\188\DC3W\222\188\DC3W\172\187\ad\215b\147\229\248kZ\200\255\243\245\251\194\ETB\240^\182/&[\130\202\193^(=\204DZ\172\143\DLE\202Ue\NAK\146\t\202\213\181Ms:N~\v\210\135N\241\ETX\246\b\196\130\184\211)\238\NUL\223\201\DC1G\251&\208\168\156\&5\166\DC2\ACK|`n\154Ic6\232\214\150gc\fC\132I\174\200F>@Qt\236|z\237\200\222o\159^\172\&4\DC3\221b\215m\DC4\165\234L\198t\170QG7\RS<xxW(\197T\238\&6\192\170b\NUL\RS\134\142U\225Bb\156\234\172`\153c&\147O\ESCj\146\"\168\226m\RS\246\&7(\SO\232 \232R\145\STX\b\USC\136=V\EOT|^\237\174\212Bi.F\209\132\&4\129\243\241\219\&1+3Xl\RS\SI\a\233\242 ,I\246\240\ETB\159\f\ACK\217\DC2\180At\249\217\NUL\a\SUB.t\252\136\NAK\209\194$~\228e\131\228\&7S\242~\248\129\NUL\252\225i\191F\212PL\152\198\139Lr\239\249O%\129\193X\162\193\143`\135\246\192ji-)\149k\233K\DC4c\SI\226\193\239\224\161\165\181\159\t\"?Ke\196\ACK\153\148\177\133\SOH5\ETX\157g{\228B\FS\fE\145\208#\SO\rE\ESC\239\DC1\186\146\195\163\ACK\141X\DEL\131o\233@\130\&6\197*b\199\149\195Bk5\253\RS\NUL\246\184\207J\169\248\ENQ\NAK\166\198\170)\149<?\166Ht\240\162H\141\"\239c\199s\193\224\ETX\b\162\193w\129G\DC3'\216\134W\131\232q\204\162\167\136\192\189\SUB]3\199l\243X\165\186|6n\159\175\217TN\146\200\146\230.\220\128\216O\243\203\172\151T\205-\ACK\225\206s\134I\133\188J\250\216\b1\141k\152x\212)7\232\238@\159\SUB($<\134\176\US\195\180\SYN\vtw\209\SO\184\232`P=\"H\140\199\251\161\&9\178\172\165\229\ENQ\GSROmR4z\DLE\131\166Y\208\136B\224\208$\207\216!\236\253\128XPL\234X\211\227u\RS\152\238Nk\r\186J\157\216G\173F{\SI)\206>\GS\236\193#;#I\169\&7\192\143\n\215\202\241\SO\SOH\ACK\FSs\DC1\241\164\136\213\&3@L\DLE\235\146z\156\231B\148\136\STX?\220\129rw\\\183\&5\134\128&\175\DC1\161\RSF\178\184\197\&2\b\166\&0\139f\247C\US\ESCd]\209\148\249\148\ETB\184\144-\222\140\142\136\227\204\DC4\207\212\206\NAK\167k\"\245+\DC4F\194\144\198\237c\170\f\155\143\173\&6\226\&8\130\DC4\178\128\185\tW\202A>\162\137/\193\&1\204T\166\206\200\139\"\239\a:\SUB\203\SO\233\&8\233\&3\US\EOT\219\CANl\233#\CAN\240\a\SO]\\\t\166^\246\221\135\nP\144\208\132\202\248\158Fv><\222\184\136\EOTk\217\160i\r\b\210\246\203\213\211\142\&2\137\US\RS\US\179\218i\151YI\128\STX\216\NUL4o\158%\216>|\204\ACKPi:/e\141\151Z\200\186\200%x'y\188\SUB7L{\233\128\144[\173\SUB\DC2\SUB]\148B\188{\nw0\224\t\140\225\ETX\151\174\149\ACK\215\143iE}h\239U\160;\201\159\195\&8pH\156\&4\206\STX\SO\205u(<\212b\195v\135/\247\150\250\167\225z4>\EOT\172Cs4]\217\179\234D-\207\143\144\SUB\160>K\207vW\193\240\205\233@\147C\ETB\174\222\233\214]\SO\221\220}\230\154\173\235l\221S\197\137\208\&1\ENQ\SUB\189T\156\b5Ur\ETB\SYN\215\203\139\207\DC4\193ma\SYN\218\n\184E\143\198p\SI\188\192`<6sk\187E4\140\163]EP\205\148LxG\213\ETB\217C\209\EM\147\157\148\&5\194l\ACK2/\166k\DC2uE\US\132\DC1\159/\234T10:4\171C\v*\209\225{\bC\131\160-$;\182y\193\230\253\t\170\136*\228\188\131\178%\236\SO[\195\150\144J9>\136\"\170\&4\157\182\213l\174\222\242W\DLE\184B`\233l\152>\204\&7\236\140\138b\130X\192\226\133(\244\145>\248\163m\254q\141\220\167a\131\146\146!w\SI0\141\129\DC4\214\144\167\GS\243\185\DLE\205\138\226\&5\"\132q\DELsd.'L\"\159\DC3\SOH\235,\ACK~uu/\154\224f\227iK\192\211\SYN\224\US\192S$\ESC\DC1\133@'\144\135\218\170=\173\174\170*\"\212\180\136\SI=\162\fo\165\226\166\&2\238Y2\176\224\tt\245\t}\240$\184\193@\244\129\179\157M\149\SI\153\179\213\242\136\SI\149$\142y\210\&9\216\189\167+\244\185\128tL,\159\&5{\154\219V\253\197:k<_\STX\206\148\DC4\219\152j\142\193\153FN\194\128\186@\193w\254\147}i\206\SYN\162\220\252\188\132\231f\217\182\181y<xt\230@I\t\171GSFJ\208(g\149O\215\139\202\153L\218DK\248\169\217_*-i\235\&2\151\202\244>\195\153~K9\217\163bW\242x\155\&2\174\212jh\209\DC1N5\247E&]\186\138\179X`\181\a\224Tj`\157\139h\150,H/\246\162*i\186\131b\194!\243\225\ETX\203\213,\137`~d\198X\179O\171\&3\230\NUL\189\237\142.\224k\228\187\237\DC3F\168(\136$u3\161\230\SYN\138\EM\208\217F.\150\180\210\207\176\246q\195\218\SUB\EM\214\238o\216\233\209P\216h\239\DC3S%\185\NULy\154W4\231x\205q\241y\188gr\220{&\SUBy\207\228\"\222#\ETB\SYN\154\141\167\194\SOH.a\216\233q\195N52\236\180\183a\151\245p\223?*\176F/\FS\DC4\150\141+\197\&5c\194\236\184\235\204\&4r\157\217%\\G*$4\155N\129\245/a\213\249q\171\206\&5\178\234\188\183U\ETBgZu\209\223\170\157M\244\183\234\USbD\248.k\164\152\ETX\241\163&\167\177i\USn\b#\203\147\213d\209D\167q\130x.\208\176c\215\205\194\173\211\246\234\184Ox\252\157\GS\173]\212e{\173F\169\240\252\189\153o0d'\164\NUL!\208e.\205\\\187}v\137\210\ETX.zu\163%\200w\226.\131\250\233\ESC\160\181\211(\181mP\179i\199\&2\157u\r\181\219\146\&5\179}75\159\DEL\DC2\205\NAK\153\155y\230\RS\232\175\224\198\v<6Y\DC3O\193\251vO)d\a\\\176\175\159t\133\227\178^\197\175\151\187c\218:\"\EM\188\155\197\235\200\247D\189\180\b\158\ETBh\ESC7-\179(\155\ACK\216Z\DLE,\193\174\&2\DC4~do\186\216\136\190d\182\228G'\219\208\230\162\131\\\238\250\ESC\193\EM\162\166\189Zu.]\169@\SId\251l\EM\158e\142\134\140\172\201\SUB=_\243uZ\255\SUB\150\161,i\ESC\176\179\SI\NULW\226\255\159\226\136x\155'\131\189\254\165\250\US\DLEvs\235\156o\215\212\SO\252\DC4W\249t\203\133\222\ACK\FS\225\174\rY\234\ENQ\243\208\223 D\STXD\160Fs\217Z5\191\254\237\n\144F\181\218\ENQ'\179\236.Us\254\"\145\226(J[\152i!\190\154a\207\129\184\253\&4^QR+\203\198\128\"/9\200\&9\EM\137\167\161\138Q\146\167\144\SO\204\161#e\176\140Oir>\234h\145;f\169\193\204L5\245\143\US%\236\151\152\242\255sud3\212AM\\y\198\212\150\213\NAK\202\158\151\176.\154W\SYN!a-I<g\194z\154\GSD\147(\177\198\229\210R\181\236\243y9\255\175\128\130u\238\\j\208\186X\176\210^o\210\191\136\201\SO)\139\243\245\217\203P\DC3\218\216\131\136\157\203d\aJS\t)w\203\138\182E\188/\157\157{\ACK\160\190\202\SI\195\&3#\189\247\STX\216>;\v\217\SOH\ETB|6\183y\142\141\161,W\146\157\159\137Xz\DC2\147/\217\a\207%;1\210\154\230\210\v\ACK\244\SI\214$\253\ETX\DEL\"(\DC1\STX7\185/\156\133\146\172=\RS}\242c\172\233\211\&4\236\136\233xQ\200\135X\173\145)c\141,+$\ETX\ETB\197\140\GS\189[\154\236\223\243R\250\&2\251@\FSB\214\151\244\230Y9#\156\USM\b\231\213\ETB\216\165Lp~n\"\232\225\136;X\163\215\150\253\158\203\SOj\139\205U\SO\143\RS=\225\250;n\169\244\229Hr7\175c\243\"\151\RSd\162\149\193\201u\250\203\216\247!\145\234\&1\DC1\237\236\238\212\221\215\234\&5\197\234\230\235\170c\239\181^\183\197\rW\DC2;\175\199\ESC\203EWg\250\237\175\247\225\142\221\195=\a\184\230U\163AS\238\143\199\222\ACK'R*\142\189} \CAN%\254\154\143\174\213}\DC2\217\129\n\CAN\180\218s\160\227\242\190\135(\174\189E\145\159\DC1\252)\143\214d\135Q\188\221e\134\142\144\239\157\169UL\187H\238\189\247\212\171\160\141\DC1ks0[~z\166Fk\229\250\172\207\214\230K/ya\249\154f\227GH\227\&3\229\240JBs\247\187(\249\151`\237o\184\206;gK\179\245 Y\176\146\175|\180\133\155Lr\192\197\206\179rzU\236\157\201\210\191J\STX\197\197c\202\226pr\DC1S\156\176]\130<\215L\217B\151\\\218wqe\173\215\134h\177\192w$K\169\236 \251.\192\&9\249\132\216!\b\FSF\229\142w\152\n\234\DC1\167\132\ETBo\157\b\240\DC4;;#Ro\230\247II1\128\146<?S\146\214Jr\245\202)c\154\182\ESC\201Kz\129\145\230Z\179K\DC3i\ESC\213=\202=\219\STX\SOHkZ\"^\169\180\&8A\DC2\238\NUL\183is\154\186\246\203Rw\242\178\212\157\190,ug/K\221\249\203Rw\241\178\212]\190,uW/K]\171\146\140\\W\235J\185X\146\238CE\164a\133,\237wt\220\ACK*v:\172\202j*\f,\201\162\147\205\174\202\138*n\150\165b\237\251-\STX\160Q\188\217x4g\GS\181cm\157\tv\154\EOT\SYN[\151U\172[Fv\250\240m}\134\207?(a\172\217\217\195\196\203V\v[|\ry5\140&\250bT>\196zE\140\166\250b4[\153+-0\154\233\139\209b\185\152j\129\209\\_\140V\203\233\\\v\140\SYN\186bd\141\172\165\&5\211\STX\163\165\190\CANM\232d\211\STX\163\149\190\CAN\205\SYN3=\214~\203\212\ETB\164\197\194\190\\\208\SYNe\206\202\216;\174y\ETB\EM\187\253\172\EM\251[H\203\139\&1\150[`\USW|\NUL~\fY\227\253\210\242\185\RS!\254\252\180\\\STX\163I\207\180\220\150J9\179+f\SUB\166\229\DC2\CANM{\166\156s\169t*\253\218\159\142i\185\EOTF\179^\DC1\222^\172,\EM\140(\197\177\&5M\203%0\154\247\194h9_Md0Z\152\FSK\GS\211r\t\140\SYN=0\178i:\181\148\194he\206tM\203%0Z\246\192h2\154.'\DC21\219\SUB\153\246d\174iZ.\129\209\170\aF\211\209\204\\H\172\253\148\ACK\154\246R\215\180\\\STX$\171\225n\134\&4J\179\209\220\&2%\200\v\141\238\&6\223\152z\230\188\188\227\ETX:E^>y\137y9\223~\184l\140\215\&6/\151\221zy\ACK\140\180\205\203\237\209dnK\228\156\207\128\145\182y\249d4\155N%r\206g\192H\219\188|:Z\216\&2\219S\207\128\145\182y\249\140\230\146s\137\156\243\EM0\210\&6/_\140\204\229b\169\ENQF\218\230\229\203\145=_J\229\229\ETB\199H\219\188|5\154\234\177\242k\156\149[\230h>\185`\130\212;-\239\248\252a\145\150O\159\&5-\151x\129\241\219W\188\147.5\252\vl\175\191\133S/\141\192\245\221s\DEL\vGa\SUB\129\235\183\DC1\255\&6\206\199\&4\STX\215\135\ENQ\188\149C3\141\192\245\161\ACKo\229$M#p}\248\194[9^\211\b\\\US\DC2\241V\206\220\&4\STX\215\135Y\188\153\131\&8\141\200\245#\FS\154\US\207\233\248fv\193\&7f\186\241\141\254'wf\139\ETB\204\&7\172f\190!\246\152\153\146\171\DC3\245f#\v96b\207\248f\159\206l\228\231\237\176\STX\245ld:\153H\157\220H\SOHV\EOT\220:\249\EOTG\US6\194\197\146v\248\223\134x?\252\223\143\255\237\ENQ\197|b\201\241\139Y\229\240A\222\EM\171!\251\157\144\227H&\131;\GS\201S\233\137z$\165\t\135\230H\158\202W\212#\185\154\202\GS\208\211\GS\201S\t\140j$\173\145\185ZJ\188\194\208\US\201S\EM\141z$\237\217T\234\144\150\238H\158Jq\212#95W\175\194'O\230<\234\161\156\205g\218.9\231p\160\247^\242q\184\142\251\196L\228\248U\226&s=\187\181d\b\142f>}*?R\191\246S\132$\215~\189\145<\149\DC2\169GrbI\238\227j\142\228\245\&9\210Tv\175Hs$\175\207\145\230\165\191\129\225\229\"y}\142\180\144:\156\164?\146\215\230H\140m\202\FS\208\209\US\201\235s$\203|\GSq\242\250\FS\201\158\201r$\189\145\212\128#M\173\133\220\203\197+@\217\135#u\220\224\230\FS\233\232\229\237\vq\164\191\245\230H\214\210\210\217\167Up\164\211@\170q\164\EOT\161\227.\173\&9\146*8R?$\237\201\\\238\ENQ\186\230H\170\224H\253\144\156\204d.h\234\143\164\n\142\212\SI\201\169\228\DC1S\205\129TA\145\250\SOH\153\222\187\DEL\241H\170\160H\253\144Lo\231\191x$UP\164~H.\237\215\&1\187UP\164~H\174\166\&3\185\ETBr\154#\169\132\"\245\129\210\SUBI\221\ENQ\188\SO\146}\CANR\199]z\206\144\142^\163\191\fC\250\231_\251\191E\210\251\205\168\STX\134\244\247\255\244|\139\&4\147\220\211\211\ESCI\ENQ\f\233\245\187\155\STX\242ss7U\228\231\245\187\155\STXbss7U\196\230\245\187\155\STX\206rs7U\156\229\245\187\155\n:\242\138\253\173\SI\US\233\248\136\NUL\231#G\191\USp\EM>\242\239\219\169\182\163 \253\244\227_n\167\218\148\240\145\159~\252\243\237T\155\DC2\210\210\ETB\201\219\169\&6UH\222N\181\169B\242v\170M\NAK\146\183Smj\144\188\157jS\135\228\237T\155\&2(_\235\169\182\142\SI\USp\142t\244\155\a\151\225H\255\250\199\141#\169\ACK\233\198\145.\133\228\141#\169B\242\198\145T!y\227H\170\144\188q$UH\222\&8\146\SUB$o\FSI\GS\146\&7\142\164\f\202\ETB\203\145\STXD`d8(\216x\219\CAN\ETX\226\161`\144\ETB\CAN\142\SI\162\232~\184A\136\176\223\201\248x\177\227\DC1.l\136h\255&\149+\192n\170\177F\238Sk5\DLE8;\132Efv\244\179g\166\208I\166id\132(\242Xw\247\195\DLElE\205\147\186A\230\CAN\ACKk\215EN\188\135\SOH\201\145=\SOH\FS\CAN\184\ENQ6u\149\189f\149\203\GS\249^\NUL\v\141\154:\228\133\ACK\147c\246\NUL~$\SO\tm6\DC1$\226'\EOT\155\160+\228\211\214\n\136|\184!\169\158^\224`\200\176`\153\\\162\229gc\218\129\231\192dfE\252Q\250\EOT\196\EOT\209\230=\199(\202r\151\174S\239\175\191\177\&2\221\&6`\239\249O\204:\CANl1\bw\"\128\244!\213\160\230$\DLE\ETB\148<\ETBLj\139Sg\131\146\217\EOT|oK\a\231\208\166 .\DEL\244\237OqD\188\ruC\138\&7\237\226\128\176\155\193\154[f,\140\162\&4.\230Ptb?\161\152\148G\ETB\238\173\186\130\185lEE^\146\ACK\134\229HH\SO\178\178\GS\244\182;f9\171\211\162\&9f\212w\136\129\176G\135\vR\207G\152`\224Q\211\210\&6\247\NULoi@\"(\164UK\189\165%kD\168\&1\147B\225\&1\243\141\150\SUB8U\176\208\239\128\169GQ\ETB\222#\151\STX\226c\131\172\203Zf\DC3\212\216\131\199|\132&m\160\SYN\DLEs\201\b\134Y\235Y\CAN5\205E\233\146@\190\135Ch\252\200\226\&2\171\200\133'\229e\174\"\f6\212;*\178\131l\SOH\b`\226\132\247\195\NUL\ENQ\176\218\ACKp\153\US%\147%\153B\201s\\\132|{\246i\181\150\131|D\151\156w&\255\167\DC4\204\187|\166\226X;\b\\\166\&7\159c\227J\225\134O\SYN1\218\215k\166\&2e\167dKVn\149Q)\207\170z\132Yv\DC3\\\152\178\161\n\247:sd\ETB\216\186Ot\210\176\184AWR\234\&1\213\217W\160Q\USK\ETXN\165\&0\213\DC4\148\178\128\181\aQ\222Z9Z\165%\172\209\210\172\166\235n\224\STX\236\150\227Sa\161\246\185\159h.\224\207\ETXlX\207RXX,\196rA\214\137\248\ENQ\204\b\250\208!\\C\SUB\213b\204bd\169\158\149.\245BM\161\247\180\172\EM\223\&2\178\STX\SYN%d+\232\229\207\179\245\&3/\249?PK\ETX\EOT\DC4\NUL\NUL\b\b\NUL\186\186\vC_\197\128\&2\FS\SOH\NUL\NUL>\EOT\NUL\NUL\NAK\NUL\NUL\NULMETA-INF/manifest.xml\173TKn\195 \DLE\221\231\DC4\SYN\219\202\208fU\161\&8YT\234\t\210\ETXP<v\144`\176`\136\226\219\ETB[M\236\170Je\171\217\&1\191\247\222|\196\238pq\182\&8C\136\198c\197^\248\&3+\NUL\181\175\r\182\NAK\251\&8\190\151\175\236\176\223\236\156B\211@$y}\DC4\185\SO\227\205\172X\n(\189\138&JT\SO\162$-}\aX{\157\FS \201\159\249rd\186Y3\SOH[\182\223\DC4\DC3_c,\148\185>\244Sv\147\172-;E\167\138\137{ \147\219AmTI}\a\NAKS]g\141V\148\211\196\EMk>\n\230s\157\156\224BL\172\209\224\128\DC4\207\237\221\225\FS\NUL\197\DLE^\ENQ\SUB\129(\239 >\FSX{\164\161\207G\227\RSO\201}\162\&26\n\186>y\135\237\GS\DC2\227T\vb\136\175\155\245\183\143\135\186Y\176\227\156\245\180\186\147\&7\143\141iS\CAN!\226V(\173\193B6}\DLE:\133\240\247\244\254\199\181\240nc\194A\STXO\134\235\&9\194\202\ESC\163\222\194\210\v\219\137_\DEL\192\254\vPK\SOH\STX\DC4\NUL\DC4\NUL\NUL\b\NUL\NUL\186\186\vC^\198\&2\f'\NUL\NUL\NUL'\NUL\NUL\NUL\b\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NULmimetypePK\SOH\STX\RS\ETX\DC4\NUL\NUL\NUL\b\NUL;\138\vC\163\159\SOHAJ\SOH\NUL\NUL\STX\ETX\NUL\NUL\b\NUL\CAN\NUL\NUL\NUL\NUL\NUL\SOH\NUL\NUL\NUL\182\129M\NUL\NUL\NULmeta.xmlUT\ENQ\NUL\ETX\177)\bRux\v\NUL\SOH\EOT\245\SOH\NUL\NUL\EOT\DC4\NUL\NUL\NULPK\SOH\STX\DC4\NUL\DC4\NUL\NUL\b\b\NUL\186\186\vC\"\STX\240\214\207\ENQ\NUL\NUL\138&\NUL\NUL\f\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\217\SOH\NUL\NULsettings.xmlPK\SOH\STX\DC4\NUL\DC4\NUL\NUL\b\b\NUL\186\186\vC\250+^\183\175\ETX\NUL\NUL+\SO\NUL\NUL\v\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\210\a\NUL\NULcontent.xmlPK\SOH\STX\DC4\NUL\DC4\NUL\NUL\b\NUL\NUL\186\186\vCq\197\131\202\DC1\ETX\NUL\NUL\DC1\ETX\NUL\NUL\CAN\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\170\v\NUL\NULThumbnails/thumbnail.pngPK\SOH\STX\DC4\NUL\DC4\NUL\NUL\b\b\NUL\186\186\vC\180\247h\210\ENQ\SOH\NUL\NUL\131\ETX\NUL\NUL\f\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\241\SO\NUL\NULmanifest.rdfPK\SOH\STX\DC4\NUL\DC4\NUL\NUL\b\NUL\NUL\186\186\vC\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\US\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL \DLE\NUL\NULConfigurations2/images/Bitmaps/PK\SOH\STX\DC4\NUL\DC4\NUL\NUL\b\NUL\NUL\186\186\vC\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\SUB\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL]\DLE\NUL\NULConfigurations2/popupmenu/PK\SOH\STX\DC4\NUL\DC4\NUL\NUL\b\NUL\NUL\186\186\vC\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\SUB\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\149\DLE\NUL\NULConfigurations2/toolpanel/PK\SOH\STX\DC4\NUL\DC4\NUL\NUL\b\NUL\NUL\186\186\vC\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\SUB\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\205\DLE\NUL\NULConfigurations2/statusbar/PK\SOH\STX\DC4\NUL\DC4\NUL\NUL\b\NUL\NUL\186\186\vC\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\FS\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\ENQ\DC1\NUL\NULConfigurations2/progressbar/PK\SOH\STX\DC4\NUL\DC4\NUL\NUL\b\NUL\NUL\186\186\vC\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\CAN\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL?\DC1\NUL\NULConfigurations2/toolbar/PK\SOH\STX\DC4\NUL\DC4\NUL\NUL\b\NUL\NUL\186\186\vC\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\CAN\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NULu\DC1\NUL\NULConfigurations2/menubar/PK\SOH\STX\DC4\NUL\DC4\NUL\NUL\b\b\NUL\186\186\vC\NUL\NUL\NUL\NUL\STX\NUL\NUL\NUL\NUL\NUL\NUL\NUL'\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\171\DC1\NUL\NULConfigurations2/accelerator/current.xmlPK\SOH\STX\DC4\NUL\DC4\NUL\NUL\b\NUL\NUL\186\186\vC\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\CAN\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\242\DC1\NUL\NULConfigurations2/floater/PK\SOH\STX\RS\ETX\DC4\NUL\NUL\NUL\b\NUL\205f\"DQ}\226,\EM\DC2\NUL\NUL;\213\NUL\NUL\n\NUL\CAN\NUL\NUL\NUL\NUL\NUL\SOH\NUL\NUL\NUL\182\129(\DC2\NUL\NULstyles.xmlUT\ENQ\NUL\ETX\STX\210\197Rux\v\NUL\SOH\EOT\245\SOH\NUL\NUL\EOT\DC4\NUL\NUL\NULPK\SOH\STX\DC4\NUL\DC4\NUL\NUL\b\b\NUL\186\186\vC_\197\128\&2\FS\SOH\NUL\NUL>\EOT\NUL\NUL\NAK\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\133$\NUL\NULMETA-INF/manifest.xmlPK\ENQ\ACK\NUL\NUL\NUL\NUL\DC1\NUL\DC1\NUL\160\EOT\NUL\NUL\212%\NUL\NUL\NUL\NUL"),("MathMLinHTML.js","/*\nMarch 19, 2004 MathHTML (c) Peter Jipsen http://www.chapman.edu/~jipsen\nReleased under the GNU General Public License version 2 or later.\nSee the GNU General Public License (at http://www.gnu.org/copyleft/gpl.html)\nfor more details.\n*/\n\nfunction convertMath(node) {// for Gecko\n  if (node.nodeType==1) {\n    var newnode =\n      document.createElementNS(\"http://www.w3.org/1998/Math/MathML\",\n        node.nodeName.toLowerCase());\n    for(var i=0; i < node.attributes.length; i++)\n      newnode.setAttribute(node.attributes[i].nodeName,\n        node.attributes[i].value);\n    for (var i=0; i<node.childNodes.length; i++) {\n      var st = node.childNodes[i].nodeValue;\n      if (st==null || st.slice(0,1)!=\" \" && st.slice(0,1)!=\"\\n\")\n        newnode.appendChild(convertMath(node.childNodes[i]));\n    }\n    return newnode;\n  }\n  else return node;\n}\n\nfunction convert() {\n  var mmlnode = document.getElementsByTagName(\"math\");\n  var st,str,node,newnode;\n  for (var i=0; i<mmlnode.length; i++)\n    if (document.createElementNS!=null)\n      mmlnode[i].parentNode.replaceChild(convertMath(mmlnode[i]),mmlnode[i]);\n    else { // convert for IE\n      str = \"\";\n      node = mmlnode[i];\n      while (node.nodeName!=\"/MATH\") {\n        st = node.nodeName.toLowerCase();\n        if (st==\"#text\") str += node.nodeValue;\n        else {\n          str += (st.slice(0,1)==\"/\" ? \"</m:\"+st.slice(1) : \"<m:\"+st);\n          if (st.slice(0,1)!=\"/\")\n             for(var j=0; j < node.attributes.length; j++)\n               if (node.attributes[j].value!=\"italic\" &&\n                 node.attributes[j].value!=\"\" &&\n                 node.attributes[j].value!=\"inherit\" &&\n                 node.attributes[j].value!=undefined)\n                 str += \" \"+node.attributes[j].nodeName+\"=\"+\n                     \"\\\"\"+node.attributes[j].value+\"\\\"\";\n          str += \">\";\n        }\n        node = node.nextSibling;\n        node.parentNode.removeChild(node.previousSibling);\n      }\n      str += \"</m:math>\";\n      newnode = document.createElement(\"span\");\n      node.parentNode.replaceChild(newnode,node);\n      newnode.innerHTML = str;\n    }\n}\n\nif (document.createElementNS==null) {\n  document.write(\"<object id=\\\"mathplayer\\\"\\\n  classid=\\\"clsid:32F66A20-7614-11D4-BD11-00104BD3F987\\\"></object>\");\n  document.write(\"<?import namespace=\\\"m\\\" implementation=\\\"#mathplayer\\\"?>\");\n}\nif(typeof window.addEventListener != 'undefined'){\n  window.addEventListener('load', convert, false);\n}\nif(typeof window.attachEvent != 'undefined') {\n  window.attachEvent('onload', convert);\n}\n"),("reference.docx","PK\ETX\EOT\DC4\NUL\NUL\NUL\b\NUL\224\171\193D\185\190\SI8^\SOH\NUL\NUL%\ACK\NUL\NUL\DC3\NUL\FS\NUL[Content_Types].xmlUT\t\NUL\ETX\ETX\254\139S\ACK\254\139Sux\v\NUL\SOH\EOT\245\SOH\NUL\NUL\EOT\DC4\NUL\NUL\NUL\181\148\203j\195\&0\DLEE\247\249\n\163m\177\149tQJ\137\147E\US\203\&6\208\244\ETX\DC4y\156\136\234\133\&4y\253}\199vcJ\tv\200cc\176g\230\222\163\203\200\227\233\206\232d\ETX!*gs6\202\134,\SOH+]\161\236\&2g_\243\183\244\145M'\131\241|\239!&\212kc\206V\136\254\137\243(W`D\204\156\aK\149\210\ENQ#\144^\195\146{!\191\197\DC2\248\253p\248\192\165\179\b\SYNS\172\&4\216d\252\STX\165XkL^w\244\185\241\165q\150<7}\149U\206\132\247ZI\129T\230u\149\US\GS\f\160c\199\228\198\SYN\255\240\210_\180\140&\235\158\184R>\222\GS,>(\138\160\nHf\"\224\187\&0\164\199\183.\DC4|\v\139O@\164Xb\214M{\196\211\149\165\146P8\185\&64\146U\130>8\t1\146\158\209\217\US\241~\DC2\187\&6\v\b\212{}\142V\186\159\"\222,\140xr\DC2H\251\a\205st1G-\211\239Y\146\195\\,4\\\255\224\173t'\ENQ\205\207\130\243\145\147\219\197\fP\221\164\STX\138\148@<\EOTT\208\GS{k.]8#\129\195\221\171\166O\181l\182\r\247\SUBn\177k\181n\191\DEL\171pu\130\182b\132\178\167\172\159C\235\240\SYNY\180\210-\ENQ\175\255\250\147\193\SIPK\ETX\EOT\DC4\NUL\STX\b\b\NUL\171\FS\194D\142\236\DC2\EM\220\NUL\NUL\NUL?\STX\NUL\NUL\v\NUL\NUL\NUL_rels/.rels\173\146\207J\ETXA\f\135\239>\197\144{7\219*\"\210\221^\164\208\155H}\128\&0\147\221\GS\236\252!\DC3\181\190\189#\136Z\169\165\a\143\147\249\229\203G\200r\181\SI;\243\194R|\138\GS\204\155\SYN\fG\155\156\143c\a\143\219\245\236\ACKV\253\197\242\129w\164\&5R&\159\139\169=\177t0\169\230[\196b'\SOT\154\148\&9\214\159!I \173O\EM1\147}\162\145q\209\182\215(?\EM\208\US0\205\198u \ESC7\a\179}\203|\SO;\r\131\183|\151\236s\224\168GF\252JT2\201\200\218\193k\DC2\135\238\179\220T,\CAN<\174s\245\159:\188W\142\142\221,K\237\ETB\245\\\190\157\170\206}-\ETB\164\156O*]\158\175\244\247\246\&1\176\146#%\180I\248\180\208G\226\203\b\SI\SO\161\DEL\aPK\ETX\EOT\DC4\NUL\NUL\NUL\b\NUL\247\171\193D\232\150\&1\DC2\v\SOH\NUL\NUL\209\STX\NUL\NUL\DC1\NUL\FS\NULword/document.xmlUT\t\NUL\ETX2\254\139S2\254\139Sux\v\NUL\SOH\EOT\245\SOH\NUL\NUL\EOT\DC4\NUL\NUL\NUL\157\146MN\196\&0\f\133\247s\138*\251\&6\GS\SYN\bUmg3B\FS\NUL\SO\DLERw\SUB)\137#'m\225\246\164?\SOH\177\NULU\179yVd\191O\182\227\250\242at6\SOHy\133\182a\231\162d\EMX\137\157\178\183\134\189\189>\231O\236\210\158\234\185\234P\142\ACKl\200\162\193\250jn\216\DLE\130\171\&8\247r\NUL#|\129\SOl\204\245HF\132\248\164\ESC\159\145:G(\193\251\200\&3\154?\148\229#7BY\182c\204\DC1\f\246\189\146p\221\ESCH\144\&0$\b\221\v!\208\"\196\193\253\160\156O4l\216H\182\218Q\185Q\146\208c\USr\137\166\218({H\142\233?\199dt\170\155\207\229\SOH\246\178\180\228\DLEG&\235H\204\DEL\172\215)y\a!\186\194H\223\227\205\238\SO\198\239\175\191nI\214\198Cz\199\238s\137n\DC1Zd\189\169\202;!\161a\142\192\ETXM\192\218\ETB\208\SUB\179\b\210]Q\243X\214.J\171\186U7\DC4\255\&9\206\246\244\ENQPK\ETX\EOT\DC4\NUL\NUL\NUL\b\NUL\232\171\193D\208\179\r$\252\NUL\NUL\NUL1\EOT\NUL\NUL\FS\NUL\FS\NULword/_rels/document.xml.relsUT\t\NUL\ETX\DC3\254\139S\DC3\254\139Sux\v\NUL\SOH\EOT\245\SOH\NUL\NUL\EOT\DC4\NUL\NUL\NUL\181\211OO\195 \CAN\ACK\240\251>\ENQy\239\150v\234\&4\203\218]\140\201\174Z?\NULm\223\254\137\ENQ\SUBx\167\238\219K\220\STX\204x\240\194\145<\240\240\131\192n\255%g\246\129\198NZ\149Pd90T\173\238&5\148\240V?\223<\194\190Z\237^p\SYN\228\166\216qZ,sk\148-a$Z\182\156\219vD)l\166\ETBT.\233\181\145\130\220\208\f|\DC1\237\187\CAN\144\175\243|\195M\220\SOH\213U'\171O\v\254\167Q\247\253\212\226\147n\143\DC2\NAK\253Q\204\213Q6h\156\US\216\161+\193\FS\186\STXX-\204\128T\130\SI3\215\v\140'SX:\205h=a\GS\b\231$\249\254H\228\142\EM\EOT\183\145\224\146\165\&6|b\243\250\155q\ETB\CANQ\156Z\210kE\181hf\244\142\251\224\240aj\ENQ\185\181A\176\t\130\159\224\FS\ETB\233\175B\147\210\DC4\189\205\135\248*.\161W\240\171\159_\173\190\SOHPK\ETX\EOT\DC4\NUL\STX\b\b\NUL\171\FS\194D\141\231\194\&4o\NUL\NUL\NUL}\NUL\NUL\NUL\GS\NUL\NUL\NULword/_rels/footnotes.xml.relsM\140A\SO\STX!\fE\247\158\130t\239\DC4]\CANc\134\153\157\a0z\128\ACK+\DLE\135B(1\RS_\150.\DEL\222{\DEL^\191y3\USn\154\138\&88L\SYN\f\139/\207$\193\193\227~\221\159a]v\243\141\&7\234C\209\152\170\154\209\136:\136\189\215\v\162\250\200\153t*\149e\144Wi\153\250\152-`%\255\166\192x\180\246\132\237\255\ETX\f.?PK\ETX\EOT\DC4\NUL\STX\b\b\NUL\171\FS\194DO\174i\165h\SOH\NUL\NUL\204\ACK\NUL\NUL\DC2\NUL\NUL\NULword/numbering.xml\197\149\205n\131\&0\f\199\239{\n\148\251\SUB\190FiU\218[\165N\211\180C\247\NUL\SOH\210\&6R\DC2P\DC2h\247\246s\178B\215\RSP\197\133\v&\246\223\142\DEL\160\196\171\205Ep\175\165J\179Jf(\152\249\200\163\178\168J&\143\EM\250\222o_S\180Y\191\172\206K\217\136\156*p{\144!\245\242\156\161\147\&1\245\DC2c]\156\168 zV\213TB\236P)A\f,\213\DC1\159+U\214\170*\168\214\144)8\SO}?\193\130\&0\137\214P\147\228\218(R\152\207Fxw\171]\153!\223I\164f%\196Z\194\&3D\131\249!Y\228\EOTy\216\134D\195\r\251\160-\229\251\159\154v\"\231\229\214{\149\241\150C\140\129\233k6b+L\151\144\&7\156Ss\DC3\239\233\165\143y7\247{\209\&99=t\242\250KYc\160\245\171\237D\176\a\130\247\186\210vW\171\198\&7\GS\147\150\201\214\201P\156\250Vx\"\242\232\190\185[\255\201]u\236v\DEL\EOT\t&\SOH\153\135\131(\SOH\252\221\DC1,\225$,A\FS\SI\195,\194\&10\209$0a\144\f\194\132I<\ACK&\158\ACK&M\aa\162(\EM\ETX\243\&6\t\f\244:|\252\253Q\231?\153\EOT&\142\134/\NUL\232\253\&9\CAN|w\219_Q<\247\180W\DEL\240\&8\GSv\253\f\232\235I\155\135\255\205\165\245/PK\ETX\EOT\DC4\NUL\NUL\NUL\b\NUL\b\157\ETBE\FS\165\153\197!\ACK\NUL\NUL\222\&2\NUL\NUL\SI\NUL\FS\NULword/styles.xmlUT\t\NUL\ETX\144P\249S\144P\249Sux\v\NUL\SOH\EOT\245\SOH\NUL\NUL\EOT\DC4\NUL\NUL\NUL\237Z]w\155\&8\DLE}\239\175\224\240\222\SUBc'qs\226\246\&8N}\154\179\253Hk\167}\150A\182U\ETXb%\145\143\253\245;\STX\132\SOH\v\236`6I\187\233K\163\185\131tgt5\DC2\194g\239\239|\207\184\193\140\DC3\SUB\f\205\238\ESC\203\&4p\224P\151\EOT\203\161y=\155\188\RS\152\239\223\189:\187=\229\226\222\195\220\NUL\247\128\159\178\161\185\DC2\"<\237t\184\179\194>\226oh\136\ETX\192\SYN\148\249H@\147-;t\177 \SO\190\160N\228\227@tl\203:\238\&0\236!\SOHC\241\NAK\t\185\153\246v\187Oo\183\148\185!\163\SO\230\FS\184\249^\210\159\143H`\190{e\CAN\192\208\165\206\ENQ^\160\200\DC3\\Zb\ESC\187b\169-1)\163j%\237\t\r\EOT7nO\DC1w\b\153\SOH\ENQ<4}\DC2P\246q\DC4pb\STX\130\DC1\ETB#N\144\SYN\\\201?\180\136\195E\206|N\\\176v\nc\243\DEL\192\237\ACKyC\211\238occ^\141z(X*\DC4\a\175\175\167y\158\&9\211\FSF\GS\154\136\189\158\142r]\156uryH\ESC\133L\193\b\161.ya)y<D\SO\137\153\160\133\192 \f\152\151\210\&8a~\156b\167\210R\154\183\&84\SOH\138\153&\138\ETX\a\188\248D\157\&5v\167\STX\128\161i\153\137\241\250\242\138\DC1\202\136\184\223\216\166\216'\US\137\235\226 \231\ETB\172\136\139\DEL\174pp\205\177\187\177\DEL\155\196\250J\r\SO\141\STX\248\219>9N\233+\209\ETX&\238C\CAN7D\f-\EM\nW\233\243\146\&2\172\EM\217\138\GS/\161\239/\178K\207\204r\CAN \US\171YJ1\149\FS@\255N\CAN\228,\185\244\SYN\146;\199\176\CAN\128Cw\DLE\147Ms\GS\183:\133\228\170\172\198\140v\135\145\DC1\USS\US\ACK\DC3z\230\n\204\DC1\157#\200\229\215\160\205\216z\199\185\208z\199mE6#\194\195\250\184\DC2\232!Q\ENQ\248N4\143y\141q\248E\246\208)\EM?\145\NUL\164\222\169MO\191\&0\245v\191\176\204nO\DEL9\138\151\ETX\139\a3]\250\202\229\175\178\248\161_5\197O\130\USR\219V\253+<\185\169\DEL\210\\\170\DEL2\221\197\214\184\152\STX\135z\148\169\160z\253\163\209`$;\141\187\FSK\f\202\154#\131\237f\230\233\n\185\&0\220\249Qq\156M\149\205\201j\171\198\150$\199\182%\183\167\226\166\209\\$\162\&3\234\254\233\DC4\153=Z-\202-\209>\161&c\NAK\182\174\201\220tY5\211ei\166\171I\129\CANEbE\153\190B\164\216Sd{\159\228\&5\t\247\STX6Q}\176\&1\242'\133:\154s\193*w\181\f\253M6\128\158\149_l=K\187\247\215.'\187f9\217\186\229\212(\235\231d\238\DC1\SUB\219\239\245\153/x4\205~U'\218\&9\200\181\152j5\137\237#F\242\221\168\171\143+E\141n\139\146\138\136:\229*\159\183Ot\228(\137\135F\194\131>>\221x\138\216\190\130\252\191\157\&9\236\154M\204nk\213\165\218\179\235\149i?\158\&2\163\194k\215\163\157H\172\aI\182\251\135I\182?\EMt\207/*%\251\f\EOT\218\171\ETBh\239E\160/\STX-\v\212\RS\212\156[\ACK-\v\180_/\208\254\139@_\EOT\186%\208~\141@\251-\v\244\168^\160G/\STX\253\253\EOTJ\138\173\223T\160\231\RSu\214\223\"Zu\193\DLE\227F\226\240\252E\170\185}/(\175\187\247\ESC\248\211\214\190\146\152\RS\251:`B\169\b`\198g0\137zY(\SI#vi*\140\194\&8m\203\163>pg\133\228E\146\188\184\170\252\&2\148~\227\186R9\146\146\168\184\134K<\141\204\213\136}s\212x\246\149kG \245\180\ENQ\154\203\155\228J\202\&3\137\239\254\162e\204\146~\SUB\240\171X\135b\238\NAK\214\SI\180/\ETX\ETBF\189M?\214%\252\221;T\DC40\248\141\177\231}F\197o\148\130\134;\158\141\221<\188\DLE\137_\215\SUB\212z\206\169\DLE\212\223\167OF\150\171\221\157\202i*sOm\a\220\243\226\ENQ\t\136\252\218>\195\204\175\148Z\234c\196NM\215\222\166\US\179\178\156\&6\218\243\183\&6\249\250B;o\169f\229\226\217\145\183}S\214h;\165\238}u\213\148\232\195+&\FS\142\214\249\RSd\ac(_\213\243\182\&5\EM]\187\181\175\206q\229\CAN\163\176:\211\177\135\161\\\RS+R\181\225\ETB\182{}\216\SUB\NAK\146\150Tx\233\163e}vb\143?>;\133\237\213\137\&8\212\222\248\199!\229\253\170\DLEG\253\154\&1\202\177\150\DC2\166\221\173w\164o\175\149\190o,?0\155#A\252\234X\148\199\174P\170f\183\238\136*\DEL\242\DC1p\234!\158\157=\243\166\138\227d\131\171\194}\211\161\SOw\223\241b\199\EMRz\FS\154\140\ESC\204\196\200#\203\236\&1\RS\133\152q\135\145P\252w1\194>\184\214\a\ETB#\135\ACK\213\224%R\USb}\245\170\tpJ#\230\192X.\188\RS\150\"L #\198`\244\186\nVZ}\133\133\146\192\178\246\192\DEL\242'\131?\129\150\242\164\139X\EM\170:m\"j<c\DEL\225{9\200\140\174\183\STX\202A\218x4\180YB\187\&0O\150ub%\149\&5=\221\168)i\129\253\ENQ\DC2h\ACKO\232\232\231\177C\248\191\ENQ\246\201kr\155\196\177\243\ETXyZ\218\EMr\b\233\190\133 \237-\147>\a*_t\156\&3\224\217Q\158x\DC4\t\GS\229\fxv\148\229\152:\198\202~\CAN\225\DC3\160\220\&2\225\169`p\168\210Q\222 \207\142\244\152\250\242\&7\221\218Do\160Ch\US\ETX\233\185\170{\164]\246_a\203\211\138$\ETXZ\170\216\237Q\RSyp\"\209Q\206\128C(/\SYN\150*\210\173o2\147(p\226;\b]\EM\201a\a\165\252\216\RS\156\224\150S\254\GS/\129\218g\196\214z\177\148\241\a\EOT\144\DC2=\144\224\a\198\168\150Y\ACK<WM$g9\GS\245\r\210\&8\157\234/\254\238\213\191PK\ETX\EOT\DC4\NUL\STX\b\b\NUL\171\FS\194D(\130*b\219\NUL\NUL\NULs\STX\NUL\NUL\DC2\NUL\NUL\NULword/footnotes.xml\157\209\193j\196 \DLE\ACK\224{\159\"x\207\154\221C)\178\217\189,}\130\246\SOH\196\232F\136\142\204L\226>~-\ESC\v=\180\132\156D\198\255\131\DEL<_\USaj\SYN\139\228!\246\226x\232Dc\163\129\193\199{/>?\222\219\&7q\189\188\156\179r\NUL\FS\129-5%\DC1I\229^\140\204IIIf\180A\211\SOH\146\141e\230\NUL\131\230r\197\187\204\128CB0\150\168\128a\146\167\174{\149A\251(V&la\192\&9o\236\r\204\FSl\228\138\240X\DC1\220\139\160\157\&4\151\230\&4\250DU\131^\204\CAN\213J\181\193\ESC\EOT\STX\199\173\129\160\158\202z\212\196\242_b\tS}\151\143\221\ACK\251{i5\161\183\&4\ESCP\231?\214\155\188\217!\148\DC4\207\248S/\167\GS\198\239\175\191=\135\162\145\151/PK\ETX\EOT\DC4\NUL\STX\b\b\NUL\171\FS\194D\128\221u\231\218\NUL\NUL\NUL\137\SOH\NUL\NUL\DC1\NUL\NUL\NULdocProps/core.xmlm\144MK\196@\f\134\239\254\138\&2\247\&6\237\n\"\165\237\222<\185 \168\224u\200\196\238\176\157\SI2\209\174\255\222\177j+\184\183$\239\147\135\153t\251\179\155\138w\226d\131\239US\213\170 \143\193X?\246\234\249\233\174\188U\251\225\170\195\216b`z\224\DLE\137\197R*\242\158O-\198^\GSEb\v\144\240HN\167*\DC3>\135\175\129\157\150\220\242\bQ\227I\143\EOT\187\186\190\SOHG\162\141\SYN\r_\194\&2\174F\245\163\&4\184*\227\ESCO\139\192 \208D\142\188$h\170\ACK6V\136]\186\184\176$\DELHg\229#\210E\244\&7\\\233s\178+8\207s5_/h~\DEL\ETX/\135\251\199\229\171\165\245I\180GRCg\176\NAK+\DC3\r\GSle\174\144IK\224\239\241\214\252;\231\240\tPK\ETX\EOT\DC4\NUL\STX\b\b\NUL\171\FS\194D\SOHdNFd\SOH\NUL\NUL\212\STX\NUL\NUL\DLE\NUL\NUL\NULdocProps/app.xml\157R\203N\195\&0\DLE\188\247+\162\220\137Ky\170r]!\DLE\226\NUL\b\169)\156-{\147X8\182e\ESC\EOT\DEL\207n\211\134 8\145\211\238\204\206\236f\DC2\190\254\232m\241\SO1\EM\239V\229q5/\vp\202k\227\218U\185\173o\143.\203\181\152\241\167\232\ETX\196l \NAK(piUv9\135%cIu\208\203T!\237\144i|\236e\198\&6\182\204\&7\141Qp\227\213[\SI.\179\197|~\206\224#\131\211\160\143\194hX\SO\142\203\247\252_S\237\NAK\221\151\158\235\207\128~bV\DC4\252\197G\157\196\229\tgCE\216\166\147\DC14jE#m\STX\206\190\SOH\162\239P\GS\173q\175\233\186\147\174\ENQ}\CAN\251M\208\248\189q\144\196\241\130\179\161\"\236*\132\231!K$\170\&9>\156M\176\189\236\&5mC\237od\134\195\134\159\224\222\201\SUB%3\201\RS\140\138>\249&\ETB\244.\ENQ9W\131\241\&8B\DC2<.J\149q\215\139\201\221&H\133W\157Q\EOT\DEL2$\169\161\SI\150V>R\196\182\210>\247\156\141(\141`:\ESCPo\209\228O\129K\167\237\206\193gik\211\131\&8G\225\216\236\226V\210\194\&5~\152\&1\238\DC1\248y\174\&8\189\&8\155\RS\185\163\159\176k\163\f\GS~E\206&\221@\182\148=\225T\204\176\CAN\255'\241\ENQPK\ETX\EOT\DC4\NUL\STX\b\b\NUL\171\FS\194D=\149\n\180\EM\ACK\NUL\NUL\250\GS\NUL\NUL\NAK\NUL\NUL\NULword/theme/theme1.xml\237YMo\219\&6\CAN\190\239W\DLE\186\183\178l+u\130:E\236\216\237\214\166\r\DC2\183C\143\180DKl(Q \233$\190\r\237q\192\128a\221\176\195\n\236\182\195\176\173@\v\236\210\253\154l\GS\182\SO\232_\CANE\201\DC2eS\141\147\182\219\138\&5\aG\164\158\231\253\230K\210\190|\229\&8\"\224\DLE1\142i\220\181\156\139\r\v\160\216\163>\142\131\174u{4\188\208\177\174l~p\EMn\136\DLEE\bHt\204\&7`\215\n\133H6l\155{r\SUB\242\139\&4A\177|7\161,\130B\SOY`\251\f\RSI)\DC1\177\155\141\198\154\GSA\FS[ \134\DC1\234Z\183&\DC3\236!0JEZ\155s\225\ETX\"?b\193\211\t\143\176}Oi\212\EM\n\235\US8\233?>\227}\194\192!$]K\234\241\233\209\b\GS\v\v\DLE\200\133|\209\181\SUB\234\207\STX\246\230e\187`\DC1QC\214\136C\245\&7'\230\f\255\160\169\136,\CAN\ETBLg\216^\191\180]jhf\SUB\150\129\131\193\160?pJ\137\n\SOH=Oz\235,\129\219\195\142\211+\164j\168\236qYz\191\225\&6\218\v\EOTMCk\137\176\222\235\245\220\245*\161U\DC2\218K\132Nc\173\189\213\172\DC2\218%\193]\246\161\183\213\239\175U\tnIX[\"\f/\173\175\181\ETB\b\n\NAK\DC2\FS\US,\193\211\204\150)*0\DC3J\174\EM\241\GS\137\239\DC4\181P\194l\173\210\&2\SOH\177\168\171\187\b\222\163l(\SOH*\203P\224\CAN\136Y\130&\208\147\184>$x\204\176\210\NUL7\DLE\212^\229s\RS_\158K\213\SOH\238\&1\156\136\174\245Q\STX\229\STX)1/\159\253\240\242\217\DC3pr\255\233\201\253\159O\RS<8\185\255\147\137v\r\198\129N{\241\221\231\DEL=\250\EOT\252\249\228\219\ETB\SI\191\172!p\157\240\219\143\159\254\250\203\ETB5H\161#\159\DEL\245\248\247\167\143\159\DEL\253\217\US\223?4\225\183\CAN\FS\235\248\DC1\142\DLE\a7\209\DC1\216\163Q\234\156A\ENQ\SUB\179\&3RF!\196:e+\SO8\140aJ2\193\a\"\172\192o\206 \129&`\SIU\ETXy\135\201\198`D^\157\222\171\CAN\189\US\178\169\192&\228\245\&0\170 w(%=\202\204\142]W\234\180XL\227\160F?\155\234\192=\b\SI\141\234\251\v\169\RSL\DC3Y\219\216(\180\US\162\138\169\187Df\US\ACK(F\STX\164\239\232\SOHB&\222]\140+\241\221\193\RS\163\156N\EOT\184\139A\SIbs`Fx,\204\172k8\146\t\154\EMm\148\169\175Dh\231\SO\232QbT\176\141\SO\171P\185L 1\nE\164\DC2\205\171p*`d\182\SUBFD\135\222\128\"4\SUB\186?c^%\240\\\200\164\a\136P0\240\DC1\231F\210-6\171\152|]\246\148\154\n\216!\179\168\ne\STX\US\CAN\161\&7 \165:t\155\RS\244C\CAN%f\187q\FS\234\224\SI\249\129\172X\bv\169\&0\219A\171k&\GS\203\132\192\184>\243w0\DC2g\\\241\183q\DLE\154\139%}3e\243\190^\233\208\DC1\142_\213\174#\217\173\225[h\215\178;>\255\230\209;\214\168\183d,\140kc\177=\215\STX\ETB\155r\159\&2\US\191\ESC=y\ESCN\227]\148\214\253\251\150\252\190%\191o\201\175X\229+7\226\178\247\218\250\161Z\t\140jO\216\DC3L\200\190\152\DC1t\131\171\174\205\165\221\254PN\170\129\"\NAK'\250$\148\143s}\NAK`\192\160z\ACK\140\138\143\177\b\247C\152H=\142R\DC1\240\\v\192AB\185\188IX\181\194\213\197\DC4K\247\213\156[\220&%\FS\138\GS\234g\243\173\202\&5\179\DLE\164F\SOH\215U\181R\DC1\171\170k]z]uN\134\\Q\159\227\214\232s_\173\207\214b*\215\ACK\128\233\247\ACK\206Z37\147{\144 ?\141~.a\158\157\183\152)\167\161\167*\132>2\205k>:\173\183\DC3S\247\140v\188\161X7\150cm//.\DC2WG\224\168k\173\187M\215\STX\RSL\186\214D\RS\153\228c\148H\129<\237(\144\EOTq\215\242D\230\228\233Ks\193\233\245\154\250r\SUBn\173\207\NAK%\t\227b\ESC\242\&0\163\169W\197\ETB*q\233B\211m\167\226\222\140\SI\166\246\178\162\GS\173\142\243\175\218a/f\CANM&\200\DC353\229\&0\DELG\167\STX\177\253\208?\STXc2e{PZ\222\206\170\204\199\\\238\EOT\205\249\128\201\&2o\231\ENQX]\198\249\&2Y\252\218&_>\144$!\204\203\190\163W@\134W\207\133\DC1j\164\217g\215\CAN\DELN_Zo\208\ETB\247\255\236KZ\190\242t\218\242\213\rJn\239\f\130\180N\187\SYNe\"\164\178\US%!\246\134L\RS\b\148\&2i\CAN\144kC\181,\146~\255\156\SUB\139\SO\181\SYN\150\t\201\SUB^\DLE\138=\FS\NUL\134e\215\DC3!ChW\228\158\158\"\205\153w\200|y\228\146\242\142S\CAN\204\147\236\255\CAN\GS\"2J\ETB\241Z\SUB\STX\v\132E[\201c\161\128\139\137\179Mkl\FS\f\255\203\135\154\246\&9w\162RU\251,\ESCb[\223\EOT\180\189a\253u\173Xe_\214\DC46k\220n\186\245\155\209\226\ACK\156\200\139\ACKH?d#\199\204#\229\DC1vD\247d\NAK\128\242\NUL K\242B'_\138\197\228XZ\221\209\253Ke\253SG\164N]\222\223\232\233R\139x\171.\226\167(<\DEL\196]C\192\221S\226m//X[\187\177\168\209\210OUt|O*\223\150W\162)\201fx\"G\217\195.\203|\RSS\DEL6\DEL&<k\DC1y4\230}\158\196{h\STX\176\DEL<O\239B\\\243_\130\202M~/S\146\ACK\160`\182V`\230\132ro)\216\205\NAK\216\ENQe~;,\216\234\214g\146@4\221\EM!\203v\209\&7\139\128\145\248\&5#\183\138\a\230\200\EMky\229\200\173\146\177sDN\FS\159\DC2\185<`\182\169\f\209\177`\176?\255yKVs.IU\240\230\223PK\ETX\EOT\DC4\NUL\STX\b\b\NUL\171\FS\194D{\220H:\155\SOH\NUL\NUL\190\t\NUL\NUL\DC2\NUL\NUL\NULword/fontTable.xml\237\149]O\131\&0\DC4\134\239\247+HM\188s\DC4\134\147\225\216\226Gv\233\133\206x]X\EMMhK\218\&2\220\191\247\192\152\SO\182\136\&1\241\202\145\&4)o\223\158\158<9\167\157\206\223yfm\168\210L\138\DLE9C\140,*b\185bb\GS\162\215\229\226\202G\243\217`Z\ACK\137\DC4F[\224\SYN:P!J\141\201\ETX\219\214qJ9\209C\153S\SOHk\137T\156\CAN\248Uk[&\t\139\233\163\140\vN\133\177]\140\199\182\162\EM1p\146NY\174Q\DC3\173\252I\180R\170U\174dL\181\134\212x\182\139\199\t\DC3h6\184\188\152\220\&6)Ze \b\167!z\217\242Hf\205bc\200\137\144\154:\224\217\144,D\CANb\224k\220\250\144e\183\182\196)Q\154\154\175-]CB8\203\182\251uR\CAN\217u\228\204\196\233\222\176!\138\145(\163]\147fk\176\DC4:\194p\200g.\181\226\FS)n\173\&8\a\202\168\237\137\235\&8~[i\197iN\159\218;l\167\EM.\EM\167\218z\162\165\245,9\DC1}0]<\198#\NUL\234\193pa\230\245\193<\162\253w0G=0\SI\149\147\&0\ESC\193\249\&5\204\aY(FU\133\179\SI\228\r\192\155\212@+\144\222\EMd\v\228\ESC\\\NUL\213\253\164\191\199X\161s\234\225\ETXB\US\160\250\231\230>\172G\194#H\183\175\SYN\171f\222\&5u\213\220\238\185\SYN;\DLE3\ACK\DC4\251 .\234jtk\156g\136]\136w\144k\239K}\SI\245\231\&5\DLE\221\DEL\141p?\211\179\SIPK\ETX\EOT\DC4\NUL\STX\b\b\NUL\171\FS\194D\210\159V\SOH\235\STX\NUL\NUL\242\a\NUL\NUL\DC1\NUL\NUL\NULword/settings.xml\157UMo\226\&0\DLE\189\247WD9/%|\135\bZ-P\218C\187BM\187w\199\153\128\133\GSG\182!K\DEL\253N N\178j\161hO\216\239\205\ESC\143'\158\199\228\254\143\224\206\RS\148f2\157\186\157[\207u \165\&2f\233z\234\190\191-[\190{\DELw3\201\ETX\r\198 \168\GS\DC4\164:\144Sw\167\210@\211\r\b\162[\130Q%\181LL\139J\DC1\200$a\DC4\202\US\183T\168\169\187\&1&\v\218\237Rt+3H\145K\164\DC2\196\224V\173\219'\201B\210\157\128\212\180\187\158\&7l+\224\196`yz\195\&2m\179\137\255\205\134\228\198&\217_\186\196^p\ESC\151w\188+\174\155K\NAKW\138k\202+\EOT\153\146\DC4\180\198\206\nn\vd\169M\163\249\&5yN\212\&3\139\DC4Q\135F\146\187\ESC\199\193/\247!\165p\242 \ETXE\177\vSw\140\223\184]r \"\136\195\131\&6 \150\&25\186\"\176.\153\132\134\CAN@\169\206\128\243\227\139\160\FS\bV\151\akE\132 \170B\172N\155\ETX\135\NAKIay,p\201\184\SOH\133\241{\130W\241<\175_\135\198\242\151\&4o\138\208\237\139\220C}t\f\t\217q\243F\162\208\200\204jG\221F\217\177\"9\214\243\168X\252$\NAK\251\192\210\t\SI3B\DC1\180\130\222\240k\193oP\134\209o\194\153\206\&89\212\185\ETB\181\254\SOH\167\229P\221\232\147\198\166\191BA7\EOTo\143\253)K\153\227QJr\ESCy\236\207\\\138L\225\ETXit\152\236a\165`\207 _1jv\n*\n\167\&8\214\197\186\218\189Ji\234\238\SI\198\222\194\ESC\149\169\170\152\198\215\233t\230\254\236<\223\DEL\232\142g\189\243\252w\249G~\DEL1\240\207\243\254b\232\SI/\228\159\249\195\217hp\129\159\247\253\197\ENQ~\222\ESCvG\227\243\252C\175\&3\248i\207\159\180\ESC\r\157\136\160\&0\142\149*\149\167m12\142\&8\169\159w\148\197\196yT$\141\161>B\EOT\145\218\206Xj\195\"\192\201\253\130\SIw\145\ri\181\154\180\SYN\132\243%\190\DC3K'\132\235\DEL\DC2\DC4\SIo\SOH\201Y\158\191\DLE\181\174+\240\154\156\186\192\229\138d\175l\189\&1\r\140\165\230\153\t\ESC\174wQ\184\203\154\154\DC4\GS\232\\\192\164\221l\"6\223\160mA\209\195gR\207!\164\173\247\176\&1#\\\133\133\189\193\v\201\178\211\184F\235\206\212\229Ea\157\194\137\f\238b\162\182\199M\180\238\150\\\247\200uO\220qCh\225\DEL\CAN].j\172k\177F\\\207b\189\SUB\235[\172_c\ETX\139\rjlh\177a\129m\SOh\189h\159[\244r\187,\240Dr.s\136\159j\254\DC3\212\176\ETB\160\f\159Bx\DLEQm\DC1\183\&5\207\153\&6!d\232(FV\134\251\227\200\ETB/\217\254}\223\253\ENQPK\ETX\EOT\DC4\NUL\STX\b\b\NUL\171\FS\194D\133\FST\206\156\NUL\NUL\NUL\199\NUL\NUL\NUL\DC4\NUL\NUL\NULword/webSettings.xml]\142;\SO\194\&0\DLED\251\156\194rOl(\DLE\138\242\DC1M\232\"\164\192\SOHL\178$\150lo\228\181\DC2\142\207BAA9\243\244FS6/\239\196\n\145,\134J\238s-\ENQ\132\SOHG\ESC\166J\222o\237\238$\155:+\ETX\233b\131G\SI)1!\193V\160\130\219J\206)-\133R4\204\224\r\229\184@`\250\196\232M\226\CAN'\181a\FS\151\136\ETX\DLE\177\236\157:h}T\222\216 \235L\136\239\184q\SO\183kw\DC1\234W\141\216a\234\205\ng\234\217s\208Z\a\US^\170\191;\245\ESCPK\SOH\STX\RS\ETX\DC4\NUL\NUL\NUL\b\NUL\224\171\193D\185\190\SI8^\SOH\NUL\NUL%\ACK\NUL\NUL\DC3\NUL\CAN\NUL\NUL\NUL\NUL\NUL\SOH\NUL\NUL\NUL\164\129\NUL\NUL\NUL\NUL[Content_Types].xmlUT\ENQ\NUL\ETX\ETX\254\139Sux\v\NUL\SOH\EOT\245\SOH\NUL\NUL\EOT\DC4\NUL\NUL\NULPK\SOH\STX\NUL\NUL\DC4\NUL\STX\b\b\NUL\171\FS\194D\142\236\DC2\EM\220\NUL\NUL\NUL?\STX\NUL\NUL\v\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\171\SOH\NUL\NUL_rels/.relsPK\SOH\STX\RS\ETX\DC4\NUL\NUL\NUL\b\NUL\247\171\193D\232\150\&1\DC2\v\SOH\NUL\NUL\209\STX\NUL\NUL\DC1\NUL\CAN\NUL\NUL\NUL\NUL\NUL\SOH\NUL\NUL\NUL\164\129\176\STX\NUL\NULword/document.xmlUT\ENQ\NUL\ETX2\254\139Sux\v\NUL\SOH\EOT\245\SOH\NUL\NUL\EOT\DC4\NUL\NUL\NULPK\SOH\STX\RS\ETX\DC4\NUL\NUL\NUL\b\NUL\232\171\193D\208\179\r$\252\NUL\NUL\NUL1\EOT\NUL\NUL\FS\NUL\CAN\NUL\NUL\NUL\NUL\NUL\SOH\NUL\NUL\NUL\164\129\ACK\EOT\NUL\NULword/_rels/document.xml.relsUT\ENQ\NUL\ETX\DC3\254\139Sux\v\NUL\SOH\EOT\245\SOH\NUL\NUL\EOT\DC4\NUL\NUL\NULPK\SOH\STX\NUL\NUL\DC4\NUL\STX\b\b\NUL\171\FS\194D\141\231\194\&4o\NUL\NUL\NUL}\NUL\NUL\NUL\GS\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NULX\ENQ\NUL\NULword/_rels/footnotes.xml.relsPK\SOH\STX\NUL\NUL\DC4\NUL\STX\b\b\NUL\171\FS\194DO\174i\165h\SOH\NUL\NUL\204\ACK\NUL\NUL\DC2\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\STX\ACK\NUL\NULword/numbering.xmlPK\SOH\STX\RS\ETX\DC4\NUL\NUL\NUL\b\NUL\b\157\ETBE\FS\165\153\197!\ACK\NUL\NUL\222\&2\NUL\NUL\SI\NUL\CAN\NUL\NUL\NUL\NUL\NUL\SOH\NUL\NUL\NUL\182\129\154\a\NUL\NULword/styles.xmlUT\ENQ\NUL\ETX\144P\249Sux\v\NUL\SOH\EOT\245\SOH\NUL\NUL\EOT\DC4\NUL\NUL\NULPK\SOH\STX\NUL\NUL\DC4\NUL\STX\b\b\NUL\171\FS\194D(\130*b\219\NUL\NUL\NULs\STX\NUL\NUL\DC2\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\EOT\SO\NUL\NULword/footnotes.xmlPK\SOH\STX\NUL\NUL\DC4\NUL\STX\b\b\NUL\171\FS\194D\128\221u\231\218\NUL\NUL\NUL\137\SOH\NUL\NUL\DC1\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\SI\SI\NUL\NULdocProps/core.xmlPK\SOH\STX\NUL\NUL\DC4\NUL\STX\b\b\NUL\171\FS\194D\SOHdNFd\SOH\NUL\NUL\212\STX\NUL\NUL\DLE\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\CAN\DLE\NUL\NULdocProps/app.xmlPK\SOH\STX\NUL\NUL\DC4\NUL\STX\b\b\NUL\171\FS\194D=\149\n\180\EM\ACK\NUL\NUL\250\GS\NUL\NUL\NAK\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\170\DC1\NUL\NULword/theme/theme1.xmlPK\SOH\STX\NUL\NUL\DC4\NUL\STX\b\b\NUL\171\FS\194D{\220H:\155\SOH\NUL\NUL\190\t\NUL\NUL\DC2\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\246\ETB\NUL\NULword/fontTable.xmlPK\SOH\STX\NUL\NUL\DC4\NUL\STX\b\b\NUL\171\FS\194D\210\159V\SOH\235\STX\NUL\NUL\242\a\NUL\NUL\DC1\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\193\EM\NUL\NULword/settings.xmlPK\SOH\STX\NUL\NUL\DC4\NUL\STX\b\b\NUL\171\FS\194D\133\FST\206\156\NUL\NUL\NUL\199\NUL\NUL\NUL\DC4\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\219\FS\NUL\NULword/webSettings.xmlPK\ENQ\ACK\NUL\NUL\NUL\NUL\SO\NUL\SO\NUL\236\ETX\NUL\NUL\169\GS\NUL\NUL\NUL\NUL"),("epub.css","/* This defines styles and classes used in the book */\nbody { margin: 5%; text-align: justify; font-size: medium; }\ncode { font-family: monospace; }\nh1 { text-align: left; }\nh2 { text-align: left; }\nh3 { text-align: left; }\nh4 { text-align: left; }\nh5 { text-align: left; }\nh6 { text-align: left; }\nh1.title { }\nh2.author { }\nh3.date { }\nol.toc { padding: 0; margin-left: 1em; }\nol.toc li { list-style-type: none; margin: 0; padding: 0; }\n"),("sample.lua","-- This is a sample custom writer for pandoc.  It produces output\n-- that is very similar to that of pandoc's HTML writer.\n-- There is one new feature: code blocks marked with class 'dot'\n-- are piped through graphviz and images are included in the HTML\n-- output using 'data:' URLs.\n--\n-- Invoke with: pandoc -t sample.lua\n--\n-- Note:  you need not have lua installed on your system to use this\n-- custom writer.  However, if you do have lua installed, you can\n-- use it to test changes to the script.  'lua sample.lua' will\n-- produce informative error messages if your code contains\n-- syntax errors.\n\n-- Character escaping\nlocal function escape(s, in_attribute)\n  return s:gsub(\"[<>&\\\"']\",\n    function(x)\n      if x == '<' then\n        return '&lt;'\n      elseif x == '>' then\n        return '&gt;'\n      elseif x == '&' then\n        return '&amp;'\n      elseif x == '\"' then\n        return '&quot;'\n      elseif x == \"'\" then\n        return '&#39;'\n      else\n        return x\n      end\n    end)\nend\n\n-- Helper function to convert an attributes table into\n-- a string that can be put into HTML tags.\nlocal function attributes(attr)\n  local attr_table = {}\n  for x,y in pairs(attr) do\n    if y and y ~= \"\" then\n      table.insert(attr_table, ' ' .. x .. '=\"' .. escape(y,true) .. '\"')\n    end\n  end\n  return table.concat(attr_table)\nend\n\n-- Run cmd on a temporary file containing inp and return result.\nlocal function pipe(cmd, inp)\n  local tmp = os.tmpname()\n  local tmph = io.open(tmp, \"w\")\n  tmph:write(inp)\n  tmph:close()\n  local outh = io.popen(cmd .. \" \" .. tmp,\"r\")\n  local result = outh:read(\"*all\")\n  outh:close()\n  os.remove(tmp)\n  return result\nend\n\n-- Table to store footnotes, so they can be included at the end.\nlocal notes = {}\n\n-- Blocksep is used to separate block elements.\nfunction Blocksep()\n  return \"\\n\\n\"\nend\n\n-- This function is called once for the whole document. Parameters:\n-- body is a string, metadata is a table, variables is a table.\n-- This gives you a fragment.  You could use the metadata table to\n-- fill variables in a custom lua template.  Or, pass `--template=...`\n-- to pandoc, and pandoc will add do the template processing as\n-- usual.\nfunction Doc(body, metadata, variables)\n  local buffer = {}\n  local function add(s)\n    table.insert(buffer, s)\n  end\n  add(body)\n  if #notes > 0 then\n    add('<ol class=\"footnotes\">')\n    for _,note in pairs(notes) do\n      add(note)\n    end\n    add('</ol>')\n  end\n  return table.concat(buffer,'\\n')\nend\n\n-- The functions that follow render corresponding pandoc elements.\n-- s is always a string, attr is always a table of attributes, and\n-- items is always an array of strings (the items in a list).\n-- Comments indicate the types of other variables.\n\nfunction Str(s)\n  return escape(s)\nend\n\nfunction Space()\n  return \" \"\nend\n\nfunction LineBreak()\n  return \"<br/>\"\nend\n\nfunction Emph(s)\n  return \"<em>\" .. s .. \"</em>\"\nend\n\nfunction Strong(s)\n  return \"<strong>\" .. s .. \"</strong>\"\nend\n\nfunction Subscript(s)\n  return \"<sub>\" .. s .. \"</sub>\"\nend\n\nfunction Superscript(s)\n  return \"<sup>\" .. s .. \"</sup>\"\nend\n\nfunction SmallCaps(s)\n  return '<span style=\"font-variant: small-caps;\">' .. s .. '</span>'\nend\n\nfunction Strikeout(s)\n  return '<del>' .. s .. '</del>'\nend\n\nfunction Link(s, src, tit)\n  return \"<a href='\" .. escape(src,true) .. \"' title='\" ..\n         escape(tit,true) .. \"'>\" .. s .. \"</a>\"\nend\n\nfunction Image(s, src, tit)\n  return \"<img src='\" .. escape(src,true) .. \"' title='\" ..\n         escape(tit,true) .. \"'/>\"\nend\n\nfunction Code(s, attr)\n  return \"<code\" .. attributes(attr) .. \">\" .. escape(s) .. \"</code>\"\nend\n\nfunction InlineMath(s)\n  return \"\\\\(\" .. escape(s) .. \"\\\\)\"\nend\n\nfunction DisplayMath(s)\n  return \"\\\\[\" .. escape(s) .. \"\\\\]\"\nend\n\nfunction Note(s)\n  local num = #notes + 1\n  -- insert the back reference right before the final closing tag.\n  s = string.gsub(s,\n          '(.*)</', '%1 <a href=\"#fnref' .. num ..  '\">&#8617;</a></')\n  -- add a list item with the note to the note table.\n  table.insert(notes, '<li id=\"fn' .. num .. '\">' .. s .. '</li>')\n  -- return the footnote reference, linked to the note.\n  return '<a id=\"fnref' .. num .. '\" href=\"#fn' .. num ..\n            '\"><sup>' .. num .. '</sup></a>'\nend\n\nfunction Span(s, attr)\n  return \"<span\" .. attributes(attr) .. \">\" .. s .. \"</span>\"\nend\n\nfunction Cite(s, cs)\n  local ids = {}\n  for _,cit in ipairs(cs) do\n    table.insert(ids, cit.citationId)\n  end\n  return \"<span class=\\\"cite\\\" data-citation-ids=\\\"\" .. table.concat(ids, \",\") ..\n    \"\\\">\" .. s .. \"</span>\"\nend\n\nfunction Plain(s)\n  return s\nend\n\nfunction Para(s)\n  return \"<p>\" .. s .. \"</p>\"\nend\n\n-- lev is an integer, the header level.\nfunction Header(lev, s, attr)\n  return \"<h\" .. lev .. attributes(attr) ..  \">\" .. s .. \"</h\" .. lev .. \">\"\nend\n\nfunction BlockQuote(s)\n  return \"<blockquote>\\n\" .. s .. \"\\n</blockquote>\"\nend\n\nfunction HorizontalRule()\n  return \"<hr/>\"\nend\n\nfunction CodeBlock(s, attr)\n  -- If code block has class 'dot', pipe the contents through dot\n  -- and base64, and include the base64-encoded png as a data: URL.\n  if attr.class and string.match(' ' .. attr.class .. ' ',' dot ') then\n    local png = pipe(\"base64\", pipe(\"dot -Tpng\", s))\n    return '<img src=\"data:image/png;base64,' .. png .. '\"/>'\n  -- otherwise treat as code (one could pipe through a highlighter)\n  else\n    return \"<pre><code\" .. attributes(attr) .. \">\" .. escape(s) ..\n           \"</code></pre>\"\n  end\nend\n\nfunction BulletList(items)\n  local buffer = {}\n  for _, item in pairs(items) do\n    table.insert(buffer, \"<li>\" .. item .. \"</li>\")\n  end\n  return \"<ul>\\n\" .. table.concat(buffer, \"\\n\") .. \"\\n</ul>\"\nend\n\nfunction OrderedList(items)\n  local buffer = {}\n  for _, item in pairs(items) do\n    table.insert(buffer, \"<li>\" .. item .. \"</li>\")\n  end\n  return \"<ol>\\n\" .. table.concat(buffer, \"\\n\") .. \"\\n</ol>\"\nend\n\n-- Revisit association list STackValue instance.\nfunction DefinitionList(items)\n  local buffer = {}\n  for _,item in pairs(items) do\n    for k, v in pairs(item) do\n      table.insert(buffer,\"<dt>\" .. k .. \"</dt>\\n<dd>\" ..\n                        table.concat(v,\"</dd>\\n<dd>\") .. \"</dd>\")\n    end\n  end\n  return \"<dl>\\n\" .. table.concat(buffer, \"\\n\") .. \"\\n</dl>\"\nend\n\n-- Convert pandoc alignment to something HTML can use.\n-- align is AlignLeft, AlignRight, AlignCenter, or AlignDefault.\nfunction html_align(align)\n  if align == 'AlignLeft' then\n    return 'left'\n  elseif align == 'AlignRight' then\n    return 'right'\n  elseif align == 'AlignCenter' then\n    return 'center'\n  else\n    return 'left'\n  end\nend\n\n-- Caption is a string, aligns is an array of strings,\n-- widths is an array of floats, headers is an array of\n-- strings, rows is an array of arrays of strings.\nfunction Table(caption, aligns, widths, headers, rows)\n  local buffer = {}\n  local function add(s)\n    table.insert(buffer, s)\n  end\n  add(\"<table>\")\n  if caption ~= \"\" then\n    add(\"<caption>\" .. caption .. \"</caption>\")\n  end\n  if widths and widths[1] ~= 0 then\n    for _, w in pairs(widths) do\n      add('<col width=\"' .. string.format(\"%d%%\", w * 100) .. '\" />')\n    end\n  end\n  local header_row = {}\n  local empty_header = true\n  for i, h in pairs(headers) do\n    local align = html_align(aligns[i])\n    table.insert(header_row,'<th align=\"' .. align .. '\">' .. h .. '</th>')\n    empty_header = empty_header and h == \"\"\n  end\n  if empty_header then\n    head = \"\"\n  else\n    add('<tr class=\"header\">')\n    for _,h in pairs(header_row) do\n      add(h)\n    end\n    add('</tr>')\n  end\n  local class = \"even\"\n  for _, row in pairs(rows) do\n    class = (class == \"even\" and \"odd\") or \"even\"\n    add('<tr class=\"' .. class .. '\">')\n    for i,c in pairs(row) do\n      add('<td align=\"' .. html_align(aligns[i]) .. '\">' .. c .. '</td>')\n    end\n    add('</tr>')\n  end\n  add('</table')\n  return table.concat(buffer,'\\n')\nend\n\nfunction Div(s, attr)\n  return \"<div\" .. attributes(attr) .. \">\\n\" .. s .. \"</div>\"\nend\n\n-- The following code will produce runtime warnings when you haven't defined\n-- all of the functions you need for the custom writer, so it's useful\n-- to include when you're working on a writer.\nlocal meta = {}\nmeta.__index =\n  function(_, key)\n    io.stderr:write(string.format(\"WARNING: Undefined function '%s'\\n\",key))\n    return function() return \"\" end\n  end\nsetmetatable(_G, meta)\n\n"),("templates/default.textile","$for(include-before)$\n$include-before$\n\n$endfor$\n$body$\n$for(include-after)$\n\n$include-after$\n$endfor$\n"),("templates/default.s5","<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\">\n<head>\n  <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n  <meta http-equiv=\"Content-Style-Type\" content=\"text/css\" />\n  <meta name=\"generator\" content=\"pandoc\" />\n$for(author-meta)$\n  <meta name=\"author\" content=\"$author-meta$\" />\n$endfor$\n$if(date-meta)$\n  <meta name=\"date\" content=\"$date-meta$\" />\n$endif$\n  <title>$if(title-prefix)$$title-prefix$ - $endif$$pagetitle$</title>\n  <style type=\"text/css\">code{white-space: pre;}</style>\n  <!-- configuration parameters -->\n  <meta name=\"defaultView\" content=\"slideshow\" />\n  <meta name=\"controlVis\" content=\"hidden\" />\n$if(highlighting-css)$\n  <style type=\"text/css\">\n$highlighting-css$\n  </style>\n$endif$\n$for(css)$\n  <link rel=\"stylesheet\" href=\"$css$\" type=\"text/css\" />\n$endfor$\n  <!-- style sheet links -->\n  <link rel=\"stylesheet\" href=\"$s5-url$/slides.css\" type=\"text/css\" media=\"projection\" id=\"slideProj\" />\n  <link rel=\"stylesheet\" href=\"$s5-url$/outline.css\" type=\"text/css\" media=\"screen\" id=\"outlineStyle\" />\n  <link rel=\"stylesheet\" href=\"$s5-url$/print.css\" type=\"text/css\" media=\"print\" id=\"slidePrint\" />\n  <link rel=\"stylesheet\" href=\"$s5-url$/opera.css\" type=\"text/css\" media=\"projection\" id=\"operaFix\" />\n  <!-- S5 JS -->\n  <script src=\"$s5-url$/slides.js\" type=\"text/javascript\"></script>\n$if(math)$\n  $math$\n$endif$\n$for(header-includes)$\n  $header-includes$\n$endfor$\n</head>\n<body>\n$for(include-before)$\n$include-before$\n$endfor$\n<div class=\"layout\">\n<div id=\"controls\"></div>\n<div id=\"currentSlide\"></div>\n<div id=\"header\"></div>\n<div id=\"footer\">\n  <h1>$date$</h1>\n  <h2>$title$</h2>\n</div>\n</div>\n<div class=\"presentation\">\n$if(title)$\n<div class=\"titleslide slide\">\n  <h1>$title$</h1>\n$if(subtitle)$\n  <h1 class=\"subtitle\">$subtitle$</h1>\n$endif$\n  <h2>$for(author)$$author$$sep$<br/>$endfor$</h2>\n  <h3>$date$</h3>\n</div>\n$endif$\n$body$\n$for(include-after)$\n$include-after$\n$endfor$\n</div>\n</body>\n</html>\n"),("templates/default.asciidoc","$if(titleblock)$\n$title$\n$for(author)$\n:author: $author$\n$endfor$\n$if(date)$\n:date: $date$\n$endif$\n$if(toc)$\n:toc:\n$endif$\n\n$endif$\n$for(header-includes)$\n$header-includes$\n\n$endfor$\n$for(include-before)$\n$include-before$\n\n$endfor$\n$body$\n$for(include-after)$\n\n$include-after$\n$endfor$\n"),("templates/default.rtf","{\\rtf1\\ansi\\deff0{\\fonttbl{\\f0 \\fswiss Helvetica;}{\\f1 Courier;}}\n{\\colortbl;\\red255\\green0\\blue0;\\red0\\green0\\blue255;}\n\\widowctrl\\hyphauto\n$for(header-includes)$\n$header-includes$\n$endfor$\n\n$if(title)$\n{\\pard \\qc \\f0 \\sa180 \\li0 \\fi0 \\b \\fs36 $title$\\par}\n$endif$\n$for(author)$\n{\\pard \\qc \\f0 \\sa180 \\li0 \\fi0  $author$\\par}\n$endfor$\n$if(date)$\n{\\pard \\qc \\f0 \\sa180 \\li0 \\fi0  $date$\\par}\n$endif$\n$if(spacer)$\n{\\pard \\ql \\f0 \\sa180 \\li0 \\fi0 \\par}\n$endif$\n$if(toc)$\n$toc$\n$endif$\n$for(include-before)$\n$include-before$\n$endfor$\n$body$\n$for(include-after)$\n$include-after$\n$endfor$\n}\n"),("templates/default.html","<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\"$if(lang)$ lang=\"$lang$\" xml:lang=\"$lang$\"$endif$>\n<head>\n  <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n  <meta http-equiv=\"Content-Style-Type\" content=\"text/css\" />\n  <meta name=\"generator\" content=\"pandoc\" />\n$for(author-meta)$\n  <meta name=\"author\" content=\"$author-meta$\" />\n$endfor$\n$if(date-meta)$\n  <meta name=\"date\" content=\"$date-meta$\" />\n$endif$\n  <title>$if(title-prefix)$$title-prefix$ - $endif$$pagetitle$</title>\n  <style type=\"text/css\">code{white-space: pre;}</style>\n$if(quotes)$\n  <style type=\"text/css\">q { quotes: \"\226\128\156\" \"\226\128\157\" \"\226\128\152\" \"\226\128\153\"; }</style>\n$endif$\n$if(highlighting-css)$\n  <style type=\"text/css\">\n$highlighting-css$\n  </style>\n$endif$\n$for(css)$\n  <link rel=\"stylesheet\" href=\"$css$\" $if(html5)$$else$type=\"text/css\" $endif$/>\n$endfor$\n$if(math)$\n  $math$\n$endif$\n$for(header-includes)$\n  $header-includes$\n$endfor$\n</head>\n<body>\n$for(include-before)$\n$include-before$\n$endfor$\n$if(title)$\n<div id=\"$idprefix$header\">\n<h1 class=\"title\">$title$</h1>\n$if(subtitle)$\n<h1 class=\"subtitle\">$subtitle$</h1>\n$endif$\n$for(author)$\n<h2 class=\"author\">$author$</h2>\n$endfor$\n$if(date)$\n<h3 class=\"date\">$date$</h3>\n$endif$\n</div>\n$endif$\n$if(toc)$\n<div id=\"$idprefix$TOC\">\n$toc$\n</div>\n$endif$\n$body$\n$for(include-after)$\n$include-after$\n$endfor$\n</body>\n</html>\n"),("templates/default.markdown","$if(titleblock)$\n$titleblock$\n\n$endif$\n$for(header-includes)$\n$header-includes$\n\n$endfor$\n$for(include-before)$\n$include-before$\n\n$endfor$\n$if(toc)$\n$toc$\n\n$endif$\n$body$\n$for(include-after)$\n\n$include-after$\n$endfor$\n"),("templates/default.dzslides","<!DOCTYPE html>\n<head>\n<meta charset=\"utf-8\">\n$for(author-meta)$\n  <meta name=\"author\" content=\"$author-meta$\" />\n$endfor$\n$if(date-meta)$\n  <meta name=\"dcterms.date\" content=\"$date-meta$\" />\n$endif$\n  <title>$if(title-prefix)$$title-prefix$ - $endif$$pagetitle$</title>\n  <style type=\"text/css\">code{white-space: pre;}</style>\n$if(highlighting-css)$\n  <style type=\"text/css\">\n$highlighting-css$\n  </style>\n$endif$\n$if(css)$\n$for(css)$\n  <link rel=\"stylesheet\" href=\"$css$\" $if(html5)$$else$type=\"text/css\" $endif$/>\n$endfor$\n$else$\n<style>\n  html { background-color: black; }\n  body { background-color: white; border-radius: 12px}\n  /* A section is a slide. It's size is 800x600, and this will never change */\n  section {\n      font-family: Arial, serif;\n      font-size: 20pt;\n    }\n  address, blockquote, dl, fieldset, form, h1, h2, h3, h4, h5, h6, hr, ol, p, pre, table, ul, dl { padding: 10px 20px 10px 20px; }\n  h1, h2, h3 {\n    text-align: center;\n    margin: 10pt 10pt 20pt 10pt;\n  }\n  ul, ol {\n    margin: 10px 10px 10px 50px;\n  }\n  section.titleslide h1 { margin-top: 200px; }\n  h1.title { margin-top: 150px; }\n  h1 { font-size: 180%; }\n  h2 { font-size: 120%; }\n  h3 { font-size: 100%; }\n  q { quotes: \"\226\128\156\" \"\226\128\157\" \"\226\128\152\" \"\226\128\153\"; }\n  blockquote { font-style: italic }\n  /* Figures are displayed full-page, with the caption on\n     top of the image/video */\n  figure {\n    background-color: black;\n  }\n  figcaption {\n    margin: 70px;\n  }\n  footer {\n    position: absolute;\n    bottom: 0;\n    width: 100%;\n    padding: 40px;\n    text-align: right;\n    background-color: #F3F4F8;\n    border-top: 1px solid #CCC;\n  }\n\n  /* Transition effect */\n  /* Feel free to change the transition effect for original\n     animations. See here:\n     https://developer.mozilla.org/en/CSS/CSS_transitions\n     How to use CSS3 Transitions: */\n  section {\n      -moz-transition: left 400ms linear 0s;\n      -webkit-transition: left 400ms linear 0s;\n      -ms-transition: left 400ms linear 0s;\n      transition: left 400ms linear 0s;\n  }\n\n  /* Before */\n  section { left: -150%; }\n  /* Now */\n  section[aria-selected] { left: 0; }\n  /* After */\n  section[aria-selected] ~ section { left: +150%; }\n\n  /* Incremental elements */\n\n  /* By default, visible */\n  .incremental > * { opacity: 1; }\n\n  /* The current item */\n  .incremental > *[aria-selected] { color: red; opacity: 1; }\n\n  /* The items to-be-selected */\n  .incremental > *[aria-selected] ~ * { opacity: 0.2; }\n</style>\n$endif$\n$if(math)$\n  $math$\n$endif$\n$for(header-includes)$\n  $header-includes$\n$endfor$\n</head>\n<body>\n$if(title)$\n<section class=\"title\">\n  <h1 class=\"title\">$title$</h1>\n$if(subtitle)$\n  <h1 class=\"subtitle\">$subtitle$</h1>\n$endif$\n$for(author)$\n  <h2 class=\"author\">$author$</h2>\n$endfor$\n  <h3 class=\"date\">$date$</h3>\n</section>\n$endif$\n$for(include-before)$\n$include-before$\n$endfor$\n$body$\n$for(include-after)$\n$include-after$\n$endfor$\n$dzslides-core$\n</body>\n</html>\n"),("templates/default.epub3","<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE html>\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xmlns:epub=\"http://www.idpf.org/2007/ops\"$if(lang)$ xml:lang=\"$lang$\"$endif$>\n<head>\n  <meta charset=\"utf-8\" />\n  <meta name=\"generator\" content=\"pandoc\" />\n  <title>$pagetitle$</title>\n$if(quotes)$\n  <style type=\"text/css\">\n    q { quotes: \"\226\128\156\" \"\226\128\157\" \"\226\128\152\" \"\226\128\153\"; }\n  </style>\n$endif$\n$if(highlighting-css)$\n  <style type=\"text/css\">\n$highlighting-css$\n  </style>\n$endif$\n$for(css)$\n  <link rel=\"stylesheet\" type=\"text/css\" href=\"$css$\" />\n$endfor$\n</head>\n<body$if(coverpage)$ id=\"cover\"$endif$>\n$if(titlepage)$\n<section epub:type=\"titlepage\">\n$for(title)$\n$if(title.type)$\n  <h1 class=\"$title.type$\">$title.text$</h1>\n$else$\n  <h1 class=\"title\">$title$</h1>\n$endif$\n$endfor$\n$if(subtitle)$\n  <h1 class=\"subtitle\">$subtitle$</h1>\n$endif$\n$for(author)$\n  <h2 class=\"author\">$author$</h2>\n$endfor$\n$for(creator)$\n  <h2 class=\"$creator.type$\">$creator.text$</h2>\n$endfor$\n$if(publisher)$\n  <p class=\"publisher\">$publisher$</p>\n$endif$\n$if(date)$\n  <p class=\"date\">$date$</p>\n$endif$\n$if(rights)$\n  <p class=\"rights\">$rights$</p>\n$endif$\n</section>\n$else$\n$body$\n$endif$\n</body>\n</html>\n\n"),("templates/default.html5","<!DOCTYPE html>\n<html$if(lang)$ lang=\"$lang$\"$endif$>\n<head>\n  <meta charset=\"utf-8\">\n  <meta name=\"generator\" content=\"pandoc\">\n  <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0, user-scalable=yes\">\n$for(author-meta)$\n  <meta name=\"author\" content=\"$author-meta$\">\n$endfor$\n$if(date-meta)$\n  <meta name=\"dcterms.date\" content=\"$date-meta$\">\n$endif$\n  <title>$if(title-prefix)$$title-prefix$ - $endif$$pagetitle$</title>\n  <style type=\"text/css\">code{white-space: pre;}</style>\n  <!--[if lt IE 9]>\n    <script src=\"http://html5shim.googlecode.com/svn/trunk/html5.js\"></script>\n  <![endif]-->\n$if(quotes)$\n  <style type=\"text/css\">q { quotes: \"\226\128\156\" \"\226\128\157\" \"\226\128\152\" \"\226\128\153\"; }</style>\n$endif$\n$if(highlighting-css)$\n  <style type=\"text/css\">\n$highlighting-css$\n  </style>\n$endif$\n$for(css)$\n  <link rel=\"stylesheet\" href=\"$css$\">\n$endfor$\n$if(math)$\n  $math$\n$endif$\n$for(header-includes)$\n  $header-includes$\n$endfor$\n</head>\n<body>\n$for(include-before)$\n$include-before$\n$endfor$\n$if(title)$\n<header>\n<h1 class=\"title\">$title$</h1>\n$if(subtitle)$\n<h1 class=\"subtitle\">$subtitle$</h1>\n$endif$\n$for(author)$\n<h2 class=\"author\">$author$</h2>\n$endfor$\n$if(date)$\n<h3 class=\"date\">$date$</h3>\n$endif$\n</header>\n$endif$\n$if(toc)$\n<nav id=\"$idprefix$TOC\">\n$toc$\n</nav>\n$endif$\n$body$\n$for(include-after)$\n$include-after$\n$endfor$\n</body>\n</html>\n"),("templates/default.man","$if(has-tables)$\n.\\\"t\n$endif$\n.TH \"$title$\" \"$section$\" \"$date$\" \"$footer$\" \"$header$\"\n$for(header-includes)$\n$header-includes$\n$endfor$\n$for(include-before)$\n$include-before$\n$endfor$\n$body$\n$for(include-after)$\n$include-after$\n$endfor$\n$if(author)$\n.SH AUTHORS\n$for(author)$$author$$sep$; $endfor$.\n$endif$\n"),("templates/default.rst","$if(title)$\n$title$\n\n$endif$\n$for(author)$\n:Author: $author$\n$endfor$\n$if(date)$\n:Date:   $date$\n$endif$\n$if(author)$\n\n$else$\n$if(date)$\n\n$endif$\n$endif$\n$if(math)$\n.. role:: math(raw)\n   :format: html latex\n..\n\n$endif$\n$for(include-before)$\n$include-before$\n\n$endfor$\n$if(toc)$\n.. contents::\n   :depth: $toc-depth$\n..\n\n$endif$\n$for(header-includes)$\n$header-includes$\n\n$endfor$\n$body$\n$for(include-after)$\n\n$include-after$\n$endfor$\n"),("templates/default.slidy","<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\"\n \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\"$if(lang)$ lang=\"$lang$\" xml:lang=\"$lang$\"$endif$>\n<head>\n  <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n  <meta http-equiv=\"Content-Style-Type\" content=\"text/css\" />\n  <meta name=\"generator\" content=\"pandoc\" />\n$for(author-meta)$\n  <meta name=\"author\" content=\"$author-meta$\" />\n$endfor$\n$if(date-meta)$\n  <meta name=\"date\" content=\"$date-meta$\" />\n$endif$\n  <title>$if(title-prefix)$$title-prefix$ - $endif$$pagetitle$</title>\n  <style type=\"text/css\">code{white-space: pre;}</style>\n$if(highlighting-css)$\n  <style type=\"text/css\">\n$highlighting-css$\n  </style>\n$endif$\n  <link rel=\"stylesheet\" type=\"text/css\" media=\"screen, projection, print\"\n    href=\"$slidy-url$/styles/slidy.css\" />\n$for(css)$\n  <link rel=\"stylesheet\" type=\"text/css\" media=\"screen, projection, print\"\n   href=\"$css$\" />\n$endfor$\n$if(math)$\n  $math$\n$endif$\n$for(header-includes)$\n  $header-includes$\n$endfor$\n  <script src=\"$slidy-url$/scripts/slidy.js\"\n    charset=\"utf-8\" type=\"text/javascript\"></script>\n$if(duration)$\n  <meta name=\"duration\" content=\"$duration$\" />\n$endif$\n</head>\n<body>\n$for(include-before)$\n$include-before$\n$endfor$\n$if(title)$\n<div class=\"slide titlepage\">\n  <h1 class=\"title\">$title$</h1>\n$if(subtitle)$\n  <h1 class=\"subtitle\">$subtitle$</h1>\n$endif$\n  <p class=\"author\">\n$for(author)$$author$$sep$<br/>$endfor$\n  </p>\n$if(date)$\n  <p class=\"date\">$date$</p>\n$endif$\n</div>\n$endif$\n$body$\n$for(include-after)$\n$include-after$\n$endfor$\n</body>\n</html>\n"),("templates/default.opendocument","<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<office:document-content xmlns:office=\"urn:oasis:names:tc:opendocument:xmlns:office:1.0\" xmlns:style=\"urn:oasis:names:tc:opendocument:xmlns:style:1.0\" xmlns:text=\"urn:oasis:names:tc:opendocument:xmlns:text:1.0\" xmlns:table=\"urn:oasis:names:tc:opendocument:xmlns:table:1.0\" xmlns:draw=\"urn:oasis:names:tc:opendocument:xmlns:drawing:1.0\" xmlns:fo=\"urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:meta=\"urn:oasis:names:tc:opendocument:xmlns:meta:1.0\" xmlns:number=\"urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0\" xmlns:svg=\"urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0\" xmlns:chart=\"urn:oasis:names:tc:opendocument:xmlns:chart:1.0\" xmlns:dr3d=\"urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0\" xmlns:math=\"http://www.w3.org/1998/Math/MathML\" xmlns:form=\"urn:oasis:names:tc:opendocument:xmlns:form:1.0\" xmlns:script=\"urn:oasis:names:tc:opendocument:xmlns:script:1.0\" xmlns:ooo=\"http://openoffice.org/2004/office\" xmlns:ooow=\"http://openoffice.org/2004/writer\" xmlns:oooc=\"http://openoffice.org/2004/calc\" xmlns:dom=\"http://www.w3.org/2001/xml-events\" xmlns:xforms=\"http://www.w3.org/2002/xforms\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" office:version=\"1.2\">\n  <office:font-face-decls>\n    <style:font-face style:name=\"Courier New\" style:font-family-generic=\"modern\" style:font-pitch=\"fixed\" svg:font-family=\"'Courier New'\" />\n  </office:font-face-decls>\n  $automatic-styles$\n$for(header-includes)$\n  $header-includes$\n$endfor$\n<office:body>\n<office:text>\n$if(title)$\n<text:h text:style-name=\"Title\">$title$</text:h>\n$endif$\n$for(author)$\n<text:p text:style-name=\"Author\">$author$</text:p>\n$endfor$\n$if(date)$\n<text:p text:style-name=\"Date\">$date$</text:p>\n$endif$\n$for(include-before)$\n$include-before$\n$endfor$\n$body$\n$for(include-after)$\n$include-after$\n$endfor$\n</office:text>\n</office:body>\n</office:document-content>\n"),("templates/default.haddock","$body$\n"),("templates/default.org","$if(title)$\n#+TITLE: $title$\n\n$endif$\n$if(author)$\n#+AUTHOR: $for(author)$$author$$sep$; $endfor$\n$endif$\n$if(date)$\n#+DATE: $date$\n\n$endif$\n$for(header-includes)$\n$header-includes$\n\n$endfor$\n$for(include-before)$\n$include-before$\n\n$endfor$\n$body$\n$for(include-after)$\n\n$include-after$\n$endfor$\n"),("templates/default.latex","\\documentclass[$if(fontsize)$$fontsize$,$endif$$if(lang)$$lang$,$endif$$if(papersize)$$papersize$,$endif$$for(classoption)$$classoption$$sep$,$endfor$]{$documentclass$}\n$if(fontfamily)$\n\\usepackage{$fontfamily$}\n$else$\n\\usepackage{lmodern}\n$endif$\n$if(linestretch)$\n\\usepackage{setspace}\n\\setstretch{$linestretch$}\n$endif$\n\\usepackage{amssymb,amsmath}\n\\usepackage{ifxetex,ifluatex}\n\\usepackage{fixltx2e} % provides \\textsubscript\n\\ifnum 0\\ifxetex 1\\fi\\ifluatex 1\\fi=0 % if pdftex\n  \\usepackage[T1]{fontenc}\n  \\usepackage[utf8]{inputenc}\n$if(euro)$\n  \\usepackage{eurosym}\n$endif$\n\\else % if luatex or xelatex\n  \\ifxetex\n    \\usepackage{mathspec}\n    \\usepackage{xltxtra,xunicode}\n  \\else\n    \\usepackage{fontspec}\n  \\fi\n  \\defaultfontfeatures{Mapping=tex-text,Scale=MatchLowercase}\n  \\newcommand{\\euro}{\226\130\172}\n$if(mainfont)$\n    \\setmainfont{$mainfont$}\n$endif$\n$if(sansfont)$\n    \\setsansfont{$sansfont$}\n$endif$\n$if(monofont)$\n    \\setmonofont[Mapping=tex-ansi]{$monofont$}\n$endif$\n$if(mathfont)$\n    \\setmathfont(Digits,Latin,Greek){$mathfont$}\n$endif$\n\\fi\n% use upquote if available, for straight quotes in verbatim environments\n\\IfFileExists{upquote.sty}{\\usepackage{upquote}}{}\n% use microtype if available\n\\IfFileExists{microtype.sty}{%\n\\usepackage{microtype}\n\\UseMicrotypeSet[protrusion]{basicmath} % disable protrusion for tt fonts\n}{}\n$if(geometry)$\n\\usepackage[$for(geometry)$$geometry$$sep$,$endfor$]{geometry}\n$endif$\n$if(lang)$\n\\ifxetex\n  \\usepackage{polyglossia}\n  \\setmainlanguage{$mainlang$}\n\\else\n  \\usepackage[shorthands=off,$lang$]{babel}\n\\fi\n$endif$\n$if(natbib)$\n\\usepackage{natbib}\n\\bibliographystyle{$if(biblio-style)$$biblio-style$$else$plainnat$endif$}\n$endif$\n$if(biblatex)$\n\\usepackage{biblatex}\n$if(biblio-files)$\n\\bibliography{$biblio-files$}\n$endif$\n$endif$\n$if(listings)$\n\\usepackage{listings}\n$endif$\n$if(lhs)$\n\\lstnewenvironment{code}{\\lstset{language=Haskell,basicstyle=\\small\\ttfamily}}{}\n$endif$\n$if(highlighting-macros)$\n$highlighting-macros$\n$endif$\n$if(verbatim-in-note)$\n\\usepackage{fancyvrb}\n\\VerbatimFootnotes\n$endif$\n$if(tables)$\n\\usepackage{longtable,booktabs}\n$endif$\n$if(graphics)$\n\\usepackage{graphicx}\n\\makeatletter\n\\def\\maxwidth{\\ifdim\\Gin@nat@width>\\linewidth\\linewidth\\else\\Gin@nat@width\\fi}\n\\def\\maxheight{\\ifdim\\Gin@nat@height>\\textheight\\textheight\\else\\Gin@nat@height\\fi}\n\\makeatother\n% Scale images if necessary, so that they will not overflow the page\n% margins by default, and it is still possible to overwrite the defaults\n% using explicit options in \\includegraphics[width, height, ...]{}\n\\setkeys{Gin}{width=\\maxwidth,height=\\maxheight,keepaspectratio}\n$endif$\n\\ifxetex\n  \\usepackage[setpagesize=false, % page size defined by xetex\n              unicode=false, % unicode breaks when used with xetex\n              xetex]{hyperref}\n\\else\n  \\usepackage[unicode=true]{hyperref}\n\\fi\n\\hypersetup{breaklinks=true,\n            bookmarks=true,\n            pdfauthor={$author-meta$},\n            pdftitle={$title-meta$},\n            colorlinks=true,\n            citecolor=$if(citecolor)$$citecolor$$else$blue$endif$,\n            urlcolor=$if(urlcolor)$$urlcolor$$else$blue$endif$,\n            linkcolor=$if(linkcolor)$$linkcolor$$else$magenta$endif$,\n            pdfborder={0 0 0}}\n\\urlstyle{same}  % don't use monospace font for urls\n$if(links-as-notes)$\n% Make links footnotes instead of hotlinks:\n\\renewcommand{\\href}[2]{#2\\footnote{\\url{#1}}}\n$endif$\n$if(strikeout)$\n\\usepackage[normalem]{ulem}\n% avoid problems with \\sout in headers with hyperref:\n\\pdfstringdefDisableCommands{\\renewcommand{\\sout}{}}\n$endif$\n\\setlength{\\parindent}{0pt}\n\\setlength{\\parskip}{6pt plus 2pt minus 1pt}\n\\setlength{\\emergencystretch}{3em}  % prevent overfull lines\n$if(numbersections)$\n\\setcounter{secnumdepth}{5}\n$else$\n\\setcounter{secnumdepth}{0}\n$endif$\n$if(verbatim-in-note)$\n\\VerbatimFootnotes % allows verbatim text in footnotes\n$endif$\n\n$if(title)$\n\\title{$title$$if(subtitle)$\\\\\\vspace{0.5em}{\\large $subtitle$}$endif$}\n$endif$\n$if(author)$\n\\author{$for(author)$$author$$sep$ \\and $endfor$}\n$endif$\n\\date{$date$}\n$for(header-includes)$\n$header-includes$\n$endfor$\n\n\\begin{document}\n$if(title)$\n\\maketitle\n$endif$\n$if(abstract)$\n\\begin{abstract}\n$abstract$\n\\end{abstract}\n$endif$\n\n$for(include-before)$\n$include-before$\n\n$endfor$\n$if(toc)$\n{\n\\hypersetup{linkcolor=black}\n\\setcounter{tocdepth}{$toc-depth$}\n\\tableofcontents\n}\n$endif$\n$if(lot)$\n\\listoftables\n$endif$\n$if(lof)$\n\\listoffigures\n$endif$\n$body$\n\n$if(natbib)$\n$if(biblio-files)$\n$if(biblio-title)$\n$if(book-class)$\n\\renewcommand\\bibname{$biblio-title$}\n$else$\n\\renewcommand\\refname{$biblio-title$}\n$endif$\n$endif$\n\\bibliography{$biblio-files$}\n\n$endif$\n$endif$\n$if(biblatex)$\n\\printbibliography$if(biblio-title)$[title=$biblio-title$]$endif$\n\n$endif$\n$for(include-after)$\n$include-after$\n\n$endfor$\n\\end{document}\n"),("templates/default.dokuwiki","$for(include-before)$\n$include-before$\n\n$endfor$\n$if(toc)$\n__TOC__\n\n$endif$\n$body$\n$for(include-after)$\n\n$include-after$\n$endfor$\n"),("templates/default.icml","<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n<?aid style=\"50\" type=\"snippet\" readerVersion=\"6.0\" featureSet=\"513\" product=\"8.0(370)\" ?>\n<?aid SnippetType=\"InCopyInterchange\"?>\n<Document DOMVersion=\"8.0\" Self=\"pandoc_doc\">\n    <RootCharacterStyleGroup Self=\"pandoc_character_styles\">\n      <CharacterStyle Self=\"$$ID/NormalCharacterStyle\" Name=\"Default\" />\n      $charStyles$ \n    </RootCharacterStyleGroup>\n    <RootParagraphStyleGroup Self=\"pandoc_paragraph_styles\">\n      <ParagraphStyle Self=\"$$ID/NormalParagraphStyle\" Name=\"$$ID/NormalParagraphStyle\"\n          SpaceBefore=\"6\" SpaceAfter=\"6\"> <!-- paragraph spacing -->\n        <Properties>\n          <TabList type=\"list\">\n            <ListItem type=\"record\">\n              <Alignment type=\"enumeration\">LeftAlign</Alignment>\n              <AlignmentCharacter type=\"string\">.</AlignmentCharacter>\n              <Leader type=\"string\"></Leader>\n              <Position type=\"unit\">10</Position> <!-- first tab stop -->\n            </ListItem>\n          </TabList>\n        </Properties>\n      </ParagraphStyle>\n      $parStyles$ \n    </RootParagraphStyleGroup>\n    <RootTableStyleGroup Self=\"pandoc_table_styles\">\n      <TableStyle Self=\"TableStyle/Table\" Name=\"Table\" />\n    </RootTableStyleGroup>\n    <RootCellStyleGroup Self=\"pandoc_cell_styles\">\n      <CellStyle Self=\"CellStyle/Cell\" AppliedParagraphStyle=\"ParagraphStyle/$$ID/[No paragraph style]\" Name=\"Cell\" />\n    </RootCellStyleGroup>\n  <Story Self=\"pandoc_story\"\n      TrackChanges=\"false\"\n      StoryTitle=\"$if(title-prefix)$$title-prefix$ - $endif$$pagetitle$\"\n      AppliedTOCStyle=\"n\"\n      AppliedNamedGrid=\"n\" >\n    <StoryPreference OpticalMarginAlignment=\"true\" OpticalMarginSize=\"12\" />\n\n<!-- body needs to be non-indented, otherwise code blocks are indented too far -->\n$body$\n\n  </Story>\n  $hyperlinks$\n</Document>\n"),("templates/default.opml","<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<opml version=\"2.0\">\n  <head>\n    <title>$title$</title>\n    <dateModified>$date$</dateModified>\n    <ownerName>$for(author)$$author$$sep$; $endfor$</ownerName>\n  </head>\n  <body>\n$body$\n  </body>\n</opml>\n"),("templates/README.markdown","Templates for [pandoc](http://github.com/jgm/pandoc).\n\nIf you use custom templates, we recommend forking this repository,\nso that you can integrate changes to the default templates in future\npandoc releases.\n\nAll of the templates in this repository are dual licensed, under both\nthe GPL (v2 or higher, same as pandoc) and the BSD 3-clause license\n(included below).\n\n----\n\nCopyright (c) 2014, John MacFarlane\n\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are met:\n\n    * Redistributions of source code must retain the above copyright\n      notice, this list of conditions and the following disclaimer.\n\n    * Redistributions in binary form must reproduce the above\n      copyright notice, this list of conditions and the following\n      disclaimer in the documentation and/or other materials provided\n      with the distribution.\n\n    * Neither the name of John MacFarlane nor the names of other\n      contributors may be used to endorse or promote products derived\n      from this software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n\"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\nLIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\nA PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\nOWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\nSPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\nLIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\nDATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\nTHEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"),("templates/default.texinfo","\\input texinfo\n@documentencoding UTF-8\n$for(header-includes)$\n$header-includes$\n$endfor$\n\n$if(strikeout)$\n@macro textstrikeout{text}\n~~\\text\\~~\n@end macro\n\n$endif$\n$if(subscript)$\n@macro textsubscript{text}\n@iftex\n@textsubscript{\\text\\}\n@end iftex\n@ifnottex\n_@{\\text\\@}\n@end ifnottex\n@end macro\n\n$endif$\n$if(superscript)$\n@macro textsuperscript{text}\n@iftex\n@textsuperscript{\\text\\}\n@end iftex\n@ifnottex\n^@{\\text\\@}\n@end ifnottex\n@end macro\n\n$endif$\n@ifnottex\n@paragraphindent 0\n@end ifnottex\n$if(titlepage)$\n@titlepage\n@title $title$\n$for(author)$\n@author $author$\n$endfor$\n$if(date)$\n$date$\n$endif$\n@end titlepage\n\n$endif$\n$for(include-before)$\n$include-before$\n\n$endfor$\n$if(toc)$\n@contents\n\n$endif$\n$body$\n$for(include-after)$\n\n$include-after$\n$endfor$\n\n@bye\n"),("templates/default.context","\\startmode[*mkii]\n  \\enableregime[utf-8]  \n  \\setupcolors[state=start]\n\\stopmode\n$if(mainlang)$\n\\mainlanguage[$mainlang$]\n$endif$\n\n% Enable hyperlinks\n\\setupinteraction[state=start, color=middleblue]\n\n\\setuppapersize [$if(papersize)$$papersize$$else$letter$endif$][$if(papersize)$$papersize$$else$letter$endif$]\n\\setuplayout    [width=middle,  backspace=1.5in, cutspace=1.5in,\n                 height=middle, topspace=0.75in, bottomspace=0.75in]\n\n\\setuppagenumbering[location={footer,center}]\n\n\\setupbodyfont[11pt]\n\n\\setupwhitespace[medium]\n\n\\setuphead[chapter]      [style=\\tfd]\n\\setuphead[section]      [style=\\tfc]\n\\setuphead[subsection]   [style=\\tfb]\n\\setuphead[subsubsection][style=\\bf]\n\n$if(number-sections)$\n$else$\n\\setuphead[chapter, section, subsection, subsubsection][number=no]\n$endif$\n\n\\definedescription\n  [description]\n  [headstyle=bold, style=normal, location=hanging, width=broad, margin=1cm]\n\n\\setupitemize[autointro]    % prevent orphan list intro\n\\setupitemize[indentnext=no]\n\n\\setupfloat[figure][default={here,nonumber}]\n\\setupfloat[table][default={here,nonumber}]\n\n\\setupthinrules[width=15em] % width of horizontal rules\n\n\\setupdelimitedtext\n  [blockquote]\n  [before={\\blank[medium]},\n   after={\\blank[medium]},\n   indentnext=no,\n  ]\n\n$if(toc)$\n\\setupcombinedlist[content][list={$placelist$}]\n\n$endif$\n$for(header-includes)$\n$header-includes$\n$endfor$\n\n\\starttext\n$if(title)$\n\\startalignment[center]\n  \\blank[2*big]\n  {\\tfd $title$}\n$if(author)$\n  \\blank[3*medium]\n  {\\tfa $for(author)$$author$$sep$\\crlf $endfor$}\n$endif$\n$if(date)$\n  \\blank[2*medium]\n  {\\tfa $date$}\n$endif$\n  \\blank[3*medium]\n\\stopalignment\n$endif$\n$for(include-before)$\n$include-before$\n$endfor$\n$if(toc)$\n\\placecontent\n$endif$\n\n$body$\n\n$for(include-after)$\n$include-after$\n$endfor$\n\\stoptext\n"),("templates/default.plain","$if(titleblock)$\n$titleblock$\n\n$endif$\n$for(header-includes)$\n$header-includes$\n\n$endfor$\n$for(include-before)$\n$include-before$\n\n$endfor$\n$if(toc)$\n$toc$\n\n$endif$\n$body$\n$for(include-after)$\n\n$include-after$\n$endfor$\n"),("templates/default.epub","<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\" \"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\"$if(lang)$ xml:lang=\"$lang$\"$endif$>\n<head>\n  <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n  <meta http-equiv=\"Content-Style-Type\" content=\"text/css\" />\n  <meta name=\"generator\" content=\"pandoc\" />\n  <title>$pagetitle$</title>\n$if(highlighting-css)$\n  <style type=\"text/css\">\n$highlighting-css$\n  </style>\n$endif$\n$for(css)$\n  <link rel=\"stylesheet\" type=\"text/css\" href=\"$css$\" />\n$endfor$\n</head>\n<body$if(coverpage)$ id=\"cover\"$endif$>\n$if(titlepage)$\n$for(title)$\n$if(title.text)$\n  <h1 class=\"$title.type$\">$title.text$</h1>\n$else$\n  <h1 class=\"title\">$title$</h1>\n$endif$\n$endfor$\n$if(subtitle)$\n  <h1 class=\"subtitle\">$subtitle$</h1>\n$endif$\n$for(author)$\n  <h2 class=\"author\">$author$</h2>\n$endfor$\n$for(creator)$\n  <h2 class=\"$creator.type$\">$creator.text$</h2>\n$endfor$\n$if(publisher)$\n  <p class=\"publisher\">$publisher$</p>\n$endif$\n$if(date)$\n  <p class=\"date\">$date$</p>\n$endif$\n$if(rights)$\n  <p class=\"rights\">$rights$</p>\n$endif$\n$else$\n$body$\n$endif$\n</body>\n</html>\n\n"),("templates/default.docbook","<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n$if(mathml)$\n<!DOCTYPE article PUBLIC \"-//OASIS//DTD DocBook EBNF Module V1.1CR1//EN\"\n                  \"http://www.oasis-open.org/docbook/xml/mathml/1.1CR1/dbmathml.dtd\">\n$else$\n<!DOCTYPE article PUBLIC \"-//OASIS//DTD DocBook XML V4.5//EN\"\n                  \"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd\">\n$endif$\n<article>\n  <articleinfo>\n    <title>$title$</title>\n$if(author)$\n    <authorgroup>\n$for(author)$\n      <author>\n        $author$\n      </author>\n$endfor$\n    </authorgroup>\n$endif$\n$if(date)$\n    <date>$date$</date>\n$endif$\n  </articleinfo>\n$for(include-before)$\n$include-before$\n$endfor$\n$body$\n$for(include-after)$\n$include-after$\n$endfor$\n</article>\n"),("templates/default.slideous","<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\"\n \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\"$if(lang)$ lang=\"$lang$\" xml:lang=\"$lang$\"$endif$>\n<head>\n  <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n  <meta http-equiv=\"Content-Style-Type\" content=\"text/css\" />\n  <meta name=\"generator\" content=\"pandoc\" />\n$for(author-meta)$\n  <meta name=\"author\" content=\"$author-meta$\" />\n$endfor$\n$if(date-meta)$\n  <meta name=\"date\" content=\"$date-meta$\" />\n$endif$\n  <title>$if(title-prefix)$$title-prefix$ - $endif$$pagetitle$</title>\n  <style type=\"text/css\">code{white-space: pre;}</style>\n$if(highlighting-css)$\n  <style type=\"text/css\">\n$highlighting-css$\n  </style>\n$endif$\n  <link rel=\"stylesheet\" type=\"text/css\" media=\"screen, projection, print\"\n    href=\"$slideous-url$/slideous.css\" />\n$for(css)$\n  <link rel=\"stylesheet\" type=\"text/css\" media=\"screen, projection, print\"\n   href=\"$css$\" />\n$endfor$\n$if(math)$\n  $math$\n$endif$\n$for(header-includes)$\n  $header-includes$\n$endfor$\n  <script src=\"$slideous-url$/slideous.js\"\n    charset=\"utf-8\" type=\"text/javascript\"></script>\n$if(duration)$\n  <meta name=\"duration\" content=\"$duration$\" />\n$endif$\n</head>\n<body>\n$for(include-before)$\n$include-before$\n$endfor$\n<div id=\"statusbar\">\n<span style=\"float:right;\">\n<span style=\"margin-right:4em;font-weight:bold;\"><span id=\"slideidx\"></span> of {$$slidecount}</span>\n<button id=\"homebutton\" title=\"first slide\">1</button>\n<button id=\"prevslidebutton\" title=\"previous slide\">&laquo;</button>\n<button id=\"previtembutton\" title=\"previous item\">&lsaquo;</button>\n<button id=\"nextitembutton\" title=\"next item\">&rsaquo;</button>\n<button id=\"nextslidebutton\" title=\"next slide\">&raquo;</button>\n<button id=\"endbutton\" title=\"last slide\">{$$slidecount}</button>\n<button id=\"incfontbutton\" title=\"content\">A+</button>\n<button id=\"decfontbutton\" title=\"first slide\">A-</button>\n<select id=\"tocbox\" size=\"1\"><option></option></select>\n</span>\n<span id=\"eos\">&frac12;</span>\n<span title=\"{$$location}, {$$date}\">{$$title}, {$$author}</span>\n</div>\n$if(title)$\n<div class=\"slide titlepage\">\n  <h1 class=\"title\">$title$</h1>\n$if(subtitle)$\n  <h1 class=\"subtitle\">$subtitle$</h1>\n$endif$\n  <p class=\"author\">\n$for(author)$$author$$sep$<br/>$endfor$\n  </p>\n$if(date)$\n  <p class=\"date\">$date$</p>\n$endif$\n</div>\n$endif$\n$body$\n$for(include-after)$\n$include-after$\n$endfor$\n</body>\n</html>\n"),("templates/default.mediawiki","$for(include-before)$\n$include-before$\n\n$endfor$\n$if(toc)$\n__TOC__\n\n$endif$\n$body$\n$for(include-after)$\n\n$include-after$\n$endfor$\n"),("templates/default.revealjs","<!DOCTYPE html>\n<html$if(lang)$ lang=\"$lang$\"$endif$>\n<head>\n  <meta charset=\"utf-8\">\n  <meta name=\"generator\" content=\"pandoc\">\n$for(author-meta)$\n  <meta name=\"author\" content=\"$author-meta$\" />\n$endfor$\n$if(date-meta)$\n  <meta name=\"dcterms.date\" content=\"$date-meta$\" />\n$endif$\n  <title>$if(title-prefix)$$title-prefix$ - $endif$$pagetitle$</title>\n  <meta name=\"apple-mobile-web-app-capable\" content=\"yes\" />\n  <meta name=\"apple-mobile-web-app-status-bar-style\" content=\"black-translucent\" />\n  <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no\">\n  <link rel=\"stylesheet\" href=\"$revealjs-url$/css/reveal.min.css\"/>\n    <style type=\"text/css\">code{white-space: pre;}</style>\n$if(highlighting-css)$\n    <style type=\"text/css\">\n$highlighting-css$\n    </style>\n$endif$\n$if(css)$\n$for(css)$\n    <link rel=\"stylesheet\" href=\"$css$\"/>\n$endfor$\n$else$\n    <link rel=\"stylesheet\" href=\"$revealjs-url$/css/theme/simple.css\" id=\"theme\">\n$endif$\n    <!-- If the query includes 'print-pdf', include the PDF print sheet -->\n    <script>\n      if( window.location.search.match( /print-pdf/gi ) ) {\n        var link = document.createElement( 'link' );\n        link.rel = 'stylesheet';\n        link.type = 'text/css';\n        link.href = '$revealjs-url$/css/print/pdf.css';\n        document.getElementsByTagName( 'head' )[0].appendChild( link );\n      }\n    </script>\n    <!--[if lt IE 9]>\n    <script src=\"$revealjs-url$/lib/js/html5shiv.js\"></script>\n    <![endif]-->\n$if(math)$\n    $math$\n$endif$\n$for(header-includes)$\n    $header-includes$\n$endfor$\n</head>\n<body>\n$for(include-before)$\n$include-before$\n$endfor$\n  <div class=\"reveal\">\n    <div class=\"slides\">\n\n$if(title)$\n<section>\n    <h1 class=\"title\">$title$</h1>\n$if(subtitle)$\n  <h1 class=\"subtitle\">$subtitle$</h1>\n$endif$\n$for(author)$\n    <h2 class=\"author\">$author$</h2>\n$endfor$\n    <h3 class=\"date\">$date$</h3>\n</section>\n$endif$\n$if(toc)$\n<section id=\"$idprefix$TOC\">\n$toc$\n</section>\n$endif$\n\n$body$\n    </div>\n  </div>\n\n\n  <script src=\"$revealjs-url$/lib/js/head.min.js\"></script>\n  <script src=\"$revealjs-url$/js/reveal.min.js\"></script>\n\n  <script>\n\n      // Full list of configuration options available here:\n      // https://github.com/hakimel/reveal.js#configuration\n      Reveal.initialize({\n        controls: true,\n        progress: true,\n        history: true,\n        center: true,\n        theme: $if(theme)$'$theme$'$else$Reveal.getQueryHash().theme$endif$, // available themes are in /css/theme\n        transition: $if(transition)$'$transition$'$else$Reveal.getQueryHash().transition || 'default'$endif$, // default/cube/page/concave/zoom/linear/fade/none\n\n        // Optional libraries used to extend on reveal.js\n        dependencies: [\n          { src: '$revealjs-url$/lib/js/classList.js', condition: function() { return !document.body.classList; } },\n          { src: '$revealjs-url$/plugin/zoom-js/zoom.js', async: true, condition: function() { return !!document.body.classList; } },\n          { src: '$revealjs-url$/plugin/notes/notes.js', async: true, condition: function() { return !!document.body.classList; } },\n//          { src: '$revealjs-url$/plugin/search/search.js', async: true, condition: function() { return !!document.body.classList; }, }\n//          { src: '$revealjs-url$/plugin/remotes/remotes.js', async: true, condition: function() { return !!document.body.classList; } }\n]});\n    </script>\n  $for(include-after)$\n  $include-after$\n  $endfor$\n  </body>\n</html>\n"),("templates/default.beamer","\\documentclass[$if(fontsize)$$fontsize$,$endif$$if(handout)$handout,$endif$$if(beamer)$ignorenonframetext,$endif$$for(classoption)$$classoption$$sep$,$endfor$]{$documentclass$}\n$if(theme)$\n\\usetheme{$theme$}\n$endif$\n$if(colortheme)$\n\\usecolortheme{$colortheme$}\n$endif$\n$if(fonttheme)$\n\\usefonttheme{$fonttheme$}\n$endif$\n\\setbeamertemplate{caption}[numbered]\n\\setbeamertemplate{caption label separator}{:}\n\\setbeamercolor{caption name}{fg=normal text.fg}\n\\usepackage{amssymb,amsmath}\n\\usepackage{ifxetex,ifluatex}\n\\usepackage{fixltx2e} % provides \\textsubscript\n\\usepackage{lmodern}\n\\ifxetex\n  \\usepackage{fontspec,xltxtra,xunicode}\n  \\defaultfontfeatures{Mapping=tex-text,Scale=MatchLowercase}\n  \\newcommand{\\euro}{\226\130\172}\n\\else\n  \\ifluatex\n    \\usepackage{fontspec}\n    \\defaultfontfeatures{Mapping=tex-text,Scale=MatchLowercase}\n    \\newcommand{\\euro}{\226\130\172}\n  \\else\n    \\usepackage[T1]{fontenc}\n    \\usepackage[utf8]{inputenc}\n    $if(euro)$\n      \\usepackage{eurosym}\n    $endif$\n  \\fi\n\\fi\n% use upquote if available, for straight quotes in verbatim environments\n\\IfFileExists{upquote.sty}{\\usepackage{upquote}}{}\n% use microtype if available\n\\IfFileExists{microtype.sty}{\\usepackage{microtype}}{}\n$if(natbib)$\n\\usepackage{natbib}\n\\bibliographystyle{plainnat}\n$endif$\n$if(biblatex)$\n\\usepackage{biblatex}\n$if(biblio-files)$\n\\bibliography{$biblio-files$}\n$endif$\n$endif$\n$if(listings)$\n\\usepackage{listings}\n$endif$\n$if(lhs)$\n\\lstnewenvironment{code}{\\lstset{language=Haskell,basicstyle=\\small\\ttfamily}}{}\n$endif$\n$if(highlighting-macros)$\n$highlighting-macros$\n$endif$\n$if(verbatim-in-note)$\n\\usepackage{fancyvrb}\n$endif$\n$if(tables)$\n\\usepackage{longtable,booktabs}\n\\usepackage{caption}\n% These lines are needed to make table captions work with longtable:\n\\makeatletter\n\\def\\fnum@table{\\tablename~\\thetable}\n\\makeatother\n$endif$\n$if(url)$\n\\usepackage{url}\n$endif$\n$if(graphics)$\n\\usepackage{graphicx}\n\\makeatletter\n\\def\\maxwidth{\\ifdim\\Gin@nat@width>\\linewidth\\linewidth\\else\\Gin@nat@width\\fi}\n\\def\\maxheight{\\ifdim\\Gin@nat@height>\\textheight0.8\\textheight\\else\\Gin@nat@height\\fi}\n\\makeatother\n% Scale images if necessary, so that they will not overflow the page\n% margins by default, and it is still possible to overwrite the defaults\n% using explicit options in \\includegraphics[width, height, ...]{}\n\\setkeys{Gin}{width=\\maxwidth,height=\\maxheight,keepaspectratio}\n$endif$\n\n% Comment these out if you don't want a slide with just the\n% part/section/subsection/subsubsection title:\n\\AtBeginPart{\n  \\let\\insertpartnumber\\relax\n  \\let\\partname\\relax\n  \\frame{\\partpage}\n}\n\\AtBeginSection{\n  \\let\\insertsectionnumber\\relax\n  \\let\\sectionname\\relax\n  \\frame{\\sectionpage}\n}\n\\AtBeginSubsection{\n  \\let\\insertsubsectionnumber\\relax\n  \\let\\subsectionname\\relax\n  \\frame{\\subsectionpage}\n}\n\n$if(strikeout)$\n\\usepackage[normalem]{ulem}\n% avoid problems with \\sout in headers with hyperref:\n\\pdfstringdefDisableCommands{\\renewcommand{\\sout}{}}\n$endif$\n\\setlength{\\parindent}{0pt}\n\\setlength{\\parskip}{6pt plus 2pt minus 1pt}\n\\setlength{\\emergencystretch}{3em}  % prevent overfull lines\n$if(numbersections)$\n$else$\n\\setcounter{secnumdepth}{0}\n$endif$\n$if(verbatim-in-note)$\n\\VerbatimFootnotes % allows verbatim text in footnotes\n$endif$\n$if(lang)$\n\\usepackage[$lang$]{babel}\n$endif$\n$for(header-includes)$\n$header-includes$\n$endfor$\n\n$if(title)$\n\\title{$title$}\n$endif$\n$if(subtitle)$\n\\subtitle{$subtitle$}\n$endif$\n$if(author)$\n\\author{$for(author)$$author$$sep$ \\and $endfor$}\n$endif$\n\\date{$date$}\n\n\\begin{document}\n$if(title)$\n\\frame{\\titlepage}\n$endif$\n\n$for(include-before)$\n$include-before$\n\n$endfor$\n$if(toc)$\n\\begin{frame}\n\\tableofcontents[hideallsubsections]\n\\end{frame}\n\n$endif$\n$body$\n\n$if(natbib)$\n$if(biblio-files)$\n$if(biblio-title)$\n$if(book-class)$\n\\renewcommand\\bibname{$biblio-title$}\n$else$\n\\renewcommand\\refname{$biblio-title$}\n$endif$\n$endif$\n\\begin{frame}[allowframebreaks]{$biblio-title$}\n\\bibliography{$biblio-files$}\n\\end{frame}\n\n$endif$\n$endif$\n$if(biblatex)$\n\\begin{frame}[allowframebreaks]{$biblio-title$}\n\\printbibliography[heading=none]\n\\end{frame}\n\n$endif$\n$for(include-after)$\n$include-after$\n\n$endfor$\n\\end{document}\n"),("dzslides/template.html","<!DOCTYPE html>\n\n<meta charset=\"utf-8\">\n<title>The Title Of Your Presentation</title>\n\n<!-- Your Slides -->\n<!-- One section is one slide -->\n\n<section>\n    <!-- This is the first slide -->\n    <h1>My Presentation</h1>\n    <footer>by John Doe</footer>\n</section>\n\n<section>\n    <p>Some random text: But I've never been to the moon! You can see how I lived before I met you. Also Zoidberg.\n    I could if you hadn't turned on the light and shut off my stereo.</p>\n</section>\n\n<section>\n    <h3>An incremental list</h3>\n    <ul class=\"incremental\">\n      <li>Item 1\n      <li>Item 2\n      <li>Item 3\n    </ul>\n    <details>Some notes. They are only visible using onstage shell.</details>\n</section>\n\n<section>\n  <q>\n    Who's brave enough to fly into something we all keep calling a death sphere?\n  </q>\n</section>\n\n<section>\n    <h2>Part two</h2>\n</section>\n\n<section>\n    <figure> <!-- Figures are used to display images and videos fullpage -->\n      <img src=\"http://placekitten.com/g/800/600\">\n      <figcaption>An image</figcaption>\n    </figure>\n    <details>Kittens are so cute!</details>\n</section>\n\n<section>\n    <figure> <!-- Videos are automatically played -->\n      <video src=\"http://videos-cdn.mozilla.net/brand/Mozilla_Firefox_Manifesto_v0.2_640.webm\" poster=\"http://www.mozilla.org/images/about/poster.jpg\"></video>\n      <figcaption>A video</figcaption>\n    </figure>\n</section>\n\n<section>\n    <h2>End!</h2>\n</section>\n\n<!-- Your Style -->\n<!-- Define the style of your presentation -->\n\n<!-- Maybe a font from http://www.google.com/webfonts ? -->\n<link href='http://fonts.googleapis.com/css?family=Oswald' rel='stylesheet'>\n\n<style>\n  html { background-color: black; }\n  body { background-color: white; border-radius: 12px}\n  /* A section is a slide. It's size is 800x600, and this will never change */\n  section {\n      /* The font from Google */\n      font-family: 'Oswald', arial, serif;\n      font-size: 30px;\n  }\n  h1, h2 {\n    margin-top: 200px;\n    text-align: center;\n    font-size: 80px;\n  }\n  h3 {\n    margin: 100px 0 50px 100px;\n  }\n\n  ul {\n      margin: 50px 200px;\n  }\n\n  p {\n    margin: 75px;\n    font-size: 50px;\n  }\n\n  q {\n    display: block;\n    width: 100%;\n    height: 100%;\n    background-color: black;\n    color: white;\n    font-size: 60px;\n    padding: 50px;\n  }\n\n  /* Figures are displayed full-page, with the caption\n     on top of the image/video */\n  figure {\n    background-color: black;\n  }\n  figcaption {\n    margin: 70px;\n    font-size: 50px;\n  }\n\n  footer {\n    position: absolute;\n    bottom: 0;\n    width: 100%;\n    padding: 40px;\n    text-align: right;\n    background-color: #F3F4F8;\n    border-top: 1px solid #CCC;\n  }\n\n  /* Transition effect */\n  /* Feel free to change the transition effect for original\n     animations. See here:\n     https://developer.mozilla.org/en/CSS/CSS_transitions\n     How to use CSS3 Transitions: */\n  section {\n      -moz-transition: left 400ms linear 0s;\n      -webkit-transition: left 400ms linear 0s;\n      -ms-transition: left 400ms linear 0s;\n      transition: left 400ms linear 0s;\n  }\n\n  /* Before */\n  section { left: -150%; }\n  /* Now */\n  section[aria-selected] { left: 0; }\n  /* After */\n  section[aria-selected] ~ section { left: +150%; }\n\n  /* Incremental elements */\n\n  /* By default, visible */\n  .incremental > * { opacity: 1; }\n\n  /* The current item */\n  .incremental > *[aria-selected] { opacity: 1; }\n\n  /* The items to-be-selected */\n  .incremental > *[aria-selected] ~ * { opacity: 0; }\n\n  /* The progressbar, at the bottom of the slides, show the global\n     progress of the presentation. */\n  #progress-bar {\n    height: 2px;\n    background: #AAA;\n  }\n</style>\n\n<!-- {{{{ dzslides core\n#\n#\n#     __  __  __       .  __   ___  __\n#    |  \\  / /__` |    | |  \\ |__  /__`\n#    |__/ /_ .__/ |___ | |__/ |___ .__/ core :\226\130\172\n#\n#\n# The following block of code is not supposed to be edited.\n# But if you want to change the behavior of these slides,\n# feel free to hack it!\n#\n-->\n\n<div id=\"progress-bar\"></div>\n\n<!-- Default Style -->\n<style>\n  * { margin: 0; padding: 0; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; }\n  details { display: none; }\n  body {\n    width: 800px; height: 600px;\n    margin-left: -400px; margin-top: -300px;\n    position: absolute; top: 50%; left: 50%;\n    overflow: hidden;\n  }\n  section {\n    position: absolute;\n    pointer-events: none;\n    width: 100%; height: 100%;\n  }\n  section[aria-selected] { pointer-events: auto; }\n  html { overflow: hidden; }\n  body { display: none; }\n  body.loaded { display: block; }\n  .incremental {visibility: hidden; }\n  .incremental[active] {visibility: visible; }\n  #progress-bar{\n    bottom: 0;\n    position: absolute;\n    -moz-transition: width 400ms linear 0s;\n    -webkit-transition: width 400ms linear 0s;\n    -ms-transition: width 400ms linear 0s;\n    transition: width 400ms linear 0s;\n  }\n  figure {\n    width: 100%;\n    height: 100%;\n  }\n  figure > * {\n    position: absolute;\n  }\n  figure > img, figure > video {\n    width: 100%; height: 100%;\n  }\n</style>\n\n<script>\n  var Dz = {\n    remoteWindows: [],\n    idx: -1,\n    step: 0,\n    slides: null,\n    progressBar : null,\n    params: {\n      autoplay: \"1\"\n    }\n  };\n\n  Dz.init = function() {\n    document.body.className = \"loaded\";\n    this.slides = $$(\"body > section\");\n    this.progressBar = $(\"#progress-bar\");\n    this.setupParams();\n    this.onhashchange();\n    this.setupTouchEvents();\n    this.onresize();\n  }\n  \n  Dz.setupParams = function() {\n    var p = window.location.search.substr(1).split('&');\n    p.forEach(function(e, i, a) {\n      var keyVal = e.split('=');\n      Dz.params[keyVal[0]] = decodeURIComponent(keyVal[1]);\n    });\n  // Specific params handling\n    if (!+this.params.autoplay)\n      $$.forEach($$(\"video\"), function(v){ v.controls = true });\n  }\n\n  Dz.onkeydown = function(aEvent) {\n    // Don't intercept keyboard shortcuts\n    if (aEvent.altKey\n      || aEvent.ctrlKey\n      || aEvent.metaKey\n      || aEvent.shiftKey) {\n      return;\n    }\n    if ( aEvent.keyCode == 37 // left arrow\n      || aEvent.keyCode == 38 // up arrow\n      || aEvent.keyCode == 33 // page up\n    ) {\n      aEvent.preventDefault();\n      this.back();\n    }\n    if ( aEvent.keyCode == 39 // right arrow\n      || aEvent.keyCode == 40 // down arrow\n      || aEvent.keyCode == 34 // page down\n    ) {\n      aEvent.preventDefault();\n      this.forward();\n    }\n    if (aEvent.keyCode == 35) { // end\n      aEvent.preventDefault();\n      this.goEnd();\n    }\n    if (aEvent.keyCode == 36) { // home\n      aEvent.preventDefault();\n      this.goStart();\n    }\n    if (aEvent.keyCode == 32) { // space\n      aEvent.preventDefault();\n      this.toggleContent();\n    }\n    if (aEvent.keyCode == 70) { // f\n      aEvent.preventDefault();\n      this.goFullscreen();\n    }\n  }\n\n  /* Touch Events */\n\n  Dz.setupTouchEvents = function() {\n    var orgX, newX;\n    var tracking = false;\n\n    var db = document.body;\n    db.addEventListener(\"touchstart\", start.bind(this), false);\n    db.addEventListener(\"touchmove\", move.bind(this), false);\n\n    function start(aEvent) {\n      aEvent.preventDefault();\n      tracking = true;\n      orgX = aEvent.changedTouches[0].pageX;\n    }\n\n    function move(aEvent) {\n      if (!tracking) return;\n      newX = aEvent.changedTouches[0].pageX;\n      if (orgX - newX > 100) {\n        tracking = false;\n        this.forward();\n      } else {\n        if (orgX - newX < -100) {\n          tracking = false;\n          this.back();\n        }\n      }\n    }\n  }\n\n  /* Adapt the size of the slides to the window */\n\n  Dz.onresize = function() {\n    var db = document.body;\n    var sx = db.clientWidth / window.innerWidth;\n    var sy = db.clientHeight / window.innerHeight;\n    var transform = \"scale(\" + (1/Math.max(sx, sy)) + \")\";\n\n    db.style.MozTransform = transform;\n    db.style.WebkitTransform = transform;\n    db.style.OTransform = transform;\n    db.style.msTransform = transform;\n    db.style.transform = transform;\n  }\n\n\n  Dz.getDetails = function(aIdx) {\n    var s = $(\"section:nth-of-type(\" + aIdx + \")\");\n    var d = s.$(\"details\");\n    return d ? d.innerHTML : \"\";\n  }\n\n  Dz.onmessage = function(aEvent) {\n    var argv = aEvent.data.split(\" \"), argc = argv.length;\n    argv.forEach(function(e, i, a) { a[i] = decodeURIComponent(e) });\n    var win = aEvent.source;\n    if (argv[0] === \"REGISTER\" && argc === 1) {\n      this.remoteWindows.push(win);\n      this.postMsg(win, \"REGISTERED\", document.title, this.slides.length);\n      this.postMsg(win, \"CURSOR\", this.idx + \".\" + this.step);\n      return;\n    }\n    if (argv[0] === \"BACK\" && argc === 1)\n      this.back();\n    if (argv[0] === \"FORWARD\" && argc === 1)\n      this.forward();\n    if (argv[0] === \"START\" && argc === 1)\n      this.goStart();\n    if (argv[0] === \"END\" && argc === 1)\n      this.goEnd();\n    if (argv[0] === \"TOGGLE_CONTENT\" && argc === 1)\n      this.toggleContent();\n    if (argv[0] === \"SET_CURSOR\" && argc === 2)\n      window.location.hash = \"#\" + argv[1];\n    if (argv[0] === \"GET_CURSOR\" && argc === 1)\n      this.postMsg(win, \"CURSOR\", this.idx + \".\" + this.step);\n    if (argv[0] === \"GET_NOTES\" && argc === 1)\n      this.postMsg(win, \"NOTES\", this.getDetails(this.idx));\n  }\n\n  Dz.toggleContent = function() {\n    // If a Video is present in this new slide, play it.\n    // If a Video is present in the previous slide, stop it.\n    var s = $(\"section[aria-selected]\");\n    if (s) {\n      var video = s.$(\"video\");\n      if (video) {\n        if (video.ended || video.paused) {\n          video.play();\n        } else {\n          video.pause();\n        }\n      }\n    }\n  }\n\n  Dz.setCursor = function(aIdx, aStep) {\n    // If the user change the slide number in the URL bar, jump\n    // to this slide.\n    aStep = (aStep != 0 && typeof aStep !== \"undefined\") ? \".\" + aStep : \".0\";\n    window.location.hash = \"#\" + aIdx + aStep;\n  }\n\n  Dz.onhashchange = function() {\n    var cursor = window.location.hash.split(\"#\"),\n        newidx = 1,\n        newstep = 0;\n    if (cursor.length == 2) {\n      newidx = ~~cursor[1].split(\".\")[0];\n      newstep = ~~cursor[1].split(\".\")[1];\n      if (newstep > Dz.slides[newidx - 1].$$('.incremental > *').length) {\n        newstep = 0;\n        newidx++;\n      }\n    }\n    this.setProgress(newidx, newstep);\n    if (newidx != this.idx) {\n      this.setSlide(newidx);\n    }\n    if (newstep != this.step) {\n      this.setIncremental(newstep);\n    }\n    for (var i = 0; i < this.remoteWindows.length; i++) {\n      this.postMsg(this.remoteWindows[i], \"CURSOR\", this.idx + \".\" + this.step);\n    }\n  }\n\n  Dz.back = function() {\n    if (this.idx == 1 && this.step == 0) {\n      return;\n    }\n    if (this.step == 0) {\n      this.setCursor(this.idx - 1,\n                     this.slides[this.idx - 2].$$('.incremental > *').length);\n    } else {\n      this.setCursor(this.idx, this.step - 1);\n    }\n  }\n\n  Dz.forward = function() {\n    if (this.idx >= this.slides.length &&\n        this.step >= this.slides[this.idx - 1].$$('.incremental > *').length) {\n        return;\n    }\n    if (this.step >= this.slides[this.idx - 1].$$('.incremental > *').length) {\n      this.setCursor(this.idx + 1, 0);\n    } else {\n      this.setCursor(this.idx, this.step + 1);\n    }\n  }\n\n  Dz.goStart = function() {\n    this.setCursor(1, 0);\n  }\n\n  Dz.goEnd = function() {\n    var lastIdx = this.slides.length;\n    var lastStep = this.slides[lastIdx - 1].$$('.incremental > *').length;\n    this.setCursor(lastIdx, lastStep);\n  }\n\n  Dz.setSlide = function(aIdx) {\n    this.idx = aIdx;\n    var old = $(\"section[aria-selected]\");\n    var next = $(\"section:nth-of-type(\"+ this.idx +\")\");\n    if (old) {\n      old.removeAttribute(\"aria-selected\");\n      var video = old.$(\"video\");\n      if (video) {\n        video.pause();\n      }\n    }\n    if (next) {\n      next.setAttribute(\"aria-selected\", \"true\");\n      var video = next.$(\"video\");\n      if (video && !!+this.params.autoplay) {\n        video.play();\n      }\n    } else {\n      // That should not happen\n      this.idx = -1;\n      // console.warn(\"Slide doesn't exist.\");\n    }\n  }\n\n  Dz.setIncremental = function(aStep) {\n    this.step = aStep;\n    var old = this.slides[this.idx - 1].$('.incremental > *[aria-selected]');\n    if (old) {\n      old.removeAttribute('aria-selected');\n    }\n    var incrementals = $$('.incremental');\n    if (this.step <= 0) {\n      $$.forEach(incrementals, function(aNode) {\n        aNode.removeAttribute('active');\n      });\n      return;\n    }\n    var next = this.slides[this.idx - 1].$$('.incremental > *')[this.step - 1];\n    if (next) {\n      next.setAttribute('aria-selected', true);\n      next.parentNode.setAttribute('active', true);\n      var found = false;\n      $$.forEach(incrementals, function(aNode) {\n        if (aNode != next.parentNode)\n          if (found)\n            aNode.removeAttribute('active');\n          else\n            aNode.setAttribute('active', true);\n        else\n          found = true;\n      });\n    } else {\n      setCursor(this.idx, 0);\n    }\n    return next;\n  }\n\n  Dz.goFullscreen = function() {\n    var html = $('html'),\n        requestFullscreen = html.requestFullscreen || html.requestFullScreen || html.mozRequestFullScreen || html.webkitRequestFullScreen;\n    if (requestFullscreen) {\n      requestFullscreen.apply(html);\n    }\n  }\n  \n  Dz.setProgress = function(aIdx, aStep) {\n    var slide = $(\"section:nth-of-type(\"+ aIdx +\")\");\n    if (!slide)\n      return;\n    var steps = slide.$$('.incremental > *').length + 1,\n        slideSize = 100 / (this.slides.length - 1),\n        stepSize = slideSize / steps;\n    this.progressBar.style.width = ((aIdx - 1) * slideSize + aStep * stepSize) + '%';\n  }\n  \n  Dz.postMsg = function(aWin, aMsg) { // [arg0, [arg1...]]\n    aMsg = [aMsg];\n    for (var i = 2; i < arguments.length; i++)\n      aMsg.push(encodeURIComponent(arguments[i]));\n    aWin.postMessage(aMsg.join(\" \"), \"*\");\n  }\n  \n  function init() {\n    Dz.init();\n    window.onkeydown = Dz.onkeydown.bind(Dz);\n    window.onresize = Dz.onresize.bind(Dz);\n    window.onhashchange = Dz.onhashchange.bind(Dz);\n    window.onmessage = Dz.onmessage.bind(Dz);\n  }\n\n  window.onload = init;\n</script>\n\n\n<script> // Helpers\n  if (!Function.prototype.bind) {\n    Function.prototype.bind = function (oThis) {\n\n      // closest thing possible to the ECMAScript 5 internal IsCallable\n      // function \n      if (typeof this !== \"function\")\n      throw new TypeError(\n        \"Function.prototype.bind - what is trying to be fBound is not callable\"\n      );\n\n      var aArgs = Array.prototype.slice.call(arguments, 1),\n          fToBind = this,\n          fNOP = function () {},\n          fBound = function () {\n            return fToBind.apply( this instanceof fNOP ? this : oThis || window,\n                   aArgs.concat(Array.prototype.slice.call(arguments)));\n          };\n\n      fNOP.prototype = this.prototype;\n      fBound.prototype = new fNOP();\n\n      return fBound;\n    };\n  }\n\n  var $ = (HTMLElement.prototype.$ = function(aQuery) {\n    return this.querySelector(aQuery);\n  }).bind(document);\n\n  var $$ = (HTMLElement.prototype.$$ = function(aQuery) {\n    return this.querySelectorAll(aQuery);\n  }).bind(document);\n\n  $$.forEach = function(nodeList, fun) {\n    Array.prototype.forEach.call(nodeList, fun);\n  }\n\n</script>\n<!-- vim: set fdm=marker: }}} -->\n")]
man/make-pandoc-man-pages.hs view
@@ -1,6 +1,7 @@ {-# LANGUAGE CPP #-} -- Create pandoc.1 man and pandoc_markdown.5 man pages from README import Text.Pandoc+import Text.Pandoc.Error (handleError) import qualified Text.Pandoc.UTF8 as UTF8 import Data.Char (toUpper) import Control.Monad@@ -27,7 +28,7 @@    unless (null ds1 && null ds2) $ do     rmContents <- UTF8.readFile "README"-    let (Pandoc meta blocks) = normalize $ readMarkdown def rmContents+    let (Pandoc meta blocks) = normalize $ handleError $ readMarkdown def rmContents     let manBlocks = removeSect [Str "Wrappers"]                   $ removeSect [Str "Pandoc's",Space,Str "markdown"] blocks     let syntaxBlocks = extractSect [Str "Pandoc's",Space,Str "markdown"] blocks@@ -101,4 +102,3 @@   depModTimes <- mapM getModificationTime dependencies   let modified = zipWith (\dep time -> if time > fileModTime then Just dep else Nothing) dependencies depModTimes   return $ catMaybes modified-
man/man1/pandoc.1 view
@@ -1,9 +1,9 @@-.TH PANDOC 1 "August 30, 2014" "1.14"+.TH PANDOC 1 "May 27, 2015" "1.14" .SH NAME pandoc - general markup converter .SH SYNOPSIS .PP-pandoc [\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@@ -164,7 +164,8 @@ packages are available: \f[C]amssymb\f[], \f[C]amsmath\f[], \f[C]ifxetex\f[], \f[C]ifluatex\f[], \f[C]listings\f[] (if the \f[C]\-\-listings\f[] option is used), \f[C]fancyvrb\f[],-\f[C]longtable\f[], \f[C]booktabs\f[], \f[C]url\f[], \f[C]graphicx\f[],+\f[C]longtable\f[], \f[C]booktabs\f[], \f[C]url\f[], \f[C]graphicx\f[]+and \f[C]grffile\f[] (if the document contains images), \f[C]hyperref\f[], \f[C]ulem\f[], \f[C]babel\f[] (if the \f[C]lang\f[] variable is set), \f[C]fontspec\f[] (if \f[C]xelatex\f[] or \f[C]lualatex\f[] is used as the LaTeX engine), \f[C]xltxtra\f[] and@@ -412,7 +413,7 @@ filename with \f[C]\&./\f[]. .RE .TP-.B \f[C]\-M\f[] \f[I]KEY[=VAL]\f[], \f[C]\-\-metadata=\f[]\f[I]KEY[:VAL]\f[]+.B \f[C]\-M\f[] \f[I]KEY\f[][\f[C]=\f[]\f[I]VAL\f[]], \f[C]\-\-metadata=\f[]\f[I]KEY\f[][\f[C]:\f[]\f[I]VAL\f[]] Set the metadata field \f[I]KEY\f[] to the value \f[I]VAL\f[]. A value specified on the command line overrides a value specified in the document.@@ -445,16 +446,16 @@ .RS .RE .TP-.B \f[C]\-\-track\-changes=\f[]\f[I]accept|reject|all\f[]+.B \f[C]\-\-track\-changes=accept\f[]|\f[C]reject\f[]|\f[C]all\f[] Specifies what to do with insertions and deletions produced by the MS Word "track\-changes" feature.-\f[I]accept\f[] (the default), inserts all insertions, and ignores all+\f[C]accept\f[] (the default), inserts all insertions, and ignores all deletions.-\f[I]reject\f[] inserts all deletions and ignores insertions.-\f[I]all\f[] puts in both insertions and deletions, wrapped in spans+\f[C]reject\f[] inserts all deletions and ignores insertions.+\f[C]all\f[] puts in both insertions and deletions, wrapped in spans with \f[C]insertion\f[] and \f[C]deletion\f[] classes, respectively. The author and time of change is included.-\f[I]all\f[] is useful for scripting: only accepting changes from a+\f[C]all\f[] is useful for scripting: only accepting changes from a certain reviewer, say, or before a certain date. This option only affects the docx reader. .RS@@ -492,7 +493,7 @@ .RS .RE .TP-.B \f[C]\-V\f[] \f[I]KEY[=VAL]\f[], \f[C]\-\-variable=\f[]\f[I]KEY[:VAL]\f[]+.B \f[C]\-V\f[] \f[I]KEY\f[][\f[C]=\f[]\f[I]VAL\f[]], \f[C]\-\-variable=\f[]\f[I]KEY\f[][\f[C]:\f[]\f[I]VAL\f[]] Set the template variable \f[I]KEY\f[] to the value \f[I]VAL\f[] when rendering the document in standalone mode. This is generally only useful when the \f[C]\-\-template\f[] option is@@ -520,7 +521,7 @@ .RS .RE .TP-.B \f[C]\-\-columns\f[]=\f[I]NUMBER\f[]+.B \f[C]\-\-columns=\f[]\f[I]NUMBER\f[] Specify length of lines in characters (for text wrapping). .RS .RE@@ -549,11 +550,13 @@ .RS .RE .TP-.B \f[C]\-\-highlight\-style\f[]=\f[I]STYLE\f[]+.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[].+For more information on syntax highlighting in pandoc, see Syntax+highlighting, below. .RS .RE .TP@@ -667,7 +670,7 @@ .RS .RE .TP-.B \f[C]\-\-number\-offset\f[]=\f[I]NUMBER[,NUMBER,...]\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,@@ -707,7 +710,7 @@ .RS .RE .TP-.B \f[C]\-\-slide\-level\f[]=\f[I]NUMBER\f[]+.B \f[C]\-\-slide\-level=\f[]\f[I]NUMBER\f[] Specifies that headers with the specified level create slides (for \f[C]beamer\f[], \f[C]s5\f[], \f[C]slidy\f[], \f[C]slideous\f[], \f[C]dzslides\f[]).@@ -727,17 +730,17 @@ .RS .RE .TP-.B \f[C]\-\-email\-obfuscation=\f[]\f[I]none|javascript|references\f[]+.B \f[C]\-\-email\-obfuscation=none\f[]|\f[C]javascript\f[]|\f[C]references\f[] Specify a method for obfuscating \f[C]mailto:\f[] links in HTML documents.-\f[I]none\f[] leaves \f[C]mailto:\f[] links as they are.-\f[I]javascript\f[] obfuscates them using javascript.-\f[I]references\f[] obfuscates them by printing their letters as decimal+\f[C]none\f[] leaves \f[C]mailto:\f[] links as they are.+\f[C]javascript\f[] obfuscates them using javascript.+\f[C]references\f[] obfuscates them by printing their letters as decimal or hexadecimal character references. .RS .RE .TP-.B \f[C]\-\-id\-prefix\f[]=\f[I]STRING\f[]+.B \f[C]\-\-id\-prefix=\f[]\f[I]STRING\f[] Specify a prefix to be added to all automatically generated identifiers in HTML and DocBook output, and to footnote numbers in markdown output. This is useful for preventing duplicate identifiers when generating@@ -893,7 +896,7 @@ .RS .RE .TP-.B \f[C]\-\-latex\-engine=\f[]\f[I]pdflatex|lualatex|xelatex\f[]+.B \f[C]\-\-latex\-engine=pdflatex\f[]|\f[C]lualatex\f[]|\f[C]xelatex\f[] Use the specified LaTeX engine when producing PDF output. The default is \f[C]pdflatex\f[]. If the engine is not in your PATH, the full path of the engine may be@@ -917,13 +920,19 @@ citations using \f[C]pandoc\-citeproc\f[]. (This is equivalent to \f[C]\-\-metadata\ bibliography=FILE\ \-\-filter\ pandoc\-citeproc\f[].)+If \f[C]\-\-natbib\f[] or \f[C]\-\-biblatex\f[] is also supplied,+\f[C]pandoc\-citeproc\f[] is not used, making this equivalent to+\f[C]\-\-metadata\ bibliography=FILE\f[].+If you supply this argument multiple times, each \f[I]FILE\f[] will be+added to bibliography. .RS .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.-(This is equivalent to \f[C]\-\-metadata\ csl=FILE\f[].)+(This is equivalent to \f[C]\-\-metadata\ csl=FILE\f[].) This option is+only relevant with \f[C]pandoc\-citeproc\f[]. .RS .RE .TP@@ -931,7 +940,8 @@ Set the \f[C]citation\-abbreviations\f[] field in the document\[aq]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[].)+\f[C]\-\-metadata\ citation\-abbreviations=FILE\f[].) This option is+only relevant with \f[C]pandoc\-citeproc\f[]. .RS .RE .TP@@ -954,7 +964,7 @@ .RE .SS Math rendering in HTML .TP-.B \f[C]\-m\f[] [\f[I]URL\f[]], \f[C]\-\-latexmathml\f[][=\f[I]URL\f[]]+.B \f[C]\-m\f[] [\f[I]URL\f[]], \f[C]\-\-latexmathml\f[][\f[C]=\f[]\f[I]URL\f[]] Use the LaTeXMathML script to display embedded TeX math in HTML output. To insert a link to a local copy of the \f[C]LaTeXMathML.js\f[] script, provide a \f[I]URL\f[].@@ -966,7 +976,7 @@ .RS .RE .TP-.B \f[C]\-\-mathml\f[][=\f[I]URL\f[]]+.B \f[C]\-\-mathml\f[][\f[C]=\f[]\f[I]URL\f[]] Convert TeX math to MathML (in \f[C]docbook\f[] as well as \f[C]html\f[] and \f[C]html5\f[]). In standalone \f[C]html\f[] output, a small javascript (or a link to@@ -975,7 +985,7 @@ .RS .RE .TP-.B \f[C]\-\-jsmath\f[][=\f[I]URL\f[]]+.B \f[C]\-\-jsmath\f[][\f[C]=\f[]\f[I]URL\f[]] Use jsMath to display embedded TeX math in HTML output. The \f[I]URL\f[] should point to the jsMath load script (e.g. \f[C]jsMath/easy/load.js\f[]); if provided, it will be linked to in the@@ -986,7 +996,7 @@ .RS .RE .TP-.B \f[C]\-\-mathjax\f[][=\f[I]URL\f[]]+.B \f[C]\-\-mathjax\f[][\f[C]=\f[]\f[I]URL\f[]] Use MathJax to display embedded TeX math in HTML output. The \f[I]URL\f[] should point to the \f[C]MathJax.js\f[] load script. If a \f[I]URL\f[] is not provided, a link to the MathJax CDN will be@@ -1001,34 +1011,36 @@ .RS .RE .TP-.B \f[C]\-\-mimetex\f[][=\f[I]URL\f[]]+.B \f[C]\-\-mimetex\f[][\f[C]=\f[]\f[I]URL\f[]] Render TeX math using the mimeTeX CGI script. If \f[I]URL\f[] is not specified, it is assumed that the script is at \f[C]/cgi\-bin/mimetex.cgi\f[]. .RS .RE .TP-.B \f[C]\-\-webtex\f[][=\f[I]URL\f[]]+.B \f[C]\-\-webtex\f[][\f[C]=\f[]\f[I]URL\f[]] Render TeX formulas using an external script that converts TeX formulas to images. The formula will be concatenated with the URL provided. If \f[I]URL\f[] is not specified, the Google Chart API will be used. .RS .RE-.PP-\f[C]\-\-katex\f[][=\f[I]URL\f[]]-.PP-: Use KaTeX to display embedded TeX math in HTML output.+.TP+.B \f[C]\-\-katex\f[][\f[C]=\f[]\f[I]URL\f[]]+Use KaTeX to display embedded TeX math in HTML output. The \f[I]URL\f[] should point to the \f[C]katex.js\f[] load script. If a \f[I]URL\f[] is not provided, a link to the KaTeX CDN will be inserted.-.PP-\f[C]\-\-katex\-stylesheet=*URL*\f[]-.PP-: The \f[I]URL\f[] should point to the \f[C]katex.css\f[] stylesheet.+.RS+.RE+.TP+.B \f[C]\-\-katex\-stylesheet=\f[]\f[I]URL\f[]+The \f[I]URL\f[] should point to the \f[C]katex.css\f[] stylesheet. If this option is not specified, a link to the KaTeX CDN will be inserted. Note that this option does not imply \f[C]\-\-katex\f[].+.RS+.RE .SS Options for wrapper scripts .TP .B \f[C]\-\-dump\-args\f[]@@ -1237,6 +1249,11 @@ .RS .RE .TP+.B \f[C]toccolor\f[]+color for links in table of contents in LaTeX documents+.RS+.RE+.TP .B \f[C]urlcolor\f[] color for external links in LaTeX documents .RS@@ -1262,6 +1279,11 @@ .RS .RE .TP+.B \f[C]toc\-title\f[]+title of table of contents (works only with EPUB and docx)+.RS+.RE+.TP .B \f[C]lof\f[] include list of figures in LaTeX documents .RS@@ -1272,14 +1294,13 @@ .RS .RE .TP-.B \f[C]biblio\-style\f[]-bibliography style in LaTeX, when used with \f[C]\-\-natbib\f[]+.B \f[C]bibliography\f[]+bibliography to use for resolving references .RS .RE .TP-.B \f[C]biblio\-files\f[]-bibliography files to use in LaTeX, with \f[C]\-\-natbib\f[] or-\f[C]\-\-biblatex\f[]+.B \f[C]biblio\-style\f[]+bibliography style in LaTeX, when used with \f[C]\-\-natbib\f[] .RS .RE .TP@@ -1484,7 +1505,7 @@ reveal.js. .SS Incremental lists .PP-By default, these writers produces lists that display "all at once." If+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. If you want a particular list to depart from the default (that is, to@@ -1587,6 +1608,19 @@ presentation. Notes are not yet supported for other slide formats, but the notes will not appear on the slides themselves.+.SS Marking frames "fragile" in beamer+.PP+Sometimes it is necessary to add the LaTeX \f[C][fragile]\f[] option to+a frame in beamer (for example, when using the \f[C]minted\f[]+environment).+This can be forced by adding the \f[C]fragile\f[] class to the header+introducing the slide:+.IP+.nf+\f[C]+#\ Fragile\ slide\ {.fragile}+\f[]+.fi .SH EPUB METADATA .PP EPUB metadata may be specified using the \f[C]\-\-epub\-metadata\f[]@@ -1772,6 +1806,24 @@ .PP writes HTML with the Haskell code in bird tracks, so it can be copied and pasted as literate Haskell source.+.SH SYNTAX HIGHLIGHTING+.PP+Pandoc will automatically highlight syntax in fenced code blocks that+are marked with a language name.+(See [Extension: \f[C]inline_code_attributes\f[]] and [Extension:+\f[C]fenced_code_attributes\f[]], above.) The Haskell library+highlighting\-kate is used for highlighting, which works in HTML, Docx,+and LaTeX/PDF output.+The color scheme can be selected using the \f[C]\-\-highlight\-style\f[]+option.+The default color scheme is \f[C]pygments\f[], which imitates the+default color scheme used by the Python library pygments, but pygments+is not actually used to do the highlighting.+.PP+To see a list of language names that pandoc will recognize, type+\f[C]pandoc\ \-\-version\f[].+.PP+To disable highlighting, use the \f[C]\-\-no\-highlight\f[] option. .SH CUSTOM WRITERS .PP Pandoc can be extended with custom writers written in lua.@@ -1800,19 +1852,43 @@ .fi .SH AUTHORS .PP-© 2006\-2013 John MacFarlane (jgm at berkeley dot edu).+© 2006\-2015 John MacFarlane (jgm\@berkeley.edu). Released under the GPL, version 2 or greater. This software carries no warranty of any kind.-(See COPYRIGHT for full copyright and warranty notices.) Other-contributors include Recai Oktaş, Paulo Tanimoto, Peter Wang, Andrea-Rossato, Eric Kow, infinity0x, Luke Plant, shreevatsa.public, Puneeth-Chaganti, Paul Rivier, rodja.trappe, Bradley Kuhn, thsutton, Nathan-Gass, Jonathan Daugherty, Jérémy Bobbio, Justin Bogner, qerub,-Christopher Sawicki, Kelsey Hightower, Masayoshi Takahashi, Antoine-Latter, Ralf Stephan, Eric Seidel, B.-Scott Michel, Gavin Beatty, Sergey Astanin, Arlo O\[aq]Keeffe, Denis-Laxalde, Brent Yorgey, David Lazar, Jamie F.-Olson, Matthew Pickering, Albert Krewinkel, mb21, Jesse Rosenthal.+(See COPYRIGHT for full copyright and warranty notices.)+.PP+Contributors include Aaron Wolen, Albert Krewinkel, Alexander+Kondratskiy, Alexander Sulfrian, Alexander V Vershilov, Alfred+Wechselberger, Andreas Lööw, Antoine Latter, Arlo O\[aq]Keeffe, Artyom+Kazak, Ben Gamari, Beni Cherniavsky\-Paskin, Bjorn Buckwalter, Bradley+Kuhn, Brent Yorgey, Bryan O\[aq]Sullivan, B.+Scott Michel, Caleb McDaniel, Calvin Beck, Christoffer Ackelman,+Christoffer Sawicki, Clare Macrae, Clint Adams, Conal Elliott, Craig S.+Bosma, Daniel Bergey, Daniel T.+Staal, David Lazar, David Röthlisberger, Denis Laxalde, Douglas Calvert,+Douglas F.+Calvert, Eric Kow, Eric Seidel, Florian Eitel, François Gannaz, Freiric+Barral, Fyodor Sheremetyev, Gabor Pali, Gavin Beatty, Greg Maslov,+Grégory Bataille, Greg Rundlett, gwern, Gwern Branwen, Hans\-Peter+Deifel, Henry de Valence, Ilya V.+Portnov, infinity0x, Jaime Marquínez Ferrándiz, James Aspnes, Jamie F.+Olson, Jason Ronallo, Jeff Arnold, Jeff Runningen, Jens Petersen, Jérémy+Bobbio, Jesse Rosenthal, J.+Lewis Muir, Joe Hillenbrand, John MacFarlane, Jonas Smedegaard, Jonathan+Daugherty, Josef Svenningsson, Jose Luis Duran, Julien Cretel, Justin+Bogner, Kelsey Hightower, Konstantin Zudov, Luke Plant, Mark Szepieniec,+Mark Wright, Masayoshi Takahashi, Matej Kollar, Mathias Schenner,+Matthew Pickering, Matthias C.+M.+Troffaes, Max Bolingbroke, Max Rydahl Andersen, mb21, Merijn+Verstraaten, Michael Snoyman, Michael Thompson, MinRK, Nathan Gass, Neil+Mayhew, Nick Bart, Nicolas Kaiser, Nikolay Yakimov, Paulo Tanimoto, Paul+Rivier, Peter Wang, Philippe Ombredanne, Phillip Alday, Puneeth+Chaganti, qerub, Ralf Stephan, Recai Oktaş, rodja.trappe, RyanGlScott,+Scott Morrison, Sergei Trofimovich, Sergey Astanin, Shahbaz Youssefi,+Shaun Attfield, shreevatsa.public, Simon Hengel, Sumit Sahrawat,+takahashim, thsutton, Tim Lin, Timothy Humphries, Todd Sifleet, Tom+Leese, Uli Köhler, Václav Zeman, Viktor Kronvall, Vincent, and Wikiwide. .SH PANDOC'S MARKDOWN For a complete description of pandoc's extensions to standard markdown, see \f[C]pandoc_markdown\f[] (5).
man/man5/pandoc_markdown.5 view
@@ -1,5 +1,5 @@ .\"t-.TH PANDOC_MARKDOWN 5 "August 30, 2014" "1.14"+.TH PANDOC_MARKDOWN 5 "May 27, 2015" "1.14" .SH NAME pandoc_markdown - markdown syntax for pandoc(1) .SH DESCRIPTION@@ -40,7 +40,7 @@ .SH PARAGRAPHS .PP A paragraph is one or more lines of text followed by one or more blank-line.+lines. Newlines are treated as spaces, so you can reflow your paragraphs as you like. If you need a hard line break, put two or more spaces at the end of a@@ -294,10 +294,22 @@ reference will link to the first one only, and you will need to use explicit links to link to the others, as described above. .PP-Unlike regular reference links, these references are case\-sensitive.+Like regular reference links, these references are case\-insensitive. .PP-Note: if you have defined an explicit identifier for a header, then-implicit references to it will not work.+Explicit link reference definitions always take priority over implicit+header references.+So, in the following example, the link will point to \f[C]bar\f[], not+to \f[C]#foo\f[]:+.IP+.nf+\f[C]+#\ Foo++[foo]:\ bar++See\ [foo]+\f[]+.fi .SH BLOCK QUOTATIONS .PP Markdown uses email conventions for quoting blocks of text.@@ -384,9 +396,8 @@ .PP In addition to standard indented code blocks, Pandoc supports \f[I]fenced\f[] code blocks.-These begin with a row of three or more tildes (\f[C]~\f[]) or backticks-(\f[C]`\f[]) and end with a row of tildes or backticks that must be at-least as long as the starting row.+These begin with a row of three or more tildes (\f[C]~\f[]) and end with+a row of tildes that must be at least as long as the starting row. Everything between these lines is treated as code. No indentation is necessary: .IP@@ -415,10 +426,14 @@ ~~~~~~~~~~~~~~~~ \f[] .fi+.SS Extension: \f[C]backtick_code_blocks\f[]+.PP+Same as \f[C]fenced_code_blocks\f[], but uses backticks (\f[C]`\f[])+instead of tildes (\f[C]~\f[]). .SS Extension: \f[C]fenced_code_attributes\f[] .PP-Optionally, you may attach attributes to the code block using this-syntax:+Optionally, you may attach attributes to fenced or backtick code block+using this syntax: .IP .nf \f[C]@@ -478,6 +493,7 @@ .PP To prevent all highlighting, use the \f[C]\-\-no\-highlight\f[] flag. To set the highlighting style, use \f[C]\-\-highlight\-style\f[].+For more information on highlighting, see Syntax highlighting, below. .SH LINE BLOCKS .SS Extension: \f[C]line_blocks\f[] .PP@@ -1121,7 +1137,7 @@ If you want content to wrap within cells, use multiline or grid tables. .PP Note: Pandoc also recognizes pipe tables of the following form, as can-produced by Emacs\[aq] orgtbl\-mode:+be produced by Emacs\[aq] orgtbl\-mode: .IP .nf \f[C]@@ -1698,10 +1714,10 @@ .nf \f[C] <table>-\	<tr>-\	\	<td>*one*</td>-\	\	<td>[a\ link](http://google.com)</td>-\	</tr>+<tr>+<td>*one*</td>+<td>[a\ link](http://google.com)</td>+</tr> </table> \f[] .fi@@ -1711,10 +1727,10 @@ .nf \f[C] <table>-\	<tr>-\	\	<td><em>one</em></td>-\	\	<td><a\ href="http://google.com">a\ link</a></td>-\	</tr>+<tr>+<td><em>one</em></td>+<td><a\ href="http://google.com">a\ link</a></td>+</tr> </table> \f[] .fi@@ -2049,7 +2065,10 @@ .PP In order to use this feature, you will need to specify a bibliography file using the \f[C]bibliography\f[] metadata field in a YAML metadata-section.+section, or \f[C]\-\-bibliography\f[] command line argument.+You can supply multiple \f[C]\-\-bibliography\f[] arguments or set+\f[C]bibliography\f[] metadata field to YAML array, if you want to use+multiple bibliography files. The bibliography may have any of these formats: .PP .TS@@ -2062,11 +2081,6 @@ T} _ T{-MODS-T}@T{-\&.mods-T}-T{ BibLaTeX T}@T{ \&.bib@@ -2077,11 +2091,21 @@ \&.bibtex T} T{-RIS+Copac T}@T{-\&.ris+\&.copac T} T{+CSL JSON+T}@T{+\&.json+T}+T{+CSL YAML+T}@T{+\&.yaml+T}+T{ EndNote T}@T{ \&.enl@@ -2102,20 +2126,30 @@ \&.medline T} T{-Copac+MODS T}@T{-\&.copac+\&.mods T} T{-JSON citeproc+RIS T}@T{-\&.json+\&.ris T} .TE .PP Note that \f[C]\&.bib\f[] can generally be used with both BibTeX and BibLaTeX files, but you can use \f[C]\&.bibtex\f[] to force BibTeX. .PP+Note that \f[C]pandoc\-citeproc\ \-\-bib2json\f[] and+\f[C]pandoc\-citeproc\ \-\-bib2yaml\f[] can produce \f[C]\&.json\f[] and+\f[C]\&.yaml\f[] files from any of the supported formats.+.PP+In\-field markup: In bibtex and biblatex databases, pandoc\-citeproc+parses (a subset of) LaTeX markup; in CSL JSON databases, an HTML\-like+markup (specs); and in CSL YAML databases, pandoc markdown.+\f[C]pandoc\-citeproc\ \-j\f[] and \f[C]\-y\f[] interconvert these+markup formats as far as possible.+.PP As an alternative to specifying a bibliography file, you can include the citation data directly in the \f[C]references\f[] field of the document\[aq]s YAML metadata.@@ -2126,46 +2160,51 @@ \f[C] \-\-\- references:-\-\ id:\ fenner2012a-\ \ title:\ One\-click\ science\ marketing+\-\ type:\ article\-journal+\ \ id:\ WatsonCrick1953 \ \ author:-\ \ \-\ family:\ Fenner-\ \ \ \ given:\ Martin-\ \ container\-title:\ Nature\ Materials-\ \ volume:\ 11-\ \ URL:\ \[aq]http://dx.doi.org/10.1038/nmat3283\[aq]-\ \ DOI:\ 10.1038/nmat3283-\ \ issue:\ 4-\ \ publisher:\ Nature\ Publishing\ Group-\ \ page:\ 261\-263-\ \ type:\ article\-journal+\ \ \-\ family:\ Watson+\ \ \ \ given:\ J.\ D.+\ \ \-\ family:\ Crick+\ \ \ \ given:\ F.\ H.\ C. \ \ issued:-\ \ \ \ year:\ 2012-\ \ \ \ month:\ 3+\ \ \ \ date\-parts:+\ \ \ \ \-\ \-\ 1953+\ \ \ \ \ \ \-\ 4+\ \ \ \ \ \ \-\ 25+\ \ title:\ \[aq]Molecular\ structure\ of\ nucleic\ acids:\ a\ structure\ for\ deoxyribose+\ \ \ \ nucleic\ acid\[aq]+\ \ title\-short:\ Molecular\ structure\ of\ nucleic\ acids+\ \ container\-title:\ Nature+\ \ volume:\ 171+\ \ issue:\ 4356+\ \ page:\ 737\-738+\ \ DOI:\ 10.1038/171737a0+\ \ URL:\ http://www.nature.com/nature/journal/v171/n4356/abs/171737a0.html+\ \ language:\ en\-GB \&... \f[] .fi .PP-(The program \f[C]mods2yaml\f[], which comes with-\f[C]pandoc\-citeproc\f[], can help produce these from a MODS reference-collection.)+(\f[C]pandoc\-citeproc\ \-\-bib2yaml\f[] can produce these from a+bibliography file in one of the supported formats.) .PP-By default, \f[C]pandoc\-citeproc\f[] will use a Chicago author\-date-format for citations and references.+By default, \f[C]pandoc\-citeproc\f[] will use the Chicago Manual of+Style author\-date format for citations and references. To use another style, you will need to specify a CSL 1.0 style file in the \f[C]csl\f[] metadata field.-A primer on creating and modifying CSL styles can be found at-http://citationstyles.org/downloads/primer.html. A repository of CSL styles can be found at https://github.com/citation\-style\-language/styles. See also http://zotero.org/styles for easy browsing.+A primer on creating and modifying CSL styles can be found at+http://citationstyles.org/downloads/primer.html. .PP Citations go inside square brackets and are separated by semicolons. Each citation must have a key, composed of \[aq]\@\[aq] + 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 or \f[C]_\f[], and may contain-alphanumerics, \f[C]_\f[], and internal punctuation characters+The citation key must begin with a letter, digit, or \f[C]_\f[], and may+contain alphanumerics, \f[C]_\f[], and internal punctuation characters (\f[C]:.#$%&\-+?<>~/\f[]). Here are some examples: .IP@@ -2233,6 +2272,14 @@ In this example, the document will contain a citation for \f[C]item3\f[] only, but the bibliography will contain entries for \f[C]item1\f[], \f[C]item2\f[], and \f[C]item3\f[].+.PP+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+\f[C]\-\-natbib\f[] or \f[C]\-\-biblatex\f[] argument to \f[C]pandoc\f[]+invocation.+Bear in mind that bibliography files have to be in respective format+(either BibTeX or BibLaTeX). .SH NON\-PANDOC EXTENSIONS .PP The following markdown syntax extensions are not enabled by default in@@ -2348,7 +2395,8 @@ \f[C]footnotes\f[], \f[C]pipe_tables\f[], \f[C]raw_html\f[], \f[C]markdown_attribute\f[], \f[C]fenced_code_blocks\f[], \f[C]definition_lists\f[], \f[C]intraword_underscores\f[],-\f[C]header_attributes\f[], \f[C]abbreviations\f[].+\f[C]header_attributes\f[], \f[C]abbreviations\f[],+\f[C]shortcut_reference_links\f[]. .RS .RE .TP@@ -2358,7 +2406,7 @@ \f[C]auto_identifiers\f[], \f[C]ascii_identifiers\f[], \f[C]backtick_code_blocks\f[], \f[C]autolink_bare_uris\f[], \f[C]intraword_underscores\f[], \f[C]strikeout\f[],-\f[C]hard_line_breaks\f[]+\f[C]hard_line_breaks\f[], \f[C]shortcut_reference_links\f[]. .RS .RE .TP@@ -2368,7 +2416,8 @@ \f[C]tex_math_double_backslash\f[], \f[C]intraword_underscores\f[], \f[C]mmd_title_block\f[], \f[C]footnotes\f[], \f[C]definition_lists\f[], \f[C]all_symbols_escapable\f[], \f[C]implicit_header_references\f[],-\f[C]auto_identifiers\f[], \f[C]mmd_header_identifiers\f[]+\f[C]auto_identifiers\f[], \f[C]mmd_header_identifiers\f[],+\f[C]shortcut_reference_links\f[]. .RS .RE .TP
pandoc.cabal view
@@ -1,17 +1,17 @@ Name:            pandoc-Version:         1.13.2.1+Version:         1.14 Cabal-Version:   >= 1.10 Build-Type:      Custom License:         GPL License-File:    COPYING-Copyright:       (c) 2006-2014 John MacFarlane+Copyright:       (c) 2006-2015 John MacFarlane Author:          John MacFarlane <jgm@berkeley.edu> Maintainer:      John MacFarlane <jgm@berkeley.edu> Bug-Reports:     https://github.com/jgm/pandoc/issues Stability:       alpha Homepage:        http://johnmacfarlane.net/pandoc Category:        Text-Tested-With:     GHC == 7.4.2, GHC == 7.6.3, GHC == 7.8.2, GHC == 7.10.1+Tested-With:     GHC == 7.4.2, GHC == 7.6.3, GHC == 7.8.2 Synopsis:        Conversion between markup formats Description:     Pandoc is a Haskell library for converting from one markup                  format to another, and a command-line tool that uses@@ -94,6 +94,31 @@                  -- generated man pages (produced post-build)                  man/man1/pandoc.1                  man/man5/pandoc_markdown.5+                 -- source files for reference.docx+                 data/docx/[Content_Types].xml+                 data/docx/_rels/.rels+                 data/docx/docProps/app.xml+                 data/docx/docProps/core.xml+                 data/docx/word/document.xml+                 data/docx/word/fontTable.xml+                 data/docx/word/footnotes.xml+                 data/docx/word/numbering.xml+                 data/docx/word/settings.xml+                 data/docx/word/webSettings.xml+                 data/docx/word/styles.xml+                 data/docx/word/_rels/document.xml.rels+                 data/docx/word/_rels/footnotes.xml.rels+                 data/docx/word/theme/theme1.xml+                 -- source files for reference.odt+                 data/odt/mimetype+                 data/odt/manifest.rdf+                 data/odt/styles.xml+                 data/odt/content.xml+                 data/odt/meta.xml+                 data/odt/settings.xml+                 data/odt/Configurations2/accelerator/current.xml+                 data/odt/Thumbnails/thumbnail.png+                 data/odt/META-INF/manifest.xml                  -- trypandoc                  trypandoc/Makefile                  trypandoc/index.html@@ -107,6 +132,9 @@                  tests/insert                  tests/lalune.jpg                  tests/movie.jpg+                 tests/media/rId25.jpg+                 tests/media/rId26.jpg+                 tests/media/rId27.jpg                  tests/latex-reader.latex                  tests/textile-reader.textile                  tests/markdown-reader-more.txt@@ -203,10 +231,6 @@   Description:   Enable support for downloading of resources over https.   Default:       True -Flag make-pandoc-man-pages-  Description:   Build program to regenerate pandoc man pages from README.-  Default:       False- Flag network-uri   Description:   Get Network.URI from the network-uri package   Default:       True@@ -230,7 +254,7 @@                  text >= 0.11 && < 1.3,                  zip-archive >= 0.2.3.4 && < 0.3,                  HTTP >= 4000.0.5 && < 4000.3,-                 texmath >= 0.8.0.1 && < 0.9,+                 texmath >= 0.8.1 && < 0.9,                  xml >= 1.3.12 && < 1.4,                  random >= 1 && < 1.2,                  extensible-exceptions >= 0.1 && < 0.2,@@ -238,12 +262,13 @@                  aeson >= 0.7 && < 0.9,                  tagsoup >= 0.13.1 && < 0.14,                  base64-bytestring >= 0.1 && < 1.1,-                 zlib >= 0.5 && < 0.6,-                 highlighting-kate >= 0.5.11.1 && < 0.6,+                 zlib >= 0.5 && < 0.7,+                 highlighting-kate >= 0.6 && < 0.7,                  data-default >= 0.4 && < 0.6,                  temporary >= 1.1 && < 1.3,                  blaze-html >= 0.5 && < 0.9,                  blaze-markup >= 0.5.1 && < 0.8,+                 css-text >= 0.1.2 && < 0.3,                  yaml >= 0.8.8.2 && < 0.9,                  scientific >= 0.2 && < 0.4,                  vector >= 0.10 && < 0.11,@@ -253,7 +278,9 @@                  haddock-library >= 1.1 && < 1.3,                  old-time,                  deepseq-generics >= 0.1 && < 0.2,-                 JuicyPixels >= 3.1.6.1 && < 3.3+                 JuicyPixels >= 3.1.6.1 && < 3.3,+                 filemanip >= 0.3 && < 0.4,+                 cmark >= 0.3.3 && < 0.4   if flag(old-locale)      Build-Depends: old-locale >= 1 && < 1.1,                     time >= 1.2 && < 1.5@@ -288,9 +315,11 @@                    Text.Pandoc.Pretty,                    Text.Pandoc.Shared,                    Text.Pandoc.MediaBag,+                   Text.Pandoc.Error,                    Text.Pandoc.Readers.HTML,                    Text.Pandoc.Readers.LaTeX,                    Text.Pandoc.Readers.Markdown,+                   Text.Pandoc.Readers.CommonMark,                    Text.Pandoc.Readers.MediaWiki,                    Text.Pandoc.Readers.RST,                    Text.Pandoc.Readers.Org,@@ -314,6 +343,7 @@                    Text.Pandoc.Writers.Texinfo,                    Text.Pandoc.Writers.Man,                    Text.Pandoc.Writers.Markdown,+                   Text.Pandoc.Writers.CommonMark,                    Text.Pandoc.Writers.Haddock,                    Text.Pandoc.Writers.RST,                    Text.Pandoc.Writers.Org,@@ -337,7 +367,9 @@   Other-Modules:   Text.Pandoc.Readers.Docx.Lists,                    Text.Pandoc.Readers.Docx.Reducible,                    Text.Pandoc.Readers.Docx.Parse,-                   Text.Pandoc.Readers.Docx.Fonts+                   Text.Pandoc.Readers.Docx.Fonts,+                   Text.Pandoc.Readers.Docx.Util,+                   Text.Pandoc.Readers.Docx.StyleMap                    Text.Pandoc.Writers.Shared,                    Text.Pandoc.Asciify,                    Text.Pandoc.MIME,@@ -364,7 +396,7 @@                  text >= 0.11 && < 1.3,                  bytestring >= 0.9 && < 0.11,                  extensible-exceptions >= 0.1 && < 0.2,-                 highlighting-kate >= 0.5.11.1 && < 0.6,+                 highlighting-kate >= 0.6 && < 0.7,                  aeson >= 0.7.0.5 && < 0.9,                  yaml >= 0.8.8.2 && < 0.9,                  containers >= 0.1 && < 0.6,@@ -408,11 +440,17 @@                  old-time >= 1.0 && < 1.2,                  time >= 1.2 && < 1.6   Default-Language: Haskell98-  if flag(make-pandoc-man-pages)-    Buildable:   True-  else-    Buildable:   False+  Buildable:   True +Executable make-reference-files+  Main-Is:       make-reference-files.hs+  Hs-Source-Dirs: data+  Build-Depends: zip-archive >= 0.2.3.4 && < 0.3,+                 base >= 4.2 && < 5,+                 directory >= 1 && < 1.3,+                 bytestring >= 0.9 && < 0.11+  Default-Language: Haskell2010+ Test-Suite test-pandoc   Type:           exitcode-stdio-1.0   Main-Is:        test-pandoc.hs@@ -426,12 +464,12 @@                   directory >= 1 && < 1.3,                   filepath >= 1.1 && < 1.5,                   process >= 1 && < 1.3,-                  highlighting-kate >= 0.5.11.1 && < 0.6,+                  highlighting-kate >= 0.6 && < 0.7,                   Diff >= 0.2 && < 0.4,                   test-framework >= 0.3 && < 0.9,                   test-framework-hunit >= 0.2 && < 0.4,                   test-framework-quickcheck2 >= 0.2.9 && < 0.4,-                  QuickCheck >= 2.4 && < 2.8,+                  QuickCheck >= 2.4 && < 2.9,                   HUnit >= 1.2 && < 1.3,                   containers >= 0.1 && < 0.6,                   ansi-terminal >= 0.5 && < 0.7,@@ -443,6 +481,7 @@                   Tests.Shared                   Tests.Walk                   Tests.Readers.LaTeX+                  Tests.Readers.HTML                   Tests.Readers.Markdown                   Tests.Readers.Org                   Tests.Readers.RST@@ -457,6 +496,8 @@                   Tests.Writers.Plain                   Tests.Writers.AsciiDoc                   Tests.Writers.LaTeX+                  Tests.Writers.Docx+                  Tests.Writers.RST   Ghc-Options:  -rtsopts -Wall -fno-warn-unused-do-bind -threaded   Default-Language: Haskell98 @@ -467,6 +508,6 @@   Build-Depends:   pandoc,                    base >= 4.2 && < 5,                    syb >= 0.1 && < 0.5,-                   criterion >= 0.5 && < 0.9+                   criterion >= 0.5 && < 1.1   Ghc-Options:   -rtsopts -Wall -fno-warn-unused-do-bind   Default-Language: Haskell98
pandoc.hs view
@@ -1,6 +1,6 @@ {-# LANGUAGE CPP, TupleSections #-} {--Copyright (C) 2006-2014 John MacFarlane <jgm@berkeley.edu>+Copyright (C) 2006-2015 John MacFarlane <jgm@berkeley.edu>  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@@ -19,7 +19,7 @@  {- |    Module      : Main-   Copyright   : Copyright (C) 2006-2014 John MacFarlane+   Copyright   : Copyright (C) 2006-2015 John MacFarlane    License     : GNU GPL, version 2 or above     Maintainer  : John MacFarlane <jgm@berkeley@edu>@@ -49,7 +49,7 @@ import System.FilePath import System.Console.GetOpt import Data.Char ( toLower )-import Data.List ( intercalate, isPrefixOf, isSuffixOf, sort )+import Data.List ( delete, intercalate, isPrefixOf, isSuffixOf, sort ) import System.Directory ( getAppUserDataDirectory, findExecutable,                           doesFileExist, Permissions(..), getPermissions ) import System.IO ( stdout, stderr )@@ -58,7 +58,7 @@ import Control.Exception.Extensible ( throwIO ) import qualified Text.Pandoc.UTF8 as UTF8 import Control.Monad (when, unless, (>=>))-import Data.Maybe (isJust, fromMaybe)+import Data.Maybe (fromMaybe) import Data.Foldable (foldrM) import Network.URI (parseURI, isURI, URI(..)) import qualified Data.ByteString.Lazy as B@@ -72,12 +72,14 @@ import Text.Pandoc.Readers.Txt2Tags (getT2TMeta) import Data.Monoid +import Text.Pandoc.Error+ type Transform = Pandoc -> Pandoc  copyrightMessage :: String copyrightMessage = intercalate "\n" [   "",-  "Copyright (C) 2006-2014 John MacFarlane",+  "Copyright (C) 2006-2015 John MacFarlane",   "Web:  http://johnmacfarlane.net/pandoc",   "This is free software; see the source for copying conditions.",   "There is no warranty, not even for merchantability or fitness",@@ -186,6 +188,7 @@     , optTOCDepth          :: Int     -- ^ Number of levels to include in TOC     , optDumpArgs          :: Bool    -- ^ Output command-line arguments     , optIgnoreArgs        :: Bool    -- ^ Ignore command-line arguments+    , optVerbose           :: Bool    -- ^ Verbose diagnostic output     , optReferenceLinks    :: Bool    -- ^ Use reference links in writing markdown, rst     , optWrapText          :: Bool    -- ^ Wrap text     , optColumns           :: Int     -- ^ Line length in characters@@ -197,6 +200,7 @@     , optCiteMethod        :: CiteMethod -- ^ Method to output cites     , optListings          :: Bool       -- ^ Use listings package for code blocks     , optLaTeXEngine       :: String     -- ^ Program to use for latex -> pdf+    , optLaTeXEngineArgs   :: [String]   -- ^ Flags to pass to the latex-engine     , optSlideLevel        :: Maybe Int  -- ^ Header level that creates slides     , optSetextHeaders     :: Bool       -- ^ Use atx headers for markdown level 1-2     , optAscii             :: Bool       -- ^ Use ascii characters only in html@@ -246,6 +250,7 @@     , optTOCDepth              = 3     , optDumpArgs              = False     , optIgnoreArgs            = False+    , optVerbose               = False     , optReferenceLinks        = False     , optWrapText              = True     , optColumns               = 72@@ -257,6 +262,7 @@     , optCiteMethod            = Citeproc     , optListings              = False     , optLaTeXEngine           = "pdflatex"+    , optLaTeXEngineArgs       = []     , optSlideLevel            = Nothing     , optSetextHeaders         = True     , optAscii                 = False@@ -732,14 +738,19 @@                   "PROGRAM")                  "" -- "Name of latex program to use in generating PDF" +    , Option "" ["latex-engine-opt"]+                 (ReqArg+                  (\arg opt -> do+                      let oldArgs = optLaTeXEngineArgs opt+                      return opt { optLaTeXEngineArgs = arg : oldArgs })+                  "STRING")+                 "" -- "Flags to pass to the LaTeX engine, all instances of this option are accumulated and used"+     , Option "" ["bibliography"]                  (ReqArg                   (\arg opt -> return opt{ optMetadata = addMetadata                                              "bibliography" (readMetaValue arg)                                              $ optMetadata opt-                                         , optVariables =-                                            ("biblio-files", dropExtension arg) :-                                            optVariables opt                                          })                    "FILE")                  ""@@ -858,6 +869,11 @@                   (\opt -> return opt { optIgnoreArgs = True }))                  "" -- "Ignore command-line arguments." +    , Option "" ["verbose"]+                 (NoArg+                  (\opt -> return opt { optVerbose = True }))+                 "" -- "Verbose diagnostic output."+     , Option "v" ["version"]                  (NoArg                   (\_ -> do@@ -898,13 +914,15 @@ usageMessage :: String -> [OptDescr (Opt -> IO Opt)] -> String usageMessage programName = usageInfo   (programName ++ " [OPTIONS] [FILES]" ++ "\nInput formats:  " ++-  (wrapWords 16 78 $ readers'names) ++ "\nOutput formats: " +++  (wrapWords 16 78 $ readers'names) ++ +     '\n' : replicate 16 ' ' +++     "[ *only Pandoc's JSON version of native AST]" ++ "\nOutput formats: " ++   (wrapWords 16 78 $ writers'names) ++      '\n' : replicate 16 ' ' ++-     "[*for pdf output, use latex or beamer and -o FILENAME.pdf]\nOptions:")+     "[**for pdf output, use latex or beamer and -o FILENAME.pdf]\nOptions:")   where-    writers'names = sort $ "pdf*" : map fst writers-    readers'names = sort $ map fst readers+    writers'names = sort $ "json*" : "pdf**" : delete "json" (map fst writers)+    readers'names = sort $ "json*" : delete "json" (map fst readers)  -- Determine default reader based on source file extensions defaultReaderName :: String -> [FilePath] -> String@@ -1061,6 +1079,7 @@               , optTOCDepth              = epubTOCDepth               , optDumpArgs              = dumpArgs               , optIgnoreArgs            = ignoreArgs+              , optVerbose               = verbose               , optReferenceLinks        = referenceLinks               , optWrapText              = wrap               , optColumns               = columns@@ -1072,6 +1091,7 @@               , optCiteMethod            = citeMethod               , optListings              = listings               , optLaTeXEngine           = latexEngine+              , optLaTeXEngineArgs       = latexEngineArgs               , optSlideLevel            = slideLevel               , optSetextHeaders         = setextHeaders               , optAscii                 = ascii@@ -1097,7 +1117,7 @@     -- --bibliography implies -F pandoc-citeproc for backwards compatibility:-  let needsCiteproc = isJust (M.lookup "bibliography" metadata) &&+  let needsCiteproc = any ("--bibliography" `isPrefixOf`) rawArgs &&                       optCiteMethod opts `notElem` [Natbib, Biblatex] &&                       "pandoc-citeproc" `notElem` map takeBaseName filters   let filters' = if needsCiteproc then "pandoc-citeproc" : filters@@ -1247,23 +1267,24 @@              Right (bs,_)  -> return $ UTF8.toString bs    let readFiles [] = error "Cannot read archive from stdin"-      readFiles (x:_) = B.readFile x+      readFiles [x] = B.readFile x+      readFiles (x:xs) = mapM (warn . ("Ignoring: " ++)) xs >> B.readFile x    let convertTabs = tabFilter (if preserveTabs || readerName' == "t2t"                                  then 0                                  else tabStop) -  let handleIncludes' = if readerName' == "latex" ||-                           readerName' == "latex+lhs"+  let handleIncludes' :: String -> IO (Either PandocError String)+      handleIncludes' = if readerName' `elem`  ["latex", "latex+lhs"]                                then handleIncludes-                               else return+                               else return . Right -  (doc, media) <--     case reader of-          StringReader r-> (, mempty) <$>-            (  readSources >=>-               handleIncludes' . convertTabs . intercalate "\n" >=>-               r readerOpts ) sources+  (doc, media) <- fmap handleError $+      case reader of+          StringReader r-> do+            srcs <- convertTabs . intercalate "\n" <$> readSources sources+            doc <- handleIncludes' srcs+            either (return . Left) (\s -> fmap (,mempty) <$> r readerOpts s) doc           ByteStringReader r -> readFiles sources >>= r readerOpts    let writerOptions = def { writerStandalone       = standalone',@@ -1302,7 +1323,9 @@                             writerTOCDepth         = epubTOCDepth,                             writerReferenceODT     = referenceODT,                             writerReferenceDocx    = referenceDocx,-                            writerMediaBag         = media+                            writerMediaBag         = media,+                            writerVerbose          = verbose,+                            writerLaTeXArgs        = latexEngineArgs                           }  
src/Text/Pandoc.hs view
@@ -1,6 +1,6 @@ {-# LANGUAGE ScopedTypeVariables, FlexibleInstances #-} {--Copyright (C) 2006-2014 John MacFarlane <jgm@berkeley.edu>+Copyright (C) 2006-2015 John MacFarlane <jgm@berkeley.edu>  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@@ -19,7 +19,7 @@  {- |    Module      : Text.Pandoc-   Copyright   : Copyright (C) 2006-2014 John MacFarlane+   Copyright   : Copyright (C) 2006-2015 John MacFarlane    License     : GNU GPL, version 2 or above     Maintainer  : John MacFarlane <jgm@berkeley.edu>@@ -37,10 +37,12 @@  > module Main where > import Text.Pandoc+> import Text.Pandoc.Error (handleError) > > markdownToRST :: String -> String-> markdownToRST =->   (writeRST def {writerReferenceLinks = True}) . readMarkdown def+> markdownToRST = handleError .+>   writeRST def {writerReferenceLinks = True} .+>   readMarkdown def > > main = getContents >>= putStrLn . markdownToRST @@ -66,6 +68,7 @@                , mkStringReader                , readDocx                , readMarkdown+               , readCommonMark                , readMediaWiki                , readRST                , readOrg@@ -109,6 +112,7 @@                , writeOrg                , writeAsciiDoc                , writeHaddock+               , writeCommonMark                , writeCustom                -- * Rendering templates and default templates                , module Text.Pandoc.Templates@@ -124,6 +128,7 @@ import Text.Pandoc.Generic import Text.Pandoc.JSON import Text.Pandoc.Readers.Markdown+import Text.Pandoc.Readers.CommonMark import Text.Pandoc.Readers.MediaWiki import Text.Pandoc.Readers.RST import Text.Pandoc.Readers.Org@@ -161,11 +166,13 @@ import Text.Pandoc.Writers.Org import Text.Pandoc.Writers.AsciiDoc import Text.Pandoc.Writers.Haddock+import Text.Pandoc.Writers.CommonMark import Text.Pandoc.Writers.Custom import Text.Pandoc.Templates import Text.Pandoc.Options-import Text.Pandoc.Shared (safeRead, warn)+import Text.Pandoc.Shared (safeRead, warn, mapLeft) import Text.Pandoc.MediaBag (MediaBag)+import Text.Pandoc.Error import Data.Aeson import qualified Data.ByteString.Lazy as BL import Data.List (intercalate)@@ -201,19 +208,22 @@                         '-'  -> Set.delete ext                         _    -> Set.insert ext -data Reader = StringReader (ReaderOptions -> String -> IO Pandoc)-              | ByteStringReader (ReaderOptions -> BL.ByteString -> IO (Pandoc, MediaBag)) -mkStringReader :: (ReaderOptions -> String -> Pandoc) -> Reader+data Reader = StringReader (ReaderOptions -> String -> IO (Either PandocError Pandoc))+              | ByteStringReader (ReaderOptions -> BL.ByteString -> IO (Either PandocError (Pandoc,MediaBag)))++mkStringReader :: (ReaderOptions -> String -> (Either PandocError Pandoc)) -> Reader mkStringReader r = StringReader (\o s -> return $ r o s) -mkStringReaderWithWarnings :: (ReaderOptions -> String -> (Pandoc, [String])) -> Reader+mkStringReaderWithWarnings :: (ReaderOptions -> String -> Either PandocError (Pandoc, [String])) -> Reader mkStringReaderWithWarnings r  = StringReader $ \o s -> do-    let (doc, warnings) = r o s-    mapM_ warn warnings-    return doc+  case r o s of+    Left err -> return $ Left err+    Right (doc, warnings) -> do+      mapM_ warn warnings+      return (Right doc) -mkBSReader :: (ReaderOptions -> BL.ByteString -> (Pandoc, MediaBag)) -> Reader+mkBSReader :: (ReaderOptions -> BL.ByteString -> (Either PandocError (Pandoc, MediaBag))) -> Reader mkBSReader r = ByteStringReader (\o s -> return $ r o s)  -- | Association list of formats and readers.@@ -225,6 +235,7 @@            ,("markdown_phpextra" , mkStringReaderWithWarnings readMarkdownWithWarnings)            ,("markdown_github" , mkStringReaderWithWarnings readMarkdownWithWarnings)            ,("markdown_mmd",  mkStringReaderWithWarnings readMarkdownWithWarnings)+           ,("commonmark"   , mkStringReader readCommonMark)            ,("rst"          , mkStringReaderWithWarnings readRSTWithWarnings )            ,("mediawiki"    , mkStringReader readMediaWiki)            ,("docbook"      , mkStringReader readDocBook)@@ -296,6 +307,7 @@   ,("org"          , PureStringWriter writeOrg)   ,("asciidoc"     , PureStringWriter writeAsciiDoc)   ,("haddock"      , PureStringWriter writeHaddock)+  ,("commonmark"   , PureStringWriter writeCommonMark)   ]  getDefaultExtensions :: String -> Set Extension@@ -357,8 +369,8 @@   where toJsonFilter :: a -> IO ()         toJsonFilter = toJSONFilter -readJSON :: ReaderOptions -> String -> Pandoc-readJSON _ = either error id . eitherDecode' . UTF8.fromStringLazy+readJSON :: ReaderOptions -> String -> Either PandocError Pandoc+readJSON _ = mapLeft ParseFailure . eitherDecode' . UTF8.fromStringLazy  writeJSON :: WriterOptions -> Pandoc -> String writeJSON _ = UTF8.toStringLazy . encode
src/Text/Pandoc/Asciify.hs view
@@ -1,5 +1,5 @@ {--Copyright (C) 2013-2014 John MacFarlane <jgm@berkeley.edu>+Copyright (C) 2013-2015 John MacFarlane <jgm@berkeley.edu>  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@@ -18,7 +18,7 @@  {- |    Module      : Text.Pandoc.Asciify-   Copyright   : Copyright (C) 2013-2014 John MacFarlane+   Copyright   : Copyright (C) 2013-2015 John MacFarlane    License     : GNU GPL, version 2 or above     Maintainer  : John MacFarlane <jgm@berkeley.edu>
+ src/Text/Pandoc/Error.hs view
@@ -0,0 +1,64 @@+{-+Copyright (C) 2006-2015 John MacFarlane <jgm@berkeley.edu>++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+the Free Software Foundation; either version 2 of the License, or+(at your option) any later version.++This program is distributed in the hope that it will be useful,+but WITHOUT ANY WARRANTY; without even the implied warranty of+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the+GNU General Public License for more details.++You should have received a copy of the GNU General Public License+along with this program; if not, write to the Free Software+Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA+-}+{- |+   Module      : Text.Pandoc.Error+   Copyright   : Copyright (C) 2006-2015 John MacFarlane+   License     : GNU GPL, version 2 or above++   Maintainer  : John MacFarlane <jgm@berkeley.edu>+   Stability   : alpha+   Portability : portable++This module provides a standard way to deal with possible errors encounted+during parsing.++-}+module Text.Pandoc.Error (PandocError(..), handleError) where++import Text.Parsec.Error+import Text.Parsec.Pos hiding (Line)+import Text.Pandoc.Compat.Except++type Input = String++data PandocError = -- | Generic parse failure+                   ParseFailure String+                 -- | Error thrown by a Parsec parser+                 | ParsecError Input ParseError+                 deriving (Show)+++instance Error PandocError where+  strMsg = ParseFailure+++-- | An unsafe method to handle `PandocError`s.+handleError :: Either PandocError a -> a+handleError (Right r) = r+handleError (Left err) =+  case err of+    ParseFailure string -> error string+    ParsecError input err' ->+        let errPos = errorPos err'+            errLine = sourceLine errPos+            errColumn = sourceColumn errPos+            theline = (lines input ++ [""]) !! (errLine - 1)+        in  error $ "\nError at " ++ show  err' ++ "\n" +++                theline ++ "\n" ++ replicate (errColumn - 1) ' ' +++                "^"+
src/Text/Pandoc/Highlighting.hs view
@@ -1,5 +1,5 @@ {--Copyright (C) 2008-2014 John MacFarlane <jgm@berkeley.edu>+Copyright (C) 2008-2015 John MacFarlane <jgm@berkeley.edu>  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@@ -18,7 +18,7 @@  {- |    Module      : Text.Pandoc.Highlighting-   Copyright   : Copyright (C) 2008-2014 John MacFarlane+   Copyright   : Copyright (C) 2008-2015 John MacFarlane    License     : GNU GPL, version 2 or above     Maintainer  : John MacFarlane <jgm@berkeley.edu>
src/Text/Pandoc/ImageSize.hs view
@@ -1,6 +1,7 @@-{-# LANGUAGE OverloadedStrings, ScopedTypeVariables  #-}+{-# LANGUAGE OverloadedStrings, ScopedTypeVariables, CPP #-}+{-# OPTIONS_GHC -fno-warn-type-defaults #-} {--  Copyright (C) 2011-2014 John MacFarlane <jgm@berkeley.edu>+  Copyright (C) 2011-2015 John MacFarlane <jgm@berkeley.edu>      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@@ -19,7 +20,7 @@  {- | Module      : Text.Pandoc.ImageSize-Copyright   : Copyright (C) 2011-2014 John MacFarlane+Copyright   : Copyright (C) 2011-2015 John MacFarlane License     : GNU GPL, version 2 or above  Maintainer  : John MacFarlane <jgm@berkeley.edu>@@ -38,8 +39,11 @@ import Data.Bits import Data.Binary import Data.Binary.Get-import Text.Pandoc.Shared (safeRead)+import Text.Pandoc.Shared (safeRead, hush) import qualified Data.Map as M+import Text.Pandoc.Compat.Except+import Control.Monad.Trans+import Data.Maybe (fromMaybe)  -- quick and dirty functions to get image sizes -- algorithms borrowed from wwwis.pl@@ -64,17 +68,19 @@                      "%!PS"                        | (B.take 4 $ B.drop 1 $ B.dropWhile (/=' ') img) == "EPSF"                                         -> return Eps-                     _                  -> fail "Unknown image type"+                     _                  -> mzero -imageSize :: ByteString -> Maybe ImageSize-imageSize img = do-  t <- imageType img-  case t of-       Png  -> pngSize img-       Gif  -> gifSize img-       Jpeg -> jpegSize img-       Eps  -> epsSize img-       Pdf  -> Nothing  -- TODO+imageSize :: ByteString -> Either String ImageSize+imageSize img =+  case imageType img of+       Just Png  -> mbToEither "could not determine PNG size" $ pngSize img+       Just Gif  -> mbToEither "could not determine GIF size" $ gifSize img+       Just Jpeg -> jpegSize img+       Just Eps  -> mbToEither "could not determine EPS size" $ epsSize img+       Just Pdf  -> Left "could not determine PDF size" -- TODO+       Nothing   -> Left "could not determine image type"+  where mbToEither msg Nothing  = Left msg+        mbToEither _   (Just x) = Right x  defaultSize :: (Integer, Integer) defaultSize = (72, 72)@@ -114,7 +120,7 @@                 ([w1,w2,w3,w4,h1,h2,h3,h4] :: [Integer]) -> return                     ((shift w1 24) + (shift w2 16) + (shift w3 8) + w4,                      (shift h1 24) + (shift h2 16) + (shift h3 8) + h4)-                _ -> fail "PNG parse error"+                _ -> (hush . Left) "PNG parse error"   let (dpix, dpiy) = findpHYs rest''   return $ ImageSize { pxX  = x, pxY = y, dpiX = dpix, dpiY = dpiy } @@ -143,67 +149,84 @@                           dpiX = 72,                           dpiY = 72                           }-       _             -> fail "GIF parse error"+       _             -> (hush . Left) "GIF parse error" -jpegSize :: ByteString -> Maybe ImageSize-jpegSize img = do+jpegSize :: ByteString -> Either String ImageSize+jpegSize img =   let (hdr, rest) = B.splitAt 4 img-  guard $ B.length rest >= 14-  case hdr of-       "\xff\xd8\xff\xe0" -> jfifSize rest-       "\xff\xd8\xff\xe1" -> exifSize $ B.takeWhile (/= '\xff') rest-       _                  -> mzero+  in if B.length rest < 14+        then Left "unable to determine JPEG size"+        else case hdr of+               "\xff\xd8\xff\xe0" -> jfifSize rest+               "\xff\xd8\xff\xe1" -> exifSize rest+               _                  -> Left "unable to determine JPEG size" -jfifSize :: ByteString -> Maybe ImageSize-jfifSize rest = do+jfifSize :: ByteString -> Either String ImageSize+jfifSize rest =   let [dpiDensity,dpix1,dpix2,dpiy1,dpiy2] = map fromIntegral                                            $ unpack $ B.take 5 $ B.drop 9 $ rest-  let factor = case dpiDensity of+      factor = case dpiDensity of                     1 -> id                     2 -> \x -> (x * 254 `div` 10)                     _ -> const 72-  let dpix = factor (shift dpix1 8 + dpix2)-  let dpiy = factor (shift dpiy1 8 + dpiy2)-  (w,h) <- findJfifSize rest-  return $ ImageSize { pxX = w, pxY = h, dpiX = dpix, dpiY = dpiy }+      dpix = factor (shift dpix1 8 + dpix2)+      dpiy = factor (shift dpiy1 8 + dpiy2)+  in case findJfifSize rest of+       Left msg    -> Left msg+       Right (w,h) -> Right $ ImageSize { pxX = w+                                        , pxY = h+                                        , dpiX = dpix+                                        , dpiY = dpiy } -findJfifSize :: ByteString -> Maybe (Integer,Integer)-findJfifSize bs = do+findJfifSize :: ByteString -> Either String (Integer,Integer)+findJfifSize bs =   let bs' = B.dropWhile (=='\xff') $ B.dropWhile (/='\xff') bs-  case B.uncons bs' of-       Just (c,bs'') | c >= '\xc0' && c <= '\xc3' -> do+  in case B.uncons bs' of+       Just (c,bs'') | c >= '\xc0' && c <= '\xc3' ->          case map fromIntegral $ unpack $ B.take 4 $ B.drop 3 bs'' of-              [h1,h2,w1,w2] -> return (shift w1 8 + w2, shift h1 8 + h2)-              _             -> fail "JPEG parse error"-       Just (_,bs'') ->  do+              [h1,h2,w1,w2] -> Right (shift w1 8 + w2, shift h1 8 + h2)+              _             -> Left "JFIF parse error"+       Just (_,bs'') ->          case map fromIntegral $ unpack $ B.take 2 bs'' of-              [c1,c2] -> do+              [c1,c2] ->                 let len = shift c1 8 + c2                 -- skip variables-                findJfifSize $ B.drop len bs''-              _       -> fail "JPEG parse error"-       Nothing -> fail "Did not find length record"+                in  findJfifSize $ B.drop len bs''+              _       -> Left "JFIF parse error"+       Nothing -> Left "Did not find JFIF length record" -exifSize :: ByteString -> Maybe ImageSize-exifSize bs = runGet (Just <$> exifHeader bl) bl+runGet' :: Get (Either String a) -> BL.ByteString -> Either String a+runGet' p bl =+#if MIN_VERSION_binary(0,7,0)+  case runGetOrFail p bl of+       Left (_,_,msg) -> Left msg+       Right (_,_,x)  -> x+#else+  runGet p bl+#endif+++exifSize :: ByteString -> Either String ImageSize+exifSize bs = runGet' header $ bl   where bl = BL.fromChunks [bs]+        header = runExceptT $ exifHeader bl -- NOTE:  It would be nicer to do -- runGet ((Just <$> exifHeader) <|> return Nothing) -- which would prevent pandoc from raising an error when an exif header can't -- be parsed.  But we only get an Alternative instance for Get in binary 0.6, -- and binary 0.5 ships with ghc 7.6. -exifHeader :: BL.ByteString -> Get ImageSize+exifHeader :: BL.ByteString -> ExceptT String Get ImageSize exifHeader hdr = do-  _app1DataSize <- getWord16be-  exifHdr <- getWord32be-  unless (exifHdr == 0x45786966) $ fail "Did not find exif header"-  zeros <- getWord16be-  unless (zeros == 0) $ fail "Expected zeros after exif header"+  _app1DataSize <- lift getWord16be+  exifHdr <- lift getWord32be+  unless (exifHdr == 0x45786966) $ throwError "Did not find exif header"+  zeros <- lift getWord16be+  unless (zeros == 0) $ throwError "Expected zeros after exif header"   -- beginning of tiff header -- we read whole thing to use   -- in getting data from offsets:   let tiffHeader = BL.drop 8 hdr-  byteAlign <- getWord16be+  byteAlign <- lift getWord16be   let bigEndian = byteAlign == 0x4d4d   let (getWord16, getWord32, getWord64) =         if bigEndian@@ -213,48 +236,53 @@         num <- getWord32         den <- getWord32         return $ fromIntegral num / fromIntegral den-  tagmark <- getWord16-  unless (tagmark == 0x002a) $ fail "Failed alignment sanity check"-  ifdOffset <- getWord32-  skip (fromIntegral ifdOffset - 8) -- skip to IDF-  numentries <- getWord16-  let ifdEntry = do-       tag <- getWord16 >>= \t ->-                maybe (return UnknownTagType) return-                (M.lookup t tagTypeTable)-       dataFormat <- getWord16-       numComponents <- getWord32+  tagmark <- lift getWord16+  unless (tagmark == 0x002a) $ throwError "Failed alignment sanity check"+  ifdOffset <- lift getWord32+  lift $ skip (fromIntegral ifdOffset - 8) -- skip to IDF+  numentries <- lift  getWord16+  let ifdEntry :: ExceptT String Get (TagType, DataFormat)+      ifdEntry = do+       tag <- fromMaybe UnknownTagType . flip M.lookup tagTypeTable+                <$> lift getWord16+       dataFormat <- lift getWord16+       numComponents <- lift getWord32        (fmt, bytesPerComponent) <-              case dataFormat of-                  1  -> return (UnsignedByte . runGet getWord8, 1)-                  2  -> return (AsciiString, 1)-                  3  -> return (UnsignedShort . runGet getWord16, 2)-                  4  -> return (UnsignedLong . runGet getWord32, 4)-                  5  -> return (UnsignedRational . runGet getRational, 8)-                  6  -> return (SignedByte . runGet getWord8, 1)-                  7  -> return (Undefined . runGet getWord8, 1)-                  8  -> return (SignedShort . runGet getWord16, 2)-                  9  -> return (SignedLong . runGet getWord32, 4)-                  10 -> return (SignedRational . runGet getRational, 8)-                  11 -> return (SingleFloat . runGet getWord32 {- TODO -}, 4)-                  12 -> return (DoubleFloat . runGet getWord64 {- TODO -}, 8)-                  _  -> fail $ "Unknown data format " ++ show dataFormat+                  1  -> return (UnsignedByte <$> getWord8, 1)+                  2  -> return (AsciiString <$>+                                getLazyByteString+                                (fromIntegral numComponents), 1)+                  3  -> return (UnsignedShort <$> getWord16, 2)+                  4  -> return (UnsignedLong <$> getWord32, 4)+                  5  -> return (UnsignedRational <$> getRational, 8)+                  6  -> return (SignedByte <$> getWord8, 1)+                  7  -> return (Undefined <$> getLazyByteString+                                (fromIntegral numComponents), 1)+                  8  -> return (SignedShort <$> getWord16, 2)+                  9  -> return (SignedLong <$> getWord32, 4)+                  10 -> return (SignedRational <$> getRational, 8)+                  11 -> return (SingleFloat <$> getWord32 {- TODO -}, 4)+                  12 -> return (DoubleFloat <$> getWord64 {- TODO -}, 8)+                  _  -> throwError $ "Unknown data format " ++ show dataFormat        let totalBytes = fromIntegral $ numComponents * bytesPerComponent        payload <- if totalBytes <= 4 -- data is right here-                     then fmt <$>-                          (getLazyByteString (fromIntegral totalBytes) <*-                          skip (4 - totalBytes))+                     then lift $ fmt <* skip (4 - totalBytes)                      else do  -- get data from offset-                          offs <- getWord32-                          return $ fmt $ BL.take (fromIntegral totalBytes) $-                                   BL.drop (fromIntegral offs) tiffHeader+                          offs <- lift getWord32+                          let bytesAtOffset =+                                 BL.take (fromIntegral totalBytes)+                                 $ BL.drop (fromIntegral offs) tiffHeader+                          case runGet' (Right <$> fmt) bytesAtOffset of+                               Left msg -> throwError msg+                               Right x  -> return x        return (tag, payload)   entries <- sequence $ replicate (fromIntegral numentries) ifdEntry   subentries <- case lookup ExifOffset entries of                       Just (UnsignedLong offset) -> do-                        pos <- bytesRead-                        skip (fromIntegral offset - (fromIntegral pos - 8))-                        numsubentries <- getWord16+                        pos <- lift bytesRead+                        lift $ skip (fromIntegral offset - (fromIntegral pos - 8))+                        numsubentries <- lift getWord16                         sequence $                            replicate (fromIntegral numsubentries) ifdEntry                       _ -> return []@@ -285,7 +313,7 @@                 | UnsignedLong Word32                 | UnsignedRational Rational                 | SignedByte Word8-                | Undefined Word8+                | Undefined BL.ByteString                 | SignedShort Word16                 | SignedLong Word32                 | SignedRational Rational
src/Text/Pandoc/MIME.hs view
@@ -1,5 +1,5 @@ {--Copyright (C) 2011-2014 John MacFarlane <jgm@berkeley.edu>+Copyright (C) 2011-2015 John MacFarlane <jgm@berkeley.edu>  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@@ -18,7 +18,7 @@  {- |    Module      : Text.Pandoc.MIME-   Copyright   : Copyright (C) 2011-2014 John MacFarlane+   Copyright   : Copyright (C) 2011-2015 John MacFarlane    License     : GNU GPL, version 2 or above     Maintainer  : John MacFarlane <jgm@berkeley.edu>@@ -433,7 +433,9 @@            ,("sv4cpio","application/x-sv4cpio")            ,("sv4crc","application/x-sv4crc")            ,("svg","image/svg+xml")-           ,("svgz","image/svg+xml")+           -- removed for now, since it causes problems with+           -- extensionFromMimeType: see #2183.+           -- ,("svgz","image/svg+xml")            ,("sw","chemical/x-swissprot")            ,("swf","application/x-shockwave-flash")            ,("swfl","application/x-shockwave-flash")@@ -497,6 +499,7 @@            ,("wmx","video/x-ms-wmx")            ,("wmz","application/x-ms-wmz")            ,("woff","application/x-font-woff")+           ,("woff2","application/x-font-woff2")            ,("wp5","application/wordperfect5.1")            ,("wpd","application/wordperfect")            ,("wrl","model/vrml")
src/Text/Pandoc/MediaBag.hs view
@@ -1,4 +1,4 @@-{-# LANGUAGE GeneralizedNewtypeDeriving #-}+{-# LANGUAGE GeneralizedNewtypeDeriving, DeriveDataTypeable #-} {- Copyright (C) 2014 John MacFarlane <jgm@berkeley.edu> @@ -46,13 +46,15 @@ import qualified Text.Pandoc.UTF8 as UTF8 import Data.Maybe (fromMaybe) import System.IO (stderr)+import Data.Data (Data)+import Data.Typeable (Typeable)  -- | A container for a collection of binary resources, with names and -- mime types.  Note that a 'MediaBag' is a Monoid, so 'mempty' -- can be used for an empty 'MediaBag', and '<>' can be used to append -- two 'MediaBag's. newtype MediaBag = MediaBag (M.Map [String] (MimeType, BL.ByteString))-        deriving (Monoid)+        deriving (Monoid, Data, Typeable)  instance Show MediaBag where   show bag = "MediaBag " ++ show (mediaDirectory bag)
src/Text/Pandoc/Options.hs view
@@ -1,5 +1,6 @@+{-# LANGUAGE DeriveDataTypeable #-} {--Copyright (C) 2012-2014 John MacFarlane <jgm@berkeley.edu>+Copyright (C) 2012-2015 John MacFarlane <jgm@berkeley.edu>  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@@ -18,7 +19,7 @@  {- |    Module      : Text.Pandoc.Options-   Copyright   : Copyright (C) 2012-2014 John MacFarlane+   Copyright   : Copyright (C) 2012-2015 John MacFarlane    License     : GNU GPL, version 2 or above     Maintainer  : John MacFarlane <jgm@berkeley.edu>@@ -51,6 +52,8 @@ import Text.Pandoc.Highlighting (Style, pygments) import Text.Pandoc.MediaBag (MediaBag) import Data.Monoid+import Data.Data (Data)+import Data.Typeable (Typeable)  -- | Individually selectable syntax extensions. data Extension =@@ -74,7 +77,7 @@     | Ext_latex_macros        -- ^ Parse LaTeX macro definitions (for math only)     | Ext_fenced_code_blocks  -- ^ Parse fenced code blocks     | Ext_fenced_code_attributes  -- ^ Allow attributes on fenced code blocks-    | Ext_backtick_code_blocks    -- ^ Github style ``` code blocks+    | Ext_backtick_code_blocks    -- ^ GitHub style ``` code blocks     | Ext_inline_code_attributes  -- ^ Allow attributes on inline code     | Ext_markdown_in_html_blocks -- ^ Interpret as markdown inside HTML blocks     | Ext_native_divs             -- ^ Use Div blocks for contents of <div> tags@@ -109,7 +112,8 @@     | Ext_implicit_header_references -- ^ Implicit reference links for headers     | Ext_line_blocks         -- ^ RST style line blocks     | Ext_epub_html_exts      -- ^ Recognise the EPUB extended version of HTML-    deriving (Show, Read, Enum, Eq, Ord, Bounded)+    | Ext_shortcut_reference_links -- ^ Shortcut reference links+    deriving (Show, Read, Enum, Eq, Ord, Bounded, Data, Typeable)  pandocExtensions :: Set Extension pandocExtensions = Set.fromList@@ -151,6 +155,7 @@   , Ext_header_attributes   , Ext_implicit_header_references   , Ext_line_blocks+  , Ext_shortcut_reference_links   ]  phpMarkdownExtraExtensions :: Set Extension@@ -164,6 +169,7 @@   , Ext_intraword_underscores   , Ext_header_attributes   , Ext_abbreviations+  , Ext_shortcut_reference_links   ]  githubMarkdownExtensions :: Set Extension@@ -180,6 +186,7 @@   , Ext_strikeout   , Ext_hard_line_breaks   , Ext_lists_without_preceding_blankline+  , Ext_shortcut_reference_links   ]  multimarkdownExtensions :: Set Extension@@ -202,7 +209,9 @@  strictExtensions :: Set Extension strictExtensions = Set.fromList-  [ Ext_raw_html ]+  [ Ext_raw_html+  , Ext_shortcut_reference_links+  ]  data ReaderOptions = ReaderOptions{          readerExtensions      :: Set Extension  -- ^ Syntax extensions@@ -220,7 +229,7 @@        , readerDefaultImageExtension :: String -- ^ Default extension for images        , readerTrace           :: Bool -- ^ Print debugging info        , readerTrackChanges    :: TrackChanges-} deriving (Show, Read)+} deriving (Show, Read, Data, Typeable)  instance Default ReaderOptions   where def = ReaderOptions{@@ -242,7 +251,7 @@ -- Writer options -- -data EPUBVersion = EPUB2 | EPUB3 deriving (Eq, Show, Read)+data EPUBVersion = EPUB2 | EPUB3 deriving (Eq, Show, Read, Data, Typeable)  data HTMLMathMethod = PlainMath                     | LaTeXMathML (Maybe String)  -- url of LaTeXMathML.js@@ -252,18 +261,18 @@                     | MathML (Maybe String)       -- url of MathMLinHTML.js                     | MathJax String              -- url of MathJax.js                     | KaTeX String String -- url of stylesheet and katex.js-                    deriving (Show, Read, Eq)+                    deriving (Show, Read, Eq, Data, Typeable)  data CiteMethod = Citeproc                        -- use citeproc to render them                   | Natbib                        -- output natbib cite commands                   | Biblatex                      -- output biblatex cite commands-                deriving (Show, Read, Eq)+                deriving (Show, Read, Eq, Data, Typeable)  -- | Methods for obfuscating email addresses in HTML. data ObfuscationMethod = NoObfuscation                        | ReferenceObfuscation                        | JavascriptObfuscation-                       deriving (Show, Read, Eq)+                       deriving (Show, Read, Eq, Data, Typeable)  -- | Varieties of HTML slide shows. data HTMLSlideVariant = S5Slides@@ -272,13 +281,13 @@                       | DZSlides                       | RevealJsSlides                       | NoSlides-                      deriving (Show, Read, Eq)+                      deriving (Show, Read, Eq, Data, Typeable)  -- | Options for accepting or rejecting MS Word track-changes. data TrackChanges = AcceptChanges                   | RejectChanges                   | AllChanges-                  deriving (Show, Read, Eq)+                  deriving (Show, Read, Eq, Data, Typeable)  -- | Options for writers data WriterOptions = WriterOptions@@ -323,7 +332,9 @@   , writerReferenceODT     :: Maybe FilePath -- ^ Path to reference ODT if specified   , writerReferenceDocx    :: Maybe FilePath -- ^ Path to reference DOCX if specified   , writerMediaBag         :: MediaBag       -- ^ Media collected by docx or epub reader-  } deriving Show+  , writerVerbose          :: Bool           -- ^ Verbose debugging output+  , writerLaTeXArgs        :: [String]       -- ^ Flags to pass to latex-engine+  } deriving (Show, Data, Typeable)  instance Default WriterOptions where   def = WriterOptions { writerStandalone       = False@@ -366,6 +377,8 @@                       , writerReferenceODT     = Nothing                       , writerReferenceDocx    = Nothing                       , writerMediaBag         = mempty+                      , writerVerbose          = False+                      , writerLaTeXArgs        = []                       }  -- | Returns True if the given extension is enabled.
src/Text/Pandoc/PDF.hs view
@@ -1,6 +1,6 @@ {-# LANGUAGE OverloadedStrings, CPP, ScopedTypeVariables #-} {--Copyright (C) 2012-2014 John MacFarlane <jgm@berkeley.edu>+Copyright (C) 2012-2015 John MacFarlane <jgm@berkeley.edu>  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@@ -19,7 +19,7 @@  {- |    Module      : Text.Pandoc.PDF-   Copyright   : Copyright (C) 2012-2014 John MacFarlane+   Copyright   : Copyright (C) 2012-2015 John MacFarlane    License     : GNU GPL, version 2 or above     Maintainer  : John MacFarlane <jgm@berkeley.edu>@@ -36,10 +36,11 @@ import qualified Data.ByteString as BS import System.Exit (ExitCode (..)) import System.FilePath+import System.IO (stderr, stdout) import System.Directory import Data.Digest.Pure.SHA (showDigest, sha1) import System.Environment-import Control.Monad (unless, (<=<))+import Control.Monad (unless, when, (<=<)) import qualified Control.Exception as E import Control.Applicative ((<$)) import Data.List (isInfixOf)@@ -70,7 +71,8 @@ makePDF program writer opts doc = withTempDir "tex2pdf." $ \tmpdir -> do   doc' <- handleImages opts tmpdir doc   let source = writer opts doc'-  tex2pdf' tmpdir program source+      args   = writerLaTeXArgs opts+  tex2pdf' (writerVerbose opts) args tmpdir program source  handleImages :: WriterOptions              -> FilePath      -- ^ temp dir to store images@@ -106,8 +108,7 @@   img <- convertImage tmpdir src   newPath <-     case img of-      Left e -> src <$-                 warn ("Unable to convert image `" ++ src ++ "':\n" ++ e)+      Left e -> src <$ warn e       Right fp -> return fp   return (Image ils (newPath, tit)) convertImages _ x = return x@@ -121,7 +122,8 @@     Just "application/pdf" -> doNothing     _ -> JP.readImage fname >>= \res ->           case res of-               Left msg  -> return $ Left msg+               Left _    -> return $ Left $ "Unable to convert `" +++                               fname ++ "' for use with pdflatex."                Right img ->                  E.catch (Right fileOut <$ JP.savePngImage fileOut img) $                      \(e :: E.SomeException) -> return (Left (show e))@@ -130,22 +132,25 @@     mime = getMimeType fname     doNothing = return (Right fname) -tex2pdf' :: FilePath                        -- ^ temp directory for output+tex2pdf' :: Bool                            -- ^ Verbose output+         -> [String]                        -- ^ Arguments to the latex-engine+         -> FilePath                        -- ^ temp directory for output          -> String                          -- ^ tex program          -> String                          -- ^ tex source          -> IO (Either ByteString ByteString)-tex2pdf' tmpDir program source = do+tex2pdf' verbose args tmpDir program source = do   let numruns = if "\\tableofcontents" `isInfixOf` source                    then 3  -- to get page numbers                    else 2  -- 1 run won't give you PDF bookmarks-  (exit, log', mbPdf) <- runTeXProgram program numruns tmpDir source+  (exit, log', mbPdf) <- runTeXProgram verbose program args 1 numruns tmpDir source   case (exit, mbPdf) of        (ExitFailure _, _)      -> do           let logmsg = extractMsg log'           let extramsg =                 case logmsg of-                     x | "! Package inputenc Error" `BC.isPrefixOf` x ->-                           "\nTry running pandoc with --latex-engine=xelatex."+                     x | ("! Package inputenc Error" `BC.isPrefixOf` x+                           && program /= "xelatex")+                       -> "\nTry running pandoc with --latex-engine=xelatex."                      _ -> ""           return $ Left $ logmsg <> extramsg        (ExitSuccess, Nothing)  -> return $ Left ""@@ -170,9 +175,9 @@ -- Run a TeX program on an input bytestring and return (exit code, -- contents of stdout, contents of produced PDF if any).  Rerun -- a fixed number of times to resolve references.-runTeXProgram :: String -> Int -> FilePath -> String+runTeXProgram :: Bool -> String -> [String] -> Int -> Int -> FilePath -> String               -> IO (ExitCode, ByteString, Maybe ByteString)-runTeXProgram program runsLeft tmpDir source = do+runTeXProgram verbose program args runNumber numRuns tmpDir source = do     let file = tmpDir </> "input.tex"     exists <- doesFileExist file     unless exists $ UTF8.writeFile file source@@ -185,16 +190,33 @@     let file' = file #endif     let programArgs = ["-halt-on-error", "-interaction", "nonstopmode",-         "-output-directory", tmpDir', file']+         "-output-directory", tmpDir', file'] ++ args     env' <- getEnvironment     let sep = searchPathSeparator:[]     let texinputs = maybe (tmpDir' ++ sep) ((tmpDir' ++ sep) ++)           $ lookup "TEXINPUTS" env'     let env'' = ("TEXINPUTS", texinputs) :                   [(k,v) | (k,v) <- env', k /= "TEXINPUTS"]+    when (verbose && runNumber == 1) $ do+      putStrLn $ "[makePDF] temp dir:"+      putStrLn tmpDir'+      putStrLn $ "[makePDF] Command line:"+      putStrLn $ program ++ " " ++ unwords (map show programArgs)+      putStr "\n"+      putStrLn $ "[makePDF] Environment:"+      mapM_ print env''+      putStr "\n"+      putStrLn $ "[makePDF] Contents of " ++ file' ++ ":"+      B.readFile file' >>= B.putStr+      putStr "\n"     (exit, out, err) <- pipeProcess (Just env'') program programArgs BL.empty-    if runsLeft > 1-       then runTeXProgram program (runsLeft - 1) tmpDir source+    when verbose $ do+      putStrLn $ "[makePDF] Run #" ++ show runNumber+      B.hPutStr stdout out+      B.hPutStr stderr err+      putStr "\n"+    if runNumber <= numRuns+       then runTeXProgram verbose program args (runNumber + 1) numRuns tmpDir source        else do          let pdfFile = replaceDirectory (replaceExtension file ".pdf") tmpDir          pdfExists <- doesFileExist pdfFile
src/Text/Pandoc/Parsing.hs view
@@ -5,7 +5,7 @@ , MultiParamTypeClasses , FlexibleInstances #-} {--Copyright (C) 2006-2014 John MacFarlane <jgm@berkeley.edu>+Copyright (C) 2006-2015 John MacFarlane <jgm@berkeley.edu>  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@@ -24,7 +24,7 @@  {- |    Module      : Text.Pandoc.Parsing-   Copyright   : Copyright (C) 2006-2014 John MacFarlane+   Copyright   : Copyright (C) 2006-2015 John MacFarlane    License     : GNU GPL, version 2 or above     Maintainer  : John MacFarlane <jgm@berkeley.edu>@@ -163,7 +163,8 @@                              setSourceColumn,                              setSourceLine,                              newPos,-                             addWarning+                             addWarning,+                             (<+?>)                              ) where @@ -192,6 +193,8 @@ import Data.Monoid import Data.Maybe (catMaybes) +import Text.Pandoc.Error+ type Parser t s = Parsec t s  type ParserT = ParsecT@@ -863,31 +866,22 @@           => ParserT [Char] st m a       -- ^ parser           -> st                       -- ^ initial state           -> String                   -- ^ input-          -> m a+          -> m (Either PandocError a) readWithM parser state input =-    handleError <$> (runParserT parser state "source" input)-    where-      handleError (Left err') =-        let errPos = errorPos err'-            errLine = sourceLine errPos-            errColumn = sourceColumn errPos-            theline = (lines input ++ [""]) !! (errLine - 1)-        in  error $ "\nError at " ++ show  err' ++ "\n" ++-                theline ++ "\n" ++ replicate (errColumn - 1) ' ' ++-                "^"-      handleError (Right result) = result+    mapLeft (ParsecError input) <$> runParserT parser state "source" input + -- | Parse a string with a given parser and state readWith :: Parser [Char] st a          -> st          -> String-         -> a+         -> Either PandocError a readWith p t inp = runIdentity $ readWithM p t inp  readWithWarnings :: Parser [Char] ParserState a                     -> ParserState                     -> String-                    -> (a, [String])+                    -> Either PandocError (a, [String]) readWithWarnings p = readWith $ do          doc <- p          warnings <- stateWarnings <$> getState@@ -909,7 +903,8 @@       stateAllowLinks      :: Bool,          -- ^ Allow parsing of links       stateMaxNestingLevel :: Int,           -- ^ Max # of nested Strong/Emph       stateLastStrPos      :: Maybe SourcePos, -- ^ Position after last str parsed-      stateKeys            :: KeyTable,      -- ^ List of reference keys (with fallbacks)+      stateKeys            :: KeyTable,      -- ^ List of reference keys+      stateHeaderKeys      :: KeyTable,      -- ^ List of implicit header ref keys       stateSubstitutions   :: SubstTable,    -- ^ List of substitution references       stateNotes           :: NoteTable,     -- ^ List of notes (raw bodies)       stateNotes'          :: NoteTable',    -- ^ List of notes (parsed bodies)@@ -1007,6 +1002,7 @@                   stateMaxNestingLevel = 6,                   stateLastStrPos      = Nothing,                   stateKeys            = M.empty,+                  stateHeaderKeys      = M.empty,                   stateSubstitutions   = M.empty,                   stateNotes           = [],                   stateNotes'          = [],@@ -1212,7 +1208,7 @@   guard =<< notAfterString   suppress_author <- option False (char '-' *> return True)   char '@'-  firstChar <- letter <|> char '_'+  firstChar <- alphaNum <|> char '_' <|> char '*' -- @* for wildcard in nocite   let regchar = satisfy (\c -> isAlphaNum c || c == '_')   let internal p = try $ p <* lookAhead regchar   rest <- many $ regchar <|> internal (oneOf ":.#$%&-+?<>~/")@@ -1264,3 +1260,6 @@   updateState $ \st -> st{     stateWarnings = (msg ++ maybe "" (\pos -> " " ++ show pos) mbpos) :                      stateWarnings st }+infixr 5 <+?>+(<+?>) :: (Monoid a, Monad m) => ParserT s st m a -> ParserT s st m a -> ParserT s st m a+a <+?> b = a >>= flip fmap (try b <|> return mempty) . (<>)
src/Text/Pandoc/Pretty.hs view
@@ -1,6 +1,6 @@ {-# LANGUAGE GeneralizedNewtypeDeriving, CPP #-} {--Copyright (C) 2010-2014 John MacFarlane <jgm@berkeley.edu>+Copyright (C) 2010-2015 John MacFarlane <jgm@berkeley.edu>  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@@ -19,7 +19,7 @@  {- |    Module      : Text.Pandoc.Pretty-   Copyright   : Copyright (C) 2010-2014 John MacFarlane+   Copyright   : Copyright (C) 2010-2015 John MacFarlane    License     : GNU GPL, version 2 or above     Maintainer  : John MacFarlane <jgm@berkeley.edu>@@ -250,6 +250,11 @@           => Doc -> DocState a renderDoc = renderList . toList . unDoc +data IsBlock = IsBlock Int [String]++-- This would be nicer with a pattern synonym+-- pattern VBlock i s <- mkIsBlock -> Just (IsBlock ..)+ renderList :: (IsString a, Monoid a)            => [D] -> DocState a renderList [] = return ()@@ -323,11 +328,11 @@           outp 1 " "           renderList xs' -renderList (b1@Block{} : b2@Block{} : xs) =-  renderList (mergeBlocks False b1 b2 : xs)+renderList (Block i1 s1 : Block i2 s2  : xs) =+  renderList (mergeBlocks False (IsBlock i1 s1) (IsBlock i2 s2) : xs) -renderList (b1@Block{} : BreakingSpace : b2@Block{} : xs) =-  renderList (mergeBlocks True b1 b2 : xs)+renderList (Block i1 s1 : BreakingSpace : Block i2 s2 : xs) =+  renderList (mergeBlocks True (IsBlock i1 s1) (IsBlock i2 s2) : xs)  renderList (Block width lns : xs) = do   st <- get@@ -339,15 +344,14 @@   modify $ \s -> s{ prefix = oldPref }   renderList xs -mergeBlocks :: Bool -> D -> D -> D-mergeBlocks addSpace (Block w1 lns1) (Block w2 lns2) =+mergeBlocks :: Bool -> IsBlock -> IsBlock -> D+mergeBlocks addSpace (IsBlock w1 lns1) (IsBlock w2 lns2) =   Block (w1 + w2 + if addSpace then 1 else 0) $      zipWith (\l1 l2 -> pad w1 l1 ++ l2) (lns1 ++ empties) (map sp lns2 ++ empties)     where empties = replicate (abs $ length lns1 - length lns2) ""           pad n s = s ++ replicate (n - realLength s) ' '           sp "" = ""           sp xs = if addSpace then (' ' : xs) else xs-mergeBlocks _ _ _ = error "mergeBlocks tried on non-Block!"  blockToDoc :: Int -> [String] -> Doc blockToDoc _ lns = text $ intercalate "\n" lns
src/Text/Pandoc/Process.hs view
@@ -1,5 +1,5 @@ {--Copyright (C) 2013-2014 John MacFarlane <jgm@berkeley.edu>+Copyright (C) 2013-2015 John MacFarlane <jgm@berkeley.edu>  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@@ -18,7 +18,7 @@  {- |    Module      : Text.Pandoc.Process-   Copyright   : Copyright (C) 2013-2014 John MacFarlane+   Copyright   : Copyright (C) 2013-2015 John MacFarlane    License     : GNU GPL, version 2 or above     Maintainer  : John MacFarlane <jgm@berkeley.edu>
+ src/Text/Pandoc/Readers/CommonMark.hs view
@@ -0,0 +1,119 @@+{-+Copyright (C) 2015 John MacFarlane <jgm@berkeley.edu>++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+the Free Software Foundation; either version 2 of the License, or+(at your option) any later version.++This program is distributed in the hope that it will be useful,+but WITHOUT ANY WARRANTY; without even the implied warranty of+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the+GNU General Public License for more details.++You should have received a copy of the GNU General Public License+along with this program; if not, write to the Free Software+Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA+-}++{- |+   Module      : Text.Pandoc.Readers.CommonMark+   Copyright   : Copyright (C) 2015 John MacFarlane+   License     : GNU GPL, version 2 or above++   Maintainer  : John MacFarlane <jgm@berkeley.edu>+   Stability   : alpha+   Portability : portable++Conversion of CommonMark-formatted plain text to 'Pandoc' document.++CommonMark is a strongly specified variant of Markdown: http://commonmark.org.+-}+module Text.Pandoc.Readers.CommonMark (readCommonMark)+where++import CMark+import Data.Text (unpack, pack)+import Data.List (groupBy)+import Text.Pandoc.Definition+import Text.Pandoc.Options+import Text.Pandoc.Error++-- | Parse a CommonMark formatted string into a 'Pandoc' structure.+readCommonMark :: ReaderOptions -> String -> Either PandocError Pandoc+readCommonMark opts = Right . nodeToPandoc . commonmarkToNode opts' . pack+  where opts' = if readerSmart opts+                   then [optNormalize, optSmart]+                   else [optNormalize]++nodeToPandoc :: Node -> Pandoc+nodeToPandoc (Node _ DOCUMENT nodes) =+  Pandoc nullMeta $ foldr addBlock [] nodes+nodeToPandoc n =  -- shouldn't happen+  Pandoc nullMeta $ foldr addBlock [] [n]++addBlocks :: [Node] -> [Block]+addBlocks = foldr addBlock []++addBlock :: Node -> [Block] -> [Block]+addBlock (Node _ PARAGRAPH nodes) =+  (Para (addInlines nodes) :)+addBlock (Node _ HRULE _) =+  (HorizontalRule :)+addBlock (Node _ BLOCK_QUOTE nodes) =+  (BlockQuote (addBlocks nodes) :)+addBlock (Node _ (HTML t) _) =+  (RawBlock (Format "html") (unpack t) :)+addBlock (Node _ (CODE_BLOCK info t) _) =+  (CodeBlock ("", take 1 (words (unpack info)), []) (unpack t) :)+addBlock (Node _ (HEADER lev) nodes) =+  (Header lev ("",[],[]) (addInlines nodes) :)+addBlock (Node _ (LIST listAttrs) nodes) =+  (constructor (map (setTightness . addBlocks . children) nodes) :)+  where constructor = case listType listAttrs of+                       BULLET_LIST  -> BulletList+                       ORDERED_LIST -> OrderedList+                                         (start, DefaultStyle, delim)+        start = listStart listAttrs+        setTightness = if listTight listAttrs+                           then map paraToPlain+                           else id+        paraToPlain (Para xs) = Plain (xs)+        paraToPlain x         = x+        delim = case listDelim listAttrs of+                     PERIOD_DELIM  -> Period+                     PAREN_DELIM   -> OneParen+addBlock (Node _ ITEM _) = id -- handled in LIST+addBlock _ = id++children :: Node -> [Node]+children (Node _ _ ns) = ns++addInlines :: [Node] -> [Inline]+addInlines = foldr addInline []++addInline :: Node -> [Inline] -> [Inline]+addInline (Node _ (TEXT t) _) = (map toinl clumps ++)+  where raw = unpack t+        clumps = groupBy samekind raw+        samekind ' ' ' ' = True+        samekind ' ' _   = False+        samekind _   ' ' = False+        samekind _  _    = True+        toinl (' ':_)    = Space+        toinl xs         = Str xs+addInline (Node _ LINEBREAK _) = (LineBreak :)+addInline (Node _ SOFTBREAK _) = (Space :)+addInline (Node _ (INLINE_HTML t) _) =+  (RawInline (Format "html") (unpack t) :)+addInline (Node _ (CODE t) _) =+  (Code ("",[],[]) (unpack t) :)+addInline (Node _ EMPH nodes) =+  (Emph (addInlines nodes) :)+addInline (Node _ STRONG nodes) =+  (Strong (addInlines nodes) :)+addInline (Node _ (LINK url title) nodes) =+  (Link (addInlines nodes) (unpack url, unpack title) :)+addInline (Node _ (IMAGE url title) nodes) =+  (Image (addInlines nodes) (unpack url, unpack title) :)+addInline _ = id
src/Text/Pandoc/Readers/DocBook.hs view
@@ -15,6 +15,9 @@ import Data.List (intersperse) import Data.Maybe (fromMaybe) import Text.TeXMath (readMathML, writeTeX)+import Text.Pandoc.Error (PandocError)+import Text.Pandoc.Compat.Except+import Data.Default  {- @@ -497,7 +500,7 @@ [x] ?asciidoc-br? - line break from asciidoc docbook output -} -type DB = State DBState+type DB = ExceptT PandocError (State DBState)  data DBState = DBState{ dbSectionLevel :: Int                       , dbQuoteType    :: QuoteType@@ -507,16 +510,18 @@                       , dbFigureTitle  :: Inlines                       } deriving Show -readDocBook :: ReaderOptions -> String -> Pandoc-readDocBook _ inp  = Pandoc (dbMeta st') (toList $ mconcat bs)-  where (bs, st') = runState (mapM parseBlock $ normalizeTree $ parseXML inp')-                             DBState{ dbSectionLevel = 0-                                    , dbQuoteType = DoubleQuote-                                    , dbMeta = mempty-                                    , dbAcceptsMeta = False-                                    , dbBook = False-                                    , dbFigureTitle = mempty-                                    }+instance Default DBState where+  def = DBState{ dbSectionLevel = 0+               , dbQuoteType = DoubleQuote+               , dbMeta = mempty+               , dbAcceptsMeta = False+               , dbBook = False+               , dbFigureTitle = mempty }+++readDocBook :: ReaderOptions -> String -> Either PandocError Pandoc+readDocBook _ inp  = (\blocks -> Pandoc (dbMeta st') (toList . mconcat $ blocks)) <$>  bs+  where (bs , st') = flip runState def . runExceptT . mapM parseBlock . normalizeTree . parseXML $ inp'         inp' = handleInstructions inp  -- We treat <?asciidoc-br?> specially (issue #1236), converting it@@ -863,7 +868,9 @@          parseRow = mapM (parseMixed plain . elContent) . filterChildren isEntry          sect n = do isbook <- gets dbBook                      let n' = if isbook || n == 0 then n + 1 else n-                     headerText <- case filterChild (named "title") e of+                     headerText <- case filterChild (named "title") e `mplus`+                                        (filterChild (named "info") e >>=+                                            filterChild (named "title")) of                                       Just t -> getInlines t                                       Nothing -> return mempty                      modify $ \st -> st{ dbSectionLevel = n }
src/Text/Pandoc/Readers/Docx.hs view
@@ -96,14 +96,17 @@ import Data.Sequence (ViewL(..), viewl) import qualified Data.Sequence as Seq (null) +import Text.Pandoc.Error+import Text.Pandoc.Compat.Except+ readDocx :: ReaderOptions          -> B.ByteString-         -> (Pandoc, MediaBag)+         -> Either PandocError (Pandoc, MediaBag) readDocx opts bytes =   case archiveToDocx (toArchive bytes) of-    Right docx -> (Pandoc meta blks, mediaBag) where-      (meta, blks, mediaBag) = (docxToOutput opts docx)-    Left _   -> error $ "couldn't parse docx file"+    Right docx -> (\(meta, blks, mediaBag) -> (Pandoc meta blks, mediaBag))+                    <$> (docxToOutput opts docx)+    Left _   -> Left (ParseFailure "couldn't parse docx file")  data DState = DState { docxAnchorMap :: M.Map String String                      , docxMediaBag      :: MediaBag@@ -122,10 +125,10 @@ instance Default DEnv where   def = DEnv def False -type DocxContext = ReaderT DEnv (State DState)+type DocxContext = ExceptT PandocError (ReaderT DEnv (State DState)) -evalDocxContext :: DocxContext a -> DEnv -> DState -> a-evalDocxContext ctx env st = evalState (runReaderT ctx env) st+evalDocxContext :: DocxContext a -> DEnv -> DState -> Either PandocError a+evalDocxContext ctx env st = flip evalState st . flip runReaderT env . runExceptT $ ctx  -- This is empty, but we put it in for future-proofing. spansToKeep :: [String]@@ -277,7 +280,13 @@ runToInlines (Run rs runElems)   | Just (s, _) <- rStyle rs   , s `elem` codeStyles =-    return $ code $ concatMap runElemToString runElems+    let rPr = resolveDependentRunStyle rs+        codeString = code $ concatMap runElemToString runElems+    in+     return $ case rVertAlign rPr of+     Just SupScrpt -> superscript codeString+     Just SubScrpt -> subscript codeString+     _             -> codeString   | otherwise = do     let ils = concatReduce (map runElemToInlines runElems)     return $ (runStyleToTransform $ resolveDependentRunStyle rs) ils@@ -397,7 +406,9 @@ singleParaToPlain blks = blks  cellToBlocks :: Cell -> DocxContext Blocks-cellToBlocks (Cell bps) = concatReduce <$> mapM bodyPartToBlocks bps+cellToBlocks (Cell bps) = do+  blks <- concatReduce <$> mapM bodyPartToBlocks bps+  return $ fromList $ blocksToDefinitions $ blocksToBullets $ toList blks  rowToBlocksList :: Row -> DocxContext [Blocks] rowToBlocksList (Row cells) = do@@ -543,7 +554,7 @@             blks',             mediaBag) -docxToOutput :: ReaderOptions -> Docx -> (Meta, [Block], MediaBag)+docxToOutput :: ReaderOptions -> Docx -> Either PandocError (Meta, [Block], MediaBag) docxToOutput opts (Docx (Document _ body)) =   let dEnv   = def { docxOptions  = opts} in    evalDocxContext (bodyToOutput body) dEnv def
src/Text/Pandoc/Readers/Docx/Parse.hs view
@@ -65,6 +65,7 @@ import Text.TeXMath.Readers.OMML (readOMML) import Text.Pandoc.Readers.Docx.Fonts (getUnicode, Font(..)) import Text.TeXMath (Exp)+import Text.Pandoc.Readers.Docx.Util import Data.Char (readLitChar, ord, chr, isDigit)  data ReaderEnv = ReaderEnv { envNotes         :: Notes@@ -108,8 +109,6 @@   in    concatMapM handler xs -type NameSpaces = [(String, String)]- data Docx = Docx Document           deriving Show @@ -158,6 +157,7 @@                                      , indentation :: Maybe ParIndentation                                      , dropCap     :: Bool                                      , pHeading    :: Maybe (String, Int)+                                     , pNumInfo    :: Maybe (String, String)                                      , pBlockQuote :: Maybe Bool                                      }                       deriving Show@@ -167,6 +167,7 @@                                        , indentation = Nothing                                        , dropCap     = False                                        , pHeading    = Nothing+                                       , pNumInfo    = Nothing                                        , pBlockQuote = Nothing                                        } @@ -224,6 +225,7 @@  data ParStyleData = ParStyleData { headingLev :: Maybe (String, Int)                                  , isBlockQuote :: Maybe Bool+                                 , numInfo :: Maybe (String, String)                                  , psStyle :: Maybe ParStyle}                     deriving Show @@ -246,10 +248,6 @@ type Author = String type ChangeDate = String -attrToNSPair :: Attr -> Maybe (String, String)-attrToNSPair (Attr (QName s _ (Just "xmlns")) val) = Just (s, val)-attrToNSPair _ = Nothing- archiveToDocx :: Archive -> Either DocxError Docx archiveToDocx archive = do   let notes     = archiveToNotes archive@@ -266,7 +264,7 @@ archiveToDocument zf = do   entry <- maybeToD $ findEntryByPath "word/document.xml" zf   docElem <- maybeToD $ (parseXMLDoc . UTF8.toStringLazy . fromEntry) entry-  let namespaces = mapMaybe attrToNSPair (elAttribs docElem)+  let namespaces = elemToNameSpaces docElem   bodyElem <- maybeToD $ findChild (elemName namespaces "w" "body") docElem   body <- elemToBody namespaces bodyElem   return $ Document namespaces body@@ -285,7 +283,7 @@    case stylesElem of      Nothing -> (M.empty, M.empty)      Just styElem ->-       let namespaces = mapMaybe attrToNSPair (elAttribs styElem)+       let namespaces = elemToNameSpaces styElem        in         ( M.fromList $ buildBasedOnList namespaces styElem             (Nothing :: Maybe CharStyle),@@ -353,10 +351,10 @@       enElem = findEntryByPath "word/endnotes.xml" zf                >>= (parseXMLDoc . UTF8.toStringLazy . fromEntry)       fn_namespaces = case fnElem of-        Just e -> mapMaybe attrToNSPair (elAttribs e)+        Just e -> elemToNameSpaces e         Nothing -> []       en_namespaces = case enElem of-        Just e -> mapMaybe attrToNSPair (elAttribs e)+        Just e -> elemToNameSpaces e         Nothing -> []       ns = unionBy (\x y -> fst x == fst y) fn_namespaces en_namespaces       fn = fnElem >>= (elemToNotes ns "footnote")@@ -456,7 +454,7 @@     Nothing -> Just $ Numbering [] [] []     Just entry -> do       numberingElem <- (parseXMLDoc . UTF8.toStringLazy . fromEntry) entry-      let namespaces = mapMaybe attrToNSPair (elAttribs numberingElem)+      let namespaces = elemToNameSpaces numberingElem           numElems = findChildren                      (QName "num" (lookup "w" namespaces) (Just "w"))                      numberingElem@@ -485,15 +483,6 @@ --------------------------------------------- --------------------------------------------- -elemName :: NameSpaces -> String -> String -> QName-elemName ns prefix name = (QName name (lookup prefix ns) (Just prefix))--isElem :: NameSpaces -> String -> String -> Element -> Bool-isElem ns prefix name element =-  qName (elName element) == name &&-  qURI (elName element) == (lookup prefix ns)-- elemToTblGrid :: NameSpaces -> Element -> D TblGrid elemToTblGrid ns element | isElem ns "w" "tblGrid" element =   let cols = findChildren (elemName ns "w" "gridCol") element@@ -546,20 +535,6 @@       stringToInteger} elemToParIndentation _ _ = Nothing --elemToNumInfo :: NameSpaces -> Element -> Maybe (String, String)-elemToNumInfo ns element  | isElem ns "w" "p" element = do-  let pPr = findChild (elemName ns "w" "pPr") element-      numPr = pPr >>= findChild (elemName ns "w" "numPr")-  lvl <- numPr >>=-         findChild (elemName ns "w" "ilvl") >>=-         findAttr (elemName ns "w" "val")-  numId <- numPr >>=-           findChild (elemName ns "w" "numId") >>=-           findAttr (elemName ns "w" "val")-  return (numId, lvl)-elemToNumInfo _ _ = Nothing- testBitMask :: String -> Int -> Bool testBitMask bitMaskS n =   case (reads ("0x" ++ bitMaskS) :: [(Int, String)]) of@@ -578,20 +553,28 @@         return $ OMathPara expsLst elemToBodyPart ns element   | isElem ns "w" "p" element-  , Just (numId, lvl) <- elemToNumInfo ns element = do+  , Just (numId, lvl) <- getNumInfo ns element = do     sty <- asks envParStyles     let parstyle = elemToParagraphStyle ns element sty     parparts <- mapD (elemToParPart ns) (elChildren element)     num <- asks envNumbering     case lookupLevel numId lvl num of-      Just levelInfo -> return $ ListItem parstyle numId lvl levelInfo parparts-      Nothing         -> throwError WrongElem+     Just levelInfo -> return $ ListItem parstyle numId lvl levelInfo parparts+     Nothing        -> throwError WrongElem elemToBodyPart ns element   | isElem ns "w" "p" element = do-    sty <- asks envParStyles-    let parstyle = elemToParagraphStyle ns element sty-    parparts <- mapD (elemToParPart ns) (elChildren element)-    return $ Paragraph parstyle parparts+      sty <- asks envParStyles+      let parstyle = elemToParagraphStyle ns element sty+      parparts <- mapD (elemToParPart ns) (elChildren element)+      case pNumInfo parstyle of+       Just (numId, lvl) -> do+         num <- asks envNumbering+         case lookupLevel numId lvl num of+          Just levelInfo ->+            return $ ListItem parstyle numId lvl levelInfo parparts+          Nothing         ->+            throwError WrongElem+       Nothing -> return $ Paragraph parstyle parparts elemToBodyPart ns element   | isElem ns "w" "tbl" element = do     let caption' = findChild (elemName ns "w" "tblPr") element@@ -639,7 +622,17 @@      case drawing of        Just s -> expandDrawingId s >>= (\(fp, bs) -> return $ Drawing fp bs)        Nothing -> throwError WrongElem+-- The below is an attempt to deal with images in deprecated vml format. elemToParPart ns element+  | isElem ns "w" "r" element+  , Just _ <- findChild (elemName ns "w" "pict") element =+    let drawing = findElement (elemName ns "v" "imagedata") element+                  >>= findAttr (elemName ns "r" "id")+    in+     case drawing of+       Just s -> expandDrawingId s >>= (\(fp, bs) -> return $ Drawing fp bs)+       Nothing -> throwError WrongElem+elemToParPart ns element   | isElem ns "w" "r" element =     elemToRun ns element >>= (\r -> return $ PlainRun r) elemToParPart ns element@@ -761,6 +754,7 @@             Just _      -> True             Nothing     -> False       , pHeading = getParStyleField headingLev sty style+      , pNumInfo = getParStyleField numInfo sty style       , pBlockQuote = getParStyleField isBlockQuote sty style       } elemToParagraphStyle _ _ _ =  defaultParagraphStyle@@ -847,12 +841,26 @@   , styleName `elem` blockQuoteStyleNames = Just True getBlockQuote _ _ = Nothing +getNumInfo :: NameSpaces -> Element -> Maybe (String, String)+getNumInfo ns element = do+  let numPr = findChild (elemName ns "w" "pPr") element >>=+              findChild (elemName ns "w" "numPr")+      lvl = fromMaybe "0" (numPr >>=+                           findChild (elemName ns "w" "ilvl") >>=+                           findAttr (elemName ns "w" "val"))+  numId <- numPr >>=+           findChild (elemName ns "w" "numId") >>=+           findAttr (elemName ns "w" "val")+  return (numId, lvl)++ elemToParStyleData :: NameSpaces -> Element -> Maybe ParStyle -> ParStyleData elemToParStyleData ns element parentStyle =     ParStyleData       {         headingLev = getHeaderLevel ns element       , isBlockQuote = getBlockQuote ns element+      , numInfo = getNumInfo ns element       , psStyle = parentStyle         } 
+ src/Text/Pandoc/Readers/Docx/StyleMap.hs view
@@ -0,0 +1,106 @@+module Text.Pandoc.Readers.Docx.StyleMap (  StyleMaps(..)+                                          , defaultStyleMaps+                                          , getStyleMaps+                                          , getStyleId+                                          , hasStyleName+                                          ) where++import           Text.XML.Light+import           Text.Pandoc.Readers.Docx.Util+import           Control.Monad.State+import           Data.Char  (toLower)+import qualified Data.Map                      as M++newtype ParaStyleMap = ParaStyleMap ( M.Map String String )+newtype CharStyleMap = CharStyleMap ( M.Map String String )++class StyleMap a where+  alterMap :: (M.Map String String -> M.Map String String) -> a -> a+  getMap :: a -> M.Map String String++instance StyleMap ParaStyleMap where+  alterMap f (ParaStyleMap m) = ParaStyleMap $ f m+  getMap (ParaStyleMap m) = m++instance StyleMap CharStyleMap where+  alterMap f (CharStyleMap m) = CharStyleMap $ f m+  getMap (CharStyleMap m) = m++insert :: (StyleMap a) => Maybe String -> Maybe String -> a -> a+insert (Just k) (Just v) m = alterMap (M.insert k v) m+insert _ _ m = m++getStyleId :: (StyleMap a) => String -> a -> String+getStyleId s = M.findWithDefault (filter (/=' ') s) (map toLower s) . getMap++hasStyleName :: (StyleMap a) => String -> a -> Bool+hasStyleName styleName = M.member (map toLower styleName) . getMap++data StyleMaps = StyleMaps { sNameSpaces   :: NameSpaces+                           , sParaStyleMap :: ParaStyleMap+                           , sCharStyleMap :: CharStyleMap+                           }++data StyleType = ParaStyle | CharStyle++defaultStyleMaps :: StyleMaps+defaultStyleMaps = StyleMaps { sNameSpaces = []+                             , sParaStyleMap = ParaStyleMap M.empty+                             , sCharStyleMap = CharStyleMap M.empty+                             }++type StateM a = State StyleMaps a++getStyleMaps :: Element -> StyleMaps+getStyleMaps docElem = execState genStyleMap state'+    where+    state' = defaultStyleMaps {sNameSpaces = elemToNameSpaces docElem}+    genStyleItem e = do+      styleType <- getStyleType e+      styleId <- getAttrStyleId e+      nameValLowercase <- fmap (map toLower) `fmap` getNameVal e+      case styleType of+        Just ParaStyle -> modParaStyleMap $ insert nameValLowercase styleId+        Just CharStyle -> modCharStyleMap $ insert nameValLowercase styleId+        _              -> return ()+    genStyleMap = do+      style <- elemName' "style"+      let styles = findChildren style docElem+      forM_ styles genStyleItem++modParaStyleMap :: (ParaStyleMap -> ParaStyleMap) -> StateM ()+modParaStyleMap f = modify $ \s ->+  s {sParaStyleMap = f $ sParaStyleMap s}++modCharStyleMap :: (CharStyleMap -> CharStyleMap) -> StateM ()+modCharStyleMap f = modify $ \s ->+  s {sCharStyleMap = f $ sCharStyleMap s}++getStyleType :: Element -> StateM (Maybe StyleType)+getStyleType e = do+  styleTypeStr <- getAttrType e+  case styleTypeStr of+    Just "paragraph" -> return $ Just ParaStyle+    Just "character" -> return $ Just CharStyle+    _                -> return   Nothing++getAttrType :: Element -> StateM (Maybe String)+getAttrType el = do+  name <- elemName' "type"+  return $ findAttr name el++getAttrStyleId :: Element -> StateM (Maybe String)+getAttrStyleId el = do+  name <- elemName' "styleId"+  return $ findAttr name el++getNameVal :: Element -> StateM (Maybe String)+getNameVal el = do+  name <- elemName' "name"+  val <- elemName' "val"+  return $ findChild name el >>= findAttr val++elemName' :: String -> StateM QName+elemName' name = do+  namespaces <- gets sNameSpaces+  return $ elemName namespaces "w" name
+ src/Text/Pandoc/Readers/Docx/Util.hs view
@@ -0,0 +1,26 @@+module Text.Pandoc.Readers.Docx.Util (+                                        NameSpaces+                                      , elemName+                                      , isElem+                                      , elemToNameSpaces+                                      ) where++import Text.XML.Light+import Data.Maybe (mapMaybe)++type NameSpaces = [(String, String)]++elemToNameSpaces :: Element -> NameSpaces+elemToNameSpaces = mapMaybe attrToNSPair . elAttribs++attrToNSPair :: Attr -> Maybe (String, String)+attrToNSPair (Attr (QName s _ (Just "xmlns")) val) = Just (s, val)+attrToNSPair _ = Nothing++elemName :: NameSpaces -> String -> String -> QName+elemName ns prefix name = QName name (lookup prefix ns) (Just prefix)++isElem :: NameSpaces -> String -> String -> Element -> Bool+isElem ns prefix name element =+  qName (elName element) == name &&+  qURI (elName element) == lookup prefix ns
src/Text/Pandoc/Readers/EPUB.hs view
@@ -35,18 +35,20 @@  import Debug.Trace (trace) +import Text.Pandoc.Error+ type Items = M.Map String (FilePath, MimeType) -readEPUB :: ReaderOptions -> BL.ByteString -> (Pandoc, MediaBag)+readEPUB :: ReaderOptions -> BL.ByteString -> Either PandocError (Pandoc, MediaBag) readEPUB opts bytes = runEPUB (archiveToEPUB opts $ toArchive bytes) -runEPUB :: Except String a -> a-runEPUB = either error id . runExcept+runEPUB :: Except PandocError a -> Either PandocError a+runEPUB = runExcept  -- Note that internal reference are aggresively normalised so that all ids -- are of the form "filename#id" ---archiveToEPUB :: (MonadError String m) => ReaderOptions -> Archive -> m (Pandoc, MediaBag)+archiveToEPUB :: (MonadError PandocError m) => ReaderOptions -> Archive -> m (Pandoc, MediaBag) archiveToEPUB os archive = do   -- root is path to folder with manifest file in   (root, content) <- getManifest archive@@ -64,19 +66,20 @@   return $ (ast, mediaBag)   where     os' = os {readerParseRaw = True}-    parseSpineElem :: MonadError String m => FilePath -> (FilePath, MimeType) -> m Pandoc+    parseSpineElem :: MonadError PandocError m => FilePath -> (FilePath, MimeType) -> m Pandoc     parseSpineElem (normalise -> r) (normalise -> path, mime) = do       when (readerTrace os) (traceM path)       doc <- mimeToReader mime r path       let docSpan = B.doc $ B.para $ B.spanWith (takeFileName path, [], []) mempty       return $ docSpan <> doc-    mimeToReader :: MonadError String m => MimeType -> FilePath -> FilePath -> m Pandoc+    mimeToReader :: MonadError PandocError m => MimeType -> FilePath -> FilePath -> m Pandoc     mimeToReader "application/xhtml+xml" (normalise -> root) (normalise -> path) = do       fname <- findEntryByPathE (root </> path) archive-      return $ fixInternalReferences path .+      html <- either throwError return .                 readHtml os' .                   UTF8.toStringLazy $                     fromEntry fname+      return $ fixInternalReferences path html     mimeToReader s _ path       | s `elem` imageMimes = return $ imageToPandoc path       | otherwise = return $ mempty@@ -114,7 +117,7 @@  type CoverImage = FilePath -parseManifest :: (MonadError String m) => Element -> m (Maybe CoverImage, Items)+parseManifest :: (MonadError PandocError m) => Element -> m (Maybe CoverImage, Items) parseManifest content = do   manifest <- findElementE (dfName "manifest") content   let items = findChildren (dfName "item") manifest@@ -130,7 +133,7 @@       mime <- findAttrE (emptyName "media-type") e       return (uid, (href, mime)) -parseSpine :: MonadError String m => Items -> Element -> m [(FilePath, MimeType)]+parseSpine :: MonadError PandocError m => Items -> Element -> m [(FilePath, MimeType)] parseSpine is e = do   spine <- findElementE (dfName "spine") e   let itemRefs = findChildren (dfName "itemref") spine@@ -141,7 +144,7 @@       guard linear       findAttr (emptyName "idref") ref -parseMeta :: MonadError String m => Element -> m Meta+parseMeta :: MonadError PandocError m => Element -> m Meta parseMeta content = do   meta <- findElementE (dfName "metadata") content   let dcspace (QName _ (Just "http://purl.org/dc/elements/1.1/") (Just "dc")) = True@@ -159,7 +162,7 @@ renameMeta "creator" = "author" renameMeta s = s -getManifest :: MonadError String m => Archive -> m (String, Element)+getManifest :: MonadError PandocError m => Archive -> m (String, Element) getManifest archive = do   metaEntry <- findEntryByPathE ("META-INF" </> "container.xml") archive   docElem <- (parseXMLDocE . UTF8.toStringLazy . fromEntry) metaEntry@@ -266,18 +269,18 @@  -- Convert Maybe interface to Either -findAttrE :: MonadError String m => QName -> Element -> m String+findAttrE :: MonadError PandocError m => QName -> Element -> m String findAttrE q e = mkE "findAttr" $ findAttr q e -findEntryByPathE :: MonadError String m => FilePath -> Archive -> m Entry+findEntryByPathE :: MonadError PandocError m => FilePath -> Archive -> m Entry findEntryByPathE (normalise -> path) a =   mkE ("No entry on path: " ++ path) $ findEntryByPath path a -parseXMLDocE :: MonadError String m => String -> m Element+parseXMLDocE :: MonadError PandocError m => String -> m Element parseXMLDocE doc = mkE "Unable to parse XML doc" $ parseXMLDoc doc -findElementE :: MonadError String m => QName -> Element -> m Element+findElementE :: MonadError PandocError m => QName -> Element -> m Element findElementE e x = mkE ("Unable to find element: " ++ show e) $ findElement e x -mkE :: MonadError String m => String -> Maybe a -> m a-mkE s = maybe (throwError s) return+mkE :: MonadError PandocError m => String -> Maybe a -> m a+mkE s = maybe (throwError . ParseFailure $ s) return
src/Text/Pandoc/Readers/HTML.hs view
@@ -1,6 +1,7 @@-{-# LANGUAGE FlexibleContexts, FlexibleInstances, MultiParamTypeClasses #-}+{-# LANGUAGE FlexibleContexts, FlexibleInstances, MultiParamTypeClasses,+ViewPatterns#-} {--Copyright (C) 2006-2014 John MacFarlane <jgm@berkeley.edu>+Copyright (C) 2006-2015 John MacFarlane <jgm@berkeley.edu>  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@@ -19,7 +20,7 @@  {- |    Module      : Text.Pandoc.Readers.HTML-   Copyright   : Copyright (C) 2006-2014 John MacFarlane+   Copyright   : Copyright (C) 2006-2015 John MacFarlane    License     : GNU GPL, version 2 or above     Maintainer  : John MacFarlane <jgm@berkeley.edu>@@ -43,14 +44,14 @@ import qualified Text.Pandoc.Builder as B import Text.Pandoc.Builder (Blocks, Inlines, trimInlines, HasMeta(..)) import Text.Pandoc.Shared ( extractSpaces, renderTags'-                          , escapeURI, safeRead )+                          , escapeURI, safeRead, mapLeft ) import Text.Pandoc.Options (ReaderOptions(readerParseRaw, readerTrace)                            , Extension (Ext_epub_html_exts,                                Ext_native_divs, Ext_native_spans)) import Text.Pandoc.Parsing hiding ((<|>)) import Text.Pandoc.Walk import Data.Maybe ( fromMaybe, isJust)-import Data.List ( intercalate, isInfixOf )+import Data.List ( intercalate, isInfixOf, isPrefixOf, isSuffixOf ) import Data.Char ( isDigit ) import Control.Monad ( liftM, guard, when, mzero, void, unless ) import Control.Arrow ((***))@@ -61,16 +62,20 @@ import Text.TeXMath (readMathML, writeTeX) import Data.Default (Default (..), def) import Control.Monad.Reader (Reader,ask, asks, local, runReader)+import Network.URI (isURI)+import Text.Pandoc.Error +import Text.Parsec.Error + -- | Convert HTML-formatted string to 'Pandoc' document. readHtml :: ReaderOptions -- ^ Reader options          -> String        -- ^ String to parse (assumes @'\n'@ line endings)-         -> Pandoc+         -> Either PandocError Pandoc readHtml opts inp =-  case flip runReader def $ runParserT parseDoc (HTMLState def{ stateOptions = opts } [])  "source" tags of-          Left err'    -> error $ "\nError at " ++ show  err'-          Right result -> result+    mapLeft (ParseFailure . getError) . flip runReader def $+      runParserT parseDoc (HTMLState def{ stateOptions = opts } [] Nothing)+             "source" tags     where tags = stripPrefixes . canonicalizeTags $                    parseTagsOptions parseOptions{ optTagPosition = True } inp           parseDoc = do@@ -78,6 +83,9 @@              meta <- stateMeta . parserState <$> getState              bs' <- replaceNotes (B.toList blocks)              return $ Pandoc meta bs'+          getError (errorMessages -> ms) = case ms of+                                                []    -> ""+                                                (m:_) -> messageString m  replaceNotes :: [Block] -> TagParser [Block] replaceNotes = walkM replaceNotes'@@ -91,7 +99,8 @@ data HTMLState =   HTMLState   {  parserState :: ParserState,-     noteTable   :: [(String, Blocks)]+     noteTable   :: [(String, Blocks)],+     baseHref    :: Maybe String   }  data HTMLLocal = HTMLLocal { quoteContext :: QuoteContext@@ -113,7 +122,7 @@ pBody = pInTags "body" block  pHead :: TagParser Blocks-pHead = pInTags "head" $ pTitle <|> pMetaTag <|> (mempty <$ pAnyTag)+pHead = pInTags "head" $ pTitle <|> pMetaTag <|> pBaseTag <|> (mempty <$ pAnyTag)   where pTitle = pInTags "title" inline >>= setTitle . trimInlines         setTitle t = mempty <$ (updateState $ B.setMeta "title" t)         pMetaTag = do@@ -125,6 +134,17 @@                let content = fromAttrib "content" mt                updateState $ B.setMeta name (B.text content)                return mempty+        pBaseTag = do+          bt <- pSatisfy (~== TagOpen "base" [])+          let baseH = fromAttrib "href" bt+          if null baseH+             then return mempty+             else do+               let baseH' = case reverse baseH of+                                  '/':_ -> baseH+                                  _     -> baseH ++ "/"+               updateState $ \st -> st{ baseHref = Just baseH' }+               return mempty  block :: TagParser Blocks block = do@@ -373,13 +393,21 @@   skipMany pBlank   caption <- option mempty $ pInTags "caption" inline <* skipMany pBlank   -- TODO actually read these and take width information from them-  widths' <- pColgroup <|> many pCol-  head' <- option [] $ pOptInTag "thead" $ pInTags "tr" (pCell "th")-  skipMany pBlank-  rows <- pOptInTag "tbody"-          $ many1 $ try $ skipMany pBlank >> pInTags "tr" (pCell "td")-  skipMany pBlank+  widths' <- (mconcat <$> many1 pColgroup) <|> many pCol+  let pTh = option [] $ pInTags "tr" (pCell "th")+      pTr = try $ skipMany pBlank >> pInTags "tr" (pCell "td" <|> pCell "th")+      pTBody = do pOptInTag "tbody" $ many1 pTr+  head'' <- pOptInTag "thead" pTh+  head'  <- pOptInTag "tbody" $ do+              if null head''+                 then pTh+                 else return head''+  rowsLs <- many pTBody+  rows'  <- pOptInTag "tfoot" $ many pTr   TagClose _ <- pSatisfy (~== TagClose "table")+  let rows = (concat rowsLs) ++ rows'+  -- fail on empty table+  guard $ not $ null head' && null rows   let isSinglePlain x = case B.toList x of                              [Plain _] -> True                              _         -> False@@ -551,7 +579,11 @@ pRelLink :: TagParser Inlines pRelLink = try $ do   tag <- pSatisfy (tagOpenLit "a" (isJust . lookup "href"))-  let url = fromAttrib "href" tag+  mbBaseHref <- baseHref <$> getState+  let url' = fromAttrib "href" tag+  let url = case (isURI url', mbBaseHref) of+                 (False, Just h) -> h ++ url'+                 _               -> url'   let title = fromAttrib "title" tag   let uid = fromAttrib "id" tag   let spanC = case uid of@@ -563,7 +595,11 @@ pImage :: TagParser Inlines pImage = do   tag <- pSelfClosing (=="img") (isJust . lookup "src")-  let url = fromAttrib "src" tag+  mbBaseHref <- baseHref <$> getState+  let url' = fromAttrib "src" tag+  let url = case (isURI url', mbBaseHref) of+                 (False, Just h) -> h ++ url'+                 _               -> url'   let title = fromAttrib "title" tag   let alt = fromAttrib "alt" tag   return $ B.image (escapeURI url) title (B.text alt)@@ -624,14 +660,17 @@   pSatisfy (~== TagOpen tagtype [])   mconcat <$> manyTill parser (pCloses tagtype <|> eof) -pOptInTag :: String -> TagParser a-          -> TagParser a-pOptInTag tagtype parser = try $ do-  open <- option False (pSatisfy (~== TagOpen tagtype []) >> return True)+-- parses p, preceeded by an optional opening tag+-- and followed by an optional closing tags+pOptInTag :: String -> TagParser a -> TagParser a+pOptInTag tagtype p = try $ do   skipMany pBlank-  x <- parser+  optional $ pSatisfy (~== TagOpen tagtype [])   skipMany pBlank-  when open $ pCloses tagtype+  x <- p+  skipMany pBlank+  optional $ pSatisfy (~== TagClose tagtype)+  skipMany pBlank   return x  pCloses :: String -> TagParser ()@@ -856,7 +895,7 @@                -> ParserT String st m String htmlInBalanced f = try $ do   (TagOpen t _, tag) <- htmlTag f-  guard $ '/' `notElem` tag      -- not a self-closing tag+  guard $ not $ "/>" `isSuffixOf` tag -- not a self-closing tag   let stopper = htmlTag (~== TagClose t)   let anytag = snd <$> htmlTag (const True)   contents <- many $ notFollowedBy' stopper >>@@ -869,16 +908,18 @@         => (Tag String -> Bool)         -> ParserT [Char] st m (Tag String, String) htmlTag f = try $ do-  lookAhead $ char '<' >> (oneOf "/!?" <|> letter)-  (next : _) <- getInput >>= return . canonicalizeTags . parseTags+  lookAhead (char '<')+  inp <- getInput+  let (next : _) = canonicalizeTags $ parseTags inp   guard $ f next-  -- advance the parser   case next of-       TagComment s -> do+       TagComment s+         | "<!--" `isPrefixOf` inp -> do           count (length s + 4) anyChar           skipMany (satisfy (/='>'))           char '>'           return (next, "<!--" ++ s ++ "-->")+         | otherwise -> fail "bogus comment mode, HTML5 parse error"        _            -> do           rendered <- manyTill anyChar (char '>')           return (next, rendered ++ ">")@@ -925,7 +966,7 @@     extractReaderOptions = extractReaderOptions . parserState  instance Default HTMLState where-  def = HTMLState def []+  def = HTMLState def [] Nothing  instance HasMeta HTMLState where   setMeta s b st = st {parserState = setMeta s b $ parserState st}
src/Text/Pandoc/Readers/Haddock.hs view
@@ -26,15 +26,17 @@ import Documentation.Haddock.Types import Debug.Trace (trace) +import Text.Pandoc.Error+ -- | Parse Haddock markup and return a 'Pandoc' document. readHaddock :: ReaderOptions -- ^ Reader options             -> String        -- ^ String to parse-            -> Pandoc+            -> Either PandocError Pandoc readHaddock opts = #if MIN_VERSION_haddock_library(1,2,0)-  B.doc . docHToBlocks . trace' . _doc . parseParas+  Right . B.doc . docHToBlocks . trace' . _doc . parseParas #else-  B.doc . docHToBlocks . trace' . parseParas+  Right .  B.doc . docHToBlocks . trace' . parseParas #endif   where trace' x = if readerTrace opts                       then trace (show x) x
src/Text/Pandoc/Readers/LaTeX.hs view
@@ -1,6 +1,6 @@ {-# LANGUAGE ScopedTypeVariables, OverloadedStrings #-} {--Copyright (C) 2006-2014 John MacFarlane <jgm@berkeley.edu>+Copyright (C) 2006-2015 John MacFarlane <jgm@berkeley.edu>  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@@ -19,7 +19,7 @@  {- |    Module      : Text.Pandoc.Readers.LaTeX-   Copyright   : Copyright (C) 2006-2014 John MacFarlane+   Copyright   : Copyright (C) 2006-2015 John MacFarlane    License     : GNU GPL, version 2 or above     Maintainer  : John MacFarlane <jgm@berkeley.edu>@@ -42,26 +42,25 @@ import Text.Pandoc.Parsing hiding ((<|>), many, optional, space,                                    mathDisplay, mathInline) import qualified Text.Pandoc.UTF8 as UTF8-import Data.Char ( chr, ord )+import Data.Char ( chr, ord, isLetter, isAlphaNum ) import Control.Monad.Trans (lift) import Control.Monad import Text.Pandoc.Builder-import Data.Char (isLetter, isAlphaNum) import Control.Applicative import Data.Monoid-import Data.Maybe (fromMaybe)+import Data.Maybe (fromMaybe, maybeToList) import System.Environment (getEnv)-import System.FilePath (replaceExtension, (</>))-import Data.List (intercalate, intersperse)+import System.FilePath (replaceExtension, (</>), takeExtension, addExtension)+import Data.List (intercalate) import qualified Data.Map as M import qualified Control.Exception as E-import System.FilePath (takeExtension, addExtension) import Text.Pandoc.Highlighting (fromListingsLanguage)+import Text.Pandoc.Error  -- | Parse LaTeX from string and return 'Pandoc' document. readLaTeX :: ReaderOptions -- ^ Reader options           -> String        -- ^ String to parse (assumes @'\n'@ line endings)-          -> Pandoc+          -> Either PandocError Pandoc readLaTeX opts = readWith parseLaTeX def{ stateOptions = opts }  parseLaTeX :: LP Pandoc@@ -73,17 +72,16 @@   let (Pandoc _ bs') = doc bs   return $ Pandoc meta bs' -type LP = Parser [Char] ParserState+type LP = Parser String ParserState  anyControlSeq :: LP String anyControlSeq = do   char '\\'   next <- option '\n' anyChar-  name <- case next of-               '\n'           -> return ""-               c | isLetter c -> (c:) <$> (many letter <* optional sp)-                 | otherwise  -> return [c]-  return name+  case next of+       '\n'           -> return ""+       c | isLetter c -> (c:) <$> (many letter <* optional sp)+         | otherwise  -> return [c]  controlSeq :: String -> LP String controlSeq name = try $ do@@ -103,7 +101,7 @@  sp :: LP () sp = skipMany1 $ satisfy (\c -> c == ' ' || c == '\t')-        <|> (try $ newline <* lookAhead anyChar <* notFollowedBy blankline)+        <|> try (newline <* lookAhead anyChar <* notFollowedBy blankline)  isLowerHex :: Char -> Bool isLowerHex x = x >= '0' && x <= '9' || x >= 'a' && x <= 'f'@@ -161,30 +159,28 @@ mathInline p = math <$> (try p >>= applyMacros')  mathChars :: LP String-mathChars = concat <$>-  many (   many1 (satisfy (\c -> c /= '$' && c /='\\'))-      <|> (\c -> ['\\',c]) <$> (try $ char '\\' *> anyChar)-       )+mathChars = (concat <$>) $+  many $+          many1 (satisfy (\c -> c /= '$' && c /='\\'))+      <|> (\c -> ['\\',c]) <$> try (char '\\' *> anyChar)  quoted' :: (Inlines -> Inlines) -> LP String -> LP () -> LP Inlines quoted' f starter ender = do   startchs <- starter   try ((f . mconcat) <$> manyTill inline ender) <|> lit startchs -double_quote :: LP Inlines-double_quote =-  (   quoted' doubleQuoted (try $ string "``") (void $ try $ string "''")+doubleQuote :: LP Inlines+doubleQuote =+      quoted' doubleQuoted (try $ string "``") (void $ try $ string "''")   <|> quoted' doubleQuoted (string "“")        (void $ char '”')   -- the following is used by babel for localized quotes:   <|> quoted' doubleQuoted (try $ string "\"`") (void $ try $ string "\"'")   <|> quoted' doubleQuoted (string "\"")       (void $ char '"')-  ) -single_quote :: LP Inlines-single_quote =-  (  quoted' singleQuoted (string "`") (try $ char '\'' >> notFollowedBy letter)+singleQuote :: LP Inlines+singleQuote =+      quoted' singleQuoted (string "`") (try $ char '\'' >> notFollowedBy letter)   <|> quoted' singleQuoted (string "‘") (try $ char '’' >> notFollowedBy letter)-  )  inline :: LP Inlines inline = (mempty <$ comment)@@ -194,17 +190,17 @@      <|> inlineEnvironment      <|> inlineGroup      <|> (char '-' *> option (str "-")-           ((char '-') *> option (str "–") (str "—" <$ char '-')))-     <|> double_quote-     <|> single_quote+           (char '-' *> option (str "–") (str "—" <$ char '-')))+     <|> doubleQuote+     <|> singleQuote      <|> (str "”" <$ try (string "''"))      <|> (str "”" <$ char '”')      <|> (str "’" <$ char '\'')      <|> (str "’" <$ char '’')      <|> (str "\160" <$ char '~')-     <|> (mathDisplay $ string "$$" *> mathChars <* string "$$")-     <|> (mathInline  $ char '$' *> mathChars <* char '$')-     <|> (superscript <$> (char '^' *> tok))+     <|> mathDisplay (string "$$" *> mathChars <* string "$$")+     <|> mathInline  (char '$' *> mathChars <* char '$')+     <|> try (superscript <$> (char '^' *> tok))      <|> (subscript <$> (char '_' *> tok))      <|> (guardEnabled Ext_literate_haskell *> char '|' *> doLHSverb)      <|> (str . (:[]) <$> tildeEscape)@@ -238,20 +234,32 @@ blocks :: LP Blocks blocks = mconcat <$> many block +getRawCommand :: String -> LP String+getRawCommand name' = do+  rawargs <- withRaw (skipopts *> option "" dimenarg *> many braced)+  return $ '\\' : name' ++ snd rawargs++lookupListDefault :: (Ord k) => v -> [k] -> M.Map k v -> v+lookupListDefault d = (fromMaybe d .) . lookupList+  where+  lookupList l m = msum $ map (`M.lookup` m) l+ blockCommand :: LP Blocks blockCommand = try $ do   name <- anyControlSeq   guard $ name /= "begin" && name /= "end"   star <- option "" (string "*" <* optional sp)   let name' = name ++ star-  case M.lookup name' blockCommands of-       Just p      -> p-       Nothing     -> case M.lookup name blockCommands of-                           Just p    -> p-                           Nothing   -> mzero+  let raw = do+        rawcommand <- getRawCommand name'+        transformed <- applyMacros' rawcommand+        guard $ transformed /= rawcommand+        notFollowedBy $ parseFromString inlines transformed+        parseFromString blocks transformed+  lookupListDefault raw [name',name] blockCommands  inBrackets :: Inlines -> Inlines-inBrackets x = (str "[") <> x <> (str "]")+inBrackets x = str "[" <> x <> str "]"  -- eat an optional argument and one or more arguments in braces ignoreInlines :: String -> (String, LP Inlines)@@ -259,19 +267,21 @@   where optargs = skipopts *> skipMany (try $ optional sp *> braced)         contseq = '\\':name         doraw = (rawInline "latex" . (contseq ++) . snd) <$>-                 (getOption readerParseRaw >>= guard >> (withRaw optargs))+                 (getOption readerParseRaw >>= guard >> withRaw optargs)  ignoreBlocks :: String -> (String, LP Blocks) ignoreBlocks name = (name, doraw <|> (mempty <$ optargs))   where optargs = skipopts *> skipMany (try $ optional sp *> braced)         contseq = '\\':name         doraw = (rawBlock "latex" . (contseq ++) . snd) <$>-                 (getOption readerParseRaw >>= guard >> (withRaw optargs))+                 (getOption readerParseRaw >>= guard >> withRaw optargs)  blockCommands :: M.Map String (LP Blocks) blockCommands = M.fromList $   [ ("par", mempty <$ skipopts)-  , ("title", mempty <$ (skipopts *> tok >>= addMeta "title"))+  , ("title", mempty <$ (skipopts *>+                          (grouped inline >>= addMeta "title")+                      <|> (grouped block >>= addMeta "title")))   , ("subtitle", mempty <$ (skipopts *> tok >>= addMeta "subtitle"))   , ("author", mempty <$ (skipopts *> authors))   -- -- in letter class, temp. store address & sig as title, author@@ -302,7 +312,7 @@   --   , ("hrule", pure horizontalRule)   , ("rule", skipopts *> tok *> tok *> pure horizontalRule)-  , ("item", skipopts *> loose_item)+  , ("item", skipopts *> looseItem)   , ("documentclass", skipopts *> braced *> preamble)   , ("centerline", (para . trimInlines) <$> (skipopts *> tok))   , ("caption", skipopts *> setCaption)@@ -328,6 +338,7 @@   , "hyperdef"   , "markboth", "markright", "markleft"   , "hspace", "vspace"+  , "newpage"   ]  addMeta :: ToMetaValue a => String -> a -> LP ()@@ -341,7 +352,7 @@ setCaption = do   ils <- tok   mblabel <- option Nothing $-               try $ spaces >> controlSeq "label" >> (Just <$> tok)+               try $ spaces' >> controlSeq "label" >> (Just <$> tok)   let ils' = case mblabel of                   Just lab -> ils <> spanWith                                 ("",[],[("data-label", stringify lab)]) mempty@@ -369,7 +380,7 @@   let lvl' = if hasChapters then lvl + 1 else lvl   skipopts   contents <- grouped inline-  lab <- option ident $ try (spaces >> controlSeq "label" >> spaces >> braced)+  lab <- option ident $ try (spaces' >> controlSeq "label" >> spaces' >> braced)   attr' <- registerHeader (lab, classes, kvs) contents   return $ headerWith attr' lvl' contents @@ -382,25 +393,21 @@   star <- option "" (string "*")   let name' = name ++ star   let raw = do-        rawargs <- withRaw (skipopts *> option "" dimenarg *> many braced)-        let rawcommand = '\\' : name ++ star ++ snd rawargs+        rawcommand <- getRawCommand name'         transformed <- applyMacros' rawcommand         if transformed /= rawcommand            then parseFromString inlines transformed            else if parseRaw                    then return $ rawInline "latex" rawcommand                    else return mempty-  case M.lookup name' inlineCommands of-       Just p      -> p <|> raw-       Nothing     -> case M.lookup name inlineCommands of-                           Just p    -> p <|> raw-                           Nothing   -> raw+  lookupListDefault mzero [name',name] inlineCommands+    <|> raw  unlessParseRaw :: LP () unlessParseRaw = getOption readerParseRaw >>= guard . not  isBlockCommand :: String -> Bool-isBlockCommand s = maybe False (const True) $ M.lookup s blockCommands+isBlockCommand s = s `M.member` blockCommands   inlineEnvironments :: M.Map String (LP Inlines)@@ -446,7 +453,7 @@   , ("cref", unlessParseRaw >> (inBrackets <$> tok))  -- from cleveref.sty   , ("(", mathInline $ manyTill anyChar (try $ string "\\)"))   , ("[", mathDisplay $ manyTill anyChar (try $ string "\\]"))-  , ("ensuremath", mathInline $ braced)+  , ("ensuremath", mathInline braced)   , ("texorpdfstring", (\_ x -> x) <$> tok <*> tok)   , ("P", lit "¶")   , ("S", lit "§")@@ -495,7 +502,7 @@   , ("v", option (str "v") $ try $ tok >>= accent hacek)   , ("u", option (str "u") $ try $ tok >>= accent breve)   , ("i", lit "i")-  , ("\\", linebreak <$ (optional (bracketed inline) *> optional sp))+  , ("\\", linebreak <$ (optional (bracketed inline) *> spaces'))   , (",", pure mempty)   , ("@", pure mempty)   , (" ", lit "\160")@@ -508,7 +515,7 @@   , ("thanks", (note . mconcat) <$> (char '{' *> manyTill block (char '}')))   , ("footnote", (note . mconcat) <$> (char '{' *> manyTill block (char '}')))   , ("verb", doverb)-  , ("lstinline", doverb)+  , ("lstinline", skipopts *> doverb)   , ("Verb", doverb)   , ("texttt", (code . stringify . toList) <$> tok)   , ("url", (unescapeURL <$> braced) >>= \url ->@@ -618,7 +625,7 @@ accent :: (Char -> String) -> Inlines -> LP Inlines accent f ils =   case toList ils of-       (Str (x:xs) : ys) -> return $ fromList $ (Str (f x ++ xs) : ys)+       (Str (x:xs) : ys) -> return $ fromList (Str (f x ++ xs) : ys)        []                -> mzero        _                 -> return ils @@ -807,7 +814,7 @@ breve c   = [c]  tok :: LP Inlines-tok = try $ grouped inline <|> inlineCommand <|> str <$> (count 1 $ inlineChar)+tok = try $ grouped inline <|> inlineCommand <|> str <$> count 1 inlineChar  opt :: LP Inlines opt = bracketed inline <* optional sp@@ -825,17 +832,14 @@ environment = do   controlSeq "begin"   name <- braced-  case M.lookup name environments of-       Just p      -> p <|> rawEnv name-       Nothing     -> rawEnv name+  M.findWithDefault mzero name environments+    <|> rawEnv name  inlineEnvironment :: LP Inlines inlineEnvironment = try $ do   controlSeq "begin"   name <- braced-  case M.lookup name inlineEnvironments of-       Just p      -> p-       Nothing     -> mzero+  M.findWithDefault mzero name inlineEnvironments  rawEnv :: String -> LP Blocks rawEnv name = do@@ -848,15 +852,11 @@  ---- -type IncludeParser = ParserT [Char] [String] IO String+type IncludeParser = ParserT String [String] IO String  -- | Replace "include" commands with file contents.-handleIncludes :: String -> IO String-handleIncludes s = do-  res <- runParserT includeParser' [] "input" s-  case res of-       Right s'    -> return s'-       Left e      -> error $ show e+handleIncludes :: String -> IO (Either PandocError String)+handleIncludes s =  mapLeft (ParsecError s) <$> runParserT includeParser' [] "input" s  includeParser' :: IncludeParser includeParser' =@@ -898,6 +898,12 @@ braced' :: IncludeParser braced' = try $ char '{' *> manyTill (satisfy (/='}')) (char '}') +maybeAddExtension :: String -> FilePath -> FilePath+maybeAddExtension ext fp =+  if null (takeExtension fp)+     then addExtension fp ext+     else fp+ include' :: IncludeParser include' = do   fs' <- try $ do@@ -906,11 +912,11 @@                   <|> try (string "input")                   <|> string "usepackage"               -- skip options-              skipMany $ try $ char '[' *> (manyTill anyChar (char ']'))+              skipMany $ try $ char '[' *> manyTill anyChar (char ']')               fs <- (map trim . splitBy (==',')) <$> braced'               return $ if name == "usepackage"-                          then map (flip replaceExtension ".sty") fs-                          else map (flip replaceExtension ".tex") fs+                          then map (maybeAddExtension ".sty") fs+                          else map (maybeAddExtension ".tex") fs   pos <- getPosition   containers <- getState   let fn = case containers of@@ -979,14 +985,14 @@ alltt :: String -> LP Blocks alltt t = walk strToCode <$> parseFromString blocks   (substitute " " "\\ " $ substitute "%" "\\%" $-   concat $ intersperse "\\\\\n" $ lines t)+   intercalate "\\\\\n" $ lines t)   where strToCode (Str s) = Code nullAttr s         strToCode x       = x -rawLaTeXBlock :: Parser [Char] ParserState String+rawLaTeXBlock :: LP String rawLaTeXBlock = snd <$> try (withRaw (environment <|> blockCommand)) -rawLaTeXInline :: Parser [Char] ParserState Inline+rawLaTeXInline :: LP Inline rawLaTeXInline = do   raw <- (snd <$> withRaw inlineCommand) <|> (snd <$> withRaw blockCommand)   RawInline "latex" <$> applyMacros' raw@@ -995,41 +1001,42 @@ addImageCaption = walkM go   where go (Image alt (src,tit)) = do           mbcapt <- stateCaption <$> getState-          case mbcapt of-               Just ils -> return (Image (toList ils) (src, "fig:"))-               Nothing  -> return (Image alt (src,tit))+          return $ case mbcapt of+               Just ils -> Image (toList ils) (src, "fig:")+               Nothing  -> Image alt (src,tit)         go x = return x  addTableCaption :: Blocks -> LP Blocks addTableCaption = walkM go   where go (Table c als ws hs rs) = do           mbcapt <- stateCaption <$> getState-          case mbcapt of-               Just ils -> return (Table (toList ils) als ws hs rs)-               Nothing  -> return (Table c als ws hs rs)+          return $ case mbcapt of+               Just ils -> Table (toList ils) als ws hs rs+               Nothing  -> Table c als ws hs rs         go x = return x  environments :: M.Map String (LP Blocks) environments = M.fromList   [ ("document", env "document" blocks <* skipMany anyChar)-  , ("letter", env "letter" letter_contents)+  , ("letter", env "letter" letterContents)   , ("figure", env "figure" $          resetCaption *> skipopts *> blocks >>= addImageCaption)   , ("center", env "center" blocks)   , ("table",  env "table" $          resetCaption *> skipopts *> blocks >>= addTableCaption)-  , ("tabular", env "tabular" simpTable)+  , ("tabular*", env "tabular" $ simpTable True)+  , ("tabular", env "tabular"  $ simpTable False)   , ("quote", blockQuote <$> env "quote" blocks)   , ("quotation", blockQuote <$> env "quotation" blocks)   , ("verse", blockQuote <$> env "verse" blocks)   , ("itemize", bulletList <$> listenv "itemize" (many item))   , ("description", definitionList <$> listenv "description" (many descItem))-  , ("enumerate", ordered_list)+  , ("enumerate", orderedList')   , ("alltt", alltt =<< verbEnv "alltt")   , ("code", guardEnabled Ext_literate_haskell *>       (codeBlockWith ("",["sourceCode","literate","haskell"],[]) <$>         verbEnv "code"))-  , ("verbatim", codeBlock <$> (verbEnv "verbatim"))+  , ("verbatim", codeBlock <$> verbEnv "verbatim")   , ("Verbatim",   do options <- option [] keyvals                       let kvs = [ (if k == "firstnumber"                                       then "startFrom"@@ -1037,17 +1044,17 @@                       let classes = [ "numberLines" |                                       lookup "numbers" options == Just "left" ]                       let attr = ("",classes,kvs)-                      codeBlockWith attr <$> (verbEnv "Verbatim"))+                      codeBlockWith attr <$> verbEnv "Verbatim")   , ("lstlisting", do options <- option [] keyvals                       let kvs = [ (if k == "firstnumber"                                       then "startFrom"                                       else k, v) | (k,v) <- options ]                       let classes = [ "numberLines" |                                       lookup "numbers" options == Just "left" ]-                                 ++ maybe [] (:[]) (lookup "language" options+                                 ++ maybeToList (lookup "language" options                                          >>= fromListingsLanguage)                       let attr = (fromMaybe "" (lookup "label" options),classes,kvs)-                      codeBlockWith attr <$> (verbEnv "lstlisting"))+                      codeBlockWith attr <$> verbEnv "lstlisting")   , ("minted",     do options <- option [] keyvals                       lang <- grouped (many1 $ satisfy (/='}'))                       let kvs = [ (if k == "firstnumber"@@ -1057,7 +1064,7 @@                                     [ "numberLines" |                                       lookup "linenos" options == Just "true" ]                       let attr = ("",classes,kvs)-                      codeBlockWith attr <$> (verbEnv "minted"))+                      codeBlockWith attr <$> verbEnv "minted")   , ("obeylines", parseFromString                   (para . trimInlines . mconcat <$> many inline) =<<                   intercalate "\\\\\n" . lines <$> verbEnv "obeylines")@@ -1076,8 +1083,8 @@   , ("alignat*", mathEnv para (Just "aligned") "alignat*")   ] -letter_contents :: LP Blocks-letter_contents = do+letterContents :: LP Blocks+letterContents = do   bs <- blocks   st <- getState   -- add signature (author) and address (title)@@ -1104,8 +1111,8 @@ item :: LP Blocks item = blocks *> controlSeq "item" *> skipopts *> blocks -loose_item :: LP Blocks-loose_item = do+looseItem :: LP Blocks+looseItem = do   ctx <- stateParserContext `fmap` getState   if ctx == ListItemState      then mzero@@ -1148,8 +1155,8 @@   res <- manyTill anyChar endEnv   return $ stripTrailingNewlines res -ordered_list :: LP Blocks-ordered_list = do+orderedList' :: LP Blocks+orderedList' = do   optional sp   (_, style, delim) <- option (1, DefaultStyle, DefaultDelim) $                               try $ char '[' *> anyOrderedListMarker <* char ']'@@ -1161,7 +1168,7 @@                                optional sp                                num <- grouped (many1 digit)                                spaces-                               return $ (read num + 1 :: Int)+                               return (read num + 1 :: Int)   bs <- listenv "enumerate" (many item)   return $ orderedListWith (start, style, delim) bs @@ -1175,14 +1182,14 @@ preamble :: LP Blocks preamble = mempty <$> manyTill preambleBlock beginDoc   where beginDoc = lookAhead $ try $ controlSeq "begin" *> string "{document}"-        preambleBlock =  (void comment)-                     <|> (void sp)-                     <|> (void blanklines)-                     <|> (void macro)-                     <|> (void blockCommand)-                     <|> (void anyControlSeq)-                     <|> (void braced)-                     <|> (void anyChar)+        preambleBlock =  void comment+                     <|> void sp+                     <|> void blanklines+                     <|> void macro+                     <|> void blockCommand+                     <|> void anyControlSeq+                     <|> void braced+                     <|> void anyChar  ------- @@ -1258,7 +1265,7 @@                    suff  <- ils                    skipSpaces                    optional $ char ';'-                   return $ addPrefix pref $ addSuffix suff $ cits'+                   return $ addPrefix pref $ addSuffix suff cits'   (c:cits, raw) <- withRaw $ grouped parseOne   return $ cite (c{ citationMode = mode }:cits)            (rawInline "latex" $ "\\citetext" ++ raw)@@ -1268,7 +1275,7 @@ parseAligns :: LP [Alignment] parseAligns = try $ do   char '{'-  let maybeBar = skipMany $ sp <|> () <$ char '|' <|> () <$ try (string "@{}")+  let maybeBar = skipMany $ sp <|> () <$ char '|' <|> () <$ (char '@' >> braced)   maybeBar   let cAlign = AlignCenter <$ char 'c'   let lAlign = AlignLeft <$ char 'l'@@ -1282,13 +1289,13 @@   return aligns'  hline :: LP ()-hline = () <$ (try $ spaces >> controlSeq "hline")+hline = () <$ try (spaces' *> controlSeq "hline" <* spaces')  lbreak :: LP ()-lbreak = () <$ (try $ spaces *> controlSeq "\\")+lbreak = () <$ try (spaces' *> controlSeq "\\" <* spaces')  amp :: LP ()-amp = () <$ (try $ spaces *> char '&')+amp = () <$ try (spaces' *> char '&')  parseTableRow :: Int  -- ^ number of columns               -> LP [Blocks]@@ -1301,19 +1308,22 @@   guard $ cells' /= [mempty]   -- note:  a & b in a three-column table leaves an empty 3rd cell:   let cells'' = cells' ++ replicate (cols - numcells) mempty-  spaces+  spaces'   return cells'' -simpTable :: LP Blocks-simpTable = try $ do-  spaces+spaces' :: LP ()+spaces' = spaces *> skipMany (comment *> spaces)++simpTable :: Bool -> LP Blocks+simpTable hasWidthParameter = try $ do+  when hasWidthParameter $ () <$ (spaces' >> tok)+  skipopts   aligns <- parseAligns   let cols = length aligns   optional hline   header' <- option [] $ try (parseTableRow cols <* lbreak <* hline)   rows <- sepEndBy (parseTableRow cols) (lbreak <* optional hline)-  spaces-  skipMany (comment *> spaces)+  spaces'   let header'' = if null header'                     then replicate cols mempty                     else header'
src/Text/Pandoc/Readers/Markdown.hs view
@@ -1,6 +1,7 @@ {-# LANGUAGE RelaxedPolyRec #-} -- needed for inlinesBetween on GHC < 7+{-# LANGUAGE ScopedTypeVariables #-} {--Copyright (C) 2006-2014 John MacFarlane <jgm@berkeley.edu>+Copyright (C) 2006-2015 John MacFarlane <jgm@berkeley.edu>  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@@ -19,7 +20,7 @@  {- |    Module      : Text.Pandoc.Readers.Markdown-   Copyright   : Copyright (C) 2006-2014 John MacFarlane+   Copyright   : Copyright (C) 2006-2015 John MacFarlane    License     : GNU GPL, version 2 or above     Maintainer  : John MacFarlane <jgm@berkeley.edu>@@ -35,7 +36,7 @@ import qualified Data.Map as M import Data.Scientific (coefficient, base10Exponent) import Data.Ord ( comparing )-import Data.Char ( isAlphaNum, toLower )+import Data.Char ( isSpace, isAlphaNum, toLower ) import Data.Maybe import Text.Pandoc.Definition import qualified Data.Text as T@@ -55,7 +56,7 @@ import Text.Pandoc.Readers.HTML ( htmlTag, htmlInBalanced, isInlineTag, isBlockTag,                                   isTextTag, isCommentTag ) import Data.Monoid (mconcat, mempty)-import Control.Applicative ((<$>), (<*), (*>), (<$))+import Control.Applicative ((<$>), (<*), (*>), (<$), (<*>)) import Control.Monad import System.FilePath (takeExtension, addExtension) import Text.HTML.TagSoup@@ -63,13 +64,14 @@ import qualified Data.Set as Set import Text.Printf (printf) import Debug.Trace (trace)+import Text.Pandoc.Error  type MarkdownParser = Parser [Char] ParserState  -- | Read markdown from an input string and return a Pandoc document. readMarkdown :: ReaderOptions -- ^ Reader options              -> String        -- ^ String to parse (assuming @'\n'@ line endings)-             -> Pandoc+             -> Either PandocError Pandoc readMarkdown opts s =   (readWith parseMarkdown) def{ stateOptions = opts } (s ++ "\n\n") @@ -77,7 +79,7 @@ -- and a list of warnings. readMarkdownWithWarnings :: ReaderOptions -- ^ Reader options                          -> String        -- ^ String to parse (assuming @'\n'@ line endings)-                         -> (Pandoc, [String])+                         -> Either PandocError (Pandoc, [String]) readMarkdownWithWarnings opts s =     (readWithWarnings parseMarkdown) def{ stateOptions = opts } (s ++ "\n\n") @@ -163,20 +165,24 @@ -- | Parse a sequence of inline elements between square brackets, -- including inlines between balanced pairs of square brackets. inlinesInBalancedBrackets :: MarkdownParser (F Inlines)-inlinesInBalancedBrackets = charsInBalancedBrackets >>=-  parseFromString (trimInlinesF . mconcat <$> many inline)--charsInBalancedBrackets :: MarkdownParser [Char]-charsInBalancedBrackets = do+inlinesInBalancedBrackets = do   char '['-  result <- manyTill (  many1 (noneOf "`[]\n")-                    <|> (snd <$> withRaw code)-                    <|> ((\xs -> '[' : xs ++ "]") <$> charsInBalancedBrackets)-                    <|> count 1 (satisfy (/='\n'))-                    <|> (newline >> notFollowedBy blankline >> return "\n")-                     ) (char ']')-  return $ concat result+  (_, raw) <- withRaw $ charsInBalancedBrackets 1+  guard $ not $ null raw+  parseFromString (trimInlinesF . mconcat <$> many inline) (init raw) +charsInBalancedBrackets :: Int -> MarkdownParser ()+charsInBalancedBrackets 0 = return ()+charsInBalancedBrackets openBrackets =+      (char '[' >> charsInBalancedBrackets (openBrackets + 1))+  <|> (char ']' >> charsInBalancedBrackets (openBrackets - 1))+  <|> ((  (() <$ code)+     <|> (() <$ (escapedChar'))+     <|> (newline >> notFollowedBy blankline)+     <|> skipMany1 (noneOf "[]`\n\\")+     <|> (() <$ count 1 (oneOf "`\\"))+      ) >> charsInBalancedBrackets openBrackets)+ -- -- document structure --@@ -245,8 +251,9 @@                          H.foldrWithKey (\k v m ->                               if ignorable k                                  then m-                                 else B.setMeta (T.unpack k)-                                            (yamlToMeta opts v) m)+                                 else case yamlToMeta opts v of+                                        Left _  -> m+                                        Right v' -> B.setMeta (T.unpack k) v' m)                            nullMeta hashmap                 Right Yaml.Null -> return $ return nullMeta                 Right _ -> do@@ -278,33 +285,42 @@ ignorable :: Text -> Bool ignorable t = (T.pack "_") `T.isSuffixOf` t -toMetaValue :: ReaderOptions -> Text -> MetaValue-toMetaValue opts x =-  case readMarkdown opts (T.unpack x) of-       Pandoc _ [Plain xs] -> MetaInlines xs-       Pandoc _ [Para xs]+toMetaValue :: ReaderOptions -> Text -> Either PandocError MetaValue+toMetaValue opts x = toMeta <$> readMarkdown opts' (T.unpack x)+  where+    toMeta p =+      case p of+        Pandoc _ [Plain xs]  -> MetaInlines xs+        Pandoc _ [Para xs]          | endsWithNewline x -> MetaBlocks [Para xs]          | otherwise         -> MetaInlines xs-       Pandoc _ bs           -> MetaBlocks bs-  where endsWithNewline t = (T.pack "\n") `T.isSuffixOf` t+        Pandoc _ bs           -> MetaBlocks bs+    endsWithNewline t = T.pack "\n" `T.isSuffixOf` t+    opts' = opts{readerExtensions=readerExtensions opts `Set.difference` meta_exts}+    meta_exts = Set.fromList [ Ext_pandoc_title_block+                             , Ext_mmd_title_block+                             , Ext_yaml_metadata_block+                             ] -yamlToMeta :: ReaderOptions -> Yaml.Value -> MetaValue+yamlToMeta :: ReaderOptions -> Yaml.Value -> Either PandocError MetaValue yamlToMeta opts (Yaml.String t) = toMetaValue opts t yamlToMeta _    (Yaml.Number n)   -- avoid decimal points for numbers that don't need them:-  | base10Exponent n >= 0     = MetaString $ show+  | base10Exponent n >= 0     = return $ MetaString $ show                                 $ coefficient n * (10 ^ base10Exponent n)-  | otherwise                 = MetaString $ show n-yamlToMeta _    (Yaml.Bool b) = MetaBool b-yamlToMeta opts (Yaml.Array xs) = B.toMetaValue $ map (yamlToMeta opts)-                                                $ V.toList xs-yamlToMeta opts (Yaml.Object o) = MetaMap $ H.foldrWithKey (\k v m ->+  | otherwise                 = return $ MetaString $ show n+yamlToMeta _    (Yaml.Bool b) = return $ MetaBool b+yamlToMeta opts (Yaml.Array xs) = B.toMetaValue <$> mapM (yamlToMeta opts)+                                                  (V.toList xs)+yamlToMeta opts (Yaml.Object o) = MetaMap <$> H.foldrWithKey (\k v m ->                                 if ignorable k                                    then m-                                   else M.insert (T.unpack k)-                                           (yamlToMeta opts v) m)-                               M.empty o-yamlToMeta _ _ = MetaString ""+                                   else (do+                                    v' <- yamlToMeta opts v+                                    m' <- m+                                    return (M.insert (T.unpack k) v' m')))+                                (return M.empty) o+yamlToMeta _ _ = return $ MetaString ""  stopLine :: MarkdownParser () stopLine = try $ (string "---" <|> string "...") >> blankline >> return ()@@ -320,11 +336,15 @@ kvPair :: MarkdownParser (String, MetaValue) kvPair = try $ do   key <- many1Till (alphaNum <|> oneOf "_- ") (char ':')+  skipMany1 spaceNoNewline   val <- manyTill anyChar           (try $ newline >> lookAhead (blankline <|> nonspaceChar))+  guard $ not . null . trim $ val   let key' = concat $ words $ map toLower key   let val' = MetaBlocks $ B.toList $ B.plain $ B.text $ trim val   return (key',val')+  where+    spaceNoNewline = satisfy (\x -> isSpace x && (x/='\n') && (x/='\r'))  parseMarkdown :: MarkdownParser Pandoc parseMarkdown = do@@ -454,12 +474,12 @@                , bulletList                , header                , lhsCodeBlock-               , rawTeXBlock                , divHtml                , htmlBlock                , table-               , lineBlock                , codeBlockIndented+               , rawTeXBlock+               , lineBlock                , blockQuote                , hrule                , orderedList@@ -489,9 +509,12 @@   notFollowedBy $ guardEnabled Ext_fancy_lists >>                   (char '.' <|> char ')') -- this would be a list   skipSpaces-  text <- trimInlinesF . mconcat <$> many (notFollowedBy atxClosing >> inline)+  (text, raw) <- withRaw $+          trimInlinesF . mconcat <$> many (notFollowedBy atxClosing >> inline)   attr <- atxClosing-  attr' <- registerHeader attr (runF text defaultParserState)+  attr'@(ident,_,_) <- registerHeader attr (runF text defaultParserState)+  guardDisabled Ext_implicit_header_references+    <|> registerImplicitHeader raw ident   return $ B.headerWith attr' level <$> text  atxClosing :: MarkdownParser Attr@@ -524,15 +547,24 @@   -- This lookahead prevents us from wasting time parsing Inlines   -- unless necessary -- it gives a significant performance boost.   lookAhead $ anyLine >> many1 (oneOf setextHChars) >> blankline-  text <- trimInlinesF . mconcat <$> many1 (notFollowedBy setextHeaderEnd >> inline)+  (text, raw) <- withRaw $+       trimInlinesF . mconcat <$> many1 (notFollowedBy setextHeaderEnd >> inline)   attr <- setextHeaderEnd   underlineChar <- oneOf setextHChars   many (char underlineChar)   blanklines   let level = (fromMaybe 0 $ findIndex (== underlineChar) setextHChars) + 1-  attr' <- registerHeader attr (runF text defaultParserState)+  attr'@(ident,_,_) <- registerHeader attr (runF text defaultParserState)+  guardDisabled Ext_implicit_header_references+    <|> registerImplicitHeader raw ident   return $ B.headerWith attr' level <$> text +registerImplicitHeader :: String -> String -> MarkdownParser ()+registerImplicitHeader raw ident = do+  let key = toKey $ "[" ++ raw ++ "]"+  updateState (\s -> s { stateHeaderKeys =+                         M.insert key ('#':ident,"") (stateHeaderKeys s) })+ -- -- hrule block --@@ -855,7 +887,7 @@   tabStop <- getOption readerTabStop   let remaining = tabStop - (length sps + 1)   if remaining > 0-     then count remaining (char ' ') <|> string "\t"+     then try (count remaining (char ' ')) <|> string "\t" <|> many1 spaceChar      else mzero   return () @@ -864,7 +896,7 @@   rawLine' <- anyLine   raw <- many1 $ defRawBlock compact   term <- parseFromString (trimInlinesF . mconcat <$> many inline) rawLine'-  contents <- mapM (parseFromString parseBlocks) raw+  contents <- mapM (parseFromString parseBlocks . (++"\n")) raw   optional blanklines   return $ liftM2 (,) term (sequence contents) @@ -875,6 +907,7 @@   firstline <- anyLine   let dline = try                ( do notFollowedBy blankline+                    notFollowedByHtmlCloser                     if compact -- laziness not compatible with compact                        then () <$ indentSpaces                        else (() <$ indentSpaces)@@ -891,7 +924,10 @@  definitionList :: MarkdownParser (F Blocks) definitionList = try $ do-  lookAhead (anyLine >> optional blankline >> defListMarker)+  lookAhead (anyLine >>+             optional (blankline >> notFollowedBy (table >> return ())) >>+             -- don't capture table caption as def list!+             defListMarker)   compactDefinitionList <|> normalDefinitionList  compactDefinitionList :: MarkdownParser (F Blocks)@@ -1054,7 +1090,9 @@ dashedLine ch = do   dashes <- many1 (char ch)   sp     <- many spaceChar-  return $ (length dashes, length $ dashes ++ sp)+  let lengthDashes = length dashes+      lengthSp     = length sp+  return (lengthDashes, lengthDashes + lengthSp)  -- Parse a table header with dashed lines of '-' preceded by -- one (or zero) line of text.@@ -1208,7 +1246,8 @@ gridPart ch = do   dashes <- many1 (char ch)   char '+'-  return (length dashes, length dashes + 1)+  let lengthDashes = length dashes+  return (lengthDashes, lengthDashes + 1)  gridDashedLines :: Char -> Parser [Char] st [(Int,Int)] gridDashedLines ch = try $ char '+' >> many1 (gridPart ch) <* blankline@@ -1287,12 +1326,8 @@  pipeTable :: MarkdownParser ([Alignment], [Double], F [Blocks], F [[Blocks]]) pipeTable = try $ do-  (heads,aligns) <- try ( pipeBreak >>= \als ->-                     return (return $ replicate (length als) mempty, als))-                  <|> ( pipeTableRow >>= \row -> pipeBreak >>= \als ->--                          return (row, als) )-  lines' <- sequence <$> many1 pipeTableRow+  (heads,aligns) <- (,) <$> pipeTableRow <*> pipeBreak+  lines' <-  sequence <$> many pipeTableRow   let widths = replicate (length aligns) 0.0   return $ (aligns, widths, heads, lines') @@ -1474,7 +1509,9 @@  math :: MarkdownParser (F Inlines) math =  (return . B.displayMath <$> (mathDisplay >>= applyMacros'))-     <|> (return . B.math <$> (mathInline >>= applyMacros'))+     <|> (return . B.math <$> (mathInline >>= applyMacros')) <+?>+               ((getOption readerSmart >>= guard) *> (return <$> apostrophe)+                <* notFollowedBy space)  -- Parses material enclosed in *s, **s, _s, or __s. -- Designed to avoid backtracking.@@ -1675,10 +1712,11 @@               -> (F Inlines, String) -> MarkdownParser (F Inlines) referenceLink constructor (lab, raw) = do   sp <- (True <$ lookAhead (char ' ')) <|> return False-  (ref,raw') <- option (mempty, "") $+  (_,raw') <- option (mempty, "") $       lookAhead (try (spnl >> normalCite >> return (mempty, "")))       <|>       try (spnl >> reference)+  when (raw' == "") $ guardEnabled Ext_shortcut_reference_links   let labIsRef = raw' == "" || raw' == "[]"   let key = toKey $ if labIsRef then raw else raw'   parsedRaw <- parseFromString (mconcat <$> many inline) raw'@@ -1694,13 +1732,13 @@   return $ do     keys <- asksF stateKeys     case M.lookup key keys of-       Nothing        -> do-         headers <- asksF stateHeaders-         ref' <- if labIsRef then lab else ref+       Nothing        ->          if implicitHeaderRefs-            then case M.lookup ref' headers of-                   Just ident -> constructor ('#':ident) "" <$> lab-                   Nothing    -> makeFallback+            then do+              headerKeys <- asksF stateHeaderKeys+              case M.lookup key headerKeys of+                   Just (src, tit) -> constructor src tit <$> lab+                   Nothing         -> makeFallback             else makeFallback        Just (src,tit) -> constructor src tit <$> lab @@ -1866,8 +1904,20 @@          return $ (flip B.cite (B.text $ '@':key ++ " " ++ raw) . (first:))                <$> rest        Nothing   ->-         (do (cs, raw) <- withRaw $ bareloc first-             return $ (flip B.cite (B.text $ '@':key ++ " " ++ raw)) <$> cs)+         (do+          (cs, raw) <- withRaw $ bareloc first+          let (spaces',raw') = span isSpace raw+              spc | null spaces' = mempty+                  | otherwise    = B.space+          lab <- parseFromString (mconcat <$> many inline) $ dropBrackets raw'+          fallback <- referenceLink B.link (lab,raw')+          return $ do+            fallback' <- fallback+            cs' <- cs+            return $+              case B.toList fallback' of+                Link{}:_ -> B.cite [first] (B.str $ '@':key) <> spc <> fallback'+                _        -> B.cite cs' (B.text $ '@':key ++ " " ++ raw))          <|> return (do st <- askF                         return $ case M.lookup key (stateExamples st) of                                  Just n -> B.str (show n)@@ -1877,10 +1927,12 @@ bareloc c = try $ do   spnl   char '['+  notFollowedBy $ char '^'   suff <- suffix   rest <- option (return []) $ try $ char ';' >> citeList   spnl   char ']'+  notFollowedBy $ oneOf "[("   return $ do     suff' <- suff     rest' <- rest
src/Text/Pandoc/Readers/MediaWiki.hs view
@@ -1,7 +1,7 @@ {-# LANGUAGE RelaxedPolyRec, FlexibleInstances, TypeSynonymInstances #-} -- RelaxedPolyRec needed for inlinesBetween on GHC < 7 {--  Copyright (C) 2012-2014 John MacFarlane <jgm@berkeley.edu>+  Copyright (C) 2012-2015 John MacFarlane <jgm@berkeley.edu>  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.MediaWiki-   Copyright   : Copyright (C) 2012-2014 John MacFarlane+   Copyright   : Copyright (C) 2012-2015 John MacFarlane    License     : GNU GPL, version 2 or above     Maintainer  : John MacFarlane <jgm@berkeley.edu>@@ -58,21 +58,21 @@ import Text.Printf (printf) import Debug.Trace (trace) +import Text.Pandoc.Error+ -- | Read mediawiki from an input string and return a Pandoc document. readMediaWiki :: ReaderOptions -- ^ Reader options               -> String        -- ^ String to parse (assuming @'\n'@ line endings)-              -> Pandoc+              -> Either PandocError Pandoc readMediaWiki opts s =-  case runParser parseMediaWiki MWState{ mwOptions = opts+  readWith parseMediaWiki MWState{ mwOptions = opts                                        , mwMaxNestingLevel = 4                                        , mwNextLinkNumber  = 1                                        , mwCategoryLinks = []                                        , mwHeaderMap = M.empty                                        , mwIdentifierList = []                                        }-       "source" (s ++ "\n") of-          Left err'    -> error $ "\nError:\n" ++ show err'-          Right result -> result+           (s ++ "\n")  data MWState = MWState { mwOptions         :: ReaderOptions                        , mwMaxNestingLevel :: Int@@ -593,11 +593,17 @@   <|> try (many1 (oneOf "x0123456789") <* string "px")   <|> try (oneOfStrings ["link=","alt=","page=","class="] <* many (noneOf "|]")) +collapseUnderscores :: String -> String+collapseUnderscores [] = []+collapseUnderscores ('_':'_':xs) = collapseUnderscores ('_':xs)+collapseUnderscores (x:xs) = x : collapseUnderscores xs++addUnderscores :: String -> String+addUnderscores = collapseUnderscores . intercalate "_" . words+ internalLink :: MWParser Inlines internalLink = try $ do   sym "[["-  let addUnderscores x = let (pref,suff) = break (=='#') x-                         in  pref ++ intercalate "_" (words suff)   pagename <- unwords . words <$> many (noneOf "|]")   label <- option (B.text pagename) $ char '|' *>              (  (mconcat <$> many1 (notFollowedBy (char ']') *> inline))
src/Text/Pandoc/Readers/Native.hs view
@@ -1,9 +1,9 @@ {--Copyright (C) 2011-2014 John MacFarlane <jgm@berkeley.edu>+Copyright (C) 2011-2015 John MacFarlane <jgm@berkeley.edu>  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-the Free Software Foundation; either version 2 of the License, or+the Free Software Foundation; Either version 2 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful,@@ -18,7 +18,7 @@  {- |    Module      : Text.Pandoc.Readers.Native-   Copyright   : Copyright (C) 2011-2014 John MacFarlane+   Copyright   : Copyright (C) 2011-2015 John MacFarlane    License     : GNU GPL, version 2 or above     Maintainer  : John MacFarlane <jgm@berkeley.edu>@@ -33,6 +33,9 @@ import Text.Pandoc.Definition import Text.Pandoc.Shared (safeRead) +import Text.Pandoc.Error+import Control.Applicative+ -- | Read native formatted text and return a Pandoc document. -- The input may be a full pandoc document, a block list, a block, -- an inline list, or an inline.  Thus, for example,@@ -44,33 +47,18 @@ -- > Pandoc nullMeta [Plain [Str "hi"]] -- readNative :: String      -- ^ String to parse (assuming @'\n'@ line endings)-           -> Pandoc-readNative s =-  case safeRead s of-       Just d    -> d-       Nothing   -> Pandoc nullMeta $ readBlocks s+           -> Either PandocError Pandoc+readNative s = maybe (Pandoc nullMeta <$> readBlocks s) Right (safeRead s) -readBlocks :: String -> [Block]-readBlocks s =-  case safeRead s of-       Just d    -> d-       Nothing   -> [readBlock s]+readBlocks :: String -> Either PandocError [Block]+readBlocks s = maybe ((:[]) <$> readBlock s) Right (safeRead s) -readBlock :: String -> Block-readBlock s =-  case safeRead s of-       Just d    -> d-       Nothing   -> Plain $ readInlines s+readBlock :: String -> Either PandocError Block+readBlock s = maybe (Plain <$> readInlines s) Right (safeRead s) -readInlines :: String -> [Inline]-readInlines s =-  case safeRead s of-       Just d     -> d-       Nothing    -> [readInline s]+readInlines :: String -> Either PandocError [Inline]+readInlines s = maybe ((:[]) <$> readInline s) Right (safeRead s) -readInline :: String -> Inline-readInline s =-  case safeRead s of-       Just d     -> d-       Nothing    -> error "Cannot parse document"+readInline :: String -> Either PandocError Inline+readInline s = maybe (Left . ParseFailure $ "Could not read: " ++ s) Right (safeRead s) 
src/Text/Pandoc/Readers/OPML.hs view
@@ -1,3 +1,4 @@+{-# LANGUAGE FlexibleContexts #-} module Text.Pandoc.Readers.OPML ( readOPML ) where import Data.Char (toUpper) import Text.Pandoc.Options@@ -11,8 +12,11 @@ import Data.Monoid import Control.Monad.State import Control.Applicative ((<$>), (<$))+import Data.Default+import Text.Pandoc.Compat.Except+import Text.Pandoc.Error -type OPML = State OPMLState+type OPML = ExceptT PandocError (State OPMLState)  data OPMLState = OPMLState{                         opmlSectionLevel :: Int@@ -21,17 +25,19 @@                       , opmlDocDate      :: Inlines                       } deriving Show -readOPML :: ReaderOptions -> String -> Pandoc+instance Default OPMLState where+  def = OPMLState{ opmlSectionLevel = 0+                 , opmlDocTitle = mempty+                 , opmlDocAuthors = []+                 , opmlDocDate = mempty+                  }++readOPML :: ReaderOptions -> String -> Either PandocError Pandoc readOPML _ inp  = setTitle (opmlDocTitle st')-                   $ setAuthors (opmlDocAuthors st')-                   $ setDate (opmlDocDate st')-                   $ doc $ mconcat bs-  where (bs, st') = runState (mapM parseBlock $ normalizeTree $ parseXML inp)-                             OPMLState{ opmlSectionLevel = 0-                                    , opmlDocTitle = mempty-                                    , opmlDocAuthors = []-                                    , opmlDocDate = mempty-                                    }+                   . setAuthors (opmlDocAuthors st')+                   . setDate (opmlDocDate st')+                   . doc . mconcat <$> bs+  where (bs, st') = flip runState def . runExceptT $ (mapM parseBlock $ normalizeTree $ parseXML inp)  -- normalize input, consolidating adjacent Text and CRef elements normalizeTree :: [Content] -> [Content]@@ -58,15 +64,17 @@     Just z  -> z     Nothing -> "" -asHtml :: String -> Inlines-asHtml s = case readHtml def s of-                Pandoc _ [Plain ils] -> fromList ils-                _ -> mempty+exceptT :: Either PandocError a -> OPML a+exceptT = either throwError return -asMarkdown :: String -> Blocks-asMarkdown s = fromList bs-  where Pandoc _ bs = readMarkdown def s+asHtml :: String -> OPML Inlines+asHtml s = (\(Pandoc _ bs) -> case bs of+                                [Plain ils] -> fromList ils+                                _ -> mempty) <$> exceptT (readHtml def s) +asMarkdown :: String -> OPML Blocks+asMarkdown s = (\(Pandoc _ bs) -> fromList bs) <$> exceptT (readMarkdown def s)+ getBlocks :: Element -> OPML Blocks getBlocks e =  mconcat <$> (mapM parseBlock $ elContent e) @@ -82,8 +90,8 @@         "outline" -> gets opmlSectionLevel >>= sect . (+1)         "?xml"  -> return mempty         _       -> getBlocks e-   where sect n = do let headerText = asHtml $ attrValue "text" e-                     let noteBlocks = asMarkdown $ attrValue "_note" e+   where sect n = do headerText <- asHtml $ attrValue "text" e+                     noteBlocks <- asMarkdown $ attrValue "_note" e                      modify $ \st -> st{ opmlSectionLevel = n }                      bs <- getBlocks e                      modify $ \st -> st{ opmlSectionLevel = n - 1 }
src/Text/Pandoc/Readers/Org.hs view
@@ -1,8 +1,8 @@ {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-}-{-# LANGUAGE FlexibleContexts #-}+{-# LANGUAGE MultiParamTypeClasses, FlexibleContexts, FlexibleInstances #-} {--Copyright (C) 2014 Albert Krewinkel <tarleb@moltkeplatz.de>+Copyright (C) 2014-2015 Albert Krewinkel <tarleb@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@@ -49,7 +49,7 @@                                      , (<$>), (<$), (<*>), (<*), (*>) ) import           Control.Arrow (first) import           Control.Monad (foldM, guard, liftM, liftM2, mplus, mzero, when)-import           Control.Monad.Reader (Reader, runReader, ask, asks)+import           Control.Monad.Reader (Reader, runReader, ask, asks, local) import           Data.Char (isAlphaNum, toLower) import           Data.Default import           Data.List (intersperse, isPrefixOf, isSuffixOf)@@ -58,14 +58,18 @@ import           Data.Monoid (Monoid, mconcat, mempty, mappend) import           Network.HTTP (urlEncode) +import           Text.Pandoc.Error+ -- | Parse org-mode string and return a Pandoc document. readOrg :: ReaderOptions -- ^ Reader options         -> String        -- ^ String to parse (assuming @'\n'@ line endings)-        -> Pandoc-readOrg opts s = readWith parseOrg def{ orgStateOptions = opts } (s ++ "\n\n")+        -> Either PandocError Pandoc+readOrg opts s = flip runReader def $ readWithM parseOrg def{ orgStateOptions = opts } (s ++ "\n\n") -type OrgParser = Parser [Char] OrgParserState+data OrgParserLocal = OrgParserLocal { orgLocalQuoteContext :: QuoteContext } +type OrgParser = ParserT [Char] OrgParserState (Reader OrgParserLocal)+ parseOrg :: OrgParser Pandoc parseOrg = do   blocks' <- parseBlocks@@ -80,14 +84,22 @@ dropCommentTrees blks@(b:bs) =   maybe blks (flip dropUntilHeaderAboveLevel bs) $ commentHeaderLevel b --- | Return the level of a header starting a comment tree and Nothing--- otherwise.+-- | Return the level of a header starting a comment or :noexport: tree and+--  Nothing otherwise. commentHeaderLevel :: Block -> Maybe Int commentHeaderLevel blk =    case blk of-     (Header level _ ((Str "COMMENT"):_)) -> Just level-     _                                    -> Nothing+     (Header level _ ((Str "COMMENT"):_))          -> Just level+     (Header level _ title) | hasNoExportTag title -> Just level+     _                                             -> Nothing+ where+   hasNoExportTag :: [Inline] -> Bool+   hasNoExportTag = any isNoExportTag +   isNoExportTag :: Inline -> Bool+   isNoExportTag (Span ("", ["tag"], [("data-tag-name", "noexport")]) []) = True+   isNoExportTag _ = False+ -- | Drop blocks until a header on or above the given level is seen dropUntilHeaderAboveLevel :: Int -> [Block] -> [Block] dropUntilHeaderAboveLevel n = dropWhile (not . isHeaderLevelLowerEq n)@@ -125,6 +137,9 @@                       , orgStateNotes'               :: OrgNoteTable                       } +instance Default OrgParserLocal where+  def = OrgParserLocal NoQuote+ instance HasReaderOptions OrgParserState where   extractReaderOptions = orgStateOptions @@ -138,6 +153,10 @@   getLastStrPos = orgStateLastStrPos   setLastStrPos pos st = st{ orgStateLastStrPos = Just pos } +instance HasQuoteContext st (Reader OrgParserLocal) where+  getQuoteContext = asks orgLocalQuoteContext+  withQuoteContext q = local (\s -> s{orgLocalQuoteContext = q})+ instance Default OrgParserState where   def = defaultOrgParserState @@ -161,19 +180,6 @@ recordAnchorId i = updateState $ \s ->   s{ orgStateAnchorIds = i : (orgStateAnchorIds s) } -addBlockAttribute :: String -> String -> OrgParser ()-addBlockAttribute key val = updateState $ \s ->-  let attrs = orgStateBlockAttributes s-  in s{ orgStateBlockAttributes = M.insert key val attrs }--lookupBlockAttribute :: String -> OrgParser (Maybe String)-lookupBlockAttribute key =-  M.lookup key . orgStateBlockAttributes <$> getState--resetBlockAttributes :: OrgParser ()-resetBlockAttributes = updateState $ \s ->-  s{ orgStateBlockAttributes = orgStateBlockAttributes def }- updateLastForbiddenCharPos :: OrgParser () updateLastForbiddenCharPos = getPosition >>= \p ->   updateState $ \s -> s{ orgStateLastForbiddenCharPos = Just p}@@ -301,9 +307,18 @@                , paraOrPlain                ] <?> "block" +--+-- Block Attributes+--++-- | Parse optional block attributes (like #+TITLE or #+NAME) optionalAttributes :: OrgParser (F Blocks) -> OrgParser (F Blocks) optionalAttributes parser = try $   resetBlockAttributes *> parseBlockAttributes *> parser+ where+   resetBlockAttributes :: OrgParser ()+   resetBlockAttributes = updateState $ \s ->+     s{ orgStateBlockAttributes = orgStateBlockAttributes def }  parseBlockAttributes :: OrgParser () parseBlockAttributes = do@@ -328,7 +343,16 @@         (fmap Just . parseFromString parseInlines)         val +addBlockAttribute :: String -> String -> OrgParser ()+addBlockAttribute key val = updateState $ \s ->+  let attrs = orgStateBlockAttributes s+  in s{ orgStateBlockAttributes = M.insert key val attrs } +lookupBlockAttribute :: String -> OrgParser (Maybe String)+lookupBlockAttribute key =+  M.lookup key . orgStateBlockAttributes <$> getState++ -- -- Org Blocks (#+BEGIN_... / #+END_...) --@@ -383,11 +407,11 @@ exportsResults attrs = ("rundoc-exports", "results") `elem` attrs                        || ("rundoc-exports", "both") `elem` attrs -followingResultsBlock :: OrgParser (Maybe String)+followingResultsBlock :: OrgParser (Maybe (F Blocks)) followingResultsBlock =        optionMaybe (try $ blanklines *> stringAnyCase "#+RESULTS:"                                      *> blankline-                                     *> (unlines <$> many1 exampleLine))+                                     *> block)  codeBlock :: BlockProperties -> OrgParser (F Blocks) codeBlock blkProp = do@@ -402,7 +426,7 @@   labelledBlck      <- maybe (pure codeBlck)                              (labelDiv codeBlck)                              <$> lookupInlinesAttr "caption"-  let resultBlck     = pure $ maybe mempty (exampleCode) resultsContent+  let resultBlck     = fromMaybe mempty resultsContent   return $ (if includeCode then labelledBlck else mempty)            <> (if includeResults then resultBlck else mempty)  where@@ -641,9 +665,26 @@ header :: OrgParser (F Blocks) header = try $ do   level <- headerStart-  title <- inlinesTillNewline-  return $ B.header level <$> title+  title <- manyTill inline (lookAhead headerEnd)+  tags <- headerEnd+  let inlns = trimInlinesF . mconcat $ title <> map tagToInlineF tags+  return $ B.header level <$> inlns+ where+   tagToInlineF :: String -> F Inlines+   tagToInlineF t = return $ B.spanWith ("", ["tag"], [("data-tag-name", t)]) mempty +headerEnd :: OrgParser [String]+headerEnd = option [] headerTags <* newline++headerTags :: OrgParser [String]+headerTags = try $+  skipSpaces+  *> char ':'+  *> many1 tag+  <* skipSpaces+ where tag = many1 (alphaNum <|> oneOf "@%#_")+             <* char ':'+ headerStart :: OrgParser Int headerStart = try $   (length <$> many1 (char '*')) <* many1 (char ' ')@@ -964,6 +1005,7 @@          , subscript          , superscript          , inlineLaTeX+         , smart          , symbol          ] <* (guard =<< newlinesCountWithinLimits)   <?> "inline"@@ -1106,7 +1148,7 @@   char ']'   return $ do     src <- srcF-    if isImageFilename src && isImageFilename title+    if isImageFilename title       then pure $ B.link src "" $ B.image title mempty mempty       else linkToInlinesF src =<< title' @@ -1270,12 +1312,16 @@ displayMath = return . B.displayMath <$> choice [ rawMathBetween "\\[" "\\]"                                                 , rawMathBetween "$$"  "$$"                                                 ]++updatePositions :: Char+                -> OrgParser (Char)+updatePositions c = do+  when (c `elem` emphasisPreChars) updateLastPreCharPos+  when (c `elem` emphasisForbiddenBorderChars) updateLastForbiddenCharPos+  return c+ symbol :: OrgParser (F Inlines) symbol = return . B.str . (: "") <$> (oneOf specialChars >>= updatePositions)- where updatePositions c = do-         when (c `elem` emphasisPreChars) updateLastPreCharPos-         when (c `elem` emphasisForbiddenBorderChars) updateLastForbiddenCharPos-         return c  emphasisBetween :: Char                 -> OrgParser (F Inlines)@@ -1486,3 +1532,31 @@       count len anyChar       return cs     _ -> mzero++smart :: OrgParser (F Inlines)+smart = do+  getOption readerSmart >>= guard+  doubleQuoted <|> singleQuoted <|>+    choice (map (return <$>) [orgApostrophe, dash, ellipses])+  where orgApostrophe =+          (char '\'' <|> char '\8217') <* updateLastPreCharPos+                                       <* updateLastForbiddenCharPos+                                       *> return (B.str "\x2019")++singleQuoted :: OrgParser (F Inlines)+singleQuoted = try $ do+  singleQuoteStart+  withQuoteContext InSingleQuote $+    fmap B.singleQuoted . trimInlinesF . mconcat <$>+      many1Till inline singleQuoteEnd++-- doubleQuoted will handle regular double-quoted sections, as well+-- as dialogues with an open double-quote without a close double-quote+-- in the same paragraph.+doubleQuoted :: OrgParser (F Inlines)+doubleQuoted = try $ do+  doubleQuoteStart+  contents <- mconcat <$> many (try $ notFollowedBy doubleQuoteEnd >> inline)+  (withQuoteContext InDoubleQuote $ (doubleQuoteEnd <* updateLastForbiddenCharPos) >> return+       (fmap B.doubleQuoted . trimInlinesF $ contents))+   <|> (return $ return (B.str "\8220") <> contents)
src/Text/Pandoc/Readers/RST.hs view
@@ -1,7 +1,7 @@ {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE FlexibleContexts #-} {--Copyright (C) 2006-2014 John MacFarlane <jgm@berkeley.edu>+Copyright (C) 2006-2015 John MacFarlane <jgm@berkeley.edu>  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.RST-   Copyright   : Copyright (C) 2006-2014 John MacFarlane+   Copyright   : Copyright (C) 2006-2015 John MacFarlane    License     : GNU GPL, version 2 or above     Maintainer  : John MacFarlane <jgm@berkeley.edu>@@ -51,13 +51,15 @@ import Data.Sequence (viewr, ViewR(..)) import Data.Char (toLower, isHexDigit, isSpace) +import Text.Pandoc.Error+ -- | Parse reStructuredText string and return Pandoc document. readRST :: ReaderOptions -- ^ Reader options         -> String        -- ^ String to parse (assuming @'\n'@ line endings)-        -> Pandoc+        -> Either PandocError Pandoc readRST opts s = (readWith parseRST) def{ stateOptions = opts } (s ++ "\n\n") -readRSTWithWarnings :: ReaderOptions -> String -> (Pandoc, [String])+readRSTWithWarnings :: ReaderOptions -> String -> Either PandocError (Pandoc, [String]) readRSTWithWarnings opts s = (readWithWarnings parseRST) def{ stateOptions = opts } (s ++ "\n\n")  type RSTParser = Parser [Char] ParserState
src/Text/Pandoc/Readers/TWiki.hs view
@@ -48,17 +48,18 @@ import Text.HTML.TagSoup import Data.Char (isAlphaNum) import qualified Data.Foldable as F+import Text.Pandoc.Error  -- | Read twiki from an input string and return a Pandoc document. readTWiki :: ReaderOptions -- ^ Reader options           -> String        -- ^ String to parse (assuming @'\n'@ line endings)-          -> Pandoc+          -> Either PandocError Pandoc readTWiki opts s =   (readWith parseTWiki) def{ stateOptions = opts } (s ++ "\n\n")  readTWikiWithWarnings :: ReaderOptions -- ^ Reader options                       -> String        -- ^ String to parse (assuming @'\n'@ line endings)-                      -> (Pandoc, [String])+                      -> Either PandocError (Pandoc, [String]) readTWikiWithWarnings opts s =   (readWith parseTWikiWithWarnings) def{ stateOptions = opts } (s ++ "\n\n")  where parseTWikiWithWarnings = do
src/Text/Pandoc/Readers/TeXMath.hs view
@@ -1,5 +1,5 @@ {--Copyright (C) 2007-2014 John MacFarlane <jgm@berkeley.edu>+Copyright (C) 2007-2015 John MacFarlane <jgm@berkeley.edu>  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@@ -18,7 +18,7 @@  {- |    Module      : Text.Pandoc.Readers.TeXMath-   Copyright   : Copyright (C) 2007-2014 John MacFarlane+   Copyright   : Copyright (C) 2007-2015 John MacFarlane    License     : GNU GPL, version 2 or above     Maintainer  : John MacFarlane <jgm@berkeley.edu>
src/Text/Pandoc/Readers/Textile.hs view
@@ -1,5 +1,5 @@ {--Copyright (C) 2010-2014 Paul Rivier <paul*rivier#demotera*com> | tr '*#' '.@'+Copyright (C) 2010-2015 Paul Rivier <paul*rivier#demotera*com> | tr '*#' '.@'                         and John MacFarlane  This program is free software; you can redistribute it and/or modify@@ -19,7 +19,7 @@  {- |    Module      : Text.Pandoc.Readers.Textile-   Copyright   : Copyright (C) 2010-2014 Paul Rivier and John MacFarlane+   Copyright   : Copyright (C) 2010-2015 Paul Rivier and John MacFarlane    License     : GNU GPL, version 2 or above     Maintainer  : Paul Rivier <paul*rivier#demotera*com>@@ -57,6 +57,7 @@ import Text.Pandoc.Options import Text.Pandoc.Parsing import Text.Pandoc.Readers.HTML ( htmlTag, isBlockTag )+import Text.Pandoc.Shared (trim) import Text.Pandoc.Readers.LaTeX ( rawLaTeXInline, rawLaTeXBlock ) import Text.HTML.TagSoup (parseTags, innerText, fromAttrib, Tag(..)) import Text.HTML.TagSoup.Match@@ -67,11 +68,12 @@ import Control.Applicative ((<$>), (*>), (<*), (<$)) import Data.Monoid import Debug.Trace (trace)+import Text.Pandoc.Error  -- | Parse a Textile text and return a Pandoc document. readTextile :: ReaderOptions -- ^ Reader options             -> String       -- ^ String to parse (assuming @'\n'@ line endings)-            -> Pandoc+            -> Either PandocError Pandoc readTextile opts s =   (readWith parseTextile) def{ stateOptions = opts } (s ++ "\n\n") @@ -325,33 +327,30 @@ -- Tables  -- | A table cell spans until a pipe |-tableCell :: Parser [Char] ParserState Blocks-tableCell = do-  c <- many1 (noneOf "|\n")-  content <- trimInlines . mconcat <$> parseFromString (many1 inline) c+tableCell :: Bool -> Parser [Char] ParserState Blocks+tableCell headerCell = try $ do+  char '|'+  when headerCell $ () <$ string "_."+  notFollowedBy blankline+  raw <- trim <$>+         many (noneOf "|\n" <|> try (char '\n' <* notFollowedBy blankline))+  content <- mconcat <$> parseFromString (many inline) raw   return $ B.plain content  -- | A table row is made of many table cells tableRow :: Parser [Char] ParserState [Blocks]-tableRow = try $ ( char '|' *>-  (endBy1 tableCell (optional blankline *> char '|')) <* newline)---- | Many table rows-tableRows :: Parser [Char] ParserState [[Blocks]]-tableRows = many1 tableRow+tableRow = many1 (tableCell False) <* char '|' <* newline --- | Table headers are made of cells separated by a tag "|_."-tableHeaders :: Parser [Char] ParserState [Blocks]-tableHeaders = let separator = (try $ string "|_.") in-  try $ ( separator *> (sepBy1 tableCell separator) <* char '|' <* newline )+tableHeader :: Parser [Char] ParserState [Blocks]+tableHeader = many1 (tableCell True) <* char '|' <* newline  -- | A table with an optional header. Current implementation can -- handle tables with and without header, but will parse cells -- alignment attributes as content. table :: Parser [Char] ParserState Blocks table = try $ do-  headers <- option mempty tableHeaders-  rows <- tableRows+  headers <- option mempty $ tableHeader+  rows <- many1 tableRow   blanklines   let nbOfCols = max (length headers) (length $ head rows)   return $ B.table mempty
src/Text/Pandoc/Readers/Txt2Tags.hs view
@@ -48,6 +48,7 @@ import Control.Monad (void, guard, when) import Data.Default import Control.Monad.Reader (Reader, runReader, asks)+import Text.Pandoc.Error  import Data.Time.LocalTime (getZonedTime) import Text.Pandoc.Compat.Directory(getModificationTime)@@ -83,12 +84,12 @@     return $ T2TMeta curDate curMtime (intercalate ", " inps) out  -- | Read Txt2Tags from an input string returning a Pandoc document-readTxt2Tags :: T2TMeta -> ReaderOptions -> String -> Pandoc+readTxt2Tags :: T2TMeta -> ReaderOptions -> String -> Either PandocError Pandoc readTxt2Tags t opts s = flip runReader t $ readWithM parseT2T (def {stateOptions = opts}) (s ++ "\n\n")  -- | Read Txt2Tags (ignoring all macros) from an input string returning -- a Pandoc document-readTxt2TagsNoMacros :: ReaderOptions -> String -> Pandoc+readTxt2TagsNoMacros :: ReaderOptions -> String -> Either PandocError Pandoc readTxt2TagsNoMacros = readTxt2Tags def  parseT2T :: T2T Pandoc
src/Text/Pandoc/SelfContained.hs view
@@ -1,6 +1,6 @@ {-# LANGUAGE OverloadedStrings #-} {--Copyright (C) 2011-2014 John MacFarlane <jgm@berkeley.edu>+Copyright (C) 2011-2015 John MacFarlane <jgm@berkeley.edu>  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@@ -19,7 +19,7 @@  {- |    Module      : Text.Pandoc.SelfContained-   Copyright   : Copyright (C) 2011-2014 John MacFarlane+   Copyright   : Copyright (C) 2011-2015 John MacFarlane    License     : GNU GPL, version 2 or above     Maintainer  : John MacFarlane <jgm@berkeley.edu>@@ -43,12 +43,31 @@ import Text.Pandoc.Shared (renderTags', err, fetchItem') import Text.Pandoc.MediaBag (MediaBag) import Text.Pandoc.MIME (MimeType)-import Text.Pandoc.UTF8 (toString,  fromString)+import Text.Pandoc.UTF8 (toString) import Text.Pandoc.Options (WriterOptions(..))+import Data.List (isPrefixOf)+import Control.Applicative+import Text.CSS.Parse (parseNestedBlocks, NestedBlock(..))+import Text.CSS.Render (renderNestedBlocks)+import Data.Text.Encoding (decodeUtf8, encodeUtf8)+import qualified Data.Text as T+import Data.Text (Text)+import Data.Text.Lazy (toStrict)+import Data.Text.Lazy.Builder (toLazyText)  isOk :: Char -> Bool isOk c = isAscii c && isAlphaNum c +makeDataURI :: String -> ByteString -> String+makeDataURI mime raw =+  if textual+     then "data:" ++ mime' ++ "," ++ escapeURIString isOk (toString raw)+     else "data:" ++ mime' ++ ";base64," ++ toString (encode raw)+  where textual = "text/" `Data.List.isPrefixOf` mime+        mime' = if textual && ';' `notElem` mime+                   then mime ++ ";charset=utf-8"+                   else mime  -- mime type already has charset+ convertTag :: MediaBag -> Maybe String -> Tag String -> IO (Tag String) convertTag media sourceURL t@(TagOpen tagname as)   | tagname `elem`@@ -58,51 +77,62 @@   where processAttribute (x,y) =            if x == "src" || x == "href" || x == "poster"               then do-                (raw, mime) <- getRaw media sourceURL (fromAttrib "type" t) y-                let enc = "data:" ++ mime ++ ";base64," ++ toString (encode raw)+                enc <- getDataURI media sourceURL (fromAttrib "type" t) y                 return (x, enc)               else return (x,y) convertTag media sourceURL t@(TagOpen "script" as) =   case fromAttrib "src" t of        []     -> return t        src    -> do-           (raw, mime) <- getRaw media sourceURL (fromAttrib "type" t) src-           let enc = "data:" ++ mime ++ "," ++ escapeURIString isOk (toString raw)+           enc <- getDataURI media sourceURL (fromAttrib "type" t) src            return $ TagOpen "script" (("src",enc) : [(x,y) | (x,y) <- as, x /= "src"]) convertTag media sourceURL t@(TagOpen "link" as) =   case fromAttrib "href" t of        []  -> return t        src -> do-           (raw, mime) <- getRaw media sourceURL (fromAttrib "type" t) src-           let enc = "data:" ++ mime ++ "," ++ escapeURIString isOk (toString raw)+           enc <- getDataURI media sourceURL (fromAttrib "type" t) src            return $ TagOpen "link" (("href",enc) : [(x,y) | (x,y) <- as, x /= "href"]) convertTag _ _ t = return t  -- NOTE: This is really crude, it doesn't respect CSS comments. cssURLs :: MediaBag -> Maybe String -> FilePath -> ByteString         -> IO ByteString-cssURLs media sourceURL d orig =-  case B.breakSubstring "url(" orig of-       (x,y) | B.null y  -> return orig-             | otherwise -> do-                  let (u,v) = B.breakSubstring ")" $ B.drop 4 y-                  let url = toString-                          $ case B.take 1 u of-                                 "\"" -> B.takeWhile (/='"') $ B.drop 1 u-                                 "'"  -> B.takeWhile (/='\'') $ B.drop 1 u-                                 _    -> u-                  let url' = if isURI url-                                then url-                                else d </> url-                  (raw, mime) <- getRaw media sourceURL "" url'-                  rest <- cssURLs media sourceURL d v-                  let enc = "data:" `B.append` fromString mime `B.append`-                               ";base64," `B.append` (encode raw)-                  return $ x `B.append` "url(" `B.append` enc `B.append` rest+cssURLs media sourceURL d orig = do+  case parseNestedBlocks (decodeUtf8 orig) of+       Left _err  -> return orig+       Right bs   -> (encodeUtf8 . toStrict . toLazyText . renderNestedBlocks)+                   <$> mapM (handleCSSUrls media sourceURL d) bs -getRaw :: MediaBag -> Maybe String -> MimeType -> String-       -> IO (ByteString, MimeType)-getRaw media sourceURL mimetype src = do+handleCSSUrls :: MediaBag -> Maybe String -> FilePath -> NestedBlock+              -> IO NestedBlock+handleCSSUrls media sourceURL d (NestedBlock t bs) =+  NestedBlock t <$> mapM (handleCSSUrls media sourceURL d) bs+handleCSSUrls media sourceURL d (LeafBlock (selector, attrs)) = do+  attrs' <- mapM (handleCSSAttr media sourceURL d) attrs+  return (LeafBlock (selector, attrs'))++handleCSSAttr :: MediaBag -> Maybe String -> FilePath -> (Text, Text)+              -> IO (Text, Text)+handleCSSAttr media sourceURL d (key, val) =+  if "url(" `T.isPrefixOf` val+     then do+        let url = T.unpack $ dropParens $ T.drop 3 val+        case url of+             '#':_ -> return (key, val)+             'd':'a':'t':'a':':':_ -> return (key, val)+             _ -> do+               let url' = if isURI url then url else d </> url+               enc <- getDataURI media sourceURL "" url'+               return (key, T.pack enc)+      else return (key, val)++dropParens :: Text -> Text+dropParens = T.dropAround (`elem` ['(',')','"','\'',' ','\t','\n','\r'])++getDataURI :: MediaBag -> Maybe String -> MimeType -> String+       -> IO String+getDataURI _ _ _ src@('d':'a':'t':'a':':':_) = return src  -- already data: uri+getDataURI media sourceURL mimetype src = do   let ext = map toLower $ takeExtension src   fetchResult <- fetchItem' media sourceURL src   (raw, respMime) <- case fetchResult of@@ -128,7 +158,7 @@   result <- if mime == "text/css"                then cssURLs media cssSourceURL (takeDirectory src) raw'                else return raw'-  return (result, mime)+  return $ makeDataURI mime result  -- | Convert HTML into self-contained HTML, incorporating images, -- scripts, and CSS using data: URIs.
src/Text/Pandoc/Shared.hs view
@@ -2,7 +2,7 @@     FlexibleContexts, ScopedTypeVariables, PatternGuards,     ViewPatterns #-} {--Copyright (C) 2006-2014 John MacFarlane <jgm@berkeley.edu>+Copyright (C) 2006-2015 John MacFarlane <jgm@berkeley.edu>  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.Shared-   Copyright   : Copyright (C) 2006-2014 John MacFarlane+   Copyright   : Copyright (C) 2006-2015 John MacFarlane    License     : GNU GPL, version 2 or above     Maintainer  : John MacFarlane <jgm@berkeley.edu>@@ -85,6 +85,8 @@                      -- * Error handling                      err,                      warn,+                     mapLeft,+                     hush,                      -- * Safe read                      safeRead,                      -- * Temp directory@@ -113,7 +115,7 @@ import Data.Generics (Typeable, Data) import qualified Control.Monad.State as S import qualified Control.Exception as E-import Control.Monad (msum, unless)+import Control.Monad (msum, unless, MonadPlus(..)) import Text.Pandoc.Pretty (charWidth) import Text.Pandoc.Compat.Locale (defaultTimeLocale) import Data.Time@@ -794,6 +796,7 @@         fp = unEscapeString $ dropFragmentAndQuery s         mime = case takeExtension fp of                     ".gz" -> getMimeType $ dropExtension fp+                    ".svgz" -> getMimeType $ dropExtension fp ++ ".svg"                     x     -> getMimeType x         ensureEscaped x@(_:':':'\\':_) = x -- likely windows path         ensureEscaped x = escapeURIString isAllowedInURI x@@ -855,6 +858,14 @@   name <- getProgName   UTF8.hPutStrLn stderr $ name ++ ": " ++ msg +mapLeft :: (a -> b) -> Either a c -> Either b c+mapLeft f (Left x) = Left (f x)+mapLeft _ (Right x) = Right x++hush :: Either a b -> Maybe b+hush (Left _) = Nothing+hush (Right x) = Just x+ -- | Remove intermediate "." and ".." directories from a path. -- -- > collapseFilePath "./foo" == "foo"@@ -883,11 +894,11 @@ -- Safe read -- -safeRead :: (Monad m, Read a) => String -> m a+safeRead :: (MonadPlus m, Read a) => String -> m a safeRead s = case reads s of                   (d,x):_                     | all isSpace x -> return d-                  _                 -> fail $ "Could not read `" ++ s ++ "'"+                  _                 -> mzero  -- -- Temp directory
src/Text/Pandoc/Slides.hs view
@@ -1,5 +1,5 @@ {--Copyright (C) 2012-2014 John MacFarlane <jgm@berkeley.edu>+Copyright (C) 2012-2015 John MacFarlane <jgm@berkeley.edu>  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@@ -18,7 +18,7 @@  {- |    Module      : Text.Pandoc.Slides-   Copyright   : Copyright (C) 2012-2014 John MacFarlane+   Copyright   : Copyright (C) 2012-2015 John MacFarlane    License     : GNU GPL, version 2 or above     Maintainer  : John MacFarlane <jgm@berkeley.edu>
src/Text/Pandoc/Templates.hs view
@@ -1,7 +1,7 @@ {-# LANGUAGE TypeSynonymInstances, FlexibleInstances, CPP,     OverloadedStrings, GeneralizedNewtypeDeriving #-} {--Copyright (C) 2009-2014 John MacFarlane <jgm@berkeley.edu>+Copyright (C) 2009-2015 John MacFarlane <jgm@berkeley.edu>  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.Templates-   Copyright   : Copyright (C) 2009-2014 John MacFarlane+   Copyright   : Copyright (C) 2009-2015 John MacFarlane    License     : GNU GPL, version 2 or above     Maintainer  : John MacFarlane <jgm@berkeley.edu>
src/Text/Pandoc/UTF8.hs view
@@ -1,6 +1,6 @@ {-# LANGUAGE CPP #-} {--Copyright (C) 2010-2014 John MacFarlane <jgm@berkeley.edu>+Copyright (C) 2010-2015 John MacFarlane <jgm@berkeley.edu>  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@@ -19,7 +19,7 @@  {- |    Module      : Text.Pandoc.UTF8-   Copyright   : Copyright (C) 2010-2014 John MacFarlane+   Copyright   : Copyright (C) 2010-2015 John MacFarlane    License     : GNU GPL, version 2 or above     Maintainer  : John MacFarlane <jgm@berkeley.edu>@@ -93,10 +93,16 @@ dropBOM ('\xFEFF':xs) = xs dropBOM xs = xs +filterCRs :: String -> String+filterCRs ('\r':'\n':xs) = '\n': filterCRs xs+filterCRs ('\r':xs) = '\n' : filterCRs xs+filterCRs (x:xs) = x : filterCRs xs+filterCRs []     = []+ -- | Convert UTF8-encoded ByteString to String, also -- removing '\r' characters. toString :: B.ByteString -> String-toString = filter (/='\r') . dropBOM . T.unpack . T.decodeUtf8+toString = filterCRs . dropBOM . T.unpack . T.decodeUtf8  fromString :: String -> B.ByteString fromString = T.encodeUtf8 . T.pack@@ -104,7 +110,7 @@ -- | Convert UTF8-encoded ByteString to String, also -- removing '\r' characters. toStringLazy :: BL.ByteString -> String-toStringLazy = filter (/='\r') . dropBOM . TL.unpack . TL.decodeUtf8+toStringLazy = filterCRs . dropBOM . TL.unpack . TL.decodeUtf8  fromStringLazy :: String -> BL.ByteString fromStringLazy = TL.encodeUtf8 . TL.pack
src/Text/Pandoc/UUID.hs view
@@ -1,5 +1,5 @@ {--Copyright (C) 2010-2014 John MacFarlane <jgm@berkeley.edu>+Copyright (C) 2010-2015 John MacFarlane <jgm@berkeley.edu>  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@@ -18,7 +18,7 @@  {- |    Module      : Text.Pandoc.UUID-   Copyright   : Copyright (C) 2010-2014 John MacFarlane+   Copyright   : Copyright (C) 2010-2015 John MacFarlane    License     : GNU GPL, version 2 or above     Maintainer  : John MacFarlane <jgm@berkeley.edu>
src/Text/Pandoc/Writers/AsciiDoc.hs view
@@ -1,6 +1,6 @@ {-# LANGUAGE OverloadedStrings #-} {--Copyright (C) 2006-2014 John MacFarlane <jgm@berkeley.edu>+Copyright (C) 2006-2015 John MacFarlane <jgm@berkeley.edu>  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@@ -19,7 +19,7 @@  {- |    Module      : Text.Pandoc.Writers.AsciiDoc-   Copyright   : Copyright (C) 2006-2014 John MacFarlane+   Copyright   : Copyright (C) 2006-2015 John MacFarlane    License     : GNU GPL, version 2 or above     Maintainer  : John MacFarlane <jgm@berkeley.edu>@@ -126,7 +126,7 @@ blockToAsciiDoc _ Null = return empty blockToAsciiDoc opts (Plain inlines) = do   contents <- inlineListToAsciiDoc opts inlines-  return $ contents <> cr+  return $ contents <> blankline blockToAsciiDoc opts (Para [Image alt (src,'f':'i':'g':':':tit)]) = do   blockToAsciiDoc opts (Para [Image alt (src,tit)]) blockToAsciiDoc opts (Para inlines) = do@@ -272,7 +272,7 @@   contents <- foldM addBlock empty blocks   modify $ \s -> s{ bulletListLevel = lev }   let marker = text (replicate lev '*')-  return $ marker <> space <> contents <> cr+  return $ marker <> text " " <> contents <> cr  -- | Convert ordered list item (a list of blocks) to asciidoc. orderedListItemToAsciiDoc :: WriterOptions -- ^ options@@ -292,7 +292,7 @@   modify $ \s -> s{ orderedListLevel = lev + 1 }   contents <- foldM addBlock empty blocks   modify $ \s -> s{ orderedListLevel = lev }-  return $ text marker <> space <> contents <> cr+  return $ text marker <> text " " <> contents <> cr  -- | Convert definition list item (label, list of blocks) to asciidoc. definitionListItemToAsciiDoc :: WriterOptions
+ src/Text/Pandoc/Writers/CommonMark.hs view
@@ -0,0 +1,178 @@+{-+Copyright (C) 2015 John MacFarlane <jgm@berkeley.edu>++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+the Free Software Foundation; either version 2 of the License, or+(at your option) any later version.++This program is distributed in the hope that it will be useful,+but WITHOUT ANY WARRANTY; without even the implied warranty of+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the+GNU General Public License for more details.++You should have received a copy of the GNU General Public License+along with this program; if not, write to the Free Software+Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA+-}++{- |+   Module      : Text.Pandoc.Writers.CommonMark+   Copyright   : Copyright (C) 2015 John MacFarlane+   License     : GNU GPL, version 2 or above++   Maintainer  : John MacFarlane <jgm@berkeley.edu>+   Stability   : alpha+   Portability : portable++Conversion of 'Pandoc' documents to CommonMark.++CommonMark:  <http://commonmark.org>+-}+module Text.Pandoc.Writers.CommonMark (writeCommonMark) where++import Text.Pandoc.Writers.HTML (writeHtmlString)+import Text.Pandoc.Definition+import Text.Pandoc.Shared (isTightList)+import Text.Pandoc.Templates (renderTemplate')+import Text.Pandoc.Writers.Shared+import Text.Pandoc.Options+import CMark+import qualified Data.Text as T+import Control.Monad.Identity (runIdentity, Identity)+import Control.Monad.State (runState, State, modify, get)+import Text.Pandoc.Walk (walkM)++-- | Convert Pandoc to CommonMark.+writeCommonMark :: WriterOptions -> Pandoc -> String+writeCommonMark opts (Pandoc meta blocks) = rendered+  where main = runIdentity $ blocksToCommonMark opts (blocks' ++ notes')+        (blocks', notes) = runState (walkM processNotes blocks) []+        notes' = if null notes+                    then []+                    else [OrderedList (1, Decimal, Period) $ reverse notes]+        metadata = runIdentity $ metaToJSON opts+                     (blocksToCommonMark opts)+                     (inlinesToCommonMark opts)+                     meta+        context = defField "body" main $ metadata+        rendered = if writerStandalone opts+                      then renderTemplate' (writerTemplate opts) context+                      else main++processNotes :: Inline -> State [[Block]] Inline+processNotes (Note bs) = do+  modify (bs :)+  notes <- get+  return $ Str $ "[" ++ show (length notes) ++ "]"+processNotes x = return x++node :: NodeType -> [Node] -> Node+node = Node Nothing++blocksToCommonMark :: WriterOptions -> [Block] -> Identity String+blocksToCommonMark opts bs = return $+  T.unpack $ nodeToCommonmark cmarkOpts colwidth+           $ node DOCUMENT (blocksToNodes bs)+   where cmarkOpts = [optHardBreaks | isEnabled Ext_hard_line_breaks opts]+         colwidth = if writerWrapText opts+                       then writerColumns opts+                       else 0++inlinesToCommonMark :: WriterOptions -> [Inline] -> Identity String+inlinesToCommonMark opts ils = return $+  T.unpack $ nodeToCommonmark cmarkOpts colwidth+           $ node PARAGRAPH (inlinesToNodes ils)+   where cmarkOpts = [optHardBreaks | isEnabled Ext_hard_line_breaks opts]+         colwidth = if writerWrapText opts+                       then writerColumns opts+                       else 0++blocksToNodes :: [Block] -> [Node]+blocksToNodes = foldr blockToNodes []++blockToNodes :: Block -> [Node] -> [Node]+blockToNodes (Plain xs) = (node PARAGRAPH (inlinesToNodes xs) :)+blockToNodes (Para xs) = (node PARAGRAPH (inlinesToNodes xs) :)+blockToNodes (CodeBlock (_,classes,_) xs) =+  (node (CODE_BLOCK (T.pack (unwords classes)) (T.pack xs)) [] :)+blockToNodes (RawBlock fmt xs)+  | fmt == Format "html" = (node (HTML (T.pack xs)) [] :)+  | otherwise = id+blockToNodes (BlockQuote bs) =+  (node BLOCK_QUOTE (blocksToNodes bs) :)+blockToNodes (BulletList items) =+  (node (LIST ListAttributes{+               listType = BULLET_LIST,+               listDelim = PERIOD_DELIM,+               listTight = isTightList items,+               listStart = 1 }) (map (node ITEM . blocksToNodes) items) :)+blockToNodes (OrderedList (start, _sty, delim) items) =+  (node (LIST ListAttributes{+               listType = ORDERED_LIST,+               listDelim = case delim of+                                OneParen  -> PAREN_DELIM+                                TwoParens -> PAREN_DELIM+                                _         -> PERIOD_DELIM,+               listTight = isTightList items,+               listStart = start }) (map (node ITEM . blocksToNodes) items) :)+blockToNodes HorizontalRule = (node HRULE [] :)+blockToNodes (Header lev _ ils) = (node (HEADER lev) (inlinesToNodes ils) :)+blockToNodes (Div _ bs) = (blocksToNodes bs ++)+blockToNodes (DefinitionList items) = blockToNodes (BulletList items')+  where items' = map dlToBullet items+        dlToBullet (term, ((Para xs : ys) : zs))  =+          Para (term ++ [LineBreak] ++ xs) : ys ++ concat zs+        dlToBullet (term, ((Plain xs : ys) : zs)) =+          Plain (term ++ [LineBreak] ++ xs) : ys ++ concat zs+        dlToBullet (term, xs) =+          Para term : concat xs+blockToNodes t@(Table _ _ _ _ _) =+  (node (HTML (T.pack $! writeHtmlString def $! Pandoc nullMeta [t])) [] :)+blockToNodes Null = id++inlinesToNodes :: [Inline] -> [Node]+inlinesToNodes  = foldr inlineToNodes []++inlineToNodes :: Inline -> [Node] -> [Node]+inlineToNodes (Str s) = (node (TEXT (T.pack s)) [] :)+inlineToNodes Space   = (node (TEXT (T.pack " ")) [] :)+inlineToNodes LineBreak = (node LINEBREAK [] :)+inlineToNodes (Emph xs) = (node EMPH (inlinesToNodes xs) :)+inlineToNodes (Strong xs) = (node STRONG (inlinesToNodes xs) :)+inlineToNodes (Strikeout xs) =+  ((node (INLINE_HTML (T.pack "<s>")) [] : inlinesToNodes xs +++   [node (INLINE_HTML (T.pack "</s>")) []]) ++ )+inlineToNodes (Superscript xs) =+  ((node (INLINE_HTML (T.pack "<sub>")) [] : inlinesToNodes xs +++   [node (INLINE_HTML (T.pack "</sub>")) []]) ++ )+inlineToNodes (Subscript xs) =+  ((node (INLINE_HTML (T.pack "<sup>")) [] : inlinesToNodes xs +++   [node (INLINE_HTML (T.pack "</sup>")) []]) ++ )+inlineToNodes (SmallCaps xs) =+  ((node (INLINE_HTML (T.pack "<span style=\"font-variant:small-caps;\">")) []+    : inlinesToNodes xs +++    [node (INLINE_HTML (T.pack "</span>")) []]) ++ )+inlineToNodes (Link ils (url,tit)) =+  (node (LINK (T.pack url) (T.pack tit)) (inlinesToNodes ils) :)+inlineToNodes (Image ils (url,tit)) =+  (node (IMAGE (T.pack url) (T.pack tit)) (inlinesToNodes ils) :)+inlineToNodes (RawInline fmt xs)+  | fmt == Format "html" = (node (INLINE_HTML (T.pack xs)) [] :)+  | otherwise = id+inlineToNodes (Quoted qt ils) =+  ((node (TEXT start) [] : inlinesToNodes ils ++ [node (TEXT end) []]) ++)+  where (start, end) = case qt of+                          SingleQuote -> (T.pack "‘", T.pack "’")+                          DoubleQuote -> (T.pack "“", T.pack "”")+inlineToNodes (Code _ str) = (node (CODE (T.pack str)) [] :)+inlineToNodes (Math mt str) =+  case mt of+    InlineMath  ->+      (node (INLINE_HTML (T.pack ("\\(" ++ str ++ "\\)"))) [] :)+    DisplayMath ->+      (node (INLINE_HTML (T.pack ("\\[" ++ str ++ "\\]"))) [] :)+inlineToNodes (Span _ ils) = (inlinesToNodes ils ++)+inlineToNodes (Cite _ ils) = (inlinesToNodes ils ++)+inlineToNodes (Note _) = id -- should not occur+-- we remove Note elements in preprocessing
src/Text/Pandoc/Writers/ConTeXt.hs view
@@ -1,6 +1,6 @@ {-# LANGUAGE OverloadedStrings #-} {--Copyright (C) 2007-2014 John MacFarlane <jgm@berkeley.edu>+Copyright (C) 2007-2015 John MacFarlane <jgm@berkeley.edu>  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@@ -19,7 +19,7 @@  {- |    Module      : Text.Pandoc.Writers.ConTeXt-   Copyright   : Copyright (C) 2007-2014 John MacFarlane+   Copyright   : Copyright (C) 2007-2015 John MacFarlane    License     : GNU GPL, version 2 or above     Maintainer  : John MacFarlane <jgm@berkeley.edu>
src/Text/Pandoc/Writers/Custom.hs view
@@ -1,7 +1,11 @@-{-# LANGUAGE OverlappingInstances, FlexibleInstances, OverloadedStrings,-    ScopedTypeVariables #-} {-# OPTIONS_GHC -fno-warn-orphans #-}-{- Copyright (C) 2012-2014 John MacFarlane <jgm@berkeley.edu>+{-# LANGUAGE FlexibleInstances, OverloadedStrings,+    ScopedTypeVariables, DeriveDataTypeable, CPP #-}+#if MIN_VERSION_base(4,8,0)+#else+{-# LANGUAGE OverlappingInstances #-}+#endif+{- Copyright (C) 2012-2015 John MacFarlane <jgm@berkeley.edu>  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 +24,7 @@  {- |    Module      : Text.Pandoc.Writers.Custom-   Copyright   : Copyright (C) 2012-2014 John MacFarlane+   Copyright   : Copyright (C) 2012-2015 John MacFarlane    License     : GNU GPL, version 2 or above     Maintainer  : John MacFarlane <jgm@berkeley.edu>@@ -35,21 +39,23 @@ import Text.Pandoc.Options import Data.List ( intersperse ) import Data.Char ( toLower )+import Data.Typeable import Scripting.Lua (LuaState, StackValue, callfunc) import Text.Pandoc.Writers.Shared import qualified Scripting.Lua as Lua-import Text.Pandoc.UTF8 (fromString, toString)-import Data.ByteString (ByteString)-import qualified Data.ByteString.Char8 as C8+import qualified Text.Pandoc.UTF8 as UTF8 import Data.Monoid+import Control.Monad (when)+import Control.Exception import qualified Data.Map as M import Text.Pandoc.Templates+import GHC.IO.Encoding (getForeignEncoding,setForeignEncoding, utf8) -attrToMap :: Attr -> M.Map ByteString ByteString+attrToMap :: Attr -> M.Map String String attrToMap (id',classes,keyvals) = M.fromList-    $ ("id", fromString id')-    : ("class", fromString $ unwords classes)-    : map (\(x,y) -> (fromString x, fromString y)) keyvals+    $ ("id", id')+    : ("class", unwords classes)+    : keyvals  getList :: StackValue a => LuaState -> Int -> IO [a] getList lua i' = do@@ -63,12 +69,11 @@        return (x : rest)      else return [] -instance StackValue ByteString where-    push l x = Lua.push l $ C8.unpack x-    peek l n = (fmap . fmap) C8.pack (Lua.peek l n)-    valuetype _ = Lua.TSTRING-+#if MIN_VERSION_base(4,8,0)+instance {-# OVERLAPS #-} StackValue a => StackValue [a] where+#else instance StackValue a => StackValue [a] where+#endif   push lua xs = do     Lua.createtable lua (length xs + 1) 0     let addValue (i, x) = Lua.push lua x >> Lua.rawseti lua (-2) i@@ -107,12 +112,12 @@   valuetype _ = Lua.TTABLE  instance StackValue [Inline] where-  push l ils = Lua.push l . C8.unpack =<< inlineListToCustom l ils+  push l ils = Lua.push l =<< inlineListToCustom l ils   peek _ _ = undefined   valuetype _ = Lua.TSTRING  instance StackValue [Block] where-  push l ils = Lua.push l . C8.unpack =<< blockListToCustom l ils+  push l ils = Lua.push l =<< blockListToCustom l ils   peek _ _ = undefined   valuetype _ = Lua.TSTRING @@ -134,7 +139,7 @@ instance StackValue Citation where   push lua cit = do     Lua.createtable lua 6 0-    let addValue ((k :: String), v) = Lua.push lua k >> Lua.push lua v >>+    let addValue (k :: String, v) = Lua.push lua k >> Lua.push lua v >>                           Lua.rawset lua (-3)     addValue ("citationId", citationId cit)     addValue ("citationPrefix", citationPrefix cit)@@ -145,29 +150,41 @@   peek = undefined   valuetype _ = Lua.TTABLE +data PandocLuaException = PandocLuaException String+    deriving (Show, Typeable)++instance Exception PandocLuaException+ -- | Convert Pandoc to custom markup. writeCustom :: FilePath -> WriterOptions -> Pandoc -> IO String writeCustom luaFile opts doc@(Pandoc meta _) = do-  luaScript <- C8.unpack `fmap` C8.readFile luaFile+  luaScript <- UTF8.readFile luaFile+  enc <- getForeignEncoding+  setForeignEncoding utf8   lua <- Lua.newstate   Lua.openlibs lua-  Lua.loadstring lua luaScript "custom"+  status <- Lua.loadstring lua luaScript luaFile+  -- check for error in lua script (later we'll change the return type+  -- to handle this more gracefully):+  when (status /= 0) $+    Lua.tostring lua 1 >>= throw . PandocLuaException   Lua.call lua 0 0   -- TODO - call hierarchicalize, so we have that info   rendered <- docToCustom lua opts doc   context <- metaToJSON opts-             (fmap toString . blockListToCustom lua)-             (fmap toString . inlineListToCustom lua)+             (blockListToCustom lua)+             (inlineListToCustom lua)              meta   Lua.close lua-  let body = toString rendered+  setForeignEncoding enc+  let body = rendered   if writerStandalone opts      then do        let context' = setField "body" body context        return $ renderTemplate' (writerTemplate opts) context'      else return body -docToCustom :: LuaState -> WriterOptions -> Pandoc -> IO ByteString+docToCustom :: LuaState -> WriterOptions -> Pandoc -> IO String docToCustom lua opts (Pandoc (Meta metamap) blocks) = do   body <- blockListToCustom lua blocks   callfunc lua "Doc" body metamap (writerVariables opts)@@ -175,7 +192,7 @@ -- | Convert Pandoc block element to Custom. blockToCustom :: LuaState      -- ^ Lua state               -> Block         -- ^ Block element-              -> IO ByteString+              -> IO String  blockToCustom _ Null = return "" @@ -187,7 +204,7 @@ blockToCustom lua (Para inlines) = callfunc lua "Para" inlines  blockToCustom lua (RawBlock format str) =-  callfunc lua "RawBlock" format (fromString str)+  callfunc lua "RawBlock" format str  blockToCustom lua HorizontalRule = callfunc lua "HorizontalRule" @@ -195,7 +212,7 @@   callfunc lua "Header" level inlines (attrToMap attr)  blockToCustom lua (CodeBlock attr str) =-  callfunc lua "CodeBlock" (fromString str) (attrToMap attr)+  callfunc lua "CodeBlock" str (attrToMap attr)  blockToCustom lua (BlockQuote blocks) = callfunc lua "BlockQuote" blocks @@ -216,22 +233,22 @@ -- | Convert list of Pandoc block elements to Custom. blockListToCustom :: LuaState -- ^ Options                   -> [Block]       -- ^ List of block elements-                  -> IO ByteString+                  -> IO String blockListToCustom lua xs = do   blocksep <- callfunc lua "Blocksep"   bs <- mapM (blockToCustom lua) xs   return $ mconcat $ intersperse blocksep bs  -- | Convert list of Pandoc inline elements to Custom.-inlineListToCustom :: LuaState -> [Inline] -> IO ByteString+inlineListToCustom :: LuaState -> [Inline] -> IO String inlineListToCustom lua lst = do   xs <- mapM (inlineToCustom lua) lst-  return $ C8.concat xs+  return $ concat xs  -- | Convert Pandoc inline element to Custom.-inlineToCustom :: LuaState -> Inline -> IO ByteString+inlineToCustom :: LuaState -> Inline -> IO String -inlineToCustom lua (Str str) = callfunc lua "Str" $ fromString str+inlineToCustom lua (Str str) = callfunc lua "Str" str  inlineToCustom lua Space = callfunc lua "Space" @@ -254,24 +271,24 @@ inlineToCustom lua (Cite cs lst) = callfunc lua "Cite" lst cs  inlineToCustom lua (Code attr str) =-  callfunc lua "Code" (fromString str) (attrToMap attr)+  callfunc lua "Code" str (attrToMap attr)  inlineToCustom lua (Math DisplayMath str) =-  callfunc lua "DisplayMath" (fromString str)+  callfunc lua "DisplayMath" str  inlineToCustom lua (Math InlineMath str) =-  callfunc lua "InlineMath" (fromString str)+  callfunc lua "InlineMath" str  inlineToCustom lua (RawInline format str) =-  callfunc lua "RawInline" format (fromString str)+  callfunc lua "RawInline" format str  inlineToCustom lua (LineBreak) = callfunc lua "LineBreak"  inlineToCustom lua (Link txt (src,tit)) =-  callfunc lua "Link" txt (fromString src) (fromString tit)+  callfunc lua "Link" txt src tit  inlineToCustom lua (Image alt (src,tit)) =-  callfunc lua "Image" alt (fromString src) (fromString tit)+  callfunc lua "Image" alt src tit  inlineToCustom lua (Note contents) = callfunc lua "Note" contents 
src/Text/Pandoc/Writers/Docbook.hs view
@@ -1,6 +1,6 @@ {-# LANGUAGE OverloadedStrings, PatternGuards #-} {--Copyright (C) 2006-2014 John MacFarlane <jgm@berkeley.edu>+Copyright (C) 2006-2015 John MacFarlane <jgm@berkeley.edu>  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@@ -19,7 +19,7 @@  {- |    Module      : Text.Pandoc.Writers.Docbook-   Copyright   : Copyright (C) 2006-2014 John MacFarlane+   Copyright   : Copyright (C) 2006-2015 John MacFarlane    License     : GNU GPL, version 2 or above     Maintainer  : John MacFarlane <jgm@berkeley.edu>@@ -114,7 +114,8 @@                  n | n == 0           -> "chapter"                    | n >= 1 && n <= 5 -> "sect" ++ show n                    | otherwise        -> "simplesect"-  in  inTags True tag [("id", writerIdentifierPrefix opts ++ id')] $+  in  inTags True tag [("id", writerIdentifierPrefix opts ++ id') |+                       not (null id')] $       inTagsSimple "title" (inlinesToDocbook opts title) $$       vcat (map (elementToDocbook opts (lvl + 1)) elements') @@ -153,6 +154,14 @@ -- | Convert a Pandoc block element to Docbook. blockToDocbook :: WriterOptions -> Block -> Doc blockToDocbook _ Null = empty+-- Add ids to paragraphs in divs with ids - this is needed for+-- pandoc-citeproc to get link anchors in bibliographies:+blockToDocbook opts (Div (ident,_,_) [Para lst]) =+  let attribs = [("id", ident) | not (null ident)] in+  if hasLineBreaks lst+     then flush $ nowrap $ inTags False "literallayout" attribs+                         $ inlinesToDocbook opts lst+     else inTags True "para" attribs $ inlinesToDocbook opts lst blockToDocbook opts (Div _ bs) = blocksToDocbook opts $ map plainToPara bs blockToDocbook _ (Header _ _ _) = empty -- should not occur after hierarchicalize blockToDocbook opts (Plain lst) = inlinesToDocbook opts lst
src/Text/Pandoc/Writers/Docx.hs view
@@ -1,6 +1,6 @@-{-# LANGUAGE ScopedTypeVariables, PatternGuards #-}+{-# LANGUAGE ScopedTypeVariables, PatternGuards, ViewPatterns #-} {--Copyright (C) 2012-2014 John MacFarlane <jgm@berkeley.edu>+Copyright (C) 2012-2015 John MacFarlane <jgm@berkeley.edu>  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@@ -19,7 +19,7 @@  {- |    Module      : Text.Pandoc.Writers.Docx-   Copyright   : Copyright (C) 2012-2014 John MacFarlane+   Copyright   : Copyright (C) 2012-2015 John MacFarlane    License     : GNU GPL, version 2 or above     Maintainer  : John MacFarlane <jgm@berkeley.edu>@@ -29,7 +29,7 @@ Conversion of 'Pandoc' documents to docx. -} module Text.Pandoc.Writers.Docx ( writeDocx ) where-import Data.List ( intercalate, isPrefixOf, isSuffixOf, stripPrefix )+import Data.List ( intercalate, isPrefixOf, isSuffixOf ) import qualified Data.ByteString as B import qualified Data.ByteString.Lazy as BL import qualified Data.ByteString.Lazy.Char8 as BL8@@ -54,6 +54,8 @@ 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.State import Text.Highlighting.Kate import Data.Unique (hashUnique, newUnique)@@ -63,8 +65,8 @@ import Text.Pandoc.MIME (MimeType, getMimeType, getMimeTypeDef,                          extensionFromMimeType) import Control.Applicative ((<$>), (<|>), (<*>))-import Data.Maybe (fromMaybe, mapMaybe)-import Data.Char (isDigit)+import Data.Maybe (fromMaybe, mapMaybe, maybeToList)+import Data.Char (ord)  data ListMarker = NoMarker                 | BulletMarker@@ -106,14 +108,16 @@        , stChangesAuthor  :: String        , stChangesDate    :: String        , stPrintWidth     :: Integer-       , stHeadingStyles  :: [(Int,String)]+       , stStyleMaps      :: StyleMaps+       , stFirstPara      :: Bool+       , stTocTitle       :: [Inline]        }  defaultWriterState :: WriterState defaultWriterState = WriterState{         stTextProperties = []       , stParaProperties = []-      , stFootnotes      = []+      , stFootnotes      = defaultFootnotes       , stSectionIds     = []       , stExternalLinks  = M.empty       , stImages         = M.empty@@ -126,7 +130,9 @@       , stChangesAuthor  = "unknown"       , stChangesDate    = "1969-12-31T19:00:00Z"       , stPrintWidth     = 1-      , stHeadingStyles  = []+      , stStyleMaps      = defaultStyleMaps+      , stFirstPara      = False+      , stTocTitle       = normalizeInlines [Str "Table of Contents"]       }  type WS a = StateT WriterState IO a@@ -173,13 +179,36 @@ renumIds :: (QName -> Bool) -> (M.Map String String) -> [Element] -> [Element] renumIds f renumMap = map (renumId f renumMap) +-- | Certain characters are invalid in XML even if escaped.+-- See #1992+stripInvalidChars :: Pandoc -> Pandoc+stripInvalidChars = bottomUp (filter isValidChar)++-- | See XML reference+isValidChar :: Char -> Bool+isValidChar (ord -> c)+  | c == 0x9                      = True+  | c == 0xA                      = True+  | c == 0xD                      = True+  | 0x20 <= c &&  c <= 0xD7FF     = True+  | 0xE000 <= c && c <= 0xFFFD    = True+  | 0x10000 <= c && c <= 0x10FFFF = True+  | otherwise                     = False++metaValueToInlines :: MetaValue -> [Inline]+metaValueToInlines (MetaString s) = normalizeInlines [Str s]+metaValueToInlines (MetaInlines ils) = ils+metaValueToInlines (MetaBlocks bs) = query return bs+metaValueToInlines (MetaBool b) = [Str $ show b]+metaValueToInlines _ = []+ -- | Produce an Docx file from a Pandoc document. writeDocx :: WriterOptions  -- ^ Writer options           -> Pandoc         -- ^ Document to convert           -> IO BL.ByteString writeDocx opts doc@(Pandoc meta _) = do   let datadir = writerUserDataDir opts-  let doc' = walk fixDisplayMath doc+  let doc' = stripInvalidChars . walk fixDisplayMath $ doc   username <- lookup "USERNAME" <$> getEnvironment   utctime <- getCurrentTime   refArchive <- liftM (toArchive . toLazy) $@@ -213,32 +242,18 @@   styledoc <- parseXml refArchive distArchive stylepath    -- parse styledoc for heading styles-  let styleNamespaces = map ((,) <$> qName . attrKey <*> attrVal) .-                        filter ((==Just "xmlns") . qPrefix . attrKey) .-                        elAttribs $ styledoc-  let headingStyles =-       let-           mywURI = lookup "w" styleNamespaces-           myName name = QName name mywURI (Just "w")-           getAttrStyleId = findAttr (myName "styleId")-           getNameVal = findChild (myName "name") >=> findAttr (myName "val")-           getNum s | not $ null s, all isDigit s = Just (read s :: Int)-                    | otherwise = Nothing-           getEngHeader = getAttrStyleId >=> stripPrefix "Heading" >=> getNum-           getIntHeader = getNameVal >=> stripPrefix "heading " >=> getNum-           toTuple getF = liftM2 (,) <$> getF <*> getAttrStyleId-           toMap getF = mapMaybe (toTuple getF) $-                        findChildren (myName "style") styledoc-           select a b | not $ null a = a-                      | otherwise = b-           in-              select (toMap getEngHeader) (toMap getIntHeader)+  let styleMaps = getStyleMaps styledoc +  let tocTitle = fromMaybe (stTocTitle defaultWriterState) $+                    metaValueToInlines <$> lookupMeta "toc-title" meta+   ((contents, footnotes), st) <- runStateT (writeOpenXML opts{writerWrapText = False} doc')                        defaultWriterState{ stChangesAuthor = fromMaybe "unknown" username                                          , stChangesDate   = formatTime defaultTimeLocale "%FT%XZ" utctime                                          , stPrintWidth = (maybe 420 (\x -> quot x 20) pgContentWidth)-                                         , stHeadingStyles = headingStyles}+                                         , stStyleMaps  = styleMaps+                                         , stTocTitle   = tocTitle+                                         }   let epochtime = floor $ utcTimeToPOSIXSeconds utctime   let imgs = M.elems $ stImages st @@ -391,9 +406,18 @@         linkrels    -- styles-  let newstyles = styleToOpenXml $ writerHighlightStyle opts-  let styledoc' = styledoc{ elContent = elContent styledoc ++-                  [Elem x | x <- newstyles, writerHighlight opts] }+  let newstyles = styleToOpenXml styleMaps $ writerHighlightStyle opts+  let styledoc' = styledoc{ elContent = modifyContent (elContent styledoc) }+                  where+                    modifyContent+                      | writerHighlight opts = (++ map Elem newstyles)+                      | otherwise = filter notTokStyle+                    notTokStyle (Elem el) = notStyle el || notTokId el+                    notTokStyle _         = True+                    notStyle = (/= elemName' "style") . elName+                    notTokId = maybe True (`notElem` tokStys) . findAttr (elemName' "styleId")+                    tokStys  = "SourceCode" : map show (enumFromTo KeywordTok NormalTok)+                    elemName' = elemName (sNameSpaces styleMaps) "w"   let styleEntry = toEntry stylepath epochtime $ renderXml styledoc'    -- construct word/numbering.xml@@ -438,6 +462,17 @@         ]   let relsEntry = toEntry relsPath epochtime $ renderXml rels +  -- we use dist archive for settings.xml, because Word sometimes+  -- adds references to footnotes or endnotes we don't have...+  -- we do, however, copy some settings over from reference+  let settingsPath = "word/settings.xml"+      settingsList = [ "w:autoHyphenation"+                     , "w:consecutiveHyphenLimit"+                     , "w:hyphenationZone"+                     , "w:doNotHyphenateCap"+                     ]+  settingsEntry <- copyChildren refArchive distArchive settingsPath epochtime settingsList+   let entryFromArchive arch path =          maybe (fail $ path ++ " corrupt or missing in reference docx")                return@@ -445,9 +480,6 @@   docPropsAppEntry <- entryFromArchive refArchive "docProps/app.xml"   themeEntry <- entryFromArchive refArchive "word/theme/theme1.xml"   fontTableEntry <- entryFromArchive refArchive "word/fontTable.xml"-  -- we use dist archive for settings.xml, because Word sometimes-  -- adds references to footnotes or endnotes we don't have...-  settingsEntry <- entryFromArchive distArchive "word/settings.xml"   webSettingsEntry <- entryFromArchive refArchive "word/webSettings.xml"   headerFooterEntries <- mapM (entryFromArchive refArchive) $                      mapMaybe (fmap ("word/" ++) . extractTarget)@@ -470,10 +502,13 @@                   miscRelEntries ++ otherMediaEntries   return $ fromArchive archive -styleToOpenXml :: Style -> [Element]-styleToOpenXml style = parStyle : map toStyle alltoktypes+styleToOpenXml :: StyleMaps -> Style -> [Element]+styleToOpenXml sm style =+  maybeToList parStyle ++ mapMaybe toStyle alltoktypes   where alltoktypes = enumFromTo KeywordTok NormalTok-        toStyle toktype = mknode "w:style" [("w:type","character"),+        toStyle toktype | hasStyleName (show toktype) (sCharStyleMap sm) = Nothing+                        | otherwise = Just $+                          mknode "w:style" [("w:type","character"),                            ("w:customStyle","1"),("w:styleId",show toktype)]                              [ mknode "w:name" [("w:val",show toktype)] ()                              , mknode "w:basedOn" [("w:val","VerbatimChar")] ()@@ -494,17 +529,35 @@         tokBg toktype = maybe "auto" (drop 1 . fromColor)                          $ (tokenBackground =<< lookup toktype tokStyles)                            `mplus` backgroundColor style-        parStyle = mknode "w:style" [("w:type","paragraph"),+        parStyle | hasStyleName "Source Code" (sParaStyleMap sm) = Nothing+                 | otherwise = Just $+                   mknode "w:style" [("w:type","paragraph"),                            ("w:customStyle","1"),("w:styleId","SourceCode")]                              [ mknode "w:name" [("w:val","Source Code")] ()                              , mknode "w:basedOn" [("w:val","Normal")] ()                              , mknode "w:link" [("w:val","VerbatimChar")] ()                              , mknode "w:pPr" []                                $ mknode "w:wordWrap" [("w:val","off")] ()+                               : mknode "w:noProof" [] ()                                : ( maybe [] (\col -> [mknode "w:shd" [("w:val","clear"),("w:fill",drop 1 $ fromColor col)] ()])                                  $ backgroundColor style )                              ] +copyChildren :: Archive -> Archive -> String -> Integer -> [String] -> IO Entry+copyChildren refArchive distArchive path timestamp elNames = do+  ref  <- parseXml refArchive distArchive path+  dist <- parseXml distArchive distArchive path+  return $ toEntry path timestamp $ renderXml dist{+      elContent = elContent dist ++ copyContent ref+    }+  where+    strName QName{qName=name, qPrefix=prefix}+      | Just p <- prefix = p++":"++name+      | otherwise        = name+    shouldCopy = (`elem` elNames) . strName+    cleanElem el@Element{elName=name} = Elem el{elName=name{qURI=Nothing}}+    copyContent = map cleanElem . filterChildrenName shouldCopy+ -- this is the lowest number used for a list numId baseListId :: Int baseListId = 1000@@ -582,6 +635,34 @@ getNumId :: WS Int getNumId = (((baseListId - 1) +) . length) `fmap` gets stLists +makeTOC :: WriterOptions -> WS [Element]+makeTOC opts | writerTableOfContents opts = do+  let depth = "1-"++(show (writerTOCDepth opts))+  let tocCmd = "TOC \\o \""++depth++"\" \\h \\z \\u"+  tocTitle <- gets stTocTitle+  title <- withParaPropM (pStyleM "TOC Heading") (blocksToOpenXML opts [Para tocTitle])+  return $+    [mknode "w:sdt" [] ([+      mknode "w:sdtPr" [] (+        mknode "w:docPartObj" [] (+          [mknode "w:docPartGallery" [("w:val","Table of Contents")] (),+          mknode "w:docPartUnique" [] ()]+        ) -- w:docPartObj+      ), -- w:sdtPr+      mknode "w:sdtContent" [] (title++[+        mknode "w:p" [] (+          mknode "w:r" [] ([+            mknode "w:fldChar" [("w:fldCharType","begin"),("w:dirty","true")] (),+            mknode "w:instrText" [("xml:space","preserve")] tocCmd,+            mknode "w:fldChar" [("w:fldCharType","separate")] (),+            mknode "w:fldChar" [("w:fldCharType","end")] ()+          ]) -- w:r+        ) -- w:p+      ])+    ])] -- w:sdt+makeTOC _ = return []++ -- | Convert Pandoc document to two lists of -- OpenXML elements (the main document and footnotes). writeOpenXML :: WriterOptions -> Pandoc -> WS ([Element], [Element])@@ -600,33 +681,46 @@                        Just (MetaBlocks [Para  xs]) -> xs                        Just (MetaInlines xs)        -> xs                        _ -> []-  title <- withParaProp (pStyle "Title") $ blocksToOpenXML opts [Para tit | not (null tit)]-  subtitle <- withParaProp (pStyle "Subtitle") $ blocksToOpenXML opts [Para subtitle' | not (null subtitle')]-  authors <- withParaProp (pStyle "Author") $ blocksToOpenXML opts $+  title <- withParaPropM (pStyleM "Title") $ blocksToOpenXML opts [Para tit | not (null tit)]+  subtitle <- withParaPropM (pStyleM "Subtitle") $ blocksToOpenXML opts [Para subtitle' | not (null subtitle')]+  authors <- withParaProp (pCustomStyle "Author") $ blocksToOpenXML opts $        map Para auths-  date <- withParaProp (pStyle "Date") $ blocksToOpenXML opts [Para dat | not (null dat)]+  date <- withParaPropM (pStyleM "Date") $ blocksToOpenXML opts [Para dat | not (null dat)]   abstract <- if null abstract'                  then return []-                 else withParaProp (pStyle "Abstract") $ blocksToOpenXML opts abstract'+                 else withParaProp (pCustomStyle "Abstract") $ blocksToOpenXML opts abstract'   let convertSpace (Str x : Space : Str y : xs) = Str (x ++ " " ++ y) : xs       convertSpace (Str x : Str y : xs) = Str (x ++ y) : xs       convertSpace xs = xs   let blocks' = bottomUp convertSpace blocks-  doc' <- blocksToOpenXML opts blocks'+  doc' <- (setFirstPara >> blocksToOpenXML opts blocks')   notes' <- reverse `fmap` gets stFootnotes-  let meta' = title ++ subtitle ++ authors ++ date ++ abstract+  toc <- makeTOC opts+  let meta' = title ++ subtitle ++ authors ++ date ++ abstract ++ toc   return (meta' ++ doc', notes')  -- | Convert a list of Pandoc blocks to OpenXML. blocksToOpenXML :: WriterOptions -> [Block] -> WS [Element] blocksToOpenXML opts bls = concat `fmap` mapM (blockToOpenXML opts) bls -pStyle :: String -> Element-pStyle sty = mknode "w:pStyle" [("w:val",sty)] ()+pCustomStyle :: String -> Element+pCustomStyle sty = mknode "w:pStyle" [("w:val",sty)] () -rStyle :: String -> Element-rStyle sty = mknode "w:rStyle" [("w:val",sty)] ()+pStyleM :: String -> WS XML.Element+pStyleM styleName = do+  styleMaps <- gets stStyleMaps+  let sty' = getStyleId styleName $ sParaStyleMap styleMaps+  return $ mknode "w:pStyle" [("w:val",sty')] () +rCustomStyle :: String -> Element+rCustomStyle sty = mknode "w:rStyle" [("w:val",sty)] ()++rStyleM :: String -> WS XML.Element+rStyleM styleName = do+  styleMaps <- gets stStyleMaps+  let sty' = getStyleId styleName $ sCharStyleMap styleMaps+  return $ mknode "w:rStyle" [("w:val",sty')] ()+ getUniqueId :: MonadIO m => m String -- the + 20 is to ensure that there are no clashes with the rIds -- already in word/document.xml.rel@@ -639,12 +733,12 @@   let (hs, bs') = span isHeaderBlock bs   header <- blocksToOpenXML opts hs   -- We put the Bibliography style on paragraphs after the header-  rest <- withParaProp (pStyle "Bibliography") $ blocksToOpenXML opts bs'+  rest <- withParaPropM (pStyleM "Bibliography") $ blocksToOpenXML opts bs'   return (header ++ rest) blockToOpenXML opts (Div _ bs) = blocksToOpenXML opts bs blockToOpenXML opts (Header lev (ident,_,_) lst) = do-  headingStyles <- gets stHeadingStyles-  paraProps <- maybe id (withParaProp . pStyle) (lookup lev headingStyles) $+  setFirstPara+  paraProps <- withParaPropM (pStyleM ("Heading "++show lev)) $                     getParaProps False   contents <- inlinesToOpenXML opts lst   usedIdents <- gets stSectionIds@@ -657,40 +751,60 @@                                                ,("w:name",bookmarkName)] ()   let bookmarkEnd = mknode "w:bookmarkEnd" [("w:id", id')] ()   return [mknode "w:p" [] (paraProps ++ [bookmarkStart, bookmarkEnd] ++ contents)]-blockToOpenXML opts (Plain lst) = withParaProp (pStyle "Compact")+blockToOpenXML opts (Plain lst) = withParaProp (pCustomStyle "Compact")   $ blockToOpenXML opts (Para lst) -- title beginning with fig: indicates that the image is a figure blockToOpenXML opts (Para [Image alt (src,'f':'i':'g':':':tit)]) = do+  setFirstPara+  pushParaProp $ pCustomStyle $+    if null alt+      then "Figure"+      else "FigureWithCaption"   paraProps <- getParaProps False+  popParaProp   contents <- inlinesToOpenXML opts [Image alt (src,tit)]-  captionNode <- withParaProp (pStyle "ImageCaption")+  captionNode <- withParaProp (pCustomStyle "ImageCaption")                  $ blockToOpenXML opts (Para alt)   return $ mknode "w:p" [] (paraProps ++ contents) : captionNode -- fixDisplayMath sometimes produces a Para [] as artifact blockToOpenXML _ (Para []) = return [] blockToOpenXML opts (Para lst) = do-    paraProps <- getParaProps $ case lst of-                                     [Math DisplayMath _] -> True-                                     _                    -> False-    contents <- inlinesToOpenXML opts lst-    return [mknode "w:p" [] (paraProps ++ contents)]+  isFirstPara <- gets stFirstPara+  paraProps <- getParaProps $ case lst of+                               [Math DisplayMath _] -> True+                               _                    -> False+  bodyTextStyle <- pStyleM "Body Text"+  let paraProps' = case paraProps of+        [] | isFirstPara -> [mknode "w:pPr" [] [pCustomStyle "FirstParagraph"]]+        []               -> [mknode "w:pPr" [] [bodyTextStyle]]+        ps               -> ps+  modify $ \s -> s { stFirstPara = False }+  contents <- inlinesToOpenXML opts lst+  return [mknode "w:p" [] (paraProps' ++ contents)] blockToOpenXML _ (RawBlock format str)   | format == Format "openxml" = return [ x | Elem x <- parseXML str ]   | otherwise                  = return []-blockToOpenXML opts (BlockQuote blocks) =-  withParaProp (pStyle "BlockQuote") $ blocksToOpenXML opts blocks-blockToOpenXML opts (CodeBlock attrs str) =-  withParaProp (pStyle "SourceCode") $ blockToOpenXML opts $ Para [Code attrs str]-blockToOpenXML _ HorizontalRule = return [-  mknode "w:p" [] $ mknode "w:r" [] $ mknode "w:pict" []+blockToOpenXML opts (BlockQuote blocks) = do+  p <- withParaPropM (pStyleM "Block Text") $ blocksToOpenXML opts blocks+  setFirstPara+  return p+blockToOpenXML opts (CodeBlock attrs str) = do+  p <- withParaProp (pCustomStyle "SourceCode") (blockToOpenXML opts $ Para [Code attrs str])+  setFirstPara+  return p+blockToOpenXML _ HorizontalRule = do+  setFirstPara+  return [+    mknode "w:p" [] $ mknode "w:r" [] $ mknode "w:pict" []     $ mknode "v:rect" [("style","width:0;height:1.5pt"),                        ("o:hralign","center"),                        ("o:hrstd","t"),("o:hr","t")] () ] blockToOpenXML opts (Table caption aligns widths headers rows) = do+  setFirstPara   let captionStr = stringify caption   caption' <- if null caption                  then return []-                 else withParaProp (pStyle "TableCaption")+                 else withParaProp (pCustomStyle "TableCaption")                       $ blockToOpenXML opts (Para caption)   let alignmentFor al = mknode "w:jc" [("w:val",alignmentToString al)] ()   let cellToOpenXML (al, cell) = withParaProp (alignmentFor al)@@ -701,52 +815,62 @@                     [ mknode "w:tcBorders" []                       $ mknode "w:bottom" [("w:val","single")] ()                     , mknode "w:vAlign" [("w:val","bottom")] () ]-  let emptyCell = [mknode "w:p" [] [mknode "w:pPr" []-                    [mknode "w:pStyle" [("w:val","Compact")] ()]]]+  let emptyCell = [mknode "w:p" [] [pCustomStyle "Compact"]]   let mkcell border contents = mknode "w:tc" []                             $ [ borderProps | border ] ++                             if null contents                                then emptyCell                                else contents-  let mkrow border cells = mknode "w:tr" [] $ map (mkcell border) cells+  let mkrow border cells = mknode "w:tr" [] $+                        [mknode "w:trPr" [] [+                          mknode "w:cnfStyle" [("w:firstRow","1")] ()] | border]+                        ++ map (mkcell border) cells   let textwidth = 7920  -- 5.5 in in twips, 1/20 pt   let fullrow = 5000 -- 100% specified in pct   let rowwidth = fullrow * sum widths   let mkgridcol w = mknode "w:gridCol"                        [("w:w", show (floor (textwidth * w) :: Integer))] ()+  let hasHeader = not (all null headers)   return $     caption' ++     [mknode "w:tbl" []       ( mknode "w:tblPr" []         (   mknode "w:tblStyle" [("w:val","TableNormal")] () :             mknode "w:tblW" [("w:type", "pct"), ("w:w", show rowwidth)] () :+            mknode "w:tblLook" [("w:firstRow","1") | hasHeader ] () :           [ mknode "w:tblCaption" [("w:val", captionStr)] ()           | not (null caption) ] )       : mknode "w:tblGrid" []         (if all (==0) widths             then []             else map mkgridcol widths)-      : [ mkrow True headers' | not (all null headers) ] +++      : [ mkrow True headers' | hasHeader ] ++       map (mkrow False) rows'       )] blockToOpenXML opts (BulletList lst) = do   let marker = BulletMarker   addList marker   numid  <- getNumId-  asList $ concat `fmap` mapM (listItemToOpenXML opts numid) lst+  l <- asList $ concat `fmap` mapM (listItemToOpenXML opts numid) lst+  setFirstPara+  return l blockToOpenXML opts (OrderedList (start, numstyle, numdelim) lst) = do   let marker = NumberMarker numstyle numdelim start   addList marker   numid  <- getNumId-  asList $ concat `fmap` mapM (listItemToOpenXML opts numid) lst-blockToOpenXML opts (DefinitionList items) =-  concat `fmap` mapM (definitionListItemToOpenXML opts) items+  l <- asList $ concat `fmap` mapM (listItemToOpenXML opts numid) lst+  setFirstPara+  return l+blockToOpenXML opts (DefinitionList items) = do+  l <- concat `fmap` mapM (definitionListItemToOpenXML opts) items+  setFirstPara+  return l  definitionListItemToOpenXML  :: WriterOptions -> ([Inline],[[Block]]) -> WS [Element] definitionListItemToOpenXML opts (term,defs) = do-  term' <- withParaProp (pStyle "DefinitionTerm")+  term' <- withParaProp (pCustomStyle "DefinitionTerm")            $ blockToOpenXML opts (Para term)-  defs' <- withParaProp (pStyle "Definition")+  defs' <- withParaProp (pCustomStyle "Definition")            $ concat `fmap` mapM (blocksToOpenXML opts) defs   return $ term' ++ defs' @@ -810,6 +934,9 @@   popTextProp   return res +withTextPropM :: WS Element -> WS a -> WS a+withTextPropM = (. flip withTextProp) . (>>=)+ getParaProps :: Bool -> WS [Element] getParaProps displayMathPara = do   props <- gets stParaProperties@@ -838,6 +965,9 @@   popParaProp   return res +withParaPropM :: WS Element -> WS a -> WS a+withParaPropM = (. flip withParaProp) . (>>=)+ formattedString :: String -> WS [Element] formattedString str = do   props <- getTextProps@@ -847,6 +977,9 @@              [ mknode (if inDel then "w:delText" else "w:t")                [("xml:space","preserve")] str ] ] +setFirstPara :: WS ()+setFirstPara =  modify $ \s -> s { stFirstPara = True }+ -- | Convert an inline element to OpenXML. inlineToOpenXML :: WriterOptions -> Inline -> WS [Element] inlineToOpenXML _ (Str str) = formattedString str@@ -917,25 +1050,26 @@         Right r -> return [r]         Left  _ -> inlinesToOpenXML opts (texMathToInlines mathType str) inlineToOpenXML opts (Cite _ lst) = inlinesToOpenXML opts lst-inlineToOpenXML opts (Code attrs str) =-  withTextProp (rStyle "VerbatimChar")-  $ if writerHighlight opts-       then case highlight formatOpenXML attrs str of-             Nothing  -> unhighlighted-             Just h   -> return h-       else unhighlighted-     where unhighlighted = intercalate [br] `fmap`-                             (mapM formattedString $ lines str)-           formatOpenXML _fmtOpts = intercalate [br] . map (map toHlTok)-           toHlTok (toktype,tok) = mknode "w:r" []-                                     [ mknode "w:rPr" []-                                       [ rStyle $ show toktype ]-                                     , mknode "w:t" [("xml:space","preserve")] tok ]+inlineToOpenXML opts (Code attrs str) = do+  let unhighlighted = intercalate [br] `fmap`+                       (mapM formattedString $ lines str)+      formatOpenXML _fmtOpts = intercalate [br] . map (map toHlTok)+      toHlTok (toktype,tok) = mknode "w:r" []+                               [ mknode "w:rPr" []+                                 [ rCustomStyle (show toktype) ]+                               , mknode "w:t" [("xml:space","preserve")] tok ]+  withTextProp (rCustomStyle "VerbatimChar")+    $ if writerHighlight opts+         then case highlight formatOpenXML attrs str of+               Nothing  -> unhighlighted+               Just h   -> return h+         else unhighlighted inlineToOpenXML opts (Note bs) = do   notes <- gets stFootnotes   notenum <- getUniqueId+  footnoteStyle <- rStyleM "Footnote Reference"   let notemarker = mknode "w:r" []-                   [ mknode "w:rPr" [] (rStyle "FootnoteRef")+                   [ mknode "w:rPr" [] footnoteStyle                    , mknode "w:footnoteRef" [] () ]   let notemarkerXml = RawInline (Format "openxml") $ ppElement notemarker   let insertNoteRef (Plain ils : xs) = Plain (notemarkerXml : ils) : xs@@ -945,22 +1079,22 @@   oldParaProperties <- gets stParaProperties   oldTextProperties <- gets stTextProperties   modify $ \st -> st{ stListLevel = -1, stParaProperties = [], stTextProperties = [] }-  contents <- withParaProp (pStyle "FootnoteText") $ blocksToOpenXML opts+  contents <- withParaPropM (pStyleM "Footnote Text") $ blocksToOpenXML opts                 $ insertNoteRef bs   modify $ \st -> st{ stListLevel = oldListLevel, stParaProperties = oldParaProperties,                       stTextProperties = oldTextProperties }   let newnote = mknode "w:footnote" [("w:id", notenum)] $ contents   modify $ \s -> s{ stFootnotes = newnote : notes }   return [ mknode "w:r" []-           [ mknode "w:rPr" [] (rStyle "FootnoteRef")+           [ mknode "w:rPr" [] footnoteStyle            , mknode "w:footnoteReference" [("w:id", notenum)] () ] ] -- internal link: inlineToOpenXML opts (Link txt ('#':xs,_)) = do-  contents <- withTextProp (rStyle "Link") $ inlinesToOpenXML opts txt+  contents <- withTextPropM (rStyleM "Hyperlink") $ inlinesToOpenXML opts txt   return [ mknode "w:hyperlink" [("w:anchor",xs)] contents ] -- external link: inlineToOpenXML opts (Link txt (src,_)) = do-  contents <- withTextProp (rStyle "Link") $ inlinesToOpenXML opts txt+  contents <- withTextPropM (rStyleM "Hyperlink") $ inlinesToOpenXML opts txt   extlinks <- gets stExternalLinks   id' <- case M.lookup src extlinks of             Just i   -> return i@@ -986,8 +1120,13 @@           inlinesToOpenXML opts alt         Right (img, mt) -> do           ident <- ("rId"++) `fmap` getUniqueId-          let size = imageSize img-          let (xpt,ypt) = maybe (120,120) sizeInPoints size+          (xpt,ypt) <- case imageSize img of+                             Right size  -> return $ sizeInPoints size+                             Left msg    -> do+                               liftIO $ warn $+                                 "Could not determine image size in `" +++                                 src ++ "': " ++ msg+                               return (120,120)           -- 12700 emu = 1 pt           let (xemu,yemu) = fitToPage (xpt * 12700, ypt * 12700) (pageWidth * 12700)           let cNvPicPr = mknode "pic:cNvPicPr" [] $@@ -1046,6 +1185,22 @@  br :: Element br = mknode "w:r" [] [mknode "w:br" [("w:type","textWrapping")] () ]++-- Word will insert these footnotes into the settings.xml file+-- (whether or not they're visible in the document). If they're in the+-- file, but not in the footnotes.xml file, it will produce+-- problems. So we want to make sure we insert them into our document.+defaultFootnotes :: [Element]+defaultFootnotes = [ mknode "w:footnote"+                     [("w:type", "separator"), ("w:id", "-1")] $+                     [ mknode "w:p" [] $+                       [mknode "w:r" [] $+                        [ mknode "w:separator" [] ()]]]+                   , mknode "w:footnote"+                     [("w:type", "continuationSeparator"), ("w:id", "0")] $+                     [ mknode "w:p" [] $+                       [ mknode "w:r" [] $+                         [ mknode "w:continuationSeparator" [] ()]]]]  parseXml :: Archive -> Archive -> String -> IO Element parseXml refArchive distArchive relpath =
src/Text/Pandoc/Writers/DokuWiki.hs view
@@ -1,5 +1,5 @@ {--Copyright (C) 2008-2014 John MacFarlane <jgm@berkeley.edu>+Copyright (C) 2008-2015 John MacFarlane <jgm@berkeley.edu>  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@@ -18,7 +18,7 @@  {- |    Module      : Text.Pandoc.Writers.DokuWiki-   Copyright   : Copyright (C) 2008-2014 John MacFarlane+   Copyright   : Copyright (C) 2008-2015 John MacFarlane    License     : GNU GPL, version 2 or above     Maintainer  : Clare Macrae <clare.macrae@googlemail.com>@@ -459,7 +459,7 @@   | f == Format "html"     = return $ "<html>" ++ str ++ "</html>"   | otherwise              = return "" -inlineToDokuWiki _ (LineBreak) = return "\\\\ "+inlineToDokuWiki _ (LineBreak) = return "\\\\\n"  inlineToDokuWiki _ Space = return " " 
src/Text/Pandoc/Writers/EPUB.hs view
@@ -1,6 +1,6 @@ {-# LANGUAGE PatternGuards, CPP, ScopedTypeVariables, ViewPatterns, FlexibleContexts #-} {--Copyright (C) 2010-2014 John MacFarlane <jgm@berkeley.edu>+Copyright (C) 2010-2015 John MacFarlane <jgm@berkeley.edu>  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@@ -19,7 +19,7 @@  {- |    Module      : Text.Pandoc.Writers.EPUB-   Copyright   : Copyright (C) 2010-2014 John MacFarlane+   Copyright   : Copyright (C) 2010-2015 John MacFarlane    License     : GNU GPL, version 2 or above     Maintainer  : John MacFarlane <jgm@berkeley.edu>@@ -31,11 +31,12 @@ module Text.Pandoc.Writers.EPUB ( writeEPUB ) where import Data.IORef ( IORef, newIORef, readIORef, modifyIORef ) import qualified Data.Map as M-import Data.Maybe ( fromMaybe )+import Data.Maybe ( fromMaybe, catMaybes ) import Data.List ( isPrefixOf, isInfixOf, intercalate ) import System.Environment ( getEnv ) import Text.Printf (printf) import System.FilePath ( takeExtension, takeFileName )+import System.FilePath.Glob ( namesMatching ) import qualified Data.ByteString.Lazy as B import qualified Data.ByteString.Lazy.Char8 as B8 import qualified Text.Pandoc.UTF8 as UTF8@@ -55,16 +56,18 @@                            , EPUBVersion(..)                            , ObfuscationMethod(NoObfuscation) ) import Text.Pandoc.Definition-import Text.Pandoc.Walk (walk, walkM)-import Control.Monad.State (modify, get, execState, State, put, evalState)-import Control.Monad (foldM, when, mplus, liftM)+import Text.Pandoc.Walk (walk, walkM, query)+import Data.Default+import Text.Pandoc.Writers.Markdown (writePlain)+import Control.Monad.State (modify, get, State, put, evalState)+import Control.Monad (mplus, liftM, when) import Text.XML.Light ( unode, Element(..), unqual, Attr(..), add_attrs                       , strContent, lookupAttr, Node(..), QName(..), parseXML                       , onlyElems, node, ppElement) import Text.Pandoc.UUID (getRandomUUID) import Text.Pandoc.Writers.HTML (writeHtmlString, writeHtml) import Data.Char ( toLower, isDigit, isAlphaNum )-import Text.Pandoc.MIME (MimeType, getMimeType)+import Text.Pandoc.MIME (MimeType, getMimeType, extensionFromMimeType) import qualified Control.Exception as E import Text.Blaze.Html.Renderer.Utf8 (renderHtml) import Text.HTML.TagSoup (Tag(TagOpen), fromAttrib, parseTags)@@ -225,8 +228,9 @@  metaValueToString :: MetaValue -> String metaValueToString (MetaString s) = s-metaValueToString (MetaInlines ils) = stringify ils-metaValueToString (MetaBlocks bs) = stringify bs+metaValueToString (MetaInlines ils) = writePlain def+                                      (Pandoc nullMeta [Plain ils])+metaValueToString (MetaBlocks bs) = writePlain def (Pandoc nullMeta bs) metaValueToString (MetaBool b) = show b metaValueToString _ = "" @@ -374,21 +378,17 @@   mediaRef <- newIORef []   Pandoc _ blocks <- walkM (transformInline opts' mediaRef) doc >>=                      walkM (transformBlock opts' mediaRef)-  pics <- readIORef mediaRef-  let readPicEntry entries (oldsrc, newsrc) = do-        res <- fetchItem' (writerMediaBag opts')-                  (writerSourceURL opts') oldsrc-        case res of-             Left _        -> do-              warn $ "Could not find media `" ++ oldsrc ++ "', skipping..."-              return entries-             Right (img,_) -> return $-              (toEntry newsrc epochtime $ B.fromChunks . (:[]) $ img) : entries-  picEntries <- foldM readPicEntry [] pics+  picEntries <- (catMaybes . map (snd . snd)) <$> readIORef mediaRef    -- handle fonts+  let matchingGlob f = do+        xs <- namesMatching f+        when (null xs) $+          warn $ f ++ " did not match any font files."+        return xs   let mkFontEntry f = mkEntry (takeFileName f) `fmap` B.readFile f-  fontEntries <- mapM mkFontEntry $ writerEpubFonts opts'+  fontFiles <- concat <$> mapM matchingGlob (writerEpubFonts opts')+  fontEntries <- mapM mkFontEntry fontFiles    -- set page progression direction attribution   let progressionDirection = case epubPageDirection metadata of@@ -408,17 +408,16 @@                                                  (docTitle' meta) : blocks    let chapterHeaderLevel = writerEpubChapterLevel opts-  -- internal reference IDs change when we chunk the file,-  -- so that '#my-header-1' might turn into 'chap004.xhtml#my-header'.-  -- the next two lines fix that:-  let reftable = correlateRefs chapterHeaderLevel blocks'-  let blocks'' = replaceRefs reftable blocks'    let isChapterHeader (Header n _ _) = n <= chapterHeaderLevel+      isChapterHeader (Div ("",["references"],[]) (Header n _ _:_)) =+        n <= chapterHeaderLevel       isChapterHeader _ = False    let toChapters :: [Block] -> State [Int] [Chapter]       toChapters []     = return []+      toChapters (Div ("",["references"],[]) bs@(Header 1 _ _:_) : rest) =+        toChapters (bs ++ rest)       toChapters (Header n attr@(_,classes,_) ils : bs) = do         nums <- get         mbnum <- if "unnumbered" `elem` classes@@ -439,8 +438,38 @@         let (xs,ys) = break isChapterHeader bs         (Chapter Nothing (b:xs) :) `fmap` toChapters ys -  let chapters = evalState (toChapters blocks'') []+  let chapters' = evalState (toChapters blocks') [] +  let extractLinkURL' :: Int -> Inline -> [(String, String)]+      extractLinkURL' num (Span (ident, _, _) _)+        | not (null ident) = [(ident, showChapter num ++ ('#':ident))]+      extractLinkURL' _ _ = []++  let extractLinkURL :: Int -> Block -> [(String, String)]+      extractLinkURL num (Div (ident, _, _) _)+        | not (null ident) = [(ident, showChapter num ++ ('#':ident))]+      extractLinkURL num (Header _ (ident, _, _) _)+        | not (null ident) = [(ident, showChapter num ++ ('#':ident))]+      extractLinkURL num b = query (extractLinkURL' num) b++  let reftable = concat $ zipWith (\(Chapter _ bs) num ->+                                    query (extractLinkURL num) bs)+                          chapters' [1..]++  let fixInternalReferences :: Inline -> Inline+      fixInternalReferences (Link lab ('#':xs, tit)) =+        case lookup xs reftable of+             Just ys ->  Link lab (ys, tit)+             Nothing -> Link lab ('#':xs, tit)+      fixInternalReferences x = x++  -- internal reference IDs change when we chunk the file,+  -- so that '#my-header-1' might turn into 'chap004.xhtml#my-header'.+  -- this fixes that:+  let chapters = map (\(Chapter mbnum bs) ->+                         Chapter mbnum $ walk fixInternalReferences bs)+                 chapters'+   let chapToEntry :: Int -> Chapter -> Entry       chapToEntry num (Chapter mbnum bs) = mkEntry (showChapter num)         $ renderHtml@@ -488,6 +517,9 @@                                    []   -> "UNTITLED"                                    (x:_) -> titleText x                         x  -> stringify x++  let tocTitle = fromMaybe plainTitle $+                   metaValueToString <$> lookupMeta "toc-title" meta   let uuid = case epubIdentifier metadata of                   (x:_) -> identifierText x  -- use first identifier as UUID                   []    -> error "epubIdentifier is null"  -- shouldn't happen@@ -521,7 +553,7 @@               case epubCoverImage metadata of                     Nothing -> []                     Just _ -> [ unode "itemref" !-                                [("idref", "cover_xhtml"),("linear","no")] $ () ]+                                [("idref", "cover_xhtml")] $ () ]               ++ ((unode "itemref" ! [("idref", "title_page_xhtml")                                      ,("linear",                                          case lookupMeta "title" meta of@@ -532,7 +564,7 @@                   map chapterRefNode chapterEntries)           , unode "guide" $              [ unode "reference" !-                   [("type","toc"),("title",plainTitle),+                   [("type","toc"),("title", tocTitle),                     ("href","nav.xhtml")] $ ()              ] ++              [ unode "reference" !@@ -542,7 +574,7 @@   let contentsEntry = mkEntry "content.opf" contentsData    -- toc.ncx-  let secs = hierarchicalize blocks''+  let secs = hierarchicalize blocks'    let tocLevel = writerTOCDepth opts @@ -613,7 +645,7 @@   let navBlocks = [RawBlock (Format "html") $ ppElement $                    unode navtag ! ([("epub:type","toc") | epub3] ++                                    [("id","toc")]) $-                    [ unode "h1" ! [("id","toc-title")] $ plainTitle+                    [ unode "h1" ! [("id","toc-title")] $ tocTitle                     , unode "ol" ! [("class","toc")] $ evalState (mapM (navPointNode navXhtmlFormatter) secs) 1]]   let landmarks = if epub3                      then [RawBlock (Format "html") $ ppElement $@@ -781,59 +813,75 @@ showDateTimeISO8601 :: UTCTime -> String showDateTimeISO8601 = formatTime defaultTimeLocale "%FT%TZ" -transformTag :: IORef [(FilePath, FilePath)] -- ^ (oldpath, newpath) media+transformTag :: WriterOptions+             -> IORef [(FilePath, (FilePath, Maybe Entry))] -- ^ (oldpath, newpath, entry) media              -> Tag String              -> IO (Tag String)-transformTag mediaRef tag@(TagOpen name attr)+transformTag opts mediaRef tag@(TagOpen name attr)   | name `elem` ["video", "source", "img", "audio"] = do   let src = fromAttrib "src" tag   let poster = fromAttrib "poster" tag-  newsrc <- modifyMediaRef mediaRef src-  newposter <- modifyMediaRef mediaRef poster+  newsrc <- modifyMediaRef opts mediaRef src+  newposter <- modifyMediaRef opts mediaRef poster   let attr' = filter (\(x,_) -> x /= "src" && x /= "poster") attr ++               [("src", newsrc) | not (null newsrc)] ++               [("poster", newposter) | not (null newposter)]   return $ TagOpen name attr'-transformTag _ tag = return tag+transformTag _ _ tag = return tag -modifyMediaRef :: IORef [(FilePath, FilePath)] -> FilePath -> IO FilePath-modifyMediaRef _ "" = return ""-modifyMediaRef mediaRef oldsrc = do+modifyMediaRef :: WriterOptions+               -> IORef [(FilePath, (FilePath, Maybe Entry))]+               -> FilePath+               -> IO FilePath+modifyMediaRef _ _ "" = return ""+modifyMediaRef opts mediaRef oldsrc = do   media <- readIORef mediaRef   case lookup oldsrc media of-         Just n  -> return n-         Nothing -> do-           let new = "media/file" ++ show (length media) ++-                    takeExtension (takeWhile (/='?') oldsrc) -- remove query-           modifyIORef mediaRef ( (oldsrc, new): )+         Just (n,_) -> return n+         Nothing    -> do+           res <- fetchItem' (writerMediaBag opts)+                    (writerSourceURL opts) oldsrc+           (new, mbEntry) <-+                case res of+                      Left _        -> do+                        warn $ "Could not find media `" ++ oldsrc ++ "', skipping..."+                        return (oldsrc, Nothing)+                      Right (img,mbMime) -> do+                        let new = "media/file" ++ show (length media) +++                               fromMaybe (takeExtension (takeWhile (/='?') oldsrc))+                                 (('.':) <$> (mbMime >>= extensionFromMimeType))+                        epochtime <- floor `fmap` getPOSIXTime+                        let entry = toEntry new epochtime $ B.fromChunks . (:[]) $ img+                        return (new, Just entry)+           modifyIORef mediaRef ( (oldsrc, (new, mbEntry)): )            return new  transformBlock  :: WriterOptions-                -> IORef [(FilePath, FilePath)] -- ^ (oldpath, newpath) media+                -> IORef [(FilePath, (FilePath, Maybe Entry))] -- ^ (oldpath, newpath, entry) media                 -> Block                 -> IO Block-transformBlock _ mediaRef (RawBlock fmt raw)+transformBlock opts mediaRef (RawBlock fmt raw)   | fmt == Format "html" = do   let tags = parseTags raw-  tags' <- mapM (transformTag mediaRef)  tags+  tags' <- mapM (transformTag opts mediaRef)  tags   return $ RawBlock fmt (renderTags' tags') transformBlock _ _ b = return b  transformInline  :: WriterOptions-                 -> IORef [(FilePath, FilePath)] -- ^ (oldpath, newpath) media+                 -> IORef [(FilePath, (FilePath, Maybe Entry))] -- ^ (oldpath, newpath) media                  -> Inline                  -> IO Inline-transformInline _ mediaRef (Image lab (src,tit)) = do-    newsrc <- modifyMediaRef mediaRef src+transformInline opts mediaRef (Image lab (src,tit)) = do+    newsrc <- modifyMediaRef opts mediaRef src     return $ Image lab (newsrc, tit) transformInline opts _ (x@(Math _ _))   | WebTeX _ <- writerHTMLMathMethod opts = do     raw <- makeSelfContained opts $ writeHtmlInline opts x     return $ RawInline (Format "html") raw-transformInline _ mediaRef  (RawInline fmt raw)+transformInline opts mediaRef  (RawInline fmt raw)   | fmt == Format "html" = do   let tags = parseTags raw-  tags' <- mapM (transformTag mediaRef) tags+  tags' <- mapM (transformTag opts mediaRef) tags   return $ RawInline fmt (renderTags' tags') transformInline _ _ x = return x @@ -866,11 +914,6 @@     Just y | any (`isPrefixOf` y) mediaPrefixes -> Just y     _                                           -> Nothing -data IdentState = IdentState{-       chapterNumber :: Int,-       identTable    :: [(String,String)]-       } deriving (Read, Show)- -- Returns filename for chapter number. showChapter :: Int -> String showChapter = printf "ch%03d.xhtml"@@ -886,38 +929,6 @@          put $ ident' : ids          return $ Header n (ident',classes,kvs) ils        go x = return x---- Go through a block list and construct a table--- correlating the automatically constructed references--- that would be used in a normal pandoc document with--- new URLs to be used in the EPUB.  For example, what--- was "header-1" might turn into "ch006.xhtml#header".-correlateRefs :: Int -> [Block] -> [(String,String)]-correlateRefs chapterHeaderLevel bs =-  identTable $ execState (mapM_ go bs)-    IdentState{ chapterNumber = 0-              , identTable = [] }- where go :: Block -> State IdentState ()-       go (Header n (ident,_,_) _) = do-          when (n <= chapterHeaderLevel) $-              modify $ \s -> s{ chapterNumber = chapterNumber s + 1 }-          st <- get-          let chapterid = showChapter (chapterNumber st) ++-                          if n <= chapterHeaderLevel-                             then ""-                             else '#' : ident-          modify $ \s -> s{ identTable = (ident, chapterid) : identTable st }-       go _ = return ()---- Replace internal link references using the table produced--- by correlateRefs.-replaceRefs :: [(String,String)] -> [Block] -> [Block]-replaceRefs refTable = walk replaceOneRef-  where replaceOneRef x@(Link lab ('#':xs,tit)) =-          case lookup xs refTable of-                Just url -> Link lab (url,tit)-                Nothing  -> x-        replaceOneRef x = x  -- Variant of normalizeDate that allows partial dates: YYYY, YYYY-MM normalizeDate' :: String -> Maybe String
src/Text/Pandoc/Writers/HTML.hs view
@@ -1,7 +1,7 @@-{-# LANGUAGE OverloadedStrings, CPP, ViewPatterns #-}+{-# LANGUAGE OverloadedStrings, CPP, ViewPatterns, ScopedTypeVariables #-} {-# OPTIONS_GHC -fno-warn-deprecations #-} {--Copyright (C) 2006-2014 John MacFarlane <jgm@berkeley.edu>+Copyright (C) 2006-2015 John MacFarlane <jgm@berkeley.edu>  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.Writers.HTML-   Copyright   : Copyright (C) 2006-2014 John MacFarlane+   Copyright   : Copyright (C) 2006-2015 John MacFarlane    License     : GNU GPL, version 2 or above     Maintainer  : John MacFarlane <jgm@berkeley.edu>@@ -46,7 +46,7 @@ import Data.Char ( ord, toLower ) import Data.List ( isPrefixOf, intersperse ) import Data.String ( fromString )-import Data.Maybe ( catMaybes, fromMaybe )+import Data.Maybe ( catMaybes, fromMaybe, isJust ) import Control.Monad.State import Text.Blaze.Html hiding(contents) #if MIN_VERSION_blaze_markup(0,6,3)@@ -194,6 +194,9 @@                   defField "revealjs-url" ("reveal.js" :: String) $                   defField "s5-url" ("s5/default" :: String) $                   defField "html5" (writerHtml5 opts) $+                  defField "center" (case lookupMeta "center" meta of+                                          Just (MetaBool False) -> False+                                          _                     -> True) $                   metadata   return (thebody, context) @@ -446,19 +449,25 @@   contents <- inlineListToHtml opts lst   return $ H.p contents blockToHtml opts (Div attr@(_,classes,_) bs) = do-  contents <- blockListToHtml opts bs+  let speakerNotes = "notes" `elem` classes+  -- we don't want incremental output inside speaker notes, see #1394+  let opts' = if speakerNotes then opts{ writerIncremental = False } else opts+  contents <- blockListToHtml opts' bs   let contents' = nl opts >> contents >> nl opts   return $-     if "notes" `elem` classes-        then let opts' = opts{ writerIncremental = False } in-             -- we don't want incremental output inside speaker notes-             case writerSlideVariant opts of+     if speakerNotes+        then case writerSlideVariant opts of                   RevealJsSlides -> addAttrs opts' attr $ H5.aside $ contents'                   NoSlides       -> addAttrs opts' attr $ H.div $ contents'                   _              -> mempty         else addAttrs opts attr $ H.div $ contents'-blockToHtml _ (RawBlock f str)+blockToHtml opts (RawBlock f str)   | f == Format "html" = return $ preEscapedString str+  | f == Format "latex" =+      case writerHTMLMathMethod opts of+           MathJax _  -> do modify (\st -> st{ stMath = True })+                            return $ toHtml str+           _          -> return mempty   | otherwise          = return mempty blockToHtml opts (HorizontalRule) = return $ if writerHtml5 opts then H5.hr else H.hr blockToHtml opts (CodeBlock (id',classes,keyvals) rawCode) = do@@ -525,7 +534,9 @@   return $ unordList opts contents blockToHtml opts (OrderedList (startnum, numstyle, _) lst) = do   contents <- mapM (blockListToHtml opts) lst-  let numstyle' = camelCaseToHyphenated $ show numstyle+  let numstyle' = case numstyle of+                       Example -> "decimal"+                       _       -> camelCaseToHyphenated $ show numstyle   let attribs = (if startnum /= 1                    then [A.start $ toValue startnum]                    else []) ++@@ -654,7 +665,8 @@   case inline of     (Str str)        -> return $ strToHtml str     (Space)          -> return $ strToHtml " "-    (LineBreak)      -> return $ if writerHtml5 opts then H5.br else H.br+    (LineBreak)      -> return $ (if writerHtml5 opts then H5.br else H.br)+                                 <> strToHtml "\n"     (Span (id',classes,kvs) ils)                      -> inlineListToHtml opts ils >>=                            return . addAttrs opts attr' . H.span@@ -702,67 +714,72 @@                                  H.q `fmap` inlineListToHtml opts lst                                else (\x -> leftQuote >> x >> rightQuote)                                     `fmap` inlineListToHtml opts lst-    (Math t str) ->     modify (\st -> st {stMath = True}) >>-                        (case writerHTMLMathMethod opts of-                               LaTeXMathML _ ->-                                  -- putting LaTeXMathML in container with class "LaTeX" prevents-                                  -- non-math elements on the page from being treated as math by-                                  -- the javascript-                                  return $ H.span ! A.class_ "LaTeX" $-                                         case t of-                                           InlineMath  -> toHtml ("$" ++ str ++ "$")-                                           DisplayMath -> toHtml ("$$" ++ str ++ "$$")-                               JsMath _ -> do-                                  let m = preEscapedString str-                                  return $ case t of-                                           InlineMath -> H.span ! A.class_ "math" $ m-                                           DisplayMath -> H.div ! A.class_ "math" $ m-                               WebTeX url -> do-                                  let imtag = if writerHtml5 opts then H5.img else H.img-                                  let m = imtag ! A.style "vertical-align:middle"-                                                ! A.src (toValue $ url ++ urlEncode str)-                                                ! A.alt (toValue str)-                                                ! A.title (toValue str)-                                  let brtag = if writerHtml5 opts then H5.br else H.br-                                  return $ case t of-                                            InlineMath  -> m-                                            DisplayMath -> brtag >> m >> brtag-                               GladTeX ->-                                  return $ case t of-                                             InlineMath -> preEscapedString $ "<EQ ENV=\"math\">" ++ str ++ "</EQ>"-                                             DisplayMath -> preEscapedString $ "<EQ ENV=\"displaymath\">" ++ str ++ "</EQ>"-                               MathML _ -> do-                                  let dt = if t == InlineMath-                                              then DisplayInline-                                              else DisplayBlock-                                  let conf = useShortEmptyTags (const False)-                                               defaultConfigPP-                                  case writeMathML dt <$> readTeX str of-                                        Right r  -> return $ preEscapedString $-                                            ppcElement conf (annotateMML r str)-                                        Left _   -> inlineListToHtml opts-                                            (texMathToInlines t str) >>=-                                            return .  (H.span ! A.class_ "math")-                               MathJax _ -> return $ H.span ! A.class_ "math" $ toHtml $-                                  case t of-                                    InlineMath  -> "\\(" ++ str ++ "\\)"-                                    DisplayMath -> "\\[" ++ str ++ "\\]"-                               KaTeX _ _ -> return $ H.span ! A.class_ "math" $-                                  toHtml (case t of-                                            InlineMath -> str-                                            DisplayMath -> "\\displaystyle " ++ str)-                               PlainMath -> do-                                  x <- inlineListToHtml opts (texMathToInlines t str)-                                  let m = H.span ! A.class_ "math" $ x-                                  let brtag = if writerHtml5 opts then H5.br else H.br-                                  return  $ case t of-                                             InlineMath  -> m-                                             DisplayMath -> brtag >> m >> brtag )+    (Math t str) -> do+      modify (\st -> st {stMath = True})+      let mathClass = toValue $ ("math " :: String) +++                      if t == InlineMath then "inline" else "display"+      case writerHTMLMathMethod opts of+           LaTeXMathML _ ->+              -- putting LaTeXMathML in container with class "LaTeX" prevents+              -- non-math elements on the page from being treated as math by+              -- the javascript+              return $ H.span ! A.class_ "LaTeX" $+                     case t of+                       InlineMath  -> toHtml ("$" ++ str ++ "$")+                       DisplayMath -> toHtml ("$$" ++ str ++ "$$")+           JsMath _ -> do+              let m = preEscapedString str+              return $ case t of+                       InlineMath -> H.span ! A.class_ mathClass $ m+                       DisplayMath -> H.div ! A.class_ mathClass $ m+           WebTeX url -> do+              let imtag = if writerHtml5 opts then H5.img else H.img+              let m = imtag ! A.style "vertical-align:middle"+                            ! A.src (toValue $ url ++ urlEncode str)+                            ! A.alt (toValue str)+                            ! A.title (toValue str)+              let brtag = if writerHtml5 opts then H5.br else H.br+              return $ case t of+                        InlineMath  -> m+                        DisplayMath -> brtag >> m >> brtag+           GladTeX ->+              return $ case t of+                         InlineMath -> preEscapedString $ "<EQ ENV=\"math\">" ++ str ++ "</EQ>"+                         DisplayMath -> preEscapedString $ "<EQ ENV=\"displaymath\">" ++ str ++ "</EQ>"+           MathML _ -> do+              let dt = if t == InlineMath+                          then DisplayInline+                          else DisplayBlock+              let conf = useShortEmptyTags (const False)+                           defaultConfigPP+              case writeMathML dt <$> readTeX str of+                    Right r  -> return $ preEscapedString $+                        ppcElement conf (annotateMML r str)+                    Left _   -> inlineListToHtml opts+                        (texMathToInlines t str) >>=+                        return .  (H.span ! A.class_ mathClass)+           MathJax _ -> return $ H.span ! A.class_ mathClass $ toHtml $+              case t of+                InlineMath  -> "\\(" ++ str ++ "\\)"+                DisplayMath -> "\\[" ++ str ++ "\\]"+           KaTeX _ _ -> return $ H.span ! A.class_ mathClass $+              toHtml (case t of+                        InlineMath -> str+                        DisplayMath -> "\\displaystyle " ++ str)+           PlainMath -> do+              x <- inlineListToHtml opts (texMathToInlines t str)+              let m = H.span ! A.class_ mathClass $ x+              let brtag = if writerHtml5 opts then H5.br else H.br+              return  $ case t of+                         InlineMath  -> m+                         DisplayMath -> brtag >> m >> brtag      (RawInline f str)       | f == Format "latex" ->                           case writerHTMLMathMethod opts of                                LaTeXMathML _ -> do modify (\st -> st {stMath = True})                                                    return $ toHtml str+                               MathJax _     -> do modify (\st -> st {stMath = True})+                                                   return $ toHtml str                                _             -> return mempty       | f == Format "html" -> return $ preEscapedString str       | otherwise          -> return mempty@@ -783,22 +800,15 @@                                     then link'                                     else link' ! A.title (toValue tit)     (Image txt (s,tit)) | treatAsImage s -> do-                        let alternate' = stringify txt                         let attributes = [A.src $ toValue s] ++-                                         (if null tit-                                            then []-                                            else [A.title $ toValue tit]) ++-                                         if null txt-                                            then []-                                            else [A.alt $ toValue alternate']+                                         [A.title $ toValue tit | not $ null tit] +++                                         [A.alt $ toValue $ stringify txt]                         let tag = if writerHtml5 opts then H5.img else H.img                         return $ foldl (!) tag attributes                         -- note:  null title included, as in Markdown.pl     (Image _ (s,tit)) -> do                         let attributes = [A.src $ toValue s] ++-                                         (if null tit-                                            then []-                                            else [A.title $ toValue tit])+                                         [A.title $ toValue tit | not $ null tit]                         return $ foldl (!) H5.embed attributes                         -- note:  null title included, as in Markdown.pl     (Note contents)@@ -818,7 +828,9 @@                                          writerIdentifierPrefix opts ++ "fn" ++ ref)                                        ! A.class_ "footnoteRef"                                        ! prefixedId opts ("fnref" ++ ref)-                                       $ H.sup+                                       $ (if isJust (writerEpubVersion opts)+                                             then id+                                             else H.sup)                                        $ toHtml ref                         return $ case writerEpubVersion opts of                                       Just EPUB3 -> link ! customAttribute "epub:type" "noteref"
src/Text/Pandoc/Writers/ICML.hs view
@@ -25,6 +25,7 @@ import Data.Text as Text (breakOnAll, pack) import Data.Monoid (mappend) import Control.Monad.State+import Network.URI (isURI) import qualified Data.Set as Set  type Style = [String]@@ -70,7 +71,6 @@ -- block element names (appear in InDesign's paragraph styles pane) paragraphName     :: String codeBlockName     :: String-rawBlockName      :: String blockQuoteName    :: String orderedListName   :: String bulletListName    :: String@@ -93,7 +93,6 @@ footnoteName      :: String paragraphName     = "Paragraph" codeBlockName     = "CodeBlock"-rawBlockName      = "Rawblock" blockQuoteName    = "Blockquote" orderedListName   = "NumList" bulletListName    = "BulList"@@ -278,7 +277,9 @@ blockToICML opts style (Plain lst) = parStyle opts style lst blockToICML opts style (Para lst) = parStyle opts (paragraphName:style) lst blockToICML opts style (CodeBlock _ str) = parStyle opts (codeBlockName:style) $ [Str str]-blockToICML opts style (RawBlock _ str) = parStyle opts (rawBlockName:style) $ [Str str]+blockToICML _ _ (RawBlock f str)+  | f == Format "icml" = return $ text str+  | otherwise          = return empty blockToICML opts style (BlockQuote blocks) = blocksToICML opts (blockQuoteName:style) blocks blockToICML opts style (OrderedList attribs lst) = listItemsToICML opts orderedListName style (Just attribs) lst blockToICML opts style (BulletList lst) = listItemsToICML opts bulletListName style Nothing lst@@ -404,7 +405,9 @@ inlineToICML _    style Space = charStyle style space inlineToICML _ style LineBreak = charStyle style $ text lineSeparator inlineToICML _ style (Math _ str) = charStyle style $ text $ escapeStringForXML str --InDesign doesn't really do math-inlineToICML _ style (RawInline _ str) = charStyle style $ text $ escapeStringForXML str+inlineToICML _ _ (RawInline f str)+  | f == Format "icml" = return $ text str+  | otherwise          = return empty inlineToICML opts style (Link lst (url, title)) = do   content <- inlinesToICML opts (linkName:style) lst   state $ \st ->@@ -497,6 +500,7 @@       hh = show $ imgHeight `div` 2       qw = show $ imgWidth  `div` 4       qh = show $ imgHeight `div` 4+      uriPrefix = if isURI linkURI then "" else "file:"       (stlStr, attrs) = styleToStrAttr style       props  = inTags True "Properties" [] $ inTags True "PathGeometry" []                  $ inTags True "GeometryPathType" [("PathOpen","false")]@@ -516,7 +520,7 @@                  $ vcat [                      inTags True "Properties" [] $ inTags True "Profile" [("type","string")] $ text "$ID/Embedded"                        $$ selfClosingTag "GraphicBounds" [("Left","0"), ("Top","0"), ("Right", hw), ("Bottom", hh)]-                   , selfClosingTag "Link" [("Self", "ueb"), ("LinkResourceURI", linkURI)]+                   , selfClosingTag "Link" [("Self", "ueb"), ("LinkResourceURI", uriPrefix++linkURI)]                    ]       doc    = inTags True "CharacterStyleRange" attrs                  $ inTags True "Rectangle" [("Self","uec"), ("ItemTransform", "1 0 0 1 "++qw++" -"++qh)]
src/Text/Pandoc/Writers/LaTeX.hs view
@@ -1,7 +1,7 @@ {-# LANGUAGE OverloadedStrings, ScopedTypeVariables,              PatternGuards #-} {--Copyright (C) 2006-2014 John MacFarlane <jgm@berkeley.edu>+Copyright (C) 2006-2015 John MacFarlane <jgm@berkeley.edu>  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.Writers.LaTeX-   Copyright   : Copyright (C) 2006-2014 John MacFarlane+   Copyright   : Copyright (C) 2006-2015 John MacFarlane    License     : GNU GPL, version 2 or above     Maintainer  : John MacFarlane <jgm@berkeley.edu>@@ -42,6 +42,7 @@                    isPrefixOf, intercalate, intersperse ) import Data.Char ( toLower, isPunctuation, isAscii, isLetter, isDigit, ord ) import Data.Maybe ( fromMaybe )+import Data.Aeson.Types ( (.:), parseMaybe, withObject ) import Control.Applicative ((<|>)) import Control.Monad.State import Text.Pandoc.Pretty@@ -102,8 +103,16 @@   modify $ \s -> s{ stInternalLinks = query isInternalLink blocks' }   let template = writerTemplate options   -- set stBook depending on documentclass+  let colwidth = if writerWrapText options+                    then Just $ writerColumns options+                    else Nothing+  metadata <- metaToJSON options+              (fmap (render colwidth) . blockListToLaTeX)+              (fmap (render colwidth) . inlineListToLaTeX)+              meta   let bookClasses = ["memoir","book","report","scrreprt","scrbook"]-  case lookup "documentclass" (writerVariables options) of+  case lookup "documentclass" (writerVariables options) `mplus`+        parseMaybe (withObject "object" (.: "documentclass")) metadata of          Just x  | x `elem` bookClasses -> modify $ \s -> s{stBook = True}                  | otherwise            -> return ()          Nothing | any (\x -> "\\documentclass" `isPrefixOf` x &&@@ -114,13 +123,6 @@   -- \enquote{...} for smart quotes:   when ("{csquotes}" `isInfixOf` template) $     modify $ \s -> s{stCsquotes = True}-  let colwidth = if writerWrapText options-                    then Just $ writerColumns options-                    else Nothing-  metadata <- metaToJSON options-              (fmap (render colwidth) . blockListToLaTeX)-              (fmap (render colwidth) . inlineListToLaTeX)-              meta   let (blocks'', lastHeader) = if writerCiteMethod options == Citeproc then                                  (blocks', [])                                else case last blocks' of@@ -135,6 +137,11 @@   st <- get   titleMeta <- stringToLaTeX TextString $ stringify $ docTitle meta   authorsMeta <- mapM (stringToLaTeX TextString . stringify) $ docAuthors meta+  let (mainlang, otherlang) =+       case (reverse . splitBy (==',') . filter (/=' ')) `fmap`+            getField "lang" metadata of+              Just (m:os) -> (m, reverse os)+              _           -> ("", [])   let context  =  defField "toc" (writerTableOfContents options) $                   defField "toc-depth" (show (writerTOCDepth options -                                               if stBook st@@ -159,8 +166,8 @@                   defField "euro" (stUsesEuro st) $                   defField "listings" (writerListings options || stLHS st) $                   defField "beamer" (writerBeamer options) $-                  defField "mainlang" (maybe "" (reverse . takeWhile (/=',') . reverse)-                                (lookup "lang" $ writerVariables options)) $+                  defField "mainlang" mainlang $+                  defField "otherlang" otherlang $                   (if stHighlighting st                       then defField "highlighting-macros" (styleToLaTeX                                 $ writerHighlightStyle options )@@ -206,7 +213,7 @@        '€' -> "\\euro{}" ++ rest        '{' -> "\\{" ++ rest        '}' -> "\\}" ++ rest-       '$' -> "\\$" ++ rest+       '$' | not isUrl -> "\\$" ++ rest        '%' -> "\\%" ++ rest        '&' -> "\\&" ++ rest        '_' | not isUrl -> "\\_" ++ rest@@ -272,10 +279,11 @@       let hasCode (Code _ _) = [True]           hasCode _          = []       opts <- gets stOptions-      let fragile = not $ null $ query hasCodeBlock elts +++      let fragile = "fragile" `elem` classes ||+                    not (null $ query hasCodeBlock elts ++                                      if writerListings opts                                         then query hasCode elts-                                        else []+                                        else [])       let allowframebreaks = "allowframebreaks" `elem` classes       let optionslist = ["fragile" | fragile] ++                         ["allowframebreaks" | allowframebreaks]@@ -311,7 +319,8 @@   ref <- toLabel identifier   let linkAnchor = if null identifier                       then empty-                      else "\\hyperdef{}" <> braces (text ref) <> "{}"+                      else "\\hyperdef{}" <> braces (text ref) <>+                           braces ("\\label" <> braces (text ref))   contents <- blockListToLaTeX bs   if beamer && "notes" `elem` classes  -- speaker notes      then return $ "\\note" <> braces contents@@ -414,7 +423,7 @@   let inc = if incremental then "[<+->]" else ""   items <- mapM listItemToLaTeX lst   let spacing = if isTightList lst-                   then text "\\itemsep1pt\\parskip0pt\\parsep0pt"+                   then text "\\tightlist"                    else empty   return $ text ("\\begin{itemize}" ++ inc) $$ spacing $$ vcat items $$              "\\end{itemize}"@@ -449,7 +458,7 @@                         else "\\setcounter" <> braces enum <>                               braces (text $ show $ start - 1)   let spacing = if isTightList lst-                   then text "\\itemsep1pt\\parskip0pt\\parsep0pt"+                   then text "\\tightlist"                    else empty   return $ text ("\\begin{enumerate}" ++ inc)          $$ stylecommand@@ -463,7 +472,7 @@   let inc = if incremental then "[<+->]" else ""   items <- mapM defListItemToLaTeX lst   let spacing = if all isTightList (map snd lst)-                   then text "\\itemsep1pt\\parskip0pt\\parsep0pt"+                   then text "\\tightlist"                    else empty   return $ text ("\\begin{description}" ++ inc) $$ spacing $$ vcat items $$                "\\end{description}"@@ -701,7 +710,7 @@                                ("\\\\[" ++ show (length lbs) ++                                 "\\baselineskip]") : fixBreaks rest        fixBreaks (y:ys) = y : fixBreaks ys- + isQuoted :: Inline -> Bool isQuoted (Quoted _ _) = True isQuoted _ = False@@ -716,7 +725,8 @@   ref <- toLabel id'   let linkAnchor = if null id'                       then empty-                      else "\\hyperdef{}" <> braces (text ref) <> "{}"+                      else "\\hyperdef{}" <> braces (text ref) <>+                             braces ("\\label" <> braces (text ref))   fmap (linkAnchor <>)     ((if noEmph then inCmd "textup" else id) .      (if noStrong then inCmd "textnormal" else id) .@@ -750,10 +760,11 @@  inlineToLaTeX (Code (_,classes,_) str) = do   opts <- gets stOptions+  inHeading <- gets stInHeading   case () of-     _ | writerListings opts                         -> listingsCode+     _ | writerListings opts  && not inHeading      -> listingsCode        | writerHighlight opts && not (null classes) -> highlightCode-       | otherwise                                   -> rawCode+       | otherwise                                  -> rawCode    where listingsCode = do            inNote <- gets stInNote            when inNote $ modify $ \s -> s{ stVerbInNote = True }@@ -802,7 +813,7 @@   | f == Format "latex" || f == Format "tex"                         = return $ text str   | otherwise           = return empty-inlineToLaTeX (LineBreak) = return "\\\\"+inlineToLaTeX (LineBreak) = return $ "\\\\" <> cr inlineToLaTeX Space = return space inlineToLaTeX (Link txt ('#':ident, _)) = do   contents <- inlineListToLaTeX txt
src/Text/Pandoc/Writers/Man.hs view
@@ -1,5 +1,5 @@ {--Copyright (C) 2007-2014 John MacFarlane <jgm@berkeley.edu>+Copyright (C) 2007-2015 John MacFarlane <jgm@berkeley.edu>  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@@ -18,7 +18,7 @@  {- |    Module      : Text.Pandoc.Writers.Man-   Copyright   : Copyright (C) 2007-2014 John MacFarlane+   Copyright   : Copyright (C) 2007-2015 John MacFarlane    License     : GNU GPL, version 2 or above     Maintainer  : John MacFarlane <jgm@berkeley.edu>
src/Text/Pandoc/Writers/Markdown.hs view
@@ -1,6 +1,6 @@ {-# LANGUAGE OverloadedStrings, TupleSections, ScopedTypeVariables #-} {--Copyright (C) 2006-2014 John MacFarlane <jgm@berkeley.edu>+Copyright (C) 2006-2015 John MacFarlane <jgm@berkeley.edu>  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@@ -19,7 +19,7 @@  {- |    Module      : Text.Pandoc.Writers.Markdown-   Copyright   : Copyright (C) 2006-2014 John MacFarlane+   Copyright   : Copyright (C) 2006-2015 John MacFarlane    License     : GNU GPL, version 2 or above     Maintainer  : John MacFarlane <jgm@berkeley.edu>@@ -57,12 +57,15 @@  type Notes = [[Block]] type Refs = [([Inline], Target)]-data WriterState = WriterState { stNotes :: Notes-                               , stRefs  :: Refs-                               , stIds   :: [String]-                               , stPlain :: Bool }+data WriterState = WriterState { stNotes           :: Notes+                               , stRefs            :: Refs+                               , stRefShortcutable :: Bool+                               , stInList          :: Bool+                               , stIds             :: [String]+                               , stPlain           :: Bool } instance Default WriterState-  where def = WriterState{ stNotes = [], stRefs = [], stIds = [], stPlain = False }+  where def = WriterState{ stNotes = [], stRefs = [], stRefShortcutable = True,+                           stInList = False, stIds = [], stPlain = False }  -- | Convert Pandoc to Markdown. writeMarkdown :: WriterOptions -> Pandoc -> String@@ -243,7 +246,8 @@ -- | Escape special characters for Markdown. escapeString :: WriterOptions -> String -> String escapeString opts = escapeStringUsing markdownEscapes-  where markdownEscapes = backslashEscapes specialChars+  where markdownEscapes = ('<', "&lt;") : ('>', "&gt;") :+                          backslashEscapes specialChars         specialChars =                 (if isEnabled Ext_superscript opts                     then ('^':)@@ -254,7 +258,7 @@                 (if isEnabled Ext_tex_math_dollars opts                     then ('$':)                     else id) $-                "\\`*_<>#"+                "\\`*_[]#"  -- | Construct table of contents from list of header blocks. tableOfContents :: WriterOptions -> [Block] -> Doc@@ -453,7 +457,7 @@                                 $ Pandoc nullMeta [t]   return $ nst $ tbl $$ blankline $$ caption'' $$ blankline blockToMarkdown opts (BulletList items) = do-  contents <- mapM (bulletListItemToMarkdown opts) items+  contents <- inList $ mapM (bulletListItemToMarkdown opts) items   return $ cat contents <> blankline blockToMarkdown opts (OrderedList (start,sty,delim) items) = do   let start' = if isEnabled Ext_startnum opts then start else 1@@ -464,13 +468,22 @@   let markers' = map (\m -> if length m < 3                                then m ++ replicate (3 - length m) ' '                                else m) markers-  contents <- mapM (\(item, num) -> orderedListItemToMarkdown opts item num) $+  contents <- inList $+              mapM (\(item, num) -> orderedListItemToMarkdown opts item num) $               zip markers' items   return $ cat contents <> blankline blockToMarkdown opts (DefinitionList items) = do-  contents <- mapM (definitionListItemToMarkdown opts) items+  contents <- inList $ mapM (definitionListItemToMarkdown opts) items   return $ cat contents <> blankline +inList :: State WriterState a -> State WriterState a+inList p = do+  oldInList <- gets stInList+  modify $ \st -> st{ stInList = True }+  res <- p+  modify $ \st -> st{ stInList = oldInList }+  return res+ addMarkdownAttribute :: String -> String addMarkdownAttribute s =   case span isTagText $ reverse $ parseTags s of@@ -497,7 +510,12 @@                              AlignCenter  -> ':':replicate w '-' ++ ":"                              AlignRight   -> replicate (w + 1) '-' ++ ":"                              AlignDefault -> replicate (w + 2) '-'-  let header = if headless then empty else torow rawHeaders+  -- note:  pipe tables can't completely lack a+  -- header; for a headerless table, we need a header of empty cells.+  -- see jgm/pandoc#1996.+  let header = if headless+                  then torow (replicate (length aligns) empty)+                  else torow rawHeaders   let border = nowrap $ text "|" <> hcat (intersperse (text "|") $                         map toborder $ zip aligns widths) <> text "|"   let body   = vcat $ map torow rawRows@@ -677,13 +695,54 @@  -- | Convert list of Pandoc inline elements to markdown. inlineListToMarkdown :: WriterOptions -> [Inline] -> State WriterState Doc-inlineListToMarkdown opts lst =-  mapM (inlineToMarkdown opts) (avoidBadWraps lst) >>= return . cat-  where avoidBadWraps [] = []-        avoidBadWraps (Space:Str (c:cs):xs)-          | c `elem` ("-*+>" :: String) = Str (' ':c:cs) : avoidBadWraps xs-        avoidBadWraps (x:xs) = x : avoidBadWraps xs+inlineListToMarkdown opts lst = do+  inlist <- gets stInList+  go (if inlist then avoidBadWrapsInList lst else lst)+  where go [] = return empty+        go (i:is) = case i of+            (Link _ _) -> case is of+                -- If a link is followed by another link or '[' we don't shortcut+                (Link _ _):_                  -> unshortcutable+                Space:(Link _ _):_            -> unshortcutable+                Space:(Str('[':_)):_          -> unshortcutable+                Space:(RawInline _ ('[':_)):_ -> unshortcutable+                Space:(Cite _ _):_            -> unshortcutable+                (Cite _ _):_                  -> unshortcutable+                Str ('[':_):_                 -> unshortcutable+                (RawInline _ ('[':_)):_       -> unshortcutable+                (RawInline _ (' ':'[':_)):_   -> unshortcutable+                _                             -> shortcutable+            _ -> shortcutable+          where shortcutable = liftM2 (<>) (inlineToMarkdown opts i) (go is)+                unshortcutable = do+                    iMark <- withState (\s -> s { stRefShortcutable = False })+                                       (inlineToMarkdown opts i)+                    modify (\s -> s {stRefShortcutable = True })+                    fmap (iMark <>) (go is) +avoidBadWrapsInList :: [Inline] -> [Inline]+avoidBadWrapsInList [] = []+avoidBadWrapsInList (Space:Str ('>':cs):xs) =+  Str (' ':'>':cs) : avoidBadWrapsInList xs+avoidBadWrapsInList (Space:Str [c]:[])+  | c `elem` ['-','*','+'] = Str [' ', c] : []+avoidBadWrapsInList (Space:Str [c]:Space:xs)+  | c `elem` ['-','*','+'] = Str [' ', c] : Space : avoidBadWrapsInList xs+avoidBadWrapsInList (Space:Str cs:Space:xs)+  | isOrderedListMarker cs = Str (' ':cs) : Space : avoidBadWrapsInList xs+avoidBadWrapsInList (Space:Str cs:[])+  | isOrderedListMarker cs = Str (' ':cs) : []+avoidBadWrapsInList (x:xs) = x : avoidBadWrapsInList xs++isOrderedListMarker :: String -> Bool+isOrderedListMarker xs = (last xs `elem` ['.',')']) &&+              isRight (runParserT (anyOrderedListMarker >> eof)+                       defaultParserState "" xs)++isRight :: Either a b -> Bool+isRight (Right _) = True+isRight (Left  _) = False+ escapeSpaces :: Inline -> Inline escapeSpaces (Str s) = Str $ substitute " " "\\ " s escapeSpaces Space = Str "\\ "@@ -692,8 +751,10 @@ -- | Convert Pandoc inline element to markdown. inlineToMarkdown :: WriterOptions -> Inline -> State WriterState Doc inlineToMarkdown opts (Span attrs ils) = do+  plain <- gets stPlain   contents <- inlineListToMarkdown opts ils-  return $ if isEnabled Ext_raw_html opts+  return $ if not plain &&+              (isEnabled Ext_raw_html opts || isEnabled Ext_native_spans opts)               then tagWithAttrs "span" attrs <> contents <> text "</span>"               else contents inlineToMarkdown opts (Emph lst) = do@@ -726,13 +787,14 @@               else "<sub>" <> contents <> "</sub>" inlineToMarkdown opts (SmallCaps lst) = do   plain <- gets stPlain-  if plain-     then inlineListToMarkdown opts $ capitalize lst-     else do+  if not plain &&+     (isEnabled Ext_raw_html opts || isEnabled Ext_native_spans opts)+     then do        contents <- inlineListToMarkdown opts lst        return $ tagWithAttrs "span"-            ("",[],[("style","font-variant:small-caps;")])+                 ("",[],[("style","font-variant:small-caps;")])              <> contents <> text "</span>"+     else inlineListToMarkdown opts $ capitalize lst inlineToMarkdown opts (Quoted SingleQuote lst) = do   contents <- inlineListToMarkdown opts lst   return $ "‘" <> contents <> "’"@@ -838,6 +900,9 @@                       [Str s] | escapeURI s == srcSuffix -> True                       _                                  -> False   let useRefLinks = writerReferenceLinks opts && not useAuto+  shortcutable <- gets stRefShortcutable+  let useShortcutRefLinks = shortcutable &&+                            isEnabled Ext_shortcut_reference_links opts   ref <- if useRefLinks then getReference txt (src, tit) else return []   reftext <- inlineListToMarkdown opts ref   return $ if useAuto@@ -847,7 +912,9 @@               else if useRefLinks                       then let first  = "[" <> linktext <> "]"                                second = if txt == ref-                                           then "[]"+                                           then if useShortcutRefLinks+                                                   then ""+                                                   else "[]"                                            else "[" <> reftext <> "]"                            in  first <> second                       else if plain
src/Text/Pandoc/Writers/MediaWiki.hs view
@@ -1,5 +1,5 @@ {--Copyright (C) 2008-2014 John MacFarlane <jgm@berkeley.edu>+Copyright (C) 2008-2015 John MacFarlane <jgm@berkeley.edu>  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@@ -18,7 +18,7 @@  {- |    Module      : Text.Pandoc.Writers.MediaWiki-   Copyright   : Copyright (C) 2008-2014 John MacFarlane+   Copyright   : Copyright (C) 2008-2015 John MacFarlane    License     : GNU GPL, version 2 or above     Maintainer  : John MacFarlane <jgm@berkeley.edu>@@ -107,7 +107,7 @@   let opt = if null txt                then ""                else "|alt=" ++ if null tit then capt else tit ++ capt-  return $ "[[Image:" ++ src ++ "|frame|none" ++ opt ++ "]]\n"+  return $ "[[File:" ++ src ++ "|frame|none" ++ opt ++ "]]\n"  blockToMediaWiki (Para inlines) = do   tags <- asks useTags@@ -375,7 +375,7 @@   | f == Format "html"      = return str   | otherwise               = return "" -inlineToMediaWiki (LineBreak) = return "<br />"+inlineToMediaWiki (LineBreak) = return "<br />\n"  inlineToMediaWiki Space = return " " @@ -397,7 +397,7 @@                        then ""                        else '|' : alt'                else '|' : tit-  return $ "[[Image:" ++ source ++ txt ++ "]]"+  return $ "[[File:" ++ source ++ txt ++ "]]"  inlineToMediaWiki (Note contents) = do   contents' <- blockListToMediaWiki contents
src/Text/Pandoc/Writers/Native.hs view
@@ -1,6 +1,6 @@ {-# LANGUAGE OverloadedStrings #-} {--Copyright (C) 2006-2014 John MacFarlane <jgm@berkeley.edu>+Copyright (C) 2006-2015 John MacFarlane <jgm@berkeley.edu>  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@@ -19,7 +19,7 @@  {- |    Module      : Text.Pandoc.Writers.Native-   Copyright   : Copyright (C) 2006-2014 John MacFarlane+   Copyright   : Copyright (C) 2006-2015 John MacFarlane    License     : GNU GPL, version 2 or above     Maintainer  : John MacFarlane <jgm@berkeley.edu>
src/Text/Pandoc/Writers/ODT.hs view
@@ -1,6 +1,6 @@ {-# LANGUAGE ScopedTypeVariables #-} {--Copyright (C) 2008-2014 John MacFarlane <jgm@berkeley.edu>+Copyright (C) 2008-2015 John MacFarlane <jgm@berkeley.edu>  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@@ -19,7 +19,7 @@  {- |    Module      : Text.Pandoc.Writers.ODT-   Copyright   : Copyright (C) 2008-2014 John MacFarlane+   Copyright   : Copyright (C) 2008-2015 John MacFarlane    License     : GNU GPL, version 2 or above     Maintainer  : John MacFarlane <jgm@berkeley.edu>@@ -127,15 +127,19 @@   return $ fromArchive archive''  transformPicMath :: WriterOptions -> IORef [Entry] -> Inline -> IO Inline-transformPicMath opts entriesRef (Image lab (src,_)) = do+transformPicMath opts entriesRef (Image lab (src,t)) = do   res <- fetchItem' (writerMediaBag opts) (writerSourceURL opts) src   case res of      Left (_ :: E.SomeException) -> do        warn $ "Could not find image `" ++ src ++ "', skipping..."        return $ Emph lab      Right (img, mbMimeType) -> do-       let size = imageSize img-       let (w,h) = fromMaybe (0,0) $ sizeInPoints `fmap` size+       (w,h) <- case imageSize img of+                     Right size -> return $ sizeInPoints size+                     Left msg   -> do+                       warn $ "Could not determine image size in `" +++                         src ++ "': " ++ msg+                       return (0,0)        let tit' = show w ++ "x" ++ show h        entries <- readIORef entriesRef        let extension = fromMaybe (takeExtension $ takeWhile (/='?') src)@@ -145,7 +149,9 @@        epochtime <- floor `fmap` getPOSIXTime        let entry = toEntry newsrc epochtime $ toLazy img        modifyIORef entriesRef (entry:)-       return $ Image lab (newsrc, tit')+       let fig | "fig:" `isPrefixOf` t = "fig:"+               | otherwise             = ""+       return $ Image lab (newsrc, fig++tit') transformPicMath _ entriesRef (Math t math) = do   entries <- readIORef entriesRef   let dt = if t == InlineMath then DisplayInline else DisplayBlock
src/Text/Pandoc/Writers/OPML.hs view
@@ -1,5 +1,5 @@ {--Copyright (C) 2013-2014 John MacFarlane <jgm@berkeley.edu>+Copyright (C) 2013-2015 John MacFarlane <jgm@berkeley.edu>  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@@ -18,7 +18,7 @@  {- |    Module      : Text.Pandoc.Writers.OPML-   Copyright   : Copyright (C) 2013-2014 John MacFarlane+   Copyright   : Copyright (C) 2013-2015 John MacFarlane    License     : GNU GPL, version 2 or above     Maintainer  : John MacFarlane <jgm@berkeley.edu>
src/Text/Pandoc/Writers/OpenDocument.hs view
@@ -1,6 +1,6 @@ {-# LANGUAGE PatternGuards, OverloadedStrings, FlexibleContexts #-} {--Copyright (C) 2008-2014 Andrea Rossato <andrea.rossato@ing.unitn.it>+Copyright (C) 2008-2015 Andrea Rossato <andrea.rossato@ing.unitn.it>                         and John MacFarlane.  This program is free software; you can redistribute it and/or modify@@ -20,7 +20,7 @@  {- |    Module      : Text.Pandoc.Writers.OpenDocument-   Copyright   : Copyright (C) 2008-2014 Andrea Rossato and John MacFarlane+   Copyright   : Copyright (C) 2008-2015 Andrea Rossato and John MacFarlane    License     : GNU GPL, version 2 or above     Maintainer  : Andrea Rossato <andrea.rossato@ing.unitn.it>@@ -288,6 +288,8 @@     | Plain          b <- bs = if null b                                   then return empty                                   else inParagraphTags =<< inlinesToOpenDocument o b+    | Para [Image c (s,'f':'i':'g':':':t)] <- bs+                             = figure c s t     | Para           b <- bs = if null b                                   then return empty                                   else inParagraphTags =<< inlinesToOpenDocument o b@@ -334,7 +336,7 @@         mapM_ addParaStyle . newPara $ paraHStyles ++ paraStyles         captionDoc <- if null c                       then return empty-                      else withParagraphStyle o "Caption" [Para c]+                      else withParagraphStyle o "TableCaption" [Para c]         th <- if all null h                  then return empty                  else colHeadsToOpenDocument o name (map fst paraHStyles) h@@ -342,6 +344,12 @@         return $ inTags True "table:table" [ ("table:name"      , name)                                            , ("table:style-name", name)                                            ] (vcat columns $$ th $$ vcat tr) $$ captionDoc+      figure caption source title | null caption =+        withParagraphStyle o "Figure" [Para [Image caption (source,title)]]+                                  | otherwise    = do+        imageDoc <- withParagraphStyle o "FigureWithCaption" [Para [Image caption (source,title)]]+        captionDoc <- withParagraphStyle o "FigureCaption" [Para caption]+        return $ imageDoc $$ captionDoc  colHeadsToOpenDocument :: WriterOptions -> String -> [String] -> [[Block]] -> State WriterState Doc colHeadsToOpenDocument o tn ns hs =@@ -370,7 +378,7 @@ inlineToOpenDocument o ils     | Space         <- ils = inTextStyle space     | Span _ xs     <- ils = inlinesToOpenDocument o xs-    | LineBreak     <- ils = return $ selfClosingTag "text:line-break" []+    | LineBreak     <- ils = return $ selfClosingTag "text:line-break" [] <> cr     | Str         s <- ils = inTextStyle $ handleSpaces $ escapeStringForXML s     | Emph        l <- ils = withTextStyle Italic $ inlinesToOpenDocument o l     | Strong      l <- ils = withTextStyle Bold   $ inlinesToOpenDocument o l@@ -553,4 +561,3 @@                     ,("style:font-name-asian"        ,"Courier New")                     ,("style:font-name-complex"      ,"Courier New")]     | otherwise   = []-
src/Text/Pandoc/Writers/Org.hs view
@@ -1,6 +1,6 @@ {-# LANGUAGE OverloadedStrings #-} {--Copyright (C) 2010-2014 Puneeth Chaganti <punchagan@gmail.com>+Copyright (C) 2010-2015 Puneeth Chaganti <punchagan@gmail.com>                         and John MacFarlane <jgm@berkeley.edu>  This program is free software; you can redistribute it and/or modify@@ -20,7 +20,7 @@  {- |    Module      : Text.Pandoc.Writers.Org-   Copyright   : Copyright (C) 2010-2014 Puneeth Chaganti and John MacFarlane+   Copyright   : Copyright (C) 2010-2015 Puneeth Chaganti and John MacFarlane    License     : GNU GPL, version 2 or above     Maintainer  : Puneeth Chaganti <punchagan@gmail.com>
src/Text/Pandoc/Writers/RST.hs view
@@ -1,6 +1,6 @@ {-# LANGUAGE OverloadedStrings #-} {--Copyright (C) 2006-2014 John MacFarlane <jgm@berkeley.edu>+Copyright (C) 2006-2015 John MacFarlane <jgm@berkeley.edu>  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@@ -19,7 +19,7 @@  {- |    Module      : Text.Pandoc.Writers.RST-   Copyright   : Copyright (C) 2006-2014 John MacFarlane+   Copyright   : Copyright (C) 2006-2015 John MacFarlane    License     : GNU GPL, version 2 or above     Maintainer  : John MacFarlane <jgm@berkeley.edu>@@ -48,11 +48,13 @@ type Refs = [([Inline], Target)]  data WriterState =-  WriterState { stNotes     :: [[Block]]-              , stLinks     :: Refs-              , stImages    :: [([Inline], (String, String, Maybe String))]-              , stHasMath   :: Bool-              , stOptions   :: WriterOptions+  WriterState { stNotes       :: [[Block]]+              , stLinks       :: Refs+              , stImages      :: [([Inline], (String, String, Maybe String))]+              , stHasMath     :: Bool+              , stHasRawTeX   :: Bool+              , stOptions     :: WriterOptions+              , stTopLevel    :: Bool               }  -- | Convert Pandoc to RST.@@ -60,7 +62,8 @@ writeRST opts document =   let st = WriterState { stNotes = [], stLinks = [],                          stImages = [], stHasMath = False,-                         stOptions = opts }+                         stHasRawTeX = False, stOptions = opts,+                         stTopLevel = True}   in evalState (pandocToRST document) st  -- | Return RST representation of document.@@ -78,23 +81,32 @@                 (fmap (render colwidth) . blockListToRST)                 (fmap (trimr . render colwidth) . inlineListToRST)                 $ deleteMeta "title" $ deleteMeta "subtitle" meta-  body <- blockListToRST blocks+  body <- blockListToRST' True $ normalizeHeadings 1 blocks   notes <- liftM (reverse . stNotes) get >>= notesToRST   -- note that the notes may contain refs, so we do them first   refs <- liftM (reverse . stLinks) get >>= refsToRST   pics <- liftM (reverse . stImages) get >>= pictRefsToRST   hasMath <- liftM stHasMath get+  rawTeX <- liftM stHasRawTeX get   let main = render colwidth $ foldl ($+$) empty $ [body, notes, refs, pics]   let context = defField "body" main               $ defField "toc" (writerTableOfContents opts)-              $ defField "toc-depth" (writerTOCDepth opts)+              $ defField "toc-depth" (show $ writerTOCDepth opts)               $ defField "math" hasMath               $ defField "title" (render Nothing title :: String)               $ defField "math" hasMath+              $ defField "rawtex" rawTeX               $ metadata   if writerStandalone opts      then return $ renderTemplate' (writerTemplate opts) context      else return main+  where+    normalizeHeadings lev (Header l a i:bs) = Header lev a i:normalizeHeadings (lev+1) cont ++ normalizeHeadings lev bs'+      where (cont,bs') = break (headerLtEq l) bs+            headerLtEq level (Header l' _ _) = l' <= level+            headerLtEq _ _ = False+    normalizeHeadings lev (b:bs) = b:normalizeHeadings lev bs+    normalizeHeadings _   []     = []  -- | Return RST representation of reference key table. refsToRST :: Refs -> State WriterState Doc@@ -188,11 +200,21 @@                     (nest 3 $ text str) $$ blankline blockToRST HorizontalRule =   return $ blankline $$ "--------------" $$ blankline-blockToRST (Header level _ inlines) = do+blockToRST (Header level (name,classes,_) inlines) = do   contents <- inlineListToRST inlines-  let headerChar = if level > 5 then ' ' else "=-~^'" !! (level - 1)-  let border = text $ replicate (offset contents) headerChar-  return $ nowrap $ contents $$ border $$ blankline+  isTopLevel <- gets stTopLevel+  if isTopLevel+    then do+          let headerChar = if level > 5 then ' ' else "=-~^'" !! (level - 1)+          let border = text $ replicate (offset contents) headerChar+          return $ nowrap $ contents $$ border $$ blankline+    else do+          let rub     = "rubric:: " <> contents+          let name' | null name    = empty+                    | otherwise    = ":name: " <> text name+          let cls   | null classes = empty+                    | otherwise    = ":class: " <> text (unwords classes)+          return $ nowrap $ hang 3 ".. " (rub $$ name' $$ cls) $$ blankline blockToRST (CodeBlock (_,classes,kvs) str) = do   opts <- stOptions <$> get   let tabstop = writerTabStop opts@@ -294,9 +316,19 @@   return $ label' $$ nest tabstop (nestle contents <> cr)  -- | Convert list of Pandoc block elements to RST.+blockListToRST' :: Bool+                -> [Block]       -- ^ List of block elements+                -> State WriterState Doc+blockListToRST' topLevel blocks = do+  tl <- gets stTopLevel+  modify (\s->s{stTopLevel=topLevel})+  res <- vcat `fmap` mapM blockToRST blocks+  modify (\s->s{stTopLevel=tl})+  return res+ blockListToRST :: [Block]       -- ^ List of block elements                -> State WriterState Doc-blockListToRST blocks = mapM blockToRST blocks >>= return . vcat+blockListToRST = blockListToRST' False  -- | Convert list of Pandoc inline elements to RST. inlineListToRST :: [Inline] -> State WriterState Doc@@ -392,6 +424,9 @@                    else blankline $$ (".. math:: " <> text str) $$ blankline inlineToRST (RawInline f x)   | f == "rst" = return $ text x+  | f == "latex" || f == "tex" = do+      modify $ \st -> st{ stHasRawTeX = True }+      return $ ":raw-latex:`" <> text x <> "`"   | otherwise  = return empty inlineToRST (LineBreak) = return cr -- there's no line break in RST (see Para) inlineToRST Space = return space
src/Text/Pandoc/Writers/RTF.hs view
@@ -1,5 +1,5 @@ {--Copyright (C) 2006-2014 John MacFarlane <jgm@berkeley.edu>+Copyright (C) 2006-2015 John MacFarlane <jgm@berkeley.edu>  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@@ -18,7 +18,7 @@  {- |    Module      : Text.Pandoc.Writers.RTF-   Copyright   : Copyright (C) 2006-2014 John MacFarlane+   Copyright   : Copyright (C) 2006-2015 John MacFarlane    License     : GNU GPL, version 2 or above     Maintainer  : John MacFarlane <jgm@berkeley.edu>@@ -56,9 +56,12 @@                              "image/jpeg" -> "\\jpegblip"                              "image/png"  -> "\\pngblip"                              _            -> error "Unknown file type"-         let sizeSpec = case imageSize imgdata of-                             Nothing -> ""-                             Just sz -> "\\picw" ++ show xpx +++         sizeSpec <- case imageSize imgdata of+                             Left msg -> do+                               warn $ "Could not determine image size in `" +++                                 src ++ "': " ++ msg+                               return ""+                             Right sz -> return $ "\\picw" ++ show xpx ++                                         "\\pich" ++ show ypx ++                                         "\\picwgoal" ++ show (xpt * 20)                                         ++ "\\pichgoal" ++ show (ypt * 20)
src/Text/Pandoc/Writers/Shared.hs view
@@ -1,6 +1,6 @@ {-# LANGUAGE OverloadedStrings #-} {--Copyright (C) 2013-2014 John MacFarlane <jgm@berkeley.edu>+Copyright (C) 2013-2015 John MacFarlane <jgm@berkeley.edu>  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@@ -19,7 +19,7 @@  {- |    Module      : Text.Pandoc.Writers.Shared-   Copyright   : Copyright (C) 2013-2014 John MacFarlane+   Copyright   : Copyright (C) 2013-2015 John MacFarlane    License     : GNU GPL, version 2 or above     Maintainer  : John MacFarlane <jgm@berkeley.edu>
src/Text/Pandoc/Writers/Texinfo.hs view
@@ -1,6 +1,6 @@ {-# LANGUAGE OverloadedStrings #-} {--Copyright (C) 2008-2014 John MacFarlane and Peter Wang+Copyright (C) 2008-2015 John MacFarlane and Peter Wang  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@@ -19,7 +19,7 @@  {- |    Module      : Text.Pandoc.Writers.Texinfo-   Copyright   : Copyright (C) 2008-2014 John MacFarlane and Peter Wang+   Copyright   : Copyright (C) 2008-2015 John MacFarlane and Peter Wang    License     : GNU GPL, version 2 or above     Maintainer  : John MacFarlane <jgm@berkeley.edu>@@ -421,8 +421,8 @@                       return $ text "@tex" $$ text str $$ text "@end tex"   | f == "texinfo" =  return $ text str   | otherwise      =  return empty-inlineToTexinfo (LineBreak) = return $ text "@*"-inlineToTexinfo Space = return $ char ' '+inlineToTexinfo (LineBreak) = return $ text "@*" <> cr+inlineToTexinfo Space = return space  inlineToTexinfo (Link txt (src@('#':_), _)) = do   contents <- escapeCommas $ inlineListToTexinfo txt
src/Text/Pandoc/Writers/Textile.hs view
@@ -1,5 +1,5 @@ {--Copyright (C) 2010-2014 John MacFarlane <jgm@berkeley.edu>+Copyright (C) 2010-2015 John MacFarlane <jgm@berkeley.edu>  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@@ -18,7 +18,7 @@  {- |    Module      : Text.Pandoc.Writers.Textile-   Copyright   : Copyright (C) 2010-2014 John MacFarlane+   Copyright   : Copyright (C) 2010-2015 John MacFarlane    License     : GNU GPL, version 2 or above     Maintainer  : John MacFarlane <jgm@berkeley.edu>
src/Text/Pandoc/XML.hs view
@@ -1,5 +1,5 @@ {--Copyright (C) 2006-2014 John MacFarlane <jgm@berkeley.edu>+Copyright (C) 2006-2015 John MacFarlane <jgm@berkeley.edu>  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@@ -18,7 +18,7 @@  {- |    Module      : Text.Pandoc.XML-   Copyright   : Copyright (C) 2006-2014 John MacFarlane+   Copyright   : Copyright (C) 2006-2015 John MacFarlane    License     : GNU GPL, version 2 or above     Maintainer  : John MacFarlane <jgm@berkeley.edu>
tests/Tests/Old.hs view
@@ -18,6 +18,7 @@ import qualified Data.ByteString.Lazy as B import Text.Pandoc.UTF8 (toStringLazy) import Text.Printf+import Text.Pandoc.Error  readFileUTF8 :: FilePath -> IO String readFileUTF8 f = B.readFile f >>= return . toStringLazy@@ -175,14 +176,14 @@     , t "lhs to lhs"    (format ++ "+lhs")     ]   where-    t n f = test n ["--columns=78", "-r", "native", "-s", "--no-highlight", "-w", f]+    t n f = test n ["--columns=78", "-r", "native", "-s", "-w", f]              "lhs-test.native" ("lhs-test" <.> f)  lhsReaderTest :: String -> Test lhsReaderTest format =   testWithNormalize normalizer "lhs" ["-r", format, "-w", "native"]     ("lhs-test" <.> format) norm-   where normalizer = writeNative def . normalize . readNative+   where normalizer = writeNative def . normalize . handleError . readNative          norm = if format == "markdown+lhs"                    then "lhs-test-markdown.native"                    else "lhs-test.native"
tests/Tests/Readers/Docx.hs view
@@ -13,6 +13,7 @@ import qualified Data.Map as M import Text.Pandoc.MediaBag (MediaBag, lookupMedia, mediaDirectory) import Codec.Archive.Zip+import Text.Pandoc.Error  -- We define a wrapper around pandoc that doesn't normalize in the -- tests. Since we do our own normalization, we want to make sure@@ -41,8 +42,8 @@ compareOutput opts docxFile nativeFile = do   df <- B.readFile docxFile   nf <- Prelude.readFile nativeFile-  let (p, _) = readDocx opts df-  return $ (noNorm p, noNorm (readNative nf))+  let (p, _) = handleError $ readDocx opts df+  return $ (noNorm p, noNorm (handleError $ readNative nf))  testCompareWithOptsIO :: ReaderOptions -> String -> FilePath -> FilePath -> IO Test testCompareWithOptsIO opts name docxFile nativeFile = do@@ -79,7 +80,7 @@ compareMediaBagIO :: FilePath -> IO Bool compareMediaBagIO docxFile = do     df <- B.readFile docxFile-    let (_, mb) = readDocx def df+    let (_, mb) = handleError $ readDocx def df     bools <- mapM              (\(fp, _, _) -> compareMediaPathIO fp mb docxFile)              (mediaDirectory mb)@@ -114,6 +115,10 @@             "docx/image.docx"             "docx/image_no_embed.native"           , testCompare+            "VML image"+            "docx/image_vml.docx"+            "docx/image_vml.native"+          , testCompare             "inline image in links"             "docx/inline_images.docx"             "docx/inline_images.native"@@ -141,6 +146,10 @@             "inline code (with VerbatimChar style)"             "docx/inline_code.docx"             "docx/inline_code.native"+          , testCompare+            "inline code in subscript and superscript"+            "docx/verbatim_subsuper.docx"+            "docx/verbatim_subsuper.native"           ]         , testGroup "blocks"           [ testCompare@@ -168,6 +177,10 @@             "docx/definition_list.docx"             "docx/definition_list.native"           , testCompare+            "custom defined lists in styles"+            "docx/german_styled_lists.docx"+            "docx/german_styled_lists.native"+          , testCompare             "footnotes and endnotes"             "docx/notes.docx"             "docx/notes.native"@@ -183,6 +196,10 @@             "tables"             "docx/tables.docx"             "docx/tables.native"+          , testCompare+            "tables with lists in cells"+            "docx/table_with_list_cell.docx"+            "docx/table_with_list_cell.native"           , testCompare             "code block"             "docx/codeblock.docx"
tests/Tests/Readers/EPUB.hs view
@@ -8,10 +8,10 @@ import Text.Pandoc.Readers.EPUB import Text.Pandoc.MediaBag (MediaBag, mediaDirectory) import Control.Applicative-import System.FilePath (joinPath)+import Text.Pandoc.Error  getMediaBag :: FilePath -> IO MediaBag-getMediaBag fp = snd . readEPUB def <$> BL.readFile fp+getMediaBag fp = snd . handleError . readEPUB def <$> BL.readFile fp  testMediaBag :: FilePath -> [(String, String, Int)] -> IO () testMediaBag fp bag = do@@ -23,7 +23,11 @@              (actBag == bag)  featuresBag :: [(String, String, Int)]-featuresBag = [(joinPath ["img","check.gif"],"image/gif",1340),(joinPath ["img","check.jpg"],"image/jpeg",2661),(joinPath ["img","check.png"],"image/png",2815),(joinPath ["img","multiscripts_and_greek_alphabet.png"],"image/png",10060)]+featuresBag = [("img/check.gif","image/gif",1340)+              ,("img/check.jpg","image/jpeg",2661)+              ,("img/check.png","image/png",2815)+              ,("img/multiscripts_and_greek_alphabet.png","image/png",10060)+              ]  tests :: [Test] tests =
+ tests/Tests/Readers/HTML.hs view
@@ -0,0 +1,27 @@+{-# LANGUAGE OverloadedStrings #-}+module Tests.Readers.HTML (tests) where++import Text.Pandoc.Definition+import Test.Framework+import Tests.Helpers+import Tests.Arbitrary()+import Text.Pandoc.Builder+import Text.Pandoc+import Text.Pandoc.Error++html :: String -> Pandoc+html = handleError . readHtml def++tests :: [Test]+tests = [ testGroup "base tag"+          [ test html "simple" $+            "<head><base href=\"http://www.w3schools.com/images\" ></head><body><img src=\"stickman.gif\" alt=\"Stickman\"></head>" =?>+            plain (image "http://www.w3schools.com/images/stickman.gif" "" (text "Stickman"))+          , test html "slash at end of base" $+            "<head><base href=\"http://www.w3schools.com/images/\" ></head><body><img src=\"stickman.gif\" alt=\"Stickman\"></head>" =?>+            plain (image "http://www.w3schools.com/images/stickman.gif" "" (text "Stickman"))+          , test html "absolute URL" $+            "<head><base href=\"http://www.w3schools.com/images/\" ></head><body><img src=\"http://example.com/stickman.gif\" alt=\"Stickman\"></head>" =?>+            plain (image "http://example.com/stickman.gif" "" (text "Stickman"))+          ]+        ]
tests/Tests/Readers/LaTeX.hs view
@@ -7,15 +7,21 @@ import Tests.Arbitrary() import Text.Pandoc.Builder import Text.Pandoc+import Data.Monoid (mempty)+import Text.Pandoc.Error  latex :: String -> Pandoc-latex = readLaTeX def+latex = handleError . readLaTeX def  infix 4 =: (=:) :: ToString c      => String -> (String, c) -> Test (=:) = test latex +simpleTable' :: [Alignment] -> [[Blocks]] -> Blocks+simpleTable' aligns = table "" (zip aligns (repeat 0.0))+                      (map (const mempty) aligns)+ tests :: [Test] tests = [ testGroup "basic"           [ "simple" =:@@ -62,9 +68,53 @@             "\\begin{lstlisting}\\end{lstlisting}" =?> codeBlock ""           ] +        , testGroup "tables"+          [ "Single cell table" =:+            "\\begin{tabular}{|l|}Test\\\\\\end{tabular}" =?>+            simpleTable' [AlignLeft] [[plain "Test"]]+          , "Multi cell table" =:+            "\\begin{tabular}{|rl|}One & Two\\\\ \\end{tabular}" =?>+            simpleTable' [AlignRight,AlignLeft] [[plain "One", plain "Two"]]+          , "Multi line table" =:+            unlines [ "\\begin{tabular}{|c|}"+                    , "One\\\\"+                    , "Two\\\\"+                    , "Three\\\\"+                    , "\\end{tabular}" ] =?>+            simpleTable' [AlignCenter]+                         [[plain "One"], [plain "Two"], [plain "Three"]]+          , "Empty table" =:+            "\\begin{tabular}{}\\end{tabular}" =?>+            simpleTable' [] []+          , "Table with fixed column width" =:+            "\\begin{tabular}{|p{5cm}r|}One & Two\\\\ \\end{tabular}" =?>+            simpleTable' [AlignLeft,AlignRight] [[plain "One", plain "Two"]]+          , "Table with empty column separators" =:+            "\\begin{tabular}{@{}r@{}l}One & Two\\\\ \\end{tabular}" =?>+            simpleTable' [AlignRight,AlignLeft] [[plain "One", plain "Two"]]+          , "Table with custom column separators" =:+            unlines [ "\\begin{tabular}{@{($\\to$)}r@{\\hspace{2cm}}l}"+                    , "One&Two\\\\"+                    , "\\end{tabular}" ] =?>+            simpleTable' [AlignRight,AlignLeft] [[plain "One", plain "Two"]]+          , "Table with vertical alignment argument" =:+            "\\begin{tabular}[t]{r|r}One & Two\\\\ \\end{tabular}" =?>+            simpleTable' [AlignRight,AlignRight] [[plain "One", plain "Two"]]+          ]+         , testGroup "citations"           [ natbibCitations           , biblatexCitations+          ]++        , let hex = ['0'..'9']++['a'..'f'] in+          testGroup "Character Escapes"+          [ "Two-character escapes" =:+            concat ["^^"++[i,j] | i <- hex, j <- hex] =?>+            para (str ['\0'..'\255'])+          , "One-character escapes" =:+            concat ["^^"++[i] | i <- hex] =?>+            para (str $ ['p'..'y']++['!'..'&'])           ]         ] 
tests/Tests/Readers/Markdown.hs view
@@ -9,19 +9,20 @@ import qualified Data.Set as Set -- import Text.Pandoc.Shared ( normalize ) import Text.Pandoc+import Text.Pandoc.Error  markdown :: String -> Pandoc-markdown = readMarkdown def+markdown = handleError . readMarkdown def  markdownSmart :: String -> Pandoc-markdownSmart = readMarkdown def { readerSmart = True }+markdownSmart = handleError . readMarkdown def { readerSmart = True }  markdownCDL :: String -> Pandoc-markdownCDL = readMarkdown def { readerExtensions = Set.insert+markdownCDL = handleError . readMarkdown def { readerExtensions = Set.insert                  Ext_compact_definition_lists $ readerExtensions def }  markdownGH :: String -> Pandoc-markdownGH = readMarkdown def { readerExtensions = githubMarkdownExtensions }+markdownGH = handleError . readMarkdown def { readerExtensions = githubMarkdownExtensions }  infix 4 =: (=:) :: ToString c@@ -30,7 +31,7 @@  testBareLink :: (String, Inlines) -> Test testBareLink (inp, ils) =-  test (readMarkdown def{ readerExtensions =+  test (handleError . readMarkdown def{ readerExtensions =              Set.fromList [Ext_autolink_bare_uris, Ext_raw_html] })        inp (inp, doc $ para ils) @@ -168,6 +169,9 @@             "<del>test</del>" =?>             rawBlock "html" "<del>" <> plain (str "test") <>             rawBlock "html" "</del>"+          , "invalid tag (issue #1820" =:+            "</ div></.div>" =?>+            para (text "</ div></.div>")           ]         , "unbalanced brackets" =:             "[[[[[[[[[[[[[[[hi" =?> para (text "[[[[[[[[[[[[[[[hi")@@ -196,6 +200,9 @@           [ "blank line before header" =:             "\n# Header\n"             =?> headerWith ("header",[],[]) 1 "Header"+          , "bracketed text (#2062)" =:+            "# [hi]\n"+            =?> headerWith ("hi",[],[]) 1 "[hi]"           ]         , testGroup "smart punctuation"           [ test markdownSmart "quote before ellipses"@@ -207,6 +214,9 @@           , test markdownSmart "apostrophe in French"             ("À l'arrivée de la guerre, le thème de l'«impossibilité du socialisme»"             =?> para "À l’arrivée de la guerre, le thème de l’«impossibilité du socialisme»")+          , test markdownSmart "apostrophe after math" $ -- issue #1909+              "The value of the $x$'s and the systems' condition." =?>+              para (text "The value of the " <> math "x" <> text "\8217s and the systems\8217 condition.")           ]         , testGroup "footnotes"           [ "indent followed by newline and flush-left text" =:@@ -220,7 +230,7 @@             =?> para (note (para "See [^1]"))           ]         , testGroup "lhs"-          [ test (readMarkdown def{ readerExtensions = Set.insert+          [ test (handleError . readMarkdown def{ readerExtensions = Set.insert                        Ext_literate_haskell $ readerExtensions def })               "inverse bird tracks and html" $               "> a\n\n< b\n\n<div>\n"@@ -263,6 +273,16 @@             definitionList [ (text "foo1", [para (text "bar") <>                                             para (text "baz")])                            ]+          , "first line not indented" =:+            "foo\n: bar\n" =?>+            definitionList [ (text "foo", [plain (text "bar")]) ]+          , "list in definition" =:+            "foo\n:   - bar\n" =?>+            definitionList [ (text "foo", [bulletList [plain (text "bar")]]) ]+          , "in div" =:+            "<div>foo\n:   - bar\n</div>" =?>+            divWith nullAttr (definitionList+              [ (text "foo", [bulletList [plain (text "bar")]]) ])           ]         , testGroup "+compact_definition_lists"           [ test markdownCDL "basic compact list" $@@ -288,5 +308,68 @@               bulletList [ plain "a"                          , plain "b"                          , plain "c" <> bulletList [plain "d"] ]+          ]+        , testGroup "citations"+          [ "simple" =:+            "@item1" =?> para (cite [+                Citation{ citationId      = "item1"+                        , citationPrefix  = []+                        , citationSuffix  = []+                        , citationMode    = AuthorInText+                        , citationNoteNum = 0+                        , citationHash    = 0+                        }+                ] "@item1")+          , "key starts with digit" =:+            "@1657:huyghens" =?> para (cite [+                Citation{ citationId      = "1657:huyghens"+                        , citationPrefix  = []+                        , citationSuffix  = []+                        , citationMode    = AuthorInText+                        , citationNoteNum = 0+                        , citationHash    = 0+                        }+                ] "@1657:huyghens")+          ]+        , let citation = cite [Citation "cita" [] [] AuthorInText 0 0] (str "@cita")+          in testGroup "footnote/link following citation" -- issue #2083+          [ "footnote" =:+              unlines [ "@cita[^note]"+                      , ""+                      , "[^note]: note" ] =?>+              para (+                citation <> note (para $ str "note")+              )+          , "normal link" =:+              "@cita [link](http://www.com)" =?>+              para (+                citation <> space <> link "http://www.com" "" (str "link")+              )+          , "reference link" =:+              unlines [ "@cita [link][link]"+                      , ""+                      , "[link]: http://www.com" ] =?>+              para (+                citation <> space <> link "http://www.com" "" (str "link")+              )+          , "short reference link" =:+              unlines [ "@cita [link]"+                      , ""+                      , "[link]: http://www.com" ] =?>+              para (+                citation <> space <> link "http://www.com" "" (str "link")+              )+          , "implicit header link" =:+              unlines [ "# Header"+                      , "@cita [Header]" ] =?>+              headerWith ("header",[],[]) 1 (str "Header") <> para (+                citation <> space <> link "#header" "" (str "Header")+              )+          , "regular citation" =:+              "@cita [foo]" =?>+              para (+                cite [Citation "cita" [] [Str "foo"] AuthorInText 0 0]+                  (str "@cita" <> space <> str "[foo]")+              )           ]         ]
tests/Tests/Readers/Org.hs view
@@ -8,10 +8,14 @@ import Text.Pandoc import Data.List (intersperse) import Data.Monoid (mempty, mappend, mconcat)+import Text.Pandoc.Error  org :: String -> Pandoc-org = readOrg def+org = handleError . readOrg def +orgSmart :: String -> Pandoc+orgSmart = handleError . readOrg def { readerSmart = True }+ infix 4 =: (=:) :: ToString c      => String -> (String, c) -> Test@@ -212,6 +216,10 @@           "[[sunset.png][dusk.svg]]" =?>           (para $ link "sunset.png" "" (image "dusk.svg" "" "")) +      , "Image link with non-image target" =:+          "[[http://example.com][logo.png]]" =?>+          (para $ link "http://example.com" "" (image "logo.png" "" ""))+       , "Plain link" =:           "Posts on http://zeitlens.com/ can be funny at times." =?>           (para $ spcSep [ "Posts", "on"@@ -489,6 +497,21 @@                   , header 2 ("walk" <> space <> "dog")                   ] +      , "Tagged headers" =:+          unlines [ "* Personal       :PERSONAL:"+                  , "** Call Mom      :@PHONE:"+                  , "** Call John     :@PHONE:JOHN: "+                  ] =?>+          let tagSpan t = spanWith ("", ["tag"], [("data-tag-name", t)]) mempty+          in mconcat [ header 1 ("Personal" <> tagSpan "PERSONAL")+                     , header 2 ("Call Mom" <> tagSpan "@PHONE")+                     , header 2 ("Call John" <> tagSpan "@PHONE" <> tagSpan "JOHN")+                     ]++      , "Untagged header containing colons" =:+          "* This: is not: tagged" =?>+          header 1 "This: is not: tagged"+       , "Comment Trees" =:           unlines [ "* COMMENT A comment tree"                   , "  Not much going on here"@@ -501,6 +524,13 @@           "* COMMENT Test" =?>           (mempty::Blocks) +      , "Tree with :noexport:" =:+          unlines [ "* Should be ignored :archive:noexport:old:"+                  , "** Old stuff"+                  , "   This is not going to be exported"+                  ] =?>+          (mempty::Blocks)+       , "Paragraph starting with an asterisk" =:           "*five" =?>           para "*five"@@ -1151,5 +1181,26 @@                         , ("rundoc-city", "Zürich")                         ]           in codeBlockWith ( "", classes, params) "code body\n"+      ]+    , testGroup "Smart punctuation"+      [ test orgSmart "quote before ellipses"+        ("'...hi'"+         =?> para (singleQuoted "…hi"))++      , test orgSmart "apostrophe before emph"+        ("D'oh! A l'/aide/!"+         =?> para ("D’oh! A l’" <> emph "aide" <> "!"))++      , test orgSmart "apostrophe in French"+        ("À l'arrivée de la guerre, le thème de l'«impossibilité du socialisme»"+         =?> para "À l’arrivée de la guerre, le thème de l’«impossibilité du socialisme»")++      , test orgSmart "Quotes cannot occur at the end of emphasized text"+        ("/say \"yes\"/" =?>+         para ("/say" <> space <> doubleQuoted "yes" <> "/"))++      , test orgSmart "Dashes are allowed at the borders of emphasis'"+        ("/foo---/" =?>+         para (emph "foo—"))       ]   ]
tests/Tests/Readers/RST.hs view
@@ -7,10 +7,11 @@ import Tests.Arbitrary() import Text.Pandoc.Builder import Text.Pandoc+import Text.Pandoc.Error import Data.Monoid (mempty)  rst :: String -> Pandoc-rst = readRST def{ readerStandalone = True }+rst = handleError . readRST def{ readerStandalone = True }  infix 4 =: (=:) :: ToString c
tests/Tests/Readers/Txt2Tags.hs view
@@ -7,12 +7,13 @@ import Tests.Arbitrary() import Text.Pandoc.Builder import Text.Pandoc+import Text.Pandoc.Error import Data.List (intersperse) import Data.Monoid (mempty, mconcat) import Text.Pandoc.Readers.Txt2Tags  t2t :: String -> Pandoc-t2t s = readTxt2Tags (T2TMeta "date" "mtime" "in" "out") def s+t2t = handleError . readTxt2Tags (T2TMeta "date" "mtime" "in" "out") def  infix 4 =: (=:) :: ToString c
+ tests/Tests/Writers/Docx.hs view
@@ -0,0 +1,129 @@+module Tests.Writers.Docx (tests) where++import Text.Pandoc.Options+import Text.Pandoc.Readers.Native+import Text.Pandoc.Definition+import Tests.Helpers+import Test.Framework+import Text.Pandoc.Readers.Docx+import Text.Pandoc.Writers.Docx+import Text.Pandoc.Error++type Options = (WriterOptions, ReaderOptions)++compareOutput :: Options+                 -> FilePath+                 -> IO (Pandoc, Pandoc)+compareOutput opts nativeFile = do+  nf <- Prelude.readFile nativeFile+  df <- writeDocx (fst opts) (handleError $ readNative nf)+  let (p, _) = handleError $ readDocx (snd opts) df+  return (p, handleError $ readNative nf)++testCompareWithOptsIO :: Options -> String -> FilePath -> IO Test+testCompareWithOptsIO opts name nativeFile = do+  (dp, np) <- compareOutput opts nativeFile+  return $ test id name (dp, np)++testCompareWithOpts :: Options -> String -> FilePath -> Test+testCompareWithOpts opts name nativeFile =+  buildTest $ testCompareWithOptsIO opts name nativeFile++testCompare :: String -> FilePath -> Test+testCompare = testCompareWithOpts def++tests :: [Test]+tests = [ testGroup "inlines"+          [ testCompare+            "font formatting"+            "docx/inline_formatting_writer.native"+          , testCompare+            "font formatting with character styles"+            "docx/char_styles.native"+          , testCompare+            "hyperlinks"+            "docx/links_writer.native"+          , testCompare+            "inline image"+            "docx/image_no_embed_writer.native"+          , testCompare+            "inline image in links"+            "docx/inline_images_writer.native"+          , testCompare+            "handling unicode input"+            "docx/unicode.native"+          , testCompare+            "literal tabs"+            "docx/tabs.native"+          , testCompare+            "normalizing inlines"+            "docx/normalize.native"+          , testCompare+            "normalizing inlines deep inside blocks"+            "docx/deep_normalize.native"+          , testCompare+            "move trailing spaces outside of formatting"+            "docx/trailing_spaces_in_formatting.native"+          , testCompare+            "inline code (with VerbatimChar style)"+            "docx/inline_code.native"+          , testCompare+            "inline code in subscript and superscript"+            "docx/verbatim_subsuper.native"+          ]+        , testGroup "blocks"+          [ testCompare+            "headers"+            "docx/headers.native"+          , testCompare+            "headers already having auto identifiers"+            "docx/already_auto_ident.native"+          , testCompare+            "numbered headers automatically made into list"+            "docx/numbered_header.native"+          , testCompare+            "i18n blocks (headers and blockquotes)"+            "docx/i18n_blocks.native"+          -- Continuation does not survive round-trip+          , testCompare+            "lists"+            "docx/lists_writer.native"+          , testCompare+            "definition lists"+            "docx/definition_list.native"+          , testCompare+            "custom defined lists in styles"+            "docx/german_styled_lists.native"+          , testCompare+            "footnotes and endnotes"+            "docx/notes.native"+          , testCompare+            "blockquotes (parsing indent as blockquote)"+            "docx/block_quotes_parse_indent.native"+          , testCompare+            "hanging indents"+            "docx/hanging_indent.native"+          -- tables headers do not survive round-trip, should look into that+          , testCompare+            "tables"+            "docx/tables.native"+          , testCompare+            "tables with lists in cells"+            "docx/table_with_list_cell.native"+          , testCompare+            "code block"+            "docx/codeblock.native"+          , testCompare+            "dropcap paragraphs"+            "docx/drop_cap.native"+          ]+        , testGroup "metadata"+          [ testCompareWithOpts (def,def{readerStandalone=True})+            "metadata fields"+            "docx/metadata.native"+          , testCompareWithOpts (def,def{readerStandalone=True})+            "stop recording metadata with normal text"+            "docx/metadata_after_normal.native"+          ]++        ]
tests/Tests/Writers/LaTeX.hs view
@@ -42,7 +42,7 @@         , testGroup "definition lists"           [ "with internal link" =: definitionList [(link "#go" "" (str "testing"),              [plain (text "hi there")])] =?>-            "\\begin{description}\n\\itemsep1pt\\parskip0pt\\parsep0pt\n\\item[{\\hyperref[go]{testing}}]\nhi there\n\\end{description}"+            "\\begin{description}\n\\tightlist\n\\item[{\\hyperref[go]{testing}}]\nhi there\n\\end{description}"           ]         , testGroup "math"           [ "escape |" =: para (math "\\sigma|_{\\{x\\}}") =?>
tests/Tests/Writers/Markdown.hs view
@@ -1,4 +1,5 @@ {-# LANGUAGE OverloadedStrings #-}+{-# OPTIONS_GHC -fno-warn-name-shadowing #-} module Tests.Writers.Markdown (tests) where  import Test.Framework@@ -35,4 +36,92 @@              =: bulletList [ plain "foo" <> bulletList [ plain "bar" ],                              plain "baz" ]              =?> "-   foo\n    -   bar\n-   baz\n"-        ]+        ] ++ [shortcutLinkRefsTests]++shortcutLinkRefsTests :: Test+shortcutLinkRefsTests =+  let infix 4 =:+      (=:) :: (ToString a, ToPandoc a)+           => String -> (a, String) -> Test+      (=:) = test (writeMarkdown (def {writerReferenceLinks = True}) . toPandoc)+  in testGroup "Shortcut reference links"+     [ "Simple link (shortcutable)"+           =: (para (link "/url" "title" "foo"))+           =?> "[foo]\n\n  [foo]: /url \"title\""+     , "Followed by another link (unshortcutable)"+           =: (para ((link "/url1" "title1" "first")+                  <> (link "/url2" "title2" "second")))+           =?> unlines [ "[first][][second]"+                       , ""+                       , "  [first]: /url1 \"title1\""+                       , "  [second]: /url2 \"title2\""+                       ]+     , "Followed by space and another link (unshortcutable)"+           =: (para ((link "/url1" "title1" "first") <> " "+                  <> (link "/url2" "title2" "second")))+           =?> unlines [ "[first][] [second]"+                       , ""+                       , "  [first]: /url1 \"title1\""+                       , "  [second]: /url2 \"title2\""+                       ]+     , "Reference link is used multiple times (unshortcutable)"+           =: (para ((link "/url1" "" "foo") <> (link "/url2" "" "foo")+                                             <> (link "/url3" "" "foo")))+           =?> unlines [ "[foo][][foo][1][foo][2]"+                       , ""+                       , "  [foo]: /url1"+                       , "  [1]: /url2"+                       , "  [2]: /url3"+                       ]+     , "Reference link is used multiple times (unshortcutable)"+           =: (para ((link "/url1" "" "foo") <> " " <> (link "/url2" "" "foo")+                                             <> " " <> (link "/url3" "" "foo")))+           =?> unlines [ "[foo][] [foo][1] [foo][2]"+                       , ""+                       , "  [foo]: /url1"+                       , "  [1]: /url2"+                       , "  [2]: /url3"+                       ]+     , "Reference link is followed by text in brackets"+          =:  (para ((link "/url" "" "link") <> "[text in brackets]"))+          =?> unlines [ "[link][]\\[text in brackets\\]"+                      , ""+                      , "  [link]: /url"+                      ]+     , "Reference link is followed by space and text in brackets"+          =:  (para ((link "/url" "" "link") <> " [text in brackets]"))+          =?> unlines [ "[link][] \\[text in brackets\\]"+                      , ""+                      , "  [link]: /url"+                      ]+     , "Reference link is followed by RawInline"+          =: (para ((link "/url" "" "link") <> rawInline "markdown" "[rawText]"))+          =?> unlines [ "[link][][rawText]"+                      , ""+                      , "  [link]: /url"+                      ]+     , "Reference link is followed by space and RawInline"+          =: (para ((link "/url" "" "link") <> space <> rawInline "markdown" "[rawText]"))+          =?> unlines [ "[link][] [rawText]"+                      , ""+                      , "  [link]: /url"+                      ]+     , "Reference link is followed by RawInline with space"+          =: (para ((link "/url" "" "link") <> rawInline "markdown" " [rawText]"))+          =?> unlines [ "[link][] [rawText]"+                      , ""+                      , "  [link]: /url"+                      ]+     , "Reference link is followed by citation"+          =: (para ((link "/url" "" "link") <> cite [Citation "author" [] [] NormalCitation 0 0] (str "[@author]")))+          =?> unlines [ "[link][][@author]"+                      , ""+                      , "  [link]: /url"+                      ]+     , "Reference link is followed by space and citation"+          =: (para ((link "/url" "" "link") <> space <> cite [Citation "author" [] [] NormalCitation 0 0] (str "[@author]")))+          =?> unlines [ "[link][] [@author]"+                      , ""+                      , "  [link]: /url"+                      ]+     ]
+ tests/Tests/Writers/RST.hs view
@@ -0,0 +1,79 @@+{-# LANGUAGE OverloadedStrings #-}+module Tests.Writers.RST (tests) where++import Test.Framework+import Text.Pandoc.Builder+import Text.Pandoc+import Tests.Helpers+import Tests.Arbitrary()++infix 4 =:+(=:) :: (ToString a, ToPandoc a)+     => String -> (a, String) -> Test+(=:) = test (writeRST def{ writerHighlight = True } . toPandoc)++tests :: [Test]+tests = [ testGroup "rubrics"+          [ "in list item" =:+              bulletList [header 2 (text "foo")] =?>+              "-  .. rubric:: foo"+          , "in definition list item" =:+              definitionList [(text "foo", [header 2 (text "bar"),+                                            para $ text "baz"])] =?>+              unlines+              [ "foo"+              , "    .. rubric:: bar"+              , ""+              , "    baz"]+          , "in block quote" =:+              blockQuote (header 1 (text "bar")) =?>+              "    .. rubric:: bar"+          , "with id" =:+              blockQuote (headerWith ("foo",[],[]) 1 (text "bar")) =?>+              unlines+              [ "    .. rubric:: bar"+              , "       :name: foo"]+          , "with id class" =:+              blockQuote (headerWith ("foo",["baz"],[]) 1 (text "bar")) =?>+              unlines+              [ "    .. rubric:: bar"+              , "       :name: foo"+              , "       :class: baz"]+          ]+        , testGroup "headings"+          [ "normal heading" =:+              header 1 (text "foo") =?>+              unlines+              [ "foo"+              , "==="]+          , "heading levels" =:+              header 1 (text "Header 1") <>+              header 3 (text "Header 2") <>+              header 2 (text "Header 2") <>+              header 1 (text "Header 1") <>+              header 4 (text "Header 2") <>+              header 5 (text "Header 3") <>+              header 3 (text "Header 2") =?>+              unlines+              [ "Header 1"+              , "========"+              , ""+              , "Header 2"+              , "--------"+              , ""+              , "Header 2"+              , "--------"+              , ""+              , "Header 1"+              , "========"+              , ""+              , "Header 2"+              , "--------"+              , ""+              , "Header 3"+              , "~~~~~~~~"+              , ""+              , "Header 2"+              , "--------"]+          ]+        ]
+ tests/docx/german_styled_lists.docx view

binary file changed (absent → 43957 bytes)

+ tests/docx/german_styled_lists.native view
@@ -0,0 +1,6 @@+[BulletList+ [[Para [Str "One",Space,Str "level",Space,Str "of",Space,Str "the",Space,Str "list."]]+ ,[Para [Str "Second",Space,Str "level",Space,Str "of",Space,Str "the",Space,Str "list."]+  ,BulletList+   [[Para [Str "Next",Space,Str "level",Space,Str "of",Space,Str "the",Space,Str "list"]]]]+ ,[Para [Str "Back",Space,Str "to",Space,Str "the",Space,Str "top",Space,Str "level."]]]]
+ tests/docx/image_no_embed_writer.native view
@@ -0,0 +1,2 @@+[Para [Str "An",Space,Str "image:"]+,Para [Image [] ("media/rId25.jpg","")]]
+ tests/docx/image_vml.docx view

binary file changed (absent → 23559 bytes)

+ tests/docx/image_vml.native view
@@ -0,0 +1,4 @@+[Header 1 ("vml-image",[],[]) [Strong [Str "VML",Space,Str "Image"]]+,BlockQuote+ [Para [Str "It",Space,Str "should",Space,Str "follow",Space,Str "below:"]+ ,Para [Image [] ("media/image4.jpeg","")]]]
+ tests/docx/inline_formatting_writer.native view
@@ -0,0 +1,5 @@+[Para [Str "Regular",Space,Str "text",Space,Emph [Str "italics"],Space,Strong [Str "bold",Space,Emph [Str "bold",Space,Str "italics"]],Str "."]+,Para [Str "This",Space,Str "is",Space,SmallCaps [Str "Small",Space,Str "Caps"],Str ",",Space,Str "and",Space,Str "this",Space,Str "is",Space,Strikeout [Str "strikethrough"],Str "."]+,Para [Str "Some",Space,Str "people",Space,Str "use",Space,Emph [Str "single",Space,Str "underlines",Space,Str "for",Space,Str "emphasis"],Str "."]+,Para [Str "Above",Space,Str "the",Space,Str "line",Space,Str "is",Space,Superscript [Str "superscript"],Space,Str "and",Space,Str "below",Space,Str "the",Space,Str "line",Space,Str "is",Space,Subscript [Str "subscript"],Str "."]+,Para [Str "A",Space,Str "line",LineBreak,Str "break."]]
+ tests/docx/inline_images_writer.native view
@@ -0,0 +1,2 @@+[Para [Str "This",Space,Str "picture",Space,Image [] ("media/rId26.jpg",""),Space,Str "is",Space,Str "an",Space,Str "identicon."]+,Para [Str "Here",Space,Str "is",Space,Link [Str "one",Space,Image [] ("media/rId27.jpg",""),Space,Str "that"] ("http://www.google.com",""),Space,Str "links."]]
@@ -0,0 +1,6 @@+[Header 2 ("an-internal-link-and-an-external-link",[],[]) [Str "An",Space,Str "internal",Space,Str "link",Space,Str "and",Space,Str "an",Space,Str "external",Space,Str "link"]+,Para [Str "An",Space,Link [Str "external",Space,Str "link"] ("http://google.com",""),Space,Str "to",Space,Str "a",Space,Str "popular",Space,Str "website."]+,Para [Str "An",Space,Link [Str "external",Space,Str "link"] ("http://johnmacfarlane.net/pandoc/README.html#synopsis",""),Space,Str "to",Space,Str "a",Space,Str "website",Space,Str "with",Space,Str "an",Space,Str "anchor."]+,Para [Str "An",Space,Link [Str "internal",Space,Str "link"] ("#a-section-for-testing-link-targets",""),Space,Str "to",Space,Str "a",Space,Str "section",Space,Str "header."]+,Para [Str "An",Space,Link [Str "internal",Space,Str "link"] ("#my_bookmark",""),Space,Str "to",Space,Str "a",Space,Str "bookmark."]+,Header 2 ("a-section-for-testing-link-targets",[],[]) [Str "A",Space,Str "section",Space,Str "for",Space,Str "testing",Space,Str "link",Space,Str "targets"]]
+ tests/docx/lists_writer.native view
@@ -0,0 +1,17 @@+[Header 2 ("some-nested-lists",[],[]) [Str "Some",Space,Str "nested",Space,Str "lists"]+,OrderedList (1,Decimal,Period)+ [[Para [Str "one"]]+ ,[Para [Str "two"]+  ,OrderedList (1,LowerAlpha,DefaultDelim)+   [[Para [Str "a"]]+   ,[Para [Str "b"]]]]]+,BulletList+ [[Para [Str "one"]]+ ,[Para [Str "two"]+  ,BulletList+   [[Para [Str "three"]+    ,BulletList+     [[Para [Str "four"]]]]]]+ ,[Para [Str "Same",Space,Str "list"]]]+,BulletList+ [[Para [Str "Different",Space,Str "list",Space,Str "adjacent",Space,Str "to",Space,Str "the",Space,Str "one",Space,Str "above."]]]]
+ tests/docx/table_with_list_cell.docx view

binary file changed (absent → 32615 bytes)

+ tests/docx/table_with_list_cell.native view
@@ -0,0 +1,11 @@+[Table [] [AlignDefault,AlignDefault] [0.0,0.0]+ [[Plain [Str "Cell",Space,Str "with",Space,Str "text"]]+ ,[Plain [Str "Cell",Space,Str "with",Space,Str "text"]]]+ [[[BulletList+    [[Para [Str "Cell",Space,Str "with"]]+    ,[Para [Str "A"]]+    ,[Para [Str "Bullet",Space,Str "list"]]]]+  ,[OrderedList (1,Decimal,Period)+    [[Para [Str "Cell",Space,Str "with"]]+    ,[Para [Str "A"]]+    ,[Para [Str "Numbered",Space,Str "list."]]]]]]]
+ tests/docx/verbatim_subsuper.docx view

binary file changed (absent → 10353 bytes)

+ tests/docx/verbatim_subsuper.native view
@@ -0,0 +1,8 @@+[Para [Str "m",Superscript [Str "2"]]+,Para [Str "m",Superscript [Code ("",[],[]) "2"]]+,Para [Code ("",[],[]) "m",Superscript [Str "2"]]+,Para [Code ("",[],[]) "m",Superscript [Code ("",[],[]) "2"]]+,Para [Str "m",Subscript [Str "2"]]+,Para [Str "m",Subscript [Code ("",[],[]) "2"]]+,Para [Code ("",[],[]) "m",Subscript [Str "2"]]+,Para [Code ("",[],[]) "m",Subscript [Code ("",[],[]) "2"]]]
tests/dokuwiki_inline_formatting.dokuwiki view
@@ -6,7 +6,8 @@  Above the line is <sup>superscript</sup> and below the line is <sub>subscript</sub>. -A line\\ break.+A line\\+break.  hello %%//%% world %%**%% from %%__%% me 
tests/html-reader.html view
@@ -433,6 +433,7 @@ <p>text<em>   Leading spaces</em></p> <p><em>Trailing spaces    </em>text</p> <h1>Tables</h1>+<h2>Tables with Headers</h2> <table>     <tr>         <th>X</th>@@ -449,6 +450,252 @@         <td>5</td>         <td>6</td>     </tr>+</table>+<hr />+<table>+    <thead>+    <tr>+        <th>X</th>+        <th>Y</th>+        <th>Z</th>+    </tr>+    </thead>+    <tbody>+    <tr>+        <td>1</td>+        <td>2</td>+        <td>3</td>+    </tr>+    <tr>+        <td>4</td>+        <td>5</td>+        <td>6</td>+    </tr>+    </tbody>+</table>+<hr />+<table>+    <thead>+    <tr>+        <th>X</th>+        <th>Y</th>+        <th>Z</th>+    </tr>+    </thead>+    <tbody>+    <tr>+        <th>1</th>+        <td>2</td>+        <td>3</td>+    </tr>+    <tr>+        <th>4</th>+        <td>5</td>+        <td>6</td>+    </tr>+    </tbody>+</table>+<hr />+<table>+    <thead>+    <tr>+        <th>X</th>+        <th>Y</th>+        <th>Z</th>+    </tr>+    </thead>+    <tbody>+    <tr>+        <th>1</th>+        <td>2</td>+        <td>3</td>+    </tr>+    </tbody>+    <tfoot>+    <tr>+        <th>4</th>+        <td>5</td>+        <td>6</td>+    </tr>+    </tfoot>+</table>+<hr />+<table>+    <tr>+        <th>X</th>+        <th>Y</th>+        <th>Z</th>+    </tr>+    <tr>+        <th>1</th>+        <th>2</th>+        <th>3</th>+    </tr>+    <tr>+        <td>4</td>+        <td>5</td>+        <td>6</td>+    </tr>+</table>+<hr />+<table>+    <tbody>+    <tr>+        <th>X</th>+        <th>Y</th>+        <th>Z</th>+    </tr>+    <tr>+        <td>1</td>+        <td>2</td>+        <td>3</td>+    </tr>+    <tr>+        <td>4</td>+        <td>5</td>+        <td>6</td>+    </tr>+    </tbody>+</table>+<hr />+<table>+    <thead>+    </thead>+    <tbody>+    <tr>+        <th>X</th>+        <th>Y</th>+        <th>Z</th>+    </tr>+    <tr>+        <td>1</td>+        <td>2</td>+        <td>3</td>+    </tr>+    <tr>+        <td>4</td>+        <td>5</td>+        <td>6</td>+    </tr>+    </tbody>+</table>+<hr />+<table>+    <thead>+    <tr>+        <th>X</th>+        <th>Y</th>+        <th>Z</th>+    </tr>+    </thead>+    <tbody>+    <tr>+        <td>1</td>+        <td>2</td>+        <td>3</td>+    </tr>+    </tbody>+    <tbody>+    <tr>+        <td>4</td>+        <td>5</td>+        <td>6</td>+    </tr>+    </tbody>+</table>+<hr />+<table>+    <thead>+    <tr>+        <th>X</th>+        <th>Y</th>+        <th>Z</th>+    </tr>+    </thead>+    <tbody>+    <tr>+        <td>1</td>+        <td><p>2</p></td>+        <td>3</td>+    </tr>+    </tbody>+    <tbody>+    <tr>+        <td>4</td>+        <td>5</td>+        <td>6</td>+    </tr>+    </tbody>+</table>+<h2>Tables without Headers</h2>+<table>+    <tbody>+    <tr>+        <td>1</td>+        <td>2</td>+        <td>3</td>+    </tr>+    <tr>+        <td>4</td>+        <td>5</td>+        <td>6</td>+    </tr>+    </tbody>+</table>+<hr />+<table>+    <tr>+        <td>1</td>+        <td>2</td>+        <td>3</td>+    </tr>+    <tr>+        <td>4</td>+        <td>5</td>+        <td>6</td>+    </tr>+</table>+<hr />+<table>+    <thead>+    </thead>+    <tbody>+    <tr>+        <td>1</td>+        <td>2</td>+        <td>3</td>+    </tr>+    <tr>+        <td>4</td>+        <td>5</td>+        <td>6</td>+    </tr>+    </tbody>+</table>+<hr />+<table>+    <tbody>+    <tr>+        <td>1</td>+        <td>2</td>+        <td>3</td>+    </tr>+    </tbody>+    <tfoot>+    <tr>+        <td>4</td>+        <td>5</td>+        <td>6</td>+    </tr>+    </tfoot>+</table>+<h2>Empty Tables</h2>+<p>This section should be empty.</p>+<table>+    <tbody>+    </tbody>+</table>+<table> </table> </body> </html>
tests/html-reader.native view
@@ -311,6 +311,7 @@ ,Para [Str "text",Space,Emph [Str "Leading",Space,Str "spaces"]] ,Para [Emph [Str "Trailing",Space,Str "spaces"],Space,Str "text"] ,Header 1 ("",[],[]) [Str "Tables"]+,Header 2 ("",[],[]) [Str "Tables",Space,Str "with",Space,Str "Headers"] ,Table [] [AlignDefault,AlignDefault,AlignDefault] [0.0,0.0,0.0]  [[Plain [Str "X"]]  ,[Plain [Str "Y"]]@@ -320,4 +321,130 @@   ,[Plain [Str "3"]]]  ,[[Plain [Str "4"]]   ,[Plain [Str "5"]]-  ,[Plain [Str "6"]]]]]+  ,[Plain [Str "6"]]]]+,HorizontalRule+,Table [] [AlignDefault,AlignDefault,AlignDefault] [0.0,0.0,0.0]+ [[Plain [Str "X"]]+ ,[Plain [Str "Y"]]+ ,[Plain [Str "Z"]]]+ [[[Plain [Str "1"]]+  ,[Plain [Str "2"]]+  ,[Plain [Str "3"]]]+ ,[[Plain [Str "4"]]+  ,[Plain [Str "5"]]+  ,[Plain [Str "6"]]]]+,HorizontalRule+,Table [] [AlignDefault,AlignDefault,AlignDefault] [0.0,0.0,0.0]+ [[Plain [Str "X"]]+ ,[Plain [Str "Y"]]+ ,[Plain [Str "Z"]]]+ [[[Plain [Str "1"]]+  ,[Plain [Str "2"]]+  ,[Plain [Str "3"]]]+ ,[[Plain [Str "4"]]+  ,[Plain [Str "5"]]+  ,[Plain [Str "6"]]]]+,HorizontalRule+,Table [] [AlignDefault,AlignDefault,AlignDefault] [0.0,0.0,0.0]+ [[Plain [Str "X"]]+ ,[Plain [Str "Y"]]+ ,[Plain [Str "Z"]]]+ [[[Plain [Str "1"]]+  ,[Plain [Str "2"]]+  ,[Plain [Str "3"]]]+ ,[[Plain [Str "4"]]+  ,[Plain [Str "5"]]+  ,[Plain [Str "6"]]]]+,HorizontalRule+,Table [] [AlignDefault,AlignDefault,AlignDefault] [0.0,0.0,0.0]+ [[Plain [Str "X"]]+ ,[Plain [Str "Y"]]+ ,[Plain [Str "Z"]]]+ [[[Plain [Str "1"]]+  ,[Plain [Str "2"]]+  ,[Plain [Str "3"]]]+ ,[[Plain [Str "4"]]+  ,[Plain [Str "5"]]+  ,[Plain [Str "6"]]]]+,HorizontalRule+,Table [] [AlignDefault,AlignDefault,AlignDefault] [0.0,0.0,0.0]+ [[Plain [Str "X"]]+ ,[Plain [Str "Y"]]+ ,[Plain [Str "Z"]]]+ [[[Plain [Str "1"]]+  ,[Plain [Str "2"]]+  ,[Plain [Str "3"]]]+ ,[[Plain [Str "4"]]+  ,[Plain [Str "5"]]+  ,[Plain [Str "6"]]]]+,HorizontalRule+,Table [] [AlignDefault,AlignDefault,AlignDefault] [0.0,0.0,0.0]+ [[Plain [Str "X"]]+ ,[Plain [Str "Y"]]+ ,[Plain [Str "Z"]]]+ [[[Plain [Str "1"]]+  ,[Plain [Str "2"]]+  ,[Plain [Str "3"]]]+ ,[[Plain [Str "4"]]+  ,[Plain [Str "5"]]+  ,[Plain [Str "6"]]]]+,HorizontalRule+,Table [] [AlignDefault,AlignDefault,AlignDefault] [0.0,0.0,0.0]+ [[Plain [Str "X"]]+ ,[Plain [Str "Y"]]+ ,[Plain [Str "Z"]]]+ [[[Plain [Str "1"]]+  ,[Plain [Str "2"]]+  ,[Plain [Str "3"]]]+ ,[[Plain [Str "4"]]+  ,[Plain [Str "5"]]+  ,[Plain [Str "6"]]]]+,HorizontalRule+,Table [] [AlignDefault,AlignDefault,AlignDefault] [0.3333333333333333,0.3333333333333333,0.3333333333333333]+ [[Plain [Str "X"]]+ ,[Plain [Str "Y"]]+ ,[Plain [Str "Z"]]]+ [[[Plain [Str "1"]]+  ,[Para [Str "2"]]+  ,[Plain [Str "3"]]]+ ,[[Plain [Str "4"]]+  ,[Plain [Str "5"]]+  ,[Plain [Str "6"]]]]+,Header 2 ("",[],[]) [Str "Tables",Space,Str "without",Space,Str "Headers"]+,Table [] [AlignDefault,AlignDefault,AlignDefault] [0.0,0.0,0.0]+ []+ [[[Plain [Str "1"]]+  ,[Plain [Str "2"]]+  ,[Plain [Str "3"]]]+ ,[[Plain [Str "4"]]+  ,[Plain [Str "5"]]+  ,[Plain [Str "6"]]]]+,HorizontalRule+,Table [] [AlignDefault,AlignDefault,AlignDefault] [0.0,0.0,0.0]+ []+ [[[Plain [Str "1"]]+  ,[Plain [Str "2"]]+  ,[Plain [Str "3"]]]+ ,[[Plain [Str "4"]]+  ,[Plain [Str "5"]]+  ,[Plain [Str "6"]]]]+,HorizontalRule+,Table [] [AlignDefault,AlignDefault,AlignDefault] [0.0,0.0,0.0]+ []+ [[[Plain [Str "1"]]+  ,[Plain [Str "2"]]+  ,[Plain [Str "3"]]]+ ,[[Plain [Str "4"]]+  ,[Plain [Str "5"]]+  ,[Plain [Str "6"]]]]+,HorizontalRule+,Table [] [AlignDefault,AlignDefault,AlignDefault] [0.0,0.0,0.0]+ []+ [[[Plain [Str "1"]]+  ,[Plain [Str "2"]]+  ,[Plain [Str "3"]]]+ ,[[Plain [Str "4"]]+  ,[Plain [Str "5"]]+  ,[Plain [Str "6"]]]]+,Header 2 ("",[],[]) [Str "Empty",Space,Str "Tables"]+,Para [Str "This",Space,Str "section",Space,Str "should",Space,Str "be",Space,Str "empty."]]
tests/latex-reader.latex view
@@ -845,4 +845,31 @@  \$ \% \& \# \_ \{ \} +\section{Block newcommands}++See e.g. issues #1866, #1835++\newcommand{\FIG}[3]{+        \begin{figure}[h!]+                \centering+                \includegraphics[width=#2\columnwidth,angle=0]{#1}+                \caption{#3}+                \label{fig:#1}+        \end{figure}+}++\newcommand{\separator}{\vspace{4em}}++\separator++\FIG{lalune.jpg}{0.5}{Test caption}++\newcommand{\wbal}{The Wikibook about \LaTeX}++\wbal is a good resource for learning \LaTeX.++\separator with trailing inlines++\FIG{lalune.jpg}{0.5}{Test caption} with trailing inlines+ \end{document}
tests/latex-reader.native view
@@ -372,4 +372,13 @@  [[Para [Str "And",Space,Str "in",Space,Str "list",Space,Str "items.",Note [Para [Str "In",Space,Str "list."]]]]] ,Para [Str "This",Space,Str "paragraph",Space,Str "should",Space,Str "not",Space,Str "be",Space,Str "part",Space,Str "of",Space,Str "the",Space,Str "note,",Space,Str "as",Space,Str "it",Space,Str "is",Space,Str "not",Space,Str "indented."] ,Header 1 ("escaped-characters",[],[]) [Str "Escaped",Space,Str "characters"]-,Para [Str "$",Space,Str "%",Space,Str "&",Space,Str "#",Space,Str "_",Space,Str "{",Space,Str "}"]]+,Para [Str "$",Space,Str "%",Space,Str "&",Space,Str "#",Space,Str "_",Space,Str "{",Space,Str "}"]+,Header 1 ("block-newcommands",[],[]) [Str "Block",Space,Str "newcommands"]+,Para [Str "See",Space,Str "e.g.",Space,Str "issues",Space,Str "#1866,",Space,Str "#1835"]+,RawBlock (Format "latex") "\\vspace{4em}"+,Para [RawInline (Format "latex") "\\centering",Image [Str "Test",Space,Str "caption",Span ("",[],[("data-label","fig:lalune.jpg")]) []] ("lalune.jpg","fig:")]+,Para [Span ("",[],[]) [Str "The",Space,Str "Wikibook",Space,Str "about",Space,Str "LaTeX"],Str "is",Space,Str "a",Space,Str "good",Space,Str "resource",Space,Str "for",Space,Str "learning",Space,Str "LaTeX."]+,RawBlock (Format "latex") "\\vspace{4em}"+,Para [Str "with",Space,Str "trailing",Space,Str "inlines"]+,Para [RawInline (Format "latex") "\\centering",Image [Str "Test",Space,Str "caption",Span ("",[],[("data-label","fig:lalune.jpg")]) []] ("lalune.jpg","fig:")]+,Para [Str "with",Space,Str "trailing",Space,Str "inlines"]]
tests/lhs-test.html view
@@ -6,13 +6,50 @@   <meta name="generator" content="pandoc" />   <title></title>   <style type="text/css">code{white-space: pre;}</style>+  <style type="text/css">+div.sourceCode { overflow-x: auto; }+table.sourceCode, tr.sourceCode, td.lineNumbers, td.sourceCode {+  margin: 0; padding: 0; vertical-align: baseline; border: none; }+table.sourceCode { width: 100%; line-height: 100%; }+td.lineNumbers { text-align: right; padding-right: 4px; padding-left: 4px; color: #aaaaaa; border-right: 1px solid #aaaaaa; }+td.sourceCode { padding-left: 5px; }+code > span.kw { color: #007020; font-weight: bold; } /* Keyword */+code > span.dt { color: #902000; } /* DataType */+code > span.dv { color: #40a070; } /* DecVal */+code > span.bn { color: #40a070; } /* BaseN */+code > span.fl { color: #40a070; } /* Float */+code > span.ch { color: #4070a0; } /* Char */+code > span.st { color: #4070a0; } /* String */+code > span.co { color: #60a0b0; font-style: italic; } /* Comment */+code > span.ot { color: #007020; } /* Other */+code > span.al { color: #ff0000; font-weight: bold; } /* Alert */+code > span.fu { color: #06287e; } /* Function */+code > span.er { color: #ff0000; font-weight: bold; } /* Error */+code > span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warning */+code > span.cn { color: #880000; } /* Constant */+code > span.sc { color: #4070a0; } /* SpecialChar */+code > span.vs { color: #4070a0; } /* VerbatimString */+code > span.ss { color: #bb6688; } /* SpecialString */+code > span.im { } /* Import */+code > span.va { color: #19177c; } /* Variable */+code > span.cf { color: #007020; font-weight: bold; } /* ControlFlow */+code > span.op { color: #666666; } /* Operator */+code > span.bu { } /* BuiltIn */+code > span.ex { } /* Extension */+code > span.pp { color: #bc7a00; } /* Preprocessor */+code > span.at { color: #7d9029; } /* Attribute */+code > span.do { color: #ba2121; font-style: italic; } /* Documentation */+code > span.an { color: #60a0b0; font-weight: bold; font-style: italic; } /* Annotation */+code > span.cv { color: #60a0b0; font-weight: bold; font-style: italic; } /* CommentVar */+code > span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Information */+  </style> </head> <body> <h1 id="lhs-test">lhs test</h1> <p><code>unsplit</code> is an arrow that takes a pair of values and combines them to return a single value:</p>-<pre class="sourceCode literate haskell"><code>unsplit :: (Arrow a) =&gt; (b -&gt; c -&gt; d) -&gt; a (b, c) d-unsplit = arr . uncurry-          -- arr (\op (x,y) -&gt; x `op` y)</code></pre>+<div class="sourceCode"><pre class="sourceCode literate haskell"><code class="sourceCode haskell"><span class="ot">unsplit ::</span> (<span class="dt">Arrow</span> a) <span class="ot">=&gt;</span> (b <span class="ot">-&gt;</span> c <span class="ot">-&gt;</span> d) <span class="ot">-&gt;</span> a (b, c) d+unsplit <span class="fu">=</span> arr <span class="fu">.</span> uncurry+          <span class="co">-- arr (\op (x,y) -&gt; x `op` y)</span></code></pre></div> <p><code>(***)</code> combines two arrows into a new arrow by running the two arrows on a pair of values (one arrow on the first item of the pair and one arrow on the second item of the pair).</p> <pre><code>f *** g = first f &gt;&gt;&gt; second g</code></pre> <p>Block quote:</p>
tests/lhs-test.html+lhs view
@@ -6,14 +6,50 @@   <meta name="generator" content="pandoc" />   <title></title>   <style type="text/css">code{white-space: pre;}</style>+  <style type="text/css">+div.sourceCode { overflow-x: auto; }+table.sourceCode, tr.sourceCode, td.lineNumbers, td.sourceCode {+  margin: 0; padding: 0; vertical-align: baseline; border: none; }+table.sourceCode { width: 100%; line-height: 100%; }+td.lineNumbers { text-align: right; padding-right: 4px; padding-left: 4px; color: #aaaaaa; border-right: 1px solid #aaaaaa; }+td.sourceCode { padding-left: 5px; }+code > span.kw { color: #007020; font-weight: bold; } /* Keyword */+code > span.dt { color: #902000; } /* DataType */+code > span.dv { color: #40a070; } /* DecVal */+code > span.bn { color: #40a070; } /* BaseN */+code > span.fl { color: #40a070; } /* Float */+code > span.ch { color: #4070a0; } /* Char */+code > span.st { color: #4070a0; } /* String */+code > span.co { color: #60a0b0; font-style: italic; } /* Comment */+code > span.ot { color: #007020; } /* Other */+code > span.al { color: #ff0000; font-weight: bold; } /* Alert */+code > span.fu { color: #06287e; } /* Function */+code > span.er { color: #ff0000; font-weight: bold; } /* Error */+code > span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warning */+code > span.cn { color: #880000; } /* Constant */+code > span.sc { color: #4070a0; } /* SpecialChar */+code > span.vs { color: #4070a0; } /* VerbatimString */+code > span.ss { color: #bb6688; } /* SpecialString */+code > span.im { } /* Import */+code > span.va { color: #19177c; } /* Variable */+code > span.cf { color: #007020; font-weight: bold; } /* ControlFlow */+code > span.op { color: #666666; } /* Operator */+code > span.bu { } /* BuiltIn */+code > span.ex { } /* Extension */+code > span.pp { color: #bc7a00; } /* Preprocessor */+code > span.at { color: #7d9029; } /* Attribute */+code > span.do { color: #ba2121; font-style: italic; } /* Documentation */+code > span.an { color: #60a0b0; font-weight: bold; font-style: italic; } /* Annotation */+code > span.cv { color: #60a0b0; font-weight: bold; font-style: italic; } /* CommentVar */+code > span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Information */+  </style> </head> <body> <h1 id="lhs-test">lhs test</h1> <p><code>unsplit</code> is an arrow that takes a pair of values and combines them to return a single value:</p>-<pre class="sourceCode literate haskell"><code>&gt; unsplit :: (Arrow a) =&gt; (b -&gt; c -&gt; d) -&gt; a (b, c) d-&gt; unsplit = arr . uncurry-&gt;           -- arr (\op (x,y) -&gt; x `op` y)-</code></pre>+<div class="sourceCode"><pre class="sourceCode literate literatehaskell"><code class="sourceCode literatehaskell"><span class="ot">&gt; unsplit ::</span> (<span class="dt">Arrow</span> a) <span class="ot">=&gt;</span> (b <span class="ot">-&gt;</span> c <span class="ot">-&gt;</span> d) <span class="ot">-&gt;</span> a (b, c) d+<span class="ot">&gt;</span> unsplit <span class="fu">=</span> arr <span class="fu">.</span> uncurry+<span class="ot">&gt;</span>           <span class="co">-- arr (\op (x,y) -&gt; x `op` y)</span></code></pre></div> <p><code>(***)</code> combines two arrows into a new arrow by running the two arrows on a pair of values (one arrow on the first item of the pair and one arrow on the second item of the pair).</p> <pre><code>f *** g = first f &gt;&gt;&gt; second g</code></pre> <p>Block quote:</p>
tests/lhs-test.latex view
@@ -40,13 +40,63 @@             linkcolor=magenta,             pdfborder={0 0 0}} \urlstyle{same}  % don't use monospace font for urls+\usepackage{color}+\usepackage{fancyvrb}+\newcommand{\VerbBar}{|}+\newcommand{\VERB}{\Verb[commandchars=\\\{\}]}+\DefineVerbatimEnvironment{Highlighting}{Verbatim}{commandchars=\\\{\}}+% Add ',fontsize=\small' for more characters per line+\newenvironment{Shaded}{}{}+\newcommand{\KeywordTok}[1]{\textcolor[rgb]{0.00,0.44,0.13}{\textbf{{#1}}}}+\newcommand{\DataTypeTok}[1]{\textcolor[rgb]{0.56,0.13,0.00}{{#1}}}+\newcommand{\DecValTok}[1]{\textcolor[rgb]{0.25,0.63,0.44}{{#1}}}+\newcommand{\BaseNTok}[1]{\textcolor[rgb]{0.25,0.63,0.44}{{#1}}}+\newcommand{\FloatTok}[1]{\textcolor[rgb]{0.25,0.63,0.44}{{#1}}}+\newcommand{\ConstantTok}[1]{\textcolor[rgb]{0.53,0.00,0.00}{{#1}}}+\newcommand{\CharTok}[1]{\textcolor[rgb]{0.25,0.44,0.63}{{#1}}}+\newcommand{\SpecialCharTok}[1]{\textcolor[rgb]{0.25,0.44,0.63}{{#1}}}+\newcommand{\StringTok}[1]{\textcolor[rgb]{0.25,0.44,0.63}{{#1}}}+\newcommand{\VerbatimStringTok}[1]{\textcolor[rgb]{0.25,0.44,0.63}{{#1}}}+\newcommand{\SpecialStringTok}[1]{\textcolor[rgb]{0.73,0.40,0.53}{{#1}}}+\newcommand{\ImportTok}[1]{{#1}}+\newcommand{\CommentTok}[1]{\textcolor[rgb]{0.38,0.63,0.69}{\textit{{#1}}}}+\newcommand{\DocumentationTok}[1]{\textcolor[rgb]{0.73,0.13,0.13}{\textit{{#1}}}}+\newcommand{\AnnotationTok}[1]{\textcolor[rgb]{0.38,0.63,0.69}{\textbf{\textit{{#1}}}}}+\newcommand{\CommentVarTok}[1]{\textcolor[rgb]{0.38,0.63,0.69}{\textbf{\textit{{#1}}}}}+\newcommand{\OtherTok}[1]{\textcolor[rgb]{0.00,0.44,0.13}{{#1}}}+\newcommand{\FunctionTok}[1]{\textcolor[rgb]{0.02,0.16,0.49}{{#1}}}+\newcommand{\VariableTok}[1]{\textcolor[rgb]{0.10,0.09,0.49}{{#1}}}+\newcommand{\ControlFlowTok}[1]{\textcolor[rgb]{0.00,0.44,0.13}{\textbf{{#1}}}}+\newcommand{\OperatorTok}[1]{\textcolor[rgb]{0.40,0.40,0.40}{{#1}}}+\newcommand{\BuiltInTok}[1]{{#1}}+\newcommand{\ExtensionTok}[1]{{#1}}+\newcommand{\PreprocessorTok}[1]{\textcolor[rgb]{0.74,0.48,0.00}{{#1}}}+\newcommand{\AttributeTok}[1]{\textcolor[rgb]{0.49,0.56,0.16}{{#1}}}+\newcommand{\RegionMarkerTok}[1]{{#1}}+\newcommand{\InformationTok}[1]{\textcolor[rgb]{0.38,0.63,0.69}{\textbf{\textit{{#1}}}}}+\newcommand{\WarningTok}[1]{\textcolor[rgb]{0.38,0.63,0.69}{\textbf{\textit{{#1}}}}}+\newcommand{\AlertTok}[1]{\textcolor[rgb]{1.00,0.00,0.00}{\textbf{{#1}}}}+\newcommand{\ErrorTok}[1]{\textcolor[rgb]{1.00,0.00,0.00}{\textbf{{#1}}}}+\newcommand{\NormalTok}[1]{{#1}} \setlength{\parindent}{0pt} \setlength{\parskip}{6pt plus 2pt minus 1pt} \setlength{\emergencystretch}{3em}  % prevent overfull lines+\providecommand{\tightlist}{%+  \setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}} \setcounter{secnumdepth}{0}  \date{} +% Redefines (sub)paragraphs to behave more like sections+\ifx\paragraph\undefined\else+\let\oldparagraph\paragraph+\renewcommand{\paragraph}[1]{\oldparagraph{#1}\mbox{}}+\fi+\ifx\subparagraph\undefined\else+\let\oldsubparagraph\subparagraph+\renewcommand{\subparagraph}[1]{\oldsubparagraph{#1}\mbox{}}+\fi+ \begin{document}  \section{lhs test}\label{lhs-test}@@ -54,11 +104,13 @@ \texttt{unsplit} is an arrow that takes a pair of values and combines them to return a single value: -\begin{verbatim}-unsplit :: (Arrow a) => (b -> c -> d) -> a (b, c) d-unsplit = arr . uncurry-          -- arr (\op (x,y) -> x `op` y)-\end{verbatim}+\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}+          \CommentTok{-- arr (\textbackslash{}op (x,y) -> x `op` y)}+\end{Highlighting}+\end{Shaded}  \texttt{(***)} combines two arrows into a new arrow by running the two arrows on a pair of values (one arrow on the first item of the pair and one arrow on
tests/lhs-test.latex+lhs view
@@ -23,8 +23,6 @@ \usepackage{microtype} \UseMicrotypeSet[protrusion]{basicmath} % disable protrusion for tt fonts }{}-\usepackage{listings}-\lstnewenvironment{code}{\lstset{language=Haskell,basicstyle=\small\ttfamily}}{} \ifxetex   \usepackage[setpagesize=false, % page size defined by xetex               unicode=false, % unicode breaks when used with xetex@@ -42,12 +40,26 @@             linkcolor=magenta,             pdfborder={0 0 0}} \urlstyle{same}  % don't use monospace font for urls+\usepackage{listings}+\lstnewenvironment{code}{\lstset{language=Haskell,basicstyle=\small\ttfamily}}{} \setlength{\parindent}{0pt} \setlength{\parskip}{6pt plus 2pt minus 1pt} \setlength{\emergencystretch}{3em}  % prevent overfull lines+\providecommand{\tightlist}{%+  \setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}} \setcounter{secnumdepth}{0}  \date{}++% Redefines (sub)paragraphs to behave more like sections+\ifx\paragraph\undefined\else+\let\oldparagraph\paragraph+\renewcommand{\paragraph}[1]{\oldparagraph{#1}\mbox{}}+\fi+\ifx\subparagraph\undefined\else+\let\oldsubparagraph\subparagraph+\renewcommand{\subparagraph}[1]{\oldsubparagraph{#1}\mbox{}}+\fi  \begin{document} 
tests/markdown-reader-more.native view
@@ -76,6 +76,7 @@ ,Header 3 ("my-other-header",[],[]) [Str "My",Space,Str "other",Space,Str "header"] ,Para [Str "A",Space,Str "link",Space,Str "to",Space,Link [Str "My",Space,Str "header"] ("#my-header-1",""),Str "."] ,Para [Str "Another",Space,Str "link",Space,Str "to",Space,Link [Str "it"] ("#my-header-1",""),Str "."]+,Para [Str "Should",Space,Str "be",Space,Link [Str "case",Space,Str "insensitive"] ("#my-header-1",""),Str "."] ,Para [Str "Link",Space,Str "to",Space,Link [Str "Explicit",Space,Str "header",Space,Str "attributes"] ("#foobar",""),Str "."] ,Para [Str "But",Space,Str "this",Space,Str "is",Space,Str "not",Space,Str "a",Space,Str "link",Space,Str "to",Space,Link [Str "My",Space,Str "other",Space,Str "header"] ("/foo",""),Str ",",Space,Str "since",Space,Str "the",Space,Str "reference",Space,Str "is",Space,Str "defined."] ,Header 2 ("foobar",["baz"],[("key","val")]) [Str "Explicit",Space,Str "header",Space,Str "attributes"]@@ -150,10 +151,15 @@ ,Para [Link [Str "link"] ("/hi(there)","")] ,Para [Link [Str "link"] ("/hithere)","")] ,Para [Link [Str "linky"] ("hi_(there_(nested))","")]+,Header 2 ("backslashes-in-link-references",[],[]) [Str "Backslashes",Space,Str "in",Space,Str "link",Space,Str "references"]+,Para [Link [Str "*",RawInline (Format "tex") "\\a"] ("b","")] ,Header 2 ("reference-link-fallbacks",[],[]) [Str "Reference",Space,Str "link",Space,Str "fallbacks"] ,Para [Str "[",Emph [Str "not",Space,Str "a",Space,Str "link"],Str "]",Space,Str "[",Emph [Str "nope"],Str "]\8230"] ,Header 2 ("reference-link-followed-by-a-citation",[],[]) [Str "Reference",Space,Str "link",Space,Str "followed",Space,Str "by",Space,Str "a",Space,Str "citation"] ,Para [Str "MapReduce",Space,Str "is",Space,Str "a",Space,Str "paradigm",Space,Str "popularized",Space,Str "by",Space,Link [Str "Google"] ("http://google.com",""),Space,Cite [Citation {citationId = "mapreduce", citationPrefix = [], citationSuffix = [], citationMode = NormalCitation, citationNoteNum = 0, citationHash = 0}] [Str "[@mapreduce]"],Space,Str "as",Space,Str "its",Space,Str "most",Space,Str "vocal",Space,Str "proponent."] ,Header 2 ("empty-reference-links",[],[]) [Str "Empty",Space,Str "reference",Space,Str "links"] ,Para [Str "bar"]-,Para [Link [Str "foo2"] ("","")]]+,Para [Link [Str "foo2"] ("","")]+,Header 2 ("wrapping-shouldnt-introduce-new-list-items",[],[]) [Str "Wrapping",Space,Str "shouldn\8217t",Space,Str "introduce",Space,Str "new",Space,Str "list",Space,Str "items"]+,BulletList+ [[Plain [Str "blah",Space,Str "blah",Space,Str "blah",Space,Str "blah",Space,Str "blah",Space,Str "blah",Space,Str "blah",Space,Str "blah",Space,Str "blah",Space,Str "blah",Space,Str "blah",Space,Str "blah",Space,Str "blah",Space,Str "blah",Space,Str "2015."]]]]
tests/markdown-reader-more.txt view
@@ -168,6 +168,8 @@  Another link to [it][My header]. +Should be [case insensitive][my header].+ Link to [Explicit header attributes].  [my other header]: /foo@@ -258,6 +260,10 @@  [linky]: hi_(there_(nested)) +## Backslashes in link references++[\*\a](b)+ ## Reference link fallbacks  [*not a link*] [*nope*]...@@ -276,3 +282,8 @@ bar  [foo2]++## Wrapping shouldn't introduce new list items++- blah blah blah blah blah blah blah blah blah blah blah blah blah blah 2015.+
+ tests/media/rId25.jpg view
+ tests/media/rId26.jpg view
+ tests/media/rId27.jpg view
tests/pipe-tables.txt view
@@ -1,7 +1,7 @@ Simplest table without caption:  | Default1 | Default2 | Default3 | -|----------|----------|----------|+ |----------|----------|----------| |12|12|12| |123|123|123| |1|1|1|@@ -27,6 +27,7 @@  Headerless table without caption: +|       |      |        | |------:|:-----|:------:| |12|12|12| |123|123|123|@@ -48,5 +49,6 @@  Header-less one-column: +|   | |:-:| |hi|
tests/s5-basic.html view
@@ -46,7 +46,7 @@ <div id="math" class="slide section level1"> <h1>Math</h1> <ul>-<li><span class="math">$\frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}$</span></li>+<li><span class="math inline">$\frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}$</span></li> </ul> </div> </div>
tests/s5-fragment.html view
@@ -5,5 +5,5 @@ </ul> <h1 id="math">Math</h1> <ul>-<li><span class="math">$\frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}$</span></li>+<li><span class="math inline">$\frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}$</span></li> </ul>
tests/s5-inserts.html view
@@ -27,7 +27,7 @@ </ul> <h1 id="math">Math</h1> <ul>-<li><span class="math">$\frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}$</span></li>+<li><span class="math inline">$\frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}$</span></li> </ul> STUFF INSERTED </body>
tests/tables.opendocument view
@@ -63,7 +63,7 @@     </table:table-cell>   </table:table-row> </table:table>-<text:p text:style-name="Caption">Demonstration of simple table+<text:p text:style-name="TableCaption">Demonstration of simple table syntax.</text:p> <text:p text:style-name="First_20_paragraph">Simple table without caption:</text:p>@@ -197,7 +197,7 @@     </table:table-cell>   </table:table-row> </table:table>-<text:p text:style-name="Caption">Demonstration of simple table+<text:p text:style-name="TableCaption">Demonstration of simple table syntax.</text:p> <text:p text:style-name="First_20_paragraph">Multiline table with caption:</text:p>@@ -253,8 +253,8 @@     </table:table-cell>   </table:table-row> </table:table>-<text:p text:style-name="Caption">Here's the caption. It may span multiple-lines.</text:p>+<text:p text:style-name="TableCaption">Here's the caption. It may span+multiple lines.</text:p> <text:p text:style-name="First_20_paragraph">Multiline table without caption:</text:p> <table:table table:name="Table5" table:style-name="Table5">
tests/test-pandoc.hs view
@@ -8,6 +8,7 @@ import qualified Tests.Readers.LaTeX import qualified Tests.Readers.Markdown import qualified Tests.Readers.Org+import qualified Tests.Readers.HTML import qualified Tests.Readers.RST import qualified Tests.Readers.Docx import qualified Tests.Readers.Txt2Tags@@ -20,6 +21,8 @@ import qualified Tests.Writers.Markdown import qualified Tests.Writers.Plain import qualified Tests.Writers.AsciiDoc+import qualified Tests.Writers.Docx+import qualified Tests.Writers.RST import qualified Tests.Shared import qualified Tests.Walk import Text.Pandoc.Shared (inDirectory)@@ -38,10 +41,13 @@           , testGroup "Markdown" Tests.Writers.Markdown.tests           , testGroup "Plain" Tests.Writers.Plain.tests           , testGroup "AsciiDoc" Tests.Writers.AsciiDoc.tests+          , testGroup "Docx" Tests.Writers.Docx.tests+          , testGroup "RST" Tests.Writers.RST.tests           ]         , testGroup "Readers"           [ testGroup "LaTeX" Tests.Readers.LaTeX.tests           , testGroup "Markdown" Tests.Readers.Markdown.tests+          , testGroup "HTML" Tests.Readers.HTML.tests           , testGroup "Org" Tests.Readers.Org.tests           , testGroup "RST" Tests.Readers.RST.tests           , testGroup "Docx" Tests.Readers.Docx.tests
tests/writer.asciidoc view
@@ -375,15 +375,19 @@ Simple block on one line:  foo+ And nested without indentation:  foo  bar+ Interpreted markdown in a table:  This is _emphasized_+ And this is *strong*+ Here’s a simple block:  foo@@ -405,6 +409,7 @@ Now, nested:  foo+ This should just be an HTML comment:  Multiline:@@ -485,7 +490,7 @@ LaTeX ----- -*+*  * latexmath:[$2+2=4$] * latexmath:[$x \in y$] * latexmath:[$\alpha \wedge \omega$]
tests/writer.dokuwiki view
@@ -36,7 +36,8 @@  Here’s one with a bullet. * criminey. -There should be a hard line break\\ here.+There should be a hard line break\\+here.   ----
tests/writer.html view
@@ -35,7 +35,8 @@ <p>Here’s a regular paragraph.</p> <p>In Markdown 1.0.0 and earlier. Version 8. This line turns into a list item. Because a hard-wrapped line in the middle of a paragraph looked like a list item.</p> <p>Here’s one with a bullet. * criminey.</p>-<p>There should be a hard line break<br />here.</p>+<p>There should be a hard line break<br />+here.</p> <hr /> <h1 id="block-quotes">Block Quotes</h1> <p>E-mail style:</p>@@ -419,13 +420,13 @@ <h1 id="latex">LaTeX</h1> <ul> <li></li>-<li><span class="math">2 + 2 = 4</span></li>-<li><span class="math"><em>x</em> ∈ <em>y</em></span></li>-<li><span class="math"><em>α</em> ∧ <em>ω</em></span></li>-<li><span class="math">223</span></li>-<li><span class="math"><em>p</em></span>-Tree</li>-<li>Here’s some display math: <br /><span class="math">$$\frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}$$</span><br /></li>-<li>Here’s one that has a line break in it: <span class="math"><em>α</em> + <em>ω</em> × <em>x</em><sup>2</sup></span>.</li>+<li><span class="math inline">2 + 2 = 4</span></li>+<li><span class="math inline"><em>x</em> ∈ <em>y</em></span></li>+<li><span class="math inline"><em>α</em> ∧ <em>ω</em></span></li>+<li><span class="math inline">223</span></li>+<li><span class="math inline"><em>p</em></span>-Tree</li>+<li>Here’s some display math: <br /><span class="math display">$$\frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}$$</span><br /></li>+<li>Here’s one that has a line break in it: <span class="math inline"><em>α</em> + <em>ω</em> × <em>x</em><sup>2</sup></span>.</li> </ul> <p>These shouldn’t be math:</p> <ul>
tests/writer.icml view
@@ -410,11 +410,6 @@         <Properties>           <BasedOn type="object">$ID/NormalParagraphStyle</BasedOn>         </Properties>-      </ParagraphStyle>-      <ParagraphStyle Self="ParagraphStyle/Rawblock" Name="Rawblock" LeftIndent="0">-        <Properties>-          <BasedOn type="object">$ID/NormalParagraphStyle</BasedOn>-        </Properties>       </ParagraphStyle>      </RootParagraphStyleGroup>     <RootTableStyleGroup Self="pandoc_table_styles">@@ -1389,21 +1384,6 @@     <Content>Interpreted markdown in a table:</Content>   </CharacterStyleRange><Br /> </ParagraphStyleRange>-<ParagraphStyleRange AppliedParagraphStyle="ParagraphStyle/Rawblock">-  <CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle">-    <Content>&lt;table&gt;</Content>-  </CharacterStyleRange><Br />-</ParagraphStyleRange>-<ParagraphStyleRange AppliedParagraphStyle="ParagraphStyle/Rawblock">-  <CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle">-    <Content>&lt;tr&gt;</Content>-  </CharacterStyleRange><Br />-</ParagraphStyleRange>-<ParagraphStyleRange AppliedParagraphStyle="ParagraphStyle/Rawblock">-  <CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle">-    <Content>&lt;td&gt;</Content>-  </CharacterStyleRange><Br />-</ParagraphStyleRange> <ParagraphStyleRange AppliedParagraphStyle="">   <CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle">     <Content>This is </Content>@@ -1412,16 +1392,6 @@     <Content>emphasized</Content>   </CharacterStyleRange><Br /> </ParagraphStyleRange>-<ParagraphStyleRange AppliedParagraphStyle="ParagraphStyle/Rawblock">-  <CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle">-    <Content>&lt;/td&gt;</Content>-  </CharacterStyleRange><Br />-</ParagraphStyleRange>-<ParagraphStyleRange AppliedParagraphStyle="ParagraphStyle/Rawblock">-  <CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle">-    <Content>&lt;td&gt;</Content>-  </CharacterStyleRange><Br />-</ParagraphStyleRange> <ParagraphStyleRange AppliedParagraphStyle="">   <CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle">     <Content>And this is </Content>@@ -1430,26 +1400,6 @@     <Content>strong</Content>   </CharacterStyleRange><Br /> </ParagraphStyleRange>-<ParagraphStyleRange AppliedParagraphStyle="ParagraphStyle/Rawblock">-  <CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle">-    <Content>&lt;/td&gt;</Content>-  </CharacterStyleRange><Br />-</ParagraphStyleRange>-<ParagraphStyleRange AppliedParagraphStyle="ParagraphStyle/Rawblock">-  <CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle">-    <Content>&lt;/tr&gt;</Content>-  </CharacterStyleRange><Br />-</ParagraphStyleRange>-<ParagraphStyleRange AppliedParagraphStyle="ParagraphStyle/Rawblock">-  <CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle">-    <Content>&lt;/table&gt;</Content>-  </CharacterStyleRange><Br />-</ParagraphStyleRange>-<ParagraphStyleRange AppliedParagraphStyle="ParagraphStyle/Rawblock">-  <CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle">-    <Content>&lt;script type=&quot;text/javascript&quot;&gt;document.write('This *should not* be interpreted as markdown');&lt;/script&gt;</Content>-  </CharacterStyleRange><Br />-</ParagraphStyleRange> <ParagraphStyleRange AppliedParagraphStyle="ParagraphStyle/Paragraph">   <CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle">     <Content>Here’s a simple block:</Content>@@ -1497,31 +1447,11 @@     <Content>This should just be an HTML comment:</Content>   </CharacterStyleRange><Br /> </ParagraphStyleRange>-<ParagraphStyleRange AppliedParagraphStyle="ParagraphStyle/Rawblock">-  <CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle">-    <Content>&lt;!-- Comment --&gt;</Content>-  </CharacterStyleRange><Br />-</ParagraphStyleRange> <ParagraphStyleRange AppliedParagraphStyle="ParagraphStyle/Paragraph">   <CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle">     <Content>Multiline:</Content>   </CharacterStyleRange><Br /> </ParagraphStyleRange>-<ParagraphStyleRange AppliedParagraphStyle="ParagraphStyle/Rawblock">-  <CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle">-    <Content>&lt;!---Blah-Blah---&gt;</Content>-  </CharacterStyleRange><Br />-</ParagraphStyleRange>-<ParagraphStyleRange AppliedParagraphStyle="ParagraphStyle/Rawblock">-  <CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle">-    <Content>&lt;!---    This is another comment.---&gt;</Content>-  </CharacterStyleRange><Br />-</ParagraphStyleRange> <ParagraphStyleRange AppliedParagraphStyle="ParagraphStyle/Paragraph">   <CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle">     <Content>Code block:</Content>@@ -1537,11 +1467,6 @@     <Content>Just plain comment, with trailing spaces on the line:</Content>   </CharacterStyleRange><Br /> </ParagraphStyleRange>-<ParagraphStyleRange AppliedParagraphStyle="ParagraphStyle/Rawblock">-  <CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle">-    <Content>&lt;!-- foo --&gt;</Content>-  </CharacterStyleRange><Br />-</ParagraphStyleRange> <ParagraphStyleRange AppliedParagraphStyle="ParagraphStyle/Paragraph">   <CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle">     <Content>Code:</Content>@@ -1557,51 +1482,6 @@     <Content>Hr’s:</Content>   </CharacterStyleRange><Br /> </ParagraphStyleRange>-<ParagraphStyleRange AppliedParagraphStyle="ParagraphStyle/Rawblock">-  <CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle">-    <Content>&lt;hr&gt;</Content>-  </CharacterStyleRange><Br />-</ParagraphStyleRange>-<ParagraphStyleRange AppliedParagraphStyle="ParagraphStyle/Rawblock">-  <CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle">-    <Content>&lt;hr /&gt;</Content>-  </CharacterStyleRange><Br />-</ParagraphStyleRange>-<ParagraphStyleRange AppliedParagraphStyle="ParagraphStyle/Rawblock">-  <CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle">-    <Content>&lt;hr /&gt;</Content>-  </CharacterStyleRange><Br />-</ParagraphStyleRange>-<ParagraphStyleRange AppliedParagraphStyle="ParagraphStyle/Rawblock">-  <CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle">-    <Content>&lt;hr&gt;</Content>-  </CharacterStyleRange><Br />-</ParagraphStyleRange>-<ParagraphStyleRange AppliedParagraphStyle="ParagraphStyle/Rawblock">-  <CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle">-    <Content>&lt;hr /&gt;</Content>-  </CharacterStyleRange><Br />-</ParagraphStyleRange>-<ParagraphStyleRange AppliedParagraphStyle="ParagraphStyle/Rawblock">-  <CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle">-    <Content>&lt;hr /&gt;</Content>-  </CharacterStyleRange><Br />-</ParagraphStyleRange>-<ParagraphStyleRange AppliedParagraphStyle="ParagraphStyle/Rawblock">-  <CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle">-    <Content>&lt;hr class=&quot;foo&quot; id=&quot;bar&quot; /&gt;</Content>-  </CharacterStyleRange><Br />-</ParagraphStyleRange>-<ParagraphStyleRange AppliedParagraphStyle="ParagraphStyle/Rawblock">-  <CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle">-    <Content>&lt;hr class=&quot;foo&quot; id=&quot;bar&quot; /&gt;</Content>-  </CharacterStyleRange><Br />-</ParagraphStyleRange>-<ParagraphStyleRange AppliedParagraphStyle="ParagraphStyle/Rawblock">-  <CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle">-    <Content>&lt;hr class=&quot;foo&quot; id=&quot;bar&quot;&gt;</Content>-  </CharacterStyleRange><Br />-</ParagraphStyleRange> <ParagraphStyleRange AppliedParagraphStyle="ParagraphStyle/Header1">   <CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle">     <Content>Inline Markup</Content>@@ -1980,9 +1860,7 @@   </CharacterStyleRange><Br /> </ParagraphStyleRange> <ParagraphStyleRange AppliedParagraphStyle="ParagraphStyle/BulList &gt; first" NumberingContinue="false">-  <CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle">-    <Content>\cite[22-23]{smith.1899}</Content>-  </CharacterStyleRange><Br />+  <Br /> </ParagraphStyleRange> <ParagraphStyleRange AppliedParagraphStyle="ParagraphStyle/BulList">   <CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle">@@ -2097,15 +1975,6 @@     <Content>Here’s a LaTeX table:</Content>   </CharacterStyleRange><Br /> </ParagraphStyleRange>-<ParagraphStyleRange AppliedParagraphStyle="ParagraphStyle/Rawblock">-  <CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle">-    <Content>\begin{tabular}{|l|l|}\hline-Animal &amp; Number \\ \hline-Dog    &amp; 2      \\-Cat    &amp; 1      \\ \hline-\end{tabular}</Content>-  </CharacterStyleRange><Br />-</ParagraphStyleRange> <ParagraphStyleRange AppliedParagraphStyle="ParagraphStyle/Header1">   <CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle">     <Content>Special Characters</Content>@@ -2645,7 +2514,7 @@             <GraphicBounds Left="0" Top="0" Right="150" Bottom="100" />           </Profile>         </Properties>-        <Link Self="ueb" LinkResourceURI="lalune.jpg" />+        <Link Self="ueb" LinkResourceURI="file:lalune.jpg" />       </Image>     </Rectangle>   </CharacterStyleRange><Br />@@ -2675,7 +2544,7 @@             <GraphicBounds Left="0" Top="0" Right="150" Bottom="100" />           </Profile>         </Properties>-        <Link Self="ueb" LinkResourceURI="movie.jpg" />+        <Link Self="ueb" LinkResourceURI="file:movie.jpg" />       </Image>     </Rectangle>   </CharacterStyleRange>
tests/writer.latex view
@@ -23,17 +23,6 @@ \usepackage{microtype} \UseMicrotypeSet[protrusion]{basicmath} % disable protrusion for tt fonts }{}-\usepackage{fancyvrb}-\VerbatimFootnotes-\usepackage{graphicx}-\makeatletter-\def\maxwidth{\ifdim\Gin@nat@width>\linewidth\linewidth\else\Gin@nat@width\fi}-\def\maxheight{\ifdim\Gin@nat@height>\textheight\textheight\else\Gin@nat@height\fi}-\makeatother-% Scale images if necessary, so that they will not overflow the page-% margins by default, and it is still possible to overwrite the defaults-% using explicit options in \includegraphics[width, height, ...]{}-\setkeys{Gin}{width=\maxwidth,height=\maxheight,keepaspectratio} \ifxetex   \usepackage[setpagesize=false, % page size defined by xetex               unicode=false, % unicode breaks when used with xetex@@ -51,12 +40,25 @@             linkcolor=magenta,             pdfborder={0 0 0}} \urlstyle{same}  % don't use monospace font for urls+\usepackage{fancyvrb}+\VerbatimFootnotes+\usepackage{graphicx,grffile}+\makeatletter+\def\maxwidth{\ifdim\Gin@nat@width>\linewidth\linewidth\else\Gin@nat@width\fi}+\def\maxheight{\ifdim\Gin@nat@height>\textheight\textheight\else\Gin@nat@height\fi}+\makeatother+% Scale images if necessary, so that they will not overflow the page+% margins by default, and it is still possible to overwrite the defaults+% using explicit options in \includegraphics[width, height, ...]{}+\setkeys{Gin}{width=\maxwidth,height=\maxheight,keepaspectratio} \usepackage[normalem]{ulem} % avoid problems with \sout in headers with hyperref: \pdfstringdefDisableCommands{\renewcommand{\sout}{}} \setlength{\parindent}{0pt} \setlength{\parskip}{6pt plus 2pt minus 1pt} \setlength{\emergencystretch}{3em}  % prevent overfull lines+\providecommand{\tightlist}{%+  \setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}} \setcounter{secnumdepth}{0} \VerbatimFootnotes % allows verbatim text in footnotes @@ -64,6 +66,16 @@ \author{John MacFarlane \and Anonymous} \date{July 17, 2006} +% Redefines (sub)paragraphs to behave more like sections+\ifx\paragraph\undefined\else+\let\oldparagraph\paragraph+\renewcommand{\paragraph}[1]{\oldparagraph{#1}\mbox{}}+\fi+\ifx\subparagraph\undefined\else+\let\oldsubparagraph\subparagraph+\renewcommand{\subparagraph}[1]{\oldsubparagraph{#1}\mbox{}}+\fi+ \begin{document} \maketitle @@ -109,7 +121,8 @@  Here's one with a bullet. * criminey. -There should be a hard line break\\here.+There should be a hard line break\\+here.  \begin{center}\rule{0.5\linewidth}{\linethickness}\end{center} @@ -134,7 +147,7 @@  \begin{enumerate} \def\labelenumi{\arabic{enumi}.}-\itemsep1pt\parskip0pt\parsep0pt+\tightlist \item   item one \item@@ -189,7 +202,7 @@ Asterisks tight:  \begin{itemize}-\itemsep1pt\parskip0pt\parsep0pt+\tightlist \item   asterisk 1 \item@@ -212,7 +225,7 @@ Pluses tight:  \begin{itemize}-\itemsep1pt\parskip0pt\parsep0pt+\tightlist \item   Plus 1 \item@@ -235,7 +248,7 @@ Minuses tight:  \begin{itemize}-\itemsep1pt\parskip0pt\parsep0pt+\tightlist \item   Minus 1 \item@@ -261,7 +274,7 @@  \begin{enumerate} \def\labelenumi{\arabic{enumi}.}-\itemsep1pt\parskip0pt\parsep0pt+\tightlist \item   First \item@@ -274,7 +287,7 @@  \begin{enumerate} \def\labelenumi{\arabic{enumi}.}-\itemsep1pt\parskip0pt\parsep0pt+\tightlist \item   One \item@@ -324,17 +337,17 @@ \subsection{Nested}\label{nested}  \begin{itemize}-\itemsep1pt\parskip0pt\parsep0pt+\tightlist \item   Tab    \begin{itemize}-  \itemsep1pt\parskip0pt\parsep0pt+  \tightlist   \item     Tab      \begin{itemize}-    \itemsep1pt\parskip0pt\parsep0pt+    \tightlist     \item       Tab     \end{itemize}@@ -345,14 +358,14 @@  \begin{enumerate} \def\labelenumi{\arabic{enumi}.}-\itemsep1pt\parskip0pt\parsep0pt+\tightlist \item   First \item   Second:    \begin{itemize}-  \itemsep1pt\parskip0pt\parsep0pt+  \tightlist   \item     Fee   \item@@ -374,7 +387,7 @@   Second:    \begin{itemize}-  \itemsep1pt\parskip0pt\parsep0pt+  \tightlist   \item     Fee   \item@@ -417,7 +430,7 @@   \begin{enumerate}   \def\labelenumii{\roman{enumii}.}   \setcounter{enumii}{3}-  \itemsep1pt\parskip0pt\parsep0pt+  \tightlist   \item     sublist with roman numerals, starting with 4   \item@@ -425,7 +438,7 @@      \begin{enumerate}     \def\labelenumiii{(\Alph{enumiii})}-    \itemsep1pt\parskip0pt\parsep0pt+    \tightlist     \item       a subsublist     \item@@ -438,27 +451,27 @@  \begin{enumerate} \def\labelenumi{\Alph{enumi}.}-\itemsep1pt\parskip0pt\parsep0pt+\tightlist \item   Upper Alpha    \begin{enumerate}   \def\labelenumii{\Roman{enumii}.}-  \itemsep1pt\parskip0pt\parsep0pt+  \tightlist   \item     Upper Roman.      \begin{enumerate}     \def\labelenumiii{(\arabic{enumiii})}     \setcounter{enumiii}{5}-    \itemsep1pt\parskip0pt\parsep0pt+    \tightlist     \item       Decimal start with 6        \begin{enumerate}       \def\labelenumiv{\alph{enumiv})}       \setcounter{enumiv}{2}-      \itemsep1pt\parskip0pt\parsep0pt+      \tightlist       \item         Lower alpha with paren       \end{enumerate}@@ -469,14 +482,14 @@ Autonumbering:  \begin{enumerate}-\itemsep1pt\parskip0pt\parsep0pt+\tightlist \item   Autonumber. \item   More.    \begin{enumerate}-  \itemsep1pt\parskip0pt\parsep0pt+  \tightlist   \item     Nested.   \end{enumerate}@@ -495,7 +508,7 @@ Tight using spaces:  \begin{description}-\itemsep1pt\parskip0pt\parsep0pt+\tightlist \item[apple] red fruit \item[orange]@@ -507,7 +520,7 @@ Tight using tabs:  \begin{description}-\itemsep1pt\parskip0pt\parsep0pt+\tightlist \item[apple] red fruit \item[orange]@@ -549,7 +562,7 @@ Multiple definitions, tight:  \begin{description}-\itemsep1pt\parskip0pt\parsep0pt+\tightlist \item[apple] red fruit @@ -585,7 +598,7 @@  \begin{enumerate} \def\labelenumi{\arabic{enumi}.}-\itemsep1pt\parskip0pt\parsep0pt+\tightlist \item   sublist \item@@ -711,7 +724,7 @@ \section{LaTeX}\label{latex}  \begin{itemize}-\itemsep1pt\parskip0pt\parsep0pt+\tightlist \item   \cite[22-23]{smith.1899} \item@@ -734,7 +747,7 @@ These shouldn't be math:  \begin{itemize}-\itemsep1pt\parskip0pt\parsep0pt+\tightlist \item   To get the famous equation, write \texttt{\$e\ =\ mc\^{}2\$}. \item@@ -761,7 +774,7 @@ Here is some unicode:  \begin{itemize}-\itemsep1pt\parskip0pt\parsep0pt+\tightlist \item   I hat: Î \item@@ -885,7 +898,7 @@ With an ampersand: \url{http://example.com/?foo=1\&bar=2}  \begin{itemize}-\itemsep1pt\parskip0pt\parsep0pt+\tightlist \item   In a list? \item@@ -951,7 +964,7 @@  \begin{enumerate} \def\labelenumi{\arabic{enumi}.}-\itemsep1pt\parskip0pt\parsep0pt+\tightlist \item   And in list items.\footnote{In list.} \end{enumerate}
tests/writer.markdown view
@@ -80,7 +80,7 @@ > > > nested -This should not be a block quote: 2 \> 1.+This should not be a block quote: 2 &gt; 1.  And a following paragraph. @@ -549,8 +549,8 @@ These shouldn’t be math:  -   To get the famous equation, write `$e = mc^2$`.--   \$22,000 is a *lot* of money. So is \$34,000. (It worked if “lot” is-    emphasized.)+-   \$22,000 is a *lot* of money. So is \$34,000. (It worked if “lot”+    is emphasized.) -   Shoes (\$20) and socks (\$5). -   Escaped `$`: \$73 *this should be emphasized* 23\$. @@ -581,9 +581,9 @@  This & that. -4 \< 5.+4 &lt; 5. -6 \> 5.+6 &gt; 5.  Backslash: \\ @@ -597,15 +597,15 @@  Right brace: } -Left bracket: [+Left bracket: \[ -Right bracket: ]+Right bracket: \]  Left paren: (  Right paren: ) -Greater-than: \>+Greater-than: &gt;  Hash: \# @@ -652,7 +652,7 @@  Foo [bar](/url/). -With [embedded [brackets]](/url/).+With [embedded \[brackets\]](/url/).  [b](/url/) by itself should be a link. @@ -662,7 +662,7 @@  Indented [thrice](/url). -This should [not][] be a link.+This should \[not\]\[\] be a link.      [not]: /url @@ -716,8 +716,8 @@ =========  Here is a footnote reference,[^1] and another.[^2] This should *not* be a-footnote reference, because it contains a space.[\^my note] Here is an inline-note.[^3]+footnote reference, because it contains a space.\[\^my note\] Here is an+inline note.[^3]  > Notes can go in quotes.[^4] @@ -740,7 +740,7 @@  [^3]: This is *easier* to type. Inline notes may contain     [links](http://google.com) and `]` verbatim characters, as well as-    [bracketed text].+    \[bracketed text\].  [^4]: In quote. 
tests/writer.mediawiki view
@@ -36,7 +36,8 @@  Here’s one with a bullet. * criminey. -There should be a hard line break<br />here.+There should be a hard line break<br />+here.   -----@@ -623,9 +624,9 @@  From “Voyage dans la Lune” by Georges Melies (1902): -[[Image:lalune.jpg|frame|none|alt=Voyage dans la Lune|caption lalune]]+[[File:lalune.jpg|frame|none|alt=Voyage dans la Lune|caption lalune]] -Here is a movie [[Image:movie.jpg|movie]] icon.+Here is a movie [[File:movie.jpg|movie]] icon.   -----
tests/writer.opendocument view
@@ -864,7 +864,7 @@   </office:automatic-styles> <office:body> <office:text>-<text:h text:style-name="Title">Pandoc Test Suite</text:h>+<text:p text:style-name="Title">Pandoc Test Suite</text:p> <text:p text:style-name="Author">John MacFarlane</text:p> <text:p text:style-name="Author">Anonymous</text:p> <text:p text:style-name="Date">July 17, 2006</text:p>@@ -896,7 +896,8 @@ <text:p text:style-name="Text_20_body">Here’s one with a bullet. * criminey.</text:p> <text:p text:style-name="Text_20_body">There should be a hard line-break<text:line-break />here.</text:p>+break<text:line-break />+here.</text:p> <text:p text:style-name="Horizontal_20_Line" /> <text:h text:style-name="Heading_20_1" text:outline-level="1">Block Quotes</text:h>@@ -1576,7 +1577,8 @@ <text:h text:style-name="Heading_20_1" text:outline-level="1">Images</text:h> <text:p text:style-name="First_20_paragraph">From “Voyage dans la Lune” by Georges Melies (1902):</text:p>-<text:p text:style-name="Text_20_body"><draw:frame draw:name="img1"><draw:image xlink:href="lalune.jpg" xlink:type="simple" xlink:show="embed" xlink:actuate="onLoad" /></draw:frame></text:p>+<text:p text:style-name="FigureWithCaption"><draw:frame draw:name="img1"><draw:image xlink:href="lalune.jpg" xlink:type="simple" xlink:show="embed" xlink:actuate="onLoad" /></draw:frame></text:p>+<text:p text:style-name="FigureCaption">lalune</text:p> <text:p text:style-name="Text_20_body">Here is a movie <draw:frame draw:name="img2"><draw:image xlink:href="movie.jpg" xlink:type="simple" xlink:show="embed" xlink:actuate="onLoad" /></draw:frame> icon.</text:p>
tests/writer.opml view
@@ -26,14 +26,14 @@ </outline> <outline text="Paragraphs" _note="Here’s a regular paragraph.&#10;&#10;In Markdown 1.0.0 and earlier. Version 8. This line turns into a list&#10;item. Because a hard-wrapped line in the middle of a paragraph looked&#10;like a list item.&#10;&#10;Here’s one with a bullet. \* criminey.&#10;&#10;There should be a hard line break\&#10;here.&#10;&#10;------------------------------------------------------------------------"> </outline>-<outline text="Block Quotes" _note="E-mail style:&#10;&#10;&gt; This is a block quote. It is pretty short.&#10;&#10;&gt; Code in a block quote:&#10;&gt;&#10;&gt;     sub status {&#10;&gt;         print &quot;working&quot;;&#10;&gt;     }&#10;&gt;&#10;&gt; A list:&#10;&gt;&#10;&gt; 1.  item one&#10;&gt; 2.  item two&#10;&gt;&#10;&gt; Nested block quotes:&#10;&gt;&#10;&gt; &gt; nested&#10;&gt;&#10;&gt; &gt; nested&#10;&#10;This should not be a block quote: 2 \&gt; 1.&#10;&#10;And a following paragraph.&#10;&#10;------------------------------------------------------------------------">+<outline text="Block Quotes" _note="E-mail style:&#10;&#10;&gt; This is a block quote. It is pretty short.&#10;&#10;&gt; Code in a block quote:&#10;&gt;&#10;&gt;     sub status {&#10;&gt;         print &quot;working&quot;;&#10;&gt;     }&#10;&gt;&#10;&gt; A list:&#10;&gt;&#10;&gt; 1.  item one&#10;&gt; 2.  item two&#10;&gt;&#10;&gt; Nested block quotes:&#10;&gt;&#10;&gt; &gt; nested&#10;&gt;&#10;&gt; &gt; nested&#10;&#10;This should not be a block quote: 2 &amp;gt; 1.&#10;&#10;And a following paragraph.&#10;&#10;------------------------------------------------------------------------"> </outline> <outline text="Code Blocks" _note="Code:&#10;&#10;    ---- (should be four hyphens)&#10;&#10;    sub status {&#10;        print &quot;working&quot;;&#10;    }&#10;&#10;    this code block is indented by one tab&#10;&#10;And:&#10;&#10;        this code block is indented by two tabs&#10;&#10;    These should not be escaped:  \$ \\ \&gt; \[ \{&#10;&#10;------------------------------------------------------------------------"> </outline> <outline text="Lists">   <outline text="Unordered" _note="Asterisks tight:&#10;&#10;-   asterisk 1&#10;-   asterisk 2&#10;-   asterisk 3&#10;&#10;Asterisks loose:&#10;&#10;-   asterisk 1&#10;&#10;-   asterisk 2&#10;&#10;-   asterisk 3&#10;&#10;Pluses tight:&#10;&#10;-   Plus 1&#10;-   Plus 2&#10;-   Plus 3&#10;&#10;Pluses loose:&#10;&#10;-   Plus 1&#10;&#10;-   Plus 2&#10;&#10;-   Plus 3&#10;&#10;Minuses tight:&#10;&#10;-   Minus 1&#10;-   Minus 2&#10;-   Minus 3&#10;&#10;Minuses loose:&#10;&#10;-   Minus 1&#10;&#10;-   Minus 2&#10;&#10;-   Minus 3&#10;&#10;">   </outline>-  <outline text="Ordered" _note="Tight:&#10;&#10;1.  First&#10;2.  Second&#10;3.  Third&#10;&#10;and:&#10;&#10;1.  One&#10;2.  Two&#10;3.  Three&#10;&#10;Loose using tabs:&#10;&#10;1.  First&#10;&#10;2.  Second&#10;&#10;3.  Third&#10;&#10;and using spaces:&#10;&#10;1.  One&#10;&#10;2.  Two&#10;&#10;3.  Three&#10;&#10;Multiple paragraphs:&#10;&#10;1.  Item 1, graf one.&#10;&#10;    Item 1. graf two. The quick brown fox jumped over the lazy dog’s&#10;    back.&#10;&#10;2.  Item 2.&#10;&#10;3.  Item 3.&#10;&#10;">+  <outline text="Ordered" _note="Tight:&#10;&#10;1.  First&#10;2.  Second&#10;3.  Third&#10;&#10;and:&#10;&#10;1.  One&#10;2.  Two&#10;3.  Three&#10;&#10;Loose using tabs:&#10;&#10;1.  First&#10;&#10;2.  Second&#10;&#10;3.  Third&#10;&#10;and using spaces:&#10;&#10;1.  One&#10;&#10;2.  Two&#10;&#10;3.  Three&#10;&#10;Multiple paragraphs:&#10;&#10;1.  Item 1, graf one.&#10;&#10;    Item 1. graf two. The quick brown fox jumped over the lazy&#10;    dog’s back.&#10;&#10;2.  Item 2.&#10;&#10;3.  Item 3.&#10;&#10;">   </outline>   <outline text="Nested" _note="-   Tab&#10;    -   Tab&#10;        -   Tab&#10;&#10;Here’s another:&#10;&#10;1.  First&#10;2.  Second:&#10;    -   Fee&#10;    -   Fie&#10;    -   Foe&#10;&#10;3.  Third&#10;&#10;Same thing but with paragraphs:&#10;&#10;1.  First&#10;&#10;2.  Second:&#10;&#10;    -   Fee&#10;    -   Fie&#10;    -   Foe&#10;&#10;3.  Third&#10;&#10;">   </outline>@@ -50,14 +50,14 @@ </outline> <outline text="Smart quotes, ellipses, dashes" _note="“Hello,” said the spider. “‘Shelob’ is my name.”&#10;&#10;‘A’, ‘B’, and ‘C’ are letters.&#10;&#10;‘Oak,’ ‘elm,’ and ‘beech’ are names of trees. So is ‘pine.’&#10;&#10;‘He said, “I want to go.”’ Were you alive in the 70’s?&#10;&#10;Here is some quoted ‘`code`’ and a “[quoted&#10;link](http://example.com/?foo=1&amp;bar=2)”.&#10;&#10;Some dashes: one—two — three—four — five.&#10;&#10;Dashes between numbers: 5–7, 255–66, 1987–1999.&#10;&#10;Ellipses…and…and….&#10;&#10;------------------------------------------------------------------------"> </outline>-<outline text="LaTeX" _note="-   \cite[22-23]{smith.1899}&#10;-   $2+2=4$&#10;-   $x \in y$&#10;-   $\alpha \wedge \omega$&#10;-   $223$&#10;-   $p$-Tree&#10;-   Here’s some display math:&#10;    $$\frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}$$&#10;-   Here’s one that has a line break in it:&#10;    $\alpha + \omega \times x^2$.&#10;&#10;These shouldn’t be math:&#10;&#10;-   To get the famous equation, write `$e = mc^2$`.&#10;-   \$22,000 is a *lot* of money. So is \$34,000. (It worked if “lot” is&#10;    emphasized.)&#10;-   Shoes (\$20) and socks (\$5).&#10;-   Escaped `$`: \$73 *this should be emphasized* 23\$.&#10;&#10;Here’s a LaTeX table:&#10;&#10;\begin{tabular}{|l|l|}\hline&#10;Animal &amp; Number \\ \hline&#10;Dog    &amp; 2      \\&#10;Cat    &amp; 1      \\ \hline&#10;\end{tabular}&#10;&#10;------------------------------------------------------------------------">+<outline text="LaTeX" _note="-   \cite[22-23]{smith.1899}&#10;-   $2+2=4$&#10;-   $x \in y$&#10;-   $\alpha \wedge \omega$&#10;-   $223$&#10;-   $p$-Tree&#10;-   Here’s some display math:&#10;    $$\frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}$$&#10;-   Here’s one that has a line break in it:&#10;    $\alpha + \omega \times x^2$.&#10;&#10;These shouldn’t be math:&#10;&#10;-   To get the famous equation, write `$e = mc^2$`.&#10;-   \$22,000 is a *lot* of money. So is \$34,000. (It worked if “lot”&#10;    is emphasized.)&#10;-   Shoes (\$20) and socks (\$5).&#10;-   Escaped `$`: \$73 *this should be emphasized* 23\$.&#10;&#10;Here’s a LaTeX table:&#10;&#10;\begin{tabular}{|l|l|}\hline&#10;Animal &amp; Number \\ \hline&#10;Dog    &amp; 2      \\&#10;Cat    &amp; 1      \\ \hline&#10;\end{tabular}&#10;&#10;------------------------------------------------------------------------"> </outline>-<outline text="Special Characters" _note="Here is some unicode:&#10;&#10;-   I hat: Î&#10;-   o umlaut: ö&#10;-   section: §&#10;-   set membership: ∈&#10;-   copyright: ©&#10;&#10;AT&amp;T has an ampersand in their name.&#10;&#10;AT&amp;T is another way to write it.&#10;&#10;This &amp; that.&#10;&#10;4 \&lt; 5.&#10;&#10;6 \&gt; 5.&#10;&#10;Backslash: \\&#10;&#10;Backtick: \`&#10;&#10;Asterisk: \*&#10;&#10;Underscore: \_&#10;&#10;Left brace: {&#10;&#10;Right brace: }&#10;&#10;Left bracket: [&#10;&#10;Right bracket: ]&#10;&#10;Left paren: (&#10;&#10;Right paren: )&#10;&#10;Greater-than: \&gt;&#10;&#10;Hash: \#&#10;&#10;Period: .&#10;&#10;Bang: !&#10;&#10;Plus: +&#10;&#10;Minus: -&#10;&#10;------------------------------------------------------------------------">+<outline text="Special Characters" _note="Here is some unicode:&#10;&#10;-   I hat: Î&#10;-   o umlaut: ö&#10;-   section: §&#10;-   set membership: ∈&#10;-   copyright: ©&#10;&#10;AT&amp;T has an ampersand in their name.&#10;&#10;AT&amp;T is another way to write it.&#10;&#10;This &amp; that.&#10;&#10;4 &amp;lt; 5.&#10;&#10;6 &amp;gt; 5.&#10;&#10;Backslash: \\&#10;&#10;Backtick: \`&#10;&#10;Asterisk: \*&#10;&#10;Underscore: \_&#10;&#10;Left brace: {&#10;&#10;Right brace: }&#10;&#10;Left bracket: \[&#10;&#10;Right bracket: \]&#10;&#10;Left paren: (&#10;&#10;Right paren: )&#10;&#10;Greater-than: &amp;gt;&#10;&#10;Hash: \#&#10;&#10;Period: .&#10;&#10;Bang: !&#10;&#10;Plus: +&#10;&#10;Minus: -&#10;&#10;------------------------------------------------------------------------"> </outline> <outline text="Links">   <outline text="Explicit" _note="Just a [URL](/url/).&#10;&#10;[URL and title](/url/ &quot;title&quot;).&#10;&#10;[URL and title](/url/ &quot;title preceded by two spaces&quot;).&#10;&#10;[URL and title](/url/ &quot;title preceded by a tab&quot;).&#10;&#10;[URL and title](/url/ &quot;title with &quot;quotes&quot; in it&quot;)&#10;&#10;[URL and title](/url/ &quot;title with single quotes&quot;)&#10;&#10;[with\_underscore](/url/with_underscore)&#10;&#10;[Email link](mailto:nobody@nowhere.net)&#10;&#10;[Empty]().">   </outline>-  <outline text="Reference" _note="Foo [bar](/url/).&#10;&#10;Foo [bar](/url/).&#10;&#10;Foo [bar](/url/).&#10;&#10;With [embedded [brackets]](/url/).&#10;&#10;[b](/url/) by itself should be a link.&#10;&#10;Indented [once](/url).&#10;&#10;Indented [twice](/url).&#10;&#10;Indented [thrice](/url).&#10;&#10;This should [not][] be a link.&#10;&#10;    [not]: /url&#10;&#10;Foo [bar](/url/ &quot;Title with &quot;quotes&quot; inside&quot;).&#10;&#10;Foo [biz](/url/ &quot;Title with &quot;quote&quot; inside&quot;).">+  <outline text="Reference" _note="Foo [bar](/url/).&#10;&#10;Foo [bar](/url/).&#10;&#10;Foo [bar](/url/).&#10;&#10;With [embedded \[brackets\]](/url/).&#10;&#10;[b](/url/) by itself should be a link.&#10;&#10;Indented [once](/url).&#10;&#10;Indented [twice](/url).&#10;&#10;Indented [thrice](/url).&#10;&#10;This should \[not\]\[\] be a link.&#10;&#10;    [not]: /url&#10;&#10;Foo [bar](/url/ &quot;Title with &quot;quotes&quot; inside&quot;).&#10;&#10;Foo [biz](/url/ &quot;Title with &quot;quote&quot; inside&quot;).">   </outline>   <outline text="With ampersands" _note="Here’s a [link with an ampersand in the&#10;URL](http://example.com/?foo=1&amp;bar=2).&#10;&#10;Here’s a link with an amersand in the link text:&#10;[AT&amp;T](http://att.com/ &quot;AT&amp;T&quot;).&#10;&#10;Here’s an [inline link](/script?foo=1&amp;bar=2).&#10;&#10;Here’s an [inline link in pointy braces](/script?foo=1&amp;bar=2).">   </outline>@@ -66,7 +66,7 @@ </outline> <outline text="Images" _note="From “Voyage dans la Lune” by Georges Melies (1902):&#10;&#10;![lalune](lalune.jpg &quot;Voyage dans la Lune&quot;)&#10;&#10;Here is a movie ![movie](movie.jpg) icon.&#10;&#10;------------------------------------------------------------------------"> </outline>-<outline text="Footnotes" _note="Here is a footnote reference,[^1] and another.[^2] This should *not* be&#10;a footnote reference, because it contains a space.[\^my note] Here is an&#10;inline note.[^3]&#10;&#10;&gt; Notes can go in quotes.[^4]&#10;&#10;1.  And in list items.[^5]&#10;&#10;This paragraph should not be part of the note, as it is not indented.&#10;&#10;[^1]: Here is the footnote. It can go anywhere after the footnote&#10;    reference. It need not be placed at the end of the document.&#10;&#10;[^2]: Here’s the long note. This one contains multiple blocks.&#10;&#10;    Subsequent blocks are indented to show that they belong to the&#10;    footnote (as with list items).&#10;&#10;          { &lt;code&gt; }&#10;&#10;    If you want, you can indent every line, but you can also be lazy and&#10;    just indent the first line of each block.&#10;&#10;[^3]: This is *easier* to type. Inline notes may contain&#10;    [links](http://google.com) and `]` verbatim characters, as well as&#10;    [bracketed text].&#10;&#10;[^4]: In quote.&#10;&#10;[^5]: In list.">+<outline text="Footnotes" _note="Here is a footnote reference,[^1] and another.[^2] This should *not* be&#10;a footnote reference, because it contains a space.\[\^my note\] Here is&#10;an inline note.[^3]&#10;&#10;&gt; Notes can go in quotes.[^4]&#10;&#10;1.  And in list items.[^5]&#10;&#10;This paragraph should not be part of the note, as it is not indented.&#10;&#10;[^1]: Here is the footnote. It can go anywhere after the footnote&#10;    reference. It need not be placed at the end of the document.&#10;&#10;[^2]: Here’s the long note. This one contains multiple blocks.&#10;&#10;    Subsequent blocks are indented to show that they belong to the&#10;    footnote (as with list items).&#10;&#10;          { &lt;code&gt; }&#10;&#10;    If you want, you can indent every line, but you can also be lazy and&#10;    just indent the first line of each block.&#10;&#10;[^3]: This is *easier* to type. Inline notes may contain&#10;    [links](http://google.com) and `]` verbatim characters, as well as&#10;    \[bracketed text\].&#10;&#10;[^4]: In quote.&#10;&#10;[^5]: In list."> </outline>   </body> </opml>
tests/writer.plain view
@@ -499,8 +499,8 @@ These shouldn’t be math:  -   To get the famous equation, write $e = mc^2$.--   $22,000 is a _lot_ of money. So is $34,000. (It worked if “lot” is-    emphasized.)+-   $22,000 is a _lot_ of money. So is $34,000. (It worked if “lot”+    is emphasized.) -   Shoes ($20) and socks ($5). -   Escaped $: $73 _this should be emphasized_ 23$. 
tests/writer.rst view
@@ -10,6 +10,10 @@    :format: html latex .. +.. role:: raw-latex(raw)+   :format: latex+..+ This is a set of tests for pandoc. Most of them are adapted from John Gruber’s markdown test suite. @@ -657,7 +661,7 @@ LaTeX ===== --  +-  :raw-latex:`\cite[22-23]{smith.1899}` -  :math:`2+2=4` -  :math:`x \in y` -  :math:`\alpha \wedge \omega`
tests/writer.texinfo view
@@ -36,7 +36,8 @@ @node Top @top Pandoc Test Suite -This is a set of tests for pandoc. Most of them are adapted from John Gruber's markdown test suite.+This is a set of tests for pandoc. Most of them are adapted from John Gruber's+markdown test suite.  @iftex @bigskip@hrule@bigskip@@ -125,11 +126,14 @@ @anchor{#paragraphs} Here's a regular paragraph. -In Markdown 1.0.0 and earlier. Version 8. This line turns into a list item. Because a hard-wrapped line in the middle of a paragraph looked like a list item.+In Markdown 1.0.0 and earlier. Version 8. This line turns into a list item.+Because a hard-wrapped line in the middle of a paragraph looked like a list+item.  Here's one with a bullet. * criminey. -There should be a hard line break@*here.+There should be a hard line break@*+here.  @iftex @bigskip@hrule@bigskip@@ -734,11 +738,14 @@  @textstrikeout{This is @emph{strikeout}.} -Superscripts: a@textsuperscript{bc}d a@textsuperscript{@emph{hello}} a@textsuperscript{hello@ there}.+Superscripts: a@textsuperscript{bc}d a@textsuperscript{@emph{hello}}+a@textsuperscript{hello@ there}. -Subscripts: H@textsubscript{2}O, H@textsubscript{23}O, H@textsubscript{many@ of@ them}O.+Subscripts: H@textsubscript{2}O, H@textsubscript{23}O,+H@textsubscript{many@ of@ them}O. -These should not be superscripts or subscripts, because of the unescaped spaces: a^b c^d, a~b c~d.+These should not be superscripts or subscripts, because of the unescaped+spaces: a^b c^d, a~b c~d.  @iftex @bigskip@hrule@bigskip@@ -758,7 +765,8 @@  `He said, ``I want to go.''' Were you alive in the 70's? -Here is some quoted `@code{code}' and a ``@uref{http://example.com/?foo=1&bar=2,quoted link}''.+Here is some quoted `@code{code}' and a+``@uref{http://example.com/?foo=1&bar=2,quoted link}''.  Some dashes: one---two --- three---four --- five. @@ -792,7 +800,8 @@ @item @math{p}-Tree @item-Here's some display math: @math{\frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}}+Here's some display math:+@math{\frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}} @item Here's one that has a line break in it: @math{\alpha + \omega \times x^2}. @end itemize@@ -803,7 +812,8 @@ @item To get the famous equation, write @code{$e = mc^2$}. @item-$22,000 is a @emph{lot} of money. So is $34,000. (It worked if ``lot'' is emphasized.)+$22,000 is a @emph{lot} of money. So is $34,000. (It worked if ``lot'' is+emphasized.) @item Shoes ($20) and socks ($5). @item@@ -956,7 +966,8 @@ @node With ampersands @section With ampersands @anchor{#with-ampersands}-Here's a @uref{http://example.com/?foo=1&bar=2,link with an ampersand in the URL}.+Here's a @uref{http://example.com/?foo=1&bar=2,link with an ampersand in the+URL}.  Here's a link with an amersand in the link text: @uref{http://att.com/,AT&T}. @@ -1018,15 +1029,24 @@ @node Footnotes @chapter Footnotes @anchor{#footnotes}-Here is a footnote reference,@footnote{Here is the footnote. It can go anywhere after the footnote reference. It need not be placed at the end of the document.} and another.@footnote{Here's the long note. This one contains multiple blocks.+Here is a footnote reference,@footnote{Here is the footnote. It can go+anywhere after the footnote reference. It need not be placed at the end of the+document.} and another.@footnote{Here's the long note. This one contains+multiple blocks. -Subsequent blocks are indented to show that they belong to the footnote (as with list items).+Subsequent blocks are indented to show that they belong to the footnote (as+with list items).  @verbatim   { <code> } @end verbatim -If you want, you can indent every line, but you can also be lazy and just indent the first line of each block.} This should @emph{not} be a footnote reference, because it contains a space.[^my note] Here is an inline note.@footnote{This is @emph{easier} to type. Inline notes may contain @uref{http://google.com,links} and @code{]} verbatim characters, as well as [bracketed text].}+If you want, you can indent every line, but you can also be lazy and just+indent the first line of each block.} This should @emph{not} be a footnote+reference, because it contains a space.[^my note] Here is an inline+note.@footnote{This is @emph{easier} to type. Inline notes may contain+@uref{http://google.com,links} and @code{]} verbatim characters, as well as+[bracketed text].}  @quotation Notes can go in quotes.@footnote{In quote.}
trypandoc/index.html view
@@ -73,7 +73,7 @@         <option value="markdown" selected>Markdown</option>         <option value="markdown_strict">Markdown/strict</option>         <option value="markdown_phpextra">PHP Markdown Extra</option>-        <option value="markdown_github">Github Markdown</option>+        <option value="markdown_github">GitHub Markdown</option>         <option value="markdown_mmd">MultiMarkdown</option>         <option value="rst">reStructuredText</option>         <option value="textile">Textile</option>@@ -99,7 +99,7 @@         <option value="markdown">Markdown</option>         <option value="markdown_strict">Markdown/strict</option>         <option value="markdown_phpextra">PHP Markdown Extra</option>-        <option value="markdown_github">Github Markdown</option>+        <option value="markdown_github">GitHub Markdown</option>         <option value="markdown_mmd">MultiMarkdown</option>         <option value="rst">reStructuredText</option>         <option value="asciidoc">AsciiDoc</option>
trypandoc/trypandoc.hs view
@@ -8,6 +8,7 @@ import Network.HTTP.Types.Header (hContentType) import Network.HTTP.Types.URI (queryToQueryText) import Text.Pandoc+import Text.Pandoc.Error (PandocError) import Text.Pandoc.Shared (tabFilter) import Text.Highlighting.Kate (pygments) import Data.Aeson@@ -29,7 +30,9 @@              $ lookup fromFormat fromFormats   let writer = maybe (error $ "could not find writer for " ++ T.unpack toFormat) id              $ lookup toFormat toFormats-  let result = T.pack $ writer $ reader $ tabFilter 4 $ T.unpack text+  let result = case reader $ tabFilter 4 $ T.unpack text of+                    Right doc -> T.pack $ writer doc+                    Left  err -> error (show err)   let output = encode $ object [ T.pack "result" .= result                                , T.pack "name" .=                                   if fromFormat == "markdown_strict"@@ -55,7 +58,7 @@ readerOpts = def { readerParseRaw = True,                    readerSmart = True } -fromFormats :: [(Text, String -> Pandoc)]+fromFormats :: [(Text, String -> Either PandocError Pandoc)] fromFormats = [             ("native"       , readNative)            ,("json"         , Text.Pandoc.readJSON readerOpts)