git.iko.soy/typeable/pandoc
on master help sign in
.circleci/config.yml+1−1
since splitsnapshots
unifiedsplit
@@ -2,7 +2,7 @@ version: "2.1"
2jobs:
2jobs:
3 build:
3 build:
4 macos:
4 macos:
5− xcode: 9.4.1
5+ xcode: 11.1.0
6 environment:
6 environment:
7 HOMEBREW_NO_AUTO_UPDATE: 1
7 HOMEBREW_NO_AUTO_UPDATE: 1
8 steps:
8 steps:
cabal.project+4
@@ -7,3 +7,7 @@ source-repository-package
7 location: https://github.com/jgm/doctemplates
7 location: https://github.com/jgm/doctemplates
8 tag: 428c26d5303cf7a2b1051fe1ffd9aafe9ba71c81
8 tag: 428c26d5303cf7a2b1051fe1ffd9aafe9ba71c81
9
9
10+source-repository-package
11+ type: git
12+ location: https://github.com/jgm/citeproc
13+ tag: 4ce0501cd6f9c86eee087afcf878c256e49b9615
data/templates/default.latex+29−29
@@ -36,35 +36,6 @@ $for(classoption)$
36 $classoption$$sep$,
36 $classoption$$sep$,
37$endfor$
37$endfor$
38]{$documentclass$}
38]{$documentclass$}
39−$if(title)$
40−\title{$title$$if(thanks)$\thanks{$thanks$}$endif$}
41−$endif$
42−$if(subtitle)$
43−$if(beamer)$
44−$else$
45−\usepackage{etoolbox}
46−\makeatletter
47−\providecommand{\subtitle}[1]{% add subtitle to \maketitle
48− \apptocmd{\@title}{\par {\large #1 \par}}{}{}
49−}
50−\makeatother
51−$endif$
52−\subtitle{$subtitle$}
53−$endif$
54−\author{$for(author)$$author$$sep$ \and $endfor$}
55−\date{$date$}
56−$if(beamer)$
57−$if(institute)$
58−\institute{$for(institute)$$institute$$sep$ \and $endfor$}
59−$endif$
60−$if(titlegraphic)$
61−\titlegraphic{\includegraphics{$titlegraphic$}}
62−$endif$
63−$if(logo)$
64−\logo{\includegraphics{$logo$}}
65−$endif$
66−$endif$
67−
68$if(beamer)$
39$if(beamer)$
69$if(background-image)$
40$if(background-image)$
70\usebackgroundtemplate{%
41\usebackgroundtemplate{%
@@ -452,6 +423,35 @@ $if(csquotes)$
452\usepackage{csquotes}
423\usepackage{csquotes}
453$endif$
424$endif$
454
425
426+$if(title)$
427+\title{$title$$if(thanks)$\thanks{$thanks$}$endif$}
428+$endif$
429+$if(subtitle)$
430+$if(beamer)$
431+$else$
432+\usepackage{etoolbox}
433+\makeatletter
434+\providecommand{\subtitle}[1]{% add subtitle to \maketitle
435+ \apptocmd{\@title}{\par {\large #1 \par}}{}{}
436+}
437+\makeatother
438+$endif$
439+\subtitle{$subtitle$}
440+$endif$
441+\author{$for(author)$$author$$sep$ \and $endfor$}
442+\date{$date$}
443+$if(beamer)$
444+$if(institute)$
445+\institute{$for(institute)$$institute$$sep$ \and $endfor$}
446+$endif$
447+$if(titlegraphic)$
448+\titlegraphic{\includegraphics{$titlegraphic$}}
449+$endif$
450+$if(logo)$
451+\logo{\includegraphics{$logo$}}
452+$endif$
453+$endif$
454+
455\begin{document}
455\begin{document}
456$if(has-frontmatter)$
456$if(has-frontmatter)$
457\frontmatter
457\frontmatter
data/templates/styles.html+2−1
@@ -14,7 +14,7 @@ body {
14 padding-top: $if(margin-top)$$margin-top$$else$50px$endif$;
14 padding-top: $if(margin-top)$$margin-top$$else$50px$endif$;
15 padding-bottom: $if(margin-bottom)$$margin-bottom$$else$50px$endif$;
15 padding-bottom: $if(margin-bottom)$$margin-bottom$$else$50px$endif$;
16 hyphens: auto;
16 hyphens: auto;
17− word-wrap: break-word;
17+ overflow-wrap: break-word;
18 text-rendering: optimizeLegibility;
18 text-rendering: optimizeLegibility;
19 font-kerning: normal;
19 font-kerning: normal;
20}
20}
@@ -93,6 +93,7 @@ $endif$
93pre code {
93pre code {
94 padding: 0;
94 padding: 0;
95 overflow: visible;
95 overflow: visible;
96+ overflow-wrap: normal;
96}
97}
97.sourceCode {
98.sourceCode {
98 background-color: transparent;
99 background-color: transparent;
doc/faqs.mdnew file+128
@@ -0,0 +1,128 @@
1+% FAQs
2+
3+::: faqs
4+
5+## How can I convert a whole directory of files from Markdown to RTF?
6+
7+On linux or OSX:
8+
9+ for f in *.txt; do pandoc "$f" -s -o "${f%.txt}.rtf"; done
10+
11+
12+In Windows Powershell:
13+
14+ gci -r -i *.txt |foreach{$rtf=$_.directoryname+"\"+$_.basename+".rtf";pandoc -f markdown -s $_.name -o $rtf}
15+
16+## I used pandoc to convert a document to ICML (or OPML or RTF), and when I try to open it I'm told it's invalid. What have I done wrong?
17+
18+Be sure to use the `-s` or `--standalone` flag, or you just get a
19+fragment, not a full document with the required header:
20+
21+ pandoc -s -f markdown -t icml -o my.icml my.md
22+
23+## I get a blank document when I try to convert a markdown document in Chinese to PDF.
24+
25+By default, pandoc uses pdflatex to generate the PDF, and pdflatex
26+doesn't handle Chinese characters. But you can change the default to
27+use xelatex instead. You should also make sure you're using a font
28+with Chinese glyphs. For example:
29+
30+ pandoc -o c.pdf --pdf-engine=xelatex -V mainfont='Adobe Ming Std'
31+
32+## The Windows installer does a single user install, rather than installing pandoc for all users. How can I install pandoc for all users?
33+
34+Run the following command as admin:
35+
36+ msiexec /i pandoc-VERSION.msi ALLUSERS=1
37+
38+This will put pandoc in `C:\Program Files\Pandoc`.
39+You can install Pandoc to a different directory by setting APPLICATIONFOLDER parameter,
40+for example:
41+
42+ msiexec /i pandoc-1.11.1.msi ALLUSERS=1 APPLICATIONFOLDER="C:\Pandoc"
43+
44+## How do I change the margins in PDF output?
45+
46+The option
47+
48+ -V geometry:margin=1in
49+
50+will set the margins to one inch on each side. If you don't want uniform
51+margins, you can do something like
52+
53+ -V geometry:"top=2cm, bottom=1.5cm, left=1cm, right=1cm"
54+
55+Or
56+
57+ -V geometry:"left=3cm, width=10cm"
58+
59+For more options, see the documentation for the LaTeX [geometry
60+package](https://www.ctan.org/pkg/geometry).
61+
62+## How does pandoc compare to multimarkdown?
63+
64+Here is a [wiki
65+page](https://github.com/jgm/pandoc/wiki/Pandoc-vs-Multimarkdown)
66+comparing the two.
67+
68+## When I specify an image width of 50% and convert to LaTeX, pandoc sets the height to textheight and the aspect ratio isn't preserved. How can I prevent this?
69+
70+For example, if you convert an image with `{width="50%"}`, the LaTeX produced
71+will be `\includegraphics[width=0.5\textwidth,height=\textheight]`.
72+
73+This output presupposes the following code in pandoc's default latex
74+template:
75+
76+```
77+% Scale images if necessary, so that they will not overflow the page
78+% margins by default, and it is still possible to overwrite the defaults
79+% using explicit options in \includegraphics[width, height, ...]{}
80+\setkeys{Gin}{width=\maxwidth,height=\maxheight,keepaspectratio}
81+```
82+
83+If you don't have this in your custom template, you should
84+add it. If we didn't set the `height` explicitly in this way,
85+the image would not be resized correctly unless it was
86+being resized to smaller than its original size.
87+
88+## Pandoc sometimes uses too much memory. How can I limit the memory used by pandoc?
89+
90+`pandoc +RTS -M30m -RTS` will limit heap memory to 30MB.
91+When converting a document requires more than this, an out of
92+memory error will be issued.
93+
94+## When using `--include-in-header` with PDF or LaTeX output, how do I reference tex declarations coming after `$header-includes$` in the default template?
95+
96+For various reasons, the `$header-includes$` are not at the very
97+end of the LaTeX preamble. This poses a problem when the code
98+you are inserting depends on declarations in the preamble coming
99+after the `$header-includes$` location. For example, you might
100+want to reference the `\author` and `\title` metadata values
101+(set at the very bottom of the preamble) and present them in
102+margins. In that case you can wrap your code in `etoolbox`'s
103+`\AtEndPreamble`. The technique is demonstrated in [this
104+gist](https://gist.github.com/JohnLukeBentley/9dda6166b9ee5c4127afd2b8cd16b70a).
105+When using `\AtEndPreamble`, keep any `makeatletter` or
106+`makeatother` outside of the `\AtEndPreamble`, as shown in the
107+example.
108+
109+## How can I convert PDFs to other formats using pandoc?
110+
111+You can't. You can try opening the PDF in Word or Google Docs
112+and saving in a format from which pandoc can convert directly.
113+
114+## Do I really need to install a 1 GB TeX installation to produce a PDF using pandoc?
115+
116+No. You can get by with a relatively small TeX installation,
117+for example, by starting with MacTeX's Basic TeX distribution
118+and using the `tlmgr` tool to install a few packages required by pandoc
119+(see https://pandoc.org/MANUAL.html#creating-a-pdf).
120+
121+Or, you can produce PDFs via HTML and `wkhtmltopdf`,
122+or via groff ms and `pdfroff`. (These don't produce as nice
123+topography as TeX, particularly when it comes to math, but they
124+may be fine for many purposes.)
125+
126+
127+:::
128+
pandoc.cabal+1−1
@@ -453,7 +453,7 @@ library
453 citeproc >= 0.4.0.1 && < 0.4.1,
453 citeproc >= 0.4.0.1 && < 0.4.1,
454 commonmark >= 0.2.1 && < 0.3,
454 commonmark >= 0.2.1 && < 0.3,
455 commonmark-extensions >= 0.2.1.2 && < 0.3,
455 commonmark-extensions >= 0.2.1.2 && < 0.3,
456− commonmark-pandoc >= 0.2.1 && < 0.3,
456+ commonmark-pandoc >= 0.2.1.1 && < 0.3,
457 connection >= 0.3.1,
457 connection >= 0.3.1,
458 containers >= 0.4.2.1 && < 0.7,
458 containers >= 0.4.2.1 && < 0.7,
459 data-default >= 0.4 && < 0.8,
459 data-default >= 0.4 && < 0.8,
src/Text/Pandoc/Citeproc.hs+63−39
@@ -27,7 +27,7 @@ import Text.Pandoc.Error (PandocError(..))
27import Text.Pandoc.Extensions (pandocExtensions)
27import Text.Pandoc.Extensions (pandocExtensions)
28import Text.Pandoc.Logging (LogMessage(..))
28import Text.Pandoc.Logging (LogMessage(..))
29import Text.Pandoc.Options (ReaderOptions(..))
29import Text.Pandoc.Options (ReaderOptions(..))
30−import Text.Pandoc.Shared (stringify, ordNub, blocksToInlines, tshow)
30+import Text.Pandoc.Shared (stringify, ordNub, tshow)
31import qualified Text.Pandoc.UTF8 as UTF8
31import qualified Text.Pandoc.UTF8 as UTF8
32import Text.Pandoc.Walk (query, walk, walkM)
32import Text.Pandoc.Walk (query, walk, walkM)
33import Control.Applicative ((<|>))
33import Control.Applicative ((<|>))
@@ -49,6 +49,7 @@ import qualified Data.Text as T
49import System.FilePath (takeExtension)
49import System.FilePath (takeExtension)
50import Safe (lastMay, initSafe)
50import Safe (lastMay, initSafe)
51
51
52+
52processCitations :: PandocMonad m => Pandoc -> m Pandoc
53processCitations :: PandocMonad m => Pandoc -> m Pandoc
53processCitations (Pandoc meta bs) = do
54processCitations (Pandoc meta bs) = do
54 style <- getStyle (Pandoc meta bs)
55 style <- getStyle (Pandoc meta bs)
@@ -90,22 +91,18 @@ processCitations (Pandoc meta bs) = do
90 walk (convertQuotes locale) .
91 walk (convertQuotes locale) .
91 insertSpace $ out)
92 insertSpace $ out)
92 (resultBibliography result)
93 (resultBibliography result)
93− let moveNotes = maybe True truish $
94+ let moveNotes = styleIsNoteStyle sopts &&
94− lookupMeta "notes-after-punctuation" meta
95+ maybe True truish (lookupMeta "notes-after-punctuation" meta)
95 let cits = map (walk (convertQuotes locale)) $
96 let cits = map (walk (convertQuotes locale)) $
96 resultCitations result
97 resultCitations result
97
98
98− let fixQuotes = case localePunctuationInQuote locale of
99− Just True ->
100− B.toList . movePunctuationInsideQuotes . B.fromList
101− _ -> id
102−
103 let metanocites = lookupMeta "nocite" meta
99 let metanocites = lookupMeta "nocite" meta
104 let Pandoc meta'' bs' =
100 let Pandoc meta'' bs' =
105 maybe id (setMeta "nocite") metanocites .
101 maybe id (setMeta "nocite") metanocites .
106− walk (map capitalizeNoteCitation .
107− fixQuotes . mvPunct moveNotes locale) .
102+ walk (mvPunct moveNotes locale) .
103+ (if styleIsNoteStyle sopts
108− walk deNote .
104+ then walk addNote . walk deNote
105+ else id) .
109 evalState (walkM insertResolvedCitations $ Pandoc meta' bs)
106 evalState (walkM insertResolvedCitations $ Pandoc meta' bs)
110 $ cits
107 $ cits
111 return $ Pandoc meta''
108 return $ Pandoc meta''
@@ -375,7 +372,6 @@ formatFromExtension fp = case dropWhile (== '.') $ takeExtension fp of
375
372
376
373
377isNote :: Inline -> Bool
374isNote :: Inline -> Bool
378−isNote (Note _) = True
379isNote (Cite _ [Note _]) = True
375isNote (Cite _ [Note _]) = True
380 -- the following allows citation styles that are "in-text" but use superscript
376 -- the following allows citation styles that are "in-text" but use superscript
381 -- references to be treated as if they are "notes" for the purposes of moving
377 -- references to be treated as if they are "notes" for the purposes of moving
@@ -388,6 +384,12 @@ isSpacy Space = True
388isSpacy SoftBreak = True
384isSpacy SoftBreak = True
389isSpacy _ = False
385isSpacy _ = False
390
386
387+movePunctInsideQuotes :: Locale -> [Inline] -> [Inline]
388+movePunctInsideQuotes locale
389+ | localePunctuationInQuote locale == Just True
390+ = B.toList . movePunctuationInsideQuotes . B.fromList
391+ | otherwise
392+ = id
391
393
392mvPunct :: Bool -> Locale -> [Inline] -> [Inline]
394mvPunct :: Bool -> Locale -> [Inline] -> [Inline]
393mvPunct moveNotes locale (x : xs)
395mvPunct moveNotes locale (x : xs)
@@ -400,7 +402,8 @@ mvPunct moveNotes locale (q : s : x : ys)
400 in if moveNotes
402 in if moveNotes
401 then if T.null spunct
403 then if T.null spunct
402 then q : x : mvPunct moveNotes locale ys
404 then q : x : mvPunct moveNotes locale ys
405+ else movePunctInsideQuotes locale
403− else q : Str spunct : x : mvPunct moveNotes locale
406+ [q , Str spunct , x] ++ mvPunct moveNotes locale
404 (B.toList
407 (B.toList
405 (dropTextWhile isPunctuation (B.fromList ys)))
408 (dropTextWhile isPunctuation (B.fromList ys)))
406 else q : x : mvPunct moveNotes locale ys
409 else q : x : mvPunct moveNotes locale ys
@@ -412,9 +415,10 @@ mvPunct moveNotes locale (Cite cs ils : ys)
412 , moveNotes
415 , moveNotes
413 = let s = stringify ys
416 = let s = stringify ys
414 spunct = T.takeWhile isPunctuation s
417 spunct = T.takeWhile isPunctuation s
418+ in Cite cs (movePunctInsideQuotes locale $
415− in Cite cs (init ils
419+ init ils
416− ++ [Str spunct | not (endWithPunct False (init ils))]
420+ ++ [Str spunct | not (endWithPunct False (init ils))]
417− ++ [last ils]) :
421+ ++ [last ils]) :
418 mvPunct moveNotes locale
422 mvPunct moveNotes locale
419 (B.toList (dropTextWhile isPunctuation (B.fromList ys)))
423 (B.toList (dropTextWhile isPunctuation (B.fromList ys)))
420mvPunct moveNotes locale (s : x : ys) | isSpacy s, isNote x =
424mvPunct moveNotes locale (s : x : ys) | isSpacy s, isNote x =
@@ -560,42 +564,62 @@ extractText (FancyVal x) = toText x
560extractText (NumVal n) = T.pack (show n)
564extractText (NumVal n) = T.pack (show n)
561extractText _ = mempty
565extractText _ = mempty
562
566
567+-- Here we take the Spans with class csl-note that are left
568+-- after deNote has removed nested ones, and convert them
569+-- into real notes.
563−capitalizeNoteCitation :: Inline -> Inline
570+addNote :: Inline -> Inline
564−capitalizeNoteCitation (Cite cs [Note [Para ils]]) =
571+addNote (Span ("",["csl-note"],[]) ils) =
565− Cite cs
572+ Note [Para $
566− [Note [Para $ B.toList $ addTextCase Nothing CapitalizeFirst
573+ B.toList . addTextCase Nothing CapitalizeFirst . B.fromList $ ils]
567− $ B.fromList ils]]
574+addNote x = x
568−capitalizeNoteCitation x = x
575+
569−
576+-- Here we handle citation notes that occur inside footnotes
577+-- or other citation notes, in a note style. We don't want
578+-- notes inside notes, so we convert these to parenthesized
579+-- or comma-separated citations.
570−deNote :: [Inline] -> [Inline]
580+deNote :: Inline -> Inline
571−deNote [] = []
581+deNote (Note bs) =
572−deNote (Note bs:rest) =
582+ case bs of
573− Note (walk go bs) : deNote rest
583+ [Para (cit@(Cite (c:_) _) : ils)]
584+ | citationMode c /= AuthorInText ->
585+ -- if citation is first in note, no need to parenthesize.
586+ Note [Para (walk removeNotes $ cit : walk addParens ils)]
587+ _ -> Note (walk removeNotes . walk addParens $ bs)
588+
574 where
589 where
575− go [] = []
590+ addParens [] = []
576− go (Cite (c:cs) ils : zs)
591+ addParens (Cite (c:cs) ils : zs)
577 | citationMode c == AuthorInText
592 | citationMode c == AuthorInText
578− = Cite (c:cs) (concatMap (noteAfterComma (needsPeriod zs)) ils) : go zs
593+ = Cite (c:cs) (concatMap (noteAfterComma (needsPeriod zs)) ils) :
594+ addParens zs
579 | otherwise
595 | otherwise
580− = Cite (c:cs) (concatMap noteInParens ils) : go zs
596+ = Cite (c:cs) (concatMap noteInParens ils) : addParens zs
581− go (x:xs) = x : go xs
597+ addParens (x:xs) = x : addParens xs
598+
599+ removeNotes (Span ("",["csl-note"],[]) ils) = Span ("",[],[]) ils
600+ removeNotes x = x
601+
582 needsPeriod [] = True
602 needsPeriod [] = True
583 needsPeriod (Str t:_) = case T.uncons t of
603 needsPeriod (Str t:_) = case T.uncons t of
584 Nothing -> False
604 Nothing -> False
585 Just (c,_) -> isUpper c
605 Just (c,_) -> isUpper c
586 needsPeriod (Space:zs) = needsPeriod zs
606 needsPeriod (Space:zs) = needsPeriod zs
587 needsPeriod _ = False
607 needsPeriod _ = False
608+
588− noteInParens (Note bs')
609+ noteInParens (Span ("",["csl-note"],[]) ils)
589 = Space : Str "(" :
610 = Space : Str "(" :
590− removeFinalPeriod (blocksToInlines bs') ++ [Str ")"]
611+ removeFinalPeriod ils ++ [Str ")"]
591 noteInParens x = [x]
612 noteInParens x = [x]
613+
592− noteAfterComma needsPer (Note bs')
614+ noteAfterComma needsPer (Span ("",["csl-note"],[]) ils)
615+ | not (null ils)
593 = Str "," : Space :
616 = Str "," : Space :
594− (if needsPer
617+ if needsPer
595− then id
618+ then ils
596− else removeFinalPeriod) (blocksToInlines bs')
619+ else removeFinalPeriod ils
597 noteAfterComma _ x = [x]
620 noteAfterComma _ x = [x]
621+
598−deNote (x:xs) = x : deNote xs
622+deNote x = x
599
623
600-- Note: we can't use dropTextWhileEnd indiscriminately,
624-- Note: we can't use dropTextWhileEnd indiscriminately,
601-- because this would remove the final period on abbreviations like Ibid.
625-- because this would remove the final period on abbreviations like Ibid.
src/Text/Pandoc/Citeproc/BibTeX.hs+4−2
@@ -71,9 +71,11 @@ readBibtexString variant locale idpred contents = do
71 filter (\item -> idpred (identifier item) &&
71 filter (\item -> idpred (identifier item) &&
72 entryType item /= "xdata"))
72 entryType item /= "xdata"))
73 (fromMaybe defaultLang $ localeLanguage locale, Map.empty)
73 (fromMaybe defaultLang $ localeLanguage locale, Map.empty)
74− "" (toSources contents) of
74+ (initialSourceName sources) sources of
75 Left err -> Left err
75 Left err -> Left err
76 Right xs -> return xs
76 Right xs -> return xs
77+ where
78+ sources = toSources contents
77
79
78-- | Write BibTeX or BibLaTeX given given a 'Reference'.
80-- | Write BibTeX or BibLaTeX given given a 'Reference'.
79writeBibtexString :: WriterOptions -- ^ options (for writing LaTex)
81writeBibtexString :: WriterOptions -- ^ options (for writing LaTex)
@@ -866,7 +868,7 @@ fieldName = resolveAlias . T.toLower
866
868
867isBibtexKeyChar :: Char -> Bool
869isBibtexKeyChar :: Char -> Bool
868isBibtexKeyChar c =
870isBibtexKeyChar c =
869− isAlphaNum c || c `elem` (".:;?!`'()/*@_+=-[]*&" :: [Char])
871+ isAlphaNum c || c `elem` (".:;?!`'()$/*@_+=-[]*&" :: [Char])
870
872
871bibItem :: BibParser Item
873bibItem :: BibParser Item
872bibItem = do
874bibItem = do
src/Text/Pandoc/Error.hs+3−3
@@ -97,13 +97,13 @@ renderError e =
97 [] -> ""
97 [] -> ""
98 ((pos,txt):_) ->
98 ((pos,txt):_) ->
99 let ls = T.lines txt <> [""]
99 let ls = T.lines txt <> [""]
100− ln = errLine - sourceLine pos
100+ ln = (errLine - sourceLine pos) + 1
101− in if length ls > ln - 1
101+ in if length ls > ln && ln >= 1
102 then T.concat ["\n", ls !! (ln - 1)
102 then T.concat ["\n", ls !! (ln - 1)
103 ,"\n", T.replicate (errColumn - 1) " "
103 ,"\n", T.replicate (errColumn - 1) " "
104 ,"^"]
104 ,"^"]
105 else ""
105 else ""
106− in "\nError at " <> tshow err' <> errorInFile
106+ in "Error at " <> tshow err' <> errorInFile
107 PandocMakePDFError s -> s
107 PandocMakePDFError s -> s
108 PandocOptionError s -> s
108 PandocOptionError s -> s
109 PandocSyntaxMapError s -> s
109 PandocSyntaxMapError s -> s
src/Text/Pandoc/ImageSize.hs+5−1
@@ -57,7 +57,8 @@ import Codec.Picture (decodeImageWithMetadata)
57-- quick and dirty functions to get image sizes
57-- quick and dirty functions to get image sizes
58-- algorithms borrowed from wwwis.pl
58-- algorithms borrowed from wwwis.pl
59
59
60−data ImageType = Png | Gif | Jpeg | Svg | Pdf | Eps | Emf deriving Show
60+data ImageType = Png | Gif | Jpeg | Svg | Pdf | Eps | Emf | Tiff
61+ deriving Show
61data Direction = Width | Height
62data Direction = Width | Height
62instance Show Direction where
63instance Show Direction where
63 show Width = "width"
64 show Width = "width"
@@ -100,6 +101,8 @@ imageType :: ByteString -> Maybe ImageType
100imageType img = case B.take 4 img of
101imageType img = case B.take 4 img of
101 "\x89\x50\x4e\x47" -> return Png
102 "\x89\x50\x4e\x47" -> return Png
102 "\x47\x49\x46\x38" -> return Gif
103 "\x47\x49\x46\x38" -> return Gif
104+ "\x49\x49\x2a\x00" -> return Tiff
105+ "\x4D\x4D\x00\x2a" -> return Tiff
103 "\xff\xd8\xff\xe0" -> return Jpeg -- JFIF
106 "\xff\xd8\xff\xe0" -> return Jpeg -- JFIF
104 "\xff\xd8\xff\xe1" -> return Jpeg -- Exif
107 "\xff\xd8\xff\xe1" -> return Jpeg -- Exif
105 "%PDF" -> return Pdf
108 "%PDF" -> return Pdf
@@ -124,6 +127,7 @@ imageSize opts img = checkDpi <$>
124 Just Png -> getSize img
127 Just Png -> getSize img
125 Just Gif -> getSize img
128 Just Gif -> getSize img
126 Just Jpeg -> getSize img
129 Just Jpeg -> getSize img
130+ Just Tiff -> getSize img
127 Just Svg -> mbToEither "could not determine SVG size" $ svgSize opts img
131 Just Svg -> mbToEither "could not determine SVG size" $ svgSize opts img
128 Just Eps -> mbToEither "could not determine EPS size" $ epsSize img
132 Just Eps -> mbToEither "could not determine EPS size" $ epsSize img
129 Just Pdf -> mbToEither "could not determine PDF size" $ pdfSize img
133 Just Pdf -> mbToEither "could not determine PDF size" $ pdfSize img
src/Text/Pandoc/Writers/Docx.hs+19−3
@@ -36,7 +36,8 @@ import Data.Time.Clock.POSIX
36import Data.Digest.Pure.SHA (sha1, showDigest)
36import Data.Digest.Pure.SHA (sha1, showDigest)
37import Skylighting
37import Skylighting
38import Text.Collate.Lang (renderLang)
38import Text.Collate.Lang (renderLang)
39−import Text.Pandoc.Class.PandocMonad (PandocMonad, report, toLang)
39+import Text.Pandoc.Class.PandocMonad (PandocMonad, report, toLang, translateTerm)
40+import qualified Text.Pandoc.Translations as Term
40import qualified Text.Pandoc.Class.PandocMonad as P
41import qualified Text.Pandoc.Class.PandocMonad as P
41import Data.Time
42import Data.Time
42import Text.Pandoc.UTF8 (fromTextLazy)
43import Text.Pandoc.UTF8 (fromTextLazy)
@@ -854,14 +855,28 @@ blockToOpenXML' opts (Plain lst) = do
854-- title beginning with fig: indicates that the image is a figure
855-- title beginning with fig: indicates that the image is a figure
855blockToOpenXML' opts (Para [Image attr alt (src,T.stripPrefix "fig:" -> Just tit)]) = do
856blockToOpenXML' opts (Para [Image attr alt (src,T.stripPrefix "fig:" -> Just tit)]) = do
856 setFirstPara
857 setFirstPara
858+ fignum <- gets stNextFigureNum
859+ unless (null alt) $ modify $ \st -> st{ stNextFigureNum = fignum + 1 }
860+ let figid = "fig" <> tshow fignum
861+ figname <- translateTerm Term.Figure
857 prop <- pStyleM $
862 prop <- pStyleM $
858 if null alt
863 if null alt
859 then "Figure"
864 then "Figure"
860 else "Captioned Figure"
865 else "Captioned Figure"
861 paraProps <- local (\env -> env { envParaProperties = EnvProps (Just prop) [] <> envParaProperties env }) (getParaProps False)
866 paraProps <- local (\env -> env { envParaProperties = EnvProps (Just prop) [] <> envParaProperties env }) (getParaProps False)
862 contents <- inlinesToOpenXML opts [Image attr alt (src,tit)]
867 contents <- inlinesToOpenXML opts [Image attr alt (src,tit)]
868+ captionNode <- if null alt
869+ then return []
863− captionNode <- withParaPropM (pStyleM "Image Caption")
870+ else withParaPropM (pStyleM "Image Caption")
864− $ blockToOpenXML opts (Para alt)
871+ $ blockToOpenXML opts
872+ (Para $ Span (figid,[],[])
873+ [Str (figname <> "\160"),
874+ RawInline (Format "openxml")
875+ ("<w:fldSimple w:instr=\"SEQ Figure"
876+ <> " \\* ARABIC \"><w:r><w:t>"
877+ <> tshow fignum
878+ <> "</w:t></w:r></w:fldSimple>"),
879+ Str ":", Space] : alt)
865 return $
880 return $
866 Elem (mknode "w:p" [] (map Elem paraProps ++ contents))
881 Elem (mknode "w:p" [] (map Elem paraProps ++ contents))
867 : captionNode
882 : captionNode
@@ -1289,6 +1304,7 @@ inlineToOpenXML' opts (Image attr@(imgident, _, _) alt (src, title)) = do
1289 Just Eps -> ".eps"
1304 Just Eps -> ".eps"
1290 Just Svg -> ".svg"
1305 Just Svg -> ".svg"
1291 Just Emf -> ".emf"
1306 Just Emf -> ".emf"
1307+ Just Tiff -> ".tiff"
1292 Nothing -> ""
1308 Nothing -> ""
1293 imgpath = "media/" <> ident <> imgext
1309 imgpath = "media/" <> ident <> imgext
1294 mbMimeType = mt <|> getMimeType (T.unpack imgpath)
1310 mbMimeType = mt <|> getMimeType (T.unpack imgpath)
src/Text/Pandoc/Writers/Docx/Table.hs+28−3
@@ -17,7 +17,7 @@ import Control.Monad.State.Strict
17import Data.Array
17import Data.Array
18import Data.Text (Text)
18import Data.Text (Text)
19import Text.Pandoc.Definition
19import Text.Pandoc.Definition
20−import Text.Pandoc.Class.PandocMonad (PandocMonad)
20+import Text.Pandoc.Class.PandocMonad (PandocMonad, translateTerm)
21import Text.Pandoc.Writers.Docx.Types
21import Text.Pandoc.Writers.Docx.Types
22import Text.Pandoc.Shared
22import Text.Pandoc.Shared
23import Text.Printf (printf)
23import Text.Printf (printf)
@@ -25,6 +25,7 @@ import Text.Pandoc.Writers.GridTable hiding (Table)
25import Text.Pandoc.Writers.OOXML
25import Text.Pandoc.Writers.OOXML
26import Text.Pandoc.XML.Light as XML hiding (Attr)
26import Text.Pandoc.XML.Light as XML hiding (Attr)
27import qualified Data.Text as T
27import qualified Data.Text as T
28+import qualified Text.Pandoc.Translations as Term
28import qualified Text.Pandoc.Writers.GridTable as Grid
29import qualified Text.Pandoc.Writers.GridTable as Grid
29
30
30tableToOpenXML :: PandocMonad m
31tableToOpenXML :: PandocMonad m
@@ -33,15 +34,23 @@ tableToOpenXML :: PandocMonad m
33 -> WS m [Content]
34 -> WS m [Content]
34tableToOpenXML blocksToOpenXML gridTable = do
35tableToOpenXML blocksToOpenXML gridTable = do
35 setFirstPara
36 setFirstPara
36− let (Grid.Table _attr caption colspecs _rowheads thead tbodies tfoot) =
37+ let (Grid.Table (ident,_,_) caption colspecs _rowheads thead tbodies tfoot) =
37 gridTable
38 gridTable
38 let (Caption _maybeShortCaption captionBlocks) = caption
39 let (Caption _maybeShortCaption captionBlocks) = caption
40+ tablenum <- gets stNextTableNum
41+ unless (null captionBlocks) $
42+ modify $ \st -> st{ stNextTableNum = tablenum + 1 }
43+ let tableid = if T.null ident
44+ then "table" <> tshow tablenum
45+ else ident
46+ tablename <- translateTerm Term.Table
39 let captionStr = stringify captionBlocks
47 let captionStr = stringify captionBlocks
40 let aligns = map fst $ elems colspecs
48 let aligns = map fst $ elems colspecs
41 captionXml <- if null captionBlocks
49 captionXml <- if null captionBlocks
42 then return []
50 then return []
43 else withParaPropM (pStyleM "Table Caption")
51 else withParaPropM (pStyleM "Table Caption")
44− $ blocksToOpenXML captionBlocks
52+ $ blocksToOpenXML
53+ $ addLabel tableid tablename tablenum captionBlocks
45 -- We set "in table" after processing the caption, because we don't
54 -- We set "in table" after processing the caption, because we don't
46 -- want the "Table Caption" style to be overwritten with "Compact".
55 -- want the "Table Caption" style to be overwritten with "Compact".
47 modify $ \s -> s { stInTable = True }
56 modify $ \s -> s { stInTable = True }
@@ -81,6 +90,22 @@ tableToOpenXML blocksToOpenXML gridTable = do
81 modify $ \s -> s { stInTable = False }
90 modify $ \s -> s { stInTable = False }
82 return $ captionXml ++ [Elem tbl]
91 return $ captionXml ++ [Elem tbl]
83
92
93+addLabel :: Text -> Text -> Int -> [Block] -> [Block]
94+addLabel tableid tablename tablenum bs =
95+ case bs of
96+ (Para ils : rest) -> Para (label : Space : ils) : rest
97+ (Plain ils : rest) -> Plain (label : Space : ils) : rest
98+ _ -> Para [label] : bs
99+ where
100+ label = Span (tableid,[],[])
101+ [Str (tablename <> "\160"),
102+ RawInline (Format "openxml")
103+ ("<w:fldSimple w:instr=\"SEQ Table"
104+ <> " \\* ARABIC \"><w:r><w:t>"
105+ <> tshow tablenum
106+ <> "</w:t></w:r></w:fldSimple>"),
107+ Str ":"]
108+
84-- | Parts of a table
109-- | Parts of a table
85data RowType = HeadRow | BodyRow | FootRow
110data RowType = HeadRow | BodyRow | FootRow
86
111
src/Text/Pandoc/Writers/Docx/Types.hs+4
@@ -117,6 +117,8 @@ data WriterState = WriterState{
117 , stDynamicParaProps :: Set.Set ParaStyleName
117 , stDynamicParaProps :: Set.Set ParaStyleName
118 , stDynamicTextProps :: Set.Set CharStyleName
118 , stDynamicTextProps :: Set.Set CharStyleName
119 , stCurId :: Int
119 , stCurId :: Int
120+ , stNextFigureNum :: Int
121+ , stNextTableNum :: Int
120 }
122 }
121
123
122defaultWriterState :: WriterState
124defaultWriterState :: WriterState
@@ -137,6 +139,8 @@ defaultWriterState = WriterState{
137 , stDynamicParaProps = Set.empty
139 , stDynamicParaProps = Set.empty
138 , stDynamicTextProps = Set.empty
140 , stDynamicTextProps = Set.empty
139 , stCurId = 20
141 , stCurId = 20
142+ , stNextFigureNum = 1
143+ , stNextTableNum = 1
140 }
144 }
141
145
142setFirstPara :: PandocMonad m => WS m ()
146setFirstPara :: PandocMonad m => WS m ()
src/Text/Pandoc/Writers/HTML.hs+16−7
@@ -26,8 +26,13 @@ module Text.Pandoc.Writers.HTML (
26 writeSlideous,
26 writeSlideous,
27 writeDZSlides,
27 writeDZSlides,
28 writeRevealJs,
28 writeRevealJs,
29− tagWithAttributes
29+ tagWithAttributes,
30+ inlineToHtml,
31+ blockToHtml,
32+ WriterState(..),
33+ defaultWriterState
30 ) where
34 ) where
35+
31import Control.Monad.State.Strict
36import Control.Monad.State.Strict
32import Data.Char (ord)
37import Data.Char (ord)
33import Data.List (intercalate, intersperse, partition, delete, (\\), foldl')
38import Data.List (intercalate, intersperse, partition, delete, (\\), foldl')
@@ -659,17 +664,20 @@ dimensionsToAttrList attr = consolidateStyles $ go Width ++ go Height
659figure :: PandocMonad m
664figure :: PandocMonad m
660 => WriterOptions -> Attr -> [Inline] -> (Text, Text)
665 => WriterOptions -> Attr -> [Inline] -> (Text, Text)
661 -> StateT WriterState m Html
666 -> StateT WriterState m Html
662−figure opts attr txt (s,tit) = do
667+figure opts attr@(_, _, attrList) txt (s,tit) = do
663 html5 <- gets stHtml5
668 html5 <- gets stHtml5
664 -- Screen-readers will normally read the @alt@ text and the figure; we
669 -- Screen-readers will normally read the @alt@ text and the figure; we
665 -- want to avoid them reading the same text twice. With HTML5 we can
670 -- want to avoid them reading the same text twice. With HTML5 we can
666 -- use aria-hidden for the caption; with HTML4, we use an empty
671 -- use aria-hidden for the caption; with HTML4, we use an empty
667 -- alt-text instead.
672 -- alt-text instead.
673+ -- When the alt text differs from the caption both should be read.
668 let alt = if html5 then txt else [Str ""]
674 let alt = if html5 then txt else [Str ""]
669 let tocapt = if html5
675 let tocapt = if html5
670− then H5.figcaption !
676+ then (H5.figcaption !) $
677+ if isJust (lookup "alt" attrList)
678+ then mempty
671− H5.customAttribute (textTag "aria-hidden")
679+ else H5.customAttribute (textTag "aria-hidden")
672− (toValue @Text "true")
680+ (toValue @Text "true")
673 else H.p ! A.class_ "caption"
681 else H.p ! A.class_ "caption"
674 img <- inlineToHtml opts (Image attr alt (s,tit))
682 img <- inlineToHtml opts (Image attr alt (s,tit))
675 capt <- if null txt
683 capt <- if null txt
@@ -1433,7 +1441,7 @@ inlineToHtml opts inline = do
1433 return $ if T.null tit
1441 return $ if T.null tit
1434 then link'
1442 then link'
1435 else link' ! A.title (toValue tit)
1443 else link' ! A.title (toValue tit)
1436− (Image attr txt (s,tit)) -> do
1444+ (Image attr@(_, _, attrList) txt (s, tit)) -> do
1437 let alternate = stringify txt
1445 let alternate = stringify txt
1438 slideVariant <- gets stSlideVariant
1446 slideVariant <- gets stSlideVariant
1439 let isReveal = slideVariant == RevealJsSlides
1447 let isReveal = slideVariant == RevealJsSlides
@@ -1446,7 +1454,8 @@ inlineToHtml opts inline = do
1446 [A.title $ toValue tit | not (T.null tit)] ++
1454 [A.title $ toValue tit | not (T.null tit)] ++
1447 attrs
1455 attrs
1448 imageTag = (if html5 then H5.img else H.img
1456 imageTag = (if html5 then H5.img else H.img
1449− , [A.alt $ toValue alternate | not (null txt)] )
1457+ , [A.alt $ toValue alternate | not (null txt) &&
1458+ isNothing (lookup "alt" attrList)] )
1450 mediaTag tg fallbackTxt =
1459 mediaTag tg fallbackTxt =
1451 let linkTxt = if null txt
1460 let linkTxt = if null txt
1452 then fallbackTxt
1461 then fallbackTxt
src/Text/Pandoc/Writers/Markdown.hs+3
@@ -791,6 +791,9 @@ blockListToMarkdown opts blocks = do
791 b1 : commentSep : fixBlocks (b2:bs)
791 b1 : commentSep : fixBlocks (b2:bs)
792 fixBlocks (Plain ils : bs@(RawBlock{}:_)) =
792 fixBlocks (Plain ils : bs@(RawBlock{}:_)) =
793 Plain ils : fixBlocks bs
793 Plain ils : fixBlocks bs
794+ fixBlocks (Plain ils : bs@(Div{}:_))
795+ | isEnabled Ext_fenced_divs opts =
796+ Para ils : fixBlocks bs
794 fixBlocks (Plain ils : bs) | inlist =
797 fixBlocks (Plain ils : bs) | inlist =
795 Plain ils : fixBlocks bs
798 Plain ils : fixBlocks bs
796 fixBlocks (Plain ils : bs) =
799 fixBlocks (Plain ils : bs) =
src/Text/Pandoc/Writers/Powerpoint/Output.hs+1
@@ -537,6 +537,7 @@ registerMedia fp caption = do
537 Just Eps -> Just ".eps"
537 Just Eps -> Just ".eps"
538 Just Svg -> Just ".svg"
538 Just Svg -> Just ".svg"
539 Just Emf -> Just ".emf"
539 Just Emf -> Just ".emf"
540+ Just Tiff -> Just ".tiff"
540 Nothing -> Nothing
541 Nothing -> Nothing
541
542
542 let newGlobalId = fromMaybe (maxGlobalId + 1) (M.lookup fp globalIds)
543 let newGlobalId = fromMaybe (maxGlobalId + 1) (M.lookup fp globalIds)
stack.yaml+3
@@ -8,10 +8,13 @@ packages:
8- '.'
8- '.'
9extra-deps:
9extra-deps:
10- commonmark-0.2.1
10- commonmark-0.2.1
11+- commonmark-pandoc-0.2.1.1
11- skylighting-core-0.10.5.2
12- skylighting-core-0.10.5.2
12- skylighting-0.10.5.2
13- skylighting-0.10.5.2
13- git: https://github.com/jgm/doctemplates
14- git: https://github.com/jgm/doctemplates
14 commit: 428c26d5303cf7a2b1051fe1ffd9aafe9ba71c81
15 commit: 428c26d5303cf7a2b1051fe1ffd9aafe9ba71c81
16+- git: https://github.com/jgm/citeproc
17+ commit: 4ce0501cd6f9c86eee087afcf878c256e49b9615
15ghc-options:
18ghc-options:
16 "$locals": -fhide-source-paths -Wno-missing-home-modules
19 "$locals": -fhide-source-paths -Wno-missing-home-modules
17resolver: lts-18.0
20resolver: lts-18.0
test/Tests/Writers/OOXML.hs+3−1
@@ -55,7 +55,9 @@ testArchive :: (WriterOptions -> Pandoc -> PandocIO BL.ByteString)
55 -> IO Archive
55 -> IO Archive
56testArchive writerFn opts fp = do
56testArchive writerFn opts fp = do
57 txt <- T.readFile fp
57 txt <- T.readFile fp
58+ bs <- runIOorExplode $ do
59+ setTranslations "en-US"
58− bs <- runIOorExplode $ readNative def txt >>= writerFn opts
60+ readNative def txt >>= writerFn opts
59 return $ toArchive bs
61 return $ toArchive bs
60
62
61compareFileList :: FilePath -> Archive -> Archive -> Maybe String
63compareFileList :: FilePath -> Archive -> Archive -> Maybe String
test/command/4465.mdnew file+15
@@ -0,0 +1,15 @@
1+```
2+% pandoc -f html -t markdown
3+<ol>
4+ <li>An ordered list can contain block-level elements ind html, it means that divs are also allowed.</li>
5+ <li>Let's see the problem! <div class="example">This is an example.</div></li>
6+</ol>
7+^D
8+1. An ordered list can contain block-level elements ind html, it means
9+ that divs are also allowed.
10+2. Let\'s see the problem!
11+
12+ ::: example
13+ This is an example.
14+ :::
15+```
test/command/6890.md+2−2
@@ -23,12 +23,12 @@ references:
23
23
24@fruchtel-sozialer-2013a
24@fruchtel-sozialer-2013a
25
25
26−Some text [^1].
26+Some text.[^1]
27
27
28[^1]: @fruchtel-sozialer-2013a
28[^1]: @fruchtel-sozialer-2013a
29^D
29^D
30[Para [Cite [Citation {citationId = "fruchtel-sozialer-2013a", citationPrefix = [], citationSuffix = [], citationMode = AuthorInText, citationNoteNum = 1, citationHash = 0}] [Str "Fr\252chtel,",Space,Str "Budde,",Space,Str "and",Space,Str "Cyprian",Space,Str "(2013)"]]
30[Para [Cite [Citation {citationId = "fruchtel-sozialer-2013a", citationPrefix = [], citationSuffix = [], citationMode = AuthorInText, citationNoteNum = 1, citationHash = 0}] [Str "Fr\252chtel,",Space,Str "Budde,",Space,Str "and",Space,Str "Cyprian",Space,Str "(2013)"]]
31−,Para [Str "Some",Space,Str "text",Str ".",Note [Para [Cite [Citation {citationId = "fruchtel-sozialer-2013a", citationPrefix = [], citationSuffix = [], citationMode = AuthorInText, citationNoteNum = 2, citationHash = 0}] [Str "Fr\252chtel,",Space,Str "Budde,",Space,Str "and",Space,Str "Cyprian",Space,Str "(2013)"]]],Str ""]
31+,Para [Str "Some",Space,Str "text.",Note [Para [Cite [Citation {citationId = "fruchtel-sozialer-2013a", citationPrefix = [], citationSuffix = [], citationMode = AuthorInText, citationNoteNum = 2, citationHash = 0}] [Str "Fr\252chtel,",Space,Str "Budde,",Space,Str "and",Space,Str "Cyprian",Space,Str "(2013)"]]]]
32,Div ("refs",["references","csl-bib-body","hanging-indent"],[])
32,Div ("refs",["references","csl-bib-body","hanging-indent"],[])
33 [Div ("ref-fruchtel-sozialer-2013a",["csl-entry"],[])
33 [Div ("ref-fruchtel-sozialer-2013a",["csl-entry"],[])
34 [Para [Str "Fr\252chtel,",Space,Str "Frank,",Space,Str "Wolfgang",Space,Str "Budde,",Space,Str "and",Space,Str "Gudrun",Space,Str "Cyprian.",Space,Str "2013.",Space,Emph [Str "Sozialer",Space,Str "Raum",Space,Str "und",Space,Str "Soziale",Space,Str "Arbeit",Space,Str "Fieldbook:",Space,Str "Methoden",Space,Str "und",Space,Str "Techniken"],Str ".",Space,Str "3rd",Space,Str "ed.",Space,Str "Wiesbaden,",Space,Str "Germany:",Space,Str "Springer",Space,Str "VS."]]]]
34 [Para [Str "Fr\252chtel,",Space,Str "Frank,",Space,Str "Wolfgang",Space,Str "Budde,",Space,Str "and",Space,Str "Gudrun",Space,Str "Cyprian.",Space,Str "2013.",Space,Emph [Str "Sozialer",Space,Str "Raum",Space,Str "und",Space,Str "Soziale",Space,Str "Arbeit",Space,Str "Fieldbook:",Space,Str "Methoden",Space,Str "und",Space,Str "Techniken"],Str ".",Space,Str "3rd",Space,Str "ed.",Space,Str "Wiesbaden,",Space,Str "Germany:",Space,Str "Springer",Space,Str "VS."]]]]
test/command/7394.mdnew file+85
@@ -0,0 +1,85 @@
1+```
2+% pandoc -f markdown -t plain --citeproc
3+---
4+csl: command/chicago-fullnote-bibliography.csl
5+references:
6+- author:
7+ - family: Wandt
8+ given: Manfred
9+ edition: 6
10+ id: wandt2014ges-sv
11+ issued: 2014
12+ publisher: Franz Vahlen
13+ publisher-place: München
14+ title: Gesetzliche schuldverhältnisse
15+ title-short: Gesetzl SV
16+ type: book
17+- author:
18+ - family: Smith
19+ given: Zenda
20+ edition: 6
21+ id: smith2015
22+ issued: 2015
23+ publisher: Macmillan
24+ publisher-place: New York
25+ title: A verb and a noun
26+ type: book
27+---
28+
29+Hi^[@wandt2014ges-sv.].
30+
31+Hi^[[@wandt2014ges-sv].].
32+
33+Hi^[[See also @wandt2014ges-sv].].
34+
35+Hi^[See also @wandt2014ges-sv.].
36+
37+Hi^[@wandt2014ges-sv [@smith2015].].
38+
39+Hi^[[@wandt2014ges-sv; @smith2015].].
40+
41+Hi [@wandt2014ges-sv].
42+
43+Hi [see also @wandt2014ges-sv].
44+
45+^D
46+Hi[1].
47+
48+Hi[2].
49+
50+Hi[3].
51+
52+Hi[4].
53+
54+Hi[5].
55+
56+Hi[6].
57+
58+Hi.[7]
59+
60+Hi.[8]
61+
62+Smith, Zenda. A Verb and a Noun. 6th ed. New York: Macmillan, 2015.
63+
64+Wandt, Manfred. Gesetzliche Schuldverhältnisse. 6th ed. München: Franz
65+Vahlen, 2014.
66+
67+[1] Manfred Wandt, Gesetzliche Schuldverhältnisse, 6th ed. (München:
68+Franz Vahlen, 2014).
69+
70+[2] Wandt.
71+
72+[3] See also Wandt.
73+
74+[4] See also Wandt.
75+
76+[5] Wandt, Zenda Smith, A Verb and a Noun, 6th ed. (New York: Macmillan,
77+2015).
78+
79+[6] Wandt, Gesetzl SV; Smith, A Verb and a Noun.
80+
81+[7] Wandt, Gesetzl SV.
82+
83+[8] See also Wandt.
84+```
85+
test/command/7416.mdnew file+19
@@ -0,0 +1,19 @@
1+```
2+% pandoc -f markdown -t html
3+![caption](../media/rId25.jpg "title"){alt="alt"}
4+
5+^D
6+<figure>
7+<img src="../media/rId25.jpg" title="title" alt="alt" /><figcaption>caption</figcaption>
8+</figure>
9+```
10+
11+```
12+% pandoc -f markdown -t html
13+![caption](../media/rId25.jpg "title")
14+
15+^D
16+<figure>
17+<img src="../media/rId25.jpg" title="title" alt="caption" /><figcaption aria-hidden="true">caption</figcaption>
18+</figure>
19+```
test/command/pandoc-citeproc-322.md+1−1
@@ -19,7 +19,7 @@ references:
19 type: 'article-journal'
19 type: 'article-journal'
20---
20---
21
21
22−Foo[@timmory__justice_1950].
22+Foo [@timmory__justice_1950].
23^D
23^D
24Foo.[^1]
24Foo.[^1]
25
25
test/command/pandoc-citeproc-chicago-author-date.md+7−7
@@ -54,14 +54,14 @@ References {#references .unnumbered}
54
54
55([**nonexistent?**](#ref-nonexistent))
55([**nonexistent?**](#ref-nonexistent))
56
56
57−[Doe](#ref-item1) ([2005](#ref-item1)) says blah.
57+Doe ([2005](#ref-item1)) says blah.
58
58
59−[Doe](#ref-item1) ([2005, 30](#ref-item1)) says blah.
59+Doe ([2005, 30](#ref-item1)) says blah.
60
60
61−[Doe](#ref-item1) ([2005, 30](#ref-item1), with suffix) says blah.
61+Doe ([2005, 30](#ref-item1), with suffix) says blah.
62
62
63−[Doe](#ref-item1) ([2005](#ref-item1); [2006, 30](#ref-item2); see also
63+Doe ([2005](#ref-item1); [2006, 30](#ref-item2); see also [Doe and Roe
64−[Doe and Roe 2007](#ref-пункт3)) says blah.
64+2007](#ref-пункт3)) says blah.
65
65
66In a note.[^1]
66In a note.[^1]
67
67
@@ -98,8 +98,8 @@ edited by Sam Smith. Oxford: Oxford University Press.
98:::
98:::
99:::
99:::
100
100
101−[^1]: [Doe and Roe](#ref-пункт3) ([2007, 12](#ref-пункт3)) and a
101+[^1]: Doe and Roe ([2007, 12](#ref-пункт3)) and a citation without
102− citation without locators ([Doe and Roe 2007](#ref-пункт3)).
102+ locators ([Doe and Roe 2007](#ref-пункт3)).
103
103
104[^2]: Some citations (see [Doe 2005, chap. 3](#ref-item1);
104[^2]: Some citations (see [Doe 2005, chap. 3](#ref-item1);
105 [2006](#ref-item2); [Doe and Roe 2007](#ref-пункт3)).
105 [2006](#ref-item2); [Doe and Roe 2007](#ref-пункт3)).
test/command/pandoc-citeproc-chicago-fullnote-bibliography.md+6−7
@@ -55,13 +55,13 @@ References {#references .unnumbered}
55
55
56[^2]
56[^2]
57
57
58−[John Doe](#ref-item1)[^3] says blah.
58+John Doe[^3] says blah.
59
59
60−[Doe](#ref-item1)[^4] says blah.
60+Doe[^4] says blah.
61
61
62−[Doe](#ref-item1)[^5] says blah.
62+Doe[^5] says blah.
63
63
64−[Doe](#ref-item1)[^6] says blah.
64+Doe[^6] says blah.
65
65
66In a note.[^7]
66In a note.[^7]
67
67
@@ -112,9 +112,8 @@ Sam Smith. Oxford: Oxford University Press, 2007.
112 Roe, "Why Water Is Wet," in *Third Book*, ed. Sam Smith (Oxford:
112 Roe, "Why Water Is Wet," in *Third Book*, ed. Sam Smith (Oxford:
113 Oxford University Press, 2007)](#ref-пункт3).
113 Oxford University Press, 2007)](#ref-пункт3).
114
114
115−[^7]: [Doe and Roe](#ref-пункт3), ["Why Water Is Wet," 12](#ref-пункт3)
115+[^7]: Doe and Roe, ["Why Water Is Wet," 12](#ref-пункт3) and a citation
116− and a citation without locators ([Doe and Roe, "Why Water Is
116+ without locators ([Doe and Roe, "Why Water Is Wet"](#ref-пункт3)).
117− Wet"](#ref-пункт3)).
118
117
119[^8]: See [Doe, *First Book*, chap. 3](#ref-item1); also [Doe and Roe,
118[^8]: See [Doe, *First Book*, chap. 3](#ref-item1); also [Doe and Roe,
120 "Why Water Is Wet," 34--35](#ref-пункт3).
119 "Why Water Is Wet," 34--35](#ref-пункт3).
test/docx/golden/image.docx

Binary file not shown.

test/lhs-test.html+2−1
@@ -21,7 +21,7 @@
21 padding-top: 50px;
21 padding-top: 50px;
22 padding-bottom: 50px;
22 padding-bottom: 50px;
23 hyphens: auto;
23 hyphens: auto;
24− word-wrap: break-word;
24+ overflow-wrap: break-word;
25 text-rendering: optimizeLegibility;
25 text-rendering: optimizeLegibility;
26 font-kerning: normal;
26 font-kerning: normal;
27 }
27 }
@@ -92,6 +92,7 @@
92 pre code {
92 pre code {
93 padding: 0;
93 padding: 0;
94 overflow: visible;
94 overflow: visible;
95+ overflow-wrap: normal;
95 }
96 }
96 .sourceCode {
97 .sourceCode {
97 background-color: transparent;
98 background-color: transparent;
test/lhs-test.html+lhs+2−1
@@ -21,7 +21,7 @@
21 padding-top: 50px;
21 padding-top: 50px;
22 padding-bottom: 50px;
22 padding-bottom: 50px;
23 hyphens: auto;
23 hyphens: auto;
24− word-wrap: break-word;
24+ overflow-wrap: break-word;
25 text-rendering: optimizeLegibility;
25 text-rendering: optimizeLegibility;
26 font-kerning: normal;
26 font-kerning: normal;
27 }
27 }
@@ -92,6 +92,7 @@
92 pre code {
92 pre code {
93 padding: 0;
93 padding: 0;
94 overflow: visible;
94 overflow: visible;
95+ overflow-wrap: normal;
95 }
96 }
96 .sourceCode {
97 .sourceCode {
97 background-color: transparent;
98 background-color: transparent;
test/lhs-test.latex+3−3
@@ -4,9 +4,6 @@
4%
4%
5\documentclass[
5\documentclass[
6]{article}
6]{article}
7−\author{}
8−\date{}
9−
10\usepackage{amsmath,amssymb}
7\usepackage{amsmath,amssymb}
11\usepackage{lmodern}
8\usepackage{lmodern}
12\usepackage{iftex}
9\usepackage{iftex}
@@ -88,6 +85,9 @@
88 \usepackage{selnolig} % disable illegal ligatures
85 \usepackage{selnolig} % disable illegal ligatures
89\fi
86\fi
90
87
88+\author{}
89+\date{}
90+
91\begin{document}
91\begin{document}
92
92
93\hypertarget{lhs-test}{%
93\hypertarget{lhs-test}{%
test/lhs-test.latex+lhs+3−3
@@ -4,9 +4,6 @@
4%
4%
5\documentclass[
5\documentclass[
6]{article}
6]{article}
7−\author{}
8−\date{}
9−
10\usepackage{amsmath,amssymb}
7\usepackage{amsmath,amssymb}
11\usepackage{lmodern}
8\usepackage{lmodern}
12\usepackage{iftex}
9\usepackage{iftex}
@@ -55,6 +52,9 @@
55 \usepackage{selnolig} % disable illegal ligatures
52 \usepackage{selnolig} % disable illegal ligatures
56\fi
53\fi
57
54
55+\author{}
56+\date{}
57+
58\begin{document}
58\begin{document}
59
59
60\hypertarget{lhs-test}{%
60\hypertarget{lhs-test}{%
test/writer.html4+2−1
@@ -24,7 +24,7 @@
24 padding-top: 50px;
24 padding-top: 50px;
25 padding-bottom: 50px;
25 padding-bottom: 50px;
26 hyphens: auto;
26 hyphens: auto;
27− word-wrap: break-word;
27+ overflow-wrap: break-word;
28 text-rendering: optimizeLegibility;
28 text-rendering: optimizeLegibility;
29 font-kerning: normal;
29 font-kerning: normal;
30 }
30 }
@@ -95,6 +95,7 @@
95 pre code {
95 pre code {
96 padding: 0;
96 padding: 0;
97 overflow: visible;
97 overflow: visible;
98+ overflow-wrap: normal;
98 }
99 }
99 .sourceCode {
100 .sourceCode {
100 background-color: transparent;
101 background-color: transparent;
test/writer.html5+2−1
@@ -24,7 +24,7 @@
24 padding-top: 50px;
24 padding-top: 50px;
25 padding-bottom: 50px;
25 padding-bottom: 50px;
26 hyphens: auto;
26 hyphens: auto;
27− word-wrap: break-word;
27+ overflow-wrap: break-word;
28 text-rendering: optimizeLegibility;
28 text-rendering: optimizeLegibility;
29 font-kerning: normal;
29 font-kerning: normal;
30 }
30 }
@@ -95,6 +95,7 @@
95 pre code {
95 pre code {
96 padding: 0;
96 padding: 0;
97 overflow: visible;
97 overflow: visible;
98+ overflow-wrap: normal;
98 }
99 }
99 .sourceCode {
100 .sourceCode {
100 background-color: transparent;
101 background-color: transparent;
test/writer.latex+4−4
@@ -4,10 +4,6 @@
4%
4%
5\documentclass[
5\documentclass[
6]{article}
6]{article}
7−\title{Pandoc Test Suite}
8−\author{John MacFarlane \and Anonymous}
9−\date{July 17, 2006}
10−
11\usepackage{amsmath,amssymb}
7\usepackage{amsmath,amssymb}
12\usepackage{lmodern}
8\usepackage{lmodern}
13\usepackage{iftex}
9\usepackage{iftex}
@@ -71,6 +67,10 @@
71 \usepackage{selnolig} % disable illegal ligatures
67 \usepackage{selnolig} % disable illegal ligatures
72\fi
68\fi
73
69
70+\title{Pandoc Test Suite}
71+\author{John MacFarlane \and Anonymous}
72+\date{July 17, 2006}
73+
74\begin{document}
74\begin{document}
75\maketitle
75\maketitle
76
76
test/writers-lang-and-dir.latex+3−3
@@ -5,9 +5,6 @@
5\documentclass[
5\documentclass[
6 english,
6 english,
7]{article}
7]{article}
8−\author{}
9−\date{}
10−
11\usepackage{amsmath,amssymb}
8\usepackage{amsmath,amssymb}
12\usepackage{lmodern}
9\usepackage{lmodern}
13\usepackage{iftex}
10\usepackage{iftex}
@@ -87,6 +84,9 @@
87 \newenvironment{LTR}{\beginL}{\endL}
84 \newenvironment{LTR}{\beginL}{\endL}
88\fi
85\fi
89
86
87+\author{}
88+\date{}
89+
90\begin{document}
90\begin{document}
91
91
92\hypertarget{empty-divs-and-spans}{%
92\hypertarget{empty-divs-and-spans}{%
tools/build-arm.sh+3−1
@@ -1,6 +1,8 @@
1#!/bin/sh
1#!/bin/sh
2
2
3+#old version:
3−IMAGE_ID=ami-0fa8979d18f69948b
4+#IMAGE_ID=ami-0fa8979d18f69948b
5+IMAGE_ID=ami-0cd6b53a434812702
4INSTANCE_TYPE=t4g.2xlarge
6INSTANCE_TYPE=t4g.2xlarge
5KEY_NAME=debian-arm-us-east-2
7KEY_NAME=debian-arm-us-east-2
6SECURITY_GROUP_ID=sg-086ffbadc286c5c00
8SECURITY_GROUP_ID=sg-086ffbadc286c5c00