From 6e17070be15be95cd05c466d4a2fed3ad5d756ef Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sat, 30 Nov 2013 15:06:19 -0800 Subject: Documented use of YAML metadata for EPUB. --- README | 73 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 72 insertions(+), 1 deletion(-) (limited to 'README') diff --git a/README b/README index 133c99f64..285f3d638 100644 --- a/README +++ b/README @@ -560,6 +560,10 @@ Options affecting specific writers id="BookId">` (a randomly generated UUID). Any of these may be overridden by elements in the metadata file. + Note: if the source document is markdown, a YAML metadata block + in the document can be used instead. See below under + [EPUB Metadata]. + `--epub-embed-font=`*FILE* : Embed the specified font in the EPUB. This option can be repeated to embed multiple fonts. To use embedded fonts, you @@ -2749,6 +2753,72 @@ To show the notes window, press `s` while viewing the presentation. Notes are not yet supported for other slide formats, but the notes will not appear on the slides themselves. +EPUB Metadata +============= + +EPUB metadata may be specified using the `--epub-metadata` option, but +if the source document is markdown, it is better to use a YAML metadata +block. Here is an example: + + --- + title: + - type: main + text: My Book + - type: subtitle + text: An investigation of metadata + creator: + - role: author + text: John Smith + - role: editor + text: Sarah Jones + identifier: + - scheme: DOI + text: doi:10.234234.234/33 + publisher: My Press + rights: (c) 2007 John Smith, CC BY-NC + ... + +The following fields are recognized: + +identifier + ~ Either a string value or an object with fields `text` and + `scheme`. Valid values for `scheme` are `ISBN-10`, + `GTIN-13`, `UPC`, `ISMN-10`, `DOI`, `LCCN`, `GTIN-14`, + `ISBN-13`, `Legal deposit number`, `URN`, `OCLC`, + `ISMN-13`, `ISBN-A`, `JP`, `OLCC`. +title + ~ Either a string value, or an object with fields `file-as` and + `type`, or a list of such objects. Valid values for `type` are + `main`, `subtitle`, `short`, `collection`, `edition`, `extended`. +creator + ~ Either a string value, or an object with fields `role`, `file-as`, + and `text`, or a list of such objects. Valid values for `role` are + [marc relators](http://www.loc.gov/marc/relators/relaterm.html), but + pandoc will attempt to translate the human-readable versions + (like "author" and "editor") to the appropriate marc relators. +contributor + ~ Same format as `creator`. +date + ~ A string value in `YYYY-MM-DD` format. (Only the year is necessary.) + Pandoc will attempt to convert other common date formats. +language + ~ A string value in [RFC5646] format. Pandoc will default to the local + language if nothing is specified. +subject + ~ A string value or a list of such values. +description + ~ A string value. +type + ~ A string value. +format + ~ A string value. +relation + ~ A string value. +coverage + ~ A string value. +rights + ~ A string value. + Literate Haskell support ======================== @@ -2860,4 +2930,5 @@ Jamie F. Olson. [reveal.js]: http://lab.hakim.se/reveal-js/ [FictionBook2]: http://www.fictionbook.org/index.php/Eng:XML_Schema_Fictionbook_2.1 [lua]: http://www.lua.org - +[marc relators]: http://www.loc.gov/marc/relators/relaterm.html +[RFC5646]: http://tools.ietf.org/html/rfc5646 -- cgit v1.2.3 From 2f4bf9dfa4049f9dc087c969442dcbf8f4e4c2a1 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sat, 30 Nov 2013 15:08:09 -0800 Subject: README: minor reformatting. --- README | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'README') diff --git a/README b/README index 285f3d638..3afbe8b0b 100644 --- a/README +++ b/README @@ -2780,43 +2780,43 @@ block. Here is an example: The following fields are recognized: -identifier +`identifier` ~ Either a string value or an object with fields `text` and `scheme`. Valid values for `scheme` are `ISBN-10`, `GTIN-13`, `UPC`, `ISMN-10`, `DOI`, `LCCN`, `GTIN-14`, `ISBN-13`, `Legal deposit number`, `URN`, `OCLC`, `ISMN-13`, `ISBN-A`, `JP`, `OLCC`. -title +`title` ~ Either a string value, or an object with fields `file-as` and `type`, or a list of such objects. Valid values for `type` are `main`, `subtitle`, `short`, `collection`, `edition`, `extended`. -creator +`creator` ~ Either a string value, or an object with fields `role`, `file-as`, and `text`, or a list of such objects. Valid values for `role` are [marc relators](http://www.loc.gov/marc/relators/relaterm.html), but pandoc will attempt to translate the human-readable versions (like "author" and "editor") to the appropriate marc relators. -contributor +`contributor` ~ Same format as `creator`. -date +`date` ~ A string value in `YYYY-MM-DD` format. (Only the year is necessary.) Pandoc will attempt to convert other common date formats. -language +`language` ~ A string value in [RFC5646] format. Pandoc will default to the local language if nothing is specified. -subject +`subject` ~ A string value or a list of such values. -description +`description` ~ A string value. -type +`type` ~ A string value. -format +`format` ~ A string value. -relation +`relation` ~ A string value. -coverage +`coverage` ~ A string value. -rights +`rights` ~ A string value. Literate Haskell support -- cgit v1.2.3 From 96b678d823b544e3da7dd8531615c52de6164cb8 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sat, 30 Nov 2013 15:17:38 -0800 Subject: Allow specification of epub-cover-image in YAML metadata. --- README | 6 +++++- src/Text/Pandoc/Writers/EPUB.hs | 17 ++++++++--------- 2 files changed, 13 insertions(+), 10 deletions(-) (limited to 'README') diff --git a/README b/README index 3afbe8b0b..35194769b 100644 --- a/README +++ b/README @@ -541,7 +541,9 @@ Options affecting specific writers `--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. + that the image be less than 1000px in width and height. Note that + in a markdown source document you can also specify `epub-cover-image` + in a YAML metadata block (see [EPUB Metadata], below). `--epub-metadata=`*FILE* : Look in the specified XML file for metadata for the EPUB. @@ -2818,6 +2820,8 @@ The following fields are recognized: ~ A string value. `rights` ~ A string value. +`epub-cover-image` + ~ A string value (path to cover image). Literate Haskell support ======================== diff --git a/src/Text/Pandoc/Writers/EPUB.hs b/src/Text/Pandoc/Writers/EPUB.hs index 4f1de5df0..a3b01848e 100644 --- a/src/Text/Pandoc/Writers/EPUB.hs +++ b/src/Text/Pandoc/Writers/EPUB.hs @@ -279,8 +279,7 @@ metadataFromMeta opts meta = EPUBMetadata{ relation = metaValueToString <$> lookupMeta "relation" meta coverage = metaValueToString <$> lookupMeta "coverage" meta rights = metaValueToString <$> lookupMeta "rights" meta - coverImage = fmap (const "cover-image") $ - lookup "epub-cover-image" $ writerVariables opts + coverImage = lookup "epub-cover-image" (writerVariables opts) -- | Produce an EPUB file from a Pandoc document. writeEPUB :: WriterOptions -- ^ Writer options @@ -305,11 +304,11 @@ writeEPUB opts doc@(Pandoc meta _) = do then MathML Nothing else writerHTMLMathMethod opts , writerWrapText = False } - let mbCoverImage = lookup "epub-cover-image" vars + metadata <- getEPUBMetadata opts' meta -- cover page (cpgEntry, cpicEntry) <- - case mbCoverImage of + case epubCoverImage metadata of Nothing -> return ([],[]) Just img -> do let coverImage = "cover-image" ++ takeExtension img @@ -421,7 +420,6 @@ writeEPUB opts doc@(Pandoc meta _) = do [("id", takeBaseName $ eRelativePath ent), ("href", eRelativePath ent), ("media-type", maybe "" id $ getMimeType $ eRelativePath ent)] $ () - metadata <- getEPUBMetadata opts' meta let plainTitle = case docTitle meta of [] -> case epubTitle metadata of [] -> "UNTITLED" @@ -452,7 +450,7 @@ writeEPUB opts doc@(Pandoc meta _) = do map pictureNode (cpicEntry ++ picEntries) ++ map fontNode fontEntries , unode "spine" ! [("toc","ncx")] $ - case mbCoverImage of + case epubCoverImage metadata of Nothing -> [] Just _ -> [ unode "itemref" ! [("idref", "cover"),("linear","no")] $ () ] @@ -471,7 +469,7 @@ writeEPUB opts doc@(Pandoc meta _) = do ("href","nav.xhtml")] $ () ] ++ [ unode "reference" ! - [("type","cover"),("title","Cover"),("href","cover.xhtml")] $ () | mbCoverImage /= Nothing + [("type","cover"),("title","Cover"),("href","cover.xhtml")] $ () | epubCoverImage metadata /= Nothing ] ] let contentsEntry = mkEntry "content.opf" contentsData @@ -526,7 +524,7 @@ writeEPUB opts doc@(Pandoc meta _) = do ,("content", "0")] $ () , unode "meta" ! [("name","dtb:maxPageNumber") ,("content", "0")] $ () - ] ++ case mbCoverImage of + ] ++ case epubCoverImage metadata of Nothing -> [] Just _ -> [unode "meta" ! [("name","cover"), ("content","cover-image")] $ ()] @@ -623,7 +621,8 @@ metadataElement version md currentTime = coverageNodes = maybe [] (dcTag' "coverage") $ epubCoverage md rightsNodes = maybe [] (dcTag' "rights") $ epubRights md coverImageNodes = maybe [] - (\ci -> [unode "meta" ! [("name","cover"), ("content",ci)] $ ()]) + (const $ [unode "meta" ! [("name","cover"), + ("content","cover-image")] $ ()]) $ epubCoverImage md modifiedNodes = [ unode "meta" ! [("property", "dcterms:modified")] $ (showDateTimeISO8601 currentTime) | version == EPUB3 ] -- cgit v1.2.3 From 17ef39d1577a7c844f8747294f0e7a0486c1edaa Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sat, 30 Nov 2013 15:25:28 -0800 Subject: Fixed `cover-image` in EPUB YAML metadata. --- README | 4 ++-- src/Text/Pandoc/Writers/EPUB.hs | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'README') diff --git a/README b/README index 35194769b..2a5ecc6ad 100644 --- a/README +++ b/README @@ -542,7 +542,7 @@ Options affecting specific writers `--epub-cover-image=`*FILE* : Use the specified image as the EPUB cover. It is recommended that the image be less than 1000px in width and height. Note that - in a markdown source document you can also specify `epub-cover-image` + in a markdown source document you can also specify `cover-image` in a YAML metadata block (see [EPUB Metadata], below). `--epub-metadata=`*FILE* @@ -2820,7 +2820,7 @@ The following fields are recognized: ~ A string value. `rights` ~ A string value. -`epub-cover-image` +`cover-image` ~ A string value (path to cover image). Literate Haskell support diff --git a/src/Text/Pandoc/Writers/EPUB.hs b/src/Text/Pandoc/Writers/EPUB.hs index a3b01848e..9745db5a0 100644 --- a/src/Text/Pandoc/Writers/EPUB.hs +++ b/src/Text/Pandoc/Writers/EPUB.hs @@ -279,7 +279,8 @@ metadataFromMeta opts meta = EPUBMetadata{ relation = metaValueToString <$> lookupMeta "relation" meta coverage = metaValueToString <$> lookupMeta "coverage" meta rights = metaValueToString <$> lookupMeta "rights" meta - coverImage = lookup "epub-cover-image" (writerVariables opts) + coverImage = lookup "epub-cover-image" (writerVariables opts) `mplus` + (metaValueToString <$> lookupMeta "cover-image" meta) -- | Produce an EPUB file from a Pandoc document. writeEPUB :: WriterOptions -- ^ Writer options -- cgit v1.2.3 From bd96f2bdcce55bfe5a7b753d29b3f4a45986f211 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Tue, 3 Dec 2013 10:32:03 -0800 Subject: EPUB writer: Allow 'stylesheet' in metadata. The value is a path to the stylesheet. --- README | 2 ++ src/Text/Pandoc/Writers/EPUB.hs | 33 ++++++++++++++++++++++----------- 2 files changed, 24 insertions(+), 11 deletions(-) (limited to 'README') diff --git a/README b/README index 2a5ecc6ad..11cbf189f 100644 --- a/README +++ b/README @@ -2822,6 +2822,8 @@ The following fields are recognized: ~ A string value. `cover-image` ~ A string value (path to cover image). +`stylesheet` + ~ A string value (path to CSS stylesheet). Literate Haskell support ======================== diff --git a/src/Text/Pandoc/Writers/EPUB.hs b/src/Text/Pandoc/Writers/EPUB.hs index 59c90b16d..32b0c3c32 100644 --- a/src/Text/Pandoc/Writers/EPUB.hs +++ b/src/Text/Pandoc/Writers/EPUB.hs @@ -38,7 +38,7 @@ import Text.Printf (printf) import System.FilePath ( (), takeBaseName, takeExtension, takeFileName ) import qualified Data.ByteString.Lazy as B import qualified Data.ByteString.Lazy.Char8 as B8 -import Text.Pandoc.UTF8 ( fromStringLazy, toString ) +import qualified Text.Pandoc.UTF8 as UTF8 import Text.Pandoc.SelfContained ( makeSelfContained ) import Codec.Archive.Zip import Control.Applicative ((<$>)) @@ -89,8 +89,13 @@ data EPUBMetadata = EPUBMetadata{ , epubCoverage :: Maybe String , epubRights :: Maybe String , epubCoverImage :: Maybe String + , epubStylesheet :: Maybe Stylesheet } deriving Show +data Stylesheet = StylesheetPath FilePath + | StylesheetContents String + deriving Show + data Creator = Creator{ creatorText :: String , creatorRole :: Maybe String @@ -262,6 +267,7 @@ metadataFromMeta opts meta = EPUBMetadata{ , epubCoverage = coverage , epubRights = rights , epubCoverImage = coverImage + , epubStylesheet = stylesheet } where identifiers = getIdentifier meta titles = getTitle meta @@ -282,6 +288,10 @@ metadataFromMeta opts meta = EPUBMetadata{ rights = metaValueToString <$> lookupMeta "rights" meta coverImage = lookup "epub-cover-image" (writerVariables opts) `mplus` (metaValueToString <$> lookupMeta "cover-image" meta) + stylesheet = (StylesheetContents <$> + lookup "epub-stylesheet" (writerVariables opts)) `mplus` + ((StylesheetPath . metaValueToString) <$> + lookupMeta "stylesheet" meta) -- | Produce an EPUB file from a Pandoc document. writeEPUB :: WriterOptions -- ^ Writer options @@ -437,7 +447,7 @@ writeEPUB opts doc@(Pandoc meta _) = do (x:_) -> identifierText x -- use first identifier as UUID [] -> error "epubIdentifier is null" -- shouldn't happen currentTime <- getCurrentTime - let contentsData = fromStringLazy $ ppTopElement $ + let contentsData = UTF8.fromStringLazy $ ppTopElement $ unode "package" ! [("version", case version of EPUB2 -> "2.0" EPUB3 -> "3.0") @@ -525,7 +535,7 @@ writeEPUB opts doc@(Pandoc meta _) = do [ unode "navLabel" $ unode "text" (plainify $ docTitle meta) , unode "content" ! [("src","title_page.xhtml")] $ () ] - let tocData = fromStringLazy $ ppTopElement $ + let tocData = UTF8.fromStringLazy $ ppTopElement $ unode "ncx" ! [("version","2005-1") ,("xmlns","http://www.daisy.org/z3986/2005/ncx/")] $ [ unode "head" $ @@ -557,7 +567,7 @@ writeEPUB opts doc@(Pandoc meta _) = do (_:_) -> [unode "ol" ! [("class","toc")] $ subs] let navtag = if epub3 then "nav" else "div" - let navData = fromStringLazy $ ppTopElement $ + let navData = UTF8.fromStringLazy $ ppTopElement $ unode "html" ! [("xmlns","http://www.w3.org/1999/xhtml") ,("xmlns:epub","http://www.idpf.org/2007/ops")] $ [ unode "head" $ @@ -571,10 +581,10 @@ writeEPUB opts doc@(Pandoc meta _) = do let navEntry = mkEntry "nav.xhtml" navData -- mimetype - let mimetypeEntry = mkEntry "mimetype" $ fromStringLazy "application/epub+zip" + let mimetypeEntry = mkEntry "mimetype" $ UTF8.fromStringLazy "application/epub+zip" -- container.xml - let containerData = fromStringLazy $ ppTopElement $ + let containerData = UTF8.fromStringLazy $ ppTopElement $ unode "container" ! [("version","1.0") ,("xmlns","urn:oasis:names:tc:opendocument:xmlns:container")] $ unode "rootfiles" $ @@ -583,18 +593,19 @@ writeEPUB opts doc@(Pandoc meta _) = do let containerEntry = mkEntry "META-INF/container.xml" containerData -- com.apple.ibooks.display-options.xml - let apple = fromStringLazy $ ppTopElement $ + let apple = UTF8.fromStringLazy $ ppTopElement $ unode "display_options" $ unode "platform" ! [("name","*")] $ unode "option" ! [("name","specified-fonts")] $ "true" let appleEntry = mkEntry "META-INF/com.apple.ibooks.display-options.xml" apple -- stylesheet - stylesheet <- case writerEpubStylesheet opts of - Just s -> return s - Nothing -> toString `fmap` + stylesheet <- case epubStylesheet metadata of + Just (StylesheetPath fp) -> UTF8.readFile fp + Just (StylesheetContents s) -> return s + Nothing -> UTF8.toString `fmap` readDataFile (writerUserDataDir opts) "epub.css" - let stylesheetEntry = mkEntry "stylesheet.css" $ fromStringLazy stylesheet + let stylesheetEntry = mkEntry "stylesheet.css" $ UTF8.fromStringLazy stylesheet -- construct archive let archive = foldr addEntryToArchive emptyArchive -- cgit v1.2.3 From fdaeec0c48d742489ddf0ec0c0261ca9c53f989b Mon Sep 17 00:00:00 2001 From: Jose Luis Duran Date: Mon, 2 Dec 2013 09:55:58 +0000 Subject: Add booktabs package for LaTeX tables [ci skip] --- README | 2 +- data/templates | 2 +- src/Text/Pandoc/Writers/LaTeX.hs | 10 ++--- tests/tables.latex | 90 ++++++++++++++++++++-------------------- 4 files changed, 52 insertions(+), 52 deletions(-) (limited to 'README') diff --git a/README b/README index 2a5ecc6ad..3ba1e364e 100644 --- a/README +++ b/README @@ -108,7 +108,7 @@ to PDF: Production of a PDF requires that a LaTeX engine be installed (see `--latex-engine`, below), and assumes that the following LaTeX packages are available: `amssymb`, `amsmath`, `ifxetex`, `ifluatex`, `listings` (if the -`--listings` option is used), `fancyvrb`, `longtable`, `url`, +`--listings` option is used), `fancyvrb`, `longtable`, `booktabs`, `url`, `graphicx`, `hyperref`, `ulem`, `babel` (if the `lang` variable is set), `fontspec` (if `xelatex` or `lualatex` is used as the LaTeX engine), `xltxtra` and `xunicode` (if `xelatex` is used). diff --git a/data/templates b/data/templates index 713a8f63d..f643a076d 160000 --- a/data/templates +++ b/data/templates @@ -1 +1 @@ -Subproject commit 713a8f63d5589ab9313869e47b03cf7f49e00e98 +Subproject commit f643a076d8c2b0b21391fd6aa1dedb2dd84c7e63 diff --git a/src/Text/Pandoc/Writers/LaTeX.hs b/src/Text/Pandoc/Writers/LaTeX.hs index f3cbcf19f..a2e0b016f 100644 --- a/src/Text/Pandoc/Writers/LaTeX.hs +++ b/src/Text/Pandoc/Writers/LaTeX.hs @@ -453,12 +453,12 @@ blockToLaTeX (Header level (id',classes,_) lst) = blockToLaTeX (Table caption aligns widths heads rows) = do headers <- if all null heads then return empty - else ($$ "\\hline\\noalign{\\medskip}") `fmap` + else ($$ "\\midrule\\endhead") `fmap` (tableRowToLaTeX True aligns widths) heads captionText <- inlineListToLaTeX caption let capt = if isEmpty captionText then empty - else text "\\noalign{\\medskip}" + else text "\\addlinespace" $$ text "\\caption" <> braces captionText rows' <- mapM (tableRowToLaTeX False aligns widths) rows let colDescriptors = text $ concat $ map toColDescriptor aligns @@ -466,10 +466,10 @@ blockToLaTeX (Table caption aligns widths heads rows) = do return $ "\\begin{longtable}[c]" <> braces ("@{}" <> colDescriptors <> "@{}") -- the @{} removes extra space at beginning and end - $$ "\\hline\\noalign{\\medskip}" + $$ "\\toprule\\addlinespace" $$ headers $$ vcat rows' - $$ "\\hline" + $$ "\\bottomrule" $$ capt $$ "\\end{longtable}" @@ -506,7 +506,7 @@ tableRowToLaTeX header aligns widths cols = do (w * scaleFactor))) <> (halign a <> cr <> c <> cr) <> "\\end{minipage}" let cells = zipWith3 toCell widths aligns renderedCells - return $ hsep (intersperse "&" cells) $$ "\\\\\\noalign{\\medskip}" + return $ hsep (intersperse "&" cells) $$ "\\\\\\addlinespace" listItemToLaTeX :: [Block] -> State WriterState Doc listItemToLaTeX lst = blockListToLaTeX lst >>= return . (text "\\item" $$) . diff --git a/tests/tables.latex b/tests/tables.latex index c27e10461..1a87c4f71 100644 --- a/tests/tables.latex +++ b/tests/tables.latex @@ -1,59 +1,59 @@ Simple table with caption: \begin{longtable}[c]{@{}rlcl@{}} -\hline\noalign{\medskip} +\toprule\addlinespace Right & Left & Center & Default -\\\noalign{\medskip} -\hline\noalign{\medskip} +\\\addlinespace +\midrule\endhead 12 & 12 & 12 & 12 -\\\noalign{\medskip} +\\\addlinespace 123 & 123 & 123 & 123 -\\\noalign{\medskip} +\\\addlinespace 1 & 1 & 1 & 1 -\\\noalign{\medskip} -\hline -\noalign{\medskip} +\\\addlinespace +\bottomrule +\addlinespace \caption{Demonstration of simple table syntax.} \end{longtable} Simple table without caption: \begin{longtable}[c]{@{}rlcl@{}} -\hline\noalign{\medskip} +\toprule\addlinespace Right & Left & Center & Default -\\\noalign{\medskip} -\hline\noalign{\medskip} +\\\addlinespace +\midrule\endhead 12 & 12 & 12 & 12 -\\\noalign{\medskip} +\\\addlinespace 123 & 123 & 123 & 123 -\\\noalign{\medskip} +\\\addlinespace 1 & 1 & 1 & 1 -\\\noalign{\medskip} -\hline +\\\addlinespace +\bottomrule \end{longtable} Simple table indented two spaces: \begin{longtable}[c]{@{}rlcl@{}} -\hline\noalign{\medskip} +\toprule\addlinespace Right & Left & Center & Default -\\\noalign{\medskip} -\hline\noalign{\medskip} +\\\addlinespace +\midrule\endhead 12 & 12 & 12 & 12 -\\\noalign{\medskip} +\\\addlinespace 123 & 123 & 123 & 123 -\\\noalign{\medskip} +\\\addlinespace 1 & 1 & 1 & 1 -\\\noalign{\medskip} -\hline -\noalign{\medskip} +\\\addlinespace +\bottomrule +\addlinespace \caption{Demonstration of simple table syntax.} \end{longtable} Multiline table with caption: \begin{longtable}[c]{@{}clrl@{}} -\hline\noalign{\medskip} +\toprule\addlinespace \begin{minipage}[b]{0.13\columnwidth}\centering Centered Header \end{minipage} & \begin{minipage}[b]{0.12\columnwidth}\raggedright @@ -63,8 +63,8 @@ Right Aligned \end{minipage} & \begin{minipage}[b]{0.30\columnwidth}\raggedright Default aligned \end{minipage} -\\\noalign{\medskip} -\hline\noalign{\medskip} +\\\addlinespace +\midrule\endhead \begin{minipage}[t]{0.13\columnwidth}\centering First \end{minipage} & \begin{minipage}[t]{0.12\columnwidth}\raggedright @@ -74,7 +74,7 @@ row \end{minipage} & \begin{minipage}[t]{0.30\columnwidth}\raggedright Example of a row that spans multiple lines. \end{minipage} -\\\noalign{\medskip} +\\\addlinespace \begin{minipage}[t]{0.13\columnwidth}\centering Second \end{minipage} & \begin{minipage}[t]{0.12\columnwidth}\raggedright @@ -84,16 +84,16 @@ row \end{minipage} & \begin{minipage}[t]{0.30\columnwidth}\raggedright Here's another one. Note the blank line between rows. \end{minipage} -\\\noalign{\medskip} -\hline -\noalign{\medskip} +\\\addlinespace +\bottomrule +\addlinespace \caption{Here's the caption. It may span multiple lines.} \end{longtable} Multiline table without caption: \begin{longtable}[c]{@{}clrl@{}} -\hline\noalign{\medskip} +\toprule\addlinespace \begin{minipage}[b]{0.13\columnwidth}\centering Centered Header \end{minipage} & \begin{minipage}[b]{0.12\columnwidth}\raggedright @@ -103,8 +103,8 @@ Right Aligned \end{minipage} & \begin{minipage}[b]{0.30\columnwidth}\raggedright Default aligned \end{minipage} -\\\noalign{\medskip} -\hline\noalign{\medskip} +\\\addlinespace +\midrule\endhead \begin{minipage}[t]{0.13\columnwidth}\centering First \end{minipage} & \begin{minipage}[t]{0.12\columnwidth}\raggedright @@ -114,7 +114,7 @@ row \end{minipage} & \begin{minipage}[t]{0.30\columnwidth}\raggedright Example of a row that spans multiple lines. \end{minipage} -\\\noalign{\medskip} +\\\addlinespace \begin{minipage}[t]{0.13\columnwidth}\centering Second \end{minipage} & \begin{minipage}[t]{0.12\columnwidth}\raggedright @@ -124,27 +124,27 @@ row \end{minipage} & \begin{minipage}[t]{0.30\columnwidth}\raggedright Here's another one. Note the blank line between rows. \end{minipage} -\\\noalign{\medskip} -\hline +\\\addlinespace +\bottomrule \end{longtable} Table without column headers: \begin{longtable}[c]{@{}rlcr@{}} -\hline\noalign{\medskip} +\toprule\addlinespace 12 & 12 & 12 & 12 -\\\noalign{\medskip} +\\\addlinespace 123 & 123 & 123 & 123 -\\\noalign{\medskip} +\\\addlinespace 1 & 1 & 1 & 1 -\\\noalign{\medskip} -\hline +\\\addlinespace +\bottomrule \end{longtable} Multiline table without column headers: \begin{longtable}[c]{@{}clrl@{}} -\hline\noalign{\medskip} +\toprule\addlinespace \begin{minipage}[t]{0.13\columnwidth}\centering First \end{minipage} & \begin{minipage}[t]{0.12\columnwidth}\raggedright @@ -154,7 +154,7 @@ row \end{minipage} & \begin{minipage}[t]{0.30\columnwidth}\raggedright Example of a row that spans multiple lines. \end{minipage} -\\\noalign{\medskip} +\\\addlinespace \begin{minipage}[t]{0.13\columnwidth}\centering Second \end{minipage} & \begin{minipage}[t]{0.12\columnwidth}\raggedright @@ -164,6 +164,6 @@ row \end{minipage} & \begin{minipage}[t]{0.30\columnwidth}\raggedright Here's another one. Note the blank line between rows. \end{minipage} -\\\noalign{\medskip} -\hline +\\\addlinespace +\bottomrule \end{longtable} -- cgit v1.2.3 From 6ba51165b0979f5e07a8175e4c9fd878497c20e3 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Fri, 6 Dec 2013 17:40:11 -0800 Subject: Documented use of extensions with non-markdown input formats. --- README | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'README') diff --git a/README b/README index deda5ed3c..ef22b1e09 100644 --- a/README +++ b/README @@ -2565,6 +2565,20 @@ variants are supported: `markdown_strict` (Markdown.pl) : `raw_html` +Extensions with formats other than markdown +------------------------------------------- + +Some of the extensions discussed above can be used with formats +other than markdown: + +* `auto_identifiers` can be used with `latex`, `rst`, `mediawiki`, + and `textile` input (and is used by default). + +* `tex_math_dollars`, `tex_math_single_backslash`, and + `tex_math_double_backslash` can be used with `html` input. + (This is handy for reading web pages formatted using MathJax, + for example.) + Producing slide shows with Pandoc ================================= -- cgit v1.2.3 From 7929099a7d3da1c9b44a2d7ca1f099f0706171fd Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Tue, 10 Dec 2013 10:24:14 -0800 Subject: Fixed documentation bug. --- README | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'README') diff --git a/README b/README index ef22b1e09..e85d6ef7f 100644 --- a/README +++ b/README @@ -434,8 +434,8 @@ Options affecting specific writers `--chapters` : Treat top-level headers as chapters in LaTeX, ConTeXt, and DocBook output. When the LaTeX template uses the report, book, or - memoir class, this option is implied. If `--beamer` is used, - top-level headers will become `\part{..}`. + memoir class, this option is implied. If `beamer` is the output + format, top-level headers will become `\part{..}`. `-N`, `--number-sections` : Number section headings in LaTeX, ConTeXt, HTML, or EPUB output. -- cgit v1.2.3 From 2c886935e68ed948f95206b5830d79ee556fdd94 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Wed, 11 Dec 2013 10:46:36 -0800 Subject: Added more explanation of metadata in README. --- README | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'README') diff --git a/README b/README index e85d6ef7f..4f21f04a1 100644 --- a/README +++ b/README @@ -1843,6 +1843,23 @@ equivalent of the markdown in the `abstract` field:

