pandoc 1.9.4 → 1.9.4.1
raw patch · 15 files changed
+142/−88 lines, 15 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- README +9/−2
- changelog +24/−0
- man/man1/pandoc.1 +17/−0
- man/man5/pandoc_markdown.5 +3/−3
- pandoc.cabal +1/−1
- src/Text/Pandoc/Biblio.hs +20/−4
- src/Text/Pandoc/Readers/Markdown.hs +1/−1
- templates/default.latex +23/−34
- tests/lhs-test.latex +14/−13
- tests/lhs-test.latex+lhs +14/−13
- tests/markdown-citations.chicago-author-date.txt +1/−1
- tests/markdown-citations.ieee.txt +1/−1
- tests/markdown-citations.mhra.txt +1/−1
- tests/markdown-citations.txt +1/−1
- tests/writer.latex +12/−13
README view
@@ -704,6 +704,13 @@ : theme for LaTeX beamer documents `colortheme` : colortheme for LaTeX beamer documents+`linkcolor`+: color for internal links in LaTeX documents (`red`, `green`,+ `magenta`, `cyan`, `blue`, `black`)+`urlcolor`+: color for external links in LaTeX documents+`links-as-notes`+: causes links to be printed as footnotes in LaTeX documents Variables may be set at the command line using the `-V/--variable` option. This allows users to include custom variables in their@@ -1157,8 +1164,8 @@ ii. subtwo iii. subthree -Note that Pandoc pays attention only to the *starting* marker in a list.-So, the following yields a list numbered sequentially starting from 2:+Pandoc will start a new list each time a different type of list+marker is used. So, the following will create three lists: (2) Two (5) Three
changelog view
@@ -1,3 +1,27 @@+pandoc (1.9.4.1)++ * Markdown reader: Added `cf.` and `cp.` to list of likely abbreviations.++ * LaTeX template: Added `linkcolor`, `urlcolor` and `links-as-notes`+ variables. Make TOC links black.++ * LaTeX template improvements.++ + Don't print date unless one is given explicitly in the document.+ + Simplified templates.+ + Use fontenc [T1] by default, and lmodern.+ + Use microtype if available.++ * Biblio:+ + + Add comma to beginning of bare suffix, e.g. `@item1 [50]`.+ Motivation: `@item1 [50]` should be as close as possible to+ `[@item1, 50]`.+ + Added workaround for a bug in citeproc-hs 0.3.4 that causes footnotes+ beginning with a citation to be empty. Closes #531.++ * Fixed documentation on mixed lists. Closes #533.+ pandoc (1.9.4) * Simplified `Text.Pandoc.Biblio` and fixed bugs with citations inside
man/man1/pandoc.1 view
@@ -1002,6 +1002,23 @@ colortheme for LaTeX beamer documents .RS .RE+.TP+.B \f[C]linkcolor\f[]+color for internal links in LaTeX documents (\f[C]red\f[],+\f[C]green\f[], \f[C]magenta\f[], \f[C]cyan\f[], \f[C]blue\f[],+\f[C]black\f[])+.RS+.RE+.TP+.B \f[C]urlcolor\f[]+color for external links in LaTeX documents+.RS+.RE+.TP+.B \f[C]links-as-notes\f[]+causes links to be printed as footnotes in LaTeX documents+.RS+.RE .PP Variables may be set at the command line using the \f[C]-V/--variable\f[] option.
man/man5/pandoc_markdown.5 view
@@ -544,9 +544,9 @@ \f[] .fi .PP-Note that Pandoc pays attention only to the \f[I]starting\f[] marker in-a list.-So, the following yields a list numbered sequentially starting from 2:+Pandoc will start a new list each time a different type of list marker+is used.+So, the following will create three lists: .IP .nf \f[C]
pandoc.cabal view
@@ -1,5 +1,5 @@ Name: pandoc-Version: 1.9.4+Version: 1.9.4.1 Cabal-Version: >= 1.10 Build-Type: Custom License: GPL
src/Text/Pandoc/Biblio.hs view
@@ -31,7 +31,7 @@ import Data.List import Data.Unique-import Data.Char ( isDigit )+import Data.Char ( isDigit, isPunctuation ) import qualified Data.Map as M import Text.CSL hiding ( Cite(..), Citation(..) ) import qualified Text.CSL as CSL ( Cite(..) )@@ -92,9 +92,17 @@ mvPunct xs = xs sanitize :: [Inline] -> [Inline]-sanitize xs | endWithPunct xs = toCapital xs- | otherwise = toCapital (xs ++ [Str "."])+sanitize xs | endWithPunct xs = toCapital' xs+ | otherwise = toCapital' (xs ++ [Str "."]) +-- NOTE: toCapital' works around a bug in toCapital from citeproc-hs 0.3.4.+-- When citeproc-hs is fixed, we can return to using toCapital in sanitize.+toCapital' :: [Inline] -> [Inline]+toCapital' [] = []+toCapital' xs = case toCapital xs of+ [] -> xs+ ys -> ys+ deNote :: [Block] -> [Block] deNote = topDown go where go (Note [Para xs]) = Note $ bottomUp go' [Para $ sanitize xs]@@ -124,13 +132,21 @@ toCslCite c = let (l, s) = locatorWords $ citationSuffix c (la,lo) = parseLocator l+ s' = case (l,s,citationMode c) of+ -- treat a bare locator as if it begins with comma+ -- so @item1 [blah] is like [@item1, blah]+ ("",(x:_),AuthorInText) | not (isPunct x)+ -> [Str ",",Space] ++ s+ _ -> s+ isPunct (Str (x:_)) = isPunctuation x+ isPunct _ = False citMode = case citationMode c of AuthorInText -> (True, False) SuppressAuthor -> (False,True ) NormalCitation -> (False,False) in emptyCite { CSL.citeId = citationId c , CSL.citePrefix = PandocText $ citationPrefix c- , CSL.citeSuffix = PandocText $ s+ , CSL.citeSuffix = PandocText s' , CSL.citeLabel = la , CSL.citeLocator = lo , CSL.citeNoteNumber = show $ citationNoteNum c
src/Text/Pandoc/Readers/Markdown.hs view
@@ -1131,7 +1131,7 @@ "Gen.", "Gov.", "e.g.", "i.e.", "Sgt.", "St.", "vol.", "vs.", "Sen.", "Rep.", "Pres.", "Hon.", "Rev.", "Ph.D.", "M.D.", "M.A.", "p.", "pp.",- "ch.", "sec." ]+ "ch.", "sec.", "cf.", "cp."] abbrPairs = map (break (=='.')) abbrevs in map snd $ filter (\(y,_) -> y == x) abbrPairs
templates/default.latex view
@@ -1,29 +1,24 @@ \documentclass[$if(fontsize)$$fontsize$,$endif$$if(lang)$$lang$,$endif$]{$documentclass$}+\usepackage[T1]{fontenc}+\usepackage{lmodern} \usepackage{amssymb,amsmath} \usepackage{ifxetex,ifluatex} \usepackage{fixltx2e} % provides \textsubscript-\ifxetex- \usepackage{fontspec,xltxtra,xunicode}+% use microtype if available+\IfFileExists{microtype.sty}{\usepackage{microtype}}{}+\ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex+ \usepackage[utf8]{inputenc}+$if(euro)$+ \usepackage{eurosym}+$endif$+\else % if luatex or xelatex+ \usepackage{fontspec}+ \ifxetex+ \usepackage{xltxtra,xunicode}+ \fi \defaultfontfeatures{Mapping=tex-text,Scale=MatchLowercase} \newcommand{\euro}{€} $if(mainfont)$- \setmainfont{$mainfont$}-$endif$-$if(sansfont)$- \setsansfont{$sansfont$}-$endif$-$if(monofont)$- \setmonofont{$monofont$}-$endif$-$if(mathfont)$- \setmathfont{$mathfont$}-$endif$-\else- \ifluatex- \usepackage{fontspec}- \defaultfontfeatures{Mapping=tex-text,Scale=MatchLowercase}- \newcommand{\euro}{€}-$if(mainfont)$ \setmainfont{$mainfont$} $endif$ $if(sansfont)$@@ -35,12 +30,6 @@ $if(mathfont)$ \setmathfont{$mathfont$} $endif$- \else- \usepackage[utf8]{inputenc}-$if(euro)$- \usepackage{eurosym}-$endif$- \fi \fi $if(geometry)$ \usepackage[$for(geometry)$$geometry$$sep$,$endfor$]{geometry}@@ -104,11 +93,13 @@ pdfauthor={$author-meta$}, pdftitle={$title-meta$}, colorlinks=true,- urlcolor=blue,- linkcolor=black,+ urlcolor=$if(urlcolor)$$urlcolor$$else$blue$endif$,+ linkcolor=$if(linkcolor)$$linkcolor$$else$magenta$endif$, pdfborder={0 0 0}}-% Uncomment next line if you want links as footnotes instead of hotlinks:-% \renewcommand{\href}[2]{#2\footnote{\url{#1}}}+$if(links-as-notes)$+% Make links footnotes instead of hotlinks:+\renewcommand{\href}[2]{#2\footnote{\url{#1}}}+$endif$ $if(strikeout)$ \usepackage[normalem]{ulem} % avoid problems with \sout in headers with hyperref:@@ -139,12 +130,8 @@ $if(title)$ \title{$title$} $endif$-$if(author)$ \author{$for(author)$$author$$sep$ \and $endfor$}-$endif$-$if(date)$ \date{$date$}-$endif$ \begin{document} $if(title)$@@ -156,8 +143,10 @@ $endfor$ $if(toc)$+{+\hypersetup{linkcolor=black} \tableofcontents-+} $endif$ $body$
tests/lhs-test.latex view
@@ -1,19 +1,20 @@ \documentclass[]{article}+\usepackage[T1]{fontenc}+\usepackage{lmodern} \usepackage{amssymb,amsmath} \usepackage{ifxetex,ifluatex} \usepackage{fixltx2e} % provides \textsubscript-\ifxetex- \usepackage{fontspec,xltxtra,xunicode}+% use microtype if available+\IfFileExists{microtype.sty}{\usepackage{microtype}}{}+\ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex+ \usepackage[utf8]{inputenc}+\else % if luatex or xelatex+ \usepackage{fontspec}+ \ifxetex+ \usepackage{xltxtra,xunicode}+ \fi \defaultfontfeatures{Mapping=tex-text,Scale=MatchLowercase} \newcommand{\euro}{€}-\else- \ifluatex- \usepackage{fontspec}- \defaultfontfeatures{Mapping=tex-text,Scale=MatchLowercase}- \newcommand{\euro}{€}- \else- \usepackage[utf8]{inputenc}- \fi \fi \usepackage{color} \usepackage{fancyvrb}@@ -48,15 +49,15 @@ pdftitle={}, colorlinks=true, urlcolor=blue,- linkcolor=black,+ linkcolor=magenta, pdfborder={0 0 0}}-% Uncomment next line if you want links as footnotes instead of hotlinks:-% \renewcommand{\href}[2]{#2\footnote{\url{#1}}} \setlength{\parindent}{0pt} \setlength{\parskip}{6pt plus 2pt minus 1pt} \setlength{\emergencystretch}{3em} % prevent overfull lines \setcounter{secnumdepth}{0} +\author{}+\date{} \begin{document}
tests/lhs-test.latex+lhs view
@@ -1,19 +1,20 @@ \documentclass[]{article}+\usepackage[T1]{fontenc}+\usepackage{lmodern} \usepackage{amssymb,amsmath} \usepackage{ifxetex,ifluatex} \usepackage{fixltx2e} % provides \textsubscript-\ifxetex- \usepackage{fontspec,xltxtra,xunicode}+% use microtype if available+\IfFileExists{microtype.sty}{\usepackage{microtype}}{}+\ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex+ \usepackage[utf8]{inputenc}+\else % if luatex or xelatex+ \usepackage{fontspec}+ \ifxetex+ \usepackage{xltxtra,xunicode}+ \fi \defaultfontfeatures{Mapping=tex-text,Scale=MatchLowercase} \newcommand{\euro}{€}-\else- \ifluatex- \usepackage{fontspec}- \defaultfontfeatures{Mapping=tex-text,Scale=MatchLowercase}- \newcommand{\euro}{€}- \else- \usepackage[utf8]{inputenc}- \fi \fi \usepackage{listings} \lstnewenvironment{code}{\lstset{language=Haskell,basicstyle=\small\ttfamily}}{}@@ -30,15 +31,15 @@ pdftitle={}, colorlinks=true, urlcolor=blue,- linkcolor=black,+ linkcolor=magenta, pdfborder={0 0 0}}-% Uncomment next line if you want links as footnotes instead of hotlinks:-% \renewcommand{\href}[2]{#2\footnote{\url{#1}}} \setlength{\parindent}{0pt} \setlength{\parskip}{6pt plus 2pt minus 1pt} \setlength{\emergencystretch}{3em} % prevent overfull lines \setcounter{secnumdepth}{0} +\author{}+\date{} \begin{document}
tests/markdown-citations.chicago-author-date.txt view
@@ -38,7 +38,7 @@ Doe, John, and Jenny Roe. 2007. “Why Water Is Wet.” In *Third Book*, ed. Sam Smith. Oxford: Oxford University Press. -[^1]: A citation without locators (Doe and Roe 2007), and inline: Doe and Roe (2007, 12).+[^1]: Doe and Roe (2007, 12) and a citation without locators (Doe and Roe 2007). [^2]: Some citations (see Doe 2005, chap. 3; Doe and Roe 2007; Doe 2006).
tests/markdown-citations.ieee.txt view
@@ -38,7 +38,7 @@ [3] J. Doe and J. Roe, “Why Water Is Wet,” in *Third Book*, S. Smith, Ed. Oxford: Oxford University Press, 2007. -[^1]: A citation without locators [3], and inline: Reference 3.+[^1]: Reference 3 and a citation without locators [3]. [^2]: Some citations [1–3].
tests/markdown-citations.mhra.txt view
@@ -46,7 +46,7 @@ [^4]: *First Book*; ‘Article’, *Journal of Generic Studies*, 6 (2006), 33–34 (p. 30); see also John Doe and Jenny Roe, ‘Why Water Is Wet’, in *Third Book*, ed. by Sam Smith (Oxford: Oxford University Press, 2007). -[^5]: A citation without locators Doe and Roe, and inline: Doe and Roe, p. 12.+[^5]: Doe and Roe, p. 12 and a citation without locators Doe and Roe. [^6]: See Doe, *First Book*, chap. 3; also Doe and Roe, pp. 34–35.
tests/markdown-citations.txt view
@@ -32,7 +32,7 @@ References ========== -[^1]: A citation without locators [@пункт3], and inline: @пункт3 [p. 12].+[^1]: @пункт3 [p. 12] and a citation without locators [@пункт3]. [^2]: Some citations [see @item1 chap. 3; @пункт3; @item2].
tests/writer.latex view
@@ -1,19 +1,20 @@ \documentclass[]{article}+\usepackage[T1]{fontenc}+\usepackage{lmodern} \usepackage{amssymb,amsmath} \usepackage{ifxetex,ifluatex} \usepackage{fixltx2e} % provides \textsubscript-\ifxetex- \usepackage{fontspec,xltxtra,xunicode}+% use microtype if available+\IfFileExists{microtype.sty}{\usepackage{microtype}}{}+\ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex+ \usepackage[utf8]{inputenc}+\else % if luatex or xelatex+ \usepackage{fontspec}+ \ifxetex+ \usepackage{xltxtra,xunicode}+ \fi \defaultfontfeatures{Mapping=tex-text,Scale=MatchLowercase} \newcommand{\euro}{€}-\else- \ifluatex- \usepackage{fontspec}- \defaultfontfeatures{Mapping=tex-text,Scale=MatchLowercase}- \newcommand{\euro}{€}- \else- \usepackage[utf8]{inputenc}- \fi \fi \usepackage{fancyvrb} % Redefine labelwidth for lists; otherwise, the enumerate package will cause@@ -46,10 +47,8 @@ pdftitle={Pandoc Test Suite}, colorlinks=true, urlcolor=blue,- linkcolor=black,+ linkcolor=magenta, pdfborder={0 0 0}}-% Uncomment next line if you want links as footnotes instead of hotlinks:-% \renewcommand{\href}[2]{#2\footnote{\url{#1}}} \usepackage[normalem]{ulem} % avoid problems with \sout in headers with hyperref: \pdfstringdefDisableCommands{\renewcommand{\sout}{}}