summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--MakeManPage.hs2
-rw-r--r--README58
-rw-r--r--changelog227
-rw-r--r--man/man1/markdown2pdf.115
-rw-r--r--man/man1/markdown2pdf.1.md9
-rw-r--r--man/man1/pandoc.170
-rw-r--r--man/man5/pandoc_markdown.57
-rw-r--r--pandoc.cabal39
-rw-r--r--reference.odtbin9572 -> 7058 bytes
-rw-r--r--s5/default/slides.js.comment4
-rw-r--r--s5/default/slides.js.packed74
-rw-r--r--s5/default/slides.min.js1
-rw-r--r--slidy/slidy.css401
-rw-r--r--slidy/slidy.min.css1
-rw-r--r--slidy/slidy.min.js2
-rw-r--r--src/Tests/Readers/Markdown.hs33
-rw-r--r--src/Tests/Readers/RST.hs16
-rw-r--r--src/Tests/Writers/Markdown.hs34
-rw-r--r--src/Text/Pandoc/MIME.hs483
-rw-r--r--src/Text/Pandoc/Parsing.hs44
-rw-r--r--src/Text/Pandoc/Readers/HTML.hs94
-rw-r--r--src/Text/Pandoc/Readers/LaTeX.hs31
-rw-r--r--src/Text/Pandoc/Readers/Markdown.hs63
-rw-r--r--src/Text/Pandoc/Readers/RST.hs65
-rw-r--r--src/Text/Pandoc/Readers/Textile.hs2
-rw-r--r--src/Text/Pandoc/S5.hs24
-rw-r--r--src/Text/Pandoc/Shared.hs3
-rw-r--r--src/Text/Pandoc/Templates.hs5
-rw-r--r--src/Text/Pandoc/Writers/ConTeXt.hs8
-rw-r--r--src/Text/Pandoc/Writers/Docbook.hs42
-rw-r--r--src/Text/Pandoc/Writers/EPUB.hs68
-rw-r--r--src/Text/Pandoc/Writers/HTML.hs191
-rw-r--r--src/Text/Pandoc/Writers/LaTeX.hs187
-rw-r--r--src/Text/Pandoc/Writers/Markdown.hs14
-rw-r--r--src/Text/Pandoc/Writers/ODT.hs36
-rw-r--r--src/Text/Pandoc/Writers/OpenDocument.hs53
-rw-r--r--src/Text/Pandoc/Writers/RTF.hs31
-rw-r--r--src/Text/Pandoc/Writers/Texinfo.hs12
-rw-r--r--src/markdown2pdf.hs84
-rw-r--r--src/pandoc.hs66
-rw-r--r--src/test-pandoc.hs2
-rw-r--r--templates/default.context (renamed from templates/context.template)0
-rw-r--r--templates/default.docbook (renamed from templates/docbook.template)0
-rw-r--r--templates/default.html (renamed from templates/html.template)20
-rw-r--r--templates/default.latex (renamed from templates/latex.template)57
-rw-r--r--templates/default.man (renamed from templates/man.template)0
-rw-r--r--templates/default.markdown (renamed from templates/markdown.template)0
-rw-r--r--templates/default.mediawiki (renamed from templates/mediawiki.template)0
-rw-r--r--templates/default.opendocument (renamed from templates/opendocument.template)0
-rw-r--r--templates/default.org (renamed from templates/org.template)0
-rw-r--r--templates/default.plain (renamed from templates/plain.template)0
-rw-r--r--templates/default.rst (renamed from templates/rst.template)0
-rw-r--r--templates/default.rtf (renamed from templates/rtf.template)0
-rw-r--r--templates/default.s5 (renamed from templates/s5.template)10
-rw-r--r--templates/default.slidy (renamed from templates/slidy.template)32
-rw-r--r--templates/default.texinfo (renamed from templates/texinfo.template)0
-rw-r--r--templates/default.textile (renamed from templates/textile.template)0
-rw-r--r--tests/html-reader.html34
-rw-r--r--tests/html-reader.native37
-rw-r--r--tests/latex-reader.latex2
-rw-r--r--tests/lhs-test.html2
-rw-r--r--tests/lhs-test.html+lhs2
-rw-r--r--tests/lhs-test.latex32
-rw-r--r--tests/lhs-test.latex+lhs32
-rw-r--r--tests/lhs-test.nohl.html24
-rw-r--r--tests/lhs-test.nohl.html+lhs24
-rw-r--r--tests/rst-reader.native2
-rw-r--r--tests/s5.basic.html3
-rw-r--r--tests/s5.fancy.html7
-rw-r--r--tests/s5.inserts.html5
-rw-r--r--tests/tables.docbook758
-rw-r--r--tests/tables.latex255
-rw-r--r--tests/tables.opendocument15
-rw-r--r--tests/textile-reader.native1
-rw-r--r--tests/textile-reader.textile2
-rw-r--r--tests/writer.context8
-rw-r--r--tests/writer.docbook44
-rw-r--r--tests/writer.html15
-rw-r--r--tests/writer.latex54
-rw-r--r--tests/writer.opendocument125
80 files changed, 2949 insertions, 1254 deletions
diff --git a/MakeManPage.hs b/MakeManPage.hs
index 47b284380..06a31934c 100644
--- a/MakeManPage.hs
+++ b/MakeManPage.hs
@@ -28,7 +28,7 @@ main = do
modDeps <- modifiedDependencies markdown2pdfpage [markdown2pdfpage <.> "md"]
unless (null modDeps) $ do
mpdfContents <- liftM toString $ B.readFile $ markdown2pdfpage <.> "md"
- templ <- liftM toString $ B.readFile $ "templates" </> "man.template"
+ templ <- liftM toString $ B.readFile $ "templates" </> "default.man"
let doc = readMarkdown defaultParserState{ stateStandalone = True }
mpdfContents
writeManPage markdown2pdfpage templ doc
diff --git a/README b/README
index d14fd8938..ed7e6ad8f 100644
--- a/README
+++ b/README
@@ -1,6 +1,6 @@
% Pandoc User's Guide
% John MacFarlane
-% January 29, 2011
+% July 30, 2011
Synopsis
========
@@ -238,9 +238,11 @@ Options
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
@@ -265,9 +267,6 @@ Options
show in the output, so that the slide show will work even when no
internet connection is available.
-`--xetex`
-: Create LaTeX outut suitable for processing by XeTeX.
-
`--chapters`
: Treat top-level headers as chapters in LaTeX, ConTeXt, and DocBook
output.
@@ -327,13 +326,17 @@ Options
`--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 this option is not used, a default
- template appropriate for the output format will be used. See also
- `-D/--print-default-template`.
+ of template syntax. If no extension is specified, an extension
+ corresponding to the writer will be added, so that `--template=special`
+ looks for `special.html` for HTML output. If the template is not
+ found, pandoc will search for it in the user data directory
+ (see `--data-dir`). If this option is not used, a default
+ template appropriate for the output format will be used (see
+ `-D/--print-default-template`).
`-V` *KEY=VAL*, `--variable=`*KEY:VAL*
: Set the template variable *KEY* to the value *VAL* when rendering the
- document in standalone mode. This is only useful when the
+ document in standalone mode. This is generally only useful when the
`--template` option is used to specify a custom template, since
pandoc automatically sets the variables used in the default
templates.
@@ -379,6 +382,10 @@ Options
user data directory (see `--data-dir`, below). 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.
+
`--epub-metadata=`*FILE*
: Look in the specified XML file for metadata for the EPUB.
The file should contain a series of Dublin Core elements,
@@ -431,6 +438,12 @@ Options
user data directory (see `--data-dir`), or, if that is
not present, the Chicago author-date style.
+`--natbib`
+: Use natbib for citations in LaTeX output.
+
+`--biblatex`
+: Use biblatex for citations in LaTeX output.
+
`--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
@@ -491,7 +504,7 @@ document. To see the default template that is used, just type
where `FORMAT` is the name of the output format. A custom template
can be specified using the `--template` option. You can also override
the system default templates for a given output format `FORMAT`
-by putting a file `templates/FORMAT.template` in the user data
+by putting a file `templates/default.FORMAT` in the user data
directory (see `--data-dir`, above).
Templates may contain *variables*. Variable names are sequences of
@@ -530,6 +543,11 @@ depending on the output format, but include:
: date of document, as specified in title block
`lang`
: language code for HTML documents
+`slidy-url`
+: base URL for Slidy documents (defaults to
+ `http://www.w3.org/Talks/Tools/Slidy2`)
+`s5-url`
+: base URL for S5 documents (defaults to `ui/default`)
Variables may be set at the command line using the `-V/--variable`
option. This allows users to include custom variables in their
@@ -560,6 +578,13 @@ consecutive items:
$for(author)$$author$$sep$, $endfor$
+If you use custom templates, you may need to revise them as pandoc
+changes. We recommend tracking the changes in the default templates,
+and modifying your custom templates accordingly. An easy way to do this
+is to fork the pandoc-templates repository
+(<http://github.com/jgm/pandoc-templates>) and merge in changes after each
+pandoc release.
+
Pandoc's markdown
=================
@@ -1372,6 +1397,9 @@ correct output, converting straight quotes to curly quotes, `---` and `--`
to Em-dashes, and `...` to ellipses. Nonbreaking spaces are inserted after
certain abbreviations, such as "Mr."
+Note: if your LaTeX template uses the `csquotes` package, pandoc will
+detect automatically this and use `\enquote{...}` for quoted text.
+
Inline formatting
-----------------
@@ -1805,6 +1833,7 @@ 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.
Citations go inside square brackets and are separated by semicolons.
Each citation must have a key, composed of '@' + the citation
@@ -1883,7 +1912,9 @@ block. Each level-one header and horizontal rule begins a new slide.
The file produced by pandoc with the `-s/--standalone` option embeds a
link to javascripts and CSS files, which are assumed to be available at
the relative path `ui/default` (for S5) or at the Slidy website at
-`w3.org` (for Slidy). If the `--offline` option is specified, the
+`w3.org` (for Slidy). (These paths can be changed by setting the
+`slidy-url` or `s5-url` variables; see `--variable`, above.)
+If the `--offline` option is specified, the
scripts and CSS will be included directly in the generated file, so that
it may be used offline.
@@ -1963,7 +1994,8 @@ 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.
+Nathan Gass, Jonathan Daugherty, Jérémy Bobbio, Justin Bogner, qerub,
+Christopher Sawicki, Kelsey Hightower.
[markdown]: http://daringfireball.net/projects/markdown/
[reStructuredText]: http://docutils.sourceforge.net/docs/ref/rst/introduction.html
@@ -1981,7 +2013,7 @@ Nathan Gass, Jonathan Daugherty, Jérémy Bobbio, Justin Bogner.
[groff man]: http://developer.apple.com/DOCUMENTATION/Darwin/Reference/ManPages/man7/groff_man.7.html
[Haskell]: http://www.haskell.org/
[GNU Texinfo]: http://www.gnu.org/software/texinfo/
-[Emacs Org-Mode]: http://org-mode.org
+[Emacs Org-Mode]: http://orgmode.org
[EPUB]: http://www.idpf.org/
[GPL]: http://www.gnu.org/copyleft/gpl.html "GNU General Public License"
diff --git a/changelog b/changelog
index f8fb81887..0b66b8608 100644
--- a/changelog
+++ b/changelog
@@ -1,3 +1,228 @@
+pandoc (1.8.2)
+
+ * Added script to produce OS X package.
+
+ * Made `templates` directory a git submodule. This should make it
+ easier for people to revise their custom templates when the default
+ templates change.
+
+ * Changed template naming scheme: `FORMAT.template` -> `default.FORMAT`.
+ **Note:** If you have existing templates in `~/.pandoc/templates`, you
+ must rename them to conform to the new scheme!
+
+ * Fixed smart quotes bug, now handling `'...hi'` properly.
+
+ * RST reader:
+
+ + Partial support for labeled footnotes.
+ + Improved accuracy of `simpleReferenceName` parser.
+
+ * HTML reader:
+
+ + Substitute correct unicode characters for
+ characters in the 128..159 range, which are often found even in
+ HTML that purports to be UTF-8.
+
+ * LaTeX reader: Handle `\subtitle` command (a subtitle is added
+ to the title, after a colon and linebreak). Closes #280.
+
+ * Leaner `reference.odt`.
+
+ * Added unexported module `Text.Pandoc.MIME` for use in
+ the ODT writer.
+
+ * ODT writer: Construct `manifest.xml` based on archive contents.
+ This fixes a bug in ODTs containing images. Recent versions of
+ LibreOffice would reject these as corrupt, because `manifest.xml`
+ did not contain a reference to the image files.
+
+ * LaTeX writer:
+
+ + Make verbatim environments flush to avoid spurious
+ blank lines. Closes #277.
+ + Use `\texttt` and escapes insntead of `\verb!...!`, which
+ is too fragile (doesn't work in command arguments).
+ + Use `\enquote{}` for quotes if the template includes
+ the `csquotes` package. This provides better support for
+ local quoting styles. (Thanks to Andreas Wagner for the idea.)
+
+ * ConTeXt writer: Make `\starttyping`/`\stoptyping` flush with
+ margin, preventing spurious blank lines.
+
+ * Slidy writer:
+
+ + Use non-minimized version of `slidy.css` with `--offline`
+ option, so users can more easily edit it.
+ + Also fixed a bug in the CSS that prevented proper centering
+ of title (now reported and fixed upstream).
+
+ * S5 writer:
+
+ + Replaced `s5/default/slides.js.{comment,packed}` with
+ new compressed `s5/default/slides.min.js`.
+ + Use `data:` protocol to embed S5 CSS in `<link>` tags,
+ when `--offline` is specified. Using inline CSS didn't
+ work with Chrome or Safari. This fixes offline
+ S5 on those browsers.
+
+ * HTML writer: Removed English title on footnote backlinks.
+ This is incongrous in non-English documents.
+
+ * Docbook writer:
+
+ + Use CALS tables. (Some older docbook software does not work
+ well with XHTML tables.) Closes #77.
+ + Use `programlisting` tags (instead of `screen`) for code blocks.
+
+ * `markdown2pdf`:
+
+ + Calls latex with `-halt-on-error -interaction nonstopmode` instead
+ of `-interaction=batchmode`, which essentially just ignored errors,
+ leading to bad results. Better to know when something is wrong.
+ + Fixed issues with non-UTF-8 output of `pdflatex`.
+ + Better error reporting.
+
+ * `--mathjax` now takes an optional URL argument. If it is not
+ provided, pandoc links directly to the (secure) mathjax CDN,
+ as now recommended (thanks to dsanson).
+
+ * Deprecated `--xetex` option in `pandoc`. It is no longer needed,
+ since the LaTeX writer now produces a file that can be processed by
+ `latex`, `pdflatex`, `lualatex`, or `xelatex`.
+
+ * Introduced `--luatex` option to `markdown2pdf`. This causes `lualatex`
+ to be used to create the PDF.
+
+ * If a template specified with `--template` is not found, look for it
+ in `datadir`. Also, if no extension is provided, supply one based
+ on the writer. So now you can put your `special.latex` template in
+ `~/.pandoc/templates`, and use it from any directory via
+ `pandoc -t latex --template special`.
+
+ * Default template improvements:
+
+ + HTML: Display author and date after title.
+ + HTML: Made table of contents more customizable. The container
+ for the TOC is now in the template, so users can insert a header
+ or other styling. (Thanks to Bruce D'Arcus for the suggestion.)
+ + HTML, Slidy, S5: Enclose scripts in CDATA tags.
+ + Slidy, S5: Added `s5-url` and `slidy-url` variables, instead of
+ hard-coding. If you want to put your slidy files in the slidy
+ subdirectory, for example, you can do
+ `pandoc -t slidy -V slidy-url=slidy -s`.
+ + LaTeX: Use `\and` to separate authors in LaTeX documents (reader
+ & writer). Closes #279.
+ + LaTeX: Use different `hyperref` options for `xetex`, fixing
+ problems with unicode bookmarks (thanks to CircleCode).
+ + LaTeX: Removed `ucs` package, use `utf8` rather than `utf8x`
+ with `inputenc`. This covers fewer characters but is more
+ robust with other packages, and `ucs` is unmaintained. Users
+ who need better unicode support should use xelatex or lualatex.
+
+pandoc (1.8.1.2)
+
+ * Added `--epub-cover-image` option.
+
+ * Documented `--biblatex` and `--natbib` options.
+
+ * Allow `--section-divs` with slidy output. Resolves Issue #296.
+
+ * Disallow notes within notes in reST and markdown.
+ These previously caused infinite looping and stack overflows.
+ For example:
+
+ [^1]
+
+ [^1]: See [^1]
+
+ Note references are allowed in reST notes, so this isn't a full
+ implementation of reST. That can come later. For now we need to
+ prevent the stack overflows. Partially resolves Issue #297.
+
+ * EPUB writer: Allow non-plain math methods.
+
+ * Forbid ()s in citation item keys. Resolves Issue #304: problems with
+ `(@item1; @item2)` because the final paren was being parsed as part of
+ the item key.
+
+ * Changed URI parser so it doesn't include trailing punctuation.
+ So, in RST, `http://google.com.` should be parsed as a link followed by a
+ period. The parser is smart enough to recognize balanced parentheses, as
+ often occur in wikipedia links: `http://foo.bar/baz_(bam)`.
+
+ * Markdown+lhs reader: Require space after inverse bird tracks, so that
+ HTML tags can be used freely at the left margin of a markdown+lhs document.
+ Thanks to Conal Elliot for the suggestion.
+
+ * Markdown reader:
+
+ + Improved emph/strong parsing; fixes bug found by Perry Wagle.
+ + Fixed bug in footnote order (reported by CircleCode).
+
+ * RST reader:
+ + Fixed bug in in field lists with multi-line items at the
+ end of the list.
+ + Added parentheses to RST `specialChars`, so
+ `(http://google.com)` will be parsed as a link in parens.
+ Resolves Issue #291.
+ + Allow `|` followed by newline in RST line block.
+
+ * LaTeX reader:
+ + Support `\dots`.
+ + Gobble option & space after linebreak `\\[10pt]`.
+
+ * Textile reader:
+ + Make it possible to have colons after links. (qerub)
+ + Make it possible to have colons after links. (Christoffer Sawicki)
+
+ * HTML reader:
+ + Skip spaces after `<b>`, `<emph>`, etc.
+ + Handle tbody, thead in simple tables. Closes #274.
+ + Implicit `Para`s instead of `Plains` in some contexts.
+
+ * OpenDocument writer: Use special `First paragraph` style for
+ first paragraph after most non-paragraph blocks. This allows users to
+ specify e.g. that only paragraphs after the first paragraph of a block are
+ to be indented. Thanks to Andrea Rossato for the patch. Closes #20.
+
+ * LaTeX writer: use `deVerb` on table and picture captions.
+ Otherwise LaTeX complains about `\verb` inside command argument.
+ Thanks to bbanier for reporting the bug.
+
+ * Markdown writer: Insert HTML comment btw list and indented code block.
+ This prevents the code block from being interpreted as part of the list.
+
+ * EPUB writer: Add a meta element specify the cover.
+ Some EPUB e-readers, such as the Nook, require a meta element inside the
+ OPF metadata block to ensure the cover image is properly displayed.
+ (Kelsey Hightower)
+
+ * HTML writer: Use embed tag for images with non-image extensions.
+ (e.g. PDFs). Closes #264.
+
+ * LaTeX writer: Improved tables.
+
+ + More space between lines, top-align cells.
+ + Use ctable package, which allows footnotes and
+ provides additional options.
+ + Made cell alignments work in multiline tables.
+ + Closes #271, #272.
+
+ * Un-URI-escape image filenames in LaTeX, ConTeXt, RTF, Texinfo.
+ Also do this when copying image files into EPUBs and ODTs.
+ Closes #263.
+
+ * Changed to github issue tracker.
+
+ * Added failing emph/strong markdown test case due to Perry Wagle.
+
+ * Slidy improvements:
+ + Updated to use Slidy2.
+ + Fixed bug, unclosed div tag.
+ + Added `duration` variable in template.
+ Setting this activates the timer.
+ + Use 'titlepage' instead of 'cover' for title div.
+
pandoc (1.8.1.1)
* `markdown2pdf`: Removed some debugging lines accidentally included
@@ -291,6 +516,8 @@ pandoc (1.8)
to `Text.Pandoc.Readers.Parsing`, and parameterized it with
an inline parser.
+ * Added `nonspaceChar` to `Text.Pandoc.Parsing`.
+
* Ellipses are no longer allowed to contain spaces.
Previously we allowed '. . .', ' . . . ', etc. This caused
too many complications, and removed author's flexibility in
diff --git a/man/man1/markdown2pdf.1 b/man/man1/markdown2pdf.1
index 11c0e7ce7..20c566c8d 100644
--- a/man/man1/markdown2pdf.1
+++ b/man/man1/markdown2pdf.1
@@ -47,11 +47,6 @@ Use strict markdown syntax, with no extensions or variants.
.RS
.RE
.TP
-.B --xetex
-Use xelatex instead of pdflatex to create the PDF.
-.RS
-.RE
-.TP
.B -N, --number-sections
Number section headings in LaTeX output.
(Default is not to number them.)
@@ -158,6 +153,16 @@ A \f[C]reference.odt\f[], \f[C]epub.css\f[], \f[C]templates\f[]
directory, or \f[C]s5\f[] directory placed in this directory will
override pandoc\[aq]s normal defaults.
.RE
+.TP
+.B --xetex
+Use xelatex instead of pdflatex to create the PDF.
+.RS
+.RE
+.TP
+.B --luatex
+Use lualatex instead of pdflatex to create the PDF.
+.RS
+.RE
.SH SEE ALSO
.PP
\f[C]pandoc\f[](1), \f[C]pdflatex\f[](1)
diff --git a/man/man1/markdown2pdf.1.md b/man/man1/markdown2pdf.1.md
index efbdc8184..8b8da6880 100644
--- a/man/man1/markdown2pdf.1.md
+++ b/man/man1/markdown2pdf.1.md
@@ -42,9 +42,6 @@ packages are not included in your latex setup, they can be obtained from
\--strict
: Use strict markdown syntax, with no extensions or variants.
-\--xetex
-: Use xelatex instead of pdflatex to create the PDF.
-
-N, \--number-sections
: Number section headings in LaTeX output. (Default is not to number them.)
@@ -109,6 +106,12 @@ packages are not included in your latex setup, they can be obtained from
or `s5` directory placed in this directory will override pandoc's
normal defaults.
+\--xetex
+: Use xelatex instead of pdflatex to create the PDF.
+
+\--luatex
+: Use lualatex instead of pdflatex to create the PDF.
+
# SEE ALSO
`pandoc`(1), `pdflatex`(1)
diff --git a/man/man1/pandoc.1 b/man/man1/pandoc.1
index 0faf1cc00..702e684ed 100644
--- a/man/man1/pandoc.1
+++ b/man/man1/pandoc.1
@@ -1,4 +1,4 @@
-.TH PANDOC 1 "January 29, 2011" "Pandoc"
+.TH PANDOC 1 "July 30, 2011" "Pandoc"
.SH NAME
pandoc - general markup converter
.SH SYNOPSIS
@@ -263,9 +263,11 @@ the HTML template.
.RS
.RE
.TP
-.B \f[C]--mathjax=\f[]\f[I]URL\f[]
+.B \f[C]--mathjax\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
+inserted.
.RS
.RE
.TP
@@ -304,11 +306,6 @@ connection is available.
.RS
.RE
.TP
-.B \f[C]--xetex\f[]
-Create LaTeX outut suitable for processing by XeTeX.
-.RS
-.RE
-.TP
.B \f[C]--chapters\f[]
Treat top-level headers as chapters in LaTeX, ConTeXt, and DocBook
output.
@@ -397,18 +394,22 @@ Specify the base level for headers (defaults to 1).
Use \f[I]FILE\f[] as a custom template for the generated document.
Implies \f[C]--standalone\f[].
See Templates below for a description of template syntax.
+If no extension is specified, an extension corresponding to the writer
+will be added, so that \f[C]--template=special\f[] looks for
+\f[C]special.html\f[] for HTML output.
+If the template is not found, pandoc will search for it in the user data
+directory (see \f[C]--data-dir\f[]).
If this option is not used, a default template appropriate for the
-output format will be used.
-See also \f[C]-D/--print-default-template\f[].
+output format will be used (see \f[C]-D/--print-default-template\f[]).
.RS
.RE
.TP
.B \f[C]-V\f[] \f[I]KEY=VAL\f[], \f[C]--variable=\f[]\f[I]KEY: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 only useful when the \f[C]--template\f[] option is used to
-specify a custom template, since pandoc automatically sets the variables
-used in the default templates.
+This is generally only useful when the \f[C]--template\f[] option is
+used to specify a custom template, since pandoc automatically sets the
+variables used in the default templates.
.RS
.RE
.TP
@@ -475,6 +476,13 @@ If it is not found there, sensible defaults will be used.
.RS
.RE
.TP
+.B \f[C]--epub-cover-image=\f[]\f[I]FILE\f[]
+Use the specified image as the EPUB cover.
+It is recommended that the image be less than 1000px in width and
+height.
+.RS
+.RE
+.TP
.B \f[C]--epub-metadata=\f[]\f[I]FILE\f[]
Look in the specified XML file for metadata for the EPUB.
The file should contain a series of Dublin Core elements, as documented
@@ -551,6 +559,16 @@ style: either \f[C]default.csl\f[] in the user data directory (see
author-date style.
.RE
.TP
+.B \f[C]--natbib\f[]
+Use natbib for citations in LaTeX output.
+.RS
+.RE
+.TP
+.B \f[C]--biblatex\f[]
+Use biblatex for citations in LaTeX output.
+.RS
+.RE
+.TP
.B \f[C]--data-dir=\f[]\f[I]DIRECTORY\f[]
Specify the user data directory to search for pandoc data files.
If this option is not specified, the default user data directory will be
@@ -639,7 +657,7 @@ where \f[C]FORMAT\f[] is the name of the output format.
A custom template can be specified using the \f[C]--template\f[] option.
You can also override the system default templates for a given output
format \f[C]FORMAT\f[] by putting a file
-\f[C]templates/FORMAT.template\f[] in the user data directory (see
+\f[C]templates/default.FORMAT\f[] in the user data directory (see
\f[C]--data-dir\f[], above).
.PP
Templates may contain \f[I]variables\f[].
@@ -710,6 +728,17 @@ date of document, as specified in title block
language code for HTML documents
.RS
.RE
+.TP
+.B \f[C]slidy-url\f[]
+base URL for Slidy documents (defaults to
+\f[C]http://www.w3.org/Talks/Tools/Slidy2\f[])
+.RS
+.RE
+.TP
+.B \f[C]s5-url\f[]
+base URL for S5 documents (defaults to \f[C]ui/default\f[])
+.RS
+.RE
.PP
Variables may be set at the command line using the
\f[C]-V/--variable\f[] option.
@@ -753,6 +782,14 @@ items:
$for(author)$$author$$sep$,\ $endfor$
\f[]
.fi
+.PP
+If you use custom templates, you may need to revise them as pandoc
+changes.
+We recommend tracking the changes in the default templates, and
+modifying your custom templates accordingly.
+An easy way to do this is to fork the pandoc-templates repository
+(\f[C]http://github.com/jgm/pandoc-templates\f[]) and merge in changes
+after each pandoc release.
.SH PRODUCING HTML SLIDE SHOWS WITH PANDOC
.PP
You can use Pandoc to produce an HTML + javascript slide presentation
@@ -810,7 +847,9 @@ The file produced by pandoc with the \f[C]-s/--standalone\f[] option
embeds a link to javascripts and CSS files, which are assumed to be
available at the relative path \f[C]ui/default\f[] (for S5) or at the
Slidy website at \f[C]w3.org\f[] (for Slidy).
-If the \f[C]--offline\f[] option is specified, the scripts and CSS will
+(These paths can be changed by setting the \f[C]slidy-url\f[] or
+\f[C]s5-url\f[] variables; see \f[C]--variable\f[], above.)
+ If the \f[C]--offline\f[] option is specified, the scripts and CSS will
be included directly in the generated file, so that it may be used
offline.
.PP
@@ -904,7 +943,8 @@ This software carries no warranty of any kind.
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.
+Nathan Gass, Jonathan Daugherty, Jérémy Bobbio, Justin Bogner, qerub,
+Christopher Sawicki, Kelsey Hightower.
.SH PANDOC'S MARKDOWN
For a complete description of pandoc's extensions to standard markdown,
see \f[C]pandoc_markdown\f[] (5).
diff --git a/man/man5/pandoc_markdown.5 b/man/man5/pandoc_markdown.5
index 069f02183..418b532e3 100644
--- a/man/man5/pandoc_markdown.5
+++ b/man/man5/pandoc_markdown.5
@@ -1,5 +1,5 @@
.\"t
-.TH PANDOC_MARKDOWN 5 "January 29, 2011" "Pandoc"
+.TH PANDOC_MARKDOWN 5 "July 30, 2011" "Pandoc"
.SH NAME
pandoc_markdown - markdown syntax for pandoc(1)
.SH DESCRIPTION
@@ -1040,6 +1040,10 @@ quotes, \f[C]---\f[] and \f[C]--\f[] to Em-dashes, and \f[C]...\f[] to
ellipses.
Nonbreaking spaces are inserted after certain abbreviations, such as
"Mr."
+.PP
+Note: if your LaTeX template uses the \f[C]csquotes\f[] package, pandoc
+will detect automatically this and use \f[C]\\enquote{...}\f[] for
+quoted text.
.SH INLINE FORMATTING
.SS Emphasis
.PP
@@ -1629,6 +1633,7 @@ A primer on creating and modifying CSL styles can be found at
\f[C]http://citationstyles.org/downloads/primer.html\f[].
A repository of CSL styles can be found at
\f[C]https://github.com/citation-style-language/styles\f[].
+See also \f[C]http://zotero.org/styles\f[] for easy browsing.
.PP
Citations go inside square brackets and are separated by semicolons.
Each citation must have a key, composed of \[aq]\@\[aq] + the citation
diff --git a/pandoc.cabal b/pandoc.cabal
index 039596391..99f0916ec 100644
--- a/pandoc.cabal
+++ b/pandoc.cabal
@@ -1,5 +1,5 @@
Name: pandoc
-Version: 1.8.1.1
+Version: 1.8.2
Cabal-Version: >= 1.6
Build-Type: Custom
License: GPL
@@ -7,11 +7,11 @@ License-File: COPYING
Copyright: (c) 2006-2011 John MacFarlane
Author: John MacFarlane <jgm@berkeley.edu>
Maintainer: John MacFarlane <jgm@berkeley.edu>
-Bug-Reports: http://code.google.com/p/pandoc/issues/list
+Bug-Reports: https://github.com/jgm/pandoc/issues
Stability: alpha
Homepage: http://johnmacfarlane.net/pandoc
Category: Text
-Tested-With: GHC == 6.10.4, GHC == 6.12.1, GHC == 6.12.3, GHC == 7.0.1
+Tested-With: GHC == 6.12.3, GHC == 7.0.3
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
@@ -37,14 +37,14 @@ Description: Pandoc is a Haskell library for converting from one markup
only adding a reader or writer.
Data-Files:
-- templates
- templates/html.template, templates/docbook.template,
- templates/opendocument.template, templates/latex.template,
- templates/context.template, templates/texinfo.template,
- templates/man.template, templates/markdown.template,
- templates/rst.template, templates/plain.template,
- templates/mediawiki.template, templates/rtf.template,
- templates/s5.template, templates/slidy.template,
- templates/textile.template, templates/org.template
+ templates/default.html, templates/default.docbook,
+ templates/default.opendocument, templates/default.latex,
+ templates/default.context, templates/default.texinfo,
+ templates/default.man, templates/default.markdown,
+ templates/default.rst, templates/default.plain,
+ templates/default.mediawiki, templates/default.rtf,
+ templates/default.s5, templates/default.slidy,
+ templates/default.textile, templates/default.org
-- data for ODT writer
reference.odt,
-- stylesheet for EPUB writer
@@ -53,8 +53,7 @@ Data-Files:
data/LaTeXMathML.js,
data/MathMLinHTML.js,
-- data for S5 writer
- s5/default/slides.js.comment,
- s5/default/slides.js.packed,
+ s5/default/slides.min.js,
s5/default/s5-core.css,
s5/default/framing.css,
s5/default/pretty.css,
@@ -62,7 +61,7 @@ Data-Files:
s5/default/outline.css,
s5/default/print.css,
-- data for slidy writer
- slidy/slidy.min.css,
+ slidy/slidy.css,
slidy/slidy.min.js,
-- data for citeproc
default.csl,
@@ -208,10 +207,11 @@ Library
random >= 1 && < 1.1,
extensible-exceptions >= 0.1 && < 0.2,
citeproc-hs >= 0.3.1 && < 0.4,
- pandoc-types == 1.8.*,
+ pandoc-types == 1.8.0.2,
json >= 0.4 && < 0.5,
dlist >= 0.4 && < 0.6,
- tagsoup >= 0.12 && < 0.13
+ tagsoup >= 0.12 && < 0.13,
+ base64-bytestring >= 0.1 && < 0.2
if impl(ghc >= 6.10)
Build-depends: base >= 4 && < 5, syb >= 0.1 && < 0.4
else
@@ -262,6 +262,7 @@ Library
Text.Pandoc.Biblio
Other-Modules: Text.Pandoc.XML,
Text.Pandoc.UTF8,
+ Text.Pandoc.MIME,
Text.Pandoc.UUID,
Paths_pandoc
@@ -292,10 +293,11 @@ Executable pandoc
random >= 1 && < 1.1,
extensible-exceptions >= 0.1 && < 0.2,
citeproc-hs >= 0.3.1 && < 0.4,
- pandoc-types == 1.8.*,
+ pandoc-types == 1.8.0.2,
json >= 0.4 && < 0.5,
dlist >= 0.4 && < 0.6,
- tagsoup >= 0.12 && < 0.13
+ tagsoup >= 0.12 && < 0.13,
+ base64-bytestring >= 0.1 && < 0.2
if impl(ghc >= 6.10)
Build-depends: base >= 4 && < 5, syb >= 0.1 && < 0.4
else
@@ -366,3 +368,4 @@ Executable test-pandoc
Tests.Writers.Native
Tests.Writers.ConTeXt
Tests.Writers.HTML
+ Tests.Writers.Markdown
diff --git a/reference.odt b/reference.odt
index 64a74493b..6307119d3 100644
--- a/reference.odt
+++ b/reference.odt
Binary files differ
diff --git a/s5/default/slides.js.comment b/s5/default/slides.js.comment
deleted file mode 100644
index 489b276a2..000000000
--- a/s5/default/slides.js.comment
+++ /dev/null
@@ -1,4 +0,0 @@
-// S5 v1.1 slides.js -- released into the Public Domain
-//
-// Please see http://www.meyerweb.com/eric/tools/s5/credits.html for information
-// about all the wonderful and talented contributors to this code!
diff --git a/s5/default/slides.js.packed b/s5/default/slides.js.packed
deleted file mode 100644
index 47b95e53f..000000000
--- a/s5/default/slides.js.packed
+++ /dev/null
@@ -1,74 +0,0 @@
-var undef;var slideCSS='';var snum=0;var smax=1;var incpos=0;var number=undef;var s5mode=true;var defaultView='slideshow';var controlVis='visible';var isIE=navigator.appName=='Microsoft Internet Explorer'&&navigator.userAgent.indexOf('Opera')<1?1:0;var isOp=navigator.userAgent.indexOf('Opera')>-1?1:0;var isGe=navigator.userAgent.indexOf('Gecko')>-1&&navigator.userAgent.indexOf('Safari')<1?1:0;function hasClass(object,className){if(!object.className)return false;return(object.className.search('(^|\\s)'+className+'(\\s|$)')!=-1);}
-function hasValue(object,value){if(!object)return false;return(object.search('(^|\\s)'+value+'(\\s|$)')!=-1);}
-function removeClass(object,className){if(!object)return;object.className=object.className.replace(new RegExp('(^|\\s)'+className+'(\\s|$)'),RegExp.$1+RegExp.$2);}
-function addClass(object,className){if(!object||hasClass(object,className))return;if(object.className){object.className+=' '+className;}else{object.className=className;}}
-function GetElementsWithClassName(elementName,className){var allElements=document.getElementsByTagName(elementName);var elemColl=new Array();for(var i=0;i<allElements.length;i++){if(hasClass(allElements[i],className)){elemColl[elemColl.length]=allElements[i];}}
-return elemColl;}
-function isParentOrSelf(element,id){if(element==null||element.nodeName=='BODY')return false;else if(element.id==id)return true;else return isParentOrSelf(element.parentNode,id);}
-function nodeValue(node){var result="";if(node.nodeType==1){var children=node.childNodes;for(var i=0;i<children.length;++i){result+=nodeValue(children[i]);}}
-else if(node.nodeType==3){result=node.nodeValue;}
-return(result);}
-function slideLabel(){var slideColl=GetElementsWithClassName('*','slide');var list=document.getElementById('jumplist');smax=slideColl.length;for(var n=0;n<smax;n++){var obj=slideColl[n];var did='slide'+n.toString();obj.setAttribute('id',did);if(isOp)continue;var otext='';var menu=obj.firstChild;if(!menu)continue;while(menu&&menu.nodeType==3){menu=menu.nextSibling;}
-if(!menu)continue;var menunodes=menu.childNodes;for(var o=0;o<menunodes.length;o++){otext+=nodeValue(menunodes[o]);}
-list.options[list.length]=new Option(n+' : '+otext,n);}}
-function currentSlide(){var cs;if(document.getElementById){cs=document.getElementById('currentSlide');}else{cs=document.currentSlide;}
-cs.innerHTML='<span id="csHere">'+snum+'<\/span> '+'<span id="csSep">\/<\/span> '+'<span id="csTotal">'+(smax-1)+'<\/span>';if(snum==0){cs.style.visibility='hidden';}else{cs.style.visibility='visible';}}
-function go(step){if(document.getElementById('slideProj').disabled||step==0)return;var jl=document.getElementById('jumplist');var cid='slide'+snum;var ce=document.getElementById(cid);if(incrementals[snum].length>0){for(var i=0;i<incrementals[snum].length;i++){removeClass(incrementals[snum][i],'current');removeClass(incrementals[snum][i],'incremental');}}
-if(step!='j'){snum+=step;lmax=smax-1;if(snum>lmax)snum=lmax;if(snum<0)snum=0;}else
-snum=parseInt(jl.value);var nid='slide'+snum;var ne=document.getElementById(nid);if(!ne){ne=document.getElementById('slide0');snum=0;}
-if(step<0){incpos=incrementals[snum].length}else{incpos=0;}
-if(incrementals[snum].length>0&&incpos==0){for(var i=0;i<incrementals[snum].length;i++){if(hasClass(incrementals[snum][i],'current'))
-incpos=i+1;else
-addClass(incrementals[snum][i],'incremental');}}
-if(incrementals[snum].length>0&&incpos>0)
-addClass(incrementals[snum][incpos-1],'current');ce.style.visibility='hidden';ne.style.visibility='visible';jl.selectedIndex=snum;currentSlide();number=0;}
-function goTo(target){if(target>=smax||target==snum)return;go(target-snum);}
-function subgo(step){if(step>0){removeClass(incrementals[snum][incpos-1],'current');removeClass(incrementals[snum][incpos],'incremental');addClass(incrementals[snum][incpos],'current');incpos++;}else{incpos--;removeClass(incrementals[snum][incpos],'current');addClass(incrementals[snum][incpos],'incremental');addClass(incrementals[snum][incpos-1],'current');}}
-function toggle(){var slideColl=GetElementsWithClassName('*','slide');var slides=document.getElementById('slideProj');var outline=document.getElementById('outlineStyle');if(!slides.disabled){slides.disabled=true;outline.disabled=false;s5mode=false;fontSize('1em');for(var n=0;n<smax;n++){var slide=slideColl[n];slide.style.visibility='visible';}}else{slides.disabled=false;outline.disabled=true;s5mode=true;fontScale();for(var n=0;n<smax;n++){var slide=slideColl[n];slide.style.visibility='hidden';}
-slideColl[snum].style.visibility='visible';}}
-function showHide(action){var obj=GetElementsWithClassName('*','hideme')[0];switch(action){case's':obj.style.visibility='visible';break;case'h':obj.style.visibility='hidden';break;case'k':if(obj.style.visibility!='visible'){obj.style.visibility='visible';}else{obj.style.visibility='hidden';}
-break;}}
-function keys(key){if(!key){key=event;key.which=key.keyCode;}
-if(key.which==84){toggle();return;}
-if(s5mode){switch(key.which){case 10:case 13:if(window.event&&isParentOrSelf(window.event.srcElement,'controls'))return;if(key.target&&isParentOrSelf(key.target,'controls'))return;if(number!=undef){goTo(number);break;}
-case 32:case 34:case 39:case 40:if(number!=undef){go(number);}else if(!incrementals[snum]||incpos>=incrementals[snum].length){go(1);}else{subgo(1);}
-break;case 33:case 37:case 38:if(number!=undef){go(-1*number);}else if(!incrementals[snum]||incpos<=0){go(-1);}else{subgo(-1);}
-break;case 36:goTo(0);break;case 35:goTo(smax-1);break;case 67:showHide('k');break;}
-if(key.which<48||key.which>57){number=undef;}else{if(window.event&&isParentOrSelf(window.event.srcElement,'controls'))return;if(key.target&&isParentOrSelf(key.target,'controls'))return;number=(((number!=undef)?number:0)*10)+(key.which-48);}}
-return false;}
-function clicker(e){number=undef;var target;if(window.event){target=window.event.srcElement;e=window.event;}else target=e.target;if(target.getAttribute('href')!=null||hasValue(target.rel,'external')||isParentOrSelf(target,'controls')||isParentOrSelf(target,'embed')||isParentOrSelf(target,'object'))return true;if(!e.which||e.which==1){if(!incrementals[snum]||incpos>=incrementals[snum].length){go(1);}else{subgo(1);}}}
-function findSlide(hash){var target=null;var slides=GetElementsWithClassName('*','slide');for(var i=0;i<slides.length;i++){var targetSlide=slides[i];if((targetSlide.name&&targetSlide.name==hash)||(targetSlide.id&&targetSlide.id==hash)){target=targetSlide;break;}}
-while(target!=null&&target.nodeName!='BODY'){if(hasClass(target,'slide')){return parseInt(target.id.slice(5));}
-target=target.parentNode;}
-return null;}
-function slideJump(){if(window.location.hash==null)return;var sregex=/^#slide(\d+)$/;var matches=sregex.exec(window.location.hash);var dest=null;if(matches!=null){dest=parseInt(matches[1]);}else{dest=findSlide(window.location.hash.slice(1));}
-if(dest!=null)
-go(dest-snum);}
-function fixLinks(){var thisUri=window.location.href;thisUri=thisUri.slice(0,thisUri.length-window.location.hash.length);var aelements=document.getElementsByTagName('A');for(var i=0;i<aelements.length;i++){var a=aelements[i].href;var slideID=a.match('\#slide[0-9]{1,2}');if((slideID)&&(slideID[0].slice(0,1)=='#')){var dest=findSlide(slideID[0].slice(1));if(dest!=null){if(aelements[i].addEventListener){aelements[i].addEventListener("click",new Function("e","if (document.getElementById('slideProj').disabled) return;"+"go("+dest+" - snum); "+"if (e.preventDefault) e.preventDefault();"),true);}else if(aelements[i].attachEvent){aelements[i].attachEvent("onclick",new Function("","if (document.getElementById('slideProj').disabled) return;"+"go("+dest+" - snum); "+"event.returnValue = false;"));}}}}}
-function externalLinks(){if(!document.getElementsByTagName)return;var anchors=document.getElementsByTagName('a');for(var i=0;i<anchors.length;i++){var anchor=anchors[i];if(anchor.getAttribute('href')&&hasValue(anchor.rel,'external')){anchor.target='_blank';addClass(anchor,'external');}}}
-function createControls(){var controlsDiv=document.getElementById("controls");if(!controlsDiv)return;var hider=' onmouseover="showHide(\'s\');" onmouseout="showHide(\'h\');"';var hideDiv,hideList='';if(controlVis=='hidden'){hideDiv=hider;}else{hideList=hider;}
-controlsDiv.innerHTML='<form action="#" id="controlForm"'+hideDiv+'>'+'<div id="navLinks">'+'<a accesskey="t" id="toggle" href="javascript:toggle();">&#216;<\/a>'+'<a accesskey="z" id="prev" href="javascript:go(-1);">&laquo;<\/a>'+'<a accesskey="x" id="next" href="javascript:go(1);">&raquo;<\/a>'+'<div id="navList"'+hideList+'><select id="jumplist" onchange="go(\'j\');"><\/select><\/div>'+'<\/div><\/form>';if(controlVis=='hidden'){var hidden=document.getElementById('navLinks');}else{var hidden=document.getElementById('jumplist');}
-addClass(hidden,'hideme');}
-function fontScale(){if(!s5mode)return false;var vScale=22;var hScale=32;if(window.innerHeight){var vSize=window.innerHeight;var hSize=window.innerWidth;}else if(document.documentElement.clientHeight){var vSize=document.documentElement.clientHeight;var hSize=document.documentElement.clientWidth;}else if(document.body.clientHeight){var vSize=document.body.clientHeight;var hSize=document.body.clientWidth;}else{var vSize=700;var hSize=1024;}
-var newSize=Math.min(Math.round(vSize/vScale),Math.round(hSize/hScale));fontSize(newSize+'px');if(isGe){var obj=document.getElementsByTagName('body')[0];obj.style.display='none';obj.style.display='block';}}
-function fontSize(value){if(!(s5ss=document.getElementById('s5ss'))){if(!isIE){document.getElementsByTagName('head')[0].appendChild(s5ss=document.createElement('style'));s5ss.setAttribute('media','screen, projection');s5ss.setAttribute('id','s5ss');}else{document.createStyleSheet();document.s5ss=document.styleSheets[document.styleSheets.length-1];}}
-if(!isIE){while(s5ss.lastChild)s5ss.removeChild(s5ss.lastChild);s5ss.appendChild(document.createTextNode('body {font-size: '+value+' !important;}'));}else{document.s5ss.addRule('body','font-size: '+value+' !important;');}}
-function notOperaFix(){slideCSS=document.getElementById('slideProj').href;var slides=document.getElementById('slideProj');var outline=document.getElementById('outlineStyle');slides.setAttribute('media','screen');outline.disabled=true;if(isGe){slides.setAttribute('href','null');slides.setAttribute('href',slideCSS);}
-if(isIE&&document.styleSheets&&document.styleSheets[0]){document.styleSheets[0].addRule('img','behavior: url(ui/default/iepngfix.htc)');document.styleSheets[0].addRule('div','behavior: url(ui/default/iepngfix.htc)');document.styleSheets[0].addRule('.slide','behavior: url(ui/default/iepngfix.htc)');}}
-function getIncrementals(obj){var incrementals=new Array();if(!obj)
-return incrementals;var children=obj.childNodes;for(var i=0;i<children.length;i++){var child=children[i];if(hasClass(child,'incremental')){if(child.nodeName=='OL'||child.nodeName=='UL'){removeClass(child,'incremental');for(var j=0;j<child.childNodes.length;j++){if(child.childNodes[j].nodeType==1){addClass(child.childNodes[j],'incremental');}}}else{incrementals[incrementals.length]=child;removeClass(child,'incremental');}}
-if(hasClass(child,'show-first')){if(child.nodeName=='OL'||child.nodeName=='UL'){removeClass(child,'show-first');if(child.childNodes[isGe].nodeType==1){removeClass(child.childNodes[isGe],'incremental');}}else{incrementals[incrementals.length]=child;}}
-incrementals=incrementals.concat(getIncrementals(child));}
-return incrementals;}
-function createIncrementals(){var incrementals=new Array();for(var i=0;i<smax;i++){incrementals[i]=getIncrementals(document.getElementById('slide'+i));}
-return incrementals;}
-function defaultCheck(){var allMetas=document.getElementsByTagName('meta');for(var i=0;i<allMetas.length;i++){if(allMetas[i].name=='defaultView'){defaultView=allMetas[i].content;}
-if(allMetas[i].name=='controlVis'){controlVis=allMetas[i].content;}}}
-function trap(e){if(!e){e=event;e.which=e.keyCode;}
-try{modifierKey=e.ctrlKey||e.altKey||e.metaKey;}
-catch(e){modifierKey=false;}
-return modifierKey||e.which==0;}
-function startup(){defaultCheck();if(!isOp)
-createControls();slideLabel();fixLinks();externalLinks();fontScale();if(!isOp){notOperaFix();incrementals=createIncrementals();slideJump();if(defaultView=='outline'){toggle();}
-document.onkeyup=keys;document.onkeypress=trap;document.onclick=clicker;}}
-window.onload=startup;window.onresize=function(){setTimeout('fontScale()',50);}
diff --git a/s5/default/slides.min.js b/s5/default/slides.min.js
new file mode 100644
index 000000000..84bd3507f
--- /dev/null
+++ b/s5/default/slides.min.js
@@ -0,0 +1 @@
+var undef;var slideCSS="";var snum=0;var smax=1;var incpos=0;var number=undef;var s5mode=true;var defaultView="slideshow";var controlVis="visible";var isIE=navigator.appName=="Microsoft Internet Explorer"&&navigator.userAgent.indexOf("Opera")<1?1:0;var isOp=navigator.userAgent.indexOf("Opera")>-1?1:0;var isGe=navigator.userAgent.indexOf("Gecko")>-1&&navigator.userAgent.indexOf("Safari")<1?1:0;function hasClass(a,b){if(!a.className){return false}return(a.className.search("(^|\\s)"+b+"(\\s|$)")!=-1)}function hasValue(a,b){if(!a){return false}return(a.search("(^|\\s)"+b+"(\\s|$)")!=-1)}function removeClass(a,b){if(!a){return}a.className=a.className.replace(new RegExp("(^|\\s)"+b+"(\\s|$)"),RegExp.$1+RegExp.$2)}function addClass(a,b){if(!a||hasClass(a,b)){return}if(a.className){a.className+=" "+b}else{a.className=b}}function GetElementsWithClassName(a,c){var d=document.getElementsByTagName(a);var e=new Array();for(var b=0;b<d.length;b++){if(hasClass(d[b],c)){e[e.length]=d[b]}}return e}function isParentOrSelf(a,b){if(a==null||a.nodeName=="BODY"){return false}else{if(a.id==b){return true}else{return isParentOrSelf(a.parentNode,b)}}}function nodeValue(d){var a="";if(d.nodeType==1){var c=d.childNodes;for(var b=0;b<c.length;++b){a+=nodeValue(c[b])}}else{if(d.nodeType==3){a=d.nodeValue}}return(a)}function slideLabel(){var f=GetElementsWithClassName("*","slide");var g=document.getElementById("jumplist");smax=f.length;for(var c=0;c<smax;c++){var e=f[c];var i="slide"+c.toString();e.setAttribute("id",i);if(isOp){continue}var d="";var b=e.firstChild;if(!b){continue}while(b&&b.nodeType==3){b=b.nextSibling}if(!b){continue}var h=b.childNodes;for(var a=0;a<h.length;a++){d+=nodeValue(h[a])}g.options[g.length]=new Option(c+" : "+d,c)}}function currentSlide(){var a;if(document.getElementById){a=document.getElementById("currentSlide")}else{a=document.currentSlide}a.innerHTML='<span id="csHere">'+snum+'</span> <span id="csSep">/</span> <span id="csTotal">'+(smax-1)+"</span>";if(snum==0){a.style.visibility="hidden"}else{a.style.visibility="visible"}}function go(c){if(document.getElementById("slideProj").disabled||c==0){return}var b=document.getElementById("jumplist");var g="slide"+snum;var e=document.getElementById(g);if(incrementals[snum].length>0){for(var a=0;a<incrementals[snum].length;a++){removeClass(incrementals[snum][a],"current");removeClass(incrementals[snum][a],"incremental")}}if(c!="j"){snum+=c;lmax=smax-1;if(snum>lmax){snum=lmax}if(snum<0){snum=0}}else{snum=parseInt(b.value)}var f="slide"+snum;var d=document.getElementById(f);if(!d){d=document.getElementById("slide0");snum=0}if(c<0){incpos=incrementals[snum].length}else{incpos=0}if(incrementals[snum].length>0&&incpos==0){for(var a=0;a<incrementals[snum].length;a++){if(hasClass(incrementals[snum][a],"current")){incpos=a+1}else{addClass(incrementals[snum][a],"incremental")}}}if(incrementals[snum].length>0&&incpos>0){addClass(incrementals[snum][incpos-1],"current")}e.style.visibility="hidden";d.style.visibility="visible";b.selectedIndex=snum;currentSlide();number=0}function goTo(a){if(a>=smax||a==snum){return}go(a-snum)}function subgo(a){if(a>0){removeClass(incrementals[snum][incpos-1],"current");removeClass(incrementals[snum][incpos],"incremental");addClass(incrementals[snum][incpos],"current");incpos++}else{incpos--;removeClass(incrementals[snum][incpos],"current");addClass(incrementals[snum][incpos],"incremental");addClass(incrementals[snum][incpos-1],"current")}}function toggle(){var b=GetElementsWithClassName("*","slide");var d=document.getElementById("slideProj");var c=document.getElementById("outlineStyle");if(!d.disabled){d.disabled=true;c.disabled=false;s5mode=false;fontSize("1em");for(var e=0;e<smax;e++){var a=b[e];a.style.visibility="visible"}}else{d.disabled=false;c.disabled=true;s5mode=true;fontScale();for(var e=0;e<smax;e++){var a=b[e];a.style.visibility="hidden"}b[snum].style.visibility="visible"}}function showHide(a){var b=GetElementsWithClassName("*","hideme")[0];switch(a){case"s":b.style.visibility="visible";break;case"h":b.style.visibility="hidden";break;case"k":if(b.style.visibility!="visible"){b.style.visibility="visible"}else{b.style.visibility="hidden"}break}}function keys(a){if(!a){a=event;a.which=a.keyCode}if(a.which==84){toggle();return}if(s5mode){switch(a.which){case 10:case 13:if(window.event&&isParentOrSelf(window.event.srcElement,"controls")){return}if(a.target&&isParentOrSelf(a.target,"controls")){return}if(number!=undef){goTo(number);break}case 32:case 34:case 39:case 40:if(number!=undef){go(number)}else{if(!incrementals[snum]||incpos>=incrementals[snum].length){go(1)}else{subgo(1)}}break;case 33:case 37:case 38:if(number!=undef){go(-1*number)}else{if(!incrementals[snum]||incpos<=0){go(-1)}else{subgo(-1)}}break;case 36:goTo(0);break;case 35:goTo(smax-1);break;case 67:showHide("k");break}if(a.which<48||a.which>57){number=undef}else{if(window.event&&isParentOrSelf(window.event.srcElement,"controls")){return}if(a.target&&isParentOrSelf(a.target,"controls")){return}number=(((number!=undef)?number:0)*10)+(a.which-48)}}return false}function clicker(b){number=undef;var a;if(window.event){a=window.event.srcElement;b=window.event}else{a=b.target}if(a.getAttribute("href")!=null||hasValue(a.rel,"external")||isParentOrSelf(a,"controls")||isParentOrSelf(a,"embed")||isParentOrSelf(a,"object")){return true}if(!b.which||b.which==1){if(!incrementals[snum]||incpos>=incrementals[snum].length){go(1)}else{subgo(1)}}}function findSlide(d){var c=null;var b=GetElementsWithClassName("*","slide");for(var a=0;a<b.length;a++){var e=b[a];if((e.name&&e.name==d)||(e.id&&e.id==d)){c=e;break}}while(c!=null&&c.nodeName!="BODY"){if(hasClass(c,"slide")){return parseInt(c.id.slice(5))}c=c.parentNode}return null}function slideJump(){if(window.location.hash==null){return}var b=/^#slide(\d+)$/;var c=b.exec(window.location.hash);var a=null;if(c!=null){a=parseInt(c[1])}else{a=findSlide(window.location.hash.slice(1))}if(a!=null){go(a-snum)}}function fixLinks(){var f=window.location.href;f=f.slice(0,f.length-window.location.hash.length);var g=document.getElementsByTagName("A");for(var e=0;e<g.length;e++){var b=g[e].href;var d=b.match("#slide[0-9]{1,2}");if((d)&&(d[0].slice(0,1)=="#")){var c=findSlide(d[0].slice(1));if(c!=null){if(g[e].addEventListener){g[e].addEventListener("click",new Function("e","if (document.getElementById('slideProj').disabled) return;go("+c+" - snum); if (e.preventDefault) e.preventDefault();"),true)}else{if(g[e].attachEvent){g[e].attachEvent("onclick",new Function("","if (document.getElementById('slideProj').disabled) return;go("+c+" - snum); event.returnValue = false;"))}}}}}}function externalLinks(){if(!document.getElementsByTagName){return}var c=document.getElementsByTagName("a");for(var b=0;b<c.length;b++){var a=c[b];if(a.getAttribute("href")&&hasValue(a.rel,"external")){a.target="_blank";addClass(a,"external")}}}function createControls(){var e=document.getElementById("controls");if(!e){return}var c=" onmouseover=\"showHide('s');\" onmouseout=\"showHide('h');\"";var d,a="";if(controlVis=="hidden"){d=c}else{a=c}e.innerHTML='<form action="#" id="controlForm"'+d+'><div id="navLinks"><a accesskey="t" id="toggle" href="javascript:toggle();">&#216;</a><a accesskey="z" id="prev" href="javascript:go(-1);">&laquo;</a><a accesskey="x" id="next" href="javascript:go(1);">&raquo;</a><div id="navList"'+a+'><select id="jumplist" onchange="go(\'j\');"></select></div></div></form>';if(controlVis=="hidden"){var b=document.getElementById("navLinks")}else{var b=document.getElementById("jumplist")}addClass(b,"hideme")}function fontScale(){if(!s5mode){return false}var f=22;var a=32;if(window.innerHeight){var c=window.innerHeight;var e=window.innerWidth}else{if(document.documentElement.clientHeight){var c=document.documentElement.clientHeight;var e=document.documentElement.clientWidth}else{if(document.body.clientHeight){var c=document.body.clientHeight;var e=document.body.clientWidth}else{var c=700;var e=1024}}}var b=Math.min(Math.round(c/f),Math.round(e/a));fontSize(b+"px");if(isGe){var d=document.getElementsByTagName("body")[0];d.style.display="none";d.style.display="block"}}function fontSize(a){if(!(s5ss=document.getElementById("s5ss"))){if(!isIE){document.getElementsByTagName("head")[0].appendChild(s5ss=document.createElement("style"));s5ss.setAttribute("media","screen, projection");s5ss.setAttribute("id","s5ss")}else{document.createStyleSheet();document.s5ss=document.styleSheets[document.styleSheets.length-1]}}if(!isIE){while(s5ss.lastChild){s5ss.removeChild(s5ss.lastChild)}s5ss.appendChild(document.createTextNode("body {font-size: "+a+" !important;}"))}else{document.s5ss.addRule("body","font-size: "+a+" !important;")}}function notOperaFix(){slideCSS=document.getElementById("slideProj").href;var b=document.getElementById("slideProj");var a=document.getElementById("outlineStyle");b.setAttribute("media","screen");a.disabled=true;if(isGe){b.setAttribute("href","null");b.setAttribute("href",slideCSS)}if(isIE&&document.styleSheets&&document.styleSheets[0]){document.styleSheets[0].addRule("img","behavior: url(ui/default/iepngfix.htc)");document.styleSheets[0].addRule("div","behavior: url(ui/default/iepngfix.htc)");document.styleSheets[0].addRule(".slide","behavior: url(ui/default/iepngfix.htc)")}}function getIncrementals(e){var d=new Array();if(!e){return d}var c=e.childNodes;for(var b=0;b<c.length;b++){var f=c[b];if(hasClass(f,"incremental")){if(f.nodeName=="OL"||f.nodeName=="UL"){removeClass(f,"incremental");for(var a=0;a<f.childNodes.length;a++){if(f.childNodes[a].nodeType==1){addClass(f.childNodes[a],"incremental")}}}else{d[d.length]=f;removeClass(f,"incremental")}}if(hasClass(f,"show-first")){if(f.nodeName=="OL"||f.nodeName=="UL"){removeClass(f,"show-first");if(f.childNodes[isGe].nodeType==1){removeClass(f.childNodes[isGe],"incremental")}}else{d[d.length]=f}}d=d.concat(getIncrementals(f))}return d}function createIncrementals(){var b=new Array();for(var a=0;a<smax;a++){b[a]=getIncrementals(document.getElementById("slide"+a))}return b}function defaultCheck(){var a=document.getElementsByTagName("meta");for(var b=0;b<a.length;b++){if(a[b].name=="defaultView"){defaultView=a[b].content}if(a[b].name=="controlVis"){controlVis=a[b].content}}}function trap(a){if(!a){a=event;a.which=a.keyCode}try{modifierKey=a.ctrlKey||a.altKey||a.metaKey}catch(a){modifierKey=false}return modifierKey||a.which==0}function startup(){defaultCheck();if(!isOp){createControls()}slideLabel();fixLinks();externalLinks();fontScale();if(!isOp){notOperaFix();incrementals=createIncrementals();slideJump();if(defaultView=="outline"){toggle()}document.onkeyup=keys;document.onkeypress=trap;document.onclick=clicker}}window.onload=startup;window.onresize=function(){setTimeout("fontScale()",50)}; \ No newline at end of file
diff --git a/slidy/slidy.css b/slidy/slidy.css
new file mode 100644
index 000000000..96e3da76b
--- /dev/null
+++ b/slidy/slidy.css
@@ -0,0 +1,401 @@
+/* slidy.css
+
+ Copyright (c) 2005-2010 W3C (MIT, ERCIM, Keio), All Rights Reserved.
+ W3C liability, trademark, document use and software licensing
+ rules apply, see:
+
+ http://www.w3.org/Consortium/Legal/copyright-documents
+ http://www.w3.org/Consortium/Legal/copyright-software
+*/
+body
+{
+ margin: 0 0 0 0;
+ padding: 0 0 0 0;
+ width: 100%;
+ height: 100%;
+ color: black;
+ background-color: white;
+ font-family: "Gill Sans MT", "Gill Sans", GillSans, sans-serif;
+ font-size: 14pt;
+}
+
+div.toolbar {
+ position: fixed; z-index: 200;
+ top: auto; bottom: 0; left: 0; right: 0;
+ height: 1.2em; text-align: right;
+ padding-left: 1em;
+ padding-right: 1em;
+ font-size: 60%;
+ color: red;
+ background-color: rgb(240,240,240);
+ border-top: solid 1px rgb(180,180,180);
+}
+
+div.toolbar span.copyright {
+ color: black;
+ margin-left: 0.5em;
+}
+
+div.initial_prompt {
+ position: absolute;
+ z-index: 1000;
+ bottom: 1.2em;
+ width: 100%;
+ background-color: rgb(200,200,200);
+ opacity: 0.35;
+ background-color: rgb(200,200,200, 0.35);
+ cursor: pointer;
+}
+
+div.initial_prompt p.help {
+ text-align: center;
+}
+
+div.initial_prompt p.close {
+ text-align: right;
+ font-style: italic;
+}
+
+div.slidy_toc {
+ position: absolute;
+ z-index: 300;
+ width: 60%;
+ max-width: 30em;
+ height: 30em;
+ overflow: auto;
+ top: auto;
+ right: auto;
+ left: 4em;
+ bottom: 4em;
+ padding: 1em;
+ background: rgb(240,240,240);
+ border-style: solid;
+ border-width: 2px;
+ font-size: 60%;
+}
+
+div.slidy_toc .toc_heading {
+ text-align: center;
+ width: 100%;
+ margin: 0;
+ margin-bottom: 1em;
+ border-bottom-style: solid;
+ border-bottom-color: rgb(180,180,180);
+ border-bottom-width: 1px;
+}
+
+div.slide {
+ z-index: 20;
+ margin: 0 0 0 0;
+ padding-top: 0;
+ padding-bottom: 0;
+ padding-left: 20px;
+ padding-right: 20px;
+ border-width: 0;
+ clear: both;
+ top: 0;
+ bottom: 0;
+ left: 0;
+ right: 0;
+ line-height: 120%;
+ background-color: transparent;
+}
+
+div.background {
+ display: none;
+}
+
+div.handout {
+ margin-left: 20px;
+ margin-right: 20px;
+}
+
+div.slide.titlepage {
+ text-align: center;
+}
+
+div.slide.titlepage h1 {
+ padding-top: 10%;
+ margin-right: 0;
+}
+
+div.slide h1 {
+ padding-left: 0;
+ padding-right: 20pt;
+ padding-top: 4pt;
+ padding-bottom: 4pt;
+ margin-top: 0;
+ margin-left: 0;
+ margin-right: 60pt;
+ margin-bottom: 0.5em;
+ display: block;
+ font-size: 160%;
+ line-height: 1.2em;
+ background: transparent;
+}
+
+div.toc {
+ position: absolute;
+ top: auto;
+ bottom: 4em;
+ left: 4em;
+ right: auto;
+ width: 60%;
+ max-width: 30em;
+ height: 30em;
+ border: solid thin black;
+ padding: 1em;
+ background: rgb(240,240,240);
+ color: black;
+ z-index: 300;
+ overflow: auto;
+ display: block;
+ visibility: visible;
+}
+
+div.toc-heading {
+ width: 100%;
+ border-bottom: solid 1px rgb(180,180,180);
+ margin-bottom: 1em;
+ text-align: center;
+}
+
+pre {
+ font-size: 80%;
+ font-weight: bold;
+ line-height: 120%;
+ padding-top: 0.2em;
+ padding-bottom: 0.2em;
+ padding-left: 1em;
+ padding-right: 1em;
+ border-style: solid;
+ border-left-width: 1em;
+ border-top-width: thin;
+ border-right-width: thin;
+ border-bottom-width: thin;
+ border-color: #95ABD0;
+ color: #00428C;
+ background-color: #E4E5E7;
+}
+
+li pre { margin-left: 0; }
+
+blockquote { font-style: italic }
+
+img { background-color: transparent }
+
+p.copyright { font-size: smaller }
+
+.center { text-align: center }
+.footnote { font-size: smaller; margin-left: 2em; }
+
+a img { border-width: 0; border-style: none }
+
+a:visited { color: navy }
+a:link { color: navy }
+a:hover { color: red; text-decoration: underline }
+a:active { color: red; text-decoration: underline }
+
+a {text-decoration: none}
+.navbar a:link {color: white}
+.navbar a:visited {color: yellow}
+.navbar a:active {color: red}
+.navbar a:hover {color: red}
+
+ul { list-style-type: square; }
+ul ul { list-style-type: disc; }
+ul ul ul { list-style-type: circle; }
+ul ul ul ul { list-style-type: disc; }
+li { margin-left: 0.5em; margin-top: 0.5em; }
+li li { font-size: 85%; font-style: italic }
+li li li { font-size: 85%; font-style: normal }
+
+div dt
+{
+ margin-left: 0;
+ margin-top: 1em;
+ margin-bottom: 0.5em;
+ font-weight: bold;
+}
+div dd
+{
+ margin-left: 2em;
+ margin-bottom: 0.5em;
+}
+
+
+p,pre,ul,ol,blockquote,h2,h3,h4,h5,h6,dl,table {
+ margin-left: 1em;
+ margin-right: 1em;
+}
+
+p.subhead { font-weight: bold; margin-top: 2em; }
+
+.smaller { font-size: smaller }
+.bigger { font-size: 130% }
+
+td,th { padding: 0.2em }
+
+ul {
+ margin: 0.5em 1.5em 0.5em 1.5em;
+ padding: 0;
+}
+
+ol {
+ margin: 0.5em 1.5em 0.5em 1.5em;
+ padding: 0;
+}
+
+ul { list-style-type: square; }
+ul ul { list-style-type: disc; }
+ul ul ul { list-style-type: circle; }
+ul ul ul ul { list-style-type: disc; }
+
+ul li {
+ list-style: square;
+ margin: 0.1em 0em 0.6em 0;
+ padding: 0 0 0 0;
+ line-height: 140%;
+}
+
+ol li {
+ margin: 0.1em 0em 0.6em 1.5em;
+ padding: 0 0 0 0px;
+ line-height: 140%;
+ list-style-type: decimal;
+}
+
+li ul li {
+ font-size: 85%;
+ font-style: italic;
+ list-style-type: disc;
+ background: transparent;
+ padding: 0 0 0 0;
+}
+li li ul li {
+ font-size: 85%;
+ font-style: normal;
+ list-style-type: circle;
+ background: transparent;
+ padding: 0 0 0 0;
+}
+li li li ul li {
+ list-style-type: disc;
+ background: transparent;
+ padding: 0 0 0 0;
+}
+
+li ol li {
+ list-style-type: decimal;
+}
+
+
+li li ol li {
+ list-style-type: decimal;
+}
+
+/*
+ setting class="outline on ol or ul makes it behave as an
+ ouline list where blocklevel content in li elements is
+ hidden by default and can be expanded or collapsed with
+ mouse click. Set class="expand" on li to override default
+*/
+
+ol.outline li:hover { cursor: pointer }
+ol.outline li.nofold:hover { cursor: default }
+
+ul.outline li:hover { cursor: pointer }
+ul.outline li.nofold:hover { cursor: default }
+
+ol.outline { list-style:decimal; }
+ol.outline ol { list-style-type:lower-alpha }
+
+ol.outline li.nofold {
+ padding: 0 0 0 20px;
+ background: transparent url(../graphics/nofold-dim.gif) no-repeat 0px 0.5em;
+}
+ol.outline li.unfolded {
+ padding: 0 0 0 20px;
+ background: transparent url(../graphics/fold-dim.gif) no-repeat 0px 0.5em;
+}
+ol.outline li.folded {
+ padding: 0 0 0 20px;
+ background: transparent url(../graphics/unfold-dim.gif) no-repeat 0px 0.5em;
+}
+ol.outline li.unfolded:hover {
+ padding: 0 0 0 20px;
+ background: transparent url(../graphics/fold.gif) no-repeat 0px 0.5em;
+}
+ol.outline li.folded:hover {
+ padding: 0 0 0 20px;
+ background: transparent url(../graphics/unfold.gif) no-repeat 0px 0.5em;
+}
+
+ul.outline li.nofold {
+ padding: 0 0 0 20px;
+ background: transparent url(../graphics/nofold-dim.gif) no-repeat 0px 0.5em;
+}
+ul.outline li.unfolded {
+ padding: 0 0 0 20px;
+ background: transparent url(../graphics/fold-dim.gif) no-repeat 0px 0.5em;
+}
+ul.outline li.folded {
+ padding: 0 0 0 20px;
+ background: transparent url(../graphics/unfold-dim.gif) no-repeat 0px 0.5em;
+}
+ul.outline li.unfolded:hover {
+ padding: 0 0 0 20px;
+ background: transparent url(../graphics/fold.gif) no-repeat 0px 0.5em;
+}
+ul.outline li.folded:hover {
+ padding: 0 0 0 20px;
+ background: transparent url(../graphics/unfold.gif) no-repeat 0px 0.5em;
+}
+
+/* for slides with class "title" in table of contents */
+a.titleslide { font-weight: bold; font-style: italic }
+
+/*
+ hide images for work around for save as bug
+ where browsers fail to save images used by CSS
+*/
+img.hidden { display: none; visibility: hidden }
+div.initial_prompt { display: none; visibility: hidden }
+
+ div.slide {
+ visibility: visible;
+ position: inherit;
+ }
+ div.handout {
+ border-top-style: solid;
+ border-top-width: thin;
+ border-top-color: black;
+ }
+
+@media screen {
+ .hidden { display: none; visibility: visible }
+
+ div.slide.hidden { display: block; visibility: visible }
+ div.handout.hidden { display: block; visibility: visible }
+ div.background { display: none; visibility: hidden }
+ body.single_slide div.initial_prompt { display: block; visibility: visible }
+ body.single_slide div.background { display: block; visibility: visible }
+ body.single_slide div.background.hidden { display: none; visibility: hidden }
+ body.single_slide .invisible { visibility: hidden }
+ body.single_slide .hidden { display: none; visibility: hidden }
+ body.single_slide div.slide { position: absolute }
+ body.single_slide div.handout { display: none; visibility: hidden }
+}
+
+@media print {
+ .hidden { display: block; visibility: visible }
+
+ div.slide pre { font-size: 60%; padding-left: 0.5em; }
+ div.toolbar { display: none; visibility: hidden; }
+ div.slidy_toc { display: none; visibility: hidden; }
+ div.background { display: none; visibility: hidden; }
+ div.slide { page-break-before: always }
+ /* :first-child isn't reliable for print media */
+ div.slide.first-slide { page-break-before: avoid }
+}
+
diff --git a/slidy/slidy.min.css b/slidy/slidy.min.css
deleted file mode 100644
index 59e49495f..000000000
--- a/slidy/slidy.min.css
+++ /dev/null
@@ -1 +0,0 @@
-body{margin:0;padding:0;width:100%;height:100%;color:black;background-color:white;font-family:"Gill Sans MT","Gill Sans",GillSans,sans-serif;font-size:14pt;}.hidden{display:none;visibility:hidden;}div.toolbar{position:fixed;z-index:200;top:auto;bottom:0;left:0;right:0;height:1.2em;text-align:right;padding-left:1em;padding-right:1em;font-size:60%;color:red;background:#f0f0f0;}div.background{display:none;}div.handout{margin-left:20px;margin-right:20px;}div.slide.titlepage{text-align:center;}div.slide.titlepage.h1{padding-top:40%;}div.slide{z-index:20;margin:0;padding-top:0;padding-bottom:0;padding-left:20px;padding-right:20px;border-width:0;clear:both;top:0;bottom:0;left:0;right:0;line-height:120%;background-color:transparent;}div.slide+div[class].slide{page-break-before:always;}div.slide h1{padding-left:0;padding-right:20pt;padding-top:4pt;padding-bottom:4pt;margin-top:0;margin-left:0;margin-right:60pt;margin-bottom:.5em;display:block;font-size:160%;line-height:1.2em;background:transparent;}div.toc{position:absolute;top:auto;bottom:4em;left:4em;right:auto;width:60%;max-width:30em;height:30em;border:solid thin black;padding:1em;background:#f0f0f0;color:black;z-index:300;overflow:auto;display:block;visibility:visible;}div.toc-heading{width:100%;border-bottom:solid 1px #b4b4b4;margin-bottom:1em;text-align:center;}pre{font-size:80%;font-weight:bold;line-height:120%;padding-top:.2em;padding-bottom:.2em;padding-left:1em;padding-right:1em;border-style:solid;border-left-width:1em;border-top-width:thin;border-right-width:thin;border-bottom-width:thin;border-color:#95ABD0;color:#00428C;background-color:#E4E5E7;}li pre{margin-left:0;}@media print{div.slide{display:block;visibility:visible;position:relative;border-top-style:solid;border-top-width:thin;border-top-color:black;}div.slide pre{font-size:60%;padding-left:.5em;}div.handout{display:block;visibility:visible;}}blockquote{font-style:italic;}img{background-color:transparent;}p.copyright{font-size:smaller;}.center{text-align:center;}.footnote{font-size:smaller;margin-left:2em;}a img{border-width:0;border-style:none;}a:visited{color:navy;}a:link{color:navy;}a:hover{color:red;text-decoration:underline;}a:active{color:red;text-decoration:underline;}a{text-decoration:none;}.navbar a:link{color:white;}.navbar a:visited{color:yellow;}.navbar a:active{color:red;}.navbar a:hover{color:red;}ul{list-style-type:square;}ul ul{list-style-type:disc;}ul ul ul{list-style-type:circle;}ul ul ul ul{list-style-type:disc;}li{margin-left:.5em;margin-top:.5em;}li li{font-size:85%;font-style:italic;}li li li{font-size:85%;font-style:normal;}div dt{margin-left:0;margin-top:1em;margin-bottom:.5em;font-weight:bold;}div dd{margin-left:2em;margin-bottom:.5em;}p,pre,ul,ol,blockquote,h2,h3,h4,h5,h6,dl,table{margin-left:1em;margin-right:1em;}p.subhead{font-weight:bold;margin-top:2em;}.smaller{font-size:smaller;}.bigger{font-size:130%;}td,th{padding:.2em;}ul{margin:.5em 1.5em .5em 1.5em;padding:0;}ol{margin:.5em 1.5em .5em 1.5em;padding:0;}ul{list-style-type:square;}ul ul{list-style-type:disc;}ul ul ul{list-style-type:circle;}ul ul ul ul{list-style-type:disc;}ul li{list-style:square;margin:.1em 0 .6em 0;padding:0;line-height:140%;}ol li{margin:.1em 0 .6em 1.5em;padding:0;line-height:140%;list-style-type:decimal;}li ul li{font-size:85%;font-style:italic;list-style-type:disc;background:transparent;padding:0;}li li ul li{font-size:85%;font-style:normal;list-style-type:circle;background:transparent;padding:0;}li li li ul li{list-style-type:disc;background:transparent;padding:0;}li ol li{list-style-type:decimal;}li li ol li{list-style-type:decimal;}ol.outline li:hover{cursor:pointer;}ol.outline li.nofold:hover{cursor:default;}ul.outline li:hover{cursor:pointer;}ul.outline li.nofold:hover{cursor:default;}ol.outline{list-style:decimal;}ol.outline ol{list-style-type:lower-alpha;}ol.outline li.nofold{padding:0 0 0 20px;background:transparent url(nofold-dim.gif) no-repeat 0 .5em;}ol.outline li.unfolded{padding:0 0 0 20px;background:transparent url(fold-dim.gif) no-repeat 0 .5em;}ol.outline li.folded{padding:0 0 0 20px;background:transparent url(unfold-dim.gif) no-repeat 0 .5em;}ol.outline li.unfolded:hover{padding:0 0 0 20px;background:transparent url(fold.gif) no-repeat 0 .5em;}ol.outline li.folded:hover{padding:0 0 0 20px;background:transparent url(unfold.gif) no-repeat 0 .5em;}ul.outline li.nofold{padding:0 0 0 20px;background:transparent url(nofold-dim.gif) no-repeat 0 .5em;}ul.outline li.unfolded{padding:0 0 0 20px;background:transparent url(fold-dim.gif) no-repeat 0 .5em;}ul.outline li.folded{padding:0 0 0 20px;background:transparent url(unfold-dim.gif) no-repeat 0 .5em;}ul.outline li.unfolded:hover{padding:0 0 0 20px;background:transparent url(fold.gif) no-repeat 0 .5em;}ul.outline li.folded:hover{padding:0 0 0 20px;background:transparent url(unfold.gif) no-repeat 0 .5em;}a.titleslide{font-weight:bold;font-style:italic;} \ No newline at end of file
diff --git a/slidy/slidy.min.js b/slidy/slidy.min.js
index 990d7d50f..ef9ae454d 100644
--- a/slidy/slidy.min.js
+++ b/slidy/slidy.min.js
@@ -1 +1 @@
-var ns_pos=(typeof window.pageYOffset!="undefined");var khtml=((navigator.userAgent).indexOf("KHTML")>=0?true:false);var opera=((navigator.userAgent).indexOf("Opera")>=0?true:false);var ie=(typeof document.all!="undefined"&&!opera);var ie7=(!ns_pos&&navigator.userAgent.indexOf("MSIE 7")!=-1);var ie8=(!ns_pos&&navigator.userAgent.indexOf("MSIE 8")!=-1);var slidy_started=false;if(ie&&!ie8){document.write("<iframe id='historyFrame' src='javascript:\"<html></html>\"' height='1' width='1' style='position:absolute;left:-800px'></iframe>")}if(typeof beforePrint!="undefined"){window.onbeforeprint=beforePrint;window.onafterprint=afterPrint}if(ie){setTimeout(ieSlidyInit,100)}else{if(document.addEventListener){document.addEventListener("DOMContentLoaded",startup,false)}}function ieSlidyInit(){if(document.readyState=="complete"||document.readyState=="loaded"){startup()}else{setTimeout(ieSlidyInit,100)}}setTimeout(hideSlides,50);function hideSlides(){if(document.body){document.body.style.visibility="hidden"}else{setTimeout(hideSlides,50)}}var slidenum=0;var slides;var slideNumElement;var notes;var backgrounds;var toolbar;var title;var lastShown=null;var eos=null;var toc=null;var outline=null;var selectedTextLen;var viewAll=0;var wantToolbar=1;var mouseClickEnabled=true;var scrollhack=0;var key_wanted=false;var helpAnchor;var helpPage="http://www.w3.org/Talks/Tools/Slidy/help.html";var helpText="Navigate with mouse click, space bar, Cursor Left/Right, or Pg Up and Pg Dn. Use S and B to change font size.";var sizeIndex=0;var sizeAdjustment=0;var sizes=new Array("10pt","12pt","14pt","16pt","18pt","20pt","22pt","24pt","26pt","28pt","30pt","32pt");var okayForIncremental=incrementalElementList();var lastWidth=0;var lastHeight=0;var objects;var lang="en";var strings_es={slide:"pág.","help?":"Ayuda","contents?":"Índice","table of contents":"tabla de contenidos","Table of Contents":"Tabla de Contenidos","restart presentation":"Reiniciar presentación","restart?":"Inicio"};strings_es[helpText]="Utilice el ratón, barra espaciadora, teclas Izda/Dcha, o Re pág y Av pág. Use S y B para cambiar el tamaño de fuente.";var strings_ca={slide:"pàg..","help?":"Ajuda","contents?":"Índex","table of contents":"taula de continguts","Table of Contents":"Taula de Continguts","restart presentation":"Reiniciar presentació","restart?":"Inici"};strings_ca[helpText]="Utilitzi el ratolí, barra espaiadora, tecles Esq./Dta. o Re pàg y Av pàg. Usi S i B per canviar grandària de font.";var strings_nl={slide:"pagina","help?":"Help?","contents?":"Inhoud?","table of contents":"inhoudsopgave","Table of Contents":"Inhoudsopgave","restart presentation":"herstart presentatie","restart?":"Herstart?"};strings_nl[helpText]="Navigeer d.m.v. het muis, spatiebar, Links/Rechts toetsen, of PgUp en PgDn. Gebruik S en B om de karaktergrootte te veranderen.";var strings_de={slide:"Seite","help?":"Hilfe","contents?":"Übersicht","table of contents":"Inhaltsverzeichnis","Table of Contents":"Inhaltsverzeichnis","restart presentation":"Präsentation neu starten","restart?":"Neustart"};strings_de[helpText]="Benutzen Sie die Maus, Leerschlag, die Cursortasten links/rechts oder Page up/Page Down zum Wechseln der Seiten und S und B für die Schriftgrösse.";var strings_pl={slide:"slajd","help?":"pomoc?","contents?":"spis treści?","table of contents":"spis treści","Table of Contents":"Spis Treści","restart presentation":"Restartuj prezentację","restart?":"restart?"};strings_pl[helpText]="Zmieniaj slajdy klikając myszą, naciskając spację, strzałki lewo/prawolub PgUp / PgDn. Użyj klawiszy S i B, aby zmienić rozmiar czczionki.";var strings_fr={slide:"page","help?":"Aide","contents?":"Index","table of contents":"table des matières","Table of Contents":"Table des matières","restart presentation":"Recommencer l'exposé","restart?":"Début"};strings_fr[helpText]="Naviguez avec la souris, la barre d'espace, les flèches gauche/droite ou les touches Pg Up, Pg Dn. Utilisez les touches S et B pour modifier la taille de la police.";var strings_hu={slide:"oldal","help?":"segítség","contents?":"tartalom","table of contents":"tartalomjegyzék","Table of Contents":"Tartalomjegyzék","restart presentation":"bemutató újraindítása","restart?":"újraindítás"};strings_hu[helpText]="Az oldalak közti lépkedéshez kattintson az egérrel, vagy használja a szóköz, a bal, vagy a jobb nyíl, illetve a Page Down, Page Up billentyűket. Az S és a B billentyűkkel változtathatja a szöveg méretét.";var strings_it={slide:"pag.","help?":"Aiuto","contents?":"Indice","table of contents":"indice","Table of Contents":"Indice","restart presentation":"Ricominciare la presentazione","restart?":"Inizio"};strings_it[helpText]="Navigare con mouse, barra spazio, frecce sinistra/destra o PgUp e PgDn. Usare S e B per cambiare la dimensione dei caratteri.";var strings_el={slide:"σελίδα","help?":"βοήθεια;","contents?":"περιεχόμενα;","table of contents":"πίνακας περιεχομένων","Table of Contents":"Πίνακας Περιεχομένων","restart presentation":"επανεκκίνηση παρουσίασης","restart?":"επανεκκίνηση;"};strings_el[helpText]="Πλοηγηθείτε με το κλίκ του ποντικιού, το space, τα βέλη αριστερά/δεξιά, ή Page Up και Page Down. Χρησιμοποιήστε τα πλήκτρα S και B για να αλλάξετε το μέγεθος της γραμματοσειράς.";var strings_ja={slide:"スライド","help?":"ヘルプ","contents?":"目次","table of contents":"目次を表示","Table of Contents":"目次","restart presentation":"最初から再生","restart?":"最初から"};strings_ja[helpText]="マウス左クリック ・ スペース ・ 左右キー または Page Up ・ Page Downで操作, S ・ Bでフォントサイズ変更";var strings_zh={slide:"幻灯片","help?":"帮助?","contents?":"内容?","table of contents":"目录","Table of Contents":"目录","restart presentation":"重新启动展示","restart?":"重新启动?"};strings_zh[helpText]="用鼠标点击, 空格条, 左右箭头, Pg Up 和 Pg Dn 导航. 用 S, B 改变字体大小.";var strings_ru={slide:"слайд","help?":"помощь?","contents?":"содержание?","table of contents":"оглавление","Table of Contents":"Оглавление","restart presentation":"перезапустить презентацию","restart?":"перезапуск?"};strings_ru[helpText]="Перемещайтесь кликая мышкой, используя клавишу пробел, стрелкивлево/вправо или Pg Up и Pg Dn. Клавиши S и B меняют размер шрифта.";var strings_sv={slide:"sida","help?":"hjälp","contents?":"innehåll","table of contents":"innehållsförteckning","Table of Contents":"Innehållsförteckning","restart presentation":"visa presentationen från början","restart?":"börja om"};strings_sv[helpText]="Bläddra med ett klick med vänstra musknappen, mellanslagstangenten, vänster- och högerpiltangenterna eller tangenterna Pg Up, Pg Dn. Använd tangenterna S och B för att ändra textens storlek.";var localize={es:strings_es,ca:strings_ca,nl:strings_nl,de:strings_de,pl:strings_pl,fr:strings_fr,hu:strings_hu,it:strings_it,el:strings_el,jp:strings_ja,zh:strings_zh,ru:strings_ru,sv:strings_sv};function startup(){if(slidy_started){alert("already started");return}slidy_started=true;lang=document.body.parentNode.getAttribute("lang");if(!lang){lang=document.body.parentNode.getAttribute("xml:lang")}if(!lang){lang="en"}document.body.style.visibility="visible";title=document.title;toolbar=addToolbar();wrapImplicitSlides();slides=collectSlides();notes=collectNotes();objects=document.body.getElementsByTagName("object");backgrounds=collectBackgrounds();patchAnchors();slidenum=findSlideNumber(location.href);window.offscreenbuffering=true;sizeAdjustment=findSizeAdjust();hideImageToolbar();initOutliner();if(slides.length>0){var slide=slides[slidenum];slide.style.position="absolute";if(slidenum>0){setVisibilityAllIncremental("visible");lastShown=previousIncrementalItem(null);setEosStatus(true)}else{lastShown=null;setVisibilityAllIncremental("hidden");setEosStatus(!nextIncrementalItem(lastShown))}setLocation()}toc=tableOfContents();hideTableOfContents();document.onclick=mouseButtonClick;document.onmouseup=mouseButtonUp;document.onkeydown=keyDown;if(opera){document.onkeypress=keyPress}window.onresize=resized;window.onscroll=scrolled;window.onunload=unloaded;singleSlideView();setLocation();resized();if(ie7){setTimeout("ieHack()",100)}showToolbar();setInterval("checkLocation()",200)}String.prototype.localize=function(){if(this==""){return this}var s,lookup=localize[lang];if(lookup){s=lookup[this];if(s){return s}}var lg=lang.split("-");if(lg.length>1){lookup=localize[lg[0]];if(lookup){s=lookup[this];if(s){return s}}}return this};function hideImageToolbar(){if(!ns_pos){var images=document.getElementsByTagName("IMG");for(var i=0;i<images.length;++i){images[i].setAttribute("galleryimg","no")}}}function ieHack(){window.resizeBy(0,-1);window.resizeBy(0,1)}function unloaded(e){}function reload(e){if(!e){var e=window.event}hideBackgrounds();setTimeout("document.reload();",100);stopPropagation(e);e.cancel=true;e.returnValue=false;return false}function isKHTML(){var agent=navigator.userAgent;return(agent.indexOf("KHTML")>=0?true:false)}function resized(){var width=0;if(typeof(window.innerWidth)=="number"){width=window.innerWidth}else{if(document.documentElement&&document.documentElement.clientWidth){width=document.documentElement.clientWidth}else{if(document.body&&document.body.clientWidth){width=document.body.clientWidth}}}var height=0;if(typeof(window.innerHeight)=="number"){height=window.innerHeight}else{if(document.documentElement&&document.documentElement.clientHeight){height=document.documentElement.clientHeight}else{if(document.body&&document.body.clientHeight){height=document.body.clientHeight}}}if(height&&(width/height>1.05*1024/768)){width=height*1024/768}if(width!=lastWidth||height!=lastHeight){if(width>=1100){sizeIndex=5}else{if(width>=1000){sizeIndex=4}else{if(width>=800){sizeIndex=3}else{if(width>=600){sizeIndex=2}else{if(width){sizeIndex=0}}}}}if(0<=sizeIndex+sizeAdjustment&&sizeIndex+sizeAdjustment<sizes.length){sizeIndex=sizeIndex+sizeAdjustment}adjustObjectDimensions(width,height);document.body.style.fontSize=sizes[sizeIndex];lastWidth=width;lastHeight=height;var slide=slides[slidenum];hideSlide(slide);showSlide(slide);refreshToolbar(200)}}function scrolled(){if(toolbar&&!ns_pos&&!ie7){hackoffset=scrollXOffset();toolbar.style.display="none";if(scrollhack==0&&!viewAll){setTimeout(showToolbar,1000);scrollhack=1}}}function refreshToolbar(interval){if(!ns_pos&&!ie7){hideToolbar();setTimeout(showToolbar,interval)}}function showToolbar(){if(wantToolbar){if(!ns_pos){var xoffset=scrollXOffset();toolbar.style.left=xoffset;toolbar.style.right=xoffset;toolbar.style.bottom=0}toolbar.style.display="block";toolbar.style.visibility="visible"}scrollhack=0;try{if(!opera){helpAnchor.focus()}}catch(e){}}function hideToolbar(){toolbar.style.display="none";toolbar.style.visibility="hidden";window.focus()}function toggleToolbar(){if(!viewAll){if(toolbar.style.display=="none"){toolbar.style.display="block";toolbar.style.visibility="visible";wantToolbar=1}else{toolbar.style.display="none";toolbar.style.visibility="hidden";wantToolbar=0}}}function scrollXOffset(){if(window.pageXOffset){return self.pageXOffset}if(document.documentElement&&document.documentElement.scrollLeft){return document.documentElement.scrollLeft}if(document.body){return document.body.scrollLeft}return 0}function scrollYOffset(){if(window.pageYOffset){return self.pageYOffset}if(document.documentElement&&document.documentElement.scrollTop){return document.documentElement.scrollTop}if(document.body){return document.body.scrollTop}return 0}function optimizeFontSize(){var slide=slides[slidenum];var dh=slide.scrollHeight;var wh=getWindowHeight();var u=100*dh/wh;alert("window utilization = "+u+"% (doc "+dh+" win "+wh+")")}function getDocHeight(doc){if(!doc){doc=document}if(doc&&doc.body&&doc.body.offsetHeight){return doc.body.offsetHeight}if(doc&&doc.body&&doc.body.scrollHeight){return doc.body.scrollHeight}alert("couldn't determine document height")}function getWindowHeight(){if(typeof(window.innerHeight)=="number"){return window.innerHeight}if(document.documentElement&&document.documentElement.clientHeight){return document.documentElement.clientHeight}if(document.body&&document.body.clientHeight){return document.body.clientHeight}}function documentHeight(){var sh,oh;sh=document.body.scrollHeight;oh=document.body.offsetHeight;if(sh&&oh){return(sh>oh?sh:oh)}return 0}function smaller(){if(sizeIndex>0){--sizeIndex}toolbar.style.display="none";document.body.style.fontSize=sizes[sizeIndex];var slide=slides[slidenum];hideSlide(slide);showSlide(slide);setTimeout(showToolbar,300)}function bigger(){if(sizeIndex<sizes.length-1){++sizeIndex}toolbar.style.display="none";document.body.style.fontSize=sizes[sizeIndex];var slide=slides[slidenum];hideSlide(slide);showSlide(slide);setTimeout(showToolbar,300)}function adjustObjectDimensions(width,height){for(var i=0;i<objects.length;i++){var obj=objects[i];var mimeType=obj.getAttribute("type");if(mimeType=="image/svg+xml"||mimeType=="application/x-shockwave-flash"){if(!obj.initialWidth){obj.initialWidth=obj.getAttribute("width")}if(!obj.initialHeight){obj.initialHeight=obj.getAttribute("height")}if(obj.initialWidth&&obj.initialWidth.charAt(obj.initialWidth.length-1)=="%"){var w=parseInt(obj.initialWidth.slice(0,obj.initialWidth.length-1));var newW=width*(w/100);obj.setAttribute("width",newW)}if(obj.initialHeight&&obj.initialHeight.charAt(obj.initialHeight.length-1)=="%"){var h=parseInt(obj.initialHeight.slice(0,obj.initialHeight.length-1));var newH=height*(h/100);obj.setAttribute("height",newH)}}}}function cancel(event){if(event){event.cancel=true;event.returnValue=false;if(event.preventDefault){event.preventDefault()}}return false}function keyDown(event){var key;if(!event){var event=window.event}key_wanted=false;if(window.event){key=window.event.keyCode}else{if(event.which){key=event.which}else{return true}}if(!key){return true}if(event.ctrlKey||event.altKey||event.metaKey){return true}if(isShownToc()&&key!=9&&key!=16&&key!=38&&key!=40){hideTableOfContents();if(key==27||key==84||key==67){return cancel(event)}}key_wanted=true;if(key==34){if(viewAll){return true}nextSlide(false);return cancel(event)}else{if(key==33){if(viewAll){return true}previousSlide(false);return cancel(event)}else{if(key==32){nextSlide(true);return cancel(event)}else{if(key==37){previousSlide(!event.shiftKey);return cancel(event)}else{if(key==36){firstSlide();return cancel(event)}else{if(key==35){lastSlide();return cancel(event)}else{if(key==39){nextSlide(!event.shiftKey);return cancel(event)}else{if(key==13){if(outline){if(outline.visible){fold(outline)}else{unfold(outline)}return cancel(event)}}else{if(key==188){smaller();return cancel(event)}else{if(key==190){bigger();return cancel(event)}else{if(key==189||key==109){smaller();return cancel(event)}else{if(key==187||key==191||key==107){bigger();return cancel(event)}else{if(key==83){smaller();return cancel(event)}else{if(key==66){bigger();return cancel(event)}else{if(key==90){lastSlide();return cancel(event)}else{if(key==70){toggleToolbar();return cancel(event)}else{if(key==65){toggleView();return cancel(event)}else{if(key==75){mouseClickEnabled=!mouseClickEnabled;alert((mouseClickEnabled?"enabled":"disabled")+" mouse click advance");return cancel(event)}else{if(key==84||key==67){if(toc){showTableOfContents()}return cancel(event)}else{if(key==72){window.location=helpPage;return cancel(event)}}}}}}}}}}}}}}}}}}}}key_wanted=false;return true}function keyPress(event){if(!event){event=window.event}return key_wanted?cancel(event):true}function mouseButtonUp(e){selectedTextLen=getSelectedText().length}function mouseButtonClick(e){var rightclick=false;var leftclick=false;var middleclick=false;var target;if(!e){var e=window.event}if(e.target){target=e.target}else{if(e.srcElement){target=e.srcElement}}if(target.nodeType==3){target=target.parentNode}if(e.which){leftclick=(e.which==1);middleclick=(e.which==2);rightclick=(e.which==3)}else{if(e.button){if(e.button==4){middleclick=true}rightclick=(e.button==2)}else{leftclick=true}}if(selectedTextLen>0){stopPropagation(e);e.cancel=true;e.returnValue=false;return false}hideTableOfContents();if(mouseClickEnabled&&leftclick&&target.nodeName!="EMBED"&&target.nodeName!="OBJECT"&&target.nodeName!="VIDEO"&&target.nodeName!="INPUT"&&target.nodeName!="TEXTAREA"&&target.nodeName!="SELECT"&&target.nodeName!="OPTION"){nextSlide(true);stopPropagation(e);e.cancel=true;e.returnValue=false}}function previousSlide(incremental){if(!viewAll){var slide;if((incremental||slidenum==0)&&lastShown!=null){lastShown=hidePreviousItem(lastShown);setEosStatus(false)}else{if(slidenum>0){slide=slides[slidenum];hideSlide(slide);slidenum=slidenum-1;slide=slides[slidenum];setVisibilityAllIncremental("visible");lastShown=previousIncrementalItem(null);setEosStatus(true);showSlide(slide)}}setLocation();if(!ns_pos){refreshToolbar(200)}}}function nextSlide(incremental){if(!viewAll){var slide,last=lastShown;if(incremental||slidenum==slides.length-1){lastShown=revealNextItem(lastShown)}if((!incremental||lastShown==null)&&slidenum<slides.length-1){slide=slides[slidenum];hideSlide(slide);slidenum=slidenum+1;slide=slides[slidenum];lastShown=null;setVisibilityAllIncremental("hidden");showSlide(slide)}else{if(!lastShown){if(last&&incremental){lastShown=last}}}setLocation();setEosStatus(!nextIncrementalItem(lastShown));if(!ns_pos){refreshToolbar(200)}}}function firstSlide(){if(!viewAll){var slide;if(slidenum!=0){slide=slides[slidenum];hideSlide(slide);slidenum=0;slide=slides[slidenum];lastShown=null;setVisibilityAllIncremental("hidden");showSlide(slide)}setEosStatus(!nextIncrementalItem(lastShown));setLocation()}}function lastSlide(){if(!viewAll){var slide;lastShown=null;if(lastShown==null&&slidenum<slides.length-1){slide=slides[slidenum];hideSlide(slide);slidenum=slides.length-1;slide=slides[slidenum];setVisibilityAllIncremental("visible");lastShown=previousIncrementalItem(null);showSlide(slide)}else{setVisibilityAllIncremental("visible");lastShown=previousIncrementalItem(null)}setEosStatus(true);setLocation()}}function gotoSlide(num){var slide=slides[slidenum];hideSlide(slide);slidenum=num;slide=slides[slidenum];lastShown=null;setVisibilityAllIncremental("hidden");setEosStatus(!nextIncrementalItem(lastShown));document.title=title+" ("+(slidenum+1)+")";showSlide(slide);showSlideNumber()}function setEosStatus(state){if(eos){eos.style.color=(state?"rgb(240,240,240)":"red")}}function showSlide(slide){syncBackground(slide);window.scrollTo(0,0);slide.style.visibility="visible";slide.style.display="block"}function hideSlide(slide){slide.style.visibility="hidden";slide.style.display="none"}function beforePrint(){showAllSlides();hideToolbar()}function afterPrint(){if(!viewAll){singleSlideView();showToolbar()}}function printSlides(){beforePrint();window.print();afterPrint()}function toggleView(){if(viewAll){singleSlideView();showToolbar();viewAll=0}else{showAllSlides();hideToolbar();viewAll=1}}function showAllSlides(){var slide;for(var i=0;i<slides.length;++i){slide=slides[i];slide.style.position="relative";slide.style.borderTopStyle="solid";slide.style.borderTopWidth="thin";slide.style.borderTopColor="black";try{if(i==0){slide.style.pageBreakBefore="avoid"}else{slide.style.pageBreakBefore="always"}}catch(e){}setVisibilityAllIncremental("visible");showSlide(slide)}var note;for(var i=0;i<notes.length;++i){showSlide(notes[i])}hideBackgrounds()}function singleSlideView(){var slide;for(var i=0;i<slides.length;++i){slide=slides[i];slide.style.position="absolute";if(i==slidenum){slide.style.borderStyle="none";showSlide(slide)}else{slide.style.borderStyle="none";hideSlide(slide)}}setVisibilityAllIncremental("visible");lastShown=previousIncrementalItem(null);var note;for(var i=0;i<notes.length;++i){hideSlide(notes[i])}}function hasToken(str,token){if(str){var pattern=/\w+/g;var result=str.match(pattern);for(var i=0;i<result.length;i++){if(result[i]==token){return true}}}return false}function getClassList(element){if(typeof element.className!="undefined"){return element.className}var clsname=(ns_pos||ie8)?"class":"className";return element.getAttribute(clsname)}function hasClass(element,name){var regexp=new RegExp("(^| )"+name+"W*");if(typeof element.className!="undefined"){return regexp.test(element.className)}var clsname=(ns_pos||ie8)?"class":"className";return regexp.test(element.getAttribute(clsname))}function removeClass(element,name){var regexp=new RegExp("(^| )"+name+"W*");var clsval="";if(typeof element.className!="undefined"){clsval=element.className;if(clsval){clsval=clsval.replace(regexp,"");element.className=clsval}}else{var clsname=(ns_pos||ie8)?"class":"className";clsval=element.getAttribute(clsname);if(clsval){clsval=clsval.replace(regexp,"");element.setAttribute(clsname,clsval)}}}function addClass(element,name){if(!hasClass(element,name)){if(typeof element.className!="undefined"){element.className+=" "+name}else{var clsname=(ns_pos||ie8)?"class":"className";var clsval=element.getAttribute(clsname);clsval=clsval?clsval+" "+name:name;element.setAttribute(clsname,clsval)}}}function wrapImplicitSlides(){var i,heading,node,next,div;var headings=document.getElementsByTagName("h1");if(!headings){return}for(i=0;i<headings.length;++i){heading=headings[i];if(heading.parentNode!=document.body){continue}node=heading.nextSibling;div=document.createElement("div");addClass(div,"slide");document.body.replaceChild(div,heading);div.appendChild(heading);while(node){if(node.nodeType==1&&(node.nodeName=="H1"||node.nodeName=="h1"||node.nodeName=="DIV"||node.nodeName=="div")){break}next=node.nextSibling;node=document.body.removeChild(node);div.appendChild(node);node=next}}}function collectSlides(){var slides=new Array();var divs=document.body.getElementsByTagName("div");for(var i=0;i<divs.length;++i){div=divs.item(i);if(hasClass(div,"slide")){slides[slides.length]=div;div.style.display="none";div.style.visibility="hidden";var node1=document.createElement("br");div.appendChild(node1);var node2=document.createElement("br");div.appendChild(node2)}else{if(hasClass(div,"background")){div.style.display="block"}}}return slides}function collectNotes(){var notes=new Array();var divs=document.body.getElementsByTagName("div");for(var i=0;i<divs.length;++i){div=divs.item(i);if(hasClass(div,"handout")){notes[notes.length]=div;div.style.display="none";div.style.visibility="hidden"}}return notes}function collectBackgrounds(){var backgrounds=new Array();var divs=document.body.getElementsByTagName("div");for(var i=0;i<divs.length;++i){div=divs.item(i);if(hasClass(div,"background")){backgrounds[backgrounds.length]=div;if(getClassList(div)!="background"){div.style.display="none";div.style.visibility="hidden"}}}return backgrounds}function syncBackground(slide){var background;var bgColor;if(slide.currentStyle){bgColor=slide.currentStyle.backgroundColor}else{if(document.defaultView){var styles=document.defaultView.getComputedStyle(slide,null);if(styles){bgColor=styles.getPropertyValue("background-color")}else{bgColor="transparent"}}else{bgColor=="transparent"}}if(bgColor=="transparent"){var slideClass=getClassList(slide);for(var i=0;i<backgrounds.length;i++){background=backgrounds[i];var bgClass=getClassList(background);if(matchingBackground(slideClass,bgClass)){background.style.display="block";background.style.visibility="visible"}else{background.style.display="none";background.style.visibility="hidden"}}}else{hideBackgrounds()}}function hideBackgrounds(){for(var i=0;i<backgrounds.length;i++){background=backgrounds[i];background.style.display="none";background.style.visibility="hidden"}}function matchingBackground(slideClass,bgClass){if(bgClass=="background"){return true}var pattern=/\w+/g;var result=slideClass.match(pattern);for(var i=0;i<result.length;i++){if(hasToken(bgClass,result[i])){return true}}return false}function nextNode(root,node){if(node==null){return root.firstChild}if(node.firstChild){return node.firstChild}if(node.nextSibling){return node.nextSibling}for(;;){node=node.parentNode;if(!node||node==root){break}if(node&&node.nextSibling){return node.nextSibling}}return null}function previousNode(root,node){if(node==null){node=root.lastChild;if(node){while(node.lastChild){node=node.lastChild}}return node}if(node.previousSibling){node=node.previousSibling;while(node.lastChild){node=node.lastChild}return node}if(node.parentNode!=root){return node.parentNode}return null}function incrementalElementList(){var inclist=new Array();inclist.P=true;inclist.PRE=true;inclist.LI=true;inclist.BLOCKQUOTE=true;inclist.DT=true;inclist.DD=true;inclist.H2=true;inclist.H3=true;inclist.H4=true;inclist.H5=true;inclist.H6=true;inclist.SPAN=true;inclist.ADDRESS=true;inclist.TABLE=true;inclist.TR=true;inclist.TH=true;inclist.TD=true;inclist.IMG=true;inclist.OBJECT=true;return inclist}function nextIncrementalItem(node){var slide=slides[slidenum];for(;;){node=nextNode(slide,node);if(node==null||node.parentNode==null){break}if(node.nodeType==1){if(node.nodeName=="BR"){continue}if(hasClass(node,"incremental")&&okayForIncremental[node.nodeName]){return node}if(hasClass(node.parentNode,"incremental")&&!hasClass(node,"non-incremental")){return node}}}return node}function previousIncrementalItem(node){var slide=slides[slidenum];for(;;){node=previousNode(slide,node);if(node==null||node.parentNode==null){break}if(node.nodeType==1){if(node.nodeName=="BR"){continue}if(hasClass(node,"incremental")&&okayForIncremental[node.nodeName]){return node}if(hasClass(node.parentNode,"incremental")&&!hasClass(node,"non-incremental")){return node}}}return node}function setVisibilityAllIncremental(value){var node=nextIncrementalItem(null);while(node){node.style.visibility=value;node=nextIncrementalItem(node)}}function revealNextItem(node){node=nextIncrementalItem(node);if(node&&node.nodeType==1){node.style.visibility="visible"}return node}function hidePreviousItem(node){if(node&&node.nodeType==1){node.style.visibility="hidden"}return previousIncrementalItem(node)}function patchAnchors(){var anchors=document.body.getElementsByTagName("a");for(var i=0;i<anchors.length;++i){anchors[i].onclick=clickedAnchor}}function clickedAnchor(e){if(!e){var e=window.event}if(pageAddress(this.href)==pageAddress(location.href)){var newslidenum=findSlideNumber(this.href);if(newslidenum!=slidenum){slide=slides[slidenum];hideSlide(slide);slidenum=newslidenum;slide=slides[slidenum];showSlide(slide);setLocation()}}else{if(this.target==null){location.href=this.href}}this.blur();stopPropagation(e)}function pageAddress(uri){var i=uri.indexOf("#");if(i<0){i=uri.indexOf("%23")}if(i<0){return uri}return uri.substr(0,i)}function showSlideNumber(){slideNumElement.innerHTML="slide".localize()+" "+(slidenum+1)+"/"+slides.length}function checkLocation(){var hash=location.hash;if(slidenum>0&&(hash==""||hash=="#")){gotoSlide(0)}else{if(hash.length>2&&hash!="#("+(slidenum+1)+")"){var num=parseInt(location.hash.substr(2));if(!isNaN(num)){gotoSlide(num-1)}}}}function setLocation(){var uri=pageAddress(location.href);var hash="#("+(slidenum+1)+")";if(slidenum>=0){uri=uri+hash}if(ie&&!ie8){pushHash(hash)}if(uri!=location.href){location.href=uri}if(khtml){hash="("+(slidenum+1)+")"}if(!ie&&location.hash!=hash&&location.hash!=""){location.hash=hash}document.title=title+" ("+(slidenum+1)+")";showSlideNumber()}function onFrameLoaded(hash){location.hash=hash;var uri=pageAddress(location.href);location.href=uri+hash}function pushHash(hash){if(hash==""){hash="#(1)"}window.location.hash=hash;var doc=document.getElementById("historyFrame").contentWindow.document;doc.open("javascript:'<html></html>'");doc.write('<html><head><script type="text/javascript">parent.onFrameLoaded(\''+(hash)+"');<\/script></head><body>hello mum</body></html>");doc.close()}function findSlideNumber(uri){var i=uri.indexOf("#");if(i<0){return 0}var anchor=unescape(uri.substr(i+1));var target=document.getElementById(anchor);if(!target){var re=/\((\d)+\)/;if(anchor.match(re)){var num=parseInt(anchor.substring(1,anchor.length-1));if(num>slides.length){num=1}if(--num<0){num=0}return num}re=/\[(\d)+\]/;if(anchor.match(re)){var num=parseInt(anchor.substring(1,anchor.length-1));if(num>slides.length){num=1}if(--num<0){num=0}return num}return 0}while(true){if(target.nodeName.toLowerCase()=="div"&&hasClass(target,"slide")){break}target=target.parentNode;if(!target){return 0}}for(i=0;i<slides.length;++i){if(slides[i]==target){return i}}return 0}function slideName(index){var name=null;var slide=slides[index];var heading=findHeading(slide);if(heading){name=extractText(heading)}if(!name){name=title+"("+(index+1)+")"}name.replace(/\&/g,"&amp;");name.replace(/\</g,"&lt;");name.replace(/\>/g,"&gt;");return name}function findHeading(node){if(!node||node.nodeType!=1){return null}if(node.nodeName=="H1"||node.nodeName=="h1"){return node}var child=node.firstChild;while(child){node=findHeading(child);if(node){return node}child=child.nextSibling}return null}function extractText(node){if(!node){return""}if(node.nodeType==3){return node.nodeValue}if(node.nodeType==1){node=node.firstChild;var text="";while(node){text=text+extractText(node);node=node.nextSibling}return text}return""}function findCopyright(){var name,content;var meta=document.getElementsByTagName("meta");for(var i=0;i<meta.length;++i){name=meta[i].getAttribute("name");content=meta[i].getAttribute("content");if(name=="copyright"){return content}}return null}function findSizeAdjust(){var name,content,offset;var meta=document.getElementsByTagName("meta");for(var i=0;i<meta.length;++i){name=meta[i].getAttribute("name");content=meta[i].getAttribute("content");if(name=="font-size-adjustment"){return 1*content}}return 1}function addToolbar(){var slideCounter,page;var toolbar=createElement("div");toolbar.setAttribute("class","toolbar");if(ns_pos){var right=document.createElement("div");right.setAttribute("style","float: right; text-align: right");slideCounter=document.createElement("div");slideCounter.innerHTML="slide".localize()+" n/m";right.appendChild(slideCounter);toolbar.appendChild(right);var left=document.createElement("div");left.setAttribute("style","text-align: left");eos=document.createElement("span");eos.innerHTML="* ";left.appendChild(eos);var help=document.createElement("a");help.setAttribute("href",helpPage);help.setAttribute("title",helpText.localize());help.innerHTML="help?".localize();left.appendChild(help);helpAnchor=help;var gap1=document.createTextNode(" ");left.appendChild(gap1);var contents=document.createElement("a");contents.setAttribute("href","javascript:toggleTableOfContents()");contents.setAttribute("title","table of contents".localize());contents.innerHTML="contents?".localize();left.appendChild(contents);var gap2=document.createTextNode(" ");left.appendChild(gap2);var start=document.createElement("a");start.setAttribute("href","javascript:firstSlide()");start.setAttribute("title","restart presentation".localize());start.innerHTML="restart?".localize();left.appendChild(start);var copyright=findCopyright();if(copyright){var span=document.createElement("span");span.innerHTML=copyright;span.style.color="black";span.style.marginLeft="4em";left.appendChild(span)}toolbar.appendChild(left)}else{toolbar.style.position=(ie7?"fixed":"absolute");toolbar.style.zIndex="200";toolbar.style.width="99.9%";toolbar.style.height="1.2em";toolbar.style.top="auto";toolbar.style.bottom="0";toolbar.style.left="0";toolbar.style.right="0";toolbar.style.textAlign="left";toolbar.style.fontSize="60%";toolbar.style.color="red";toolbar.borderWidth=0;toolbar.className="toolbar";toolbar.style.background="rgb(240,240,240)";var sp=document.createElement("span");sp.innerHTML="&nbsp;&nbsp;*&nbsp;";toolbar.appendChild(sp);eos=sp;var help=document.createElement("a");help.setAttribute("href",helpPage);help.setAttribute("title",helpText.localize());help.innerHTML="help?".localize();toolbar.appendChild(help);helpAnchor=help;var gap1=document.createTextNode(" ");toolbar.appendChild(gap1);var contents=document.createElement("a");contents.setAttribute("href","javascript:toggleTableOfContents()");contents.setAttribute("title","table of contents".localize());contents.innerHTML="contents?".localize();toolbar.appendChild(contents);var gap2=document.createTextNode(" ");toolbar.appendChild(gap2);var start=document.createElement("a");start.setAttribute("href","javascript:firstSlide()");start.setAttribute("title","restart presentation".localize());start.innerHTML="restart?".localize();toolbar.appendChild(start);var copyright=findCopyright();if(copyright){var span=document.createElement("span");span.innerHTML=copyright;span.style.color="black";span.style.marginLeft="2em";toolbar.appendChild(span)}slideCounter=document.createElement("div");slideCounter.style.position="absolute";slideCounter.style.width="auto";slideCounter.style.height="1.2em";slideCounter.style.top="auto";slideCounter.style.bottom=0;slideCounter.style.right="0";slideCounter.style.textAlign="right";slideCounter.style.color="red";slideCounter.style.background="rgb(240,240,240)";slideCounter.innerHTML="slide".localize()+" n/m";toolbar.appendChild(slideCounter)}toolbar.onclick=stopPropagation;document.body.appendChild(toolbar);slideNumElement=slideCounter;setEosStatus(false);return toolbar}function isShownToc(){if(toc&&toc.style.visible=="visible"){return true}return false}function showTableOfContents(){if(toc){if(toc.style.visibility!="visible"){toc.style.visibility="visible";toc.style.display="block";toc.focus();if(ie7&&slidenum==0){setTimeout("ieHack()",100)}}else{hideTableOfContents()}}}function hideTableOfContents(){if(toc&&toc.style.visibility!="hidden"){toc.style.visibility="hidden";toc.style.display="none";try{if(!opera){helpAnchor.focus()}}catch(e){}}}function toggleTableOfContents(){if(toc){if(toc.style.visible!="visible"){showTableOfContents()}else{hideTableOfContents()}}}function gotoEntry(e){var target;if(!e){var e=window.event}if(e.target){target=e.target}else{if(e.srcElement){target=e.srcElement}}if(target.nodeType==3){target=target.parentNode}if(target&&target.nodeType==1){var uri=target.getAttribute("href");if(uri){var slide=slides[slidenum];hideSlide(slide);slidenum=findSlideNumber(uri);slide=slides[slidenum];lastShown=null;setLocation();setVisibilityAllIncremental("hidden");setEosStatus(!nextIncrementalItem(lastShown));showSlide(slide);try{if(!opera){helpAnchor.focus()}}catch(e){}}}hideTableOfContents(e);if(ie7){ieHack()}stopPropagation(e);return cancel(e)}function gotoTocEntry(event){var key;if(!event){var event=window.event}if(window.event){key=window.event.keyCode}else{if(event.which){key=event.which}else{return true}}if(!key){return true}if(event.ctrlKey||event.altKey){return true}if(key==13){var uri=this.getAttribute("href");if(uri){var slide=slides[slidenum];hideSlide(slide);slidenum=findSlideNumber(uri);slide=slides[slidenum];lastShown=null;setLocation();setVisibilityAllIncremental("hidden");setEosStatus(!nextIncrementalItem(lastShown));showSlide(slide);try{if(!opera){helpAnchor.focus()}}catch(e){}}hideTableOfContents();if(ie7){ieHack()}return cancel(event)}if(key==40&&this.next){this.next.focus();return cancel(event)}if(key==38&&this.previous){this.previous.focus();return cancel(event)}return true}function isTitleSlide(slide){return hasClass(slide,"title")}function tableOfContents(){var toc=document.createElement("div");addClass(toc,"toc");var heading=document.createElement("div");addClass(heading,"toc-heading");heading.innerHTML="Table of Contents".localize();heading.style.textAlign="center";heading.style.width="100%";heading.style.margin="0";heading.style.marginBottom="1em";heading.style.borderBottomStyle="solid";heading.style.borderBottomColor="rgb(180,180,180)";heading.style.borderBottomWidth="1px";toc.appendChild(heading);var previous=null;for(var i=0;i<slides.length;++i){var title=hasClass(slides[i],"title");var num=document.createTextNode((i+1)+". ");toc.appendChild(num);var a=document.createElement("a");a.setAttribute("href","#("+(i+1)+")");if(title){addClass(a,"titleslide")}var name=document.createTextNode(slideName(i));a.appendChild(name);a.onclick=gotoEntry;a.onkeydown=gotoTocEntry;a.previous=previous;if(previous){previous.next=a}toc.appendChild(a);if(i==0){toc.first=a}if(i<slides.length-1){var br=document.createElement("br");toc.appendChild(br)}previous=a}toc.focus=function(){if(this.first){this.first.focus()}};toc.onmouseup=mouseButtonUp;toc.onclick=function(e){e||(e=window.event);if(selectedTextLen<=0){hideTableOfContents()}stopPropagation(e);if(e.cancel!=undefined){e.cancel=true}if(e.returnValue!=undefined){e.returnValue=false}return false};toc.style.position="absolute";toc.style.zIndex="300";toc.style.width="60%";toc.style.maxWidth="30em";toc.style.height="30em";toc.style.overflow="auto";toc.style.top="auto";toc.style.right="auto";toc.style.left="4em";toc.style.bottom="4em";toc.style.padding="1em";toc.style.background="rgb(240,240,240)";toc.style.borderStyle="solid";toc.style.borderWidth="2px";toc.style.fontSize="60%";document.body.insertBefore(toc,document.body.firstChild);return toc}function replaceByNonBreakingSpace(str){for(var i=0;i<str.length;++i){str[i]=160}}function initOutliner(){var items=document.getElementsByTagName("LI");for(var i=0;i<items.length;++i){var target=items[i];if(!hasClass(target.parentNode,"outline")){continue}target.onclick=outlineClick;if(!ns_pos){target.onmouseover=hoverOutline;target.onmouseout=unhoverOutline}if(foldable(target)){target.foldable=true;target.onfocus=function(){outline=this};target.onblur=function(){outline=null};if(!target.getAttribute("tabindex")){target.setAttribute("tabindex","0")}if(hasClass(target,"expand")){unfold(target)}else{fold(target)}}else{addClass(target,"nofold");target.visible=true;target.foldable=false}}}function foldable(item){if(!item||item.nodeType!=1){return false}var node=item.firstChild;while(node){if(node.nodeType==1&&isBlock(node)){return true}node=node.nextSibling}return false}function fold(item){if(item){removeClass(item,"unfolded");addClass(item,"folded")}var node=item?item.firstChild:null;while(node){if(node.nodeType==1&&isBlock(node)){node.display=getElementStyle(node,"display","display");node.style.display="none";node.style.visibility="hidden"}node=node.nextSibling}item.visible=false}function unfold(item){if(item){addClass(item,"unfolded");removeClass(item,"folded")}var node=item?item.firstChild:null;while(node){if(node.nodeType==1&&isBlock(node)){node.style.display=(node.display?node.display:"block");node.style.visibility="visible"}node=node.nextSibling}item.visible=true}function outlineClick(e){var rightclick=false;var target;if(!e){var e=window.event}if(e.target){target=e.target}else{if(e.srcElement){target=e.srcElement}}if(target.nodeType==3){target=target.parentNode}while(target&&target.visible==undefined){target=target.parentNode}if(!target){return true}if(e.which){rightclick=(e.which==3)}else{if(e.button){rightclick=(e.button==2)}}if(!rightclick&&target.visible!=undefined){if(target.foldable){if(target.visible){fold(target)}else{unfold(target)}}stopPropagation(e);e.cancel=true;e.returnValue=false}return false}function hoverOutline(e){var target;if(!e){var e=window.event}if(e.target){target=e.target}else{if(e.srcElement){target=e.srcElement}}if(target.nodeType==3){target=target.parentNode}while(target&&target.visible==undefined){target=target.parentNode}if(target&&target.foldable){target.style.cursor="pointer"}return true}function unhoverOutline(e){var target;if(!e){var e=window.event}if(e.target){target=e.target}else{if(e.srcElement){target=e.srcElement}}if(target.nodeType==3){target=target.parentNode}while(target&&target.visible==undefined){target=target.parentNode}if(target){target.style.cursor="default"}return true}function stopPropagation(e){if(window.event){window.event.cancelBubble=true}else{if(e){e.cancelBubble=true;e.stopPropagation()}}}function isBlock(elem){var tag=elem.nodeName;return tag=="OL"||tag=="UL"||tag=="P"||tag=="LI"||tag=="TABLE"||tag=="PRE"||tag=="H1"||tag=="H2"||tag=="H3"||tag=="H4"||tag=="H5"||tag=="H6"||tag=="BLOCKQUOTE"||tag=="ADDRESS"}function getElementStyle(elem,IEStyleProp,CSSStyleProp){if(elem.currentStyle){return elem.currentStyle[IEStyleProp]}else{if(window.getComputedStyle){var compStyle=window.getComputedStyle(elem,"");return compStyle.getPropertyValue(CSSStyleProp)}}return""}function createElement(element){if(typeof document.createElementNS!="undefined"){return document.createElementNS("http://www.w3.org/1999/xhtml",element)}if(typeof document.createElement!="undefined"){return document.createElement(element)}return false}function getElementsByTagName(name){if(typeof document.getElementsByTagNameNS!="undefined"){return document.getElementsByTagNameNS("http://www.w3.org/1999/xhtml",name)}if(typeof document.getElementsByTagName!="undefined"){return document.getElementsByTagName(name)}return null}function getSelectedText(){try{if(window.getSelection){return window.getSelection().toString()}if(document.getSelection){return document.getSelection().toString()}if(document.selection){return document.selection.createRange().text}}catch(e){return""}return""}; \ No newline at end of file
+var w3c_slidy={ns_pos:(typeof window.pageYOffset!="undefined"),khtml:((navigator.userAgent).indexOf("KHTML")>=0?true:false),opera:((navigator.userAgent).indexOf("Opera")>=0?true:false),ipad:((navigator.userAgent).indexOf("iPad")>=0?true:false),iphone:((navigator.userAgent).indexOf("iPhone")>=0?true:false),ie:(typeof document.all!="undefined"&&!this.opera),ie6:(!this.ns_pos&&navigator.userAgent.indexOf("MSIE 6")!=-1),ie7:(!this.ns_pos&&navigator.userAgent.indexOf("MSIE 7")!=-1),ie8:(!this.ns_pos&&navigator.userAgent.indexOf("MSIE 8")!=-1),ie9:(!this.ns_pos&&navigator.userAgent.indexOf("MSIE 9")!=-1),keyboardless:(this.ipad||this.iphone),is_xhtml:/xml/.test(document.contentType),slide_number:0,slide_number_element:null,slides:[],notes:[],backgrounds:[],toolbar:null,title:null,last_shown:null,eos:null,toc:null,outline:null,selected_text_len:0,view_all:0,want_toolbar:true,mouse_click_enabled:true,scroll_hack:0,disable_slide_click:false,lang:"en",help_anchor:null,help_page:"http://www.w3.org/Talks/Tools/Slidy2/help/help.html",help_text:"Navigate with mouse click, space bar, Cursor Left/Right, or Pg Up and Pg Dn. Use S and B to change font size.",size_index:0,size_adjustment:0,sizes:new Array("10pt","12pt","14pt","16pt","18pt","20pt","22pt","24pt","26pt","28pt","30pt","32pt"),last_width:0,last_height:0,objects:[],set_up:function(){var a=function(){w3c_slidy.init()};if(typeof window.addEventListener!="undefined"){window.addEventListener("load",a,false)}else{window.attachEvent("onload",a)}},hide_slides:function(){if(document.body&&!w3c_slidy.initialized){document.body.style.visibility="hidden"}else{setTimeout(w3c_slidy.hide_slides,50)}},ie_hack:function(){window.resizeBy(0,-1);window.resizeBy(0,1)},init:function(){document.body.style.visibility="visible";this.init_localization();this.add_toolbar();this.wrap_implicit_slides();this.collect_slides();this.collect_notes();this.collect_backgrounds();this.objects=document.body.getElementsByTagName("object");this.patch_anchors();this.slide_number=this.find_slide_number(location.href);window.offscreenbuffering=true;this.size_adjustment=this.find_size_adjust();this.time_left=this.find_duration();this.hide_image_toolbar();this.init_outliner();this.title=document.title;this.is_xhtml=(document.body.tagName=="BODY"?false:true);if(this.slides.length>0){var a=this.slides[this.slide_number];if(this.slide_number>0){this.set_visibility_all_incremental("visible");this.last_shown=this.previous_incremental_item(null);this.set_eos_status(true)}else{this.last_shown=null;this.set_visibility_all_incremental("hidden");this.set_eos_status(!this.next_incremental_item(this.last_shown))}this.set_location();this.add_class(this.slides[0],"first-slide");w3c_slidy.show_slide(a)}this.toc=this.table_of_contents();this.add_initial_prompt();if(!this.keyboardless){this.add_listener(document.body,"click",this.mouse_button_click)}this.add_listener(document,"keydown",this.key_down);this.add_listener(document,"keypress",this.key_press);this.add_listener(window,"resize",this.resized);this.add_listener(window,"scroll",this.scrolled);this.add_listener(window,"unload",this.unloaded);this.single_slide_view();this.resized();if(this.ie7){setTimeout(w3c_slidy.ie_hack,100)}this.show_toolbar();setInterval(function(){w3c_slidy.check_location()},200);w3c_slidy.initialized=true},table_of_contents:function(){var c=this.create_element("div");this.add_class(c,"slidy_toc hidden");var k=this.create_element("div");this.add_class(k,"toc-heading");k.innerHTML=this.localize("Table of Contents");c.appendChild(k);var f=null;for(var d=0;d<this.slides.length;++d){var g=this.has_class(this.slides[d],"title");var e=document.createTextNode((d+1)+". ");c.appendChild(e);var h=this.create_element("a");h.setAttribute("href","#("+(d+1)+")");if(g){this.add_class(h,"titleslide")}var b=document.createTextNode(this.slide_name(d));h.appendChild(b);h.onclick=w3c_slidy.toc_click;h.onkeydown=w3c_slidy.toc_key_down;h.previous=f;if(f){f.next=h}c.appendChild(h);if(d==0){c.first=h}if(d<this.slides.length-1){var j=this.create_element("br");c.appendChild(j)}f=h}c.focus=function(){if(this.first){this.first.focus()}};c.onmouseup=w3c_slidy.mouse_button_up;c.onclick=function(a){a||(a=window.event);if(w3c_slidy.selected_text_len<=0){w3c_slidy.hide_table_of_contents(true)}w3c_slidy.stop_propagation(a);if(a.cancel!=undefined){a.cancel=true}if(a.returnValue!=undefined){a.returnValue=false}return false};document.body.insertBefore(c,document.body.firstChild);return c},is_shown_toc:function(){return !w3c_slidy.has_class(w3c_slidy.toc,"hidden")},show_table_of_contents:function(){w3c_slidy.remove_class(w3c_slidy.toc,"hidden");var a=w3c_slidy.toc;a.focus();if(w3c_slidy.ie7&&w3c_slidy.slide_number==0){setTimeout(w3c_slidy.ie_hack,100)}},hide_table_of_contents:function(a){w3c_slidy.add_class(w3c_slidy.toc,"hidden");if(a&&!w3c_slidy.opera){w3c_slidy.help_anchor.focus()}},toggle_table_of_contents:function(){if(w3c_slidy.is_shown_toc()){w3c_slidy.hide_table_of_contents(true)}else{w3c_slidy.show_table_of_contents()}},toc_click:function(d){if(!d){d=window.event}var c=w3c_slidy.get_target(d);if(c&&c.nodeType==1){var b=c.getAttribute("href");if(b){var a=w3c_slidy.slides[w3c_slidy.slide_number];w3c_slidy.hide_slide(a);w3c_slidy.slide_number=w3c_slidy.find_slide_number(b);a=w3c_slidy.slides[w3c_slidy.slide_number];w3c_slidy.last_shown=null;w3c_slidy.set_location();w3c_slidy.set_visibility_all_incremental("hidden");w3c_slidy.set_eos_status(!w3c_slidy.next_incremental_item(w3c_slidy.last_shown));w3c_slidy.show_slide(a);try{if(!w3c_slidy.opera){w3c_slidy.help_anchor.focus()}}catch(d){}}}w3c_slidy.hide_table_of_contents(true);if(w3c_slidy.ie7){w3c_slidy.ie_hack()}w3c_slidy.stop_propagation(d);return w3c_slidy.cancel(d)},toc_key_down:function(d){var b;if(!d){var d=window.event}if(window.event){b=window.event.keyCode}else{if(d.which){b=d.which}else{return true}}if(!b){return true}if(d.ctrlKey||d.altKey){return true}if(b==13){var c=this.getAttribute("href");if(c){var a=w3c_slidy.slides[w3c_slidy.slide_number];w3c_slidy.hide_slide(a);w3c_slidy.slide_number=w3c_slidy.find_slide_number(c);a=w3c_slidy.slides[w3c_slidy.slide_number];w3c_slidy.last_shown=null;w3c_slidy.set_location();w3c_slidy.set_visibility_all_incremental("hidden");w3c_slidy.set_eos_status(!w3c_slidy.next_incremental_item(w3c_slidy.last_shown));w3c_slidy.show_slide(a);try{if(!w3c_slidy.opera){w3c_slidy.help_anchor.focus()}}catch(f){}}w3c_slidy.hide_table_of_contents(true);if(self.ie7){w3c_slidy.ie_hack()}return w3c_slidy.cancel(d)}if(b==40&&this.next){this.next.focus();return w3c_slidy.cancel(d)}if(b==38&&this.previous){this.previous.focus();return w3c_slidy.cancel(d)}return true},before_print:function(){this.show_all_slides();this.hide_toolbar();alert("before print")},after_print:function(){if(!this.view_all){this.single_slide_view();this.show_toolbar()}alert("after print")},print_slides:function(){this.before_print();window.print();this.after_print()},toggle_view:function(){if(this.view_all){this.single_slide_view();this.show_toolbar();this.view_all=0}else{this.show_all_slides();this.hide_toolbar();this.view_all=1}},show_all_slides:function(){this.remove_class(document.body,"single_slide");this.set_visibility_all_incremental("visible")},single_slide_view:function(){this.add_class(document.body,"single_slide");this.set_visibility_all_incremental("visible");this.last_shown=this.previous_incremental_item(null)},hide_image_toolbar:function(){if(!this.ns_pos){var a=document.getElementsByTagName("IMG");for(var b=0;b<a.length;++b){a[b].setAttribute("galleryimg","no")}}},unloaded:function(a){},is_KHTML:function(){var a=navigator.userAgent;return(a.indexOf("KHTML")>=0?true:false)},slide_name:function(c){var b=null;var a=this.slides[c];var d=this.find_heading(a);if(d){b=this.extract_text(d)}if(!b){b=this.title+"("+(c+1)+")"}b.replace(/\&/g,"&amp;");b.replace(/\</g,"&lt;");b.replace(/\>/g,"&gt;");return b},find_heading:function(a){if(!a||a.nodeType!=1){return null}if(a.nodeName=="H1"||a.nodeName=="h1"){return a}var b=a.firstChild;while(b){a=this.find_heading(b);if(a){return a}b=b.nextSibling}return null},extract_text:function(a){if(!a){return""}if(a.nodeType==3){return a.nodeValue}if(a.nodeType==1){a=a.firstChild;var b="";while(a){b=b+this.extract_text(a);a=a.nextSibling}return b}return""},find_copyright:function(){var a,c;var d=document.getElementsByTagName("meta");for(var b=0;b<d.length;++b){a=d[b].getAttribute("name");c=d[b].getAttribute("content");if(a=="copyright"){return c}}return null},find_size_adjust:function(){var a,c,e;var d=document.getElementsByTagName("meta");for(var b=0;b<d.length;++b){a=d[b].getAttribute("name");c=d[b].getAttribute("content");if(a=="font-size-adjustment"){return 1*c}}return 1},find_duration:function(){var a,c,e;var d=document.getElementsByTagName("meta");for(var b=0;b<d.length;++b){a=d[b].getAttribute("name");c=d[b].getAttribute("content");if(a=="duration"){return 60000*c}}return null},replace_by_non_breaking_space:function(b){for(var a=0;a<b.length;++a){b[a]=160}},init_outliner:function(){var a=document.getElementsByTagName("li");for(var b=0;b<a.length;++b){var c=a[b];if(!this.has_class(c.parentNode,"outline")){continue}c.onclick=this.outline_click;if(this.foldable(c)){c.foldable=true;c.onfocus=function(){w3c_slidy.outline=this};c.onblur=function(){w3c_slidy.outline=null};if(!c.getAttribute("tabindex")){c.setAttribute("tabindex","0")}if(this.has_class(c,"expand")){this.unfold(c)}else{this.fold(c)}}else{this.add_class(c,"nofold");c.visible=true;c.foldable=false}}},foldable:function(b){if(!b||b.nodeType!=1){return false}var a=b.firstChild;while(a){if(a.nodeType==1&&this.is_block(a)){return true}a=a.nextSibling}return false},fold:function(b){if(b){this.remove_class(b,"unfolded");this.add_class(b,"folded")}var a=b?b.firstChild:null;while(a){if(a.nodeType==1&&this.is_block(a)){w3c_slidy.add_class(a,"hidden")}a=a.nextSibling}b.visible=false},unfold:function(b){if(b){this.add_class(b,"unfolded");this.remove_class(b,"folded")}var a=b?b.firstChild:null;while(a){if(a.nodeType==1&&this.is_block(a)){w3c_slidy.remove_class(a,"hidden")}a=a.nextSibling}b.visible=true},outline_click:function(c){if(!c){c=window.event}var a=false;var b=w3c_slidy.get_target(c);while(b&&b.visible==undefined){b=b.parentNode}if(!b){return true}if(c.which){a=(c.which==3)}else{if(c.button){a=(c.button==2)}}if(!a&&b.visible!=undefined){if(b.foldable){if(b.visible){w3c_slidy.fold(b)}else{w3c_slidy.unfold(b)}}w3c_slidy.stop_propagation(c);c.cancel=true;c.returnValue=false}return false},add_initial_prompt:function(){var a=this.create_element("div");a.setAttribute("class","initial_prompt");var b=this.create_element("p");a.appendChild(b);b.setAttribute("class","help");if(this.keyboardless){b.innerHTML="Tap footer to move to next slide"}else{b.innerHTML="Space or Right Arrow to move to next slide, click help below for more details"}this.add_listener(a,"click",function(c){document.body.removeChild(a);w3c_slidy.stop_propagation(c);if(c.cancel!=undefined){c.cancel=true}if(c.returnValue!=undefined){c.returnValue=false}return false});document.body.appendChild(a);this.initial_prompt=a;setTimeout(function(){document.body.removeChild(a)},5000)},add_toolbar:function(){var a,i;this.toolbar=this.create_element("div");this.toolbar.setAttribute("class","toolbar");if(this.ns_pos||!this.ie6){var k=this.create_element("div");k.setAttribute("style","float: right; text-align: right");a=this.create_element("span");a.innerHTML=this.localize("slide")+" n/m";k.appendChild(a);this.toolbar.appendChild(k);var e=this.create_element("div");e.setAttribute("style","text-align: left");this.eos=this.create_element("span");this.eos.innerHTML="* ";e.appendChild(this.eos);var g=this.create_element("a");g.setAttribute("href",this.help_page);g.setAttribute("title",this.localize(this.help_text));g.innerHTML=this.localize("help?");e.appendChild(g);this.help_anchor=g;var d=document.createTextNode(" ");e.appendChild(d);var f=this.create_element("a");f.setAttribute("href","javascript:w3c_slidy.toggle_table_of_contents()");f.setAttribute("title",this.localize("table of contents"));f.innerHTML=this.localize("contents?");e.appendChild(f);var b=document.createTextNode(" ");e.appendChild(b);var h=this.find_copyright();if(h){var j=this.create_element("span");j.className="copyright";j.innerHTML=h;e.appendChild(j)}this.toolbar.setAttribute("tabindex","0");this.toolbar.appendChild(e)}else{this.toolbar.style.position=(this.ie7?"fixed":"absolute");this.toolbar.style.zIndex="200";this.toolbar.style.width="99.9%";this.toolbar.style.height="1.2em";this.toolbar.style.top="auto";this.toolbar.style.bottom="0";this.toolbar.style.left="0";this.toolbar.style.right="0";this.toolbar.style.textAlign="left";this.toolbar.style.fontSize="60%";this.toolbar.style.color="red";this.toolbar.borderWidth=0;this.toolbar.className="toolbar";this.toolbar.style.background="rgb(240,240,240)";var c=this.create_element("span");c.innerHTML="&nbsp;&nbsp;*&nbsp;";this.toolbar.appendChild(c);this.eos=c;var g=this.create_element("a");g.setAttribute("href",this.help_page);g.setAttribute("title",this.localize(this.help_text));g.innerHTML=this.localize("help?");this.toolbar.appendChild(g);this.help_anchor=g;var d=document.createTextNode(" ");this.toolbar.appendChild(d);var f=this.create_element("a");f.setAttribute("href","javascript:toggleTableOfContents()");f.setAttribute("title",this.localize("table of contents".localize));f.innerHTML=this.localize("contents?");this.toolbar.appendChild(f);var b=document.createTextNode(" ");this.toolbar.appendChild(b);var h=this.find_copyright();if(h){var j=this.create_element("span");j.innerHTML=h;j.style.color="black";j.style.marginLeft="0.5em";this.toolbar.appendChild(j)}a=this.create_element("div");a.style.position="absolute";a.style.width="auto";a.style.height="1.2em";a.style.top="auto";a.style.bottom=0;a.style.right="0";a.style.textAlign="right";a.style.color="red";a.style.background="rgb(240,240,240)";a.innerHTML=this.localize("slide")+" n/m";this.toolbar.appendChild(a)}this.toolbar.onclick=function(m){if(!m){m=window.event}var l=m.target;if(!l&&m.srcElement){l=m.srcElement}if(l&&l.nodeType==3){l=l.parentNode}w3c_slidy.stop_propagation(m);if(l&&l.nodeName.toLowerCase()!="a"){w3c_slidy.mouse_button_click(m)}};this.slide_number_element=a;this.set_eos_status(false);document.body.appendChild(this.toolbar)},wrap_implicit_slides:function(){var a,d,c,b,f;var e=document.getElementsByTagName("h1");if(!e){return}for(a=0;a<e.length;++a){d=e[a];if(d.parentNode!=document.body){continue}c=d.nextSibling;f=document.createElement("div");this.add_class(f,"slide");document.body.replaceChild(f,d);f.appendChild(d);while(c){if(c.nodeType==1&&(c.nodeName=="H1"||c.nodeName=="h1"||c.nodeName=="DIV"||c.nodeName=="div")){break}b=c.nextSibling;c=document.body.removeChild(c);f.appendChild(c);c=b}}},collect_slides:function(){var e=new Array();var d=document.body.getElementsByTagName("div");for(var c=0;c<d.length;++c){div=d.item(c);if(this.has_class(div,"slide")){e[e.length]=div;this.add_class(div,"hidden");var b=document.createElement("br");div.appendChild(b);var a=document.createElement("br");div.appendChild(a)}else{if(this.has_class(div,"background")){div.style.display="block"}}}this.slides=e},collect_notes:function(){var b=new Array();var c=document.body.getElementsByTagName("div");for(var a=0;a<c.length;++a){div=c.item(a);if(this.has_class(div,"handout")){b[b.length]=div;this.add_class(div,"hidden")}}this.notes=b},collect_backgrounds:function(){var c=new Array();var b=document.body.getElementsByTagName("div");for(var a=0;a<b.length;++a){div=b.item(a);if(this.has_class(div,"background")){c[c.length]=div;this.add_class(div,"hidden")}}this.backgrounds=c},patch_anchors:function(){var a=w3c_slidy;var c=function(g){if(a.page_address(this.href)==a.page_address(location.href)){var f=a.find_slide_number(this.href);if(f!=a.slide_number){var e=a.slides[a.slide_number];a.hide_slide(e);a.slide_number=f;e=a.slides[a.slide_number];a.show_slide(e);a.set_location()}}else{w3c_slidy.stop_propagation(g)}this.blur();a.disable_slide_click=true};var d=document.body.getElementsByTagName("a");for(var b=0;b<d.length;++b){if(window.addEventListener){d[b].addEventListener("click",c,false)}else{d[b].attachEvent("onclick",c)}}},show_slide_number:function(){var a=w3c_slidy.get_timer();w3c_slidy.slide_number_element.innerHTML=a+w3c_slidy.localize("slide")+" "+(w3c_slidy.slide_number+1)+"/"+w3c_slidy.slides.length},check_location:function(){var b=location.hash;if(w3c_slidy.slide_number>0&&(b==""||b=="#")){w3c_slidy.goto_slide(0)}else{if(b.length>2&&b!="#("+(w3c_slidy.slide_number+1)+")"){var a=parseInt(location.hash.substr(2));if(!isNaN(a)){w3c_slidy.goto_slide(a-1)}}}if(w3c_slidy.time_left&&w3c_slidy.slide_number>0){w3c_slidy.show_slide_number();if(w3c_slidy.time_left>0){w3c_slidy.time_left-=200}}},get_timer:function(){var c="";if(w3c_slidy.time_left){var b,a;a=Math.floor(w3c_slidy.time_left/1000);b=Math.floor(a/60);a=a%60;c=(b?b+"m":"")+a+"s "}return c},set_location:function(){var a=w3c_slidy.page_address(location.href);var b="#("+(w3c_slidy.slide_number+1)+")";if(w3c_slidy.slide_number>=0){a=a+b}if(w3c_slidy.ie&&(w3c_slidy.ie6||w3c_slidy.ie7)){w3c_slidy.push_hash(b)}if(a!=location.href){location.href=a}if(this.khtml){b="("+(w3c_slidy.slide_number+1)+")"}if(!this.ie&&location.hash!=b&&location.hash!=""){location.hash=b}document.title=w3c_slidy.title+" ("+(w3c_slidy.slide_number+1)+")";w3c_slidy.show_slide_number()},page_address:function(b){var a=b.indexOf("#");if(a<0){a=b.indexOf("%23")}if(a<0){return b}return b.substr(0,a)},on_frame_loaded:function(b){location.hash=b;var a=w3c_slidy.page_address(location.href);location.href=a+b},push_hash:function(b){if(b==""){b="#(1)"}window.location.hash=b;var a=document.getElementById("historyFrame").contentWindow.document;a.open("javascript:'<html></html>'");a.write('<html><head><script type="text/javascript">window.parent.w3c_slidy.on_frame_loaded(\''+(b)+"');\74/script></head><body>hello mum</body></html>");a.close()},find_slide_number:function(e){var c=e.indexOf("#");if(c<0){return 0}var b=unescape(e.substr(c+1));var f=document.getElementById(b);if(!f){var d=/\((\d)+\)/;if(b.match(d)){var a=parseInt(b.substring(1,b.length-1));if(a>this.slides.length){a=1}if(--a<0){a=0}return a}d=/\[(\d)+\]/;if(b.match(d)){var a=parseInt(b.substring(1,b.length-1));if(a>this.slides.length){a=1}if(--a<0){a=0}return a}return 0}while(true){if(f.nodeName.toLowerCase()=="div"&&this.has_class(f,"slide")){break}f=f.parentNode;if(!f){return 0}}for(c=0;c<slides.length;++c){if(slides[c]==f){return c}}return 0},previous_slide:function(b){if(!w3c_slidy.view_all){var a;if((b||w3c_slidy.slide_number==0)&&w3c_slidy.last_shown!=null){w3c_slidy.last_shown=w3c_slidy.hide_previous_item(w3c_slidy.last_shown);w3c_slidy.set_eos_status(false)}else{if(w3c_slidy.slide_number>0){a=w3c_slidy.slides[w3c_slidy.slide_number];w3c_slidy.hide_slide(a);w3c_slidy.slide_number=w3c_slidy.slide_number-1;a=w3c_slidy.slides[w3c_slidy.slide_number];w3c_slidy.set_visibility_all_incremental("visible");w3c_slidy.last_shown=w3c_slidy.previous_incremental_item(null);w3c_slidy.set_eos_status(true);w3c_slidy.show_slide(a)}}w3c_slidy.set_location();if(!w3c_slidy.ns_pos){w3c_slidy.refresh_toolbar(200)}}},next_slide:function(c){if(!w3c_slidy.view_all){var a,b=w3c_slidy.last_shown;if(c||w3c_slidy.slide_number==w3c_slidy.slides.length-1){w3c_slidy.last_shown=w3c_slidy.reveal_next_item(w3c_slidy.last_shown)}if((!c||w3c_slidy.last_shown==null)&&w3c_slidy.slide_number<w3c_slidy.slides.length-1){a=w3c_slidy.slides[w3c_slidy.slide_number];w3c_slidy.hide_slide(a);w3c_slidy.slide_number=w3c_slidy.slide_number+1;a=w3c_slidy.slides[w3c_slidy.slide_number];w3c_slidy.last_shown=null;w3c_slidy.set_visibility_all_incremental("hidden");w3c_slidy.show_slide(a)}else{if(!w3c_slidy.last_shown){if(b&&c){w3c_slidy.last_shown=b}}}w3c_slidy.set_location();w3c_slidy.set_eos_status(!w3c_slidy.next_incremental_item(w3c_slidy.last_shown));if(!w3c_slidy.ns_pos){w3c_slidy.refresh_toolbar(200)}}},first_slide:function(){if(!w3c_slidy.view_all){var a;if(w3c_slidy.slide_number!=0){a=w3c_slidy.slides[w3c_slidy.slide_number];w3c_slidy.hide_slide(a);w3c_slidy.slide_number=0;a=w3c_slidy.slides[w3c_slidy.slide_number];w3c_slidy.last_shown=null;w3c_slidy.set_visibility_all_incremental("hidden");w3c_slidy.show_slide(a)}w3c_slidy.set_eos_status(!w3c_slidy.next_incremental_item(w3c_slidy.last_shown));w3c_slidy.set_location()}},last_slide:function(){if(!w3c_slidy.view_all){var a;w3c_slidy.last_shown=null;if(w3c_slidy.last_shown==null&&w3c_slidy.slide_number<w3c_slidy.slides.length-1){a=w3c_slidy.slides[w3c_slidy.slide_number];w3c_slidy.hide_slide(a);w3c_slidy.slide_number=w3c_slidy.slides.length-1;a=w3c_slidy.slides[w3c_slidy.slide_number];w3c_slidy.set_visibility_all_incremental("visible");w3c_slidy.last_shown=w3c_slidy.previous_incremental_item(null);w3c_slidy.show_slide(a)}else{w3c_slidy.set_visibility_all_incremental("visible");w3c_slidy.last_shown=w3c_slidy.previous_incremental_item(null)}w3c_slidy.set_eos_status(true);w3c_slidy.set_location()}},set_eos_status:function(a){if(this.eos){this.eos.style.color=(a?"rgb(240,240,240)":"red")}},goto_slide:function(b){var a=w3c_slidy.slides[w3c_slidy.slide_number];w3c_slidy.hide_slide(a);w3c_slidy.slide_number=b;a=w3c_slidy.slides[w3c_slidy.slide_number];w3c_slidy.last_shown=null;w3c_slidy.set_visibility_all_incremental("hidden");w3c_slidy.set_eos_status(!w3c_slidy.next_incremental_item(w3c_slidy.last_shown));document.title=w3c_slidy.title+" ("+(w3c_slidy.slide_number+1)+")";w3c_slidy.show_slide(a);w3c_slidy.show_slide_number()},show_slide:function(a){this.sync_background(a);window.scrollTo(0,0);this.remove_class(a,"hidden")},hide_slide:function(a){this.add_class(a,"hidden")},sync_background:function(a){var e;var g;if(a.currentStyle){g=a.currentStyle.backgroundColor}else{if(document.defaultView){var f=document.defaultView.getComputedStyle(a,null);if(f){g=f.getPropertyValue("background-color")}else{g="transparent"}}else{g=="transparent"}}if(g=="transparent"||g.indexOf("rgba")>=0||g.indexOf("opacity")>=0){var c=this.get_class_list(a);for(var d=0;d<this.backgrounds.length;d++){e=this.backgrounds[d];var b=this.get_class_list(e);if(this.matching_background(c,b)){this.remove_class(e,"hidden")}else{this.add_class(e,"hidden")}}}else{this.hide_backgrounds()}},hide_backgrounds:function(){for(var a=0;a<this.backgrounds.length;a++){background=this.backgrounds[a];this.add_class(background,"hidden")}},matching_background:function(c,b){var d,e,f,a;f=/\w+/g;a=b.match(f);for(d=e=0;d<a.length;d++){if(a[d]=="hidden"){continue}if(a[d]=="background"){continue}++e}if(e==0){return true}a=c.match(f);for(d=e=0;d<a.length;d++){if(a[d]=="hidden"){continue}if(this.has_token(b,a[d])){return true}}return false},resized:function(){var c=0;if(typeof(window.innerWidth)=="number"){c=window.innerWidth}else{if(document.documentElement&&document.documentElement.clientWidth){c=document.documentElement.clientWidth}else{if(document.body&&document.body.clientWidth){c=document.body.clientWidth}}}var b=0;if(typeof(window.innerHeight)=="number"){b=window.innerHeight}else{if(document.documentElement&&document.documentElement.clientHeight){b=document.documentElement.clientHeight}else{if(document.body&&document.body.clientHeight){b=document.body.clientHeight}}}if(b&&(c/b>1.05*1024/768)){c=b*1024/768}if(c!=w3c_slidy.last_width||b!=w3c_slidy.last_height){if(c>=1100){w3c_slidy.size_index=5}else{if(c>=1000){w3c_slidy.size_index=4}else{if(c>=800){w3c_slidy.size_index=3}else{if(c>=600){w3c_slidy.size_index=2}else{if(c){w3c_slidy.size_index=0}}}}}if(0<=w3c_slidy.size_index+w3c_slidy.size_adjustment&&w3c_slidy.size_index+w3c_slidy.size_adjustment<w3c_slidy.sizes.length){w3c_slidy.size_index=w3c_slidy.size_index+w3c_slidy.size_adjustment}w3c_slidy.adjust_object_dimensions(c,b);if(document.body.style.fontSize!=w3c_slidy.sizes[w3c_slidy.size_index]){document.body.style.fontSize=w3c_slidy.sizes[w3c_slidy.size_index]}w3c_slidy.last_width=c;w3c_slidy.last_height=b;if(w3c_slidy.ns_pos){var a=w3c_slidy.slides[w3c_slidy.slide_number];w3c_slidy.hide_slide(a);w3c_slidy.show_slide(a)}w3c_slidy.refresh_toolbar(200)}},scrolled:function(){if(w3c_slidy.toolbar&&!w3c_slidy.ns_pos&&!w3c_slidy.ie7){w3c_slidy.hack_offset=w3c_slidy.scroll_x_offset();w3c_slidy.toolbar.style.display="none";if(w3c_slidy.scrollhack==0&&!w3c_slidy.view_all){setTimeout(function(){w3c_slidy.show_toolbar()},1000);w3c_slidy.scrollhack=1}}},hide_toolbar:function(){w3c_slidy.add_class(w3c_slidy.toolbar,"hidden");window.focus()},refresh_toolbar:function(a){if(!w3c_slidy.ns_pos&&!w3c_slidy.ie7){w3c_slidy.hide_toolbar();setTimeout(function(){w3c_slidy.show_toolbar()},a)}},show_toolbar:function(){if(w3c_slidy.want_toolbar){w3c_slidy.toolbar.style.display="block";if(!w3c_slidy.ns_pos){var b=w3c_slidy.scroll_x_offset();w3c_slidy.toolbar.style.left=b;w3c_slidy.toolbar.style.right=b;w3c_slidy.toolbar.style.bottom=0}w3c_slidy.remove_class(w3c_slidy.toolbar,"hidden")}w3c_slidy.scrollhack=0;try{if(!w3c_slidy.opera){w3c_slidy.help_anchor.focus()}}catch(a){}},toggle_toolbar:function(){if(!w3c_slidy.view_all){if(w3c_slidy.has_class(w3c_slidy.toolbar,"hidden")){w3c_slidy.remove_class(w3c_slidy.toolbar,"hidden");w3c_slidy.want_toolbar=1}else{w3c_slidy.add_class(w3c_slidy.toolbar,"hidden");w3c_slidy.want_toolbar=0}}},scroll_x_offset:function(){if(window.pageXOffset){return self.pageXOffset}if(document.documentElement&&document.documentElement.scrollLeft){return document.documentElement.scrollLeft}if(document.body){return document.body.scrollLeft}return 0},scroll_y_offset:function(){if(window.pageYOffset){return self.pageYOffset}if(document.documentElement&&document.documentElement.scrollTop){return document.documentElement.scrollTop}if(document.body){return document.body.scrollTop}return 0},optimize_font_size:function(){var a=w3c_slidy.slides[w3c_slidy.slide_number];var d=a.scrollHeight;var b=getWindowHeight();var c=100*d/b;alert("window utilization = "+c+"% (doc "+d+" win "+b+")")},get_doc_height:function(a){if(!a){a=document}if(a&&a.body&&a.body.offsetHeight){return a.body.offsetHeight}if(a&&a.body&&a.body.scrollHeight){return a.body.scrollHeight}alert("couldn't determine document height")},get_window_height:function(){if(typeof(window.innerHeight)=="number"){return window.innerHeight}if(document.documentElement&&document.documentElement.clientHeight){return document.documentElement.clientHeight}if(document.body&&document.body.clientHeight){return document.body.clientHeight}},document_height:function(){var a,b;a=document.body.scrollHeight;b=document.body.offsetHeight;if(a&&b){return(a>b?a:b)}return 0},smaller:function(){if(w3c_slidy.size_index>0){--w3c_slidy.size_index}w3c_slidy.toolbar.style.display="none";document.body.style.fontSize=w3c_slidy.sizes[w3c_slidy.size_index];var a=w3c_slidy.slides[w3c_slidy.slide_number];w3c_slidy.hide_slide(a);w3c_slidy.show_slide(a);setTimeout(function(){w3c_slidy.show_toolbar()},50)},bigger:function(){if(w3c_slidy.size_index<w3c_slidy.sizes.length-1){++w3c_slidy.size_index}w3c_slidy.toolbar.style.display="none";document.body.style.fontSize=w3c_slidy.sizes[w3c_slidy.size_index];var a=w3c_slidy.slides[w3c_slidy.slide_number];w3c_slidy.hide_slide(a);w3c_slidy.show_slide(a);setTimeout(function(){w3c_slidy.show_toolbar()},50)},adjust_object_dimensions:function(c,k){for(var e=0;e<w3c_slidy.objects.length;e++){var d=this.objects[e];var b=d.getAttribute("type");if(b=="image/svg+xml"||b=="application/x-shockwave-flash"){if(!d.initialWidth){d.initialWidth=d.getAttribute("width")}if(!d.initialHeight){d.initialHeight=d.getAttribute("height")}if(d.initialWidth&&d.initialWidth.charAt(d.initialWidth.length-1)=="%"){var j=parseInt(d.initialWidth.slice(0,d.initialWidth.length-1));var a=c*(j/100);d.setAttribute("width",a)}if(d.initialHeight&&d.initialHeight.charAt(d.initialHeight.length-1)=="%"){var f=parseInt(d.initialHeight.slice(0,d.initialHeight.length-1));var g=k*(f/100);d.setAttribute("height",g)}}}},key_press:function(a){if(!a){a=window.event}if(!w3c_slidy.key_wanted){return w3c_slidy.cancel(a)}return true},key_down:function(d){var c,e,a;w3c_slidy.key_wanted=true;if(!d){d=window.event}if(window.event){c=window.event.keyCode;e=window.event.srcElement}else{if(d.which){c=d.which;e=d.target}else{return true}}if(!c){return true}if(!w3c_slidy.slidy_chrome(e)&&w3c_slidy.special_element(e)){return true}if(d.ctrlKey||d.altKey||d.metaKey){return true}if(w3c_slidy.is_shown_toc()&&c!=9&&c!=16&&c!=38&&c!=40){w3c_slidy.hide_table_of_contents(true);if(c==27||c==84||c==67){return w3c_slidy.cancel(d)}}if(c==34){if(w3c_slidy.view_all){return true}w3c_slidy.next_slide(false);return w3c_slidy.cancel(d)}else{if(c==33){if(w3c_slidy.view_all){return true}w3c_slidy.previous_slide(false);return w3c_slidy.cancel(d)}else{if(c==32){w3c_slidy.next_slide(true);return w3c_slidy.cancel(d)}else{if(c==37){w3c_slidy.previous_slide(!d.shiftKey);return w3c_slidy.cancel(d)}else{if(c==36){w3c_slidy.first_slide();return w3c_slidy.cancel(d)}else{if(c==35){w3c_slidy.last_slide();return w3c_slidy.cancel(d)}else{if(c==39){w3c_slidy.next_slide(!d.shiftKey);return w3c_slidy.cancel(d)}else{if(c==13){if(w3c_slidy.outline){if(w3c_slidy.outline.visible){w3c_slidy.fold(w3c_slidy.outline)}else{w3c_slidy.unfold(w3c_slidy.outline)}return w3c_slidy.cancel(d)}}else{if(c==188){w3c_slidy.smaller();return w3c_slidy.cancel(d)}else{if(c==190){w3c_slidy.bigger();return w3c_slidy.cancel(d)}else{if(c==189||c==109){w3c_slidy.smaller();return w3c_slidy.cancel(d)}else{if(c==187||c==191||c==107){w3c_slidy.bigger();return w3c_slidy.cancel(d)}else{if(c==83){w3c_slidy.smaller();return w3c_slidy.cancel(d)}else{if(c==66){w3c_slidy.bigger();return w3c_slidy.cancel(d)}else{if(c==90){w3c_slidy.last_slide();return w3c_slidy.cancel(d)}else{if(c==70){w3c_slidy.toggle_toolbar();return w3c_slidy.cancel(d)}else{if(c==65){w3c_slidy.toggle_view();return w3c_slidy.cancel(d)}else{if(c==75){w3c_slidy.mouse_click_enabled=!w3c_slidy.mouse_click_enabled;var b=(w3c_slidy.mouse_click_enabled?"enabled":"disabled")+" mouse click advance";alert(w3c_slidy.localize(b));return w3c_slidy.cancel(d)}else{if(c==84||c==67){if(w3c_slidy.toc){w3c_slidy.toggle_table_of_contents()}return w3c_slidy.cancel(d)}else{if(c==72){window.location=w3c_slidy.help_page;return w3c_slidy.cancel(d)}}}}}}}}}}}}}}}}}}}}return true},create_element:function(a){if(this.xhtml&&(typeof document.createElementNS!="undefined")){return document.createElementNS("http://www.w3.org/1999/xhtml",a)}return document.createElement(a)},get_element_style:function(d,b,c){if(d.currentStyle){return d.currentStyle[b]}else{if(window.getComputedStyle){var a=window.getComputedStyle(d,"");return a.getPropertyValue(c)}}return""},has_token:function(e,c){if(e){var d=/\w+/g;var a=e.match(d);for(var b=0;b<a.length;b++){if(a[b]==c){return true}}}return false},get_class_list:function(a){if(typeof a.className!="undefined"){return a.className}return a.getAttribute("class")},has_class:function(b,a){if(b.nodeType!=1){return false}var c=new RegExp("(^| )"+a+"W*");if(typeof b.className!="undefined"){return c.test(b.className)}return c.test(b.getAttribute("class"))},remove_class:function(b,a){var d=new RegExp("(^| )"+a+"W*");var c="";if(typeof b.className!="undefined"){c=b.className;if(c){c=c.replace(d,"");b.className=c}}else{c=b.getAttribute("class");if(c){c=c.replace(d,"");b.setAttribute("class",c)}}},add_class:function(b,a){if(!this.has_class(b,a)){if(typeof b.className!="undefined"){b.className+=" "+a}else{var c=b.getAttribute("class");c=c?c+" "+a:a;b.setAttribute("class",c)}}},incremental_elements:null,okay_for_incremental:function(a){if(!this.incremental_elements){var b=new Array();b.p=true;b.pre=true;b.li=true;b.blockquote=true;b.dt=true;b.dd=true;b.h2=true;b.h3=true;b.h4=true;b.h5=true;b.h6=true;b.span=true;b.address=true;b.table=true;b.tr=true;b.th=true;b.td=true;b.img=true;b.object=true;this.incremental_elements=b}return this.incremental_elements[a.toLowerCase()]},next_incremental_item:function(c){var b=this.is_xhtml?"br":"BR";var a=w3c_slidy.slides[w3c_slidy.slide_number];for(;;){c=w3c_slidy.next_node(a,c);if(c==null||c.parentNode==null){break}if(c.nodeType==1){if(c.nodeName==b){continue}if(w3c_slidy.has_class(c,"incremental")&&w3c_slidy.okay_for_incremental(c.nodeName)){return c}if(w3c_slidy.has_class(c.parentNode,"incremental")&&!w3c_slidy.has_class(c,"non-incremental")){return c}}}return c},previous_incremental_item:function(c){var b=this.is_xhtml?"br":"BR";var a=w3c_slidy.slides[w3c_slidy.slide_number];for(;;){c=w3c_slidy.previous_node(a,c);if(c==null||c.parentNode==null){break}if(c.nodeType==1){if(c.nodeName==b){continue}if(w3c_slidy.has_class(c,"incremental")&&w3c_slidy.okay_for_incremental(c.nodeName)){return c}if(w3c_slidy.has_class(c.parentNode,"incremental")&&!w3c_slidy.has_class(c,"non-incremental")){return c}}}return c},set_visibility_all_incremental:function(b){var a=this.next_incremental_item(null);if(b=="hidden"){while(a){w3c_slidy.add_class(a,"invisible");a=w3c_slidy.next_incremental_item(a)}}else{while(a){w3c_slidy.remove_class(a,"invisible");a=w3c_slidy.next_incremental_item(a)}}},reveal_next_item:function(a){a=w3c_slidy.next_incremental_item(a);if(a&&a.nodeType==1){w3c_slidy.remove_class(a,"invisible")}return a},hide_previous_item:function(a){if(a&&a.nodeType==1){w3c_slidy.add_class(a,"invisible")}return this.previous_incremental_item(a)},next_node:function(a,b){if(b==null){return a.firstChild}if(b.firstChild){return b.firstChild}if(b.nextSibling){return b.nextSibling}for(;;){b=b.parentNode;if(!b||b==a){break}if(b&&b.nextSibling){return b.nextSibling}}return null},previous_node:function(a,b){if(b==null){b=a.lastChild;if(b){while(b.lastChild){b=b.lastChild}}return b}if(b.previousSibling){b=b.previousSibling;while(b.lastChild){b=b.lastChild}return b}if(b.parentNode!=a){return b.parentNode}return null},previous_sibling_element:function(a){a=a.previousSibling;while(a&&a.nodeType!=1){a=a.previousSibling}return a},next_sibling_element:function(a){a=a.nextSibling;while(a&&a.nodeType!=1){a=a.nextSibling}return a},first_child_element:function(a){var b;for(b=a.firstChild;b;b=b.nextSibling){if(b.nodeType==1){break}}return b},first_tag:function(b,a){var c;if(!this.is_xhtml){a=a.toUpperCase()}for(c=b.firstChild;c;c=c.nextSibling){if(c.nodeType==1&&c.nodeName==a){break}}return c},hide_selection:function(){if(window.getSelection){var b=window.getSelection();if(b.rangeCount>0){var a=b.getRangeAt(0);a.collapse(false)}}else{var c=document.selection.createRange();c.collapse(false)}},get_selected_text:function(){try{if(window.getSelection){return window.getSelection().toString()}if(document.getSelection){return document.getSelection().toString()}if(document.selection){return document.selection.createRange().text}}catch(a){}return""},mouse_button_up:function(a){w3c_slidy.selected_text_len=w3c_slidy.get_selected_text().length},mouse_button_click:function(g){var c=false;var b=false;var d=false;var f;if(!g){var g=window.event}if(g.target){f=g.target}else{if(g.srcElement){f=g.srcElement}}if(f.nodeType==3){f=f.parentNode}if(g.which){b=(g.which==1);d=(g.which==2);c=(g.which==3)}else{if(g.button){if(g.button==4){d=true}c=(g.button==2)}else{b=true}}if(w3c_slidy.selected_text_len>0){w3c_slidy.stop_propagation(g);g.cancel=true;g.returnValue=false;return false}w3c_slidy.hide_table_of_contents(false);var a=f.nodeName.toLowerCase();if(w3c_slidy.mouse_click_enabled&&b&&!w3c_slidy.special_element(f)&&!f.onclick){w3c_slidy.next_slide(true);w3c_slidy.stop_propagation(g);g.cancel=true;g.returnValue=false;return false}return true},special_element:function(b){var a=b.nodeName.toLowerCase();return b.onkeydown||b.onclick||a=="a"||a=="embed"||a=="object"||a=="video"||a=="audio"||a=="input"||a=="textarea"||a=="select"||a=="option"},slidy_chrome:function(a){while(a){if(a==w3c_slidy.toc||a==w3c_slidy.toolbar||w3c_slidy.has_class(a,"outline")){return true}a=a.parentNode}return false},get_key:function(b){var a;if(typeof window.event!="undefined"){a=window.event.keyCode}else{if(b.which){a=b.which}}return a},get_target:function(b){var a;if(!b){b=window.event}if(b.target){a=b.target}else{if(b.srcElement){a=b.srcElement}}if(a.nodeType!=1){a=a.parentNode}return a},is_block:function(b){var a=b.nodeName.toLowerCase();return a=="ol"||a=="ul"||a=="p"||a=="li"||a=="table"||a=="pre"||a=="h1"||a=="h2"||a=="h3"||a=="h4"||a=="h5"||a=="h6"||a=="blockquote"||a=="address"},add_listener:function(a,c,b){if(window.addEventListener){a.addEventListener(c,b,false)}else{a.attachEvent("on"+c,b)}},stop_propagation:function(a){a=a?a:window.event;a.cancelBubble=true;if(a.stopPropagation){a.stopPropagation()}return true},cancel:function(a){if(a){a.cancel=true;a.returnValue=false;if(a.preventDefault){a.preventDefault()}}w3c_slidy.key_wanted=false;return false},strings_es:{slide:"pág.","help?":"Ayuda","contents?":"Índice","table of contents":"tabla de contenidos","Table of Contents":"Tabla de Contenidos","restart presentation":"Reiniciar presentación","restart?":"Inicio"},help_es:"Utilice el ratón, barra espaciadora, teclas Izda/Dcha, o Re pág y Av pág. Use S y B para cambiar el tamaño de fuente.",strings_ca:{slide:"pàg..","help?":"Ajuda","contents?":"Índex","table of contents":"taula de continguts","Table of Contents":"Taula de Continguts","restart presentation":"Reiniciar presentació","restart?":"Inici"},help_ca:"Utilitzi el ratolí, barra espaiadora, tecles Esq./Dta. o Re pàg y Av pàg. Usi S i B per canviar grandària de font.",strings_cs:{slide:"snímek","help?":"nápověda","contents?":"obsah","table of contents":"obsah prezentace","Table of Contents":"Obsah prezentace","restart presentation":"znovu spustit prezentaci","restart?":"restart"},help_cs:"Prezentaci můžete procházet pomocí kliknutí myši, mezerníku, šipek vlevo a vpravo nebo kláves PageUp a PageDown. Písmo se dá zvětšit a zmenšit pomocí kláves B a S.",strings_nl:{slide:"pagina","help?":"Help?","contents?":"Inhoud?","table of contents":"inhoudsopgave","Table of Contents":"Inhoudsopgave","restart presentation":"herstart presentatie","restart?":"Herstart?"},help_nl:"Navigeer d.m.v. het muis, spatiebar, Links/Rechts toetsen, of PgUp en PgDn. Gebruik S en B om de karaktergrootte te veranderen.",strings_de:{slide:"Seite","help?":"Hilfe","contents?":"Übersicht","table of contents":"Inhaltsverzeichnis","Table of Contents":"Inhaltsverzeichnis","restart presentation":"Präsentation neu starten","restart?":"Neustart"},help_de:"Benutzen Sie die Maus, Leerschlag, die Cursortasten links/rechts oder Page up/Page Down zum Wechseln der Seiten und S und B für die Schriftgrösse.",strings_pl:{slide:"slajd","help?":"pomoc?","contents?":"spis treści?","table of contents":"spis treści","Table of Contents":"Spis Treści","restart presentation":"Restartuj prezentację","restart?":"restart?"},help_pl:"Zmieniaj slajdy klikając myszą, naciskając spację, strzałki lewo/prawolub PgUp / PgDn. Użyj klawiszy S i B, aby zmienić rozmiar czczionki.",strings_fr:{slide:"page","help?":"Aide","contents?":"Index","table of contents":"table des matières","Table of Contents":"Table des matières","restart presentation":"Recommencer l'exposé","restart?":"Début"},help_fr:"Naviguez avec la souris, la barre d'espace, les flèches gauche/droite ou les touches Pg Up, Pg Dn. Utilisez les touches S et B pour modifier la taille de la police.",strings_hu:{slide:"oldal","help?":"segítség","contents?":"tartalom","table of contents":"tartalomjegyzék","Table of Contents":"Tartalomjegyzék","restart presentation":"bemutató újraindítása","restart?":"újraindítás"},help_hu:"Az oldalak közti lépkedéshez kattintson az egérrel, vagy használja a szóköz, a bal, vagy a jobb nyíl, illetve a Page Down, Page Up billentyűket. Az S és a B billentyűkkel változtathatja a szöveg méretét.",strings_it:{slide:"pag.","help?":"Aiuto","contents?":"Indice","table of contents":"indice","Table of Contents":"Indice","restart presentation":"Ricominciare la presentazione","restart?":"Inizio"},help_it:"Navigare con mouse, barra spazio, frecce sinistra/destra o PgUp e PgDn. Usare S e B per cambiare la dimensione dei caratteri.",strings_el:{slide:"σελίδα","help?":"βοήθεια;","contents?":"περιεχόμενα;","table of contents":"πίνακας περιεχομένων","Table of Contents":"Πίνακας Περιεχομένων","restart presentation":"επανεκκίνηση παρουσίασης","restart?":"επανεκκίνηση;"},help_el:"Πλοηγηθείτε με το κλίκ του ποντικιού, το space, τα βέλη αριστερά/δεξιά, ή Page Up και Page Down. Χρησιμοποιήστε τα πλήκτρα S και B για να αλλάξετε το μέγεθος της γραμματοσειράς.",strings_ja:{slide:"スライド","help?":"ヘルプ","contents?":"目次","table of contents":"目次を表示","Table of Contents":"目次","restart presentation":"最初から再生","restart?":"最初から"},help_ja:"マウス左クリック ・ スペース ・ 左右キー または Page Up ・ Page Downで操作, S ・ Bでフォントサイズ変更",strings_zh:{slide:"幻灯片","help?":"帮助?","contents?":"内容?","table of contents":"目录","Table of Contents":"目录","restart presentation":"重新启动展示","restart?":"重新启动?"},help_zh:"用鼠标点击, 空格条, 左右箭头, Pg Up 和 Pg Dn 导航. 用 S, B 改变字体大小.",strings_ru:{slide:"слайд","help?":"помощь?","contents?":"содержание?","table of contents":"оглавление","Table of Contents":"Оглавление","restart presentation":"перезапустить презентацию","restart?":"перезапуск?"},help_ru:"Перемещайтесь кликая мышкой, используя клавишу пробел, стрелкивлево/вправо или Pg Up и Pg Dn. Клавиши S и B меняют размер шрифта.",strings_sv:{slide:"sida","help?":"hjälp","contents?":"innehåll","table of contents":"innehållsförteckning","Table of Contents":"Innehållsförteckning","restart presentation":"visa presentationen från början","restart?":"börja om"},help_sv:"Bläddra med ett klick med vänstra musknappen, mellanslagstangenten, vänster- och högerpiltangenterna eller tangenterna Pg Up, Pg Dn. Använd tangenterna S och B för att ändra textens storlek.",strings:{},localize:function(d){if(d==""){return d}var b,c=w3c_slidy.strings[w3c_slidy.lang];if(c){b=c[d];if(b){return b}}var a=w3c_slidy.lang.split("-");if(a.length>1){c=w3c_slidy.strings[a[0]];if(c){b=c[d];if(b){return b}}}return d},init_localization:function(){var b=w3c_slidy;var a=w3c_slidy.help_text;this.strings={es:this.strings_es,ca:this.strings_ca,cs:this.strings_cs,nl:this.strings_nl,de:this.strings_de,pl:this.strings_pl,fr:this.strings_fr,hu:this.strings_hu,it:this.strings_it,el:this.strings_el,jp:this.strings_ja,zh:this.strings_zh,ru:this.strings_ru,sv:this.strings_sv},b.strings_es[a]=b.help_es;b.strings_ca[a]=b.help_ca;b.strings_cs[a]=b.help_cs;b.strings_nl[a]=b.help_nl;b.strings_de[a]=b.help_de;b.strings_pl[a]=b.help_pl;b.strings_fr[a]=b.help_fr;b.strings_hu[a]=b.help_hu;b.strings_it[a]=b.help_it;b.strings_el[a]=b.help_el;b.strings_ja[a]=b.help_ja;b.strings_zh[a]=b.help_zh;b.strings_ru[a]=b.help_ru;b.strings_sv[a]=b.help_sv;w3c_slidy.lang=document.body.parentNode.getAttribute("lang");if(!w3c_slidy.lang){w3c_slidy.lang=document.body.parentNode.getAttribute("xml:lang")}if(!w3c_slidy.lang){w3c_slidy.lang="en"}}};if(w3c_slidy.ie6||w3c_slidy.ie7){document.write("<iframe id='historyFrame' src='javascript:\"<html></html>\"' height='1' width='1' style='position:absolute;left:-800px'></iframe>")}w3c_slidy.set_up();setTimeout(w3c_slidy.hide_slides,50); \ No newline at end of file
diff --git a/src/Tests/Readers/Markdown.hs b/src/Tests/Readers/Markdown.hs
index feec8fa65..941762bd0 100644
--- a/src/Tests/Readers/Markdown.hs
+++ b/src/Tests/Readers/Markdown.hs
@@ -8,10 +8,14 @@ import Tests.Arbitrary()
import Text.Pandoc.Builder
-- import Text.Pandoc.Shared ( normalize )
import Text.Pandoc
+import Data.Sequence (singleton)
markdown :: String -> Pandoc
markdown = readMarkdown defaultParserState{ stateStandalone = True }
+markdownSmart :: String -> Pandoc
+markdownSmart = readMarkdown defaultParserState{ stateSmart = True }
+
infix 5 =:
(=:) :: ToString c
=> String -> (String, c) -> Test
@@ -40,6 +44,22 @@ tests = [ testGroup "inline code"
"`*` {.haskell .special x=\"7\"}"
=?> para (codeWith ("",["haskell","special"],[("x","7")]) "*")
]
+ , testGroup "smart punctuation"
+ [ test markdownSmart "quote before ellipses"
+ ("'...hi'"
+ =?> para (singleQuoted (singleton Ellipses +++ "hi")))
+ ]
+ , testGroup "mixed emphasis and strong"
+ [ "emph and strong emph alternating" =:
+ "*xxx* ***xxx*** xxx\n*xxx* ***xxx*** xxx"
+ =?> para (emph "xxx" +++ space +++ strong (emph "xxx") +++
+ space +++ "xxx" +++ space +++
+ emph "xxx" +++ space +++ strong (emph "xxx") +++
+ space +++ "xxx")
+ , "emph with spaced strong" =:
+ "*x **xx** x*"
+ =?> para (emph ("x" +++ space +++ strong "xx" +++ space +++ "x"))
+ ]
, testGroup "footnotes"
[ "indent followed by newline and flush-left text" =:
"[^1]\n\n[^1]: my note\n\n \nnot in note\n"
@@ -47,6 +67,19 @@ tests = [ testGroup "inline code"
, "indent followed by newline and indented text" =:
"[^1]\n\n[^1]: my note\n \n in note\n"
=?> para (note (para "my note" +++ para "in note"))
+ , "recursive note" =:
+ "[^1]\n\n[^1]: See [^1]\n"
+ =?> para (note (para "See [^1]"))
+ ]
+ , testGroup "lhs"
+ [ test (readMarkdown defaultParserState{stateLiterateHaskell = True})
+ "inverse bird tracks and html" $
+ "> a\n\n< b\n\n<div>\n"
+ =?> codeBlockWith ("",["sourceCode","literate","haskell"],[]) "a"
+ +++
+ codeBlockWith ("",["sourceCode","haskell"],[]) "b"
+ +++
+ rawBlock "html" "<div>\n\n"
]
-- the round-trip properties frequently fail
-- , testGroup "round trip"
diff --git a/src/Tests/Readers/RST.hs b/src/Tests/Readers/RST.hs
index c0f60ff51..4b8c9301b 100644
--- a/src/Tests/Readers/RST.hs
+++ b/src/Tests/Readers/RST.hs
@@ -17,7 +17,10 @@ infix 5 =:
(=:) = test rst
tests :: [Test]
-tests = [ "field list" =:
+tests = [ "line block with blank line" =:
+ "| a\n|\n| b" =?> para (str "a" +++ linebreak +++
+ linebreak +++ str " " +++ str "b")
+ , "field list" =:
[_LIT|
:Hostname: media08
:IP address: 10.0.0.19
@@ -32,6 +35,8 @@ tests = [ "field list" =:
with the first line, but they must be indented relative to the
field name marker, and they must line up with each other.
:Parameter i: integer
+:Final: item
+ on two lines
|] =?> ( setAuthors ["Me","Myself","I"]
$ setDate "2001-08-16"
$ doc
@@ -41,6 +46,15 @@ tests = [ "field list" =:
, (str "Version", [para "1"])
, (str "Indentation", [para "Since the field marker may be quite long, the second and subsequent lines of the field body do not have to line up with the first line, but they must be indented relative to the field name marker, and they must line up with each other."])
, (str "Parameter i", [para "integer"])
+ , (str "Final", [para "item on two lines"])
])
+ , "URLs with following punctuation" =:
+ ("http://google.com, http://yahoo.com; http://foo.bar.baz.\n" ++
+ "http://foo.bar/baz_(bam) (http://foo.bar)") =?>
+ para (link "http://google.com" "" "http://google.com" +++ ", " +++
+ link "http://yahoo.com" "" "http://yahoo.com" +++ "; " +++
+ link "http://foo.bar.baz" "" "http://foo.bar.baz" +++ ". " +++
+ link "http://foo.bar/baz_(bam)" "" "http://foo.bar/baz_(bam)"
+ +++ " (" +++ link "http://foo.bar" "" "http://foo.bar" +++ ")")
]
diff --git a/src/Tests/Writers/Markdown.hs b/src/Tests/Writers/Markdown.hs
new file mode 100644
index 000000000..70266a683
--- /dev/null
+++ b/src/Tests/Writers/Markdown.hs
@@ -0,0 +1,34 @@
+{-# LANGUAGE OverloadedStrings, QuasiQuotes #-}
+module Tests.Writers.Markdown (tests) where
+
+import Test.Framework
+import Text.Pandoc.Builder
+import Text.Pandoc
+import Tests.Helpers
+import Tests.Arbitrary()
+
+markdown :: (ToString a, ToPandoc a) => a -> String
+markdown = writeMarkdown defaultWriterOptions . toPandoc
+
+{-
+ "my test" =: X =?> Y
+
+is shorthand for
+
+ test markdown "my test" $ X =?> Y
+
+which is in turn shorthand for
+
+ test markdown "my test" (X,Y)
+-}
+
+infix 5 =:
+(=:) :: (ToString a, ToPandoc a)
+ => String -> (a, String) -> Test
+(=:) = test markdown
+
+tests :: [Test]
+tests = [ "indented code after list"
+ =: (orderedList [ para "one" +++ para "two" ] +++ codeBlock "test")
+ =?> "1. one\n\n two\n\n<!-- -->\n\n test"
+ ]
diff --git a/src/Text/Pandoc/MIME.hs b/src/Text/Pandoc/MIME.hs
new file mode 100644
index 000000000..c52a4c475
--- /dev/null
+++ b/src/Text/Pandoc/MIME.hs
@@ -0,0 +1,483 @@
+{-
+Copyright (C) 2011 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.MIME
+ Copyright : Copyright (C) 2011 John MacFarlane
+ License : GNU GPL, version 2 or above
+
+ Maintainer : John MacFarlane <jgm@berkeley.edu>
+ Stability : alpha
+ Portability : portable
+
+Mime type lookup for ODT writer.
+-}
+module Text.Pandoc.MIME ( getMimeType )
+where
+import System.FilePath
+import Data.Char ( toLower )
+import qualified Data.Map as M
+
+-- | Determine mime type appropriate for file path.
+getMimeType :: FilePath -> Maybe String
+getMimeType f = M.lookup (map toLower $ drop 1 $ takeExtension f) mimeTypes
+ where mimeTypes = M.fromList -- List borrowed from happstack-server.
+ [("gz","application/x-gzip")
+ ,("cabal","application/x-cabal")
+ ,("%","application/x-trash")
+ ,("323","text/h323")
+ ,("3gp","video/3gpp")
+ ,("7z","application/x-7z-compressed")
+ ,("abw","application/x-abiword")
+ ,("ai","application/postscript")
+ ,("aif","audio/x-aiff")
+ ,("aifc","audio/x-aiff")
+ ,("aiff","audio/x-aiff")
+ ,("alc","chemical/x-alchemy")
+ ,("art","image/x-jg")
+ ,("asc","text/plain")
+ ,("asf","video/x-ms-asf")
+ ,("asn","chemical/x-ncbi-asn1")
+ ,("aso","chemical/x-ncbi-asn1-binary")
+ ,("asx","video/x-ms-asf")
+ ,("atom","application/atom")
+ ,("atomcat","application/atomcat+xml")
+ ,("atomsrv","application/atomserv+xml")
+ ,("au","audio/basic")
+ ,("avi","video/x-msvideo")
+ ,("b","chemical/x-molconn-Z")
+ ,("bak","application/x-trash")
+ ,("bat","application/x-msdos-program")
+ ,("bcpio","application/x-bcpio")
+ ,("bib","text/x-bibtex")
+ ,("bin","application/octet-stream")
+ ,("bmp","image/x-ms-bmp")
+ ,("boo","text/x-boo")
+ ,("book","application/x-maker")
+ ,("bsd","chemical/x-crossfire")
+ ,("c","text/x-csrc")
+ ,("c++","text/x-c++src")
+ ,("c3d","chemical/x-chem3d")
+ ,("cab","application/x-cab")
+ ,("cac","chemical/x-cache")
+ ,("cache","chemical/x-cache")
+ ,("cap","application/cap")
+ ,("cascii","chemical/x-cactvs-binary")
+ ,("cat","application/vnd.ms-pki.seccat")
+ ,("cbin","chemical/x-cactvs-binary")
+ ,("cbr","application/x-cbr")
+ ,("cbz","application/x-cbz")
+ ,("cc","text/x-c++src")
+ ,("cdf","application/x-cdf")
+ ,("cdr","image/x-coreldraw")
+ ,("cdt","image/x-coreldrawtemplate")
+ ,("cdx","chemical/x-cdx")
+ ,("cdy","application/vnd.cinderella")
+ ,("cef","chemical/x-cxf")
+ ,("cer","chemical/x-cerius")
+ ,("chm","chemical/x-chemdraw")
+ ,("chrt","application/x-kchart")
+ ,("cif","chemical/x-cif")
+ ,("class","application/java-vm")
+ ,("cls","text/x-tex")
+ ,("cmdf","chemical/x-cmdf")
+ ,("cml","chemical/x-cml")
+ ,("cod","application/vnd.rim.cod")
+ ,("com","application/x-msdos-program")
+ ,("cpa","chemical/x-compass")
+ ,("cpio","application/x-cpio")
+ ,("cpp","text/x-c++src")
+ ,("cpt","application/mac-compactpro")
+ ,("crl","application/x-pkcs7-crl")
+ ,("crt","application/x-x509-ca-cert")
+ ,("csf","chemical/x-cache-csf")
+ ,("csh","application/x-csh")
+ ,("csm","chemical/x-csml")
+ ,("csml","chemical/x-csml")
+ ,("css","text/css")
+ ,("csv","text/csv")
+ ,("ctab","chemical/x-cactvs-binary")
+ ,("ctx","chemical/x-ctx")
+ ,("cu","application/cu-seeme")
+ ,("cub","chemical/x-gaussian-cube")
+ ,("cxf","chemical/x-cxf")
+ ,("cxx","text/x-c++src")
+ ,("d","text/x-dsrc")
+ ,("dat","chemical/x-mopac-input")
+ ,("dcr","application/x-director")
+ ,("deb","application/x-debian-package")
+ ,("dif","video/dv")
+ ,("diff","text/x-diff")
+ ,("dir","application/x-director")
+ ,("djv","image/vnd.djvu")
+ ,("djvu","image/vnd.djvu")
+ ,("dl","video/dl")
+ ,("dll","application/x-msdos-program")
+ ,("dmg","application/x-apple-diskimage")
+ ,("dms","application/x-dms")
+ ,("doc","application/msword")
+ ,("dot","application/msword")
+ ,("dv","video/dv")
+ ,("dvi","application/x-dvi")
+ ,("dx","chemical/x-jcamp-dx")
+ ,("dxr","application/x-director")
+ ,("emb","chemical/x-embl-dl-nucleotide")
+ ,("embl","chemical/x-embl-dl-nucleotide")
+ ,("eml","message/rfc822")
+ ,("ent","chemical/x-ncbi-asn1-ascii")
+ ,("eps","application/postscript")
+ ,("etx","text/x-setext")
+ ,("exe","application/x-msdos-program")
+ ,("ez","application/andrew-inset")
+ ,("fb","application/x-maker")
+ ,("fbdoc","application/x-maker")
+ ,("fch","chemical/x-gaussian-checkpoint")
+ ,("fchk","chemical/x-gaussian-checkpoint")
+ ,("fig","application/x-xfig")
+ ,("flac","application/x-flac")
+ ,("fli","video/fli")
+ ,("fm","application/x-maker")
+ ,("frame","application/x-maker")
+ ,("frm","application/x-maker")
+ ,("gal","chemical/x-gaussian-log")
+ ,("gam","chemical/x-gamess-input")
+ ,("gamin","chemical/x-gamess-input")
+ ,("gau","chemical/x-gaussian-input")
+ ,("gcd","text/x-pcs-gcd")
+ ,("gcf","application/x-graphing-calculator")
+ ,("gcg","chemical/x-gcg8-sequence")
+ ,("gen","chemical/x-genbank")
+ ,("gf","application/x-tex-gf")
+ ,("gif","image/gif")
+ ,("gjc","chemical/x-gaussian-input")
+ ,("gjf","chemical/x-gaussian-input")
+ ,("gl","video/gl")
+ ,("gnumeric","application/x-gnumeric")
+ ,("gpt","chemical/x-mopac-graph")
+ ,("gsf","application/x-font")
+ ,("gsm","audio/x-gsm")
+ ,("gtar","application/x-gtar")
+ ,("h","text/x-chdr")
+ ,("h++","text/x-c++hdr")
+ ,("hdf","application/x-hdf")
+ ,("hh","text/x-c++hdr")
+ ,("hin","chemical/x-hin")
+ ,("hpp","text/x-c++hdr")
+ ,("hqx","application/mac-binhex40")
+ ,("hs","text/x-haskell")
+ ,("hta","application/hta")
+ ,("htc","text/x-component")
+ ,("htm","text/html")
+ ,("html","text/html")
+ ,("hxx","text/x-c++hdr")
+ ,("ica","application/x-ica")
+ ,("ice","x-conference/x-cooltalk")
+ ,("ico","image/x-icon")
+ ,("ics","text/calendar")
+ ,("icz","text/calendar")
+ ,("ief","image/ief")
+ ,("iges","model/iges")
+ ,("igs","model/iges")
+ ,("iii","application/x-iphone")
+ ,("inp","chemical/x-gamess-input")
+ ,("ins","application/x-internet-signup")
+ ,("iso","application/x-iso9660-image")
+ ,("isp","application/x-internet-signup")
+ ,("ist","chemical/x-isostar")
+ ,("istr","chemical/x-isostar")
+ ,("jad","text/vnd.sun.j2me.app-descriptor")
+ ,("jar","application/java-archive")
+ ,("java","text/x-java")
+ ,("jdx","chemical/x-jcamp-dx")
+ ,("jmz","application/x-jmol")
+ ,("jng","image/x-jng")
+ ,("jnlp","application/x-java-jnlp-file")
+ ,("jpe","image/jpeg")
+ ,("jpeg","image/jpeg")
+ ,("jpg","image/jpeg")
+ ,("js","application/x-javascript")
+ ,("kar","audio/midi")
+ ,("key","application/pgp-keys")
+ ,("kil","application/x-killustrator")
+ ,("kin","chemical/x-kinemage")
+ ,("kml","application/vnd.google-earth.kml+xml")
+ ,("kmz","application/vnd.google-earth.kmz")
+ ,("kpr","application/x-kpresenter")
+ ,("kpt","application/x-kpresenter")
+ ,("ksp","application/x-kspread")
+ ,("kwd","application/x-kword")
+ ,("kwt","application/x-kword")
+ ,("latex","application/x-latex")
+ ,("lha","application/x-lha")
+ ,("lhs","text/x-literate-haskell")
+ ,("lsf","video/x-la-asf")
+ ,("lsx","video/x-la-asf")
+ ,("ltx","text/x-tex")
+ ,("lyx","application/x-lyx")
+ ,("lzh","application/x-lzh")
+ ,("lzx","application/x-lzx")
+ ,("m3u","audio/mpegurl")
+ ,("m4a","audio/mpeg")
+ ,("maker","application/x-maker")
+ ,("man","application/x-troff-man")
+ ,("mcif","chemical/x-mmcif")
+ ,("mcm","chemical/x-macmolecule")
+ ,("mdb","application/msaccess")
+ ,("me","application/x-troff-me")
+ ,("mesh","model/mesh")
+ ,("mid","audio/midi")
+ ,("midi","audio/midi")
+ ,("mif","application/x-mif")
+ ,("mm","application/x-freemind")
+ ,("mmd","chemical/x-macromodel-input")
+ ,("mmf","application/vnd.smaf")
+ ,("mml","text/mathml")
+ ,("mmod","chemical/x-macromodel-input")
+ ,("mng","video/x-mng")
+ ,("moc","text/x-moc")
+ ,("mol","chemical/x-mdl-molfile")
+ ,("mol2","chemical/x-mol2")
+ ,("moo","chemical/x-mopac-out")
+ ,("mop","chemical/x-mopac-input")
+ ,("mopcrt","chemical/x-mopac-input")
+ ,("mov","video/quicktime")
+ ,("movie","video/x-sgi-movie")
+ ,("mp2","audio/mpeg")
+ ,("mp3","audio/mpeg")
+ ,("mp4","video/mp4")
+ ,("mpc","chemical/x-mopac-input")
+ ,("mpe","video/mpeg")
+ ,("mpeg","video/mpeg")
+ ,("mpega","audio/mpeg")
+ ,("mpg","video/mpeg")
+ ,("mpga","audio/mpeg")
+ ,("ms","application/x-troff-ms")
+ ,("msh","model/mesh")
+ ,("msi","application/x-msi")
+ ,("mvb","chemical/x-mopac-vib")
+ ,("mxu","video/vnd.mpegurl")
+ ,("nb","application/mathematica")
+ ,("nc","application/x-netcdf")
+ ,("nwc","application/x-nwc")
+ ,("o","application/x-object")
+ ,("oda","application/oda")
+ ,("odb","application/vnd.oasis.opendocument.database")
+ ,("odc","application/vnd.oasis.opendocument.chart")
+ ,("odf","application/vnd.oasis.opendocument.formula")
+ ,("odg","application/vnd.oasis.opendocument.graphics")
+ ,("odi","application/vnd.oasis.opendocument.image")
+ ,("odm","application/vnd.oasis.opendocument.text-master")
+ ,("odp","application/vnd.oasis.opendocument.presentation")
+ ,("ods","application/vnd.oasis.opendocument.spreadsheet")
+ ,("odt","application/vnd.oasis.opendocument.text")
+ ,("oga","audio/ogg")
+ ,("ogg","application/ogg")
+ ,("ogv","video/ogg")
+ ,("ogx","application/ogg")
+ ,("old","application/x-trash")
+ ,("otg","application/vnd.oasis.opendocument.graphics-template")
+ ,("oth","application/vnd.oasis.opendocument.text-web")
+ ,("otp","application/vnd.oasis.opendocument.presentation-template")
+ ,("ots","application/vnd.oasis.opendocument.spreadsheet-template")
+ ,("ott","application/vnd.oasis.opendocument.text-template")
+ ,("oza","application/x-oz-application")
+ ,("p","text/x-pascal")
+ ,("p7r","application/x-pkcs7-certreqresp")
+ ,("pac","application/x-ns-proxy-autoconfig")
+ ,("pas","text/x-pascal")
+ ,("pat","image/x-coreldrawpattern")
+ ,("patch","text/x-diff")
+ ,("pbm","image/x-portable-bitmap")
+ ,("pcap","application/cap")
+ ,("pcf","application/x-font")
+ ,("pcf.Z","application/x-font")
+ ,("pcx","image/pcx")
+ ,("pdb","chemical/x-pdb")
+ ,("pdf","application/pdf")
+ ,("pfa","application/x-font")
+ ,("pfb","application/x-font")
+ ,("pgm","image/x-portable-graymap")
+ ,("pgn","application/x-chess-pgn")
+ ,("pgp","application/pgp-signature")
+ ,("php","application/x-httpd-php")
+ ,("php3","application/x-httpd-php3")
+ ,("php3p","application/x-httpd-php3-preprocessed")
+ ,("php4","application/x-httpd-php4")
+ ,("phps","application/x-httpd-php-source")
+ ,("pht","application/x-httpd-php")
+ ,("phtml","application/x-httpd-php")
+ ,("pk","application/x-tex-pk")
+ ,("pl","text/x-perl")
+ ,("pls","audio/x-scpls")
+ ,("pm","text/x-perl")
+ ,("png","image/png")
+ ,("pnm","image/x-portable-anymap")
+ ,("pot","text/plain")
+ ,("ppm","image/x-portable-pixmap")
+ ,("pps","application/vnd.ms-powerpoint")
+ ,("ppt","application/vnd.ms-powerpoint")
+ ,("prf","application/pics-rules")
+ ,("prt","chemical/x-ncbi-asn1-ascii")
+ ,("ps","application/postscript")
+ ,("psd","image/x-photoshop")
+ ,("py","text/x-python")
+ ,("pyc","application/x-python-code")
+ ,("pyo","application/x-python-code")
+ ,("qt","video/quicktime")
+ ,("qtl","application/x-quicktimeplayer")
+ ,("ra","audio/x-pn-realaudio")
+ ,("ram","audio/x-pn-realaudio")
+ ,("rar","application/rar")
+ ,("ras","image/x-cmu-raster")
+ ,("rd","chemical/x-mdl-rdfile")
+ ,("rdf","application/rdf+xml")
+ ,("rgb","image/x-rgb")
+ ,("rhtml","application/x-httpd-eruby")
+ ,("rm","audio/x-pn-realaudio")
+ ,("roff","application/x-troff")
+ ,("ros","chemical/x-rosdal")
+ ,("rpm","application/x-redhat-package-manager")
+ ,("rss","application/rss+xml")
+ ,("rtf","application/rtf")
+ ,("rtx","text/richtext")
+ ,("rxn","chemical/x-mdl-rxnfile")
+ ,("sct","text/scriptlet")
+ ,("sd","chemical/x-mdl-sdfile")
+ ,("sd2","audio/x-sd2")
+ ,("sda","application/vnd.stardivision.draw")
+ ,("sdc","application/vnd.stardivision.calc")
+ ,("sdd","application/vnd.stardivision.impress")
+ ,("sdf","application/vnd.stardivision.math")
+ ,("sds","application/vnd.stardivision.chart")
+ ,("sdw","application/vnd.stardivision.writer")
+ ,("ser","application/java-serialized-object")
+ ,("sgf","application/x-go-sgf")
+ ,("sgl","application/vnd.stardivision.writer-global")
+ ,("sh","application/x-sh")
+ ,("shar","application/x-shar")
+ ,("shtml","text/html")
+ ,("sid","audio/prs.sid")
+ ,("sik","application/x-trash")
+ ,("silo","model/mesh")
+ ,("sis","application/vnd.symbian.install")
+ ,("sisx","x-epoc/x-sisx-app")
+ ,("sit","application/x-stuffit")
+ ,("sitx","application/x-stuffit")
+ ,("skd","application/x-koan")
+ ,("skm","application/x-koan")
+ ,("skp","application/x-koan")
+ ,("skt","application/x-koan")
+ ,("smi","application/smil")
+ ,("smil","application/smil")
+ ,("snd","audio/basic")
+ ,("spc","chemical/x-galactic-spc")
+ ,("spl","application/futuresplash")
+ ,("spx","audio/ogg")
+ ,("src","application/x-wais-source")
+ ,("stc","application/vnd.sun.xml.calc.template")
+ ,("std","application/vnd.sun.xml.draw.template")
+ ,("sti","application/vnd.sun.xml.impress.template")
+ ,("stl","application/vnd.ms-pki.stl")
+ ,("stw","application/vnd.sun.xml.writer.template")
+ ,("sty","text/x-tex")
+ ,("sv4cpio","application/x-sv4cpio")
+ ,("sv4crc","application/x-sv4crc")
+ ,("svg","image/svg+xml")
+ ,("svgz","image/svg+xml")
+ ,("sw","chemical/x-swissprot")
+ ,("swf","application/x-shockwave-flash")
+ ,("swfl","application/x-shockwave-flash")
+ ,("sxc","application/vnd.sun.xml.calc")
+ ,("sxd","application/vnd.sun.xml.draw")
+ ,("sxg","application/vnd.sun.xml.writer.global")
+ ,("sxi","application/vnd.sun.xml.impress")
+ ,("sxm","application/vnd.sun.xml.math")
+ ,("sxw","application/vnd.sun.xml.writer")
+ ,("t","application/x-troff")
+ ,("tar","application/x-tar")
+ ,("taz","application/x-gtar")
+ ,("tcl","application/x-tcl")
+ ,("tex","text/x-tex")
+ ,("texi","application/x-texinfo")
+ ,("texinfo","application/x-texinfo")
+ ,("text","text/plain")
+ ,("tgf","chemical/x-mdl-tgf")
+ ,("tgz","application/x-gtar")
+ ,("tif","image/tiff")
+ ,("tiff","image/tiff")
+ ,("tk","text/x-tcl")
+ ,("tm","text/texmacs")
+ ,("torrent","application/x-bittorrent")
+ ,("tr","application/x-troff")
+ ,("ts","text/texmacs")
+ ,("tsp","application/dsptype")
+ ,("tsv","text/tab-separated-values")
+ ,("txt","text/plain")
+ ,("udeb","application/x-debian-package")
+ ,("uls","text/iuls")
+ ,("ustar","application/x-ustar")
+ ,("val","chemical/x-ncbi-asn1-binary")
+ ,("vcd","application/x-cdlink")
+ ,("vcf","text/x-vcard")
+ ,("vcs","text/x-vcalendar")
+ ,("vmd","chemical/x-vmd")
+ ,("vms","chemical/x-vamas-iso14976")
+ ,("vrm","x-world/x-vrml")
+ ,("vrml","model/vrml")
+ ,("vsd","application/vnd.visio")
+ ,("wad","application/x-doom")
+ ,("wav","audio/x-wav")
+ ,("wax","audio/x-ms-wax")
+ ,("wbmp","image/vnd.wap.wbmp")
+ ,("wbxml","application/vnd.wap.wbxml")
+ ,("wk","application/x-123")
+ ,("wm","video/x-ms-wm")
+ ,("wma","audio/x-ms-wma")
+ ,("wmd","application/x-ms-wmd")
+ ,("wml","text/vnd.wap.wml")
+ ,("wmlc","application/vnd.wap.wmlc")
+ ,("wmls","text/vnd.wap.wmlscript")
+ ,("wmlsc","application/vnd.wap.wmlscriptc")
+ ,("wmv","video/x-ms-wmv")
+ ,("wmx","video/x-ms-wmx")
+ ,("wmz","application/x-ms-wmz")
+ ,("wp5","application/wordperfect5.1")
+ ,("wpd","application/wordperfect")
+ ,("wrl","model/vrml")
+ ,("wsc","text/scriptlet")
+ ,("wvx","video/x-ms-wvx")
+ ,("wz","application/x-wingz")
+ ,("xbm","image/x-xbitmap")
+ ,("xcf","application/x-xcf")
+ ,("xht","application/xhtml+xml")
+ ,("xhtml","application/xhtml+xml")
+ ,("xlb","application/vnd.ms-excel")
+ ,("xls","application/vnd.ms-excel")
+ ,("xlt","application/vnd.ms-excel")
+ ,("xml","application/xml")
+ ,("xpi","application/x-xpinstall")
+ ,("xpm","image/x-xpixmap")
+ ,("xsl","application/xml")
+ ,("xtel","chemical/x-xtel")
+ ,("xul","application/vnd.mozilla.xul+xml")
+ ,("xwd","image/x-xwindowdump")
+ ,("xyz","chemical/x-xyz")
+ ,("zip","application/zip")
+ ,("zmt","chemical/x-mopac-input")
+ ]
+
diff --git a/src/Text/Pandoc/Parsing.hs b/src/Text/Pandoc/Parsing.hs
index 9ce064f91..eaf0c0f67 100644
--- a/src/Text/Pandoc/Parsing.hs
+++ b/src/Text/Pandoc/Parsing.hs
@@ -33,6 +33,7 @@ module Text.Pandoc.Parsing ( (>>~),
notFollowedBy',
oneOfStrings,
spaceChar,
+ nonspaceChar,
skipSpaces,
blankline,
blanklines,
@@ -78,7 +79,7 @@ import Text.Pandoc.Generic
import qualified Text.Pandoc.UTF8 as UTF8 (putStrLn)
import Text.ParserCombinators.Parsec
import Text.Pandoc.CharacterReferences ( characterReference )
-import Data.Char ( toLower, toUpper, ord, isAscii, isAlphaNum, isDigit )
+import Data.Char ( toLower, toUpper, ord, isAscii, isAlphaNum, isDigit, isPunctuation )
import Data.List ( intercalate, transpose )
import Network.URI ( parseURI, URI (..), isAllowedInURI )
import Control.Monad ( join, liftM, guard )
@@ -122,6 +123,10 @@ oneOfStrings listOfStrings = choice $ map (try . string) listOfStrings
spaceChar :: CharParser st Char
spaceChar = satisfy $ \c -> c == ' ' || c == '\t'
+-- | Parses a nonspace, nonnewline character.
+nonspaceChar :: CharParser st Char
+nonspaceChar = satisfy $ \x -> x /= '\t' && x /= '\n' && x /= ' ' && x /= '\r'
+
-- | Skips zero or more spaces or tabs.
skipSpaces :: GenParser Char st ()
skipSpaces = skipMany spaceChar
@@ -264,8 +269,24 @@ uri = try $ do
let protocols = [ "http:", "https:", "ftp:", "file:", "mailto:",
"news:", "telnet:" ]
lookAhead $ oneOfStrings protocols
- -- scan non-ascii characters and ascii characters allowed in a URI
- str <- many1 $ satisfy (\c -> not (isAscii c) || isAllowedInURI c)
+ -- Scan non-ascii characters and ascii characters allowed in a URI.
+ -- We allow punctuation except when followed by a space, since
+ -- we don't want the trailing '.' in 'http://google.com.'
+ let innerPunct = try $ satisfy isPunctuation >>~
+ notFollowedBy (newline <|> spaceChar)
+ let uriChar = innerPunct <|>
+ satisfy (\c -> not (isPunctuation c) &&
+ (not (isAscii c) || isAllowedInURI c))
+ -- We want to allow
+ -- http://en.wikipedia.org/wiki/State_of_emergency_(disambiguation)
+ -- as a URL, while NOT picking up the closing paren in
+ -- (http://wikipedia.org)
+ -- So we include balanced parens in the URL.
+ let inParens = try $ do char '('
+ res <- many uriChar
+ char ')'
+ return $ '(' : res ++ ")"
+ str <- liftM concat $ many1 $ inParens <|> count 1 (innerPunct <|> uriChar)
-- now see if they amount to an absolute URI
case parseURI (escapeURI str) of
Just uri' -> if uriScheme uri' `elem` protocols
@@ -742,8 +763,9 @@ charOrRef cs =
singleQuoteStart :: GenParser Char ParserState ()
singleQuoteStart = do
failIfInQuoteContext InSingleQuote
- try $ do charOrRef "'\8216"
- notFollowedBy (oneOf ")!],.;:-? \t\n")
+ try $ do charOrRef "'\8216\145"
+ notFollowedBy (oneOf ")!],;:-? \t\n")
+ notFollowedBy (char '.') <|> lookAhead (string "..." >> return ())
notFollowedBy (try (oneOfStrings ["s","t","m","ve","ll","re"] >>
satisfy (not . isAlphaNum)))
-- possess/contraction
@@ -751,23 +773,23 @@ singleQuoteStart = do
singleQuoteEnd :: GenParser Char st ()
singleQuoteEnd = try $ do
- charOrRef "'\8217"
+ charOrRef "'\8217\146"
notFollowedBy alphaNum
doubleQuoteStart :: GenParser Char ParserState ()
doubleQuoteStart = do
failIfInQuoteContext InDoubleQuote
- try $ do charOrRef "\"\8220"
+ try $ do charOrRef "\"\8220\147"
notFollowedBy (satisfy (\c -> c == ' ' || c == '\t' || c == '\n'))
doubleQuoteEnd :: GenParser Char st ()
doubleQuoteEnd = do
- charOrRef "\"\8221"
+ charOrRef "\"\8221\148"
return ()
ellipses :: GenParser Char st Inline
ellipses = do
- try (charOrRef "…") <|> try (string "..." >> return '…')
+ try (charOrRef "…\133") <|> try (string "..." >> return '…')
return Ellipses
dash :: GenParser Char st Inline
@@ -775,13 +797,13 @@ dash = enDash <|> emDash
enDash :: GenParser Char st Inline
enDash = do
- try (charOrRef "–") <|>
+ try (charOrRef "–\150") <|>
try (char '-' >> lookAhead (satisfy isDigit) >> return '–')
return EnDash
emDash :: GenParser Char st Inline
emDash = do
- try (charOrRef "—") <|> (try $ string "--" >> optional (char '-') >> return '—')
+ try (charOrRef "—\151") <|> (try $ string "--" >> optional (char '-') >> return '—')
return EmDash
--
diff --git a/src/Text/Pandoc/Readers/HTML.hs b/src/Text/Pandoc/Readers/HTML.hs
index 18e3113d3..7c882f680 100644
--- a/src/Text/Pandoc/Readers/HTML.hs
+++ b/src/Text/Pandoc/Readers/HTML.hs
@@ -47,7 +47,7 @@ import Text.Pandoc.Parsing
import Data.Maybe ( fromMaybe, isJust )
import Data.List ( intercalate )
import Data.Char ( isSpace, isDigit )
-import Control.Monad ( liftM, guard )
+import Control.Monad ( liftM, guard, when )
-- | Convert HTML-formatted string to 'Pandoc' document.
readHtml :: ParserState -- ^ Parser state
@@ -75,7 +75,7 @@ parseHeader tags = (Meta{docTitle = tit'', docAuthors = [], docDate = []}, rest)
t ~== TagOpen "body" []) tags
parseBody :: TagParser [Block]
-parseBody = liftM concat $ manyTill block eof
+parseBody = liftM (fixPlains False . concat) $ manyTill block eof
block :: TagParser [Block]
block = choice
@@ -107,7 +107,7 @@ pBulletList = try $ do
-- treat it as a list item, though it's not valid xhtml...
skipMany nonItem
items <- manyTill (pInTags "li" block >>~ skipMany nonItem) (pCloses "ul")
- return [BulletList items]
+ return [BulletList $ map (fixPlains True) items]
pOrderedList :: TagParser [Block]
pOrderedList = try $ do
@@ -138,7 +138,7 @@ pOrderedList = try $ do
-- treat it as a list item, though it's not valid xhtml...
skipMany nonItem
items <- manyTill (pInTags "li" block >>~ skipMany nonItem) (pCloses "ol")
- return [OrderedList (start, style, DefaultDelim) items]
+ return [OrderedList (start, style, DefaultDelim) $ map (fixPlains True) items]
pDefinitionList :: TagParser [Block]
pDefinitionList = try $ do
@@ -154,7 +154,22 @@ pDefListItem = try $ do
defs <- many1 (try $ skipMany nonItem >> pInTags "dd" block)
skipMany nonItem
let term = intercalate [LineBreak] terms
- return (term, defs)
+ return (term, map (fixPlains True) defs)
+
+fixPlains :: Bool -> [Block] -> [Block]
+fixPlains inList bs = if any isParaish bs
+ then map plainToPara bs
+ else bs
+ where isParaish (Para _) = True
+ isParaish (CodeBlock _ _) = True
+ isParaish (Header _ _) = True
+ isParaish (BlockQuote _) = True
+ isParaish (BulletList _) = not inList
+ isParaish (OrderedList _ _) = not inList
+ isParaish (DefinitionList _) = not inList
+ isParaish _ = False
+ plainToPara (Plain xs) = Para xs
+ plainToPara x = x
pRawTag :: TagParser String
pRawTag = do
@@ -199,9 +214,9 @@ pSimpleTable :: TagParser [Block]
pSimpleTable = try $ do
TagOpen _ _ <- pSatisfy (~== TagOpen "table" [])
skipMany pBlank
- head' <- option [] $ pInTags "th" pTd
- rows <- many1 $ try $
- skipMany pBlank >> pInTags "tr" pTd
+ head' <- option [] $ pOptInTag "thead" $ pInTags "tr" (pCell "th")
+ rows <- pOptInTag "tbody"
+ $ many1 $ try $ skipMany pBlank >> pInTags "tr" (pCell "td")
skipMany pBlank
TagClose _ <- pSatisfy (~== TagClose "table")
let cols = maximum $ map length rows
@@ -209,17 +224,17 @@ pSimpleTable = try $ do
let widths = replicate cols 0
return [Table [] aligns widths head' rows]
-pTd :: TagParser [TableCell]
-pTd = try $ do
+pCell :: String -> TagParser [TableCell]
+pCell celltype = try $ do
skipMany pBlank
- res <- pInTags "td" pPlain
+ res <- pInTags celltype pPlain
skipMany pBlank
return [res]
pBlockQuote :: TagParser [Block]
pBlockQuote = do
contents <- pInTags "blockquote" block
- return [BlockQuote contents]
+ return [BlockQuote $ fixPlains False contents]
pPlain :: TagParser [Block]
pPlain = do
@@ -358,7 +373,7 @@ pInlinesInTags :: String -> ([Inline] -> Inline)
-> TagParser [Inline]
pInlinesInTags tagtype f = do
contents <- pInTags tagtype inline
- return [f contents]
+ return [f $ normalizeSpaces contents]
pInTags :: String -> TagParser [a]
-> TagParser [a]
@@ -366,6 +381,16 @@ pInTags tagtype parser = try $ do
pSatisfy (~== TagOpen tagtype [])
liftM concat $ manyTill parser (pCloses tagtype <|> eof)
+pOptInTag :: String -> TagParser a
+ -> TagParser a
+pOptInTag tagtype parser = try $ do
+ open <- option False (pSatisfy (~== TagOpen tagtype []) >> return True)
+ skipMany pBlank
+ x <- parser
+ skipMany pBlank
+ when open $ pCloses tagtype
+ return x
+
pCloses :: String -> TagParser ()
pCloses tagtype = try $ do
t <- lookAhead $ pSatisfy $ \tag -> isTagClose tag || isTagOpen tag
@@ -391,10 +416,12 @@ pBlank = try $ do
guard $ all isSpace str
pTagContents :: GenParser Char ParserState Inline
-pTagContents = pStr <|> pSpace <|> smartPunctuation pTagContents <|> pSymbol
+pTagContents =
+ pStr <|> pSpace <|> smartPunctuation pTagContents <|> pSymbol <|> pBad
pStr :: GenParser Char ParserState Inline
-pStr = liftM Str $ many1 $ satisfy $ \c -> not (isSpace c) && not (isSpecial c)
+pStr = liftM Str $ many1 $ satisfy $ \c ->
+ not (isSpace c) && not (isSpecial c) && not (isBad c)
isSpecial :: Char -> Bool
isSpecial '"' = True
@@ -410,6 +437,43 @@ isSpecial _ = False
pSymbol :: GenParser Char ParserState Inline
pSymbol = satisfy isSpecial >>= return . Str . (:[])
+isBad :: Char -> Bool
+isBad c = c >= '\128' && c <= '\159' -- not allowed in HTML
+
+pBad :: GenParser Char ParserState Inline
+pBad = do
+ c <- satisfy isBad
+ let c' = case c of
+ '\128' -> '\8364'
+ '\130' -> '\8218'
+ '\131' -> '\402'
+ '\132' -> '\8222'
+ '\133' -> '\8230'
+ '\134' -> '\8224'
+ '\135' -> '\8225'
+ '\136' -> '\710'
+ '\137' -> '\8240'
+ '\138' -> '\352'
+ '\139' -> '\8249'
+ '\140' -> '\338'
+ '\142' -> '\381'
+ '\145' -> '\8216'
+ '\146' -> '\8217'
+ '\147' -> '\8220'
+ '\148' -> '\8221'
+ '\149' -> '\8226'
+ '\150' -> '\8211'
+ '\151' -> '\8212'
+ '\152' -> '\732'
+ '\153' -> '\8482'
+ '\154' -> '\353'
+ '\155' -> '\8250'
+ '\156' -> '\339'
+ '\158' -> '\382'
+ '\159' -> '\376'
+ _ -> '?'
+ return $ Str [c']
+
pSpace :: GenParser Char ParserState Inline
pSpace = many1 (satisfy isSpace) >> return Space
diff --git a/src/Text/Pandoc/Readers/LaTeX.hs b/src/Text/Pandoc/Readers/LaTeX.hs
index dca745b56..02c7361d7 100644
--- a/src/Text/Pandoc/Readers/LaTeX.hs
+++ b/src/Text/Pandoc/Readers/LaTeX.hs
@@ -391,7 +391,7 @@ para = do
--
bibliographic :: GenParser Char ParserState Block
-bibliographic = choice [ maketitle, title, authors, date ]
+bibliographic = choice [ maketitle, title, subtitle, authors, date ]
maketitle :: GenParser Char st Block
maketitle = try (string "\\maketitle") >> spaces >> return Null
@@ -404,11 +404,22 @@ title = try $ do
updateState (\state -> state { stateTitle = tit })
return Null
+subtitle :: GenParser Char ParserState Block
+subtitle = try $ do
+ string "\\subtitle{"
+ tit <- manyTill inline (char '}')
+ spaces
+ updateState (\state -> state { stateTitle = stateTitle state ++
+ Str ":" : LineBreak : tit })
+ return Null
+
authors :: GenParser Char ParserState Block
authors = try $ do
string "\\author{"
- raw <- many1 (notFollowedBy (char '}') >> inline)
- let authors' = map normalizeSpaces $ splitBy (== LineBreak) raw
+ let andsep = try $ string "\\and" >> notFollowedBy letter >>
+ spaces >> return '&'
+ raw <- sepBy (many $ notFollowedBy (char '}' <|> andsep) >> inline) andsep
+ let authors' = map normalizeSpaces raw
char '}'
spaces
updateState (\s -> s { stateAuthors = authors' })
@@ -777,8 +788,12 @@ doubleQuoteEnd :: CharParser st String
doubleQuoteEnd = try $ string "''"
ellipses :: GenParser Char st Inline
-ellipses = try $ string "\\ldots" >> optional (try $ string "{}") >>
- return Ellipses
+ellipses = try $ do
+ char '\\'
+ optional $ char 'l'
+ string "dots"
+ optional $ try $ string "{}"
+ return Ellipses
enDash :: GenParser Char st Inline
enDash = try (string "--") >> return EnDash
@@ -801,7 +816,11 @@ nonbreakingSpace = char '~' >> return (Str "\160")
-- hard line break
linebreak :: GenParser Char st Inline
-linebreak = try (string "\\\\") >> return LineBreak
+linebreak = try $ do
+ string "\\\\"
+ optional $ bracketedText '[' ']' -- e.g. \\[10pt]
+ spaces
+ return LineBreak
str :: GenParser Char st Inline
str = many1 (noneOf specialChars) >>= return . Str
diff --git a/src/Text/Pandoc/Readers/Markdown.hs b/src/Text/Pandoc/Readers/Markdown.hs
index 01cc5e2e8..53531dc1a 100644
--- a/src/Text/Pandoc/Readers/Markdown.hs
+++ b/src/Text/Pandoc/Readers/Markdown.hs
@@ -1,3 +1,4 @@
+{-# LANGUAGE RelaxedPolyRec #-} -- needed for inlinesBetween on GHC < 7
{-
Copyright (C) 2006-2010 John MacFarlane <jgm@berkeley.edu>
@@ -471,8 +472,10 @@ lhsCodeBlockBirdWith c = try $ do
return $ intercalate "\n" lns'
birdTrackLine :: Char -> GenParser Char st [Char]
-birdTrackLine c = do
+birdTrackLine c = try $ do
char c
+ -- allow html tags on left margin:
+ when (c == '<') $ notFollowedBy letter
manyTill anyChar newline
@@ -905,7 +908,7 @@ inlineParsers = [ whitespace
, str
, endline
, code
- , (fourOrMore '*' <|> fourOrMore '_')
+ , fours
, strong
, emph
, note
@@ -1016,24 +1019,45 @@ mathInline = try $ do
-- to avoid performance problems, treat 4 or more _ or * in a row as a literal
-- rather than attempting to parse for emph/strong
-fourOrMore :: Char -> GenParser Char st Inline
-fourOrMore c = try $ count 4 (char c) >> many (char c) >>= \s ->
- return (Str $ replicate 4 c ++ s)
+fours :: GenParser Char st Inline
+fours = try $ do
+ x <- char '*' <|> char '_'
+ count 2 $ satisfy (==x)
+ rest <- many1 (satisfy (==x))
+ return $ Str (x:x:x:rest)
+
+-- | Parses a list of inlines between start and end delimiters.
+inlinesBetween :: (Show b)
+ => GenParser Char ParserState a
+ -> GenParser Char ParserState b
+ -> GenParser Char ParserState [Inline]
+inlinesBetween start end =
+ normalizeSpaces `liftM` try (start >> many1Till inner end)
+ where inner = innerSpace <|> (notFollowedBy' whitespace >> inline)
+ innerSpace = try $ whitespace >>~ notFollowedBy' end
emph :: GenParser Char ParserState Inline
-emph = ((enclosed (char '*') (notFollowedBy' strong >> char '*') inline) <|>
- (enclosed (char '_') (notFollowedBy' strong >> char '_' >>
- notFollowedBy alphaNum) inline)) >>=
- return . Emph . normalizeSpaces
+emph = Emph `liftM`
+ (inlinesBetween starStart starEnd <|> inlinesBetween ulStart ulEnd)
+ where starStart = char '*' >> lookAhead nonspaceChar
+ starEnd = notFollowedBy' strong >> char '*'
+ ulStart = char '_' >> lookAhead nonspaceChar
+ ulEnd = notFollowedBy' strong >> char '_'
strong :: GenParser Char ParserState Inline
-strong = ((enclosed (string "**") (try $ string "**") inline) <|>
- (enclosed (string "__") (try $ string "__") inline)) >>=
- return . Strong . normalizeSpaces
+strong = Strong `liftM`
+ (inlinesBetween starStart starEnd <|> inlinesBetween ulStart ulEnd)
+ where starStart = string "**" >> lookAhead nonspaceChar
+ starEnd = try $ string "**"
+ ulStart = string "__" >> lookAhead nonspaceChar
+ ulEnd = try $ string "__"
strikeout :: GenParser Char ParserState Inline
-strikeout = failIfStrict >> enclosed (string "~~") (try $ string "~~") inline >>=
- return . Strikeout . normalizeSpaces
+strikeout = Strikeout `liftM`
+ (failIfStrict >> inlinesBetween strikeStart strikeEnd)
+ where strikeStart = string "~~" >> lookAhead nonspaceChar
+ >> notFollowedBy (char '~')
+ strikeEnd = try $ string "~~"
superscript :: GenParser Char ParserState Inline
superscript = failIfStrict >> enclosed (char '^') (char '^')
@@ -1185,7 +1209,14 @@ note = try $ do
let notes = stateNotes state
case lookup ref notes of
Nothing -> fail "note not found"
- Just raw -> liftM Note $ parseFromString parseBlocks raw
+ Just raw -> do
+ -- We temporarily empty the note list while parsing the note,
+ -- so that we don't get infinite loops with notes inside notes...
+ -- Note references inside other notes do not work.
+ updateState $ \st -> st{ stateNotes = [] }
+ contents <- parseFromString parseBlocks raw
+ updateState $ \st -> st{ stateNotes = notes }
+ return $ Note contents
inlineNote :: GenParser Char ParserState Inline
inlineNote = try $ do
@@ -1281,7 +1312,7 @@ citeKey = try $ do
suppress_author <- option False (char '-' >> return True)
char '@'
first <- letter
- rest <- many $ (noneOf ",;]@ \t\n")
+ rest <- many $ (noneOf ",;!?[]()@ \t\n")
let key = first:rest
st <- getState
guard $ key `elem` stateCitations st
diff --git a/src/Text/Pandoc/Readers/RST.hs b/src/Text/Pandoc/Readers/RST.hs
index 32fae5ee7..7fda0da19 100644
--- a/src/Text/Pandoc/Readers/RST.hs
+++ b/src/Text/Pandoc/Readers/RST.hs
@@ -34,7 +34,7 @@ import Text.Pandoc.Definition
import Text.Pandoc.Shared
import Text.Pandoc.Parsing
import Text.ParserCombinators.Parsec
-import Control.Monad ( when )
+import Control.Monad ( when, liftM )
import Data.List ( findIndex, intercalate, transpose, sort, deleteFirstsBy )
import qualified Data.Map as M
import Text.Printf ( printf )
@@ -58,7 +58,7 @@ underlineChars = "!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~"
-- treat these as potentially non-text when parsing inline:
specialChars :: [Char]
-specialChars = "\\`|*_<>$:[-.\"'\8216\8217\8220\8221"
+specialChars = "\\`|*_<>$:[]()-.\"'\8216\8217\8220\8221"
--
-- parsing documents
@@ -162,6 +162,7 @@ fieldListItem indent = try $ do
(name, raw) <- rawFieldListItem indent
let term = [Str name]
contents <- parseFromString (many block) raw
+ optional blanklines
case (name, contents) of
("Author", x) -> do
updateState $ \st ->
@@ -187,7 +188,6 @@ fieldList :: GenParser Char ParserState Block
fieldList = try $ do
indent <- lookAhead $ many spaceChar
items <- many1 $ fieldListItem indent
- blanklines
if null items
then return Null
else return $ DefinitionList $ catMaybes items
@@ -198,11 +198,14 @@ fieldList = try $ do
lineBlockLine :: GenParser Char ParserState [Inline]
lineBlockLine = try $ do
- string "| "
+ char '|'
+ char ' ' <|> lookAhead (char '\n')
white <- many spaceChar
line <- many $ (notFollowedBy newline >> inline) <|> (try $ endline >>~ char ' ')
optional endline
- return $ normalizeSpaces $ (if null white then [] else [Str white]) ++ line
+ return $ if null white
+ then normalizeSpaces line
+ else Str white : normalizeSpaces line
lineBlock :: GenParser Char ParserState Block
lineBlock = try $ do
@@ -330,15 +333,14 @@ indentedLine indents = try $ do
string indents
manyTill anyChar newline
--- two or more indented lines, possibly separated by blank lines.
+-- one or more indented lines, possibly separated by blank lines.
-- any amount of indentation will work.
indentedBlock :: GenParser Char st [Char]
-indentedBlock = try $ do
+indentedBlock = try $ do
indents <- lookAhead $ many1 spaceChar
- lns <- many $ choice $ [ indentedLine indents,
- try $ do b <- blanklines
- l <- indentedLine indents
- return (b ++ l) ]
+ lns <- many1 $ try $ do b <- option "" blanklines
+ l <- indentedLine indents
+ return (b ++ l)
optional blanklines
return $ unlines lns
@@ -538,9 +540,15 @@ noteBlock = try $ do
return $ replicate (sourceLine endPos - sourceLine startPos) '\n'
noteMarker :: GenParser Char ParserState [Char]
-noteMarker = char '[' >> (many1 digit <|> count 1 (oneOf "#*")) >>~ char ']'
+noteMarker = do
+ char '['
+ res <- many1 digit
+ <|> (try $ char '#' >> liftM ('#':) simpleReferenceName')
+ <|> count 1 (oneOf "#*")
+ char ']'
+ return res
---
+--
-- reference key
--
@@ -555,13 +563,20 @@ unquotedReferenceName = try $ do
label' <- many1Till inline (lookAhead $ char ':')
return label'
-isolated :: Char -> GenParser Char st Char
-isolated ch = try $ char ch >>~ notFollowedBy (char ch)
+-- Simple reference names are single words consisting of alphanumerics
+-- plus isolated (no two adjacent) internal hyphens, underscores,
+-- periods, colons and plus signs; no whitespace or other characters
+-- are allowed.
+simpleReferenceName' :: GenParser Char st String
+simpleReferenceName' = do
+ x <- alphaNum
+ xs <- many $ alphaNum
+ <|> (try $ oneOf "-_:+." >> lookAhead alphaNum)
+ return (x:xs)
simpleReferenceName :: GenParser Char st [Inline]
simpleReferenceName = do
- raw <- many1 (alphaNum <|> isolated '-' <|> isolated '.' <|>
- (try $ char '_' >>~ lookAhead alphaNum))
+ raw <- simpleReferenceName'
return [Str raw]
referenceName :: GenParser Char ParserState [Inline]
@@ -864,10 +879,16 @@ note = try $ do
case lookup ref notes of
Nothing -> fail "note not found"
Just raw -> do
+ -- We temporarily empty the note list while parsing the note,
+ -- so that we don't get infinite loops with notes inside notes...
+ -- Note references inside other notes are allowed in reST, but
+ -- not yet in this implementation.
+ updateState $ \st -> st{ stateNotes = [] }
contents <- parseFromString parseBlocks raw
- when (ref == "*" || ref == "#") $ do -- auto-numbered
- -- delete the note so the next auto-numbered note
- -- doesn't get the same contents:
- let newnotes = deleteFirstsBy (==) notes [(ref,raw)]
- updateState $ \st -> st{ stateNotes = newnotes }
+ let newnotes = if (ref == "*" || ref == "#") -- auto-numbered
+ -- delete the note so the next auto-numbered note
+ -- doesn't get the same contents:
+ then deleteFirstsBy (==) notes [(ref,raw)]
+ else notes
+ updateState $ \st -> st{ stateNotes = newnotes }
return $ Note contents
diff --git a/src/Text/Pandoc/Readers/Textile.hs b/src/Text/Pandoc/Readers/Textile.hs
index 19357b343..12d299aa4 100644
--- a/src/Text/Pandoc/Readers/Textile.hs
+++ b/src/Text/Pandoc/Readers/Textile.hs
@@ -465,7 +465,7 @@ link :: GenParser Char ParserState Inline
link = try $ do
name <- surrounded (char '"') inline
char ':'
- url <- manyTill (anyChar) (lookAhead $ (space <|> try (oneOf ".;," >> (space <|> newline))))
+ url <- manyTill (anyChar) (lookAhead $ (space <|> try (oneOf ".;,:" >> (space <|> newline))))
return $ Link name (url, "")
-- | Detect plain links to http or email.
diff --git a/src/Text/Pandoc/S5.hs b/src/Text/Pandoc/S5.hs
index 1567a3ede..b17b052c5 100644
--- a/src/Text/Pandoc/S5.hs
+++ b/src/Text/Pandoc/S5.hs
@@ -31,6 +31,8 @@ Definitions for creation of S5 powerpoint-like HTML.
module Text.Pandoc.S5 ( s5HeaderIncludes) where
import Text.Pandoc.Shared ( readDataFile )
import System.FilePath ( (</>) )
+import Data.ByteString.UTF8 ( toString, fromString )
+import Data.ByteString.Base64 ( encode )
s5HeaderIncludes :: Maybe FilePath -> IO String
s5HeaderIncludes datadir = do
@@ -40,10 +42,14 @@ s5HeaderIncludes datadir = do
s5Javascript :: Maybe FilePath -> IO String
s5Javascript datadir = do
- jsCom <- readDataFile datadir $ "s5" </> "default" </> "slides.js.comment"
- jsPacked <- readDataFile datadir $ "s5" </> "default" </> "slides.js.packed"
- return $ "<script type=\"text/javascript\">\n" ++ jsCom ++ jsPacked ++
- "</script>\n"
+ js <- readDataFile datadir $ "s5" </> "default" </> "slides.min.js"
+ return $ "<script type=\"text/javascript\">\n" ++ inCDATA js ++ "</script>\n"
+
+inCDATA :: String -> String
+inCDATA s = "/*<![CDATA[*/\n" ++ s ++ "\n/*]]>*/\n"
+
+base64 :: String -> String
+base64 = toString . encode . fromString
s5CSS :: Maybe FilePath -> IO String
s5CSS datadir = do
@@ -53,5 +59,11 @@ s5CSS datadir = do
s5OperaCSS <- readDataFile datadir $ "s5" </> "default" </> "opera.css"
s5OutlineCSS <- readDataFile datadir $ "s5" </> "default" </> "outline.css"
s5PrintCSS <- readDataFile datadir $ "s5" </> "default" </> "print.css"
- return $ "<style type=\"text/css\" media=\"projection\" id=\"slideProj\">\n" ++ s5CoreCSS ++ "\n" ++ s5FramingCSS ++ "\n" ++ s5PrettyCSS ++ "\n</style>\n<style type=\"text/css\" media=\"projection\" id=\"operaFix\">\n" ++ s5OperaCSS ++ "\n</style>\n<style type=\"text/css\" media=\"screen\" id=\"outlineStyle\">\n" ++ s5OutlineCSS ++ "\n</style>\n<style type=\"text/css\" media=\"print\" id=\"slidePrint\">\n" ++ s5PrintCSS ++ "\n</style>\n"
-
+ return $ "<link rel=\"stylesheet\" type=\"text/css\" media=\"projection\" id=\"slideProj\" href=\"data:text/css;charset=utf-8;base64," ++
+ base64 (s5CoreCSS ++ "\n" ++ s5FramingCSS ++ "\n" ++ s5PrettyCSS) ++ "\" />\n" ++
+ "<link rel=\"stylesheet\" type=\"text/css\" media=\"screen\" id=\"outlineStyle\" href=\"data:text/css;charset=utf-8;base64," ++
+ base64 s5OutlineCSS ++ "\" />\n" ++
+ "<link rel=\"stylesheet\" type=\"text/css\" media=\"print\" id=\"slidePrint\" href=\"data:text/css;charset=utf-8;base64," ++
+ base64 s5PrintCSS ++ "\" />\n" ++
+ "<link rel=\"stylesheet\" type=\"text/css\" media=\"projection\" id=\"operaFix\" href=\"data:text/css;charset=utf-8;base64," ++
+ base64 s5OperaCSS ++ "\" />\n"
diff --git a/src/Text/Pandoc/Shared.hs b/src/Text/Pandoc/Shared.hs
index c4bc66830..9717e1bc8 100644
--- a/src/Text/Pandoc/Shared.hs
+++ b/src/Text/Pandoc/Shared.hs
@@ -67,7 +67,7 @@ module Text.Pandoc.Shared (
-- * File handling
inDirectory,
findDataFile,
- readDataFile
+ readDataFile,
) where
import Text.Pandoc.Definition
@@ -493,6 +493,7 @@ data WriterOptions = WriterOptions
, writerAscii :: Bool -- ^ Avoid non-ascii characters
} deriving Show
+{-# DEPRECATED writerXeTeX "writerXeTeX no longer does anything" #-}
-- | Default writer options.
defaultWriterOptions :: WriterOptions
defaultWriterOptions =
diff --git a/src/Text/Pandoc/Templates.hs b/src/Text/Pandoc/Templates.hs
index b03e8c73f..19c9a808a 100644
--- a/src/Text/Pandoc/Templates.hs
+++ b/src/Text/Pandoc/Templates.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE TypeSynonymInstances #-}
+{-# LANGUAGE TypeSynonymInstances, FlexibleInstances #-}
{-
Copyright (C) 2009-2010 John MacFarlane <jgm@berkeley.edu>
@@ -83,9 +83,10 @@ getDefaultTemplate :: (Maybe FilePath) -- ^ User data directory to search first
-> IO (Either E.IOException String)
getDefaultTemplate _ "native" = return $ Right ""
getDefaultTemplate user "odt" = getDefaultTemplate user "opendocument"
+getDefaultTemplate user "epub" = getDefaultTemplate user "html"
getDefaultTemplate user writer = do
let format = takeWhile (/='+') writer -- strip off "+lhs" if present
- let fname = "templates" </> format <.> "template"
+ let fname = "templates" </> "default" <.> format
E.try $ readDataFile user fname
data TemplateState = TemplateState Int [(String,String)]
diff --git a/src/Text/Pandoc/Writers/ConTeXt.hs b/src/Text/Pandoc/Writers/ConTeXt.hs
index 0f6e00a3b..763f77d7c 100644
--- a/src/Text/Pandoc/Writers/ConTeXt.hs
+++ b/src/Text/Pandoc/Writers/ConTeXt.hs
@@ -36,6 +36,7 @@ import Data.List ( intercalate )
import Control.Monad.State
import Text.Pandoc.Pretty
import Text.Pandoc.Templates ( renderTemplate )
+import Network.URI ( isAbsoluteURI, unEscapeString )
data WriterState =
WriterState { stNextRef :: Int -- number of next URL reference
@@ -122,7 +123,7 @@ blockToConTeXt (BlockQuote lst) = do
contents <- blockListToConTeXt lst
return $ "\\startblockquote" $$ nest 0 contents $$ "\\stopblockquote" <> blankline
blockToConTeXt (CodeBlock _ str) =
- return $ "\\starttyping" <> cr <> flush (text str) <> cr <> "\\stoptyping" $$ blankline
+ return $ flush ("\\starttyping" <> cr <> text str <> cr <> "\\stoptyping") $$ blankline
-- blankline because \stoptyping can't have anything after it, inc. '}'
blockToConTeXt (RawBlock "context" str) = return $ text str <> blankline
blockToConTeXt (RawBlock _ _ ) = return empty
@@ -282,7 +283,10 @@ inlineToConTeXt (Link txt (src, _)) = do
brackets empty <> brackets label <>
"\\from" <> brackets (text ref)
inlineToConTeXt (Image _ (src, _)) = do
- return $ braces $ "\\externalfigure" <> brackets (text src)
+ let src' = if isAbsoluteURI src
+ then src
+ else unEscapeString src
+ return $ braces $ "\\externalfigure" <> brackets (text src')
inlineToConTeXt (Note contents) = do
contents' <- blockListToConTeXt contents
return $ text "\\footnote{" <>
diff --git a/src/Text/Pandoc/Writers/Docbook.hs b/src/Text/Pandoc/Writers/Docbook.hs
index 9d09d46e3..29c042cf9 100644
--- a/src/Text/Pandoc/Writers/Docbook.hs
+++ b/src/Text/Pandoc/Writers/Docbook.hs
@@ -147,9 +147,9 @@ blockToDocbook opts (Para lst) =
inTagsIndented "para" $ inlinesToDocbook opts lst
blockToDocbook opts (BlockQuote blocks) =
inTagsIndented "blockquote" $ blocksToDocbook opts blocks
-blockToDocbook _ (CodeBlock (_,classes,_) str) =
- text ("<screen" ++ lang ++ ">") <> cr <>
- flush (text (escapeStringForXML str) <> cr <> text "</screen>")
+blockToDocbook _ (CodeBlock (_,classes,_) str) =
+ text ("<programlisting" ++ lang ++ ">") <> cr <>
+ flush (text (escapeStringForXML str) <> cr <> text "</programlisting>")
where lang = if null langs
then ""
else " language=\"" ++ escapeStringForXML (head langs) ++
@@ -185,24 +185,24 @@ blockToDocbook _ (RawBlock "html" str) = text str -- raw XML block
blockToDocbook _ (RawBlock _ _) = empty
blockToDocbook _ HorizontalRule = empty -- not semantic
blockToDocbook opts (Table caption aligns widths headers rows) =
- let alignStrings = map alignmentToString aligns
- captionDoc = if null caption
+ let captionDoc = if null caption
then empty
- else inTagsIndented "caption"
+ else inTagsIndented "title"
(inlinesToDocbook opts caption)
tableType = if isEmpty captionDoc then "informaltable" else "table"
- percent w = show (truncate (100*w) :: Integer) ++ "%"
- coltags = if all (== 0.0) widths
- then empty
- else vcat $ map (\w ->
- selfClosingTag "col" [("width", percent w)]) widths
+ percent w = show (truncate (100*w) :: Integer) ++ "*"
+ coltags = vcat $ zipWith (\w al -> selfClosingTag "colspec"
+ ([("colwidth", percent w) | w > 0] ++
+ [("align", alignmentToString al)])) widths aligns
head' = if all null headers
then empty
else inTagsIndented "thead" $
- tableRowToDocbook opts alignStrings "th" headers
+ tableRowToDocbook opts headers
body' = inTagsIndented "tbody" $
- vcat $ map (tableRowToDocbook opts alignStrings "td") rows
- in inTagsIndented tableType $ captionDoc $$ coltags $$ head' $$ body'
+ vcat $ map (tableRowToDocbook opts) rows
+ in inTagsIndented tableType $ captionDoc $$
+ (inTags True "tgroup" [("cols", show (length headers))] $
+ coltags $$ head' $$ body')
alignmentToString :: Alignment -> [Char]
alignmentToString alignment = case alignment of
@@ -212,22 +212,16 @@ alignmentToString alignment = case alignment of
AlignDefault -> "left"
tableRowToDocbook :: WriterOptions
- -> [String]
- -> String
-> [[Block]]
-> Doc
-tableRowToDocbook opts aligns celltype cols =
- inTagsIndented "tr" $ vcat $
- zipWith (tableItemToDocbook opts celltype) aligns cols
+tableRowToDocbook opts cols =
+ inTagsIndented "row" $ vcat $ map (tableItemToDocbook opts) cols
tableItemToDocbook :: WriterOptions
- -> [Char]
- -> [Char]
-> [Block]
-> Doc
-tableItemToDocbook opts tag align item =
- let attrib = [("align", align)]
- in inTags True tag attrib $ vcat $ map (blockToDocbook opts) item
+tableItemToDocbook opts item =
+ inTags True "entry" [] $ vcat $ map (blockToDocbook opts) item
-- | Convert a list of inline elements to Docbook.
inlinesToDocbook :: WriterOptions -> [Inline] -> Doc
diff --git a/src/Text/Pandoc/Writers/EPUB.hs b/src/Text/Pandoc/Writers/EPUB.hs
index c0cc815d4..9fc393fed 100644
--- a/src/Text/Pandoc/Writers/EPUB.hs
+++ b/src/Text/Pandoc/Writers/EPUB.hs
@@ -46,6 +46,8 @@ import Text.Pandoc.UUID
import Text.Pandoc.Writers.HTML
import Text.Pandoc.Writers.Markdown ( writePlain )
import Data.Char ( toLower )
+import System.Directory ( copyFile )
+import Network.URI ( unEscapeString )
-- | Produce an EPUB file from a Pandoc document.
writeEPUB :: Maybe String -- ^ EPUB stylesheet specified at command line
@@ -59,9 +61,26 @@ writeEPUB mbStylesheet opts doc@(Pandoc meta _) = do
, writerStandalone = True
, writerWrapText = False }
let sourceDir = writerSourceDirectory opts'
+ let vars = writerVariables opts'
+ let mbCoverImage = lookup "epub-cover-image" vars
+
+ -- cover page
+ (cpgEntry, cpicEntry) <-
+ case mbCoverImage of
+ Nothing -> return ([],[])
+ Just img -> do
+ let coverImage = "cover-image" ++ takeExtension img
+ copyFile img coverImage
+ let cpContent = fromString $ writeHtmlString
+ opts'{writerTemplate = pageTemplate
+ ,writerVariables =
+ ("coverimage",coverImage):vars}
+ (Pandoc meta [])
+ imgContent <- B.readFile img
+ return ( [mkEntry "cover.xhtml" cpContent]
+ , [mkEntry coverImage imgContent] )
-- title page
- let vars = writerVariables opts'
let tpContent = fromString $ writeHtmlString
opts'{writerTemplate = pageTemplate
,writerVariables = ("titlepage","yes"):vars}
@@ -84,8 +103,7 @@ writeEPUB mbStylesheet opts doc@(Pandoc meta _) = do
let chunks = splitByIndices h1Indices blocks
let titleize (Header 1 xs : ys) = Pandoc meta{docTitle = xs} ys
titleize xs = Pandoc meta xs
- let chapToHtml = writeHtmlString opts'{ writerTemplate = pageTemplate
- , writerHTMLMathMethod = PlainMath }
+ let chapToHtml = writeHtmlString opts'{ writerTemplate = pageTemplate }
let chapters = map titleize chunks
let chapterToEntry :: Int -> Pandoc -> Entry
chapterToEntry num chap = mkEntry ("ch" ++ show num ++ ".xhtml") $
@@ -117,17 +135,21 @@ writeEPUB mbStylesheet opts doc@(Pandoc meta _) = do
,("xmlns","http://www.idpf.org/2007/opf")
,("unique-identifier","BookId")] $
[ metadataElement (writerEPUBMetadata opts')
- uuid lang plainTitle plainAuthors
+ uuid lang plainTitle plainAuthors mbCoverImage
, unode "manifest" $
[ unode "item" ! [("id","ncx"), ("href","toc.ncx")
,("media-type","application/x-dtbncx+xml")] $ ()
, unode "item" ! [("id","style"), ("href","stylesheet.css")
,("media-type","text/css")] $ ()
] ++
- map chapterNode (tpEntry : chapterEntries) ++
- map pictureNode picEntries
+ map chapterNode (cpgEntry ++ (tpEntry : chapterEntries)) ++
+ map pictureNode (cpicEntry ++ picEntries)
, unode "spine" ! [("toc","ncx")] $
- map chapterRefNode (tpEntry : chapterEntries)
+ case mbCoverImage of
+ Nothing -> []
+ Just _ -> [ unode "itemref" !
+ [("idref", "cover"),("linear","no")] $ () ]
+ ++ map chapterRefNode (tpEntry : chapterEntries)
]
let contentsEntry = mkEntry "content.opf" contentsData
@@ -142,7 +164,7 @@ writeEPUB mbStylesheet opts doc@(Pandoc meta _) = do
let tocData = fromString $ ppTopElement $
unode "ncx" ! [("version","2005-1")
,("xmlns","http://www.daisy.org/z3986/2005/ncx/")] $
- [ unode "head"
+ [ unode "head" $
[ unode "meta" ! [("name","dtb:uid")
,("content", show uuid)] $ ()
, unode "meta" ! [("name","dtb:depth")
@@ -151,7 +173,10 @@ writeEPUB mbStylesheet opts doc@(Pandoc meta _) = do
,("content", "0")] $ ()
, unode "meta" ! [("name","dtb:maxPageNumber")
,("content", "0")] $ ()
- ]
+ ] ++ case mbCoverImage of
+ Nothing -> []
+ Just _ -> [unode "meta" ! [("name","cover"),
+ ("content","cover-image")] $ ()]
, unode "docTitle" $ unode "text" $ plainTitle
, unode "navMap" $ zipWith3 navPointNode (tpEntry : chapterEntries)
[1..(length chapterEntries + 1)]
@@ -181,11 +206,12 @@ writeEPUB mbStylesheet opts doc@(Pandoc meta _) = do
-- construct archive
let archive = foldr addEntryToArchive emptyArchive
(mimetypeEntry : containerEntry : stylesheetEntry : tpEntry :
- contentsEntry : tocEntry : (picEntries ++ chapterEntries) )
+ contentsEntry : tocEntry :
+ (picEntries ++ cpicEntry ++ cpgEntry ++ chapterEntries) )
return $ fromArchive archive
-metadataElement :: String -> UUID -> String -> String -> [String] -> Element
-metadataElement metadataXML uuid lang title authors =
+metadataElement :: String -> UUID -> String -> String -> [String] -> Maybe a -> Element
+metadataElement metadataXML uuid lang title authors mbCoverImage =
let userNodes = parseXML metadataXML
elt = unode "metadata" ! [("xmlns:dc","http://purl.org/dc/elements/1.1/")
,("xmlns:opf","http://www.idpf.org/2007/opf")] $
@@ -200,7 +226,9 @@ metadataElement metadataXML uuid lang title authors =
[ unode "dc:language" lang | not (elt `contains` "language") ] ++
[ unode "dc:identifier" ! [("id","BookId")] $ show uuid |
not (elt `contains` "identifier") ] ++
- [ unode "dc:creator" ! [("opf:role","aut")] $ a | a <- authors ]
+ [ unode "dc:creator" ! [("opf:role","aut")] $ a | a <- authors ] ++
+ [ unode "meta" ! [("name","cover"), ("content","cover-image")] $ () |
+ not (isNothing mbCoverImage) ]
in elt{ elContent = elContent elt ++ map Elem newNodes }
transformInlines :: HTMLMathMethod
@@ -211,9 +239,10 @@ transformInlines :: HTMLMathMethod
transformInlines _ _ _ (Image lab (src,_) : xs) | isNothing (imageTypeOf src) =
return $ Emph lab : xs
transformInlines _ sourceDir picsRef (Image lab (src,tit) : xs) = do
+ let src' = unEscapeString src
pics <- readIORef picsRef
- let oldsrc = sourceDir </> src
- let ext = takeExtension src
+ let oldsrc = sourceDir </> src'
+ let ext = takeExtension src'
newsrc <- case lookup oldsrc pics of
Just n -> return n
Nothing -> do
@@ -266,9 +295,17 @@ pageTemplate = unlines
, "<html xmlns=\"http://www.w3.org/1999/xhtml\">"
, "<head>"
, "<title>$title$</title>"
+ , "$if(coverimage)$"
+ , "<style type=\"text/css\">img{ max-width: 100%; }</style>"
+ , "$endif$"
, "<link href=\"stylesheet.css\" type=\"text/css\" rel=\"stylesheet\" />"
, "</head>"
, "<body>"
+ , "$if(coverimage)$"
+ , "<div id=\"cover-image\">"
+ , "<img src=\"$coverimage$\" alt=\"$title$\" />"
+ , "</div>"
+ , "$else$"
, "$if(titlepage)$"
, "<h1 class=\"title\">$title$</h1>"
, "$for(author)$"
@@ -279,6 +316,7 @@ pageTemplate = unlines
, "$if(toc)$"
, "$toc$"
, "$endif$"
+ , "$endif$"
, "$body$"
, "$endif$"
, "</body>"
diff --git a/src/Text/Pandoc/Writers/HTML.hs b/src/Text/Pandoc/Writers/HTML.hs
index b3320fa06..573adbf4a 100644
--- a/src/Text/Pandoc/Writers/HTML.hs
+++ b/src/Text/Pandoc/Writers/HTML.hs
@@ -18,9 +18,9 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-}
{- |
- Module : Text.Pandoc.Writers.HTML
+ Module : Text.Pandoc.Writers.HTML
Copyright : Copyright (C) 2006-2010 John MacFarlane
- License : GNU GPL, version 2 or above
+ License : GNU GPL, version 2 or above
Maintainer : John MacFarlane <jgm@berkeley.edu>
Stability : alpha
@@ -46,6 +46,7 @@ import Text.XHtml.Transitional hiding ( stringToHtml, unordList, ordList )
import qualified Text.XHtml.Transitional as XHtml
import Text.TeXMath
import Text.XML.Light.Output
+import System.FilePath (takeExtension)
data WriterState = WriterState
{ stNotes :: [Html] -- ^ List of notes
@@ -101,42 +102,37 @@ pandocToHtml opts (Pandoc (Meta title' authors' date') blocks) = do
else return noHtml
auths <- if standalone
then mapM (inlineListToHtml opts) authors'
- else return []
+ else return []
date <- if standalone
then inlineListToHtml opts date'
- else return noHtml
- let sects = hierarchicalize blocks
- toc <- if writerTableOfContents opts
+ else return noHtml
+ let sects = hierarchicalize $
+ if writerSlideVariant opts == NoSlides
+ then blocks
+ else case blocks of
+ (Header 1 _ : _) -> blocks
+ _ ->
+ let isL1 (Header 1 _) = True
+ isL1 _ = False
+ (preBlocks, rest) = break isL1 blocks
+ in (RawBlock "html" "<div class=\"slide\">" :
+ preBlocks) ++ (RawBlock "html" "</div>" :
+ rest)
+ toc <- if writerTableOfContents opts
then tableOfContents opts sects
else return Nothing
- let startSlide = RawBlock "html" "<div class=\"slide\">\n"
- endSlide = RawBlock "html" "</div>\n"
- let cutUp (HorizontalRule : Header 1 ys : xs) = cutUp (Header 1 ys : xs)
- cutUp (HorizontalRule : xs) = [endSlide, startSlide] ++ cutUp xs
- cutUp (Header 1 ys : xs) = [endSlide, startSlide] ++
- (Header 1 ys : cutUp xs)
- cutUp (x:xs) = x : cutUp xs
- cutUp [] = []
- let slides = case blocks of
- (HorizontalRule : xs) -> [startSlide] ++ cutUp xs ++ [endSlide]
- (Header 1 ys : xs) -> [startSlide, Header 1 ys] ++
- cutUp xs ++ [endSlide]
- _ -> [startSlide] ++ cutUp blocks ++
- [endSlide]
blocks' <- liftM (toHtmlFromList . intersperse (nl opts)) $
- if writerSlideVariant opts `elem` [SlidySlides, S5Slides]
- then mapM (blockToHtml opts) slides
- else mapM (elementToHtml opts) sects
+ mapM (elementToHtml opts) sects
st <- get
let notes = reverse (stNotes st)
let thebody = blocks' +++ footnoteSection opts notes
let math = if stMath st
then case writerHTMLMathMethod opts of
LaTeXMathML (Just url) ->
- script !
+ script !
[src url, thetype "text/javascript"] $ noHtml
MathML (Just url) ->
- script !
+ script !
[src url, thetype "text/javascript"] $ noHtml
MathJax url ->
script ! [src url, thetype "text/javascript"] $ noHtml
@@ -144,9 +140,10 @@ pandocToHtml opts (Pandoc (Meta title' authors' date') blocks) = do
script !
[src url, thetype "text/javascript"] $ noHtml
_ -> case lookup "mathml-script" (writerVariables opts) of
- Just s ->
+ Just s ->
script ! [thetype "text/javascript"] <<
- primHtml s
+ primHtml ("/*<![CDATA[*/\n" ++ s ++
+ "/*]]>*/\n")
Nothing -> noHtml
else noHtml
let newvars = [("highlighting-css", defaultHighlightingCss) |
@@ -173,7 +170,10 @@ inTemplate opts tit auths date toc body' newvars =
[ ("body", dropWhile (=='\n') $ showHtmlFragment body')
, ("pagetitle", topTitle')
, ("title", dropWhile (=='\n') $ showHtmlFragment tit)
- , ("date", date') ] ++
+ , ("date", date')
+ , ("idprefix", writerIdentifierPrefix opts)
+ , ("slidy-url", "http://www.w3.org/Talks/Tools/Slidy2")
+ , ("s5-url", "ui/default") ] ++
[ ("html5","true") | writerHtml5 opts ] ++
(case toc of
Just t -> [ ("toc", showHtmlFragment t)]
@@ -202,14 +202,7 @@ tableOfContents opts sects = do
let tocList = catMaybes contents
return $ if null tocList
then Nothing
- else Just $
- if writerHtml5 opts
- then (tag "nav" ! [prefixedId opts' "TOC"] $
- nl opts +++ unordList opts tocList +++ nl opts)
- +++ nl opts
- else (thediv ! [prefixedId opts' "TOC"] $
- nl opts +++ unordList opts tocList +++ nl opts)
- +++ nl opts
+ else Just $ unordList opts tocList
-- | Convert section number to string
showSecNum :: [Int] -> String
@@ -233,33 +226,35 @@ elementToListItem opts (Sec _ num id' headerText subsecs) = do
-- | Convert an Element to Html.
elementToHtml :: WriterOptions -> Element -> State WriterState Html
-elementToHtml opts (Blk block) = blockToHtml opts block
+elementToHtml opts (Blk HorizontalRule) | writerSlideVariant opts /= NoSlides =
+ return $ primHtml "</div>" +++ nl opts +++ primHtml "<div class=\"slide\">"
+elementToHtml opts (Blk block) = blockToHtml opts block
elementToHtml opts (Sec level num id' title' elements) = do
- innerContents <- mapM (elementToHtml opts) elements
modify $ \st -> st{stSecNum = num} -- update section number
header' <- blockToHtml opts (Header level title')
- let slides = writerSlideVariant opts `elem` [SlidySlides, S5Slides]
+ innerContents <- mapM (elementToHtml opts) elements
let header'' = header' ! [prefixedId opts id' |
not (writerStrictMarkdown opts ||
- writerSectionDivs opts || slides)]
+ writerSectionDivs opts ||
+ writerSlideVariant opts == S5Slides)]
let stuff = header'' : innerContents
- return $ if slides -- S5 gets confused by the extra divs around sections
- then toHtmlFromList $ intersperse (nl opts) stuff
- else if writerSectionDivs opts
- then if writerHtml5 opts
- then tag "section" ! [prefixedId opts id']
- << (nl opts : (intersperse (nl opts) stuff
- ++ [nl opts]))
- else thediv ! [prefixedId opts id'] <<
- (nl opts : (intersperse (nl opts) stuff
- ++ [nl opts]))
- else toHtmlFromList $ intersperse (nl opts) stuff
+ let slide = writerSlideVariant opts /= NoSlides && level == 1
+ let stuff' = if slide
+ then [thediv ! [theclass "slide"] <<
+ (nl opts : intersperse (nl opts) stuff ++ [nl opts])]
+ else intersperse (nl opts) stuff
+ let inNl x = nl opts : x ++ [nl opts]
+ return $ if writerSectionDivs opts
+ then if writerHtml5 opts
+ then tag "section" ! [prefixedId opts id'] << inNl stuff'
+ else thediv ! [prefixedId opts id'] << inNl stuff'
+ else toHtmlFromList stuff'
-- | Convert list of Note blocks to a footnote <div>.
-- Assumes notes are sorted.
footnoteSection :: WriterOptions -> [Html] -> Html
footnoteSection opts notes =
- if null notes
+ if null notes
then noHtml
else nl opts +++ (thediv ! [theclass "footnotes"]
$ nl opts +++ hr +++ nl opts +++
@@ -272,7 +267,7 @@ parseMailto ('m':'a':'i':'l':'t':'o':':':addr) =
let (name', rest) = span (/='@') addr
domain = drop 1 rest
in Just (name', domain)
-parseMailto _ = Nothing
+parseMailto _ = Nothing
-- | Obfuscate a "mailto:" link.
obfuscateLink :: WriterOptions -> String -> String -> Html
@@ -280,15 +275,15 @@ obfuscateLink opts txt s | writerEmailObfuscation opts == NoObfuscation =
anchor ! [href s] << txt
obfuscateLink opts txt s =
let meth = writerEmailObfuscation opts
- s' = map toLower s
+ s' = map toLower s
in case parseMailto s' of
(Just (name', domain)) ->
let domain' = substitute "." " dot " domain
at' = obfuscateChar '@'
- (linkText, altText) =
+ (linkText, altText) =
if txt == drop 7 s' -- autolink
then ("'<code>'+e+'</code>'", name' ++ " at " ++ domain')
- else ("'" ++ txt ++ "'", txt ++ " (" ++ name' ++ " at " ++
+ else ("'" ++ txt ++ "'", txt ++ " (" ++ name' ++ " at " ++
domain' ++ ")")
in case meth of
ReferenceObfuscation ->
@@ -297,18 +292,18 @@ obfuscateLink opts txt s =
++ "\">" ++ (obfuscateString txt) ++ "</a>"
JavascriptObfuscation ->
(script ! [thetype "text/javascript"] $
- primHtml ("\n<!--\nh='" ++
- obfuscateString domain ++ "';a='" ++ at' ++ "';n='" ++
+ primHtml ("\n<!--\nh='" ++
+ obfuscateString domain ++ "';a='" ++ at' ++ "';n='" ++
obfuscateString name' ++ "';e=n+a+h;\n" ++
- "document.write('<a h'+'ref'+'=\"ma'+'ilto'+':'+e+'\">'+" ++
- linkText ++ "+'<\\/'+'a'+'>');\n// -->\n")) +++
+ "document.write('<a h'+'ref'+'=\"ma'+'ilto'+':'+e+'\">'+" ++
+ linkText ++ "+'<\\/'+'a'+'>');\n// -->\n")) +++
noscript (primHtml $ obfuscateString altText)
_ -> error $ "Unknown obfuscation method: " ++ show meth
_ -> anchor ! [href s] $ stringToHtml opts txt -- malformed email
-- | Obfuscate character as entity.
obfuscateChar :: Char -> String
-obfuscateChar char =
+obfuscateChar char =
let num = ord char
numstr = if even num then show num else "x" ++ showHex num ""
in "&#" ++ numstr ++ ";"
@@ -323,6 +318,17 @@ attrsToHtml opts (id',classes',keyvals) =
[prefixedId opts id' | not (null id')] ++
map (\(x,y) -> strAttr x y) keyvals
+imageExts :: [String]
+imageExts = [ "art", "bmp", "cdr", "cdt", "cpt", "cr2", "crw", "djvu", "erf",
+ "gif", "ico", "ief", "jng", "jpg", "jpeg", "nef", "orf", "pat", "pbm",
+ "pcx", "pgm", "png", "pnm", "ppm", "psd", "ras", "rgb", "svg", "tiff",
+ "wbmp", "xbm", "xpm", "xwd" ]
+
+treatAsImage :: FilePath -> Bool
+treatAsImage fp =
+ let ext = map toLower $ drop 1 $ takeExtension fp
+ in null ext || ext `elem` imageExts
+
-- | Convert Pandoc block element to HTML.
blockToHtml :: WriterOptions -> Block -> State WriterState Html
blockToHtml _ Null = return noHtml
@@ -361,14 +367,14 @@ blockToHtml opts (CodeBlock (id',classes,keyvals) rawCode) = do
return h
blockToHtml opts (BlockQuote blocks) =
-- in S5, treat list in blockquote specially
- -- if default is incremental, make it nonincremental;
+ -- if default is incremental, make it nonincremental;
-- otherwise incremental
if writerSlideVariant opts /= NoSlides
then let inc = not (writerIncremental opts) in
- case blocks of
+ case blocks of
[BulletList lst] -> blockToHtml (opts {writerIncremental = inc})
(BulletList lst)
- [OrderedList attribs lst] ->
+ [OrderedList attribs lst] ->
blockToHtml (opts {writerIncremental = inc})
(OrderedList attribs lst)
_ -> do contents <- blockListToHtml opts blocks
@@ -377,7 +383,7 @@ blockToHtml opts (BlockQuote blocks) =
else do
contents <- blockListToHtml opts blocks
return $ blockquote (nl opts +++ contents +++ nl opts)
-blockToHtml opts (Header level lst) = do
+blockToHtml opts (Header level lst) = do
contents <- inlineListToHtml opts lst
secnum <- liftM stSecNum get
let contents' = if writerNumberSections opts
@@ -470,8 +476,8 @@ tableRowToHtml opts aligns rownum cols' = do
0 -> "header"
x | x `rem` 2 == 1 -> "odd"
_ -> "even"
- cols'' <- sequence $ zipWith
- (\alignment item -> tableItemToHtml opts mkcell alignment item)
+ cols'' <- sequence $ zipWith
+ (\alignment item -> tableItemToHtml opts mkcell alignment item)
aligns cols'
return $ (tr ! [theclass rowclass] $ nl opts +++ toHtmlFromList cols'')
+++ nl opts
@@ -508,13 +514,13 @@ blockListToHtml opts lst =
-- | Convert list of Pandoc inline elements to HTML.
inlineListToHtml :: WriterOptions -> [Inline] -> State WriterState Html
-inlineListToHtml opts lst =
+inlineListToHtml opts lst =
mapM (inlineToHtml opts) lst >>= return . toHtmlFromList
-- | Convert Pandoc inline element to HTML.
inlineToHtml :: WriterOptions -> Inline -> State WriterState Html
inlineToHtml opts inline =
- case inline of
+ case inline of
(Str str) -> return $ stringToHtml opts str
(Space) -> return $ stringToHtml opts " "
(LineBreak) -> return br
@@ -543,9 +549,9 @@ inlineToHtml opts inline =
stringToHtml opts "”")
in do contents <- inlineListToHtml opts lst
return $ leftQuote +++ contents +++ rightQuote
- (Math t str) -> modify (\st -> st {stMath = True}) >>
+ (Math t str) -> modify (\st -> st {stMath = True}) >>
(case writerHTMLMathMethod opts of
- LaTeXMathML _ ->
+ LaTeXMathML _ ->
-- putting LaTeXMathML in container with class "LaTeX" prevents
-- non-math elements on the page from being treated as math by
-- the javascript
@@ -594,37 +600,44 @@ inlineToHtml opts inline =
LaTeXMathML _ -> do modify (\st -> st {stMath = True})
return $ primHtml str
_ -> return noHtml
- (RawInline "html" str) -> return $ primHtml str
+ (RawInline "html" str) -> return $ primHtml str
(RawInline _ _) -> return noHtml
(Link [Code _ str] (s,_)) | "mailto:" `isPrefixOf` s ->
return $ obfuscateLink opts str s
(Link txt (s,_)) | "mailto:" `isPrefixOf` s -> do
- linkText <- inlineListToHtml opts txt
+ linkText <- inlineListToHtml opts txt
return $ obfuscateLink opts (show linkText) s
(Link txt (s,tit)) -> do
linkText <- inlineListToHtml opts txt
- return $ anchor ! ([href s] ++
- if null tit then [] else [title tit]) $
+ return $ anchor ! ([href s] ++
+ if null tit then [] else [title tit]) $
linkText
- (Image txt (s,tit)) -> do
+ (Image txt (s,tit)) | treatAsImage s -> do
let alternate' = stringify txt
let attributes = [src s] ++
- (if null tit
- then []
- else [title tit]) ++
- if null txt
- then []
+ (if null tit
+ then []
+ else [title tit]) ++
+ if null txt
+ then []
else [alt alternate']
- return $ image ! attributes
- -- note: null title included, as in Markdown.pl
- (Note contents) -> do
+ return $ image ! attributes
+ -- note: null title included, as in Markdown.pl
+ (Image _ (s,tit)) -> do
+ let attributes = [src s] ++
+ (if null tit
+ then []
+ else [title tit])
+ return $ itag "embed" ! attributes
+ -- note: null title included, as in Markdown.pl
+ (Note contents) -> do
st <- get
let notes = stNotes st
let number = (length notes) + 1
let ref = show number
- htmlContents <- blockListToNote opts ref contents
+ htmlContents <- blockListToNote opts ref contents
-- push contents onto front of notes
- put $ st {stNotes = (htmlContents:notes)}
+ put $ st {stNotes = (htmlContents:notes)}
return $ sup <<
anchor ! [href ("#" ++ writerIdentifierPrefix opts ++ "fn" ++ ref),
theclass "footnoteRef",
@@ -635,9 +648,8 @@ blockListToNote :: WriterOptions -> String -> [Block] -> State WriterState Html
blockListToNote opts ref blocks =
-- If last block is Para or Plain, include the backlink at the end of
-- that block. Otherwise, insert a new Plain block with the backlink.
- let backlink = [RawInline "html" $ " <a href=\"#" ++ writerIdentifierPrefix opts ++ "fnref" ++ ref ++
- "\" class=\"footnoteBackLink\"" ++
- " title=\"Jump back to footnote " ++ ref ++ "\">" ++
+ let backlink = [RawInline "html" $ " <a href=\"#" ++ writerIdentifierPrefix opts ++ "fnref" ++ ref ++
+ "\" class=\"footnoteBackLink\">" ++
(if writerAscii opts then "&#8617;" else "↩") ++ "</a>"]
blocks' = if null blocks
then []
@@ -652,4 +664,3 @@ blockListToNote opts ref blocks =
Plain backlink]
in do contents <- blockListToHtml opts blocks'
return $ nl opts +++ (li ! [prefixedId opts ("fn" ++ ref)]) contents
-
diff --git a/src/Text/Pandoc/Writers/LaTeX.hs b/src/Text/Pandoc/Writers/LaTeX.hs
index 7dd736da4..d925b2897 100644
--- a/src/Text/Pandoc/Writers/LaTeX.hs
+++ b/src/Text/Pandoc/Writers/LaTeX.hs
@@ -34,7 +34,9 @@ import Text.Pandoc.Generic
import Text.Pandoc.Shared
import Text.Pandoc.Templates
import Text.Printf ( printf )
-import Data.List ( (\\), isSuffixOf, isPrefixOf, intercalate, intersperse )
+import Network.URI ( isAbsoluteURI, unEscapeString )
+import Data.List ( (\\), isSuffixOf, isInfixOf,
+ isPrefixOf, intercalate, intersperse )
import Data.Char ( toLower, isPunctuation )
import Control.Monad.State
import Text.Pandoc.Pretty
@@ -42,6 +44,9 @@ import System.FilePath (dropExtension)
data WriterState =
WriterState { stInNote :: Bool -- @True@ if we're in a note
+ , stInTable :: Bool -- @True@ if we're in a table
+ , stTableNotes :: [(Char, Doc)] -- List of markers, notes
+ -- in current table
, stOLLevel :: Int -- level of ordered list nesting
, stOptions :: WriterOptions -- writer options, so they don't have to be parameter
, stVerbInNote :: Bool -- true if document has verbatim text in note
@@ -53,17 +58,20 @@ data WriterState =
, stGraphics :: Bool -- true if document contains images
, stLHS :: Bool -- true if document has literate haskell code
, stBook :: Bool -- true if document uses book or memoir class
+ , stCsquotes :: Bool -- true if document uses csquotes
}
-- | Convert Pandoc to LaTeX.
writeLaTeX :: WriterOptions -> Pandoc -> String
writeLaTeX options document =
evalState (pandocToLaTeX options document) $
- WriterState { stInNote = False, stOLLevel = 1, stOptions = options,
+ WriterState { stInNote = False, stInTable = False,
+ stTableNotes = [], stOLLevel = 1, stOptions = options,
stVerbInNote = False, stEnumerate = False,
stTable = False, stStrikeout = False, stSubscript = False,
stUrl = False, stGraphics = False,
- stLHS = False, stBook = writerChapters options }
+ stLHS = False, stBook = writerChapters options,
+ stCsquotes = False }
pandocToLaTeX :: WriterOptions -> Pandoc -> State WriterState String
pandocToLaTeX options (Pandoc (Meta title authors date) blocks) = do
@@ -73,6 +81,10 @@ pandocToLaTeX options (Pandoc (Meta title authors date) blocks) = do
"{report}" `isSuffixOf` x)
when (any usesBookClass (lines template)) $
modify $ \s -> s{stBook = True}
+ -- check for \usepackage...{csquotes}; if present, we'll use
+ -- \enquote{...} for smart quotes:
+ when ("{csquotes}" `isInfixOf` template) $
+ modify $ \s -> s{stCsquotes = True}
opts <- liftM stOptions get
let colwidth = if writerWrapText opts
then Just $ writerColumns opts
@@ -106,7 +118,6 @@ pandocToLaTeX options (Pandoc (Meta title authors date) blocks) = do
, ("title", titletext)
, ("date", dateText) ] ++
[ ("author", a) | a <- authorsText ] ++
- [ ("xetex", "yes") | writerXeTeX options ] ++
[ ("verbatim-in-note", "yes") | stVerbInNote st ] ++
[ ("fancy-enums", "yes") | stEnumerate st ] ++
[ ("tables", "yes") | stTable st ] ++
@@ -147,14 +158,6 @@ stringToLaTeX = escapeStringUsing latexEscapes
inCmd :: String -> Doc -> Doc
inCmd cmd contents = char '\\' <> text cmd <> braces contents
--- | Remove all code elements from list of inline elements
--- (because it's illegal to have verbatim inside some command arguments)
-deVerb :: [Inline] -> [Inline]
-deVerb [] = []
-deVerb ((Code _ str):rest) =
- (RawInline "latex" $ "\\texttt{" ++ stringToLaTeX str ++ "}"):(deVerb rest)
-deVerb (other:rest) = other:(deVerb rest)
-
-- | Convert Pandoc block element to LaTeX.
blockToLaTeX :: Block -- ^ Block to convert
-> State WriterState Doc
@@ -211,8 +214,9 @@ blockToLaTeX (CodeBlock (_,classes,keyvalAttr) str) = do
| null params = empty
| otherwise = "[" <> hsep (intersperse "," (map text params)) <>
"]"
- return $ "\\begin{" <> text env <> "}" <> printParams $$ flush (text str) $$
- "\\end{" <> text env <> "}" $$ cr -- final cr needed because of footnotes
+ return $ flush ("\\begin{" <> text env <> "}" <> printParams $$ text str $$
+ "\\end{" <> text env <> "}") $$ cr
+ -- final cr needed because of footnotes
blockToLaTeX (RawBlock "latex" x) = return $ text x <> blankline
blockToLaTeX (RawBlock _ _) = return empty
blockToLaTeX (BulletList lst) = do
@@ -244,14 +248,13 @@ blockToLaTeX (DefinitionList lst) = do
blockToLaTeX HorizontalRule = return $
"\\begin{center}\\rule{3in}{0.4pt}\\end{center}" $$ blankline
blockToLaTeX (Header level lst) = do
- let lst' = deVerb lst
- txt <- inlineListToLaTeX lst'
+ txt <- inlineListToLaTeX lst
let noNote (Note _) = Str ""
noNote x = x
- let lstNoNotes = bottomUp noNote lst'
+ let lstNoNotes = bottomUp noNote lst
-- footnotes in sections don't work unless you specify an optional
-- argument: \section[mysec]{mysec\footnote{blah}}
- optional <- if lstNoNotes == lst'
+ optional <- if lstNoNotes == lst
then return empty
else do
res <- inlineListToLaTeX lstNoNotes
@@ -269,47 +272,61 @@ blockToLaTeX (Header level lst) = do
5 -> headerWith "\\subparagraph" stuffing
_ -> txt $$ blankline
blockToLaTeX (Table caption aligns widths heads rows) = do
+ modify $ \s -> s{ stInTable = True, stTableNotes = [] }
headers <- if all null heads
then return empty
- else liftM ($$ "\\hline") $ (tableRowToLaTeX widths) heads
+ else liftM ($$ "\\ML")
+ $ (tableRowToLaTeX True aligns widths) heads
captionText <- inlineListToLaTeX caption
- rows' <- mapM (tableRowToLaTeX widths) rows
- let colDescriptors = concat $ zipWith toColDescriptor widths aligns
- let tableBody = text ("\\begin{tabular}{" ++ colDescriptors ++ "}") $$
- headers $$ vcat rows' $$ "\\end{tabular}"
- let centered txt = "\\begin{center}" $$ txt $$ "\\end{center}"
- modify $ \s -> s{ stTable = True }
- return $ if isEmpty captionText
- then centered tableBody $$ blankline
- else "\\begin{table}[h]" $$ centered tableBody $$
- inCmd "caption" captionText $$ "\\end{table}" $$ blankline
-
-toColDescriptor :: Double -> Alignment -> String
-toColDescriptor 0 align =
+ let capt = if isEmpty captionText
+ then empty
+ else text "caption = " <> captionText <> "," <> space
+ rows' <- mapM (tableRowToLaTeX False aligns widths) rows
+ let rows'' = intersperse ("\\\\\\noalign{\\medskip}") rows'
+ tableNotes <- liftM (reverse . stTableNotes) get
+ let toNote (marker, x) = "\\tnote" <> brackets (char marker) <>
+ braces (nest 2 x)
+ let notes = vcat $ map toNote tableNotes
+ let colDescriptors = text $ concat $ map toColDescriptor aligns
+ let tableBody =
+ ("\\ctable" <> brackets (capt <> text "pos = H, center, botcap"))
+ <> braces colDescriptors
+ $$ braces ("% notes" <> cr <> notes <> cr)
+ $$ braces (text "% rows" $$ "\\FL" $$
+ vcat (headers : rows'') $$ "\\LL" <> cr)
+ modify $ \s -> s{ stTable = True, stInTable = False, stTableNotes = [] }
+ return $ tableBody $$ blankline
+
+toColDescriptor :: Alignment -> String
+toColDescriptor align =
case align of
AlignLeft -> "l"
AlignRight -> "r"
AlignCenter -> "c"
AlignDefault -> "l"
-toColDescriptor width align = ">{\\PBS" ++
- (case align of
- AlignLeft -> "\\raggedright"
- AlignRight -> "\\raggedleft"
- AlignCenter -> "\\centering"
- AlignDefault -> "\\raggedright") ++
- "\\hspace{0pt}}p{" ++ printf "%.2f" width ++ "\\columnwidth}"
blockListToLaTeX :: [Block] -> State WriterState Doc
blockListToLaTeX lst = mapM blockToLaTeX lst >>= return . vcat
-tableRowToLaTeX :: [Double] -> [[Block]] -> State WriterState Doc
-tableRowToLaTeX widths cols = do
+tableRowToLaTeX :: Bool
+ -> [Alignment]
+ -> [Double]
+ -> [[Block]]
+ -> State WriterState Doc
+tableRowToLaTeX header aligns widths cols = do
renderedCells <- mapM blockListToLaTeX cols
- let toCell 0 c = c
- toCell w c = "\\parbox{" <> text (printf "%.2f" w) <>
- "\\columnwidth}{" <> c <> cr <> "}"
- let cells = zipWith toCell widths renderedCells
- return $ (hcat $ intersperse (" & ") cells) <> "\\\\"
+ let valign = text $ if header then "[b]" else "[t]"
+ let halign x = case x of
+ AlignLeft -> "\\raggedright"
+ AlignRight -> "\\raggedleft"
+ AlignCenter -> "\\centering"
+ AlignDefault -> "\\raggedright"
+ let toCell 0 _ c = c
+ toCell w a c = "\\parbox" <> valign <>
+ braces (text (printf "%.2f\\columnwidth" w)) <>
+ braces (halign a <> cr <> c <> cr)
+ let cells = zipWith3 toCell widths aligns renderedCells
+ return $ hcat $ intersperse (" & ") cells
listItemToLaTeX :: [Block] -> State WriterState Doc
listItemToLaTeX lst = blockListToLaTeX lst >>= return . (text "\\item" $$) .
@@ -317,7 +334,7 @@ listItemToLaTeX lst = blockListToLaTeX lst >>= return . (text "\\item" $$) .
defListItemToLaTeX :: ([Inline], [[Block]]) -> State WriterState Doc
defListItemToLaTeX (term, defs) = do
- term' <- inlineListToLaTeX $ deVerb term
+ term' <- inlineListToLaTeX term
def' <- liftM vsep $ mapM blockListToLaTeX defs
return $ "\\item" <> brackets term' $$ def'
@@ -335,23 +352,23 @@ isQuoted _ = False
inlineToLaTeX :: Inline -- ^ Inline to convert
-> State WriterState Doc
inlineToLaTeX (Emph lst) =
- inlineListToLaTeX (deVerb lst) >>= return . inCmd "emph"
+ inlineListToLaTeX lst >>= return . inCmd "emph"
inlineToLaTeX (Strong lst) =
- inlineListToLaTeX (deVerb lst) >>= return . inCmd "textbf"
+ inlineListToLaTeX lst >>= return . inCmd "textbf"
inlineToLaTeX (Strikeout lst) = do
- contents <- inlineListToLaTeX $ deVerb lst
+ contents <- inlineListToLaTeX lst
modify $ \s -> s{ stStrikeout = True }
return $ inCmd "sout" contents
inlineToLaTeX (Superscript lst) =
- inlineListToLaTeX (deVerb lst) >>= return . inCmd "textsuperscript"
+ inlineListToLaTeX lst >>= return . inCmd "textsuperscript"
inlineToLaTeX (Subscript lst) = do
modify $ \s -> s{ stSubscript = True }
- contents <- inlineListToLaTeX $ deVerb lst
+ contents <- inlineListToLaTeX lst
-- oddly, latex includes \textsuperscript but not \textsubscript
-- so we have to define it (using a different name so as not to conflict with memoir class):
return $ inCmd "textsubscr" contents
inlineToLaTeX (SmallCaps lst) =
- inlineListToLaTeX (deVerb lst) >>= return . inCmd "textsc"
+ inlineListToLaTeX lst >>= return . inCmd "textsc"
inlineToLaTeX (Cite cits lst) = do
st <- get
let opts = stOptions st
@@ -362,29 +379,38 @@ inlineToLaTeX (Cite cits lst) = do
inlineToLaTeX (Code _ str) = do
st <- get
- when (stInNote st) $ modify $ \s -> s{ stVerbInNote = True }
- let chr = ((enumFromTo '!' '~') \\ str) !! 0
if writerListings (stOptions st)
- then return $ text $ "\\lstinline" ++ [chr] ++ str ++ [chr]
- else return $ text $ "\\verb" ++ [chr] ++ str ++ [chr]
+ then do
+ when (stInNote st) $ modify $ \s -> s{ stVerbInNote = True }
+ let chr = ((enumFromTo '!' '~') \\ str) !! 0
+ return $ text $ "\\lstinline" ++ [chr] ++ str ++ [chr]
+ else return $ text $ "\\texttt{" ++ stringToLaTeX str ++ "}"
inlineToLaTeX (Quoted SingleQuote lst) = do
contents <- inlineListToLaTeX lst
- let s1 = if (not (null lst)) && (isQuoted (head lst))
- then "\\,"
- else empty
- let s2 = if (not (null lst)) && (isQuoted (last lst))
- then "\\,"
- else empty
- return $ char '`' <> s1 <> contents <> s2 <> char '\''
+ csquotes <- liftM stCsquotes get
+ if csquotes
+ then return $ "\\enquote" <> braces contents
+ else do
+ let s1 = if (not (null lst)) && (isQuoted (head lst))
+ then "\\,"
+ else empty
+ let s2 = if (not (null lst)) && (isQuoted (last lst))
+ then "\\,"
+ else empty
+ return $ char '`' <> s1 <> contents <> s2 <> char '\''
inlineToLaTeX (Quoted DoubleQuote lst) = do
contents <- inlineListToLaTeX lst
- let s1 = if (not (null lst)) && (isQuoted (head lst))
- then "\\,"
- else empty
- let s2 = if (not (null lst)) && (isQuoted (last lst))
- then "\\,"
- else empty
- return $ "``" <> s1 <> contents <> s2 <> "''"
+ csquotes <- liftM stCsquotes get
+ if csquotes
+ then return $ "\\enquote" <> braces contents
+ else do
+ let s1 = if (not (null lst)) && (isQuoted (head lst))
+ then "\\,"
+ else empty
+ let s2 = if (not (null lst)) && (isQuoted (last lst))
+ then "\\,"
+ else empty
+ return $ "``" <> s1 <> contents <> s2 <> "''"
inlineToLaTeX Apostrophe = return $ char '\''
inlineToLaTeX EmDash = return "---"
inlineToLaTeX EnDash = return "--"
@@ -402,19 +428,28 @@ inlineToLaTeX (Link txt (src, _)) =
[Code _ x] | x == src -> -- autolink
do modify $ \s -> s{ stUrl = True }
return $ text $ "\\url{" ++ x ++ "}"
- _ -> do contents <- inlineListToLaTeX $ deVerb txt
+ _ -> do contents <- inlineListToLaTeX txt
return $ text ("\\href{" ++ stringToLaTeX src ++ "}{") <>
contents <> char '}'
inlineToLaTeX (Image _ (source, _)) = do
modify $ \s -> s{ stGraphics = True }
- return $ "\\includegraphics" <> braces (text source)
+ let source' = if isAbsoluteURI source
+ then source
+ else unEscapeString source
+ return $ "\\includegraphics" <> braces (text source')
inlineToLaTeX (Note contents) = do
modify (\s -> s{stInNote = True})
contents' <- blockListToLaTeX contents
modify (\s -> s {stInNote = False})
- -- note: a \n before } is needed when note ends with a Verbatim environment
- return $ "\\footnote" <> braces (nest 2 contents')
-
+ inTable <- liftM stInTable get
+ if inTable
+ then do
+ curnotes <- liftM stTableNotes get
+ let marker = cycle ['a'..'z'] !! length curnotes
+ modify $ \s -> s{ stTableNotes = (marker, contents') : curnotes }
+ return $ "\\tmark" <> brackets (char marker) <> space
+ else return $ "\\footnote" <> braces (nest 2 contents')
+ -- note: a \n before } needed when note ends with a Verbatim environment
citationsToNatbib :: [Citation] -> State WriterState Doc
citationsToNatbib (one:[])
diff --git a/src/Text/Pandoc/Writers/Markdown.hs b/src/Text/Pandoc/Writers/Markdown.hs
index 5e12c4aca..48e9578b4 100644
--- a/src/Text/Pandoc/Writers/Markdown.hs
+++ b/src/Text/Pandoc/Writers/Markdown.hs
@@ -366,7 +366,19 @@ blockListToMarkdown :: WriterOptions -- ^ Options
-> [Block] -- ^ List of block elements
-> State WriterState Doc
blockListToMarkdown opts blocks =
- mapM (blockToMarkdown opts) blocks >>= return . cat
+ mapM (blockToMarkdown opts) (fixBlocks blocks) >>= return . cat
+ -- insert comment between list and indented code block, or the
+ -- code block will be treated as a list continuation paragraph
+ where fixBlocks (b : CodeBlock attr x : rest)
+ | (writerStrictMarkdown opts || attr == nullAttr) && isListBlock b =
+ b : RawBlock "html" "<!-- -->\n" : CodeBlock attr x :
+ fixBlocks rest
+ fixBlocks (x : xs) = x : fixBlocks xs
+ fixBlocks [] = []
+ isListBlock (BulletList _) = True
+ isListBlock (OrderedList _ _) = True
+ isListBlock (DefinitionList _) = True
+ isListBlock _ = False
-- | Get reference for target; if none exists, create unique one and return.
-- Prefer label if possible; otherwise, generate a unique key.
diff --git a/src/Text/Pandoc/Writers/ODT.hs b/src/Text/Pandoc/Writers/ODT.hs
index cf1be8755..f8030965c 100644
--- a/src/Text/Pandoc/Writers/ODT.hs
+++ b/src/Text/Pandoc/Writers/ODT.hs
@@ -29,6 +29,7 @@ Conversion of 'Pandoc' documents to ODT.
-}
module Text.Pandoc.Writers.ODT ( writeODT ) where
import Data.IORef
+import Data.List ( isPrefixOf )
import System.FilePath ( (</>), takeExtension )
import qualified Data.ByteString.Lazy as B
import Data.ByteString.Lazy.UTF8 ( fromString )
@@ -36,11 +37,15 @@ import Codec.Archive.Zip
import System.Time
import Paths_pandoc ( getDataFileName )
import Text.Pandoc.Shared ( WriterOptions(..) )
+import Text.Pandoc.MIME ( getMimeType )
import Text.Pandoc.Definition
import Text.Pandoc.Generic
import Text.Pandoc.Writers.OpenDocument ( writeOpenDocument )
import System.Directory
import Control.Monad (liftM)
+import Network.URI ( unEscapeString )
+import Text.Pandoc.XML
+import Text.Pandoc.Pretty
-- | Produce an ODT file from a Pandoc document.
writeODT :: Maybe FilePath -- ^ Path specified by --reference-odt
@@ -69,14 +74,37 @@ writeODT mbRefOdt opts doc = do
(TOD epochtime _) <- getClockTime
let contentEntry = toEntry "content.xml" epochtime $ fromString newContents
picEntries <- readIORef picEntriesRef
- let archive = foldr addEntryToArchive refArchive (contentEntry : picEntries)
- return $ fromArchive archive
+ let archive = foldr addEntryToArchive refArchive $ contentEntry : picEntries
+ -- construct META-INF/manifest.xml based on archive
+ let toFileEntry fp = case getMimeType fp of
+ Nothing -> empty
+ Just m -> selfClosingTag "manifest:file-entry"
+ [("manifest:media-type", m)
+ ,("manifest:full-path", fp)
+ ]
+ let files = [ ent | ent <- filesInArchive archive, not ("META-INF" `isPrefixOf` ent) ]
+ let manifestEntry = toEntry "META-INF/manifest.xml" epochtime
+ $ fromString $ show
+ $ text "<?xml version=\"1.0\" encoding=\"utf-8\"?>"
+ $$
+ ( inTags True "manifest:manifest"
+ [("xmlns:manifest","urn:oasis:names:tc:opendocument:xmlns:manifest:1.0")]
+ $ ( selfClosingTag "manifest:file-entry"
+ [("manifest:media-type","application/vnd.oasis.opendocument.text")
+ ,("manifest:version","1.2")
+ ,("manifest:full-path","/")]
+ $$ vcat ( map toFileEntry $ files )
+ )
+ )
+ let archive' = addEntryToArchive manifestEntry archive
+ return $ fromArchive archive'
transformPic :: FilePath -> IORef [Entry] -> Inline -> IO Inline
transformPic sourceDir entriesRef (Image lab (src,tit)) = do
+ let src' = unEscapeString src
entries <- readIORef entriesRef
- let newsrc = "Pictures/" ++ show (length entries) ++ takeExtension src
- catch (readEntry [] (sourceDir </> src) >>= \entry ->
+ let newsrc = "Pictures/" ++ show (length entries) ++ takeExtension src'
+ catch (readEntry [] (sourceDir </> src') >>= \entry ->
modifyIORef entriesRef (entry{ eRelativePath = newsrc } :) >>
return (Image lab (newsrc, tit)))
(\_ -> return (Emph lab))
diff --git a/src/Text/Pandoc/Writers/OpenDocument.hs b/src/Text/Pandoc/Writers/OpenDocument.hs
index b9444aac7..e675f4e65 100644
--- a/src/Text/Pandoc/Writers/OpenDocument.hs
+++ b/src/Text/Pandoc/Writers/OpenDocument.hs
@@ -62,6 +62,7 @@ data WriterState =
, stIndentPara :: Int
, stInDefinition :: Bool
, stTight :: Bool
+ , stFirstPara :: Bool
}
defaultWriterState :: WriterState
@@ -75,6 +76,7 @@ defaultWriterState =
, stIndentPara = 0
, stInDefinition = False
, stTight = False
+ , stFirstPara = False
}
when :: Bool -> Doc -> Doc
@@ -111,10 +113,18 @@ inTightList f = modify (\s -> s { stTight = True }) >> f >>= \r ->
setInDefinitionList :: Bool -> State WriterState ()
setInDefinitionList b = modify $ \s -> s { stInDefinition = b }
-inParagraphTags :: Doc -> Doc
-inParagraphTags d | isEmpty d = empty
-inParagraphTags d =
- inTags False "text:p" [("text:style-name", "Text_20_body")] d
+setFirstPara :: State WriterState ()
+setFirstPara = modify $ \s -> s { stFirstPara = True }
+
+inParagraphTags :: Doc -> State WriterState Doc
+inParagraphTags d | isEmpty d = return empty
+inParagraphTags d = do
+ b <- gets stFirstPara
+ a <- if b
+ then do modify $ \st -> st { stFirstPara = False }
+ return $ [("text:style-name", "First_20_paragraph")]
+ else return [("text:style-name", "Text_20_body")]
+ return $ inTags False "text:p" a d
inParagraphTagsWithStyle :: String -> Doc -> Doc
inParagraphTagsWithStyle sty = inTags False "text:p" [("text:style-name", sty)]
@@ -138,9 +148,10 @@ inTextStyle d = do
$ selfClosingTag "style:text-properties" (concatMap snd $ Map.toList at)
return $ inTags False "text:span" [("text:style-name","T" ++ show tn)] d
-inHeaderTags :: Int -> Doc -> Doc
-inHeaderTags i = inTags False "text:h" [ ("text:style-name", "Heading_20_" ++ show i)
- , ("text:outline-level", show i)]
+inHeaderTags :: Int -> Doc -> State WriterState Doc
+inHeaderTags i d =
+ return $ inTags False "text:h" [ ("text:style-name", "Heading_20_" ++ show i)
+ , ("text:outline-level", show i)] d
inQuotes :: QuoteType -> Doc -> Doc
inQuotes SingleQuote s = text "&#8216;" <> s <> text "&#8217;"
@@ -164,7 +175,7 @@ writeOpenDocument :: WriterOptions -> Pandoc -> String
writeOpenDocument opts (Pandoc (Meta title authors date) blocks) =
let ((doc, title', authors', date'),s) = flip runState
defaultWriterState $ do
- title'' <- inlinesToOpenDocument opts title
+ title'' <- inlinesToOpenDocument opts title
authors'' <- mapM (inlinesToOpenDocument opts) authors
date'' <- inlinesToOpenDocument opts date
doc'' <- blocksToOpenDocument opts blocks
@@ -274,18 +285,20 @@ blocksToOpenDocument o b = vcat <$> mapM (blockToOpenDocument o) b
-- | Convert a Pandoc block element to OpenDocument.
blockToOpenDocument :: WriterOptions -> Block -> State WriterState Doc
blockToOpenDocument o bs
- | Plain b <- bs = inParagraphTags <$> inlinesToOpenDocument o b
- | Para b <- bs = inParagraphTags <$> inlinesToOpenDocument o b
- | Header i b <- bs = inHeaderTags i <$> inlinesToOpenDocument o b
- | BlockQuote b <- bs = mkBlockQuote b
- | CodeBlock _ s <- bs = preformatted s
+ | Plain b <- bs = inParagraphTags =<< inlinesToOpenDocument o b
+ | Para b <- bs = inParagraphTags =<< inlinesToOpenDocument o b
+ | Header i b <- bs = setFirstPara >>
+ (inHeaderTags i =<< inlinesToOpenDocument o b)
+ | BlockQuote b <- bs = setFirstPara >> mkBlockQuote b
+ | DefinitionList b <- bs = setFirstPara >> defList b
+ | BulletList b <- bs = setFirstPara >> bulletListToOpenDocument o b
+ | OrderedList a b <- bs = setFirstPara >> orderedList a b
+ | CodeBlock _ s <- bs = setFirstPara >> preformatted s
+ | Table c a w h r <- bs = setFirstPara >> table c a w h r
+ | HorizontalRule <- bs = setFirstPara >> return (selfClosingTag "text:p"
+ [ ("text:style-name", "Horizontal_20_Line") ])
| RawBlock _ _ <- bs = return empty
- | DefinitionList b <- bs = defList b
- | BulletList b <- bs = bulletListToOpenDocument o b
- | OrderedList a b <- bs = orderedList a b
- | Table c a w h r <- bs = table c a w h r
| Null <- bs = return empty
- | HorizontalRule <- bs = return $ selfClosingTag "text:p" [ ("text:style-name", "Horizontal_20_Line") ]
| otherwise = return empty
where
defList b = do setInDefinitionList True
@@ -381,14 +394,14 @@ inlineToOpenDocument o ils
mkImg s = inTags False "draw:frame" [] $
selfClosingTag "draw:image" [ ("xlink:href" , s )
, ("xlink:type" , "simple")
- , (" xlink:show" , "embed" )
+ , ("xlink:show" , "embed" )
, ("xlink:actuate", "onLoad")]
mkNote l = do
n <- length <$> gets stNotes
let footNote t = inTags False "text:note"
[ ("text:id" , "ftn" ++ show n)
, ("text:note-class", "footnote" )] $
- inTagsSimple "text:note-citation" (text . show $ n + 1) <>
+ inTagsSimple "text:note-citation" (text . show $ n + 1) <>
inTagsSimple "text:note-body" t
nn <- footNote <$> withParagraphStyle o "Footnote" l
addNote nn
diff --git a/src/Text/Pandoc/Writers/RTF.hs b/src/Text/Pandoc/Writers/RTF.hs
index 605e4162b..eb36c1ca6 100644
--- a/src/Text/Pandoc/Writers/RTF.hs
+++ b/src/Text/Pandoc/Writers/RTF.hs
@@ -37,23 +37,28 @@ import Data.Char ( ord, isDigit, toLower )
import System.FilePath ( takeExtension )
import qualified Data.ByteString as B
import Text.Printf ( printf )
+import Network.URI ( isAbsoluteURI, unEscapeString )
-- | Convert Image inlines into a raw RTF embedded image, read from a file.
-- If file not found or filetype not jpeg or png, leave the inline unchanged.
rtfEmbedImage :: Inline -> IO Inline
-rtfEmbedImage x@(Image _ (src,_))
- | map toLower (takeExtension src) `elem` [".jpg",".jpeg",".png"] = do
- imgdata <- catch (B.readFile src) (\_ -> return B.empty)
- let bytes = map (printf "%02x") $ B.unpack imgdata
- let filetype = case map toLower (takeExtension src) of
- ".jpg" -> "\\jpegblip"
- ".jpeg" -> "\\jpegblip"
- ".png" -> "\\pngblip"
- _ -> error "Unknown file type"
- let raw = "{\\pict" ++ filetype ++ " " ++ concat bytes ++ "}"
- return $ if B.null imgdata
- then x
- else RawInline "rtf" raw
+rtfEmbedImage x@(Image _ (src,_)) = do
+ let ext = map toLower (takeExtension src)
+ if ext `elem` [".jpg",".jpeg",".png"] && not (isAbsoluteURI src)
+ then do
+ let src' = unEscapeString src
+ imgdata <- catch (B.readFile src') (\_ -> return B.empty)
+ let bytes = map (printf "%02x") $ B.unpack imgdata
+ let filetype = case ext of
+ ".jpg" -> "\\jpegblip"
+ ".jpeg" -> "\\jpegblip"
+ ".png" -> "\\pngblip"
+ _ -> error "Unknown file type"
+ let raw = "{\\pict" ++ filetype ++ " " ++ concat bytes ++ "}"
+ return $ if B.null imgdata
+ then x
+ else RawInline "rtf" raw
+ else return x
rtfEmbedImage x = return x
-- | Convert Pandoc to a string in rich text format.
diff --git a/src/Text/Pandoc/Writers/Texinfo.hs b/src/Text/Pandoc/Writers/Texinfo.hs
index c8638cdd7..4f6645cd5 100644
--- a/src/Text/Pandoc/Writers/Texinfo.hs
+++ b/src/Text/Pandoc/Writers/Texinfo.hs
@@ -37,6 +37,8 @@ import Data.Ord ( comparing )
import Data.Char ( chr, ord )
import Control.Monad.State
import Text.Pandoc.Pretty
+import Network.URI ( isAbsoluteURI, unEscapeString )
+import System.FilePath
data WriterState =
WriterState { stStrikeout :: Bool -- document contains strikeout
@@ -412,11 +414,11 @@ inlineToTexinfo (Image alternate (source, _)) = do
return $ text ("@image{" ++ base ++ ",,,") <> content <> text "," <>
text (ext ++ "}")
where
- (revext, revbase) = break (=='.') (reverse source)
- ext = reverse revext
- base = case revbase of
- ('.' : rest) -> reverse rest
- _ -> reverse revbase
+ ext = drop 1 $ takeExtension source'
+ base = takeBaseName source'
+ source' = if isAbsoluteURI source
+ then source
+ else unEscapeString source
inlineToTexinfo (Note contents) = do
contents' <- blockListToTexinfo contents
diff --git a/src/markdown2pdf.hs b/src/markdown2pdf.hs
index 005717bf0..d6ee39dab 100644
--- a/src/markdown2pdf.hs
+++ b/src/markdown2pdf.hs
@@ -2,24 +2,63 @@ module Main where
import Data.List (isInfixOf, intercalate, isPrefixOf)
import Data.Maybe (isNothing)
+import qualified Data.ByteString as BS
+import Codec.Binary.UTF8.String (decodeString, encodeString)
+import Data.ByteString.UTF8 (toString)
+import Control.Monad (unless, guard, liftM, when)
+import Control.Concurrent (putMVar, takeMVar, newEmptyMVar, forkIO)
+import Control.Exception (tryJust, bracket, evaluate)
-import Control.Monad (unless, guard)
-import Control.Exception (tryJust, bracket)
-
-import System.IO (stderr)
+import System.IO
import System.IO.Error (isDoesNotExistError)
import System.Environment ( getArgs, getProgName )
import qualified Text.Pandoc.UTF8 as UTF8
import System.Exit (ExitCode (..), exitWith)
import System.FilePath
import System.Directory
-import System.Process (readProcessWithExitCode)
-import Codec.Binary.UTF8.String (decodeString, encodeString)
-import Control.Monad (liftM)
+import System.Process
+
+-- A variant of 'readProcessWithExitCode' that does not
+-- cause an error if the output is not UTF-8. (Copied
+-- with slight variants from 'System.Process'.)
+readProcessWithExitCode'
+ :: FilePath -- ^ command to run
+ -> [String] -- ^ any arguments
+ -> String -- ^ standard input
+ -> IO (ExitCode,String,String) -- ^ exitcode, stdout, stderr
+readProcessWithExitCode' cmd args input = do
+ (Just inh, Just outh, Just errh, pid) <-
+ createProcess (proc cmd args){ std_in = CreatePipe,
+ std_out = CreatePipe,
+ std_err = CreatePipe }
+
+ outMVar <- newEmptyMVar
+
+ -- fork off a thread to start consuming stdout
+ out <- liftM toString $ BS.hGetContents outh
+ _ <- forkIO $ evaluate (length out) >> putMVar outMVar ()
+
+ -- fork off a thread to start consuming stderr
+ err <- liftM toString $ BS.hGetContents errh
+ _ <- forkIO $ evaluate (length err) >> putMVar outMVar ()
+
+ -- now write and flush any input
+ when (not (null input)) $ do hPutStr inh input; hFlush inh
+ hClose inh -- done with stdin
+
+ -- wait on the output
+ takeMVar outMVar
+ takeMVar outMVar
+ hClose outh
+
+ -- wait on the process
+ ex <- waitForProcess pid
+
+ return (ex, out, err)
run :: FilePath -> [String] -> IO (Either String String)
run file opts = do
- (code, out, err) <- readProcessWithExitCode (encodeString file)
+ (code, out, err) <- readProcessWithExitCode' (encodeString file)
(map encodeString opts) ""
let msg = out ++ err
case code of
@@ -48,11 +87,12 @@ runPandoc inputsAndArgs output = do
runLatexRaw :: String -> FilePath -> IO (Either (Either String String) FilePath)
runLatexRaw latexProgram file = do
-- we ignore the ExitCode because pdflatex always fails the first time
- run latexProgram ["-interaction=batchmode", "-output-directory",
- takeDirectory file, dropExtension file] >> return ()
+ run latexProgram ["-halt-on-error", "-interaction", "nonstopmode",
+ "-output-directory", takeDirectory file, dropExtension file] >> return ()
let pdfFile = replaceExtension file "pdf"
let logFile = replaceExtension file "log"
- txt <- tryJust (guard . isDoesNotExistError) (UTF8.readFile logFile)
+ txt <- tryJust (guard . isDoesNotExistError)
+ (liftM toString $ BS.readFile logFile)
let checks = checkLatex $ either (const "") id txt
case checks of
-- err , bib , ref , msg
@@ -79,7 +119,9 @@ checkLatex "" = (True, False, False, "Could not read log file")
checkLatex txt = (err , bib, ref, unlines $! msgs ++ tips)
where
xs `oneOf` x = any (flip isInfixOf x) xs
- msgs = filter (oneOf ["Error:", "Warning:"]) (lines txt)
+ msgs = dropWhile (not . errorline) $ lines txt
+ errorline ('!':_) = True
+ errorline _ = False
tips = checkPackages msgs
err = any (oneOf ["!", "LaTeX Error:", "Latex Error:"]) msgs
bib = any (oneOf ["Warning: Citation"
@@ -122,7 +164,7 @@ exit x = do
saveStdin :: FilePath -> IO (Either String FilePath)
saveStdin file = do
- text <- UTF8.getContents
+ text <- liftM toString $ BS.getContents
UTF8.writeFile file text
fileExist <- doesFileExist (encodeString file)
case fileExist of
@@ -152,7 +194,7 @@ main = bracket
let goodopts = ["-f","-r","-N", "-p","-R","-H","-B","-A", "-C","-o","-V"]
let goodoptslong = ["--from","--read","--strict",
"--preserve-tabs","--tab-stop","--parse-raw",
- "--toc","--table-of-contents", "--xetex",
+ "--toc","--table-of-contents", "--xetex", "--luatex",
"--number-sections","--include-in-header",
"--include-before-body","--include-after-body",
"--custom-header","--output",
@@ -164,17 +206,23 @@ main = bracket
-- note that a long option can come in this form: --opt=val
let isGoodopt x = x `elem` (goodopts ++ goodoptslong) ||
any (\o -> (o ++ "=") `isPrefixOf` x) goodoptslong
+ let markdown2pdfOpts = ["--xetex","--luatex"]
unless (all isGoodopt opts) $ do
(code, out, _err) <- readProcessWithExitCode "pandoc" ["--help"] ""
UTF8.putStrLn "markdown2pdf [OPTIONS] [FILES]\nOptions:"
UTF8.putStr $ unlines $
- filter (\l -> any (`isInfixOf` l) goodoptslong) $ lines out
+ filter (\l -> any (`isInfixOf` l) goodoptslong) (lines out)
+ ++ map (replicate 24 ' ' ++) markdown2pdfOpts
exitWith code
+ let args' = filter (`notElem` markdown2pdfOpts) args
+
-- check for executable files
let latexProgram = if "--xetex" `elem` opts
then "xelatex"
- else "pdflatex"
+ else if "--luatex" `elem` opts
+ then "lualatex"
+ else "pdflatex"
let execs = ["pandoc", latexProgram, "bibtex"]
paths <- mapM findExecutable execs
let miss = map snd $ filter (isNothing . fst) $ zip paths execs
@@ -182,7 +230,7 @@ main = bracket
-- parse arguments
-- if no input given, use 'stdin'
- pandocArgs <- parsePandocArgs args
+ pandocArgs <- parsePandocArgs args'
(input, output) <- case pandocArgs of
Nothing -> exit "Could not parse arguments"
Just ([],out) -> do
@@ -193,7 +241,7 @@ main = bracket
-- no need because we'll pass all arguments to pandoc
Just (_ ,out) -> return ([], out)
-- run pandoc
- pandocRes <- runPandoc (input ++ args) $ replaceDirectory output tmp
+ pandocRes <- runPandoc (input ++ args') $ replaceDirectory output tmp
case pandocRes of
Left err -> exit err
Right texFile -> do
diff --git a/src/pandoc.hs b/src/pandoc.hs
index 27e4579aa..27bc2c25c 100644
--- a/src/pandoc.hs
+++ b/src/pandoc.hs
@@ -44,6 +44,8 @@ import Data.Char ( toLower )
import Data.List ( intercalate, isSuffixOf, isPrefixOf )
import System.Directory ( getAppUserDataDirectory, doesFileExist )
import System.IO ( stdout, stderr )
+import System.IO.Error ( isDoesNotExistError )
+import Control.Exception.Extensible ( throwIO )
import qualified Text.Pandoc.UTF8 as UTF8
import Text.CSL
import Text.Pandoc.Biblio
@@ -93,7 +95,7 @@ data Opt = Opt
, optParseRaw :: Bool -- ^ Parse unconvertable HTML and TeX
, optTableOfContents :: Bool -- ^ Include table of contents
, optTransforms :: [Pandoc -> Pandoc] -- ^ Doc transforms to apply
- , optTemplate :: String -- ^ Custom template
+ , optTemplate :: Maybe FilePath -- ^ Custom template
, optVariables :: [(String,String)] -- ^ Template variables to set
, optOutputFile :: String -- ^ Name of output file
, optNumberSections :: Bool -- ^ Number sections in LaTeX
@@ -137,7 +139,7 @@ defaultOpts = Opt
, optParseRaw = False
, optTableOfContents = False
, optTransforms = []
- , optTemplate = ""
+ , optTemplate = Nothing
, optVariables = []
, optOutputFile = "-" -- "-" means stdout
, optNumberSections = False
@@ -286,8 +288,12 @@ options =
"" -- "Use jsMath for HTML math"
, Option "" ["mathjax"]
- (ReqArg
- (\arg opt -> return opt { optHTMLMathMethod = MathJax arg})
+ (OptArg
+ (\arg opt -> do
+ let url' = case arg of
+ Just u -> u
+ Nothing -> "https://d3eoax9i5htok0.cloudfront.net/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"
+ return opt { optHTMLMathMethod = MathJax url'})
"URL")
"" -- "Use MathJax for HTML math"
@@ -309,7 +315,10 @@ options =
, Option "" ["xetex"]
(NoArg
- (\opt -> return opt { optXeTeX = True }))
+ (\opt -> do
+ UTF8.hPutStrLn stderr $ "pandoc: --xetex is deprecated. "
+ ++ "It is no longer needed for use with XeTeX."
+ return opt { optXeTeX = True }))
"" -- "Format latex for processing by XeTeX"
, Option "" ["chapters"]
@@ -404,8 +413,7 @@ options =
, Option "" ["template"]
(ReqArg
(\arg opt -> do
- text <- UTF8.readFile arg
- return opt{ optTemplate = text,
+ return opt{ optTemplate = Just arg,
optStandalone = True })
"FILENAME")
"" -- "Use custom template"
@@ -490,6 +498,14 @@ options =
"FILENAME")
"" -- "Path of epub.css"
+ , Option "" ["epub-cover-image"]
+ (ReqArg
+ (\arg opt ->
+ return opt { optVariables =
+ ("epub-cover-image", arg) : optVariables opt })
+ "FILENAME")
+ "" -- "Path of epub cover image"
+
, Option "" ["epub-metadata"]
(ReqArg
(\arg opt -> do
@@ -661,13 +677,12 @@ main = do
, optVariables = variables
, optTableOfContents = toc
, optTransforms = transforms
- , optTemplate = template
+ , optTemplate = templatePath
, optOutputFile = outputFile
, optNumberSections = numberSections
, optSectionDivs = sectionDivs
, optIncremental = incremental
, optOffline = offline
- , optXeTeX = xetex
, optSmart = smart
, optHtml5 = html5
, optChapters = chapters
@@ -721,10 +736,25 @@ main = do
Just r -> return r
Nothing -> error ("Unknown reader: " ++ readerName')
- templ <- getDefaultTemplate datadir writerName'
- let defaultTemplate = case templ of
- Right t -> t
- Left e -> error (show e)
+ templ <- case templatePath of
+ Nothing -> do
+ deftemp <- getDefaultTemplate datadir writerName'
+ case deftemp of
+ Left e -> throwIO e
+ Right t -> return t
+ Just tp -> do
+ -- strip off "+lhs" if present
+ let format = takeWhile (/='+') writerName'
+ let tp' = case takeExtension tp of
+ "" -> tp <.> format
+ _ -> tp
+ catch (UTF8.readFile tp')
+ (\e -> if isDoesNotExistError e
+ then catch
+ (readDataFile datadir $
+ "templates" </> tp')
+ (\_ -> throwIO e)
+ else throwIO e)
let standalone' = standalone || isNonTextOutput writerName'
@@ -736,7 +766,7 @@ main = do
slidyJs <- readDataFile datadir $
"slidy" </> "slidy.min.js"
slidyCss <- readDataFile datadir $
- "slidy" </> "slidy.min.css"
+ "slidy" </> "slidy.css"
return $ ("slidy-js", slidyJs) :
("slidy-css", slidyCss) : variables
_ -> return variables
@@ -778,10 +808,9 @@ main = do
stateIndentedCodeClasses = codeBlockClasses,
stateApplyMacros = writerName' `notElem` ["latex", "latex+lhs"] }
- let writerOptions = WriterOptions { writerStandalone = standalone',
- writerTemplate = if null template
- then defaultTemplate
- else template,
+ let writerOptions = defaultWriterOptions
+ { writerStandalone = standalone',
+ writerTemplate = templ,
writerVariables = variables'',
writerEPUBMetadata = epubMetadata,
writerTabStop = tabStop,
@@ -790,7 +819,6 @@ main = do
writerHTMLMathMethod = mathMethod,
writerSlideVariant = slideVariant,
writerIncremental = incremental,
- writerXeTeX = xetex,
writerCiteMethod = citeMethod,
writerBiblioFiles = reffiles,
writerIgnoreNotes = False,
diff --git a/src/test-pandoc.hs b/src/test-pandoc.hs
index 2b6c2bb49..33c46f2ba 100644
--- a/src/test-pandoc.hs
+++ b/src/test-pandoc.hs
@@ -11,6 +11,7 @@ import qualified Tests.Readers.RST
import qualified Tests.Writers.ConTeXt
import qualified Tests.Writers.HTML
import qualified Tests.Writers.Native
+import qualified Tests.Writers.Markdown
import qualified Tests.Shared
tests :: [Test]
@@ -20,6 +21,7 @@ tests = [ testGroup "Old" Tests.Old.tests
[ testGroup "Native" Tests.Writers.Native.tests
, testGroup "ConTeXt" Tests.Writers.ConTeXt.tests
, testGroup "HTML" Tests.Writers.HTML.tests
+ , testGroup "Markdown" Tests.Writers.Markdown.tests
]
, testGroup "Readers"
[ testGroup "LaTeX" Tests.Readers.LaTeX.tests
diff --git a/templates/context.template b/templates/default.context
index 4269d06a1..4269d06a1 100644
--- a/templates/context.template
+++ b/templates/default.context
diff --git a/templates/docbook.template b/templates/default.docbook
index 66dfbef8d..66dfbef8d 100644
--- a/templates/docbook.template
+++ b/templates/default.docbook
diff --git a/templates/html.template b/templates/default.html
index 3f8b76fed..d107f4809 100644
--- a/templates/html.template
+++ b/templates/default.html
@@ -26,7 +26,9 @@ $if(html5)$
$endif$
$if(highlighting-css)$
<style type="text/css">
+/*<![CDATA[*/
$highlighting-css$
+/*]]>*/
</style>
$endif$
$for(css)$
@@ -49,14 +51,32 @@ $endfor$
$if(title)$
$if(html5)$
<header>
+$else$
+<div id="$idprefix$header">
$endif$
<h1 class="title">$title$</h1>
+$for(author)$
+<h3 class="author">$author$</h3>
+$endfor$
+$if(date)$
+<h4 class="date">$date$</h4>
+$endif$
$if(html5)$
</header>
+$else$
+</div>
$endif$
$endif$
$if(toc)$
+$if(html5)$
+<nav id="$idprefix$TOC">
$toc$
+</nav>
+$else$
+<div id="$idprefix$TOC">
+$toc$
+</div>
+$endif$
$endif$
$body$
$for(include-after)$
diff --git a/templates/latex.template b/templates/default.latex
index 40de32109..e56583392 100644
--- a/templates/latex.template
+++ b/templates/default.latex
@@ -1,18 +1,17 @@
\documentclass$if(fontsize)$[$fontsize$]$endif${article}
\usepackage{amssymb,amsmath}
-$if(xetex)$
-\usepackage{ifxetex}
+\usepackage{ifxetex,ifluatex}
\ifxetex
\usepackage{fontspec,xltxtra,xunicode}
\defaultfontfeatures{Mapping=tex-text,Scale=MatchLowercase}
\else
- \usepackage[mathletters]{ucs}
- \usepackage[utf8x]{inputenc}
+ \ifluatex
+ \usepackage{fontspec}
+ \defaultfontfeatures{Mapping=tex-text,Scale=MatchLowercase}
+ \else
+ \usepackage[utf8]{inputenc}
+ \fi
\fi
-$else$
-\usepackage[mathletters]{ucs}
-\usepackage[utf8x]{inputenc}
-$endif$
$if(natbib)$
\usepackage{natbib}
\bibliographystyle{plainnat}
@@ -40,18 +39,8 @@ $if(fancy-enums)$
\usepackage{enumerate}
$endif$
$if(tables)$
-\usepackage{array}
-% This is needed because raggedright in table elements redefines \\:
-\newcommand{\PreserveBackslash}[1]{\let\temp=\\#1\let\\=\temp}
-\let\PBS=\PreserveBackslash
-$endif$
-$if(strikeout)$
-\usepackage[normalem]{ulem}
-% avoid problems with \sout in headers with hyperref:
-\pdfstringdefDisableCommands{\renewcommand{\sout}{}}
-$endif$
-$if(subscript)$
-\newcommand{\textsubscr}[1]{\ensuremath{_{\scriptsize\textrm{#1}}}}
+\usepackage{ctable}
+\usepackage{float} % provides the H option for float placement
$endif$
$if(url)$
\usepackage{url}
@@ -68,9 +57,25 @@ $if(graphics)$
\let\Oldincludegraphics\includegraphics
\renewcommand{\includegraphics}[1]{\Oldincludegraphics[width=\maxwidth]{#1}}
$endif$
-\usepackage[breaklinks=true,unicode=true,pdfborder={0 0 0}]{hyperref}
+\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, pdfborder={0 0 0}}
+$if(strikeout)$
+\usepackage[normalem]{ulem}
+% avoid problems with \sout in headers with hyperref:
+\pdfstringdefDisableCommands{\renewcommand{\sout}{}}
+$endif$
+$if(subscript)$
+\newcommand{\textsubscr}[1]{\ensuremath{_{\scriptsize\textrm{#1}}}}
+$endif$
\setlength{\parindent}{0pt}
\setlength{\parskip}{6pt plus 2pt minus 1pt}
+\setlength{\emergencystretch}{3em} % prevent overfull lines
$if(listings)$
\usepackage{listings}
$endif$
@@ -89,7 +94,7 @@ $if(title)$
\title{$title$}
$endif$
$if(author)$
-\author{$for(author)$$author$$sep$\\$endfor$}
+\author{$for(author)$$author$$sep$ \and $endfor$}
$endif$
$if(date)$
\date{$date$}
@@ -109,8 +114,9 @@ $if(toc)$
$endif$
$body$
-$if(biblio-files)$
+
$if(natbib)$
+$if(biblio-files)$
$if(biblio-title)$
$if(book-class)$
\renewcommand\bibname{$biblio-title$}
@@ -119,14 +125,15 @@ $else$
$endif$
$endif$
\bibliography{$biblio-files$}
+
$endif$
$endif$
$if(biblatex)$
\printbibliography$if(biblio-title)$[title=$biblio-title$]$endif$
+
$endif$
$for(include-after)$
-
$include-after$
-$endfor$
+$endfor$
\end{document}
diff --git a/templates/man.template b/templates/default.man
index ff86c8ca6..ff86c8ca6 100644
--- a/templates/man.template
+++ b/templates/default.man
diff --git a/templates/markdown.template b/templates/default.markdown
index d500d3384..d500d3384 100644
--- a/templates/markdown.template
+++ b/templates/default.markdown
diff --git a/templates/mediawiki.template b/templates/default.mediawiki
index 5d210fa7d..5d210fa7d 100644
--- a/templates/mediawiki.template
+++ b/templates/default.mediawiki
diff --git a/templates/opendocument.template b/templates/default.opendocument
index ca49782f0..ca49782f0 100644
--- a/templates/opendocument.template
+++ b/templates/default.opendocument
diff --git a/templates/org.template b/templates/default.org
index eaaa17533..eaaa17533 100644
--- a/templates/org.template
+++ b/templates/default.org
diff --git a/templates/plain.template b/templates/default.plain
index 06ecbd3a6..06ecbd3a6 100644
--- a/templates/plain.template
+++ b/templates/default.plain
diff --git a/templates/rst.template b/templates/default.rst
index f09bdd8b9..f09bdd8b9 100644
--- a/templates/rst.template
+++ b/templates/default.rst
diff --git a/templates/rtf.template b/templates/default.rtf
index 833e19844..833e19844 100644
--- a/templates/rtf.template
+++ b/templates/default.rtf
diff --git a/templates/s5.template b/templates/default.s5
index c1f727f6e..6f862ce7b 100644
--- a/templates/s5.template
+++ b/templates/default.s5
@@ -25,12 +25,12 @@ $if(s5includes)$
$s5includes$
$else$
<!-- style sheet links -->
- <link rel="stylesheet" href="ui/default/slides.css" type="text/css" media="projection" id="slideProj" />
- <link rel="stylesheet" href="ui/default/outline.css" type="text/css" media="screen" id="outlineStyle" />
- <link rel="stylesheet" href="ui/default/print.css" type="text/css" media="print" id="slidePrint" />
- <link rel="stylesheet" href="ui/default/opera.css" type="text/css" media="projection" id="operaFix" />
+ <link rel="stylesheet" href="$s5-url$/slides.css" type="text/css" media="projection" id="slideProj" />
+ <link rel="stylesheet" href="$s5-url$/outline.css" type="text/css" media="screen" id="outlineStyle" />
+ <link rel="stylesheet" href="$s5-url$/print.css" type="text/css" media="print" id="slidePrint" />
+ <link rel="stylesheet" href="$s5-url$/opera.css" type="text/css" media="projection" id="operaFix" />
<!-- S5 JS -->
- <script src="ui/default/slides.js" type="text/javascript"></script>
+ <script src="$s5-url$/slides.js" type="text/javascript"></script>
$endif$
$if(math)$
$math$
diff --git a/templates/slidy.template b/templates/default.slidy
index 9cfdb8f5e..75d2ebedd 100644
--- a/templates/slidy.template
+++ b/templates/default.slidy
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
+<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="pandoc" />
@@ -14,20 +14,25 @@ $endif$
$if(highlighting-css)$
<title>$if(title-prefix)$$title-prefix$ - $endif$$if(pagetitle)$$pagetitle$$endif$</title>
<style type="text/css">
+/*<![CDATA[*/
$highlighting-css$
+/*]]>*/
</style>
$endif$
-$for(css)$
- <link rel="stylesheet" href="$css$" type="text/css" />
-$endfor$
$if(slidy-css)$
<style type="text/css">
+/*<![CDATA[*/
$slidy-css$
+/*]]>*/
</style>
$else$
- <link rel="stylesheet" type="text/css" media="screen, projection, print"
- href="http://www.w3.org/Talks/Tools/Slidy/slidy.css" />
+ <link rel="stylesheet" type="text/css" media="screen, projection, print"
+ href="$slidy-url$/styles/slidy.css" />
$endif$
+$for(css)$
+ <link rel="stylesheet" type="text/css" media="screen, projection, print"
+ href="$css$" />
+$endfor$
$if(math)$
$math$
$endif$
@@ -35,26 +40,31 @@ $for(header-includes)$
$header-includes$
$endfor$
$if(slidy-js)$
- <script type="text/javascript" charset="utf-8">
+<script type="text/javascript" charset="utf-8">
+/*<![CDATA[*/
$slidy-js$
- </script>
+/*]]>*/
+</script>
$else$
- <script src="http://www.w3.org/Talks/Tools/Slidy/slidy.js.gz"
+ <script src="$slidy-url$/scripts/slidy.js.gz"
charset="utf-8" type="text/javascript"></script>
$endif$
+$if(duration)$
+ <meta name="duration" content="$duration$" />
+$endif$
</head>
<body>
$for(include-before)$
$include-before$
$endfor$
$if(title)$
-<div class="slide cover title">
+<div class="slide titlepage">
<h1 class="title">$title$</h1>
<p class="author">
$for(author)$$author$$sep$<br/>$endfor$
</p>
$if(date)$
- <p class="date">$date$</p>
+ <p class="date">$date$</p>
$endif$
</div>
$endif$
diff --git a/templates/texinfo.template b/templates/default.texinfo
index 9c1d8e178..9c1d8e178 100644
--- a/templates/texinfo.template
+++ b/templates/default.texinfo
diff --git a/templates/textile.template b/templates/default.textile
index 69bd05b56..69bd05b56 100644
--- a/templates/textile.template
+++ b/templates/default.textile
diff --git a/tests/html-reader.html b/tests/html-reader.html
index a51ee3307..ea10a306c 100644
--- a/tests/html-reader.html
+++ b/tests/html-reader.html
@@ -298,40 +298,6 @@ These should not be escaped: \$ \\ \> \[ \{
<dd>Low-voiced stringed instrument.</dd>
</dl>
<hr />
-<h1>HTML Blocks</h1>
-<p>Simple block on one line:</p>
-foo<p>And nested without indentation:</p>
-foobar<p>Interpreted markdown in a table:</p>
-This is <em>emphasized</em>. And this is <strong>strong</strong><p>Here's a simple block:</p>
-foo<p>This should be a code block, though:</p>
-<pre><code>&lt;div>
- foo
-&lt;/div>
-</code></pre>
-<p>As should this:</p>
-<pre><code>&lt;div>foo&lt;/div>
-</code></pre>
-<p>Now, nested:</p>
-foo<p>This should just be an HTML comment:</p>
-<p>Multiline:</p>
-<p>Code block:</p>
-<pre><code>&lt;!-- Comment -->
-</code></pre>
-<p>Just plain comment, with trailing spaces on the line:</p>
-<p>Code:</p>
-<pre><code>&lt;hr />
-</code></pre>
-<p>Hr's:</p>
-<hr />
-<hr />
-<hr />
-<hr />
-<hr />
-<hr />
-<hr />
-<hr />
-<hr />
-<hr />
<h1>Inline Markup</h1>
<p>This is <em>emphasized</em>, and so <em>is this</em>.</p>
<p>This is <strong>strong</strong>, and so <strong>is this</strong>.</p>
diff --git a/tests/html-reader.native b/tests/html-reader.native
index c7ba26568..a9070adc6 100644
--- a/tests/html-reader.native
+++ b/tests/html-reader.native
@@ -183,39 +183,6 @@ Pandoc (Meta {docTitle = [Str "Pandoc",Space,Str "Test",Space,Str "Suite"], docA
,([Str "Cello",LineBreak,Str "Violoncello"],
[[Plain [Str "Low",Str "-",Str "voiced",Space,Str "stringed",Space,Str "instrument",Str "."]]])]
,HorizontalRule
-,Header 1 [Str "HTML",Space,Str "Blocks"]
-,Para [Str "Simple",Space,Str "block",Space,Str "on",Space,Str "one",Space,Str "line:"]
-,Plain [Str "foo"]
-,Para [Str "And",Space,Str "nested",Space,Str "without",Space,Str "indentation:"]
-,Plain [Str "foobar"]
-,Para [Str "Interpreted",Space,Str "markdown",Space,Str "in",Space,Str "a",Space,Str "table:"]
-,Plain [Str "This",Space,Str "is",Space,Emph [Str "emphasized"],Str ".",Space,Str "And",Space,Str "this",Space,Str "is",Space,Strong [Str "strong"]]
-,Para [Str "Here",Str "'",Str "s",Space,Str "a",Space,Str "simple",Space,Str "block:"]
-,Plain [Str "foo"]
-,Para [Str "This",Space,Str "should",Space,Str "be",Space,Str "a",Space,Str "code",Space,Str "block,",Space,Str "though:"]
-,CodeBlock ("",[],[]) "<div>\n foo\n</div>"
-,Para [Str "As",Space,Str "should",Space,Str "this:"]
-,CodeBlock ("",[],[]) "<div>foo</div>"
-,Para [Str "Now,",Space,Str "nested:"]
-,Plain [Str "foo"]
-,Para [Str "This",Space,Str "should",Space,Str "just",Space,Str "be",Space,Str "an",Space,Str "HTML",Space,Str "comment:"]
-,Para [Str "Multiline:"]
-,Para [Str "Code",Space,Str "block:"]
-,CodeBlock ("",[],[]) "<!-- Comment -->"
-,Para [Str "Just",Space,Str "plain",Space,Str "comment,",Space,Str "with",Space,Str "trailing",Space,Str "spaces",Space,Str "on",Space,Str "the",Space,Str "line:"]
-,Para [Str "Code:"]
-,CodeBlock ("",[],[]) "<hr />"
-,Para [Str "Hr",Str "'",Str "s:"]
-,HorizontalRule
-,HorizontalRule
-,HorizontalRule
-,HorizontalRule
-,HorizontalRule
-,HorizontalRule
-,HorizontalRule
-,HorizontalRule
-,HorizontalRule
-,HorizontalRule
,Header 1 [Str "Inline",Space,Str "Markup"]
,Para [Str "This",Space,Str "is",Space,Emph [Str "emphasized"],Str ",",Space,Str "and",Space,Str "so",Space,Emph [Str "is",Space,Str "this"],Str "."]
,Para [Str "This",Space,Str "is",Space,Strong [Str "strong"],Str ",",Space,Str "and",Space,Str "so",Space,Strong [Str "is",Space,Str "this"],Str "."]
@@ -293,7 +260,7 @@ Pandoc (Meta {docTitle = [Str "Pandoc",Space,Str "Test",Space,Str "Suite"], docA
,Para [Link [Str "URL",Space,Str "and",Space,Str "title"] ("/url/","title preceded by a tab"),Str "."]
,Para [Link [Str "URL",Space,Str "and",Space,Str "title"] ("/url/","title with \"quotes\" in it")]
,Para [Link [Str "URL",Space,Str "and",Space,Str "title"] ("/url/","title with single quotes")]
-,Plain [Str "Email",Space,Str "link",Space,Str "(nobody",Space,Str "[at]",Space,Str "nowhere",Str ".",Str "net)"]
+,Para [Str "Email",Space,Str "link",Space,Str "(nobody",Space,Str "[at]",Space,Str "nowhere",Str ".",Str "net)"]
,Para [Link [Str "Empty"] ("",""),Str "."]
,Header 2 [Str "Reference"]
,Para [Str "Foo",Space,Link [Str "bar"] ("/url/",""),Str "."]
@@ -319,7 +286,7 @@ Pandoc (Meta {docTitle = [Str "Pandoc",Space,Str "Test",Space,Str "Suite"], docA
[[Plain [Str "In",Space,Str "a",Space,Str "list?"]]
,[Plain [Link [Str "http://example",Str ".",Str "com/"] ("http://example.com/","")]]
,[Plain [Str "It",Space,Str "should",Str "."]]]
-,Plain [Str "An",Space,Str "e",Str "-",Str "mail",Space,Str "address:",Space,Str "nobody",Space,Str "[at]",Space,Str "nowhere",Str ".",Str "net"]
+,Para [Str "An",Space,Str "e",Str "-",Str "mail",Space,Str "address:",Space,Str "nobody",Space,Str "[at]",Space,Str "nowhere",Str ".",Str "net"]
,BlockQuote
[Para [Str "Blockquoted:",Space,Link [Str "http://example",Str ".",Str "com/"] ("http://example.com/","")]]
,Para [Str "Auto",Str "-",Str "links",Space,Str "should",Space,Str "not",Space,Str "occur",Space,Str "here:",Space,Code ("",[],[]) "<http://example.com/>"]
diff --git a/tests/latex-reader.latex b/tests/latex-reader.latex
index 135ee57bb..119ad0881 100644
--- a/tests/latex-reader.latex
+++ b/tests/latex-reader.latex
@@ -17,7 +17,7 @@
\setcounter{secnumdepth}{0}
\VerbatimFootnotes % allows verbatim text in footnotes
\title{Pandoc Test Suite}
-\author{John MacFarlane\\Anonymous}
+\author{John MacFarlane \and Anonymous}
\date{July 17, 2006}
\begin{document}
\maketitle
diff --git a/tests/lhs-test.html b/tests/lhs-test.html
index d1ea1f128..75ad7b41f 100644
--- a/tests/lhs-test.html
+++ b/tests/lhs-test.html
@@ -5,6 +5,7 @@
<meta name="generator" content="pandoc" />
<title></title>
<style type="text/css">
+/*<![CDATA[*/
table.sourceCode, tr.sourceCode, td.lineNumbers, td.sourceCode, table.sourceCode pre
{ margin: 0; padding: 0; border: 0; vertical-align: baseline; border: none; }
td.lineNumbers { border-right: 1px solid #AAAAAA; text-align: right; color: #AAAAAA; padding-right: 5px; padding-left: 5px; }
@@ -22,6 +23,7 @@ code.sourceCode span.al { color: red; font-weight: bold; }
code.sourceCode span.fu { color: #06287e; }
code.sourceCode span.re { }
code.sourceCode span.er { color: red; font-weight: bold; }
+/*]]>*/
</style>
</head>
<body>
diff --git a/tests/lhs-test.html+lhs b/tests/lhs-test.html+lhs
index 269974eb4..16112299d 100644
--- a/tests/lhs-test.html+lhs
+++ b/tests/lhs-test.html+lhs
@@ -5,6 +5,7 @@
<meta name="generator" content="pandoc" />
<title></title>
<style type="text/css">
+/*<![CDATA[*/
table.sourceCode, tr.sourceCode, td.lineNumbers, td.sourceCode, table.sourceCode pre
{ margin: 0; padding: 0; border: 0; vertical-align: baseline; border: none; }
td.lineNumbers { border-right: 1px solid #AAAAAA; text-align: right; color: #AAAAAA; padding-right: 5px; padding-left: 5px; }
@@ -22,6 +23,7 @@ code.sourceCode span.al { color: red; font-weight: bold; }
code.sourceCode span.fu { color: #06287e; }
code.sourceCode span.re { }
code.sourceCode span.er { color: red; font-weight: bold; }
+/*]]>*/
</style>
</head>
<body>
diff --git a/tests/lhs-test.latex b/tests/lhs-test.latex
index d34c21090..307fd948f 100644
--- a/tests/lhs-test.latex
+++ b/tests/lhs-test.latex
@@ -1,10 +1,28 @@
\documentclass{article}
\usepackage{amssymb,amsmath}
-\usepackage[mathletters]{ucs}
-\usepackage[utf8x]{inputenc}
-\usepackage[breaklinks=true,unicode=true,pdfborder={0 0 0}]{hyperref}
+\usepackage{ifxetex,ifluatex}
+\ifxetex
+ \usepackage{fontspec,xltxtra,xunicode}
+ \defaultfontfeatures{Mapping=tex-text,Scale=MatchLowercase}
+\else
+ \ifluatex
+ \usepackage{fontspec}
+ \defaultfontfeatures{Mapping=tex-text,Scale=MatchLowercase}
+ \else
+ \usepackage[utf8]{inputenc}
+ \fi
+\fi
+\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, pdfborder={0 0 0}}
\setlength{\parindent}{0pt}
\setlength{\parskip}{6pt plus 2pt minus 1pt}
+\setlength{\emergencystretch}{3em} % prevent overfull lines
\setcounter{secnumdepth}{0}
@@ -12,7 +30,7 @@
\section{lhs test}
-\verb!unsplit! is an arrow that takes a pair of values and combines them to
+\texttt{unsplit} is an arrow that takes a pair of values and combines them to
return a single value:
\begin{verbatim}
@@ -20,9 +38,9 @@ unsplit :: (Arrow a) => (b -> c -> d) -> a (b, c) d
unsplit = arr . uncurry
-- arr (\op (x,y) -> x `op` y)
\end{verbatim}
-\verb!(***)! 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).
+\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
+the second item of the pair).
\begin{verbatim}
f *** g = first f >>> second g
diff --git a/tests/lhs-test.latex+lhs b/tests/lhs-test.latex+lhs
index 29237f820..4d36dc532 100644
--- a/tests/lhs-test.latex+lhs
+++ b/tests/lhs-test.latex+lhs
@@ -1,12 +1,30 @@
\documentclass{article}
\usepackage{amssymb,amsmath}
-\usepackage[mathletters]{ucs}
-\usepackage[utf8x]{inputenc}
+\usepackage{ifxetex,ifluatex}
+\ifxetex
+ \usepackage{fontspec,xltxtra,xunicode}
+ \defaultfontfeatures{Mapping=tex-text,Scale=MatchLowercase}
+\else
+ \ifluatex
+ \usepackage{fontspec}
+ \defaultfontfeatures{Mapping=tex-text,Scale=MatchLowercase}
+ \else
+ \usepackage[utf8]{inputenc}
+ \fi
+\fi
\usepackage{listings}
\lstnewenvironment{code}{\lstset{language=Haskell,basicstyle=\small\ttfamily}}{}
-\usepackage[breaklinks=true,unicode=true,pdfborder={0 0 0}]{hyperref}
+\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, pdfborder={0 0 0}}
\setlength{\parindent}{0pt}
\setlength{\parskip}{6pt plus 2pt minus 1pt}
+\setlength{\emergencystretch}{3em} % prevent overfull lines
\setcounter{secnumdepth}{0}
@@ -14,7 +32,7 @@
\section{lhs test}
-\verb!unsplit! is an arrow that takes a pair of values and combines them to
+\texttt{unsplit} is an arrow that takes a pair of values and combines them to
return a single value:
\begin{code}
@@ -22,9 +40,9 @@ unsplit :: (Arrow a) => (b -> c -> d) -> a (b, c) d
unsplit = arr . uncurry
-- arr (\op (x,y) -> x `op` y)
\end{code}
-\verb!(***)! 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).
+\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
+the second item of the pair).
\begin{verbatim}
f *** g = first f >>> second g
diff --git a/tests/lhs-test.nohl.html b/tests/lhs-test.nohl.html
index d1ea1f128..cd5c0ac05 100644
--- a/tests/lhs-test.nohl.html
+++ b/tests/lhs-test.nohl.html
@@ -4,30 +4,14 @@
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="pandoc" />
<title></title>
- <style type="text/css">
-table.sourceCode, tr.sourceCode, td.lineNumbers, td.sourceCode, table.sourceCode pre
- { margin: 0; padding: 0; border: 0; vertical-align: baseline; border: none; }
-td.lineNumbers { border-right: 1px solid #AAAAAA; text-align: right; color: #AAAAAA; padding-right: 5px; padding-left: 5px; }
-td.sourceCode { padding-left: 5px; }
-code.sourceCode span.kw { color: #007020; font-weight: bold; }
-code.sourceCode span.dt { color: #902000; }
-code.sourceCode span.dv { color: #40a070; }
-code.sourceCode span.bn { color: #40a070; }
-code.sourceCode span.fl { color: #40a070; }
-code.sourceCode span.ch { color: #4070a0; }
-code.sourceCode span.st { color: #4070a0; }
-code.sourceCode span.co { color: #60a0b0; font-style: italic; }
-code.sourceCode span.ot { color: #007020; }
-code.sourceCode span.al { color: red; font-weight: bold; }
-code.sourceCode span.fu { color: #06287e; }
-code.sourceCode span.re { }
-code.sourceCode span.er { color: red; font-weight: bold; }
- </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"><code class="sourceCode haskell"><span class="ot">unsplit </span><span class="ot">::</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<br />unsplit <span class="fu">=</span> arr <span class="fu">.</span> <span class="fu">uncurry</span> <br /> <span class="co">-- arr (\op (x,y) -&gt; x `op` y) </span></code></pre>
+<pre class="sourceCode 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>
<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>
diff --git a/tests/lhs-test.nohl.html+lhs b/tests/lhs-test.nohl.html+lhs
index 269974eb4..15c21f3be 100644
--- a/tests/lhs-test.nohl.html+lhs
+++ b/tests/lhs-test.nohl.html+lhs
@@ -4,30 +4,14 @@
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="pandoc" />
<title></title>
- <style type="text/css">
-table.sourceCode, tr.sourceCode, td.lineNumbers, td.sourceCode, table.sourceCode pre
- { margin: 0; padding: 0; border: 0; vertical-align: baseline; border: none; }
-td.lineNumbers { border-right: 1px solid #AAAAAA; text-align: right; color: #AAAAAA; padding-right: 5px; padding-left: 5px; }
-td.sourceCode { padding-left: 5px; }
-code.sourceCode span.kw { color: #007020; font-weight: bold; }
-code.sourceCode span.dt { color: #902000; }
-code.sourceCode span.dv { color: #40a070; }
-code.sourceCode span.bn { color: #40a070; }
-code.sourceCode span.fl { color: #40a070; }
-code.sourceCode span.ch { color: #4070a0; }
-code.sourceCode span.st { color: #4070a0; }
-code.sourceCode span.co { color: #60a0b0; font-style: italic; }
-code.sourceCode span.ot { color: #007020; }
-code.sourceCode span.al { color: red; font-weight: bold; }
-code.sourceCode span.fu { color: #06287e; }
-code.sourceCode span.re { }
-code.sourceCode span.er { color: red; font-weight: bold; }
- </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"><code class="sourceCode haskell">&gt; <span class="ot">unsplit </span><span class="ot">::</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<br />&gt; unsplit <span class="fu">=</span> arr <span class="fu">.</span> <span class="fu">uncurry</span> <br />&gt; <span class="co">-- arr (\op (x,y) -&gt; x `op` y) </span></code></pre>
+<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>
<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>
diff --git a/tests/rst-reader.native b/tests/rst-reader.native
index a88d499b0..3e521cb7c 100644
--- a/tests/rst-reader.native
+++ b/tests/rst-reader.native
@@ -222,7 +222,7 @@ Pandoc (Meta {docTitle = [Str "Pandoc",Space,Str "Test",Space,Str "Suite",Str ":
,Para [Str "But",Space,Str "not",Space,Str "here",Str ":"]
,CodeBlock ("",[],[]) "http://example.com/"
,Header 1 [Str "Images"]
-,Para [Str "From",Space,Quoted DoubleQuote [Str "Voyage",Space,Str "dans",Space,Str "la",Space,Str "Lune"],Space,Str "by",Space,Str "Georges",Space,Str "Melies",Space,Str "(1902)",Str ":"]
+,Para [Str "From",Space,Quoted DoubleQuote [Str "Voyage",Space,Str "dans",Space,Str "la",Space,Str "Lune"],Space,Str "by",Space,Str "Georges",Space,Str "Melies",Space,Str "(",Str "1902",Str ")",Str ":"]
,Plain [Image [Str "image"] ("lalune.jpg","")]
,Plain [Image [Str "Voyage dans la Lune"] ("lalune.jpg","")]
,Para [Str "Here",Space,Str "is",Space,Str "a",Space,Str "movie",Space,Image [Str "movie"] ("movie.jpg",""),Space,Str "icon",Str "."]
diff --git a/tests/s5.basic.html b/tests/s5.basic.html
index 34016bf18..0658dcf4b 100644
--- a/tests/s5.basic.html
+++ b/tests/s5.basic.html
@@ -35,16 +35,13 @@
<h4>July 15, 2006</h4>
</div>
<div class="slide">
-
<h1>First slide</h1>
<ul>
<li>first bullet</li>
<li>second bullet</li>
</ul>
</div>
-
<div class="slide">
-
<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>
diff --git a/tests/s5.fancy.html b/tests/s5.fancy.html
index 6fc2d51f4..39188bb1e 100644
--- a/tests/s5.fancy.html
+++ b/tests/s5.fancy.html
@@ -17,7 +17,8 @@
<link rel="stylesheet" href="ui/default/opera.css" type="text/css" media="projection" id="operaFix" />
<!-- S5 JS -->
<script src="ui/default/slides.js" type="text/javascript"></script>
- <script type="text/javascript">/*
+ <script type="text/javascript">/*<![CDATA[*/
+ /*
LaTeXMathML.js from http://math.etsu.edu/LaTeXMathML/
Adapted by Jeff Knisely and Douglas Woodall from ASCIIMathML.js v. 1.4.7,
(c) 2005 Peter Jipsen http://www.chapman.edu/~jipsen.
@@ -215,6 +216,7 @@
{existing();generic();};}
else
{window.onload=generic;}}
+ /*]]>*/
</script>
</head>
<body>
@@ -234,16 +236,13 @@
<h4>July 15, 2006</h4>
</div>
<div class="slide">
-
<h1>First slide</h1>
<ul class="incremental">
<li>first bullet</li>
<li>second bullet</li>
</ul>
</div>
-
<div class="slide">
-
<h1>Math</h1>
<ul class="incremental">
<li><span class="LaTeX">$\frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}$</span></li>
diff --git a/tests/s5.inserts.html b/tests/s5.inserts.html
index 534da25d3..67832ea3d 100644
--- a/tests/s5.inserts.html
+++ b/tests/s5.inserts.html
@@ -12,7 +12,12 @@
</head>
<body>
STUFF INSERTED
+<div id="header">
<h1 class="title">My S5 Document</h1>
+<h3 class="author">Sam Smith</h3>
+<h3 class="author">Jen Jones</h3>
+<h4 class="date">July 15, 2006</h4>
+</div>
<h1 id="first-slide">First slide</h1>
<ul>
<li>first bullet</li>
diff --git a/tests/tables.docbook b/tests/tables.docbook
index 6483a97c0..6224cf222 100644
--- a/tests/tables.docbook
+++ b/tests/tables.docbook
@@ -2,401 +2,431 @@
Simple table with caption:
</para>
<table>
- <caption>
+ <title>
Demonstration of simple table syntax.
- </caption>
- <thead>
- <tr>
- <th align="right">
- Right
- </th>
- <th align="left">
- Left
- </th>
- <th align="center">
- Center
- </th>
- <th align="left">
- Default
- </th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td align="right">
- 12
- </td>
- <td align="left">
- 12
- </td>
- <td align="center">
- 12
- </td>
- <td align="left">
- 12
- </td>
- </tr>
- <tr>
- <td align="right">
- 123
- </td>
- <td align="left">
- 123
- </td>
- <td align="center">
- 123
- </td>
- <td align="left">
- 123
- </td>
- </tr>
- <tr>
- <td align="right">
- 1
- </td>
- <td align="left">
- 1
- </td>
- <td align="center">
- 1
- </td>
- <td align="left">
- 1
- </td>
- </tr>
- </tbody>
+ </title>
+ <tgroup cols="4">
+ <colspec align="right" />
+ <colspec align="left" />
+ <colspec align="center" />
+ <colspec align="left" />
+ <thead>
+ <row>
+ <entry>
+ Right
+ </entry>
+ <entry>
+ Left
+ </entry>
+ <entry>
+ Center
+ </entry>
+ <entry>
+ Default
+ </entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>
+ 12
+ </entry>
+ <entry>
+ 12
+ </entry>
+ <entry>
+ 12
+ </entry>
+ <entry>
+ 12
+ </entry>
+ </row>
+ <row>
+ <entry>
+ 123
+ </entry>
+ <entry>
+ 123
+ </entry>
+ <entry>
+ 123
+ </entry>
+ <entry>
+ 123
+ </entry>
+ </row>
+ <row>
+ <entry>
+ 1
+ </entry>
+ <entry>
+ 1
+ </entry>
+ <entry>
+ 1
+ </entry>
+ <entry>
+ 1
+ </entry>
+ </row>
+ </tbody>
+ </tgroup>
</table>
<para>
Simple table without caption:
</para>
<informaltable>
- <thead>
- <tr>
- <th align="right">
- Right
- </th>
- <th align="left">
- Left
- </th>
- <th align="center">
- Center
- </th>
- <th align="left">
- Default
- </th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td align="right">
- 12
- </td>
- <td align="left">
- 12
- </td>
- <td align="center">
- 12
- </td>
- <td align="left">
- 12
- </td>
- </tr>
- <tr>
- <td align="right">
- 123
- </td>
- <td align="left">
- 123
- </td>
- <td align="center">
- 123
- </td>
- <td align="left">
- 123
- </td>
- </tr>
- <tr>
- <td align="right">
- 1
- </td>
- <td align="left">
- 1
- </td>
- <td align="center">
- 1
- </td>
- <td align="left">
- 1
- </td>
- </tr>
- </tbody>
+ <tgroup cols="4">
+ <colspec align="right" />
+ <colspec align="left" />
+ <colspec align="center" />
+ <colspec align="left" />
+ <thead>
+ <row>
+ <entry>
+ Right
+ </entry>
+ <entry>
+ Left
+ </entry>
+ <entry>
+ Center
+ </entry>
+ <entry>
+ Default
+ </entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>
+ 12
+ </entry>
+ <entry>
+ 12
+ </entry>
+ <entry>
+ 12
+ </entry>
+ <entry>
+ 12
+ </entry>
+ </row>
+ <row>
+ <entry>
+ 123
+ </entry>
+ <entry>
+ 123
+ </entry>
+ <entry>
+ 123
+ </entry>
+ <entry>
+ 123
+ </entry>
+ </row>
+ <row>
+ <entry>
+ 1
+ </entry>
+ <entry>
+ 1
+ </entry>
+ <entry>
+ 1
+ </entry>
+ <entry>
+ 1
+ </entry>
+ </row>
+ </tbody>
+ </tgroup>
</informaltable>
<para>
Simple table indented two spaces:
</para>
<table>
- <caption>
+ <title>
Demonstration of simple table syntax.
- </caption>
- <thead>
- <tr>
- <th align="right">
- Right
- </th>
- <th align="left">
- Left
- </th>
- <th align="center">
- Center
- </th>
- <th align="left">
- Default
- </th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td align="right">
- 12
- </td>
- <td align="left">
- 12
- </td>
- <td align="center">
- 12
- </td>
- <td align="left">
- 12
- </td>
- </tr>
- <tr>
- <td align="right">
- 123
- </td>
- <td align="left">
- 123
- </td>
- <td align="center">
- 123
- </td>
- <td align="left">
- 123
- </td>
- </tr>
- <tr>
- <td align="right">
- 1
- </td>
- <td align="left">
- 1
- </td>
- <td align="center">
- 1
- </td>
- <td align="left">
- 1
- </td>
- </tr>
- </tbody>
+ </title>
+ <tgroup cols="4">
+ <colspec align="right" />
+ <colspec align="left" />
+ <colspec align="center" />
+ <colspec align="left" />
+ <thead>
+ <row>
+ <entry>
+ Right
+ </entry>
+ <entry>
+ Left
+ </entry>
+ <entry>
+ Center
+ </entry>
+ <entry>
+ Default
+ </entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>
+ 12
+ </entry>
+ <entry>
+ 12
+ </entry>
+ <entry>
+ 12
+ </entry>
+ <entry>
+ 12
+ </entry>
+ </row>
+ <row>
+ <entry>
+ 123
+ </entry>
+ <entry>
+ 123
+ </entry>
+ <entry>
+ 123
+ </entry>
+ <entry>
+ 123
+ </entry>
+ </row>
+ <row>
+ <entry>
+ 1
+ </entry>
+ <entry>
+ 1
+ </entry>
+ <entry>
+ 1
+ </entry>
+ <entry>
+ 1
+ </entry>
+ </row>
+ </tbody>
+ </tgroup>
</table>
<para>
Multiline table with caption:
</para>
<table>
- <caption>
+ <title>
Here's the caption. It may span multiple lines.
- </caption>
- <col width="15%" />
- <col width="13%" />
- <col width="16%" />
- <col width="33%" />
- <thead>
- <tr>
- <th align="center">
- Centered Header
- </th>
- <th align="left">
- Left Aligned
- </th>
- <th align="right">
- Right Aligned
- </th>
- <th align="left">
- Default aligned
- </th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td align="center">
- First
- </td>
- <td align="left">
- row
- </td>
- <td align="right">
- 12.0
- </td>
- <td align="left">
- Example of a row that spans multiple lines.
- </td>
- </tr>
- <tr>
- <td align="center">
- Second
- </td>
- <td align="left">
- row
- </td>
- <td align="right">
- 5.0
- </td>
- <td align="left">
- Here's another one. Note the blank line between rows.
- </td>
- </tr>
- </tbody>
+ </title>
+ <tgroup cols="4">
+ <colspec colwidth="15*" align="center" />
+ <colspec colwidth="13*" align="left" />
+ <colspec colwidth="16*" align="right" />
+ <colspec colwidth="33*" align="left" />
+ <thead>
+ <row>
+ <entry>
+ Centered Header
+ </entry>
+ <entry>
+ Left Aligned
+ </entry>
+ <entry>
+ Right Aligned
+ </entry>
+ <entry>
+ Default aligned
+ </entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>
+ First
+ </entry>
+ <entry>
+ row
+ </entry>
+ <entry>
+ 12.0
+ </entry>
+ <entry>
+ Example of a row that spans multiple lines.
+ </entry>
+ </row>
+ <row>
+ <entry>
+ Second
+ </entry>
+ <entry>
+ row
+ </entry>
+ <entry>
+ 5.0
+ </entry>
+ <entry>
+ Here's another one. Note the blank line between rows.
+ </entry>
+ </row>
+ </tbody>
+ </tgroup>
</table>
<para>
Multiline table without caption:
</para>
<informaltable>
- <col width="15%" />
- <col width="13%" />
- <col width="16%" />
- <col width="33%" />
- <thead>
- <tr>
- <th align="center">
- Centered Header
- </th>
- <th align="left">
- Left Aligned
- </th>
- <th align="right">
- Right Aligned
- </th>
- <th align="left">
- Default aligned
- </th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td align="center">
- First
- </td>
- <td align="left">
- row
- </td>
- <td align="right">
- 12.0
- </td>
- <td align="left">
- Example of a row that spans multiple lines.
- </td>
- </tr>
- <tr>
- <td align="center">
- Second
- </td>
- <td align="left">
- row
- </td>
- <td align="right">
- 5.0
- </td>
- <td align="left">
- Here's another one. Note the blank line between rows.
- </td>
- </tr>
- </tbody>
+ <tgroup cols="4">
+ <colspec colwidth="15*" align="center" />
+ <colspec colwidth="13*" align="left" />
+ <colspec colwidth="16*" align="right" />
+ <colspec colwidth="33*" align="left" />
+ <thead>
+ <row>
+ <entry>
+ Centered Header
+ </entry>
+ <entry>
+ Left Aligned
+ </entry>
+ <entry>
+ Right Aligned
+ </entry>
+ <entry>
+ Default aligned
+ </entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>
+ First
+ </entry>
+ <entry>
+ row
+ </entry>
+ <entry>
+ 12.0
+ </entry>
+ <entry>
+ Example of a row that spans multiple lines.
+ </entry>
+ </row>
+ <row>
+ <entry>
+ Second
+ </entry>
+ <entry>
+ row
+ </entry>
+ <entry>
+ 5.0
+ </entry>
+ <entry>
+ Here's another one. Note the blank line between rows.
+ </entry>
+ </row>
+ </tbody>
+ </tgroup>
</informaltable>
<para>
Table without column headers:
</para>
<informaltable>
- <tbody>
- <tr>
- <td align="right">
- 12
- </td>
- <td align="left">
- 12
- </td>
- <td align="center">
- 12
- </td>
- <td align="right">
- 12
- </td>
- </tr>
- <tr>
- <td align="right">
- 123
- </td>
- <td align="left">
- 123
- </td>
- <td align="center">
- 123
- </td>
- <td align="right">
- 123
- </td>
- </tr>
- <tr>
- <td align="right">
- 1
- </td>
- <td align="left">
- 1
- </td>
- <td align="center">
- 1
- </td>
- <td align="right">
- 1
- </td>
- </tr>
- </tbody>
+ <tgroup cols="4">
+ <colspec align="right" />
+ <colspec align="left" />
+ <colspec align="center" />
+ <colspec align="right" />
+ <tbody>
+ <row>
+ <entry>
+ 12
+ </entry>
+ <entry>
+ 12
+ </entry>
+ <entry>
+ 12
+ </entry>
+ <entry>
+ 12
+ </entry>
+ </row>
+ <row>
+ <entry>
+ 123
+ </entry>
+ <entry>
+ 123
+ </entry>
+ <entry>
+ 123
+ </entry>
+ <entry>
+ 123
+ </entry>
+ </row>
+ <row>
+ <entry>
+ 1
+ </entry>
+ <entry>
+ 1
+ </entry>
+ <entry>
+ 1
+ </entry>
+ <entry>
+ 1
+ </entry>
+ </row>
+ </tbody>
+ </tgroup>
</informaltable>
<para>
Multiline table without column headers:
</para>
<informaltable>
- <col width="15%" />
- <col width="13%" />
- <col width="16%" />
- <col width="33%" />
- <tbody>
- <tr>
- <td align="center">
- First
- </td>
- <td align="left">
- row
- </td>
- <td align="right">
- 12.0
- </td>
- <td align="left">
- Example of a row that spans multiple lines.
- </td>
- </tr>
- <tr>
- <td align="center">
- Second
- </td>
- <td align="left">
- row
- </td>
- <td align="right">
- 5.0
- </td>
- <td align="left">
- Here's another one. Note the blank line between rows.
- </td>
- </tr>
- </tbody>
+ <tgroup cols="4">
+ <colspec colwidth="15*" align="center" />
+ <colspec colwidth="13*" align="left" />
+ <colspec colwidth="16*" align="right" />
+ <colspec colwidth="33*" align="left" />
+ <tbody>
+ <row>
+ <entry>
+ First
+ </entry>
+ <entry>
+ row
+ </entry>
+ <entry>
+ 12.0
+ </entry>
+ <entry>
+ Example of a row that spans multiple lines.
+ </entry>
+ </row>
+ <row>
+ <entry>
+ Second
+ </entry>
+ <entry>
+ row
+ </entry>
+ <entry>
+ 5.0
+ </entry>
+ <entry>
+ Here's another one. Note the blank line between rows.
+ </entry>
+ </row>
+ </tbody>
+ </tgroup>
</informaltable>
diff --git a/tests/tables.latex b/tests/tables.latex
index 89bcf9d9f..21ad73b0a 100644
--- a/tests/tables.latex
+++ b/tests/tables.latex
@@ -1,121 +1,176 @@
Simple table with caption:
-\begin{table}[h]
-\begin{center}
-\begin{tabular}{rlcl}
-Right & Left & Center & Default\\
-\hline
-12 & 12 & 12 & 12\\
-123 & 123 & 123 & 123\\
-1 & 1 & 1 & 1\\
-\end{tabular}
-\end{center}
-\caption{Demonstration of simple table syntax.}
-\end{table}
+\ctable[caption = Demonstration of simple table syntax.,
+pos = H, center, botcap]{rlcl}
+{% notes
+}
+{% rows
+\FL
+Right & Left & Center & Default
+\ML
+12 & 12 & 12 & 12
+\\\noalign{\medskip}
+123 & 123 & 123 & 123
+\\\noalign{\medskip}
+1 & 1 & 1 & 1
+\LL
+}
Simple table without caption:
-\begin{center}
-\begin{tabular}{rlcl}
-Right & Left & Center & Default\\
-\hline
-12 & 12 & 12 & 12\\
-123 & 123 & 123 & 123\\
-1 & 1 & 1 & 1\\
-\end{tabular}
-\end{center}
+\ctable[pos = H, center, botcap]{rlcl}
+{% notes
+}
+{% rows
+\FL
+Right & Left & Center & Default
+\ML
+12 & 12 & 12 & 12
+\\\noalign{\medskip}
+123 & 123 & 123 & 123
+\\\noalign{\medskip}
+1 & 1 & 1 & 1
+\LL
+}
Simple table indented two spaces:
-\begin{table}[h]
-\begin{center}
-\begin{tabular}{rlcl}
-Right & Left & Center & Default\\
-\hline
-12 & 12 & 12 & 12\\
-123 & 123 & 123 & 123\\
-1 & 1 & 1 & 1\\
-\end{tabular}
-\end{center}
-\caption{Demonstration of simple table syntax.}
-\end{table}
+\ctable[caption = Demonstration of simple table syntax.,
+pos = H, center, botcap]{rlcl}
+{% notes
+}
+{% rows
+\FL
+Right & Left & Center & Default
+\ML
+12 & 12 & 12 & 12
+\\\noalign{\medskip}
+123 & 123 & 123 & 123
+\\\noalign{\medskip}
+1 & 1 & 1 & 1
+\LL
+}
Multiline table with caption:
-\begin{table}[h]
-\begin{center}
-\begin{tabular}{>{\PBS\centering\hspace{0pt}}p{0.15\columnwidth}>{\PBS\raggedright\hspace{0pt}}p{0.14\columnwidth}>{\PBS\raggedleft\hspace{0pt}}p{0.16\columnwidth}>{\PBS\raggedright\hspace{0pt}}p{0.34\columnwidth}}
-\parbox{0.15\columnwidth}{Centered Header
-} & \parbox{0.14\columnwidth}{Left Aligned
-} & \parbox{0.16\columnwidth}{Right Aligned
-} & \parbox{0.34\columnwidth}{Default aligned
-}\\
-\hline
-\parbox{0.15\columnwidth}{First
-} & \parbox{0.14\columnwidth}{row
-} & \parbox{0.16\columnwidth}{12.0
-} & \parbox{0.34\columnwidth}{Example of a row that spans multiple lines.
-}\\
-\parbox{0.15\columnwidth}{Second
-} & \parbox{0.14\columnwidth}{row
-} & \parbox{0.16\columnwidth}{5.0
-} & \parbox{0.34\columnwidth}{Here's another one. Note the blank line between
-rows.
-}\\
-\end{tabular}
-\end{center}
-\caption{Here's the caption. It may span multiple lines.}
-\end{table}
+\ctable[caption = Here's the caption. It may span multiple lines.,
+pos = H, center, botcap]{clrl}
+{% notes
+}
+{% rows
+\FL
+\parbox[b]{0.15\columnwidth}{\centering
+Centered Header
+} & \parbox[b]{0.14\columnwidth}{\raggedright
+Left Aligned
+} & \parbox[b]{0.16\columnwidth}{\raggedleft
+Right Aligned
+} & \parbox[b]{0.34\columnwidth}{\raggedright
+Default aligned
+}
+\ML
+\parbox[t]{0.15\columnwidth}{\centering
+First
+} & \parbox[t]{0.14\columnwidth}{\raggedright
+row
+} & \parbox[t]{0.16\columnwidth}{\raggedleft
+12.0
+} & \parbox[t]{0.34\columnwidth}{\raggedright
+Example of a row that spans multiple lines.
+}
+\\\noalign{\medskip}
+\parbox[t]{0.15\columnwidth}{\centering
+Second
+} & \parbox[t]{0.14\columnwidth}{\raggedright
+row
+} & \parbox[t]{0.16\columnwidth}{\raggedleft
+5.0
+} & \parbox[t]{0.34\columnwidth}{\raggedright
+Here's another one. Note the blank line between rows.
+}
+\LL
+}
Multiline table without caption:
-\begin{center}
-\begin{tabular}{>{\PBS\centering\hspace{0pt}}p{0.15\columnwidth}>{\PBS\raggedright\hspace{0pt}}p{0.14\columnwidth}>{\PBS\raggedleft\hspace{0pt}}p{0.16\columnwidth}>{\PBS\raggedright\hspace{0pt}}p{0.34\columnwidth}}
-\parbox{0.15\columnwidth}{Centered Header
-} & \parbox{0.14\columnwidth}{Left Aligned
-} & \parbox{0.16\columnwidth}{Right Aligned
-} & \parbox{0.34\columnwidth}{Default aligned
-}\\
-\hline
-\parbox{0.15\columnwidth}{First
-} & \parbox{0.14\columnwidth}{row
-} & \parbox{0.16\columnwidth}{12.0
-} & \parbox{0.34\columnwidth}{Example of a row that spans multiple lines.
-}\\
-\parbox{0.15\columnwidth}{Second
-} & \parbox{0.14\columnwidth}{row
-} & \parbox{0.16\columnwidth}{5.0
-} & \parbox{0.34\columnwidth}{Here's another one. Note the blank line between
-rows.
-}\\
-\end{tabular}
-\end{center}
+\ctable[pos = H, center, botcap]{clrl}
+{% notes
+}
+{% rows
+\FL
+\parbox[b]{0.15\columnwidth}{\centering
+Centered Header
+} & \parbox[b]{0.14\columnwidth}{\raggedright
+Left Aligned
+} & \parbox[b]{0.16\columnwidth}{\raggedleft
+Right Aligned
+} & \parbox[b]{0.34\columnwidth}{\raggedright
+Default aligned
+}
+\ML
+\parbox[t]{0.15\columnwidth}{\centering
+First
+} & \parbox[t]{0.14\columnwidth}{\raggedright
+row
+} & \parbox[t]{0.16\columnwidth}{\raggedleft
+12.0
+} & \parbox[t]{0.34\columnwidth}{\raggedright
+Example of a row that spans multiple lines.
+}
+\\\noalign{\medskip}
+\parbox[t]{0.15\columnwidth}{\centering
+Second
+} & \parbox[t]{0.14\columnwidth}{\raggedright
+row
+} & \parbox[t]{0.16\columnwidth}{\raggedleft
+5.0
+} & \parbox[t]{0.34\columnwidth}{\raggedright
+Here's another one. Note the blank line between rows.
+}
+\LL
+}
Table without column headers:
-\begin{center}
-\begin{tabular}{rlcr}
-12 & 12 & 12 & 12\\
-123 & 123 & 123 & 123\\
-1 & 1 & 1 & 1\\
-\end{tabular}
-\end{center}
+\ctable[pos = H, center, botcap]{rlcr}
+{% notes
+}
+{% rows
+\FL
+12 & 12 & 12 & 12
+\\\noalign{\medskip}
+123 & 123 & 123 & 123
+\\\noalign{\medskip}
+1 & 1 & 1 & 1
+\LL
+}
Multiline table without column headers:
-\begin{center}
-\begin{tabular}{>{\PBS\centering\hspace{0pt}}p{0.15\columnwidth}>{\PBS\raggedright\hspace{0pt}}p{0.14\columnwidth}>{\PBS\raggedleft\hspace{0pt}}p{0.16\columnwidth}>{\PBS\raggedright\hspace{0pt}}p{0.34\columnwidth}}
-\parbox{0.15\columnwidth}{First
-} & \parbox{0.14\columnwidth}{row
-} & \parbox{0.16\columnwidth}{12.0
-} & \parbox{0.34\columnwidth}{Example of a row that spans multiple lines.
-}\\
-\parbox{0.15\columnwidth}{Second
-} & \parbox{0.14\columnwidth}{row
-} & \parbox{0.16\columnwidth}{5.0
-} & \parbox{0.34\columnwidth}{Here's another one. Note the blank line between
-rows.
-}\\
-\end{tabular}
-\end{center}
+\ctable[pos = H, center, botcap]{clrl}
+{% notes
+}
+{% rows
+\FL
+\parbox[t]{0.15\columnwidth}{\centering
+First
+} & \parbox[t]{0.14\columnwidth}{\raggedright
+row
+} & \parbox[t]{0.16\columnwidth}{\raggedleft
+12.0
+} & \parbox[t]{0.34\columnwidth}{\raggedright
+Example of a row that spans multiple lines.
+}
+\\\noalign{\medskip}
+\parbox[t]{0.15\columnwidth}{\centering
+Second
+} & \parbox[t]{0.14\columnwidth}{\raggedright
+row
+} & \parbox[t]{0.16\columnwidth}{\raggedleft
+5.0
+} & \parbox[t]{0.34\columnwidth}{\raggedright
+Here's another one. Note the blank line between rows.
+}
+\LL
+}
diff --git a/tests/tables.opendocument b/tests/tables.opendocument
index e103dee12..ff304ef26 100644
--- a/tests/tables.opendocument
+++ b/tests/tables.opendocument
@@ -65,7 +65,8 @@
</table:table>
<text:p text:style-name="Caption">Demonstration of simple table
syntax.</text:p>
-<text:p text:style-name="Text_20_body">Simple table without caption:</text:p>
+<text:p text:style-name="First_20_paragraph">Simple table without
+caption:</text:p>
<table:table table:name="Table2" table:style-name="Table2">
<table:table-column table:style-name="Table2.A" />
<table:table-column table:style-name="Table2.B" />
@@ -130,7 +131,7 @@ syntax.</text:p>
</table:table-cell>
</table:table-row>
</table:table>
-<text:p text:style-name="Text_20_body">Simple table indented two
+<text:p text:style-name="First_20_paragraph">Simple table indented two
spaces:</text:p>
<table:table table:name="Table3" table:style-name="Table3">
<table:table-column table:style-name="Table3.A" />
@@ -198,7 +199,8 @@ spaces:</text:p>
</table:table>
<text:p text:style-name="Caption">Demonstration of simple table
syntax.</text:p>
-<text:p text:style-name="Text_20_body">Multiline table with caption:</text:p>
+<text:p text:style-name="First_20_paragraph">Multiline table with
+caption:</text:p>
<table:table table:name="Table4" table:style-name="Table4">
<table:table-column table:style-name="Table4.A" />
<table:table-column table:style-name="Table4.B" />
@@ -253,7 +255,7 @@ syntax.</text:p>
</table:table>
<text:p text:style-name="Caption">Here's the caption. It may span multiple
lines.</text:p>
-<text:p text:style-name="Text_20_body">Multiline table without
+<text:p text:style-name="First_20_paragraph">Multiline table without
caption:</text:p>
<table:table table:name="Table5" table:style-name="Table5">
<table:table-column table:style-name="Table5.A" />
@@ -307,7 +309,8 @@ caption:</text:p>
</table:table-cell>
</table:table-row>
</table:table>
-<text:p text:style-name="Text_20_body">Table without column headers:</text:p>
+<text:p text:style-name="First_20_paragraph">Table without column
+headers:</text:p>
<table:table table:name="Table6" table:style-name="Table6">
<table:table-column table:style-name="Table6.A" />
<table:table-column table:style-name="Table6.B" />
@@ -356,7 +359,7 @@ caption:</text:p>
</table:table-cell>
</table:table-row>
</table:table>
-<text:p text:style-name="Text_20_body">Multiline table without column
+<text:p text:style-name="First_20_paragraph">Multiline table without column
headers:</text:p>
<table:table table:name="Table7" table:style-name="Table7">
<table:table-column table:style-name="Table7.A" />
diff --git a/tests/textile-reader.native b/tests/textile-reader.native
index 8c276d194..5dd6301f1 100644
--- a/tests/textile-reader.native
+++ b/tests/textile-reader.native
@@ -78,6 +78,7 @@ Pandoc (Meta {docTitle = [], docAuthors = [], docDate = []})
,Para [Str "Just",Space,Str "a",Space,Link [Str "url"] ("http://www.url.com","")]
,Para [Link [Str "Email",Space,Str "link"] ("mailto:nobody@nowhere.net","")]
,Para [Str "Automatic",Space,Str "linking",Space,Str "to",Space,Link [Str "http://www.example.com"] ("http://www.example.com",""),Space,Str "and",Space,Link [Str "foobar@example.com"] ("mailto:foobar@example.com",""),Str "."]
+,Para [Link [Str "Example"] ("http://www.example.com/",""),Str ":",Space,Str "Example",Space,Str "of",Space,Str "a",Space,Str "link",Space,Str "followed",Space,Str "by",Space,Str "a",Space,Str "colon",Str "."]
,Header 1 [Str "Tables"]
,Para [Str "Textile",Space,Str "allows",Space,Str "tables",Space,Str "with",Space,Str "and",Space,Str "without",Space,Str "headers",Space,Str ":"]
,Header 2 [Str "Without",Space,Str "headers"]
diff --git a/tests/textile-reader.textile b/tests/textile-reader.textile
index 9c9980307..85dcf142c 100644
--- a/tests/textile-reader.textile
+++ b/tests/textile-reader.textile
@@ -141,6 +141,8 @@ Just a "url":http://www.url.com
Automatic linking to http://www.example.com and foobar@example.com.
+"Example":http://www.example.com/: Example of a link followed by a colon.
+
h1. Tables
Textile allows tables with and without headers :
diff --git a/tests/writer.context b/tests/writer.context
index f9fb03cef..9c3221c31 100644
--- a/tests/writer.context
+++ b/tests/writer.context
@@ -490,9 +490,9 @@ Multiple blocks with italics:
\startdescr{{\em orange}}
orange fruit
- \starttyping
+\starttyping
{ orange code block }
- \stoptyping
+\stoptyping
\startblockquote
orange block quote
@@ -866,9 +866,9 @@ Here is a footnote reference,\footnote{Here is the footnote. It can go
Subsequent blocks are indented to show that they belong to the footnote (as
with list items).
- \starttyping
+\starttyping
{ <code> }
- \stoptyping
+\stoptyping
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 {\em not} be a footnote
diff --git a/tests/writer.docbook b/tests/writer.docbook
index e7e948288..780775d0f 100644
--- a/tests/writer.docbook
+++ b/tests/writer.docbook
@@ -84,11 +84,11 @@
<para>
Code in a block quote:
</para>
- <screen>
+ <programlisting>
sub status {
print &quot;working&quot;;
}
-</screen>
+</programlisting>
<para>
A list:
</para>
@@ -130,7 +130,7 @@ sub status {
<para>
Code:
</para>
- <screen>
+ <programlisting>
---- (should be four hyphens)
sub status {
@@ -138,15 +138,15 @@ sub status {
}
this code block is indented by one tab
-</screen>
+</programlisting>
<para>
And:
</para>
- <screen>
+ <programlisting>
this code block is indented by two tabs
These should not be escaped: \$ \\ \&gt; \[ \{
-</screen>
+</programlisting>
</section>
<section id="lists">
<title>Lists</title>
@@ -742,9 +742,9 @@ These should not be escaped: \$ \\ \&gt; \[ \{
<para>
orange fruit
</para>
- <screen>
+ <programlisting>
{ orange code block }
-</screen>
+</programlisting>
<blockquote>
<para>
orange block quote
@@ -902,17 +902,17 @@ These should not be escaped: \$ \\ \&gt; \[ \{
<para>
This should be a code block, though:
</para>
- <screen>
+ <programlisting>
&lt;div&gt;
foo
&lt;/div&gt;
-</screen>
+</programlisting>
<para>
As should this:
</para>
- <screen>
+ <programlisting>
&lt;div&gt;foo&lt;/div&gt;
-</screen>
+</programlisting>
<para>
Now, nested:
</para>
@@ -942,9 +942,9 @@ These should not be escaped: \$ \\ \&gt; \[ \{
<para>
Code block:
</para>
- <screen>
+ <programlisting>
&lt;!-- Comment --&gt;
-</screen>
+</programlisting>
<para>
Just plain comment, with trailing spaces on the line:
</para>
@@ -952,9 +952,9 @@ These should not be escaped: \$ \\ \&gt; \[ \{
<para>
Code:
</para>
- <screen>
+ <programlisting>
&lt;hr /&gt;
-</screen>
+</programlisting>
<para>
Hr's:
</para>
@@ -1291,9 +1291,9 @@ These should not be escaped: \$ \\ \&gt; \[ \{
<para>
This should [not][] be a link.
</para>
- <screen>
+ <programlisting>
[not]: /url
-</screen>
+</programlisting>
<para>
Foo <ulink url="/url/">bar</ulink>.
</para>
@@ -1355,9 +1355,9 @@ These should not be escaped: \$ \\ \&gt; \[ \{
Auto-links should not occur here:
<literal>&lt;http://example.com/&gt;</literal>
</para>
- <screen>
+ <programlisting>
or here: &lt;http://example.com/&gt;
-</screen>
+</programlisting>
</section>
</section>
<section id="images">
@@ -1398,9 +1398,9 @@ or here: &lt;http://example.com/&gt;
Subsequent blocks are indented to show that they belong to the
footnote (as with list items).
</para>
- <screen>
+ <programlisting>
{ &lt;code&gt; }
-</screen>
+</programlisting>
<para>
If you want, you can indent every line, but you can also be lazy and
just indent the first line of each block.
diff --git a/tests/writer.html b/tests/writer.html
index 371e8e17a..279c33019 100644
--- a/tests/writer.html
+++ b/tests/writer.html
@@ -9,7 +9,12 @@
<title>Pandoc Test Suite</title>
</head>
<body>
+<div id="header">
<h1 class="title">Pandoc Test Suite</h1>
+<h3 class="author">John MacFarlane</h3>
+<h3 class="author">Anonymous</h3>
+<h4 class="date">July 17, 2006</h4>
+</div>
<p>This is a set of tests for pandoc. Most of them are adapted from John Gruber’s markdown test suite.</p>
<hr />
<h1 id="headers">Headers</h1>
@@ -559,15 +564,15 @@ document.write('<a h'+'ref'+'="ma'+'ilto'+':'+e+'">'+'<code>'+e+'</code>'+'<\/'+
<div class="footnotes">
<hr />
<ol>
-<li id="fn1"><p>Here is the footnote. It can go anywhere after the footnote reference. It need not be placed at the end of the document. <a href="#fnref1" class="footnoteBackLink" title="Jump back to footnote 1">↩</a></p></li>
+<li id="fn1"><p>Here is the footnote. It can go anywhere after the footnote reference. It need not be placed at the end of the document. <a href="#fnref1" class="footnoteBackLink">↩</a></p></li>
<li id="fn2"><p>Here’s the long note. This one contains multiple blocks.</p>
<p>Subsequent blocks are indented to show that they belong to the footnote (as with list items).</p>
<pre><code> { &lt;code&gt; }
</code></pre>
-<p>If you want, you can indent every line, but you can also be lazy and just indent the first line of each block. <a href="#fnref2" class="footnoteBackLink" title="Jump back to footnote 2">↩</a></p></li>
-<li id="fn3"><p>This is <em>easier</em> to type. Inline notes may contain <a href="http://google.com">links</a> and <code>]</code> verbatim characters, as well as [bracketed text]. <a href="#fnref3" class="footnoteBackLink" title="Jump back to footnote 3">↩</a></p></li>
-<li id="fn4"><p>In quote. <a href="#fnref4" class="footnoteBackLink" title="Jump back to footnote 4">↩</a></p></li>
-<li id="fn5"><p>In list. <a href="#fnref5" class="footnoteBackLink" title="Jump back to footnote 5">↩</a></p></li>
+<p>If you want, you can indent every line, but you can also be lazy and just indent the first line of each block. <a href="#fnref2" class="footnoteBackLink">↩</a></p></li>
+<li id="fn3"><p>This is <em>easier</em> to type. Inline notes may contain <a href="http://google.com">links</a> and <code>]</code> verbatim characters, as well as [bracketed text]. <a href="#fnref3" class="footnoteBackLink">↩</a></p></li>
+<li id="fn4"><p>In quote. <a href="#fnref4" class="footnoteBackLink">↩</a></p></li>
+<li id="fn5"><p>In list. <a href="#fnref5" class="footnoteBackLink">↩</a></p></li>
</ol>
</div>
</body>
diff --git a/tests/writer.latex b/tests/writer.latex
index ff6e9d58b..5c2594ec7 100644
--- a/tests/writer.latex
+++ b/tests/writer.latex
@@ -1,7 +1,17 @@
\documentclass{article}
\usepackage{amssymb,amsmath}
-\usepackage[mathletters]{ucs}
-\usepackage[utf8x]{inputenc}
+\usepackage{ifxetex,ifluatex}
+\ifxetex
+ \usepackage{fontspec,xltxtra,xunicode}
+ \defaultfontfeatures{Mapping=tex-text,Scale=MatchLowercase}
+\else
+ \ifluatex
+ \usepackage{fontspec}
+ \defaultfontfeatures{Mapping=tex-text,Scale=MatchLowercase}
+ \else
+ \usepackage[utf8]{inputenc}
+ \fi
+\fi
\usepackage{fancyvrb}
% Redefine labelwidth for lists; otherwise, the enumerate package will cause
% markers to extend beyond the left margin.
@@ -10,10 +20,6 @@
{\setlength{\labelwidth}{4em}}
}\makeatother
\usepackage{enumerate}
-\usepackage[normalem]{ulem}
-% avoid problems with \sout in headers with hyperref:
-\pdfstringdefDisableCommands{\renewcommand{\sout}{}}
-\newcommand{\textsubscr}[1]{\ensuremath{_{\scriptsize\textrm{#1}}}}
\usepackage{url}
\usepackage{graphicx}
% We will generate all images so they have a width \maxwidth. This means
@@ -25,14 +31,26 @@
\makeatother
\let\Oldincludegraphics\includegraphics
\renewcommand{\includegraphics}[1]{\Oldincludegraphics[width=\maxwidth]{#1}}
-\usepackage[breaklinks=true,unicode=true,pdfborder={0 0 0}]{hyperref}
+\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, pdfborder={0 0 0}}
+\usepackage[normalem]{ulem}
+% avoid problems with \sout in headers with hyperref:
+\pdfstringdefDisableCommands{\renewcommand{\sout}{}}
+\newcommand{\textsubscr}[1]{\ensuremath{_{\scriptsize\textrm{#1}}}}
\setlength{\parindent}{0pt}
\setlength{\parskip}{6pt plus 2pt minus 1pt}
+\setlength{\emergencystretch}{3em} % prevent overfull lines
\setcounter{secnumdepth}{0}
\VerbatimFootnotes % allows verbatim text in footnotes
\title{Pandoc Test Suite}
-\author{John MacFarlane\\Anonymous}
+\author{John MacFarlane \and Anonymous}
\date{July 17, 2006}
\begin{document}
@@ -558,7 +576,8 @@ So is \textbf{\emph{this}} word.
So is \textbf{\emph{this}} word.
-This is code: \verb!>!, \verb!$!, \verb!\!, \verb!\$!, \verb!<html>!.
+This is code: \texttt{\textgreater{}}, \texttt{\$}, \texttt{\textbackslash{}},
+\texttt{\textbackslash{}\$}, \texttt{\textless{}html\textgreater{}}.
\sout{This is \emph{strikeout}.}
@@ -582,7 +601,7 @@ spaces: a\^{}b c\^{}d, a\ensuremath{\sim}b c\ensuremath{\sim}d.
`He said, ``I want to go.''\,' Were you alive in the 70's?
-Here is some quoted `\verb!code!' and a
+Here is some quoted `\texttt{code}' and a
``\href{http://example.com/?foo=1\&bar=2}{quoted link}''.
Some dashes: one---two --- three---four --- five.
@@ -618,14 +637,14 @@ These shouldn't be math:
\begin{itemize}
\item
- To get the famous equation, write \verb!$e = mc^2$!.
+ To get the famous equation, write \texttt{\$e = mc\^{}2\$}.
\item
\$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
- Escaped \verb!$!: \$73 \emph{this should be emphasized} 23\$.
+ Escaped \texttt{\$}: \$73 \emph{this should be emphasized} 23\$.
\end{itemize}
Here's a LaTeX table:
@@ -777,7 +796,8 @@ An e-mail address:
Blockquoted: \url{http://example.com/}
\end{quote}
-Auto-links should not occur here: \verb!<http://example.com/>!
+Auto-links should not occur here:
+\texttt{\textless{}http://example.com/\textgreater{}}
\begin{verbatim}
or here: <http://example.com/>
@@ -808,15 +828,15 @@ Here is a footnote reference,\footnote{Here is the footnote. It can go
Subsequent blocks are indented to show that they belong to the footnote (as
with list items).
- \begin{Verbatim}
+\begin{Verbatim}
{ <code> }
- \end{Verbatim}
+\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
- \href{http://google.com}{links} and \verb!]! verbatim characters, as well as
- {[}bracketed text{]}.}
+ \href{http://google.com}{links} and \texttt{{]}} verbatim characters, as
+ well as {[}bracketed text{]}.}
\begin{quote}
Notes can go in quotes.\footnote{In quote.}
diff --git a/tests/writer.opendocument b/tests/writer.opendocument
index 05d45792a..70ef85b46 100644
--- a/tests/writer.opendocument
+++ b/tests/writer.opendocument
@@ -874,12 +874,12 @@ link</text:span></text:a></text:h>
<text:h text:style-name="Heading_20_2" text:outline-level="2">Level 2 with
<text:span text:style-name="T2">emphasis</text:span></text:h>
<text:h text:style-name="Heading_20_3" text:outline-level="3">Level 3</text:h>
-<text:p text:style-name="Text_20_body">with no blank line</text:p>
+<text:p text:style-name="First_20_paragraph">with no blank line</text:p>
<text:h text:style-name="Heading_20_2" text:outline-level="2">Level 2</text:h>
-<text:p text:style-name="Text_20_body">with no blank line</text:p>
+<text:p text:style-name="First_20_paragraph">with no blank line</text:p>
<text:p text:style-name="Horizontal_20_Line" />
<text:h text:style-name="Heading_20_1" text:outline-level="1">Paragraphs</text:h>
-<text:p text:style-name="Text_20_body">Here&#8217;s a regular
+<text:p text:style-name="First_20_paragraph">Here&#8217;s a regular
paragraph.</text:p>
<text:p text:style-name="Text_20_body">In Markdown 1.0.0 and earlier. Version
8. This line turns into a list item. Because a hard-wrapped line in the middle
@@ -891,7 +891,7 @@ 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>
-<text:p text:style-name="Text_20_body">E-mail style:</text:p>
+<text:p text:style-name="First_20_paragraph">E-mail style:</text:p>
<text:p text:style-name="P1">This is a block quote. It is pretty
short.</text:p>
<text:p text:style-name="P2">Code in a block quote:</text:p>
@@ -910,13 +910,13 @@ short.</text:p>
<text:p text:style-name="P2">Nested block quotes:</text:p>
<text:p text:style-name="P7">nested</text:p>
<text:p text:style-name="P8">nested</text:p>
-<text:p text:style-name="Text_20_body">This should not be a block quote: 2
-&gt; 1.</text:p>
+<text:p text:style-name="First_20_paragraph">This should not be a block quote:
+2 &gt; 1.</text:p>
<text:p text:style-name="Text_20_body">And a following paragraph.</text:p>
<text:p text:style-name="Horizontal_20_Line" />
<text:h text:style-name="Heading_20_1" text:outline-level="1">Code
Blocks</text:h>
-<text:p text:style-name="Text_20_body">Code:</text:p>
+<text:p text:style-name="First_20_paragraph">Code:</text:p>
<text:p text:style-name="P9">---- (should be four hyphens)</text:p>
<text:p text:style-name="P10"></text:p>
<text:p text:style-name="P11">sub status {</text:p>
@@ -924,14 +924,14 @@ Blocks</text:h>
<text:p text:style-name="P13">}</text:p>
<text:p text:style-name="P14"></text:p>
<text:p text:style-name="P15">this code block is indented by one tab</text:p>
-<text:p text:style-name="Text_20_body">And:</text:p>
+<text:p text:style-name="First_20_paragraph">And:</text:p>
<text:p text:style-name="P16"><text:s text:c="4" />this code block is indented by two tabs</text:p>
<text:p text:style-name="P17"></text:p>
<text:p text:style-name="P18">These should not be escaped: <text:s text:c="1" />\$ \\ \&gt; \[ \{</text:p>
<text:p text:style-name="Horizontal_20_Line" />
<text:h text:style-name="Heading_20_1" text:outline-level="1">Lists</text:h>
<text:h text:style-name="Heading_20_2" text:outline-level="2">Unordered</text:h>
-<text:p text:style-name="Text_20_body">Asterisks tight:</text:p>
+<text:p text:style-name="First_20_paragraph">Asterisks tight:</text:p>
<text:list text:style-name="L2">
<text:list-item>
<text:p text:style-name="P19">asterisk 1</text:p>
@@ -943,7 +943,7 @@ Blocks</text:h>
<text:p text:style-name="P19">asterisk 3</text:p>
</text:list-item>
</text:list>
-<text:p text:style-name="Text_20_body">Asterisks loose:</text:p>
+<text:p text:style-name="First_20_paragraph">Asterisks loose:</text:p>
<text:list text:style-name="L3">
<text:list-item>
<text:p text:style-name="P20">asterisk 1</text:p>
@@ -955,7 +955,7 @@ Blocks</text:h>
<text:p text:style-name="P20">asterisk 3</text:p>
</text:list-item>
</text:list>
-<text:p text:style-name="Text_20_body">Pluses tight:</text:p>
+<text:p text:style-name="First_20_paragraph">Pluses tight:</text:p>
<text:list text:style-name="L4">
<text:list-item>
<text:p text:style-name="P21">Plus 1</text:p>
@@ -967,7 +967,7 @@ Blocks</text:h>
<text:p text:style-name="P21">Plus 3</text:p>
</text:list-item>
</text:list>
-<text:p text:style-name="Text_20_body">Pluses loose:</text:p>
+<text:p text:style-name="First_20_paragraph">Pluses loose:</text:p>
<text:list text:style-name="L5">
<text:list-item>
<text:p text:style-name="P22">Plus 1</text:p>
@@ -979,7 +979,7 @@ Blocks</text:h>
<text:p text:style-name="P22">Plus 3</text:p>
</text:list-item>
</text:list>
-<text:p text:style-name="Text_20_body">Minuses tight:</text:p>
+<text:p text:style-name="First_20_paragraph">Minuses tight:</text:p>
<text:list text:style-name="L6">
<text:list-item>
<text:p text:style-name="P23">Minus 1</text:p>
@@ -991,7 +991,7 @@ Blocks</text:h>
<text:p text:style-name="P23">Minus 3</text:p>
</text:list-item>
</text:list>
-<text:p text:style-name="Text_20_body">Minuses loose:</text:p>
+<text:p text:style-name="First_20_paragraph">Minuses loose:</text:p>
<text:list text:style-name="L7">
<text:list-item>
<text:p text:style-name="P24">Minus 1</text:p>
@@ -1004,7 +1004,7 @@ Blocks</text:h>
</text:list-item>
</text:list>
<text:h text:style-name="Heading_20_2" text:outline-level="2">Ordered</text:h>
-<text:p text:style-name="Text_20_body">Tight:</text:p>
+<text:p text:style-name="First_20_paragraph">Tight:</text:p>
<text:list text:style-name="L8">
<text:list-item>
<text:p text:style-name="P25">First</text:p>
@@ -1016,7 +1016,7 @@ Blocks</text:h>
<text:p text:style-name="P25">Third</text:p>
</text:list-item>
</text:list>
-<text:p text:style-name="Text_20_body">and:</text:p>
+<text:p text:style-name="First_20_paragraph">and:</text:p>
<text:list text:style-name="L9">
<text:list-item>
<text:p text:style-name="P26">One</text:p>
@@ -1028,7 +1028,7 @@ Blocks</text:h>
<text:p text:style-name="P26">Three</text:p>
</text:list-item>
</text:list>
-<text:p text:style-name="Text_20_body">Loose using tabs:</text:p>
+<text:p text:style-name="First_20_paragraph">Loose using tabs:</text:p>
<text:list text:style-name="L10">
<text:list-item>
<text:p text:style-name="P27">First</text:p>
@@ -1040,7 +1040,7 @@ Blocks</text:h>
<text:p text:style-name="P27">Third</text:p>
</text:list-item>
</text:list>
-<text:p text:style-name="Text_20_body">and using spaces:</text:p>
+<text:p text:style-name="First_20_paragraph">and using spaces:</text:p>
<text:list text:style-name="L11">
<text:list-item>
<text:p text:style-name="P28">One</text:p>
@@ -1052,7 +1052,7 @@ Blocks</text:h>
<text:p text:style-name="P28">Three</text:p>
</text:list-item>
</text:list>
-<text:p text:style-name="Text_20_body">Multiple paragraphs:</text:p>
+<text:p text:style-name="First_20_paragraph">Multiple paragraphs:</text:p>
<text:list text:style-name="L12">
<text:list-item>
<text:p text:style-name="P29">Item 1, graf one.</text:p>
@@ -1080,7 +1080,7 @@ Blocks</text:h>
</text:list>
</text:list-item>
</text:list>
-<text:p text:style-name="Text_20_body">Here&#8217;s another:</text:p>
+<text:p text:style-name="First_20_paragraph">Here&#8217;s another:</text:p>
<text:list text:style-name="L16">
<text:list-item>
<text:p text:style-name="P33">First</text:p>
@@ -1103,7 +1103,7 @@ Blocks</text:h>
<text:p text:style-name="P33">Third</text:p>
</text:list-item>
</text:list>
-<text:p text:style-name="Text_20_body">Same thing but with
+<text:p text:style-name="First_20_paragraph">Same thing but with
paragraphs:</text:p>
<text:list text:style-name="L18">
<text:list-item>
@@ -1176,7 +1176,7 @@ markers</text:h>
</text:list>
</text:list-item>
</text:list>
-<text:p text:style-name="Text_20_body">Nesting:</text:p>
+<text:p text:style-name="First_20_paragraph">Nesting:</text:p>
<text:list text:style-name="L23">
<text:list-item>
<text:p text:style-name="P40">Upper Alpha</text:p>
@@ -1197,7 +1197,7 @@ markers</text:h>
</text:list>
</text:list-item>
</text:list>
-<text:p text:style-name="Text_20_body">Autonumbering:</text:p>
+<text:p text:style-name="First_20_paragraph">Autonumbering:</text:p>
<text:list text:style-name="L24">
<text:list-item>
<text:p text:style-name="P41">Autonumber.</text:p>
@@ -1211,13 +1211,14 @@ markers</text:h>
</text:list>
</text:list-item>
</text:list>
-<text:p text:style-name="Text_20_body">Should not be a list item:</text:p>
+<text:p text:style-name="First_20_paragraph">Should not be a list
+item:</text:p>
<text:p text:style-name="Text_20_body">M.A. 2007</text:p>
<text:p text:style-name="Text_20_body">B. Williams</text:p>
<text:p text:style-name="Horizontal_20_Line" />
<text:h text:style-name="Heading_20_1" text:outline-level="1">Definition
Lists</text:h>
-<text:p text:style-name="Text_20_body">Tight using spaces:</text:p>
+<text:p text:style-name="First_20_paragraph">Tight using spaces:</text:p>
<text:p text:style-name="Definition_20_Term_20_Tight">apple</text:p>
<text:p text:style-name="Definition_20_Definition_20_Tight">red fruit</text:p>
<text:p text:style-name="Definition_20_Term_20_Tight">orange</text:p>
@@ -1226,7 +1227,7 @@ fruit</text:p>
<text:p text:style-name="Definition_20_Term_20_Tight">banana</text:p>
<text:p text:style-name="Definition_20_Definition_20_Tight">yellow
fruit</text:p>
-<text:p text:style-name="Text_20_body">Tight using tabs:</text:p>
+<text:p text:style-name="First_20_paragraph">Tight using tabs:</text:p>
<text:p text:style-name="Definition_20_Term_20_Tight">apple</text:p>
<text:p text:style-name="Definition_20_Definition_20_Tight">red fruit</text:p>
<text:p text:style-name="Definition_20_Term_20_Tight">orange</text:p>
@@ -1235,14 +1236,15 @@ fruit</text:p>
<text:p text:style-name="Definition_20_Term_20_Tight">banana</text:p>
<text:p text:style-name="Definition_20_Definition_20_Tight">yellow
fruit</text:p>
-<text:p text:style-name="Text_20_body">Loose:</text:p>
+<text:p text:style-name="First_20_paragraph">Loose:</text:p>
<text:p text:style-name="Definition_20_Term">apple</text:p>
<text:p text:style-name="Definition_20_Definition">red fruit</text:p>
<text:p text:style-name="Definition_20_Term">orange</text:p>
<text:p text:style-name="Definition_20_Definition">orange fruit</text:p>
<text:p text:style-name="Definition_20_Term">banana</text:p>
<text:p text:style-name="Definition_20_Definition">yellow fruit</text:p>
-<text:p text:style-name="Text_20_body">Multiple blocks with italics:</text:p>
+<text:p text:style-name="First_20_paragraph">Multiple blocks with
+italics:</text:p>
<text:p text:style-name="Definition_20_Term"><text:span text:style-name="T3">apple</text:span></text:p>
<text:p text:style-name="Definition_20_Definition">red
fruit</text:p><text:p text:style-name="Definition_20_Definition">contains
@@ -1250,7 +1252,8 @@ seeds, crisp, pleasant to taste</text:p>
<text:p text:style-name="Definition_20_Term"><text:span text:style-name="T4">orange</text:span></text:p>
<text:p text:style-name="Definition_20_Definition">orange fruit</text:p><text:p text:style-name="P42">{ orange code block }</text:p><text:p text:style-name="P43">orange
block quote</text:p>
-<text:p text:style-name="Text_20_body">Multiple definitions, tight:</text:p>
+<text:p text:style-name="First_20_paragraph">Multiple definitions,
+tight:</text:p>
<text:p text:style-name="Definition_20_Term_20_Tight">apple</text:p>
<text:p text:style-name="Definition_20_Definition_20_Tight">red fruit</text:p>
<text:p text:style-name="Definition_20_Definition_20_Tight">computer</text:p>
@@ -1258,15 +1261,16 @@ block quote</text:p>
<text:p text:style-name="Definition_20_Definition_20_Tight">orange
fruit</text:p>
<text:p text:style-name="Definition_20_Definition_20_Tight">bank</text:p>
-<text:p text:style-name="Text_20_body">Multiple definitions, loose:</text:p>
+<text:p text:style-name="First_20_paragraph">Multiple definitions,
+loose:</text:p>
<text:p text:style-name="Definition_20_Term">apple</text:p>
<text:p text:style-name="Definition_20_Definition">red fruit</text:p>
<text:p text:style-name="Definition_20_Definition">computer</text:p>
<text:p text:style-name="Definition_20_Term">orange</text:p>
<text:p text:style-name="Definition_20_Definition">orange fruit</text:p>
<text:p text:style-name="Definition_20_Definition">bank</text:p>
-<text:p text:style-name="Text_20_body">Blank line after term, indented marker,
-alternate markers:</text:p>
+<text:p text:style-name="First_20_paragraph">Blank line after term, indented
+marker, alternate markers:</text:p>
<text:p text:style-name="Definition_20_Term">apple</text:p>
<text:p text:style-name="Definition_20_Definition">red fruit</text:p>
<text:p text:style-name="Definition_20_Definition">computer</text:p>
@@ -1282,7 +1286,8 @@ fruit</text:p><text:list text:style-name="L25">
</text:list>
<text:h text:style-name="Heading_20_1" text:outline-level="1">HTML
Blocks</text:h>
-<text:p text:style-name="Text_20_body">Simple block on one line:</text:p>
+<text:p text:style-name="First_20_paragraph">Simple block on one
+line:</text:p>
<text:p text:style-name="Text_20_body">foo</text:p>
<text:p text:style-name="Text_20_body">And nested without
indentation:</text:p>
@@ -1301,24 +1306,24 @@ though:</text:p>
<text:p text:style-name="P45">&lt;div&gt;</text:p>
<text:p text:style-name="P46"><text:s text:c="4" />foo</text:p>
<text:p text:style-name="P47">&lt;/div&gt;</text:p>
-<text:p text:style-name="Text_20_body">As should this:</text:p>
+<text:p text:style-name="First_20_paragraph">As should this:</text:p>
<text:p text:style-name="P48">&lt;div&gt;foo&lt;/div&gt;</text:p>
-<text:p text:style-name="Text_20_body">Now, nested:</text:p>
+<text:p text:style-name="First_20_paragraph">Now, nested:</text:p>
<text:p text:style-name="Text_20_body">foo</text:p>
<text:p text:style-name="Text_20_body">This should just be an HTML
comment:</text:p>
<text:p text:style-name="Text_20_body">Multiline:</text:p>
<text:p text:style-name="Text_20_body">Code block:</text:p>
<text:p text:style-name="P49">&lt;!-- Comment --&gt;</text:p>
-<text:p text:style-name="Text_20_body">Just plain comment, with trailing
+<text:p text:style-name="First_20_paragraph">Just plain comment, with trailing
spaces on the line:</text:p>
<text:p text:style-name="Text_20_body">Code:</text:p>
<text:p text:style-name="P50">&lt;hr /&gt;</text:p>
-<text:p text:style-name="Text_20_body">Hr&#8217;s:</text:p>
+<text:p text:style-name="First_20_paragraph">Hr&#8217;s:</text:p>
<text:p text:style-name="Horizontal_20_Line" />
<text:h text:style-name="Heading_20_1" text:outline-level="1">Inline
Markup</text:h>
-<text:p text:style-name="Text_20_body">This is
+<text:p text:style-name="First_20_paragraph">This is
<text:span text:style-name="T7">emphasized</text:span>, and so
<text:span text:style-name="T8">is</text:span><text:span text:style-name="T9">
</text:span><text:span text:style-name="T10">this</text:span>.</text:p>
@@ -1365,8 +1370,8 @@ subscripts, because of the unescaped spaces: a^b c^d, a~b c~d.</text:p>
<text:p text:style-name="Horizontal_20_Line" />
<text:h text:style-name="Heading_20_1" text:outline-level="1">Smart quotes,
ellipses, dashes</text:h>
-<text:p text:style-name="Text_20_body">&#8220;Hello,&#8221; said the spider.
-&#8220;&#8216;Shelob&#8217; is my name.&#8221;</text:p>
+<text:p text:style-name="First_20_paragraph">&#8220;Hello,&#8221; said the
+spider. &#8220;&#8216;Shelob&#8217; is my name.&#8221;</text:p>
<text:p text:style-name="Text_20_body">&#8216;A&#8217;, &#8216;B&#8217;, and
&#8216;C&#8217; are letters.</text:p>
<text:p text:style-name="Text_20_body">&#8216;Oak,&#8217; &#8216;elm,&#8217;
@@ -1413,7 +1418,8 @@ three&#8212;four &#8212; five.</text:p>
α + ω × <text:span text:style-name="T61">x</text:span><text:span text:style-name="T62">2</text:span>.</text:p>
</text:list-item>
</text:list>
-<text:p text:style-name="Text_20_body">These shouldn&#8217;t be math:</text:p>
+<text:p text:style-name="First_20_paragraph">These shouldn&#8217;t be
+math:</text:p>
<text:list text:style-name="L27">
<text:list-item>
<text:p text:style-name="P52">To get the famous equation, write
@@ -1437,11 +1443,12 @@ three&#8212;four &#8212; five.</text:p>
23$.</text:p>
</text:list-item>
</text:list>
-<text:p text:style-name="Text_20_body">Here&#8217;s a LaTeX table:</text:p>
+<text:p text:style-name="First_20_paragraph">Here&#8217;s a LaTeX
+table:</text:p>
<text:p text:style-name="Horizontal_20_Line" />
<text:h text:style-name="Heading_20_1" text:outline-level="1">Special
Characters</text:h>
-<text:p text:style-name="Text_20_body">Here is some unicode:</text:p>
+<text:p text:style-name="First_20_paragraph">Here is some unicode:</text:p>
<text:list text:style-name="L28">
<text:list-item>
<text:p text:style-name="P53">I hat: Î</text:p>
@@ -1459,8 +1466,8 @@ Characters</text:h>
<text:p text:style-name="P53">copyright: ©</text:p>
</text:list-item>
</text:list>
-<text:p text:style-name="Text_20_body">AT&amp;T has an ampersand in their
-name.</text:p>
+<text:p text:style-name="First_20_paragraph">AT&amp;T has an ampersand in
+their name.</text:p>
<text:p text:style-name="Text_20_body">AT&amp;T is another way to write
it.</text:p>
<text:p text:style-name="Text_20_body">This &amp; that.</text:p>
@@ -1485,7 +1492,7 @@ it.</text:p>
<text:p text:style-name="Horizontal_20_Line" />
<text:h text:style-name="Heading_20_1" text:outline-level="1">Links</text:h>
<text:h text:style-name="Heading_20_2" text:outline-level="2">Explicit</text:h>
-<text:p text:style-name="Text_20_body">Just a
+<text:p text:style-name="First_20_paragraph">Just a
<text:a xlink:type="simple" xlink:href="/url/" office:name=""><text:span text:style-name="Definition">URL</text:span></text:a>.</text:p>
<text:p text:style-name="Text_20_body"><text:a xlink:type="simple" xlink:href="/url/" office:name="title"><text:span text:style-name="Definition">URL
and title</text:span></text:a>.</text:p>
@@ -1502,7 +1509,7 @@ and title</text:span></text:a></text:p>
link</text:span></text:a></text:p>
<text:p text:style-name="Text_20_body"><text:a xlink:type="simple" xlink:href="" office:name=""><text:span text:style-name="Definition">Empty</text:span></text:a>.</text:p>
<text:h text:style-name="Heading_20_2" text:outline-level="2">Reference</text:h>
-<text:p text:style-name="Text_20_body">Foo
+<text:p text:style-name="First_20_paragraph">Foo
<text:a xlink:type="simple" xlink:href="/url/" office:name=""><text:span text:style-name="Definition">bar</text:span></text:a>.</text:p>
<text:p text:style-name="Text_20_body">Foo
<text:a xlink:type="simple" xlink:href="/url/" office:name=""><text:span text:style-name="Definition">bar</text:span></text:a>.</text:p>
@@ -1521,13 +1528,13 @@ by itself should be a link.</text:p>
<text:a xlink:type="simple" xlink:href="/url" office:name=""><text:span text:style-name="Definition">thrice</text:span></text:a>.</text:p>
<text:p text:style-name="Text_20_body">This should [not][] be a link.</text:p>
<text:p text:style-name="P54">[not]: /url</text:p>
-<text:p text:style-name="Text_20_body">Foo
+<text:p text:style-name="First_20_paragraph">Foo
<text:a xlink:type="simple" xlink:href="/url/" office:name="Title with &quot;quotes&quot; inside"><text:span text:style-name="Definition">bar</text:span></text:a>.</text:p>
<text:p text:style-name="Text_20_body">Foo
<text:a xlink:type="simple" xlink:href="/url/" office:name="Title with &quot;quote&quot; inside"><text:span text:style-name="Definition">biz</text:span></text:a>.</text:p>
<text:h text:style-name="Heading_20_2" text:outline-level="2">With
ampersands</text:h>
-<text:p text:style-name="Text_20_body">Here&#8217;s a
+<text:p text:style-name="First_20_paragraph">Here&#8217;s a
<text:a xlink:type="simple" xlink:href="http://example.com/?foo=1&amp;bar=2" office:name=""><text:span text:style-name="Definition">link
with an ampersand in the URL</text:span></text:a>.</text:p>
<text:p text:style-name="Text_20_body">Here&#8217;s a link with an amersand in
@@ -1540,7 +1547,7 @@ link</text:span></text:a>.</text:p>
<text:a xlink:type="simple" xlink:href="/script?foo=1&amp;bar=2" office:name=""><text:span text:style-name="Definition">inline
link in pointy braces</text:span></text:a>.</text:p>
<text:h text:style-name="Heading_20_2" text:outline-level="2">Autolinks</text:h>
-<text:p text:style-name="Text_20_body">With an ampersand:
+<text:p text:style-name="First_20_paragraph">With an ampersand:
<text:a xlink:type="simple" xlink:href="http://example.com/?foo=1&amp;bar=2" office:name=""><text:span text:style-name="Definition"><text:span text:style-name="Teletype">http://example.com/?foo=1&amp;bar=2</text:span></text:span></text:a></text:p>
<text:list text:style-name="L29">
<text:list-item>
@@ -1553,24 +1560,24 @@ link in pointy braces</text:span></text:a>.</text:p>
<text:p text:style-name="P55">It should.</text:p>
</text:list-item>
</text:list>
-<text:p text:style-name="Text_20_body">An e-mail address:
+<text:p text:style-name="First_20_paragraph">An e-mail address:
<text:a xlink:type="simple" xlink:href="mailto:nobody@nowhere.net" office:name=""><text:span text:style-name="Definition"><text:span text:style-name="Teletype">nobody@nowhere.net</text:span></text:span></text:a></text:p>
<text:p text:style-name="P56">Blockquoted:
<text:a xlink:type="simple" xlink:href="http://example.com/" office:name=""><text:span text:style-name="Definition"><text:span text:style-name="Teletype">http://example.com/</text:span></text:span></text:a></text:p>
-<text:p text:style-name="Text_20_body">Auto-links should not occur here:
+<text:p text:style-name="First_20_paragraph">Auto-links should not occur here:
<text:span text:style-name="Teletype">&lt;http://example.com/&gt;</text:span></text:p>
<text:p text:style-name="P57">or here: &lt;http://example.com/&gt;</text:p>
<text:p text:style-name="Horizontal_20_Line" />
<text:h text:style-name="Heading_20_1" text:outline-level="1">Images</text:h>
-<text:p text:style-name="Text_20_body">From &#8220;Voyage dans la Lune&#8221;
-by Georges Melies (1902):</text:p>
-<text:p text:style-name="Text_20_body"><draw:frame><draw:image xlink:href="lalune.jpg" xlink:type="simple" xlink:show="embed" xlink:actuate="onLoad" /></draw:frame></text:p>
+<text:p text:style-name="First_20_paragraph">From &#8220;Voyage dans la
+Lune&#8221; by Georges Melies (1902):</text:p>
+<text:p text:style-name="Text_20_body"><draw:frame><draw:image xlink:href="lalune.jpg" xlink:type="simple" xlink:show="embed" xlink:actuate="onLoad" /></draw:frame></text:p>
<text:p text:style-name="Text_20_body">Here is a movie
-<draw:frame><draw:image xlink:href="movie.jpg" xlink:type="simple" xlink:show="embed" xlink:actuate="onLoad" /></draw:frame>
+<draw:frame><draw:image xlink:href="movie.jpg" xlink:type="simple" xlink:show="embed" xlink:actuate="onLoad" /></draw:frame>
icon.</text:p>
<text:p text:style-name="Horizontal_20_Line" />
<text:h text:style-name="Heading_20_1" text:outline-level="1">Footnotes</text:h>
-<text:p text:style-name="Text_20_body">Here is a footnote
+<text:p text:style-name="First_20_paragraph">Here is a footnote
reference,<text:note text:id="ftn0" text:note-class="footnote"><text:note-citation>1</text:note-citation><text:note-body><text:p text:style-name="Footnote">Here
is the footnote. It can go anywhere after the footnote reference. It need not
be placed at the end of the document.</text:p></text:note-body></text:note>
@@ -1600,8 +1607,8 @@ quote.</text:p></text:note-body></text:note></text:p>
list.</text:p></text:note-body></text:note></text:p>
</text:list-item>
</text:list>
-<text:p text:style-name="Text_20_body">This paragraph should not be part of
-the note, as it is not indented.</text:p>
+<text:p text:style-name="First_20_paragraph">This paragraph should not be part
+of the note, as it is not indented.</text:p>
</office:text>
</office:body>
</office:document-content>