aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README13
m---------data/templates13
-rw-r--r--pandoc.cabal6
-rw-r--r--src/Text/Pandoc/Readers/LaTeX.hs2
-rw-r--r--src/Text/Pandoc/Readers/Markdown.hs6
-rw-r--r--src/Text/Pandoc/Writers/LaTeX.hs3
6 files changed, 30 insertions, 13 deletions
diff --git a/README b/README
index c3f8161a8..e5812bda6 100644
--- a/README
+++ b/README
@@ -2828,12 +2828,23 @@ a locator, and a suffix. The citation key must begin with a letter, digit,
or `_`, and may contain alphanumerics, `_`, and internal punctuation
characters (`:.#$%&-+?<>~/`). Here are some examples:
- Blah blah [see @doe99, pp. 33-35; also @smith04, ch. 1].
+ Blah blah [see @doe99, pp. 33-35; also @smith04, chap. 1].
Blah blah [@doe99, pp. 33-35, 38-39 and *passim*].
Blah blah [@smith04; @doe99].
+`pandoc-citeproc` detects locator terms based on the [CSL locale files].
+Either abbreviated or unabbreviated forms are accepted. In the `en-US` locale,
+locator terms include `book`, `bk.`; `chapter`, `chap.`; `column`, `col.`;
+`figure`, `fig.`; `folio`, `f.`; `number`, `no.`; `line`, `l.`; `note`, `n.`;
+`opus`, `op.`; `page`, `p.`; `paragraph`, `para.`; `part`, `pt.`;
+`section`, `sec.`; `sub verbo`, `s.v.`; `verse`, `v.`; `volume`, `vol.`
+as well as the plural forms of all these. If no locator term is used,
+"page" is assumed.
+
+ [CSL locale files]: https://github.com/citation-style-language/locales
+
A minus sign (`-`) before the `@` will suppress mention of
the author in the citation. This can be useful when the
author is already mentioned in the text:
diff --git a/data/templates b/data/templates
-Subproject 8ea41996bf982835ab0d7559d2801e93c8b8f91
+Subproject 04bdf5a9b789ed4998527a57d52714ccadfedc2
diff --git a/pandoc.cabal b/pandoc.cabal
index 0e1e75897..9a72eb25b 100644
--- a/pandoc.cabal
+++ b/pandoc.cabal
@@ -242,7 +242,7 @@ Flag old-locale
Library
Build-Depends: base >= 4.2 && <5,
- syb >= 0.1 && < 0.6,
+ syb >= 0.1 && < 0.7,
containers >= 0.1 && < 0.6,
unordered-containers >= 0.2 && < 0.3,
array >= 0.3 && < 0.6,
@@ -447,7 +447,7 @@ Test-Suite test-pandoc
Main-Is: test-pandoc.hs
Hs-Source-Dirs: tests
Build-Depends: base >= 4.2 && < 5,
- syb >= 0.1 && < 0.6,
+ syb >= 0.1 && < 0.7,
pandoc,
pandoc-types >= 1.12.4 && < 1.13,
bytestring >= 0.9 && < 0.11,
@@ -499,7 +499,7 @@ benchmark benchmark-pandoc
Hs-Source-Dirs: benchmark
Build-Depends: pandoc,
base >= 4.2 && < 5,
- syb >= 0.1 && < 0.6,
+ syb >= 0.1 && < 0.7,
criterion >= 0.5 && < 1.2
Ghc-Options: -rtsopts -Wall -fno-warn-unused-do-bind
Default-Language: Haskell98
diff --git a/src/Text/Pandoc/Readers/LaTeX.hs b/src/Text/Pandoc/Readers/LaTeX.hs
index 16d387dc4..ed0291051 100644
--- a/src/Text/Pandoc/Readers/LaTeX.hs
+++ b/src/Text/Pandoc/Readers/LaTeX.hs
@@ -1022,6 +1022,8 @@ environments = M.fromList
, ("figure", env "figure" $
resetCaption *> skipopts *> blocks >>= addImageCaption)
, ("center", env "center" blocks)
+ , ("longtable", env "table" $
+ resetCaption *> skipopts *> blocks >>= addTableCaption)
, ("table", env "table" $
resetCaption *> skipopts *> blocks >>= addTableCaption)
, ("tabular*", env "tabular" $ simpTable True)
diff --git a/src/Text/Pandoc/Readers/Markdown.hs b/src/Text/Pandoc/Readers/Markdown.hs
index 80a13b3bd..b5d15c633 100644
--- a/src/Text/Pandoc/Readers/Markdown.hs
+++ b/src/Text/Pandoc/Readers/Markdown.hs
@@ -639,7 +639,11 @@ keyValAttr = try $ do
val <- enclosed (char '"') (char '"') litChar
<|> enclosed (char '\'') (char '\'') litChar
<|> many (escapedChar' <|> noneOf " \t\n\r}")
- return $ \(id',cs,kvs) -> (id',cs,kvs ++ [(key,val)])
+ return $ \(id',cs,kvs) ->
+ case key of
+ "id" -> (val,cs,kvs)
+ "class" -> (id',cs ++ words val,kvs)
+ _ -> (id',cs,kvs ++ [(key,val)])
specialAttr :: MarkdownParser (Attr -> Attr)
specialAttr = do
diff --git a/src/Text/Pandoc/Writers/LaTeX.hs b/src/Text/Pandoc/Writers/LaTeX.hs
index 956215d3c..6effbcd01 100644
--- a/src/Text/Pandoc/Writers/LaTeX.hs
+++ b/src/Text/Pandoc/Writers/LaTeX.hs
@@ -41,7 +41,6 @@ import Network.URI ( isURI, unEscapeString )
import Data.List ( (\\), isInfixOf, stripPrefix, intercalate, intersperse )
import Data.Char ( toLower, isPunctuation, isAscii, isLetter, isDigit, ord )
import Data.Maybe ( fromMaybe )
-import Data.Aeson.Types ( (.:), parseMaybe, withObject )
import Control.Applicative ((<|>))
import Control.Monad.State
import qualified Text.Parsec as P
@@ -120,7 +119,7 @@ pandocToLaTeX options (Pandoc meta blocks) = do
Right r -> r
Left _ -> ""
case lookup "documentclass" (writerVariables options) `mplus`
- parseMaybe (withObject "object" (.: "documentclass")) metadata of
+ fmap stringify (lookupMeta "documentclass" meta) of
Just x | x `elem` bookClasses -> modify $ \s -> s{stBook = True}
| otherwise -> return ()
Nothing | documentClass `elem` bookClasses