pandoc 3.1.12.2 → 3.1.12.3
raw patch · 23 files changed
+605/−264 lines, 23 filesdep ~commonmarkdep ~commonmark-extensionsdep ~djotPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: commonmark, commonmark-extensions, djot, skylighting, skylighting-core, texmath, typst, zip-archive
API changes (from Hackage documentation)
Files
- AUTHORS.md +1/−0
- MANUAL.txt +2/−2
- README.md +1/−1
- changelog.md +52/−0
- data/templates/default.html4 +1/−1
- data/templates/default.html5 +1/−1
- data/templates/default.latex +16/−2
- data/templates/default.typst +4/−0
- data/translations/ko.yaml +1/−1
- pandoc.cabal +9/−9
- src/Text/Pandoc/Data.hs +1/−1
- src/Text/Pandoc/Readers/LaTeX/Parsing.hs +44/−29
- src/Text/Pandoc/Readers/LaTeX/Table.hs +6/−5
- src/Text/Pandoc/Readers/Markdown.hs +1/−0
- src/Text/Pandoc/Writers/Typst.hs +42/−45
- test/command/9236.md +33/−0
- test/command/9517.md +34/−0
- test/command/9555.md +13/−0
- test/command/9576.md +23/−0
- test/command/9579.md +46/−0
- test/djot-reader.native +146/−43
- test/tables.typst +122/−122
- test/writer.typst +6/−2
AUTHORS.md view
@@ -290,6 +290,7 @@ - OCzarnecki - Ola Wolska - Ole Martin Ruud+- Oliver Fabel - Oliver Matthews - Olivier Benz - Ophir Lifshitz
MANUAL.txt view
@@ -1,7 +1,7 @@ --- title: Pandoc User's Guide author: John MacFarlane-date: February 29, 2024+date: March 17, 2024 --- # Synopsis@@ -516,7 +516,7 @@ [reveal.js]: https://revealjs.com/ [FictionBook2]: http://www.fictionbook.org/index.php/Eng:XML_Schema_Fictionbook_2.1 [Jupyter notebook]: https://nbformat.readthedocs.io/en/latest/-[InDesign ICML]: https://wwwimages.adobe.com/www.adobe.com/content/dam/acom/en/devnet/indesign/sdk/cs6/idml/idml-cookbook.pdf+[InDesign ICML]: https://manualzz.com/doc/9627253/adobe-indesign-cs6-idml-cookbook [TEI Simple]: https://github.com/TEIC/TEI-Simple [Muse]: https://amusewiki.org/library/manual [PowerPoint]: https://en.wikipedia.org/wiki/Microsoft_PowerPoint
README.md view
@@ -150,7 +150,7 @@ markup](https://www.w3.org/TR/html-polyglot/)) - `html4` ([XHTML](https://www.w3.org/TR/xhtml1/) 1.0 Transitional) - `icml` ([InDesign- ICML](https://wwwimages.adobe.com/www.adobe.com/content/dam/acom/en/devnet/indesign/sdk/cs6/idml/idml-cookbook.pdf))+ ICML](https://manualzz.com/doc/9627253/adobe-indesign-cs6-idml-cookbook)) - `ipynb` ([Jupyter notebook](https://nbformat.readthedocs.io/en/latest/)) - `jats_archiving` ([JATS](https://jats.nlm.nih.gov) XML, Archiving and
changelog.md view
@@ -1,5 +1,57 @@ # Revision history for pandoc +## pandoc 3.1.12.3 (2024-03-17)++ * Markdown reader: Fix bug with footnotes at end of fenced div (#9576).++ * LaTeX reader:++ + Improve tokenization of `@` (#9555). Make tokenization sensitive to+ `\makeatletter`/`\makeatother`. Previously we just always treated+ `@` as a letter. This led to bad results, e.g. with the sequence `\@`.+ E.g., `a\@ b` would parse as "ab" and `a\@b` as "a".+ + Make `withRaw` work inside `parseFromToks` (#9517).+ This is needed for raw environments to work inside table cells.+ + Better handling of table colwidths (#9579). Previously the parser just+ failed if the column width specified in `p{}` wasn't a multiple of+ `\linewidth`. This led to cases where content was skipped.++ * Typst writer:++ + Add 'kind' parameter to figures with tables (#9574).+ + Avoid unnecessary box around image in figure (#9236).+ + Omit width/height in images unless explicitly specified (#9236).+ Previously we computed width/heigth for images that didn't have+ size information, because otherwise typst would expand the image+ to fit page width. This typst behavior has changed in 0.11.+ This change fixes a bug in which images would sometimes overflow+ page margins, depending on their intrinsic size.+ + Don't add hard-coded `inset` to tables (#9580). Instead, set this+ globally in the default template, allowing it to be customized.++ * LaTeX template: Fix block headings support for unnumbered paragraphs+ (#9542, #6018, Oliver Fabel).++ * HTML templates: Replace polyfill provider (#2384, @SukkaW).+ Replace polyfill.io with cdnjs.cloudflare.com/polyfill.+ polyfill.io has been acquired by Funnull, and the service has+ become unstable.++ * Korean translations: delete colon in translation for 'to'.+ This was invalid YAML, and not desired anyway, since a colon+ is added.++ * Use latest commonmark, commonmark-extensions.+ This fixes a 3.12 regression in parsing of commonmark/gfm autolinks+ (jgm/commonmark-hs#151).++ * Depend on djot 0.1.1.3, which fixes a serious parsing bug affecting+ regular paragraphs after lists.++ * Depend on latest skylighting, skylighting-core, typst-hs, texmath.++ * MANUAL.txt: Change broken link to IDML cookbook (#9563).+ ## pandoc 3.1.12.2 (2024-02-29) * Docx reader:
data/templates/default.html4 view
@@ -28,7 +28,7 @@ $endfor$ $if(math)$ $if(mathjax)$- <script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>+ <script src="https://cdnjs.cloudflare.com/polyfill/v3/polyfill.min.js?features=es6"></script> $endif$ $math$ $endif$
data/templates/default.html5 view
@@ -28,7 +28,7 @@ $endfor$ $if(math)$ $if(mathjax)$- <script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>+ <script src="https://cdnjs.cloudflare.com/polyfill/v3/polyfill.min.js?features=es6"></script> $endif$ $math$ $endif$
data/templates/default.latex view
@@ -354,14 +354,28 @@ $else$ $if(block-headings)$ % Make \paragraph and \subparagraph free-standing+\makeatletter \ifx\paragraph\undefined\else \let\oldparagraph\paragraph- \renewcommand{\paragraph}[1]{\oldparagraph{#1}\mbox{}}+ \renewcommand{\paragraph}{+ \@ifstar+ \xxxParagraphStar+ \xxxParagraphNoStar+ }+ \newcommand{\xxxParagraphStar}[1]{\oldparagraph*{#1}\mbox{}}+ \newcommand{\xxxParagraphNoStar}[1]{\oldparagraph{#1}\mbox{}} \fi \ifx\subparagraph\undefined\else \let\oldsubparagraph\subparagraph- \renewcommand{\subparagraph}[1]{\oldsubparagraph{#1}\mbox{}}+ \renewcommand{\subparagraph}{+ \@ifstar+ \xxxSubParagraphStar+ \xxxSubParagraphNoStar+ }+ \newcommand{\xxxSubParagraphStar}[1]{\oldsubparagraph*{#1}\mbox{}}+ \newcommand{\xxxSubParagraphNoStar}[1]{\oldsubparagraph{#1}\mbox{}} \fi+\makeatother $endif$ $endif$ $if(pagestyle)$
data/templates/default.typst view
@@ -9,6 +9,10 @@ .join() } +#set table(+ inset: 6pt+)+ $if(template)$ #import "$template$": conf $else$
data/translations/ko.yaml view
@@ -14,4 +14,4 @@ Proof: 증명 References: 참고문헌 Table: 표-To: 수신:+To: 수신
pandoc.cabal view
@@ -1,6 +1,6 @@ cabal-version: 2.4 name: pandoc-version: 3.1.12.2+version: 3.1.12.3 build-type: Simple license: GPL-2.0-or-later license-file: COPYING.md@@ -477,8 +477,8 @@ bytestring >= 0.9 && < 0.13, case-insensitive >= 1.2 && < 1.3, citeproc >= 0.8.1 && < 0.9,- commonmark >= 0.2.5.1 && < 0.3,- commonmark-extensions >= 0.2.5.3 && < 0.3,+ commonmark >= 0.2.6 && < 0.3,+ commonmark-extensions >= 0.2.5.4 && < 0.3, commonmark-pandoc >= 0.2.2.1 && < 0.3, containers >= 0.6.0.1 && < 0.8, crypton-connection >= 0.3.1 && < 0.4,@@ -510,25 +510,25 @@ random >= 1 && < 1.3, safe >= 0.3.18 && < 0.4, scientific >= 0.3 && < 0.4,- skylighting >= 0.14.1 && < 0.15,- skylighting-core >= 0.14.1 && < 0.15,+ skylighting >= 0.14.1.1 && < 0.15,+ skylighting-core >= 0.14.1.1 && < 0.15, split >= 0.2 && < 0.3, syb >= 0.1 && < 0.8, tagsoup >= 0.14.6 && < 0.15, temporary >= 1.1 && < 1.4,- texmath >= 0.12.8.6 && < 0.13,+ texmath >= 0.12.8.7 && < 0.13, text >= 1.1.1.0 && < 2.2, text-conversions >= 0.3 && < 0.4, time >= 1.5 && < 1.14, unicode-collation >= 0.1.1 && < 0.2, unicode-transforms >= 0.3 && < 0.5, yaml >= 0.11 && < 0.12,- zip-archive >= 0.4.3 && < 0.5,+ zip-archive >= 0.4.3.1 && < 0.5, zlib >= 0.5 && < 0.8, xml >= 1.3.12 && < 1.4,- typst >= 0.5.0.1 && < 0.5.1,+ typst >= 0.5.0.2 && < 0.5.1, vector >= 0.12 && < 0.14,- djot >= 0.1.1.0 && < 0.2,+ djot >= 0.1.1.3 && < 0.2, tls >= 2.0.1 && < 2.1, crypton-x509-system >= 1.6.7 && < 1.7
src/Text/Pandoc/Data.hs view
@@ -38,7 +38,7 @@ import Paths_pandoc (getDataDir) #endif --- | Read file from from the default data files.+-- | Read file from the default data files. readDefaultDataFile :: PandocMonad m => FilePath -> m B.ByteString readDefaultDataFile "reference.docx" = B.concat . BL.toChunks . fromArchive <$> getDefaultReferenceDocx
src/Text/Pandoc/Readers/LaTeX/Parsing.hs view
@@ -354,41 +354,41 @@ Sources ((_,t):rest) -> tokenizeSources $ Sources ((pos,t):rest) tokenize :: SourcePos -> Text -> [Tok]-tokenize = totoks+tokenize = totoks False where- totoks pos t =+ totoks atIsLetter pos t = case T.uncons t of Nothing -> [] Just (c, rest) | c == '\n' -> Tok pos Newline "\n"- : totoks (setSourceColumn (incSourceLine pos 1) 1) rest+ : totoks atIsLetter (setSourceColumn (incSourceLine pos 1) 1) rest | isSpaceOrTab c -> let (sps, rest') = T.span isSpaceOrTab t in Tok pos Spaces sps- : totoks (incSourceColumn pos (T.length sps))+ : totoks atIsLetter (incSourceColumn pos (T.length sps)) rest' | isAlphaNum c -> let (ws, rest') = T.span isAlphaNum t in Tok pos Word ws- : totoks (incSourceColumn pos (T.length ws)) rest'+ : totoks atIsLetter (incSourceColumn pos (T.length ws)) rest' | c == '%' -> let (cs, rest') = T.break (== '\n') rest in Tok pos Comment ("%" <> cs)- : totoks (incSourceColumn pos (1 + T.length cs)) rest'+ : totoks atIsLetter (incSourceColumn pos (1 + T.length cs)) rest' | c == '\\' -> case T.uncons rest of Nothing -> [Tok pos (CtrlSeq " ") "\\"] Just (d, rest')- | isLetterOrAt d ->- -- \makeatletter is common in macro defs;- -- ideally we should make tokenization sensitive- -- to \makeatletter and \makeatother, but this is- -- probably best for now- let (ws, rest'') = T.span isLetterOrAt rest+ | isLetter' atIsLetter d ->+ let (ws, rest'') = T.span (isLetter' atIsLetter) rest (ss, rest''') = T.span isSpaceOrTab rest''+ atIsLetter' = case ws of+ "makeatletter" -> True+ "makeatother" -> False+ _ -> atIsLetter in Tok pos (CtrlSeq ws) ("\\" <> ws <> ss)- : totoks (incSourceColumn pos+ : totoks atIsLetter' (incSourceColumn pos (1 + T.length ws + T.length ss)) rest''' | isSpaceOrTab d || d == '\n' -> let (w1, r1) = T.span isSpaceOrTab rest@@ -401,15 +401,15 @@ in case T.uncons r3 of Just ('\n', _) -> Tok pos (CtrlSeq " ") ("\\" <> w1)- : totoks (incSourceColumn pos (T.length ws))- r1+ : totoks atIsLetter+ (incSourceColumn pos (T.length ws)) r1 _ -> Tok pos (CtrlSeq " ") ws- : totoks (incSourceColumn pos (T.length ws))- r3+ : totoks atIsLetter+ (incSourceColumn pos (T.length ws)) r3 | otherwise -> Tok pos (CtrlSeq (T.singleton d)) (T.pack [c,d])- : totoks (incSourceColumn pos 2) rest'+ : totoks atIsLetter (incSourceColumn pos 2) rest' | c == '#' -> case T.uncons rest of Just ('#', t3) ->@@ -417,18 +417,20 @@ in case safeRead t1 of Just i -> Tok pos (DeferredArg i) ("##" <> t1)- : totoks (incSourceColumn pos (2 + T.length t1)) t2+ : totoks atIsLetter+ (incSourceColumn pos (2 + T.length t1)) t2 Nothing -> Tok pos Symbol "#" : Tok (incSourceColumn pos 1) Symbol "#"- : totoks (incSourceColumn pos 1) t3+ : totoks atIsLetter (incSourceColumn pos 1) t3 _ -> let (t1, t2) = T.span (\d -> d >= '0' && d <= '9') rest in case safeRead t1 of Just i -> Tok pos (Arg i) ("#" <> t1)- : totoks (incSourceColumn pos (1 + T.length t1)) t2+ : totoks atIsLetter+ (incSourceColumn pos (1 + T.length t1)) t2 Nothing -> Tok pos Symbol "#"- : totoks (incSourceColumn pos 1) rest+ : totoks atIsLetter (incSourceColumn pos 1) rest | c == '^' -> case T.uncons rest of Just ('^', rest') ->@@ -438,26 +440,35 @@ case T.uncons rest'' of Just (e, rest''') | isLowerHex e -> Tok pos Esc2 (T.pack ['^','^',d,e])- : totoks (incSourceColumn pos 4) rest'''+ : totoks atIsLetter+ (incSourceColumn pos 4) rest''' _ -> Tok pos Esc1 (T.pack ['^','^',d])- : totoks (incSourceColumn pos 3) rest''+ : totoks atIsLetter+ (incSourceColumn pos 3) rest'' | d < '\128' -> Tok pos Esc1 (T.pack ['^','^',d])- : totoks (incSourceColumn pos 3) rest''+ : totoks atIsLetter+ (incSourceColumn pos 3) rest'' _ -> Tok pos Symbol "^" : Tok (incSourceColumn pos 1) Symbol "^" :- totoks (incSourceColumn pos 2) rest'+ totoks atIsLetter (incSourceColumn pos 2) rest' _ -> Tok pos Symbol "^"- : totoks (incSourceColumn pos 1) rest+ : totoks atIsLetter (incSourceColumn pos 1) rest | otherwise ->- Tok pos Symbol (T.singleton c) : totoks (incSourceColumn pos 1) rest+ Tok pos Symbol (T.singleton c) :+ totoks atIsLetter (incSourceColumn pos 1) rest isSpaceOrTab :: Char -> Bool isSpaceOrTab ' ' = True isSpaceOrTab '\t' = True isSpaceOrTab _ = False +-- First parameter is True if @ is letter+isLetter' :: Bool -> Char -> Bool+isLetter' True '@' = True+isLetter' _ c = isLetter c+ isLetterOrAt :: Char -> Bool isLetterOrAt '@' = True isLetterOrAt c = isLetter c@@ -490,7 +501,11 @@ case toks of Tok pos _ _ : _ -> setPosition pos _ -> return ()- result <- disablingWithRaw parser+ -- we ignore existing raw tokens maps (see #9517)+ oldRawTokens <- sRawTokens <$> getState+ updateState $ \st -> st{ sRawTokens = mempty }+ result <- parser+ updateState $ \st -> st{ sRawTokens = oldRawTokens } setInput oldInput setPosition oldpos return result
src/Text/Pandoc/Readers/LaTeX/Table.hs view
@@ -87,11 +87,12 @@ let alignPrefix = symbol '>' >> braced let alignSuffix = symbol '<' >> braced let colWidth = try $ do- symbol '{'- ds <- trim . untokenize <$> manyTill anyTok (controlSeq "linewidth")- spaces- symbol '}'- return $ safeRead ds+ ts <- braced+ let isLinewidth (Tok _ (CtrlSeq "linewidth") _) = True+ isLinewidth _ = False+ case break isLinewidth ts of+ (ds, _:_) -> return $ safeRead $ trim $ untokenize ds+ _ -> return Nothing let alignSpec = do pref <- option [] alignPrefix spaces
src/Text/Pandoc/Readers/Markdown.hs view
@@ -417,6 +417,7 @@ rawLine :: PandocMonad m => MarkdownParser m Text rawLine = try $ do notFollowedBy blankline+ notFollowedByDivCloser notFollowedBy' $ try $ skipNonindentSpaces >> noteMarker optional indentSpaces anyLine
src/Text/Pandoc/Writers/Typst.hs view
@@ -17,8 +17,7 @@ writeTypst ) where import Text.Pandoc.Definition-import Text.Pandoc.Class ( PandocMonad, fetchItem )-import Text.Pandoc.ImageSize (imageSize, sizeInPoints)+import Text.Pandoc.Class ( PandocMonad) import Text.Pandoc.Options ( WriterOptions(..), WrapOption(..), isEnabled ) import Data.Text (Text) import Data.List (intercalate)@@ -32,7 +31,6 @@ import qualified Text.TeXMath as TM import Text.DocLayout import Text.DocTemplates (renderTemplate)-import Control.Monad.Except (catchError) import Text.Pandoc.Extensions (Extension(..)) import Text.Collate.Lang (Lang(..), parseLang) import Data.Char (isAlphaNum)@@ -175,26 +173,37 @@ formatalign AlignCenter = "center," formatalign AlignDefault = "auto," let alignarray = parens $ mconcat $ map formatalign aligns- return $ "#figure(" $$- "align(center)[#table("- $$ nest 2- ( "columns: " <> text (show numcols) <> "," -- auto- $$ "align: (col, row) => " <> alignarray <> ".at(col),"- $$ "inset: 6pt" <> ","- $$ hsep (map ((<>",") . brackets) headers')- $$ vcat (map (\x -> brackets x <> ",") (concat rows'))- )- $$ ")]"- $$ capt'- $$ ")"+ return $+ "#figure("+ $$+ nest 2+ ("align(center)[#table("+ $$ nest 2+ ( "columns: " <> text (show numcols) <> "," -- auto+ $$ "align: (col, row) => " <> alignarray <> ".at(col),"+ $$ hsep (map ((<>",") . brackets) headers')+ $$ vcat (map (\x -> brackets x <> ",") (concat rows'))+ )+ $$ ")]"+ $$ capt'+ $$ ", kind: table"+ $$ ")") $$ lab $$ blankline Figure (ident,_,_) (Caption _mbshort capt) blocks -> do caption <- blocksToTypst capt- contents <- blocksToTypst blocks+ contents <- case blocks of+ -- don't need #box around block-level image+ [Para [Image (_,_,kvs) _ (src, _)]]+ -> pure $ mkImage False src kvs+ [Plain [Image (_,_,kvs) _ (src, _)]]+ -> pure $ mkImage False src kvs+ _ -> brackets <$> blocksToTypst blocks let lab = toLabel FreestandingLabel ident- return $ "#figure(" <> nest 2 (brackets contents <> "," <> cr <>- ("caption: [" $$ nest 2 caption $$ "]"))+ return $ "#figure(" <> nest 2 ((contents <> ",")+ $$+ ("caption: [" $$ nest 2 caption $$ "]")+ ) $$ ")" $$ lab $$ blankline Div (ident,_,_) (Header lev ("",cls,kvs) ils:rest) -> blocksToTypst (Header lev (ident,cls,kvs) ils:rest)@@ -295,36 +304,24 @@ (if inlines == [Str src] then mempty else nowrap $ brackets contents) <> endCode- Image (_,_,kvs) _inlines (src,_tit) -> do- opts <- gets stOptions- let mbHeight = lookup "height" kvs- let mdWidth = lookup "width" kvs- let src' = T.pack $ unEscapeString $ T.unpack src -- #9389- let coreImage = "image" <> parens (doubleQuoted src')- -- see #9104; we need a box or the image is treated as block-level:- case (mdWidth, mbHeight) of- (Nothing, Nothing) -> do- realWidth <- catchError- (do (bs, _mt) <- fetchItem src- case imageSize opts bs of- Right x -> pure $ Just $ T.pack $- show (fst (sizeInPoints x)) <> "pt"- Left _ -> pure Nothing)- (\_ -> pure Nothing)- case realWidth of- Just w -> return $ "#box" <>- parens ("width: " <> literal w <> ", " <> coreImage)- <> endCode- Nothing -> return $ "#" <> coreImage <> endCode- (Just w, _) -> return $ "#box" <>- parens ("width: " <> literal w <> ", " <> coreImage)- <> endCode- (_, Just h) -> return $ "#box" <>- parens ("height: " <> literal h <> ", " <> coreImage)- <> endCode+ Image (_,_,kvs) _inlines (src,_tit) -> pure $ mkImage True src kvs Note blocks -> do contents <- blocksToTypst blocks return $ "#footnote" <> brackets (chomp contents) <> endCode++-- see #9104; need box or image is treated as block-level+mkImage :: Bool -> Text -> [(Text, Text)] -> Doc Text+mkImage useBox src kvs+ | useBox = "#box" <> parens coreImage+ | otherwise = coreImage+ where+ src' = T.pack $ unEscapeString $ T.unpack src -- #9389+ toDimAttr k =+ case lookup k kvs of+ Just v -> ", " <> literal k <> ": " <> literal v+ Nothing -> mempty+ dimAttrs = mconcat $ map toDimAttr ["height", "width"]+ coreImage = "image" <> parens (doubleQuoted src' <> dimAttrs) textstyle :: PandocMonad m => Doc Text -> [Inline] -> TW m (Doc Text) textstyle s inlines =
+ test/command/9236.md view
@@ -0,0 +1,33 @@+```+% pandoc -t typst+{width=3in}++{width=3in height=2in}++++And inline: {height=2in} and+.+^D+#figure(image("command/minimal.svg", width: 3in),+ caption: [+ minimal+ ]+)++#figure(image("command/minimal.svg", height: 2in, width: 3in),+ caption: [+ minimal+ ]+)++#figure(image("command/minimal.svg"),+ caption: [+ minimal+ ]+)++And inline: #box(image("command/minimal.svg", height: 2in)) and+#box(image("command/minimal.svg")).++```
+ test/command/9517.md view
@@ -0,0 +1,34 @@+```+% pandoc -f latex+raw_tex -t native+\begin{tabular}{l}+\begin{theorem}+Cats+\end{theorem}+\end{tabular}+^D+[ Table+ ( "" , [] , [] )+ (Caption Nothing [])+ [ ( AlignLeft , ColWidthDefault ) ]+ (TableHead ( "" , [] , [] ) [])+ [ TableBody+ ( "" , [] , [] )+ (RowHeadColumns 0)+ []+ [ Row+ ( "" , [] , [] )+ [ Cell+ ( "" , [] , [] )+ AlignDefault+ (RowSpan 1)+ (ColSpan 1)+ [ RawBlock+ (Format "latex")+ "\\begin{theorem}\nCats\n\\end{theorem}"+ ]+ ]+ ]+ ]+ (TableFoot ( "" , [] , [] ) [])+]+```
+ test/command/9555.md view
@@ -0,0 +1,13 @@+```+% pandoc -t native -f latex+a\@ b\@c++\makeatletter+a\@ b\@c+\makeatother+a\@ b\@c+^D+[ Para [ Str "a" , Space , Str "bc" ]+, Para [ Str "ab" , SoftBreak , Str "a" , Space , Str "bc" ]+]+```
+ test/command/9576.md view
@@ -0,0 +1,23 @@+```+% pandoc -t native+::: {#something}+Text with a footnote.[^3]++[^3]: A footnote.+:::+^D+[ Div+ ( "something" , [] , [] )+ [ Para+ [ Str "Text"+ , Space+ , Str "with"+ , Space+ , Str "a"+ , Space+ , Str "footnote."+ , Note [ Para [ Str "A" , Space , Str "footnote." ] ]+ ]+ ]+]+```
+ test/command/9579.md view
@@ -0,0 +1,46 @@+```+% pandoc -t native+\begin{tabular}{p{2in}}+\end{tabular}++# Test++\begin{tabular}{p{2\linewidth}}+\end{tabular}+^D+[ RawBlock+ (Format "tex") "\\begin{tabular}{p{2in}}\n\\end{tabular}"+, Header 1 ( "test" , [] , [] ) [ Str "Test" ]+, RawBlock+ (Format "tex")+ "\\begin{tabular}{p{2\\linewidth}}\n\\end{tabular}"+]+```++```+% pandoc -f latex -t native+\begin{tabular}{p{2in}}+\end{tabular}++Test++\begin{tabular}{p{2\linewidth}}+\end{tabular}+^D+[ Table+ ( "" , [] , [] )+ (Caption Nothing [])+ [ ( AlignLeft , ColWidthDefault ) ]+ (TableHead ( "" , [] , [] ) [])+ [ TableBody ( "" , [] , [] ) (RowHeadColumns 0) [] [] ]+ (TableFoot ( "" , [] , [] ) [])+, Para [ Str "Test" ]+, Table+ ( "" , [] , [] )+ (Caption Nothing [])+ [ ( AlignLeft , ColWidth 2.0 ) ]+ (TableHead ( "" , [] , [] ) [])+ [ TableBody ( "" , [] , [] ) (RowHeadColumns 0) [] [] ]+ (TableFoot ( "" , [] , [] ) [])+]+```
test/djot-reader.native view
@@ -123,6 +123,7 @@ [ [ Plain [ Str "item one" ] ] , [ Plain [ Str "item two" ] ] ]+ , Para [ Str "Nested block quotes:" ] , BlockQuote [ Para [ Str "nested" ] ] , BlockQuote [ Para [ Str "nested" ] ] ]@@ -151,22 +152,37 @@ [ Header 2 ( "" , [] , [] ) [ Str "Unordered" ] , Para [ Str "Asterisks tight:" ] , BulletList+ [ [ Plain [ Str "asterisk 1" ] ]+ , [ Plain [ Str "asterisk 2" ] ]+ , [ Plain [ Str "asterisk 3" ] ]+ ]+ , Para [ Str "Asterisks loose:" ]+ , BulletList [ [ Para [ Str "asterisk 1" ] ] , [ Para [ Str "asterisk 2" ] ] , [ Para [ Str "asterisk 3" ] ]- , [ Para [ Str "asterisk 1" ] ]- , [ Para [ Str "asterisk 2" ] ]- , [ Para [ Str "asterisk 3" ] ]- , [ Para [ Str "Plus 1" ] ]- , [ Para [ Str "Plus 2" ] ]- , [ Para [ Str "Plus 3" ] ]- , [ Para [ Str "Plus 1" ] ]+ ]+ , Para [ Str "Pluses tight:" ]+ , BulletList+ [ [ Plain [ Str "Plus 1" ] ]+ , [ Plain [ Str "Plus 2" ] ]+ , [ Plain [ Str "Plus 3" ] ]+ ]+ , Para [ Str "Pluses loose:" ]+ , BulletList+ [ [ Para [ Str "Plus 1" ] ] , [ Para [ Str "Plus 2" ] ] , [ Para [ Str "Plus 3" ] ]- , [ Para [ Str "Minus 1" ] ]- , [ Para [ Str "Minus 2" ] ]- , [ Para [ Str "Minus 3" ] ]- , [ Para [ Str "Minus 1" ] ]+ ]+ , Para [ Str "Minuses tight:" ]+ , BulletList+ [ [ Plain [ Str "Minus 1" ] ]+ , [ Plain [ Str "Minus 2" ] ]+ , [ Plain [ Str "Minus 3" ] ]+ ]+ , Para [ Str "Minuses loose:" ]+ , BulletList+ [ [ Para [ Str "Minus 1" ] ] , [ Para [ Str "Minus 2" ] ] , [ Para [ Str "Minus 3" ] ] ]@@ -177,19 +193,35 @@ , Para [ Str "Tight:" ] , OrderedList ( 1 , Decimal , Period )+ [ [ Plain [ Str "First" ] ]+ , [ Plain [ Str "Second" ] ]+ , [ Plain [ Str "Third" ] ]+ ]+ , Para [ Str "and:" ]+ , OrderedList+ ( 1 , Decimal , Period )+ [ [ Plain [ Str "One" ] ]+ , [ Plain [ Str "Two" ] ]+ , [ Plain [ Str "Three" ] ]+ ]+ , Para [ Str "Loose using tabs:" ]+ , OrderedList+ ( 1 , Decimal , Period ) [ [ Para [ Str "First" ] ] , [ Para [ Str "Second" ] ] , [ Para [ Str "Third" ] ]- , [ Para [ Str "One" ] ]- , [ Para [ Str "Two" ] ]- , [ Para [ Str "Three" ] ]- , [ Para [ Str "First" ] ]- , [ Para [ Str "Second" ] ]- , [ Para [ Str "Third" ] ]- , [ Para [ Str "One" ] ]+ ]+ , Para [ Str "and using spaces:" ]+ , OrderedList+ ( 1 , Decimal , Period )+ [ [ Para [ Str "One" ] ] , [ Para [ Str "Two" ] ] , [ Para [ Str "Three" ] ]- , [ Para [ Str "Item 1, graf one." ]+ ]+ , Para [ Str "Multiple paragraphs:" ]+ , OrderedList+ ( 1 , Decimal , Period )+ [ [ Para [ Str "Item 1, graf one." ] , Para [ Str "Item 1. graf two. The quick brown fox jumped over the lazy dog\8217s back."@@ -211,18 +243,23 @@ ] ] ]+ , Para [ Str "Here\8217s another:" ] , OrderedList ( 1 , Decimal , Period )- [ [ Para [ Str "First" ] ]- , [ Para [ Str "Second:" ]+ [ [ Plain [ Str "First" ] ]+ , [ Plain [ Str "Second:" ] , BulletList [ [ Plain [ Str "Fee" ] ] , [ Plain [ Str "Fie" ] ] , [ Plain [ Str "Foe" ] ] ] ]- , [ Para [ Str "Third" ] ]- , [ Para [ Str "First" ] ]+ , [ Plain [ Str "Third" ] ]+ ]+ , Para [ Str "Same thing but with paragraphs:" ]+ , OrderedList+ ( 1 , Decimal , Period )+ [ [ Para [ Str "First" ] ] , [ Para [ Str "Second:" ] , BulletList [ [ Plain [ Str "Fee" ] ]@@ -287,6 +324,7 @@ ] ] ]+ , Para [ Str "Nesting:" ] , OrderedList ( 1 , UpperAlpha , Period ) [ [ Plain [ Str "Upper Alpha" ]@@ -308,6 +346,7 @@ ] ] ]+ , Para [ Str "Autonumbering:" ] , OrderedList ( 1 , Decimal , Period ) [ [ Plain [ Str "Autonumber." ] ]@@ -317,6 +356,8 @@ [ [ Plain [ Str "Nested." ] ] ] ] ]+ , Para [ Str "Should not be a list item:" ]+ , Para [ Str "M.A.\160\&2007" ] , OrderedList ( 2 , UpperAlpha , Period ) [ [ Plain [ Str "Williams" ] ] ]@@ -331,16 +372,33 @@ [ Header 1 ( "" , [] , [] ) [ Str "Definition Lists" ] , Para [ Str "Tight using spaces:" ] , DefinitionList+ [ ( [ Str "apple" ] , [ [ Plain [ Str "red fruit" ] ] ] )+ , ( [ Str "orange" ]+ , [ [ Plain [ Str "orange fruit" ] ] ]+ )+ , ( [ Str "banana" ]+ , [ [ Plain [ Str "yellow fruit" ] ] ]+ )+ ]+ , Para [ Str "Tight using tabs:" ]+ , DefinitionList+ [ ( [ Str "apple" ] , [ [ Plain [ Str "red fruit" ] ] ] )+ , ( [ Str "orange" ]+ , [ [ Plain [ Str "orange fruit" ] ] ]+ )+ , ( [ Str "banana" ]+ , [ [ Plain [ Str "yellow fruit" ] ] ]+ )+ ]+ , Para [ Str "Loose:" ]+ , DefinitionList [ ( [ Str "apple" ] , [ [ Para [ Str "red fruit" ] ] ] ) , ( [ Str "orange" ] , [ [ Para [ Str "orange fruit" ] ] ] ) , ( [ Str "banana" ] , [ [ Para [ Str "yellow fruit" ] ] ] )- , ( [ Str "apple" ] , [ [ Para [ Str "red fruit" ] ] ] )- , ( [ Str "orange" ] , [ [ Para [ Str "orange fruit" ] ] ] )- , ( [ Str "banana" ] , [ [ Para [ Str "yellow fruit" ] ] ] )- , ( [ Str "apple" ] , [ [ Para [ Str "red fruit" ] ] ] )- , ( [ Str "orange" ] , [ [ Para [ Str "orange fruit" ] ] ] )- , ( [ Str "banana" ] , [ [ Para [ Str "yellow fruit" ] ] ] )- , ( [ Emph [ Str "apple" ] ]+ ]+ , Para [ Str "Multiple blocks with italics:" ]+ , DefinitionList+ [ ( [ Emph [ Str "apple" ] ] , [ [ Para [ Str "red fruit" ] , Para [ Str "contains seeds, crisp, pleasant to taste" ]@@ -364,13 +422,22 @@ , ( [ Str "orange" ] , [ [ Para [ Str "orange fruit" ] , Para [ Str "bank" ] ] ] )- , ( [ Str "apple" ]+ ]+ , Para [ Str "Multiple definitions, loose:" ]+ , DefinitionList+ [ ( [ Str "apple" ] , [ [ Para [ Str "red fruit" ] , Para [ Str "computer" ] ] ] ) , ( [ Str "orange" ] , [ [ Para [ Str "orange fruit" ] , Para [ Str "bank" ] ] ] )- , ( [ Str "apple" ]+ ]+ , Para+ [ Str+ "Blank line after term, indented marker, alternate markers:"+ ]+ , DefinitionList+ [ ( [ Str "apple" ] , [ [ Para [ Str "red fruit" ] , Para [ Str "computer" ] ] ] ) , ( [ Str "orange" ]@@ -582,12 +649,12 @@ [ Header 1 ( "" , [] , [] ) [ Str "LaTeX" ] , BulletList [ []- , [ Para [ Math InlineMath "2+2=4" ] ]- , [ Para [ Math InlineMath "x \\in y" ] ]- , [ Para [ Math InlineMath "\\alpha \\wedge \\omega" ] ]- , [ Para [ Math InlineMath "223" ] ]- , [ Para [ Math InlineMath "p" , Str "-Tree" ] ]- , [ Para+ , [ Plain [ Math InlineMath "2+2=4" ] ]+ , [ Plain [ Math InlineMath "x \\in y" ] ]+ , [ Plain [ Math InlineMath "\\alpha \\wedge \\omega" ] ]+ , [ Plain [ Math InlineMath "223" ] ]+ , [ Plain [ Math InlineMath "p" , Str "-Tree" ] ]+ , [ Plain [ Str "Here\8217s some display math:" , SoftBreak , Math@@ -595,19 +662,22 @@ "\\frac{d}{dx}f(x)=\\lim_{h\\to 0}\\frac{f(x+h)-f(x)}{h}" ] ]- , [ Para+ , [ Plain [ Str "Here\8217s one that has a line break in it: " , Math InlineMath "\\alpha + \\omega \\times x^2" , Str "." ] ]- , [ Para+ ]+ , Para [ Str "These shouldn\8217t be math:" ]+ , BulletList+ [ [ Plain [ Str "To get the famous equation, write " , Code ( "" , [] , [] ) "$e = mc^2$" , Str "." ] ]- , [ Para+ , [ Plain [ Str "$22,000 is a " , Emph [ Str "lot" ] , Str " of money. So is $34,000. (It worked if "@@ -617,8 +687,8 @@ , Str "emphasized.)" ] ]- , [ Para [ Str "Shoes ($20) and socks ($5)." ] ]- , [ Para+ , [ Plain [ Str "Shoes ($20) and socks ($5)." ] ]+ , [ Plain [ Str "Escaped " , Code ( "" , [] , [] ) "$" , Str ": $73 "@@ -627,6 +697,7 @@ ] ] ]+ , Para [ Str "Here\8217s a LaTeX table:" ] , HorizontalRule ] , Div@@ -643,6 +714,27 @@ , [ Plain [ Str "set membership: \8712" ] ] , [ Plain [ Str "copyright: \169" ] ] ]+ , Para [ Str "AT&T has an ampersand in their name." ]+ , Para [ Str "AT&T is another way to write it." ]+ , Para [ Str "This & that." ]+ , Para [ Str "4 < 5." ]+ , Para [ Str "6 > 5." ]+ , Para [ Str "Backslash: \\" ]+ , Para [ Str "Backtick: `" ]+ , Para [ Str "Asterisk: *" ]+ , Para [ Str "Underscore: _" ]+ , Para [ Str "Left brace: {" ]+ , Para [ Str "Right brace: }" ]+ , Para [ Str "Left bracket: [" ]+ , Para [ Str "Right bracket: ]" ]+ , Para [ Str "Left paren: (" ]+ , Para [ Str "Right paren: )" ]+ , Para [ Str "Greater-than: >" ]+ , Para [ Str "Hash: #" ]+ , Para [ Str "Period: ." ]+ , Para [ Str "Bang: !" ]+ , Para [ Str "Plus: +" ]+ , Para [ Str "Minus: -" ] , HorizontalRule ] , Div@@ -858,6 +950,13 @@ ] , [ Plain [ Str "It should." ] ] ]+ , Para+ [ Str "An e-mail address: "+ , Link+ ( "" , [ "email" ] , [] )+ [ Str "nobody@nowhere.net" ]+ ( "mailto:nobody@nowhere.net" , "" )+ ] , BlockQuote [ Para [ Str "Blockquoted: "@@ -981,6 +1080,10 @@ , Note [ Para [ Str "In list." ] ] ] ]+ ]+ , Para+ [ Str+ "This paragraph should not be part of the note, as it is not indented." ] ] ]
test/tables.typst view
@@ -1,149 +1,149 @@ Simple table with caption: #figure(-align(center)[#table(- columns: 4,- align: (col, row) => (right,left,center,auto,).at(col),- inset: 6pt,- [Right], [Left], [Center], [Default],- [12],- [12],- [12],- [12],- [123],- [123],- [123],- [123],- [1],- [1],- [1],- [1],-)]-, caption: [Demonstration of simple table syntax.]-)+ align(center)[#table(+ columns: 4,+ align: (col, row) => (right,left,center,auto,).at(col),+ [Right], [Left], [Center], [Default],+ [12],+ [12],+ [12],+ [12],+ [123],+ [123],+ [123],+ [123],+ [1],+ [1],+ [1],+ [1],+ )]+ , caption: [Demonstration of simple table syntax.]+ , kind: table+ ) Simple table without caption: #figure(-align(center)[#table(- columns: 4,- align: (col, row) => (right,left,center,auto,).at(col),- inset: 6pt,- [Right], [Left], [Center], [Default],- [12],- [12],- [12],- [12],- [123],- [123],- [123],- [123],- [1],- [1],- [1],- [1],-)]-)+ align(center)[#table(+ columns: 4,+ align: (col, row) => (right,left,center,auto,).at(col),+ [Right], [Left], [Center], [Default],+ [12],+ [12],+ [12],+ [12],+ [123],+ [123],+ [123],+ [123],+ [1],+ [1],+ [1],+ [1],+ )]+ , kind: table+ ) Simple table indented two spaces: #figure(-align(center)[#table(- columns: 4,- align: (col, row) => (right,left,center,auto,).at(col),- inset: 6pt,- [Right], [Left], [Center], [Default],- [12],- [12],- [12],- [12],- [123],- [123],- [123],- [123],- [1],- [1],- [1],- [1],-)]-, caption: [Demonstration of simple table syntax.]-)+ align(center)[#table(+ columns: 4,+ align: (col, row) => (right,left,center,auto,).at(col),+ [Right], [Left], [Center], [Default],+ [12],+ [12],+ [12],+ [12],+ [123],+ [123],+ [123],+ [123],+ [1],+ [1],+ [1],+ [1],+ )]+ , caption: [Demonstration of simple table syntax.]+ , kind: table+ ) Multiline table with caption: #figure(-align(center)[#table(- columns: 4,- align: (col, row) => (center,left,right,left,).at(col),- inset: 6pt,- [Centered Header], [Left Aligned], [Right Aligned], [Default aligned],- [First],- [row],- [12.0],- [Example of a row that spans multiple lines.],- [Second],- [row],- [5.0],- [Here’s another one. Note the blank line between rows.],-)]-, caption: [Here’s the caption. It may span multiple lines.]-)+ align(center)[#table(+ columns: 4,+ align: (col, row) => (center,left,right,left,).at(col),+ [Centered Header], [Left Aligned], [Right Aligned], [Default aligned],+ [First],+ [row],+ [12.0],+ [Example of a row that spans multiple lines.],+ [Second],+ [row],+ [5.0],+ [Here’s another one. Note the blank line between rows.],+ )]+ , caption: [Here’s the caption. It may span multiple lines.]+ , kind: table+ ) Multiline table without caption: #figure(-align(center)[#table(- columns: 4,- align: (col, row) => (center,left,right,left,).at(col),- inset: 6pt,- [Centered Header], [Left Aligned], [Right Aligned], [Default aligned],- [First],- [row],- [12.0],- [Example of a row that spans multiple lines.],- [Second],- [row],- [5.0],- [Here’s another one. Note the blank line between rows.],-)]-)+ align(center)[#table(+ columns: 4,+ align: (col, row) => (center,left,right,left,).at(col),+ [Centered Header], [Left Aligned], [Right Aligned], [Default aligned],+ [First],+ [row],+ [12.0],+ [Example of a row that spans multiple lines.],+ [Second],+ [row],+ [5.0],+ [Here’s another one. Note the blank line between rows.],+ )]+ , kind: table+ ) Table without column headers: #figure(-align(center)[#table(- columns: 4,- align: (col, row) => (right,left,center,right,).at(col),- inset: 6pt,- [12],- [12],- [12],- [12],- [123],- [123],- [123],- [123],- [1],- [1],- [1],- [1],-)]-)+ align(center)[#table(+ columns: 4,+ align: (col, row) => (right,left,center,right,).at(col),+ [12],+ [12],+ [12],+ [12],+ [123],+ [123],+ [123],+ [123],+ [1],+ [1],+ [1],+ [1],+ )]+ , kind: table+ ) Multiline table without column headers: #figure(-align(center)[#table(- columns: 4,- align: (col, row) => (center,left,right,auto,).at(col),- inset: 6pt,- [First],- [row],- [12.0],- [Example of a row that spans multiple lines.],- [Second],- [row],- [5.0],- [Here’s another one. Note the blank line between rows.],-)]-)+ align(center)[#table(+ columns: 4,+ align: (col, row) => (center,left,right,auto,).at(col),+ [First],+ [row],+ [12.0],+ [Example of a row that spans multiple lines.],+ [Second],+ [row],+ [5.0],+ [Here’s another one. Note the blank line between rows.],+ )]+ , kind: table+ )
test/writer.typst view
@@ -15,6 +15,10 @@ .join() } +#set table(+ inset: 6pt+)+ #let conf( title: none, authors: (),@@ -780,13 +784,13 @@ <images> From "Voyage dans la Lune" by Georges Melies (1902): -#figure([#box(width: 150.0pt, image("lalune.jpg"));],+#figure(image("lalune.jpg"), caption: [ lalune ] ) -Here is a movie #box(width: 20.0pt, image("movie.jpg")) icon.+Here is a movie #box(image("movie.jpg")) icon. #horizontalrule