This is the abstract.

It consists of two paragraphs.

+Note: The example above will not work with the default templates. +The `author` variable in the templates expects a simple list or string, +and there is no `abstract` variable in most templates. To use these, +you would need to use a custom template with appropriate variables. +For example: + + $for(author)$ + $if(author.name)$ + $author.name$$if(author.affiliation)$ ($author.affiliation$)$endif$ + $else$ + $author$ + $endif$ + $endfor$ + + $if(abstract)$ + Abstract: $abstract$ + $endif$ Backslash escapes ----------------- -- cgit v1.2.3 From 02e3b2afcad5d8d38e490fe82ff6e3df882a6f69 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Wed, 11 Dec 2013 22:09:49 -0800 Subject: Updated README (since abstract will work, at least with default latex). --- README | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'README') diff --git a/README b/README index 4f21f04a1..2feff147d 100644 --- a/README +++ b/README @@ -1843,11 +1843,9 @@ equivalent of the markdown in the `abstract` field:

This is the abstract.

It consists of two paragraphs.

-Note: The example above will not work with the default templates. -The `author` variable in the templates expects a simple list or string, -and there is no `abstract` variable in most templates. To use these, -you would need to use a custom template with appropriate variables. -For example: +Note: The `author` variable in the default templates expects a simple list or +string. To use the structured authors in the example, you would need a +custom template. For example: $for(author)$ $if(author.name)$ @@ -1857,9 +1855,6 @@ For example: $endif$ $endfor$ - $if(abstract)$ - Abstract: $abstract$ - $endif$ Backslash escapes ----------------- -- cgit v1.2.3 From a738153941456aa8aa522234707b73b549ae53a2 Mon Sep 17 00:00:00 2001 From: Nicolas Kaiser Date: Mon, 23 Dec 2013 17:00:14 +0100 Subject: fix typos in README --- README | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'README') diff --git a/README b/README index 2feff147d..7bcaa7b04 100644 --- a/README +++ b/README @@ -1277,7 +1277,7 @@ one tab: + pears + peaches * vegetables - + brocolli + + broccoli + chard As noted above, markdown allows you to write list items "lazily," instead of @@ -2103,7 +2103,7 @@ Raw HTML Markdown allows you to insert raw HTML (or DocBook) anywhere in a document (except verbatim contexts, where `<`, `>`, and `&` are interpreted -literally). (Techncially this is not an extension, since standard +literally). (Technically this is not an extension, since standard markdown allows it, but it has been made an extension so that it can be disabled if desired.) @@ -2855,7 +2855,7 @@ Literate Haskell support ======================== If you append `+lhs` (or `+literate_haskell`) to an appropriate input or output -format (`markdown`, `mardkown_strict`, `rst`, or `latex` for input or output; +format (`markdown`, `markdown_strict`, `rst`, or `latex` for input or output; `beamer`, `html` or `html5` for output only), pandoc will treat the document as literate Haskell source. This means that -- cgit v1.2.3 From 93eac713837083d92df44036aa04fb44975eb18b Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Fri, 3 Jan 2014 10:05:56 -0800 Subject: Documented biblio-files variable --- README | 2 ++ 1 file changed, 2 insertions(+) (limited to 'README') diff --git a/README b/README index 7bcaa7b04..88bfab1b1 100644 --- a/README +++ b/README @@ -801,6 +801,8 @@ as `title`, `author`, and `date`) as well as the following: : causes links to be printed as footnotes in LaTeX documents `biblio-style` : bibliography style in LaTeX, when used with `--natbib` +`biblio-files` +: bibliography files to use in LaTeX, with `--natbib` or `--biblatex` `section` : section number in man pages `header` -- cgit v1.2.3 From 8ef758fa68f67ddeff041ee2b9a404983ff2723c Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Wed, 8 Jan 2014 08:11:49 -0800 Subject: Added README comment on line breaks in cells --- README | 3 +++ 1 file changed, 3 insertions(+) (limited to 'README') diff --git a/README b/README index 88bfab1b1..2d73f6b05 100644 --- a/README +++ b/README @@ -896,6 +896,9 @@ If you need a hard line break, put two or more spaces at the end of a line. **Extension: `escaped_line_breaks`** A backslash followed by a newline is also a hard line break. +Note: in multiline and grid table cells, this is the only way +to create a hard line break, since trailing spaces in the cells +are ignored. Headers ------- -- cgit v1.2.3 From 68b438b1b8a4fb56a79db020770cf71394fbc214 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sun, 12 Jan 2014 16:46:25 -0800 Subject: Removed obsolete README note about mmd title blocks. --- README | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'README') diff --git a/README b/README index 2d73f6b05..661d754ba 100644 --- a/README +++ b/README @@ -2521,10 +2521,9 @@ the document, for example: Comment: This is a sample mmd title block, with a field spanning multiple lines. -See the MultiMarkdown documentation for details. Note that only title, -author, and date are recognized; other fields are simply ignored by -pandoc. If `pandoc_title_block` or `yaml_metadata_block` is enabled, -it will take precedence over `mmd_title_block`. +See the MultiMarkdown documentation for details. If `pandoc_title_block` or +`yaml_metadata_block` is enabled, it will take precedence over +`mmd_title_block`. [MultiMarkdown]: http://fletcherpenney.net/multimarkdown/ -- cgit v1.2.3