pandoc-crossref 0.3.12.2 → 0.3.13.0
raw patch · 42 files changed
+2647/−464 lines, 42 filesdep −roman-numeralsdep ~criteriondep ~mtldep ~optparse-applicativePVP ok
version bump matches the API change (PVP)
Dependencies removed: roman-numerals
Dependency ranges changed: criterion, mtl, optparse-applicative, pandoc, pandoc-types, text
API changes (from Hackage documentation)
Files
- CHANGELOG.md +30/−0
- docs/index.md +97/−9
- lib-internal/Text/Numeral/Roman.hs +145/−0
- lib-internal/Text/Pandoc/CrossRef/References.hs +2/−2
- lib-internal/Text/Pandoc/CrossRef/References/Blocks.hs +24/−28
- lib-internal/Text/Pandoc/CrossRef/References/List.hs +3/−3
- lib-internal/Text/Pandoc/CrossRef/References/Refs.hs +9/−12
- lib-internal/Text/Pandoc/CrossRef/References/Types.hs +2/−2
- lib-internal/Text/Pandoc/CrossRef/Util/CodeBlockCaptions.hs +2/−2
- lib-internal/Text/Pandoc/CrossRef/Util/CustomLabels.hs +3/−3
- lib-internal/Text/Pandoc/CrossRef/Util/Meta.hs +4/−5
- lib-internal/Text/Pandoc/CrossRef/Util/ModifyMeta.hs +3/−3
- lib-internal/Text/Pandoc/CrossRef/Util/Options.hs +6/−2
- lib-internal/Text/Pandoc/CrossRef/Util/Settings.hs +24/−6
- lib-internal/Text/Pandoc/CrossRef/Util/Settings/Gen.hs +2/−2
- lib-internal/Text/Pandoc/CrossRef/Util/Settings/Template.hs +8/−7
- lib-internal/Text/Pandoc/CrossRef/Util/Template.hs +25/−14
- lib-internal/Text/Pandoc/CrossRef/Util/Util.hs +8/−9
- lib/Text/Pandoc/CrossRef.hs +3/−3
- licenses/LICENSE.roman-numerals +31/−0
- pandoc-crossref.cabal +19/−15
- src/ManData.hs +3/−3
- src/pandoc-crossref.hs +9/−9
- test/demo-chapters.inc +1054/−114
- test/demo.inc +1022/−114
- test/m2m/delim/expect.md +4/−4
- test/m2m/eqnBlockTemplate/expect.md +3/−0
- test/m2m/eqnBlockTemplate/expect.tex +1/−0
- test/m2m/eqnBlockTemplate/input.md +7/−0
- test/m2m/equationNumberLaTeX/input.md +1/−0
- test/m2m/equations-auto/expect.md +9/−9
- test/m2m/equations-tables-auto/expect.md +32/−32
- test/m2m/equations-tables/expect.md +16/−16
- test/m2m/equations/expect.md +4/−4
- test/m2m/links-names/expect.md +4/−4
- test/m2m/links/expect.md +4/−4
- test/m2m/multiple-eqn-same-para/expect.md +1/−1
- test/m2m/secLabels/expect.tex +5/−5
- test/m2m/setLabelAttribute/expect.md +1/−1
- test/m2m/setLabelAttribute/expect.tex +5/−5
- test/test-integrative.hs +1/−1
- test/test-pandoc-crossref.hs +11/−11
CHANGELOG.md view
@@ -1,3 +1,33 @@+## 0.3.13.0++### Main changes++- More flexible equation templates++ See [the documentation](https://lierdakil.github.io/pandoc-crossref/#equation-templates).++ **NOTICE**: Breaking change. If you're using `equationNumberTeX`, now+ `eqnIndexTemplate` gets applied to the index. Besides, the special handling+ of `qquad` is removed. TL;DR: if using `equationNumberTeX`, add `eqnIndexTemplate: $$i$$` to your metadata.++ Also note that the default behaviour is changed slightly, curly braces are added around the equation index. This shouldn't affect the rendered result, but if you need to restore the old behaviour, set `eqnInlineTemplate` as follows:++ ```yaml+ eqnInlineTemplate: $$e$$$$equationNumberTeX$$ $$i$$+ ```++- Bump minimal pandoc version to 2.18++ Pandoc 2.18 changed some formatting, so tests are only compatible with+ pandoc 2.18, hence the version bump. In a pinch, you can build with older+ pandoc by using cabal's/stack's `--allow-newer` flag.++### Genreal Maintenance++- Vendor (modified) roman-numerals library+- Update tests for pandoc 5f0bfd41 (hseg, PR 348)+- Complete purge of pandoc-citeproc references (gesh, PR #302)+ ## 0.3.12.2 - Make section numbering more consistent with pandoc
docs/index.md view
@@ -37,10 +37,6 @@ pandoc -F pandoc-crossref --citeproc file.md -o file.html -or-- pandoc -F pandoc-crossref -F pandoc-citeproc file.md -o file.html- ## Note on leading/trailing spaces in metadata options Leading and trailing spaces in YAML metadata will most likely be@@ -202,14 +198,21 @@ If you want to use tables instead, use `tableEqns` option. Depending on output format, tables might work better or worse than `\qquad`. -Alternatively, for formats that support it, you can use arbitrary LaTeX command accepting a single argument (that is, label text) for typesetting. A common example is `\tag`. Use `equationNumberTeX` metadata variable for that (set to special value `qquad` by default). For instance, to use `\tag`, you would have the following in your metadata:+Alternatively, for formats that support it, you can use arbitrary LaTeX command accepting a single argument (that is, label text) for typesetting. A common example is `\tag`. Use `equationNumberTeX` metadata variable for that (set to `\qquad` by default). +Beware that `eqnIndexTemplate` gets applied first, so you'll likely want to set it to plain index as well.++For instance, to use `\tag`, you would have the following in your metadata:+ ```yaml equationNumberTeX: \\tag+eqnIndexTemplate: $$i$$ ``` -This option doesn't affect LaTeX output (which offloads numbering to the LaTeX engine).+These options don't affect LaTeX output (which offloads numbering to the LaTeX engine). +For advanced usage, see `eqnInlineTemplate`, `eqnBlockTemplate`.+ ## Table labels ``` markdown@@ -512,12 +515,13 @@ equations (i.e. ones defined using `$$...$$`/`\[...\]`). Note that you won't be able to reference equations without explicit labels. - `tableEqns`, default `false`: Typeset equations and equation numbers- in tables instead of embedding numbers into equations themselves.+ as blocks instead of embedding numbers into equations themselves. Depending on output format, this might work better or worse.+ See also the section on [equation templates](#equation-templates). - `setLabelAttribute`, default `false`: set `label` attribute on objects to actual number used for referencing. This can be useful for post-processing.-- `equationNumberTeX`, default `qquad`: use a LaTeX command for typesetting- equation numbers. Bear in mind, `qquad` is a special value; generally, you'll want to write out a full command, backslash and all. Also remember that metadata is parsed as Markdown, so you may need to escape backslashes.+- `equationNumberTeX`, default `\\qquad`: use a LaTeX command for typesetting+ equation numbers. Remember that metadata is parsed as Markdown, so you may need to escape backslashes. This option doesn't affect LaTeX output (which offloads numbering to the LaTeX engine). ### Item title format@@ -654,6 +658,56 @@ - `ccsTemplate`, default `$$i$$$$ccsLabelSep$$$$t$$`: template for collected subfigure captions. +#### Equation templates++- `eqnIndexTemplate`, default `($$i$$)`: used to adjust how equation index+ is rendered. This is required due to it being rendered inside a math block.+ Note that for the same reason formatting is mostly ignored.++- `eqnInlineTemplate`, default `$$e$$$$equationNumberTeX$${$$i$$}`++ A template to typeset math when `tableEqns` is `false`. Similar to `eqnIndexTemplate`, formatting is mostly ignored, due to it being typeset+ inside a display math environment. However, most LaTeX should work (but backslashes need to be doubled). The following template variables are known:++ - `ri`, "raw" index, before applying `eqnIndexTemplate`+ - `i`, index after applying `eqnIndexTemplate`+ - `e`, the equation itself++ `eqnInlineTemplate` is ignored if `tableEqns` is `true`.++- `eqnBlockTemplate`, default++ ```markdown+ +:--------------------------------------------------------------:+-----:++ | $$t$$ | ```{=openxml}+ | | <w:tcPr><w:vAlign w:val="center"/></w:tcPr>+ | | ```+ | | $$i$$+ +----------------------------------------------------------------+-----++ ```++ When used with `tableEqns`, a block to use to format equations. A table+ by default, but could be literally any block. `$$t$$` stands in for the+ equation itself, and `$$i$$` stands in for the equation number.++ Note that the default contains a raw block to fix vertical alignment+ in docx output. If you're not targeting docx, it will be ignored by pandoc.++ `eqnBlockTemplate` is ignored if `tableEqns` is `false` (the default).++- `eqnBlockInlineMath`, default `False`: if you need to use+ inline math while rendering equation block template. Useful, e.g., if you're+ using raw ooxml and tabstops to align equations in docx. For example,++ ```yaml+ tableEqns: true+ eqnBlockTemplate: |+ `<w:pPr><w:tabs><w:tab w:val="center" w:leader="none" w:pos="4680" /><w:tab w:val="right" w:leader="none" w:pos="9360" /></w:tabs></w:pPr><w:r><w:tab /></w:r>`{=openxml} $$t$$ `<w:r><w:tab /></w:r>`{=openxml} $$i$$+ eqnBlockInlineMath: true+ ```++ (tweak `w:pos` for the two tabstops to taste, the unit is 1/20th of an inch, sample values are appropriate for portrait A4 with 1-inch margins)+ ### Reference templates See [Templates](#templates)@@ -852,3 +906,37 @@ under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.++This program includes code from roman-numerals library, covered by the following terms:++> Copyright 2009–2014 Roel van Dijk+>+> All rights reserved.+>+> Redistribution and use in source and binary forms, with or without+> modification, are permitted provided that the following conditions are+> met:+>+> * Redistributions of source code must retain the above copyright+> notice, this list of conditions and the following disclaimer.+>+> * Redistributions in binary form must reproduce the above+> copyright notice, this list of conditions and the following+> disclaimer in the documentation and/or other materials provided+> with the distribution.+>+> * The names of contributors may not be used to endorse or promote+> products derived from this software without specific prior+> written permission.+>+> THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS+> "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT+> LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR+> A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT+> OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,+> SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT+> LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,+> DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY+> THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT+> (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE+> OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ lib-internal/Text/Numeral/Roman.hs view
@@ -0,0 +1,145 @@+{-+pandoc-crossref is a pandoc filter for numbering figures,+equations, tables and cross-references to them.+Copyright 2009–2014 Roel van Dijk+Copyright 2022 Nikolay Yakimov <root@livid.pp.ru>++This program is free software; you can redistribute it and/or modify+it under the terms of the GNU General Public License as published by+the Free Software Foundation; either version 2 of the License, or+(at your option) any later version.++This program is distributed in the hope that it will be useful,+but WITHOUT ANY WARRANTY; without even the implied warranty of+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+GNU General Public License for more details.++You should have received a copy of the GNU General Public License along+with this program; if not, write to the Free Software Foundation, Inc.,+51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.++This file contains code covered by the license found in licenses/LICENSE.roman-numerals+-}++{-# LANGUAGE FlexibleContexts #-}+{-# LANGUAGE OverloadedStrings #-}++{-| Parsing and pretty printing of Roman numerals.++This module provides functions for parsing and pretty printing Roman+numerals. Because the notation of Roman numerals has varied through+the centuries this package allows for some customisation using a+configuration that is passed to the conversion functions.++Example:++>>> toRoman 1729 :: String+"MDCCXXIX"++>>> fromRoman "MDCCXXIX" :: Maybe Integer+Just 1729++>>> fromRoman "Bla" :: Maybe Integer+Nothing+-}+module Text.Numeral.Roman+ ( -- * Types+ NumeralConfig+ , mkNumConfig++ -- * Pretty printing+ , convertTo++ -- * Parsing+ , convertFrom++ -- * Default Configurations+ , modernRoman++ -- * Utility+ , toRoman+ , fromRoman+ ) where++import Control.Monad (mzero)+import Data.Function (on)+import Data.List (sortBy)+import qualified Data.Text as T (Text, null, stripPrefix)+import Data.Text.Internal.Builder+import qualified Data.Text.Lazy as TL (toStrict)++-- |A configuration with which the 'convertTo' and 'convertFrom' functions can+-- be parameterized.+data NumeralConfig n = NC+ { -- |Symbol to represent the value 0.+ ncZero :: T.Text+ -- |A table of symbols and their numerical values. The table must be+ -- ordered in descending order of the value of the symbols. If any symbol+ -- is the empty string then 'convertFrom' will be ⊥.+ , ncTable :: [(T.Text, n)]+ }++-- |Smart constructor for a 'NumeralConfig'.+mkNumConfig :: (Ord n, Num n)+ => T.Text -- ^Symbol for zero+ -> T.Text -- ^Symbol for one+ -> [(T.Text, n)] -- ^ Symbol-value table.+ -> NumeralConfig n+mkNumConfig z o tab =+ NC { ncZero = z, ncTable = sortBy (flip compare `on` snd) ((o, 1) : tab) }++-- |Converts a number to a Roman numeral according to the given configuration.+convertTo :: (Ord n, Num n) => NumeralConfig n -> n -> T.Text+convertTo nc n | n == 0 = ncZero nc+ | otherwise = TL.toStrict $ toLazyText $ go n $ ncTable nc+ where+ go _ [] = error "Roman.convertTo: out of symbols (BUG)"+ go i tab@(~(sym, val) : ts) | i <= 0 = mempty+ | i >= val = fromText sym <> go (i - val) tab+ | otherwise = go i ts+++-- |Parses a string as a Roman numeral according to the given+-- configuration. Result is 'Nothing' if the input is not a valid numeral.+convertFrom :: (Ord n, Num n) => NumeralConfig n -> T.Text -> Maybe n+convertFrom nc s+ | ncZero nc == s = return 0+ | otherwise = do+ n <- go 0 (ncTable nc) s+ if s == convertTo nc n then return n else mzero+ where+ go n _ x | T.null x = return n+ go _ [] _ = mzero+ go n tab@((sym, val) : ts) x =+ maybe (go n ts x) (go (n + val) tab) $ T.stripPrefix sym x++-- |Configuration for Roman numerals as they are commonly used today. The value+-- 0 is represented by the empty string. It can be interpreted as not writing+-- down a number. This configuration is practically limited to the range+-- [1..3999]. Smaller numbers will result in an empty string. Larger numbers+-- will result in repeated use of the \'M\' symbol.+modernRoman :: (Ord n, Num n) => NumeralConfig n+modernRoman = mkNumConfig+ ""+ "I"+ [ ("IV", 4)+ , ("V" , 5)+ , ("IX", 9)+ , ("X" , 10)+ , ("XL", 40)+ , ("L" , 50)+ , ("XC", 90)+ , ("C" , 100)+ , ("CD", 400)+ , ("D" , 500)+ , ("CM", 900)+ , ("M" , 1000)+ ]++-- |Converts a number to a modern Roman numeral.+toRoman :: (Ord n, Num n) => n -> T.Text+toRoman = convertTo modernRoman++-- |Parses a string as a modern Roman numeral.+fromRoman :: (Ord n, Num n) => T.Text -> Maybe n+fromRoman = convertFrom modernRoman
lib-internal/Text/Pandoc/CrossRef/References.hs view
@@ -20,7 +20,7 @@ module Text.Pandoc.CrossRef.References ( module X ) where -import Text.Pandoc.CrossRef.References.Types as X import Text.Pandoc.CrossRef.References.Blocks as X (replaceAll)-import Text.Pandoc.CrossRef.References.Refs as X import Text.Pandoc.CrossRef.References.List as X+import Text.Pandoc.CrossRef.References.Refs as X+import Text.Pandoc.CrossRef.References.Types as X
lib-internal/Text/Pandoc/CrossRef/References/Blocks.hs view
@@ -18,31 +18,30 @@ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -} -{-# LANGUAGE Rank2Types, OverloadedStrings #-}+{-# LANGUAGE Rank2Types, OverloadedStrings, FlexibleContexts #-} module Text.Pandoc.CrossRef.References.Blocks ( replaceAll ) where -import Text.Pandoc.Definition-import qualified Text.Pandoc.Builder as B-import Text.Pandoc.Shared (stringify, blocksToInlines)-import Text.Pandoc.Walk (walk) import Control.Monad.State hiding (get, modify) import Data.List-import Data.Maybe import qualified Data.Map as M+import Data.Maybe import qualified Data.Text as T import qualified Data.Text.Read as T+import qualified Text.Pandoc.Builder as B+import Text.Pandoc.Definition+import Text.Pandoc.Shared (blocksToInlines, stringify)+import Text.Pandoc.Walk (walk) -import Text.Pandoc.CrossRef.References.Types-import Text.Pandoc.CrossRef.Util.Util-import Text.Pandoc.CrossRef.Util.Options-import Text.Pandoc.CrossRef.Util.Template import Control.Applicative-import Prelude import Data.Default import Lens.Micro import Lens.Micro.Mtl+import Text.Pandoc.CrossRef.References.Types+import Text.Pandoc.CrossRef.Util.Options+import Text.Pandoc.CrossRef.Util.Template+import Text.Pandoc.CrossRef.Util.Util replaceAll :: (Data a) => Options -> a -> WS a replaceAll opts =@@ -289,29 +288,26 @@ , tableEqns opts = do (eq', idxStr) <- replaceEqn opts sattrs eq- replaceNoRecurse $ Div (label,cls,setLabel opts idxStr attrs) [- simpleTable [AlignCenter, AlignRight] [ColWidth 0.9, ColWidth 0.09]- [[[Plain [Math DisplayMath eq']], [eqnNumber $ stringify idxStr]]]]- where- eqnNumber idx- | outFormat opts == Just (Format "docx")- = Div nullAttr [- RawBlock (Format "openxml") "<w:tcPr><w:vAlign w:val=\"center\"/></w:tcPr>"- , mathIdx- ]- | otherwise = mathIdx- where mathIdx = Plain [Math DisplayMath $ "(" <> idx <> ")"]+ let mathfmt = if eqnBlockInlineMath opts then InlineMath else DisplayMath+ replaceNoRecurse $ Div (label,cls,setLabel opts idxStr attrs) $+ applyTemplate [Math mathfmt $ stringify idxStr] [Math mathfmt eq']+ $ eqnBlockTemplate opts replaceBlock _ _ = noReplaceRecurse replaceEqn :: Options -> Attr -> T.Text -> WS (T.Text, [Inline]) replaceEqn opts (label, _, attrs) eq = do let label' | T.null label = Left "eq" | otherwise = Right label- idxStr <- replaceAttr opts label' (lookup "label" attrs) [] eqnRefs- let eq' | tableEqns opts = eq- | equationNumberTeX opts == "qquad" = eq<>"\\qquad("<>idxTxt<>")"- | otherwise = eq<>equationNumberTeX opts<>"{"<>idxTxt<>"}"- idxTxt = stringify idxStr+ idxStrRaw <- replaceAttr opts label' (lookup "label" attrs) [] eqnRefs+ let idxStr = applyTemplate' (M.fromDistinctAscList [("i", idxStrRaw)]) $ eqnIndexTemplate opts+ eqTxt = applyTemplate' eqTxtVars $ eqnInlineTemplate opts :: [Inline]+ eqTxtVars = M.fromDistinctAscList+ [ ("e", [Str eq])+ , ("i", idxStr)+ , ("ri", idxStrRaw)+ ]+ eq' | tableEqns opts = eq+ | otherwise = stringify eqTxt return (eq', idxStr) replaceInlineMany :: Options -> [Inline] -> WS (ReplacedResult [Inline])
lib-internal/Text/Pandoc/CrossRef/References/List.hs view
@@ -21,16 +21,16 @@ {-# LANGUAGE OverloadedStrings #-} module Text.Pandoc.CrossRef.References.List (listOf) where -import Text.Pandoc.Definition import Control.Arrow import Data.List import qualified Data.Map as M import qualified Data.Text as T+import Text.Pandoc.Definition +import Lens.Micro.Mtl import Text.Pandoc.CrossRef.References.Types-import Text.Pandoc.CrossRef.Util.Util import Text.Pandoc.CrossRef.Util.Options-import Lens.Micro.Mtl+import Text.Pandoc.CrossRef.Util.Util listOf :: Options -> [Block] -> WS [Block] listOf Options{outFormat=f} x | isLatexFormat f = return x
lib-internal/Text/Pandoc/CrossRef/References/Refs.hs view
@@ -21,26 +21,23 @@ {-# LANGUAGE OverloadedStrings #-} module Text.Pandoc.CrossRef.References.Refs (replaceRefs) where -import Text.Pandoc.Definition-import Text.Pandoc.Builder+import Control.Arrow as A import Control.Monad.State hiding (get, modify)+import Data.Function import Data.List import qualified Data.List.HT as HT-import qualified Data.Text as T-import Data.Maybe-import Data.Function import qualified Data.Map as M-import Control.Arrow as A+import Data.Maybe+import qualified Data.Text as T+import Text.Pandoc.Builder -import Text.Pandoc.CrossRef.References.Types-import Text.Pandoc.CrossRef.Util.Template-import Text.Pandoc.CrossRef.Util.Util-import Text.Pandoc.CrossRef.Util.Options import Control.Applicative import Debug.Trace-import Prelude-import Lens.Micro import Lens.Micro.Mtl+import Text.Pandoc.CrossRef.References.Types+import Text.Pandoc.CrossRef.Util.Options+import Text.Pandoc.CrossRef.Util.Template+import Text.Pandoc.CrossRef.Util.Util replaceRefs :: Options -> [Inline] -> WS [Inline] replaceRefs opts (Cite cits _:xs)
lib-internal/Text/Pandoc/CrossRef/References/Types.hs view
@@ -21,12 +21,12 @@ {-# LANGUAGE TemplateHaskell #-} module Text.Pandoc.CrossRef.References.Types where -import qualified Data.Map as M-import Text.Pandoc.Definition import Control.Monad.State import Data.Default+import qualified Data.Map as M import Data.Text (Text) import Lens.Micro.TH+import Text.Pandoc.Definition type Index = [(Int, Maybe Text)]
lib-internal/Text/Pandoc/CrossRef/Util/CodeBlockCaptions.hs view
@@ -24,13 +24,13 @@ mkCodeBlockCaptions ) where -import Text.Pandoc.Definition import Data.List (stripPrefix) import Data.Maybe (fromMaybe)+import qualified Data.Text as T import Text.Pandoc.CrossRef.References.Types import Text.Pandoc.CrossRef.Util.Options import Text.Pandoc.CrossRef.Util.Util-import qualified Data.Text as T+import Text.Pandoc.Definition mkCodeBlockCaptions :: Options -> [Block] -> WS [Block] mkCodeBlockCaptions opts x@(cb@(CodeBlock _ _):p@(Para _):xs)
lib-internal/Text/Pandoc/CrossRef/Util/CustomLabels.hs view
@@ -21,10 +21,10 @@ {-# LANGUAGE OverloadedStrings #-} module Text.Pandoc.CrossRef.Util.CustomLabels (customLabel, customHeadingLabel) where -import Text.Pandoc.Definition-import Text.Pandoc.CrossRef.Util.Meta-import Text.Numeral.Roman import qualified Data.Text as T+import Text.Numeral.Roman+import Text.Pandoc.CrossRef.Util.Meta+import Text.Pandoc.Definition customLabel :: Meta -> T.Text -> Int -> Maybe T.Text customLabel meta ref i
lib-internal/Text/Pandoc/CrossRef/Util/Meta.hs view
@@ -31,13 +31,12 @@ , tryCapitalizeM ) where -import Text.Pandoc.CrossRef.Util.Util-import Text.Pandoc.Definition-import Text.Pandoc.Builder import Data.Default-import Text.Pandoc.Walk-import Text.Pandoc.Shared hiding (capitalize, toString) import qualified Data.Text as T+import Text.Pandoc.Builder+import Text.Pandoc.CrossRef.Util.Util+import Text.Pandoc.Shared hiding (capitalize)+import Text.Pandoc.Walk getMetaList :: (Default a) => (MetaValue -> a) -> T.Text -> Meta -> Int -> a getMetaList f name meta i = maybe def f $ lookupMeta name meta >>= getList i
lib-internal/Text/Pandoc/CrossRef/Util/ModifyMeta.hs view
@@ -24,13 +24,13 @@ modifyMeta ) where +import Control.Monad.Writer+import qualified Data.Text as T import Text.Pandoc import Text.Pandoc.Builder hiding ((<>))-import Text.Pandoc.CrossRef.Util.Options import Text.Pandoc.CrossRef.Util.Meta+import Text.Pandoc.CrossRef.Util.Options import Text.Pandoc.CrossRef.Util.Util-import qualified Data.Text as T-import Control.Monad.Writer modifyMeta :: Options -> Meta -> Meta modifyMeta opts meta
lib-internal/Text/Pandoc/CrossRef/Util/Options.hs view
@@ -19,9 +19,9 @@ -} module Text.Pandoc.CrossRef.Util.Options (Options(..)) where-import Text.Pandoc.Definition-import Text.Pandoc.CrossRef.Util.Template import Data.Text (Text)+import Text.Pandoc.CrossRef.Util.Template+import Text.Pandoc.Definition data Options = Options { cref :: Bool , chaptersDepth :: Int@@ -40,6 +40,10 @@ , tblPrefixTemplate :: Template , lstPrefixTemplate :: Template , secPrefixTemplate :: Template+ , eqnBlockTemplate :: BlockTemplate+ , eqnBlockInlineMath :: Bool+ , eqnIndexTemplate :: Template+ , eqnInlineTemplate :: Template , refIndexTemplate :: Text -> Template , subfigureRefIndexTemplate :: Template , secHeaderTemplate :: Template
lib-internal/Text/Pandoc/CrossRef/Util/Settings.hs view
@@ -22,16 +22,16 @@ {-# LANGUAGE OverloadedStrings #-} module Text.Pandoc.CrossRef.Util.Settings (getSettings, defaultMeta) where +import Control.Exception (IOException, handle) import Text.Pandoc import Text.Pandoc.Builder-import Control.Exception (handle,IOException) -import Text.Pandoc.CrossRef.Util.Settings.Gen-import Text.Pandoc.CrossRef.Util.Meta+import qualified Data.Text as T import System.Directory import System.FilePath import System.IO-import qualified Data.Text as T+import Text.Pandoc.CrossRef.Util.Meta+import Text.Pandoc.CrossRef.Util.Settings.Gen getSettings :: Maybe Format -> Meta -> IO Meta getSettings fmt meta = do@@ -89,6 +89,22 @@ <> tblPrefixTemplate (var "p" <> str "\160" <> var "i") <> lstPrefixTemplate (var "p" <> str "\160" <> var "i") <> secPrefixTemplate (var "p" <> str "\160" <> var "i")+ <> eqnBlockTemplate (+ table+ emptyCaption+ [(AlignCenter, ColWidth 0.9), (AlignRight, ColWidth 0.1)]+ (TableHead nullAttr [])+ [TableBody nullAttr (RowHeadColumns 0) [] [+ Row nullAttr+ [ simpleCell $ plain (var "t")+ , simpleCell $ wordVerticalAlign <> plain (var "i")+ ]+ ]]+ (TableFoot nullAttr [])+ )+ <> eqnIndexTemplate (str "(" <> var "i" <> ")")+ <> eqnInlineTemplate (var "e" <> var "equationNumberTeX" <> "{" <> var "i" <> "}")+ <> eqnBlockInlineMath False <> refIndexTemplate (var "i" <> var "suf") <> subfigureRefIndexTemplate (var "i" <> var "suf" <> space <> str "(" <> var "s" <> str ")") <> secHeaderTemplate (var "i" <> var "secHeaderDelim[n]" <> var "t")@@ -111,5 +127,7 @@ <> subfigGrid False <> linkReferences False <> nameInLink False- <> equationNumberTeX ("qquad" :: T.Text)- where var = displayMath+ <> equationNumberTeX ("\\qquad" :: T.Text)+ where+ var = displayMath+ wordVerticalAlign = rawBlock "openxml" "<w:tcPr><w:vAlign w:val=\"center\"/></w:tcPr>"
lib-internal/Text/Pandoc/CrossRef/Util/Settings/Gen.hs view
@@ -22,10 +22,10 @@ -- {-# OPTIONS_GHC -ddump-splices #-} module Text.Pandoc.CrossRef.Util.Settings.Gen where -import Text.Pandoc.CrossRef.Util.Settings.Template+import Language.Haskell.TH (mkName) import Text.Pandoc.CrossRef.Util.Meta import Text.Pandoc.CrossRef.Util.Options as O (Options(..))-import Language.Haskell.TH (mkName)+import Text.Pandoc.CrossRef.Util.Settings.Template import Text.Pandoc.Definition nameDeriveSetters ''Options
lib-internal/Text/Pandoc/CrossRef/Util/Settings/Template.hs view
@@ -21,17 +21,16 @@ {-# LANGUAGE TemplateHaskell, RankNTypes, ViewPatterns, MultiWayIf #-} module Text.Pandoc.CrossRef.Util.Settings.Template where -import Text.Pandoc.Definition-import Text.Pandoc.Builder-import Text.Pandoc.CrossRef.Util.Meta+import Data.List import qualified Data.Map as M+import Data.Text (Text)+import qualified Data.Text as T import Language.Haskell.TH hiding (Inline) import Language.Haskell.TH.Syntax hiding (Inline)-import Data.List-import Text.Pandoc.CrossRef.Util.Template+import Text.Pandoc.Builder import Text.Pandoc.CrossRef.Util.CustomLabels-import Data.Text (Text)-import qualified Data.Text as T+import Text.Pandoc.CrossRef.Util.Meta+import Text.Pandoc.CrossRef.Util.Template namedFields :: Con -> [VarStrictType] namedFields (RecC _ fs) = fs@@ -80,6 +79,7 @@ strT <- [t|$(conT t) -> Text|] intT <- [t|$(conT t) -> Int|] tmplT <- [t|$(conT t) -> Template|]+ btmplT <- [t|$(conT t) -> BlockTemplate|] idxTmplT <- [t|$(conT t) -> Text -> Template|] clT <- [t|$(conT t) -> Text -> Int -> Maybe Text|] chlT <- [t|$(conT t) -> Int -> Int -> Maybe Text|]@@ -93,6 +93,7 @@ | t' == inlT -> [|getMetaInlines $(varName) $(dtv)|] | t' == blkT -> [|getMetaBlock $(varName) $(dtv)|] | t' == tmplT -> [|makeTemplate $(dtv) $ getMetaInlines $(varName) $(dtv)|]+ | t' == btmplT -> [|makeTemplate $(dtv) $ getMetaBlock $(varName) $(dtv)|] | t' == idxTmplT -> [|makeIndexedTemplate $(varName) $(dtv)|] | t' == clT -> [|customLabel $(dtv)|] | t' == chlT -> [|customHeadingLabel $(dtv)|]
lib-internal/Text/Pandoc/CrossRef/Util/Template.hs view
@@ -18,29 +18,43 @@ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -} -{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE OverloadedStrings, MultiParamTypeClasses #-} module Text.Pandoc.CrossRef.Util.Template ( Template+ , BlockTemplate , makeTemplate , makeIndexedTemplate , applyTemplate , applyTemplate' ) where -import Text.Pandoc.Definition+import Control.Applicative+import Data.Data+import qualified Data.Map as M hiding (fromList, singleton, toList)+import qualified Data.Text as T import Text.Pandoc.Builder-import Text.Pandoc.Generic-import qualified Data.Map as M hiding (toList, fromList, singleton) import Text.Pandoc.CrossRef.Util.Meta-import Control.Applicative+import Text.Pandoc.Generic import Text.Read-import qualified Data.Text as T type VarFunc = T.Text -> Maybe MetaValue newtype Template = Template (VarFunc -> [Inline])+newtype BlockTemplate = BlockTemplate (VarFunc -> [Block]) -makeTemplate :: Meta -> [Inline] -> Template-makeTemplate dtv xs' = Template $ \vf -> scan (\var -> vf var <|> lookupMeta var dtv) xs'+class Data a => MkTemplate a b where+ mkTemplate :: (VarFunc -> [a]) -> b+ applyTemplate' :: M.Map T.Text [Inline] -> b -> [a]++instance MkTemplate Inline Template where+ mkTemplate = Template+ applyTemplate' vars (Template g) = g (internalVars vars)++instance MkTemplate Block BlockTemplate where+ mkTemplate = BlockTemplate+ applyTemplate' vars (BlockTemplate g) = g (internalVars vars)++makeTemplate :: MkTemplate a b => Meta -> [a] -> b+makeTemplate dtv xs' = mkTemplate $ \vf -> scan (\var -> vf var <|> lookupMeta var dtv) xs' where scan = bottomUp . go go vf (x@(Math DisplayMath var):xs)@@ -68,12 +82,9 @@ Just x -> toInlines name x Nothing -> [] -applyTemplate' :: M.Map T.Text [Inline] -> Template -> [Inline]-applyTemplate' vars (Template g) = g internalVars- where- internalVars x | Just v <- M.lookup x vars = Just $ MetaInlines v- internalVars _ = Nothing+internalVars :: M.Map T.Text [Inline] -> T.Text -> Maybe MetaValue+internalVars vars x = MetaInlines <$> M.lookup x vars -applyTemplate :: [Inline] -> [Inline] -> Template -> [Inline]+applyTemplate :: MkTemplate a b =>[Inline] -> [Inline] -> b -> [a] applyTemplate i t = applyTemplate' (M.fromDistinctAscList [("i", i), ("t", t)])
lib-internal/Text/Pandoc/CrossRef/Util/Util.hs view
@@ -24,19 +24,18 @@ , module Data.Generics ) where -import Text.Pandoc.CrossRef.References.Types-import Text.Pandoc.Definition+import Data.Char (isUpper, toLower, toUpper)+import Data.Default+import Data.Generics+import Data.List (find)+import Data.Maybe (fromMaybe)+import qualified Data.Text as T+import Data.Version import Text.Pandoc.Builder hiding ((<>)) import Text.Pandoc.Class-import Data.Char (toUpper, toLower, isUpper)-import Data.Maybe (fromMaybe)-import Data.Generics+import Text.Pandoc.CrossRef.References.Types import Text.Pandoc.Writers.LaTeX-import Data.Default-import Data.Version-import Data.List (find) import Text.ParserCombinators.ReadP (readP_to_S)-import qualified Data.Text as T intercalate' :: (Eq a, Monoid a, Foldable f) => a -> f a -> a intercalate' s xs
lib/Text/Pandoc/CrossRef.hs view
@@ -80,15 +80,15 @@ , CrossRefEnv(..) ) where -import Control.Monad.State import qualified Control.Monad.Reader as R+import Control.Monad.State import Text.Pandoc import Text.Pandoc.CrossRef.References-import Text.Pandoc.CrossRef.Util.Settings-import Text.Pandoc.CrossRef.Util.Options as O import Text.Pandoc.CrossRef.Util.CodeBlockCaptions import Text.Pandoc.CrossRef.Util.ModifyMeta+import Text.Pandoc.CrossRef.Util.Options as O+import Text.Pandoc.CrossRef.Util.Settings import Text.Pandoc.CrossRef.Util.Settings.Gen as SG -- | Enviromnent for 'CrossRefM'
+ licenses/LICENSE.roman-numerals view
@@ -0,0 +1,31 @@+Copyright 2009–2014 Roel van Dijk++All rights reserved.++Redistribution and use in source and binary forms, with or without+modification, are permitted provided that the following conditions are+met:++ * Redistributions of source code must retain the above copyright+ notice, this list of conditions and the following disclaimer.++ * Redistributions in binary form must reproduce the above+ copyright notice, this list of conditions and the following+ disclaimer in the documentation and/or other materials provided+ with the distribution.++ * The names of contributors may not be used to endorse or promote+ products derived from this software without specific prior+ written permission.++THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
pandoc-crossref.cabal view
@@ -4,10 +4,10 @@ -- -- see: https://github.com/sol/hpack ----- hash: 643ffe23ec490430a946bbeec84db2ff503e9b935182801185089d7fba7cdc3f+-- hash: 284171f1ac9b309f9076827741d8057c87cc91d18ea79b096192c8f9345ae485 name: pandoc-crossref-version: 0.3.12.2+version: 0.3.13.0 synopsis: Pandoc filter for cross-references description: pandoc-crossref is a pandoc filter for numbering figures, equations, tables and cross-references to them. category: Text@@ -22,6 +22,7 @@ test/demo-chapters.inc test/demo.inc CHANGELOG.md+ licenses/LICENSE.roman-numerals data-files: docs/demo/demo.md docs/index.md@@ -34,6 +35,9 @@ test/m2m/emptyChapterLabels/expect.md test/m2m/emptyChapterLabels/expect.tex test/m2m/emptyChapterLabels/input.md+ test/m2m/eqnBlockTemplate/expect.md+ test/m2m/eqnBlockTemplate/expect.tex+ test/m2m/eqnBlockTemplate/input.md test/m2m/equationNumberLaTeX/expect.md test/m2m/equationNumberLaTeX/expect.tex test/m2m/equationNumberLaTeX/input.md@@ -110,14 +114,15 @@ build-depends: base >=4.11 && <5 , mtl >=1.1 && <2.3- , pandoc >=2.10 && <2.18+ , pandoc ==2.18.* , pandoc-crossref-internal- , pandoc-types >=1.21 && <1.23+ , pandoc-types >=1.22.2 && <1.23 , text >=1.2.2 && <1.3 default-language: Haskell2010 library pandoc-crossref-internal exposed-modules:+ Text.Numeral.Roman Text.Pandoc.CrossRef.References Text.Pandoc.CrossRef.References.Blocks Text.Pandoc.CrossRef.References.List@@ -145,9 +150,8 @@ , microlens-mtl >=0.2.0.1 && <0.3.0.0 , microlens-th >=0.4.3.10 && <0.5.0.0 , mtl >=1.1 && <2.3- , pandoc >=2.10 && <2.18- , pandoc-types >=1.21 && <1.23- , roman-numerals ==0.5.*+ , pandoc ==2.18.*+ , pandoc-types >=1.22.2 && <1.23 , syb >=0.4 && <0.8 , template-haskell >=2.7.0.0 && <3.0.0.0 , text >=1.2.2 && <1.3@@ -167,9 +171,9 @@ , gitrev >=1.3.1 && <1.4 , open-browser ==0.2.* , optparse-applicative >=0.13 && <0.17- , pandoc >=2.10 && <2.18+ , pandoc ==2.18.* , pandoc-crossref- , pandoc-types >=1.21 && <1.23+ , pandoc-types >=1.22.2 && <1.23 , template-haskell >=2.7.0.0 && <3.0.0.0 , temporary >=1.2 && <1.4 , text >=1.2.2 && <1.3@@ -186,9 +190,9 @@ , directory >=1 && <1.4 , filepath >=1.1 && <1.5 , hspec >=2.4.4 && <3- , pandoc >=2.10 && <2.18+ , pandoc ==2.18.* , pandoc-crossref- , pandoc-types >=1.21 && <1.23+ , pandoc-types >=1.22.2 && <1.23 , text >=1.2.2 && <1.3 if flag(enable_flaky_tests) cpp-options: -DFLAKY@@ -212,10 +216,10 @@ , hspec >=2.4.4 && <3 , microlens >=0.4.12.0 && <0.5.0.0 , mtl >=1.1 && <2.3- , pandoc >=2.10 && <2.18+ , pandoc ==2.18.* , pandoc-crossref , pandoc-crossref-internal- , pandoc-types >=1.21 && <1.23+ , pandoc-types >=1.22.2 && <1.23 , text >=1.2.2 && <1.3 if flag(enable_flaky_tests) cpp-options: -DFLAKY@@ -232,8 +236,8 @@ build-depends: base >=4.11 && <5 , criterion >=1.5.9.0 && <1.6- , pandoc >=2.10 && <2.18+ , pandoc ==2.18.* , pandoc-crossref- , pandoc-types >=1.21 && <1.23+ , pandoc-types >=1.22.2 && <1.23 , text >=1.2.2 && <1.3 default-language: Haskell2010
src/ManData.hs view
@@ -21,13 +21,13 @@ {-# LANGUAGE TemplateHaskellQuotes, OverloadedStrings #-} module ManData where -import Language.Haskell.TH.Syntax+import Control.DeepSeq+import Data.String import qualified Data.Text as T import qualified Data.Text.IO as T+import Language.Haskell.TH.Syntax import System.IO import qualified Text.Pandoc as P-import Control.DeepSeq-import Data.String import Text.Pandoc.Highlighting (pygments) dataFile :: FilePath
src/pandoc-crossref.hs view
@@ -23,19 +23,19 @@ import Text.Pandoc import Text.Pandoc.JSON -import Text.Pandoc.CrossRef+import Control.Concurrent+import Control.Monad+import qualified Data.Text as T+import qualified Data.Text.IO as T+import Development.GitRev+import ManData import Options.Applicative import qualified Options.Applicative as O-import Control.Monad import System.Environment as Env-import Web.Browser-import System.IO.Temp import System.IO hiding (putStrLn)-import ManData-import Control.Concurrent-import Development.GitRev-import qualified Data.Text as T-import qualified Data.Text.IO as T+import System.IO.Temp+import Text.Pandoc.CrossRef+import Web.Browser import Prelude hiding (putStrLn)
test/demo-chapters.inc view
@@ -1,114 +1,1054 @@- [Para [Str "This",Space,Str "is",Space,Str "a",Space,Str "demo",Space,Str "file",Space,Str "for",Space,Str "pandoc-crossref.",Space,Str "With",Space,Str "this",Space,Str "filter,",Space,Str "you",Space,Str "can",Space,Str "cross-reference",Space,Str "figures",Space,Str "(see",Space,Str "figs.\160\&1.1-1.3),",Space,Str "display",Space,Str "equations",Space,Str "(see",Space,Str "eq.\160\&2.1),",Space,Str "tables",Space,Str "(see",Space,Str "tbl.\160\&3.1)",Space,Str "and",Space,Str "sections",Space,Str "(",Str "secs.\160\&1,",Space,Str "2,",Space,Str "4.1-4.3)"]- ,Para [Str "For",Space,Str "immediate",Space,Str "example,",Space,Str "see",Space,Str "fig.\160\&1"]- ,Para [Image ("fig:figure0",[],[]) [Str "Figure",Space,Str "#",Space,Str "1:",Space,Str "A",Space,Str "figure"] ("img1.jpg","fig:")]- ,Para [Str "There",Space,Str "is",Space,Str "also",Space,Str "support",Space,Str "for",Space,Str "code",Space,Str "blocks,",Space,Str "for",Space,Str "example,",Space,Str "lsts.\160\&4.1-4.3"]- ,Para [Str "It\8217s",Space,Str "possible",Space,Str "to",Space,Str "capitalize",Space,Str "reference",Space,Str "prefixes,",Space,Str "like",Space,Str "this:",Space,Str "Fig.\160\&1.1."]- ,Para [Str "In",Space,Str "case",Space,Str "of",Space,Str "multiple",Space,Str "references,",Space,Str "capitalization",Space,Str "is",Space,Str "determined",Space,Str "by",Space,Str "first",Space,Str "reference.",Space,Str "Figs.\160\&1.1,",Space,Str "1.2",Space,Str "is",Space,Str "capitalized,",Space,Str "while",Space,Str "figs.\160\&1.1,",Space,Str "1.2",Space,Str "is",Space,Str "not."]- ,Para [Str "It",Space,Str "is",Space,Str "also",Space,Str "possible",Space,Str "to",Space,Str "mix",Space,Str "different",Space,Str "references,",Space,Str "like",Space,Str "fig.\160\&1.1,",Space,Str "tbl.\160\&3.1,",Space,Str "lsts.\160\&4.1,",Space,Str "4.2,",Space,Str "figs.\160\&1.2,",Space,Str "1.3,",Space,Str "which",Space,Str "will",Space,Str "be",Space,Str "grouped",Space,Str "in",Space,Str "order",Space,Str "they",Space,Str "are",Space,Str "specified.",Space,Str "You",Space,Str "can",Space,Str "even",Space,Str "intermix",Space,Str "this",Space,Str "with",Space,Str "regular",Space,Str "citations,",Space,Str "although",Space,Str "it\8217s",Space,Str "not",Space,Str "recommended:",Space,Str "fig.\160\&1.1,",Space,Str "tbl.\160\&3.1,",Space,Cite [Citation {citationId = "unprocessedCitation", citationPrefix = [], citationSuffix = [], citationMode = NormalCitation, citationNoteNum = 11, citationHash = 0}] [Str "[@unprocessedCitation]"]]- ,Para [Str "You",Space,Str "can",Space,Str "also",Space,Str "have",Space,Str "custom",Space,Str "chapter",Space,Str "reference",Space,Str "labels,",Space,Str "like",Space,Str "sec.\160AppA.CustLab"]- ,Para [Str "Subfigures",Space,Str "are",Space,Str "supported,",Space,Str "see",Space,Str "figs.\160\&1.4,",Space,Str "1.4",Space,Str "(b)"]- ,Header 1 ("sec:sec1",[],[]) [Str "Chapter",Space,Str "1.",Space,Str "Figures"]- ,Para [Image ("fig:figure1",[],[]) [Str "Figure",Space,Str "#",Space,Str "1.1:",Space,Str "First",Space,Str "figure"] ("img1.jpg","fig:")]- ,Para [Image ("fig:figure2",[],[]) [Str "Figure",Space,Str "#",Space,Str "1.2:",Space,Str "Second",Space,Str "figure"] ("img2.jpg","fig:")]- ,Para [Image ("fig:figure3",[],[]) [Str "Figure",Space,Str "#",Space,Str "1.3:",Space,Str "Third",Space,Str "figure"] ("img3.jpg","fig:")]- ,Para [Image ("",[],[]) [Str "Unlabelled",Space,Str "image"] ("img1.jpg","fig:")]- ,Div ("fig:subfigures",["subfigures"],[])- [Para [Image ("",[],[]) [Str "a"] ("img1.jpg","fig:")]- ,Para [Image ("fig:subfigureB",[],[]) [Str "b"] ("img1.jpg","fig:")]- ,Para [Str "Figure",Space,Str "#",Space,Str "1.4:",Space,Str "Subfigures",Space,Str "caption.",Space,Str "a",Space,Str "\8212",Space,Str "Subfigure",Space,Str "a,",Space,Str "b",Space,Str "\8212",Space,Str "Subfigure",Space,Str "b"]]- ,Header 1 ("sec:sec2",[],[]) [Str "Chapter",Space,Str "2.",Space,Str "Equations"]- ,Para [Str "Display",Space,Str "equations",Space,Str "are",Space,Str "labelled",Space,Str "and",Space,Str "numbered"]- ,Para [Span ("eq:eqn1",[],[]) [Math DisplayMath " P_i(x) = \\sum_i a_i x^i \\qquad(2.1)"]]- ,Para [Str "Since",Space,Str "0.1.6.0",Space,Str "those",Space,Str "can",Space,Str "also",Space,Str "appear",Space,Str "in",Space,Str "the",Space,Str "middle",Space,Str "of",Space,Str "paragraph",SoftBreak,Span ("eq:quadr",[],[]) [Math DisplayMath "a x^2 + b x^2 + c = 0\\qquad(2.2)"],Space,Str "like",Space,Str "this."]- ,Header 1 ("sec:chapter-3.-tables",[],[]) [Str "Chapter",Space,Str "3.",Space,Str "Tables"]- ,Div ("tbl:table1",[],[])- [Table ("",[],[]) (Caption Nothing- [Plain [Emph [Str "Table",Space,Str "3.1"],Str ":",Space,Str "Table",Space,Str "example"]])- [(AlignLeft,ColWidthDefault)- ,(AlignLeft,ColWidthDefault)]- (TableHead ("",[],[])- [Row ("",[],[])- [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)- [Plain [Str "First",Space,Str "Header"]]- ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)- [Plain [Str "Second",Space,Str "Header"]]]])- [(TableBody ("",[],[]) (RowHeadColumns 0)- []- [Row ("",[],[])- [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)- [Plain [Str "Content",Space,Str "Cell"]]- ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)- [Plain [Str "Content",Space,Str "Cell"]]]- ,Row ("",[],[])- [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)- [Plain [Str "Content",Space,Str "Cell"]]- ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)- [Plain [Str "Content",Space,Str "Cell"]]]])]- (TableFoot ("",[],[])- [])]- ,Para [Str "Table",Space,Str "without",Space,Str "caption:"]- ,Table ("",[],[]) (Caption Nothing- [])- [(AlignLeft,ColWidthDefault)- ,(AlignLeft,ColWidthDefault)]- (TableHead ("",[],[])- [Row ("",[],[])- [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)- [Plain [Str "First",Space,Str "Header"]]- ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)- [Plain [Str "Second",Space,Str "Header"]]]])- [(TableBody ("",[],[]) (RowHeadColumns 0)- []- [Row ("",[],[])- [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)- [Plain [Str "Content",Space,Str "Cell"]]- ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)- [Plain [Str "Content",Space,Str "Cell"]]]- ,Row ("",[],[])- [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)- [Plain [Str "Content",Space,Str "Cell"]]- ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)- [Plain [Str "Content",Space,Str "Cell"]]]])]- (TableFoot ("",[],[])- [])- ,Header 1 ("sec:chapter-4.-code-blocks",[],[]) [Str "Chapter",Space,Str "4.",Space,Str "Code",Space,Str "blocks"]- ,Para [Str "There",Space,Str "are",Space,Str "a",Space,Str "couple",Space,Str "options",Space,Str "for",Space,Str "code",Space,Str "block",Space,Str "labels.",Space,Str "Those",Space,Str "work",Space,Str "only",Space,Str "if",Space,Str "code",Space,Str "block",Space,Str "id",Space,Str "starts",Space,Str "with",Space,Code ("",[],[]) "lst:",Str ",",Space,Str "e.g.\160",Code ("",[],[]) "{#lst:label}"]- ,Header 2 ("sec:caption-attr",[],[]) [Code ("",[],[]) "caption",Space,Str "attribute"]- ,Para [Code ("",[],[]) "caption",Space,Str "attribute",Space,Str "will",Space,Str "be",Space,Str "treated",Space,Str "as",Space,Str "code",Space,Str "block",Space,Str "caption.",Space,Str "If",Space,Str "code",Space,Str "block",Space,Str "has",Space,Str "both",Space,Str "id",Space,Str "and",Space,Code ("",[],[]) "caption",Space,Str "attributes,",Space,Str "it",Space,Str "will",Space,Str "be",Space,Str "treated",Space,Str "as",Space,Str "numbered",Space,Str "code",Space,Str "block."]- ,Div ("lst:captionAttr",["listing","haskell"],[])- [Para [Str "Listing",Space,Str "4.1:",Space,Str "Listing",Space,Str "caption"]- ,CodeBlock ("",["haskell"],[]) "main :: IO ()\nmain = putStrLn \"Hello World!\""]- ,RawBlock (Format "tex") "\\pagebreak"- ,Header 2 ("sec:table-capts",[],[]) [Str "Table-style",Space,Str "captions"]- ,Para [Str "Enabled",Space,Str "with",Space,Code ("",[],[]) "codeBlockCaptions",Space,Str "metadata",Space,Str "option.",Space,Str "If",Space,Str "code",Space,Str "block",Space,Str "is",Space,Str "immediately",SoftBreak,Str "adjacent",Space,Str "to",Space,Str "paragraph,",Space,Str "starting",Space,Str "with",Space,Code ("",[],[]) "Listing:",Space,Str "or",Space,Code ("",[],[]) ":",Str ",",Space,Str "said",Space,Str "paragraph",Space,Str "will",Space,Str "be",SoftBreak,Str "treated",Space,Str "as",Space,Str "code",Space,Str "block",Space,Str "caption."]- ,Div ("lst:tableCaption",["listing","haskell"],[])- [Para [Str "Listing",Space,Str "4.2:",Space,Str "Listing",Space,Str "caption"]- ,CodeBlock ("",["haskell"],[]) "main :: IO ()\nmain = putStrLn \"Hello World!\""]- ,Header 2 ("sec:wrapping-div",[],[]) [Str "Wrapping",Space,Str "div"]- ,Para [Str "Wrapping",Space,Str "code",Space,Str "block",Space,Str "without",Space,Str "label",Space,Str "in",Space,Str "a",Space,Str "div",Space,Str "with",Space,Str "id",Space,Code ("",[],[]) "lst:...",Space,Str "and",Space,Str "class,",Space,Str "starting",Space,Str "with",Space,Code ("",[],[]) "listing",Str ",",Space,Str "and",Space,Str "adding",Space,Str "paragraph",Space,Str "before",Space,Str "code",Space,Str "block,",Space,Str "but",Space,Str "inside",Space,Str "div,",Space,Str "will",Space,Str "treat",Space,Str "said",Space,Str "paragraph",Space,Str "as",Space,Str "code",Space,Str "block",Space,Str "caption."]- ,Div ("lst:wrappingDiv",["listing","haskell"],[])- [Para [Str "Listing",Space,Str "4.3:",Space,Str "Listing",Space,Str "caption"]- ,CodeBlock ("",["haskell"],[]) "main :: IO ()\nmain = putStrLn \"Hello World!\""]- ,Header 1 ("sec:unnumbered-chapter.",["unnumbered"],[]) [Str "Unnumbered",Space,Str "chapter."]- ,Para [Str "This",Space,Str "chapter",Space,Str "doesn\8217t",Space,Str "change",Space,Str "chapter",Space,Str "prefix",Space,Str "of",Space,Str "referenced",Space,Str "elements,",Space,Str "instead",Space,Str "keeping",Space,Str "number",Space,Str "of",Space,Str "previous",Space,Str "chapter,",Space,Str "e.g.",SoftBreak,Span ("eq:eqn2",[],[]) [Math DisplayMath " S(x) = \\int_{x_1}^{x_2} a x+b \\ \\mathrm{d}x \\qquad(4.1)"]]- ,Header 1 ("sec:chapter-5.-reference-lists",[],[]) [Str "Chapter",Space,Str "5.",Space,Str "Reference",Space,Str "lists"]- ,Para [Str "It\8217s",Space,Str "also",Space,Str "possible",Space,Str "to",Space,Str "show",Space,Str "lists",Space,Str "of",Space,Str "figures",Space,Str "and",Space,Str "tables,",Space,Str "like",Space,Str "this:"]- ,Header 2 ("list-of-figures",[],[]) [Str "List",Space,Str "of",Space,Str "Figures"]- ,Div ("",["list"],[])- [Para [Str "1",Space,Str "A",Space,Str "figure"]- ,Para [Str "1.1",Space,Str "First",Space,Str "figure"]- ,Para [Str "1.2",Space,Str "Second",Space,Str "figure"]- ,Para [Str "1.3",Space,Str "Third",Space,Str "figure"]- ,Para [Str "1.4",Space,Str "Subfigure",Space,Str "a"]- ,Para [Str "1.4",Space,Str "Subfigure",Space,Str "b"]- ,Para [Str "1.4",Space,Str "Subfigures",Space,Str "caption"]]- ,Header 2 ("list-of-tables",[],[]) [Str "List",Space,Str "of",Space,Str "Tables"]- ,Div ("",["list"],[])- [Para [Str "3.1",Space,Str "Table",Space,Str "example"]]- ,Header 1 ("",[],[]) [Str "List",Space,Str "of",Space,Str "Listings"]- ,Div ("",["list"],[])- [Para [Str "4.1",Space,Str "Listing",Space,Str "caption"]- ,Para [Str "4.2",Space,Str "Listing",Space,Str "caption"]- ,Para [Str "4.3",Space,Str "Listing",Space,Str "caption"]]- ,Header 1 ("sec:appendix-a.-custom-labels",[],[("label","AppA")]) [Str "Appendix",Space,Str "A.",Space,Str "Custom",Space,Str "labels"]- ,Header 2 ("sec:custlabs",[],[("label","CustLab")]) [Str "This",Space,Str "section",Space,Str "will",Space,Str "have",Space,Str "custom",Space,Str "label"]]+ [ Para+ [ Str "This"+ , Space+ , Str "is"+ , Space+ , Str "a"+ , Space+ , Str "demo"+ , Space+ , Str "file"+ , Space+ , Str "for"+ , Space+ , Str "pandoc-crossref."+ , Space+ , Str "With"+ , Space+ , Str "this"+ , Space+ , Str "filter,"+ , Space+ , Str "you"+ , Space+ , Str "can"+ , Space+ , Str "cross-reference"+ , Space+ , Str "figures"+ , Space+ , Str "(see"+ , Space+ , Str "figs.\160\&1.1-1.3),"+ , Space+ , Str "display"+ , Space+ , Str "equations"+ , Space+ , Str "(see"+ , Space+ , Str "eq.\160\&2.1),"+ , Space+ , Str "tables"+ , Space+ , Str "(see"+ , Space+ , Str "tbl.\160\&3.1)"+ , Space+ , Str "and"+ , Space+ , Str "sections"+ , Space+ , Str "("+ , Str "secs.\160\&1,"+ , Space+ , Str "2,"+ , Space+ , Str "4.1-4.3)"+ ]+ , Para+ [ Str "For"+ , Space+ , Str "immediate"+ , Space+ , Str "example,"+ , Space+ , Str "see"+ , Space+ , Str "fig.\160\&1"+ ]+ , Para+ [ Image+ ( "fig:figure0" , [] , [] )+ [ Str "Figure"+ , Space+ , Str "#"+ , Space+ , Str "1:"+ , Space+ , Str "A"+ , Space+ , Str "figure"+ ]+ ( "img1.jpg" , "fig:" )+ ]+ , Para+ [ Str "There"+ , Space+ , Str "is"+ , Space+ , Str "also"+ , Space+ , Str "support"+ , Space+ , Str "for"+ , Space+ , Str "code"+ , Space+ , Str "blocks,"+ , Space+ , Str "for"+ , Space+ , Str "example,"+ , Space+ , Str "lsts.\160\&4.1-4.3"+ ]+ , Para+ [ Str "It\8217s"+ , Space+ , Str "possible"+ , Space+ , Str "to"+ , Space+ , Str "capitalize"+ , Space+ , Str "reference"+ , Space+ , Str "prefixes,"+ , Space+ , Str "like"+ , Space+ , Str "this:"+ , Space+ , Str "Fig.\160\&1.1."+ ]+ , Para+ [ Str "In"+ , Space+ , Str "case"+ , Space+ , Str "of"+ , Space+ , Str "multiple"+ , Space+ , Str "references,"+ , Space+ , Str "capitalization"+ , Space+ , Str "is"+ , Space+ , Str "determined"+ , Space+ , Str "by"+ , Space+ , Str "first"+ , Space+ , Str "reference."+ , Space+ , Str "Figs.\160\&1.1,"+ , Space+ , Str "1.2"+ , Space+ , Str "is"+ , Space+ , Str "capitalized,"+ , Space+ , Str "while"+ , Space+ , Str "figs.\160\&1.1,"+ , Space+ , Str "1.2"+ , Space+ , Str "is"+ , Space+ , Str "not."+ ]+ , Para+ [ Str "It"+ , Space+ , Str "is"+ , Space+ , Str "also"+ , Space+ , Str "possible"+ , Space+ , Str "to"+ , Space+ , Str "mix"+ , Space+ , Str "different"+ , Space+ , Str "references,"+ , Space+ , Str "like"+ , Space+ , Str "fig.\160\&1.1,"+ , Space+ , Str "tbl.\160\&3.1,"+ , Space+ , Str "lsts.\160\&4.1,"+ , Space+ , Str "4.2,"+ , Space+ , Str "figs.\160\&1.2,"+ , Space+ , Str "1.3,"+ , Space+ , Str "which"+ , Space+ , Str "will"+ , Space+ , Str "be"+ , Space+ , Str "grouped"+ , Space+ , Str "in"+ , Space+ , Str "order"+ , Space+ , Str "they"+ , Space+ , Str "are"+ , Space+ , Str "specified."+ , Space+ , Str "You"+ , Space+ , Str "can"+ , Space+ , Str "even"+ , Space+ , Str "intermix"+ , Space+ , Str "this"+ , Space+ , Str "with"+ , Space+ , Str "regular"+ , Space+ , Str "citations,"+ , Space+ , Str "although"+ , Space+ , Str "it\8217s"+ , Space+ , Str "not"+ , Space+ , Str "recommended:"+ , Space+ , Str "fig.\160\&1.1,"+ , Space+ , Str "tbl.\160\&3.1,"+ , Space+ , Cite+ [ Citation+ { citationId = "unprocessedCitation"+ , citationPrefix = []+ , citationSuffix = []+ , citationMode = NormalCitation+ , citationNoteNum = 11+ , citationHash = 0+ }+ ]+ [ Str "[@unprocessedCitation]" ]+ ]+ , Para+ [ Str "You"+ , Space+ , Str "can"+ , Space+ , Str "also"+ , Space+ , Str "have"+ , Space+ , Str "custom"+ , Space+ , Str "chapter"+ , Space+ , Str "reference"+ , Space+ , Str "labels,"+ , Space+ , Str "like"+ , Space+ , Str "sec.\160AppA.CustLab"+ ]+ , Para+ [ Str "Subfigures"+ , Space+ , Str "are"+ , Space+ , Str "supported,"+ , Space+ , Str "see"+ , Space+ , Str "figs.\160\&1.4,"+ , Space+ , Str "1.4"+ , Space+ , Str "(b)"+ ]+ , Header+ 1+ ( "sec:sec1" , [] , [] )+ [ Str "Chapter" , Space , Str "1." , Space , Str "Figures" ]+ , Para+ [ Image+ ( "fig:figure1" , [] , [] )+ [ Str "Figure"+ , Space+ , Str "#"+ , Space+ , Str "1.1:"+ , Space+ , Str "First"+ , Space+ , Str "figure"+ ]+ ( "img1.jpg" , "fig:" )+ ]+ , Para+ [ Image+ ( "fig:figure2" , [] , [] )+ [ Str "Figure"+ , Space+ , Str "#"+ , Space+ , Str "1.2:"+ , Space+ , Str "Second"+ , Space+ , Str "figure"+ ]+ ( "img2.jpg" , "fig:" )+ ]+ , Para+ [ Image+ ( "fig:figure3" , [] , [] )+ [ Str "Figure"+ , Space+ , Str "#"+ , Space+ , Str "1.3:"+ , Space+ , Str "Third"+ , Space+ , Str "figure"+ ]+ ( "img3.jpg" , "fig:" )+ ]+ , Para+ [ Image+ ( "" , [] , [] )+ [ Str "Unlabelled" , Space , Str "image" ]+ ( "img1.jpg" , "fig:" )+ ]+ , Div+ ( "fig:subfigures" , [ "subfigures" ] , [] )+ [ Para+ [ Image ( "" , [] , [] ) [ Str "a" ] ( "img1.jpg" , "fig:" )+ ]+ , Para+ [ Image+ ( "fig:subfigureB" , [] , [] )+ [ Str "b" ]+ ( "img1.jpg" , "fig:" )+ ]+ , Para+ [ Str "Figure"+ , Space+ , Str "#"+ , Space+ , Str "1.4:"+ , Space+ , Str "Subfigures"+ , Space+ , Str "caption."+ , Space+ , Str "a"+ , Space+ , Str "\8212"+ , Space+ , Str "Subfigure"+ , Space+ , Str "a,"+ , Space+ , Str "b"+ , Space+ , Str "\8212"+ , Space+ , Str "Subfigure"+ , Space+ , Str "b"+ ]+ ]+ , Header+ 1+ ( "sec:sec2" , [] , [] )+ [ Str "Chapter"+ , Space+ , Str "2."+ , Space+ , Str "Equations"+ ]+ , Para+ [ Str "Display"+ , Space+ , Str "equations"+ , Space+ , Str "are"+ , Space+ , Str "labelled"+ , Space+ , Str "and"+ , Space+ , Str "numbered"+ ]+ , Para+ [ Span+ ( "eq:eqn1" , [] , [] )+ [ Math+ DisplayMath " P_i(x) = \\sum_i a_i x^i \\qquad{(2.1)}"+ ]+ ]+ , Para+ [ Str "Since"+ , Space+ , Str "0.1.6.0"+ , Space+ , Str "those"+ , Space+ , Str "can"+ , Space+ , Str "also"+ , Space+ , Str "appear"+ , Space+ , Str "in"+ , Space+ , Str "the"+ , Space+ , Str "middle"+ , Space+ , Str "of"+ , Space+ , Str "paragraph"+ , SoftBreak+ , Span+ ( "eq:quadr" , [] , [] )+ [ Math DisplayMath "a x^2 + b x^2 + c = 0\\qquad{(2.2)}" ]+ , Space+ , Str "like"+ , Space+ , Str "this."+ ]+ , Header+ 1+ ( "sec:chapter-3.-tables" , [] , [] )+ [ Str "Chapter" , Space , Str "3." , Space , Str "Tables" ]+ , Div+ ( "tbl:table1" , [] , [] )+ [ Table+ ( "" , [] , [] )+ (Caption+ Nothing+ [ Plain+ [ Emph [ Str "Table" , Space , Str "3.1" ]+ , Str ":"+ , Space+ , Str "Table"+ , Space+ , Str "example"+ ]+ ])+ [ ( AlignLeft , ColWidthDefault )+ , ( AlignLeft , ColWidthDefault )+ ]+ (TableHead+ ( "" , [] , [] )+ [ Row+ ( "" , [] , [] )+ [ Cell+ ( "" , [] , [] )+ AlignDefault+ (RowSpan 1)+ (ColSpan 1)+ [ Plain [ Str "First" , Space , Str "Header" ] ]+ , Cell+ ( "" , [] , [] )+ AlignDefault+ (RowSpan 1)+ (ColSpan 1)+ [ Plain [ Str "Second" , Space , Str "Header" ] ]+ ]+ ])+ [ TableBody+ ( "" , [] , [] )+ (RowHeadColumns 0)+ []+ [ Row+ ( "" , [] , [] )+ [ Cell+ ( "" , [] , [] )+ AlignDefault+ (RowSpan 1)+ (ColSpan 1)+ [ Plain [ Str "Content" , Space , Str "Cell" ] ]+ , Cell+ ( "" , [] , [] )+ AlignDefault+ (RowSpan 1)+ (ColSpan 1)+ [ Plain [ Str "Content" , Space , Str "Cell" ] ]+ ]+ , Row+ ( "" , [] , [] )+ [ Cell+ ( "" , [] , [] )+ AlignDefault+ (RowSpan 1)+ (ColSpan 1)+ [ Plain [ Str "Content" , Space , Str "Cell" ] ]+ , Cell+ ( "" , [] , [] )+ AlignDefault+ (RowSpan 1)+ (ColSpan 1)+ [ Plain [ Str "Content" , Space , Str "Cell" ] ]+ ]+ ]+ ]+ (TableFoot ( "" , [] , [] ) [])+ ]+ , Para+ [ Str "Table"+ , Space+ , Str "without"+ , Space+ , Str "caption:"+ ]+ , Table+ ( "" , [] , [] )+ (Caption Nothing [])+ [ ( AlignLeft , ColWidthDefault )+ , ( AlignLeft , ColWidthDefault )+ ]+ (TableHead+ ( "" , [] , [] )+ [ Row+ ( "" , [] , [] )+ [ Cell+ ( "" , [] , [] )+ AlignDefault+ (RowSpan 1)+ (ColSpan 1)+ [ Plain [ Str "First" , Space , Str "Header" ] ]+ , Cell+ ( "" , [] , [] )+ AlignDefault+ (RowSpan 1)+ (ColSpan 1)+ [ Plain [ Str "Second" , Space , Str "Header" ] ]+ ]+ ])+ [ TableBody+ ( "" , [] , [] )+ (RowHeadColumns 0)+ []+ [ Row+ ( "" , [] , [] )+ [ Cell+ ( "" , [] , [] )+ AlignDefault+ (RowSpan 1)+ (ColSpan 1)+ [ Plain [ Str "Content" , Space , Str "Cell" ] ]+ , Cell+ ( "" , [] , [] )+ AlignDefault+ (RowSpan 1)+ (ColSpan 1)+ [ Plain [ Str "Content" , Space , Str "Cell" ] ]+ ]+ , Row+ ( "" , [] , [] )+ [ Cell+ ( "" , [] , [] )+ AlignDefault+ (RowSpan 1)+ (ColSpan 1)+ [ Plain [ Str "Content" , Space , Str "Cell" ] ]+ , Cell+ ( "" , [] , [] )+ AlignDefault+ (RowSpan 1)+ (ColSpan 1)+ [ Plain [ Str "Content" , Space , Str "Cell" ] ]+ ]+ ]+ ]+ (TableFoot ( "" , [] , [] ) [])+ , Header+ 1+ ( "sec:chapter-4.-code-blocks" , [] , [] )+ [ Str "Chapter"+ , Space+ , Str "4."+ , Space+ , Str "Code"+ , Space+ , Str "blocks"+ ]+ , Para+ [ Str "There"+ , Space+ , Str "are"+ , Space+ , Str "a"+ , Space+ , Str "couple"+ , Space+ , Str "options"+ , Space+ , Str "for"+ , Space+ , Str "code"+ , Space+ , Str "block"+ , Space+ , Str "labels."+ , Space+ , Str "Those"+ , Space+ , Str "work"+ , Space+ , Str "only"+ , Space+ , Str "if"+ , Space+ , Str "code"+ , Space+ , Str "block"+ , Space+ , Str "id"+ , Space+ , Str "starts"+ , Space+ , Str "with"+ , Space+ , Code ( "" , [] , [] ) "lst:"+ , Str ","+ , Space+ , Str "e.g.\160"+ , Code ( "" , [] , [] ) "{#lst:label}"+ ]+ , Header+ 2+ ( "sec:caption-attr" , [] , [] )+ [ Code ( "" , [] , [] ) "caption"+ , Space+ , Str "attribute"+ ]+ , Para+ [ Code ( "" , [] , [] ) "caption"+ , Space+ , Str "attribute"+ , Space+ , Str "will"+ , Space+ , Str "be"+ , Space+ , Str "treated"+ , Space+ , Str "as"+ , Space+ , Str "code"+ , Space+ , Str "block"+ , Space+ , Str "caption."+ , Space+ , Str "If"+ , Space+ , Str "code"+ , Space+ , Str "block"+ , Space+ , Str "has"+ , Space+ , Str "both"+ , Space+ , Str "id"+ , Space+ , Str "and"+ , Space+ , Code ( "" , [] , [] ) "caption"+ , Space+ , Str "attributes,"+ , Space+ , Str "it"+ , Space+ , Str "will"+ , Space+ , Str "be"+ , Space+ , Str "treated"+ , Space+ , Str "as"+ , Space+ , Str "numbered"+ , Space+ , Str "code"+ , Space+ , Str "block."+ ]+ , Div+ ( "lst:captionAttr" , [ "listing" , "haskell" ] , [] )+ [ Para+ [ Str "Listing"+ , Space+ , Str "4.1:"+ , Space+ , Str "Listing"+ , Space+ , Str "caption"+ ]+ , CodeBlock+ ( "" , [ "haskell" ] , [] )+ "main :: IO ()\nmain = putStrLn \"Hello World!\""+ ]+ , RawBlock (Format "tex") "\\pagebreak"+ , Header+ 2+ ( "sec:table-capts" , [] , [] )+ [ Str "Table-style" , Space , Str "captions" ]+ , Para+ [ Str "Enabled"+ , Space+ , Str "with"+ , Space+ , Code ( "" , [] , [] ) "codeBlockCaptions"+ , Space+ , Str "metadata"+ , Space+ , Str "option."+ , Space+ , Str "If"+ , Space+ , Str "code"+ , Space+ , Str "block"+ , Space+ , Str "is"+ , Space+ , Str "immediately"+ , SoftBreak+ , Str "adjacent"+ , Space+ , Str "to"+ , Space+ , Str "paragraph,"+ , Space+ , Str "starting"+ , Space+ , Str "with"+ , Space+ , Code ( "" , [] , [] ) "Listing:"+ , Space+ , Str "or"+ , Space+ , Code ( "" , [] , [] ) ":"+ , Str ","+ , Space+ , Str "said"+ , Space+ , Str "paragraph"+ , Space+ , Str "will"+ , Space+ , Str "be"+ , SoftBreak+ , Str "treated"+ , Space+ , Str "as"+ , Space+ , Str "code"+ , Space+ , Str "block"+ , Space+ , Str "caption."+ ]+ , Div+ ( "lst:tableCaption" , [ "listing" , "haskell" ] , [] )+ [ Para+ [ Str "Listing"+ , Space+ , Str "4.2:"+ , Space+ , Str "Listing"+ , Space+ , Str "caption"+ ]+ , CodeBlock+ ( "" , [ "haskell" ] , [] )+ "main :: IO ()\nmain = putStrLn \"Hello World!\""+ ]+ , Header+ 2+ ( "sec:wrapping-div" , [] , [] )+ [ Str "Wrapping" , Space , Str "div" ]+ , Para+ [ Str "Wrapping"+ , Space+ , Str "code"+ , Space+ , Str "block"+ , Space+ , Str "without"+ , Space+ , Str "label"+ , Space+ , Str "in"+ , Space+ , Str "a"+ , Space+ , Str "div"+ , Space+ , Str "with"+ , Space+ , Str "id"+ , Space+ , Code ( "" , [] , [] ) "lst:..."+ , Space+ , Str "and"+ , Space+ , Str "class,"+ , Space+ , Str "starting"+ , Space+ , Str "with"+ , Space+ , Code ( "" , [] , [] ) "listing"+ , Str ","+ , Space+ , Str "and"+ , Space+ , Str "adding"+ , Space+ , Str "paragraph"+ , Space+ , Str "before"+ , Space+ , Str "code"+ , Space+ , Str "block,"+ , Space+ , Str "but"+ , Space+ , Str "inside"+ , Space+ , Str "div,"+ , Space+ , Str "will"+ , Space+ , Str "treat"+ , Space+ , Str "said"+ , Space+ , Str "paragraph"+ , Space+ , Str "as"+ , Space+ , Str "code"+ , Space+ , Str "block"+ , Space+ , Str "caption."+ ]+ , Div+ ( "lst:wrappingDiv" , [ "listing" , "haskell" ] , [] )+ [ Para+ [ Str "Listing"+ , Space+ , Str "4.3:"+ , Space+ , Str "Listing"+ , Space+ , Str "caption"+ ]+ , CodeBlock+ ( "" , [ "haskell" ] , [] )+ "main :: IO ()\nmain = putStrLn \"Hello World!\""+ ]+ , Header+ 1+ ( "sec:unnumbered-chapter." , [ "unnumbered" ] , [] )+ [ Str "Unnumbered" , Space , Str "chapter." ]+ , Para+ [ Str "This"+ , Space+ , Str "chapter"+ , Space+ , Str "doesn\8217t"+ , Space+ , Str "change"+ , Space+ , Str "chapter"+ , Space+ , Str "prefix"+ , Space+ , Str "of"+ , Space+ , Str "referenced"+ , Space+ , Str "elements,"+ , Space+ , Str "instead"+ , Space+ , Str "keeping"+ , Space+ , Str "number"+ , Space+ , Str "of"+ , Space+ , Str "previous"+ , Space+ , Str "chapter,"+ , Space+ , Str "e.g."+ , SoftBreak+ , Span+ ( "eq:eqn2" , [] , [] )+ [ Math+ DisplayMath+ " S(x) = \\int_{x_1}^{x_2} a x+b \\ \\mathrm{d}x \\qquad{(4.1)}"+ ]+ ]+ , Header+ 1+ ( "sec:chapter-5.-reference-lists" , [] , [] )+ [ Str "Chapter"+ , Space+ , Str "5."+ , Space+ , Str "Reference"+ , Space+ , Str "lists"+ ]+ , Para+ [ Str "It\8217s"+ , Space+ , Str "also"+ , Space+ , Str "possible"+ , Space+ , Str "to"+ , Space+ , Str "show"+ , Space+ , Str "lists"+ , Space+ , Str "of"+ , Space+ , Str "figures"+ , Space+ , Str "and"+ , Space+ , Str "tables,"+ , Space+ , Str "like"+ , Space+ , Str "this:"+ ]+ , Header+ 2+ ( "list-of-figures" , [] , [] )+ [ Str "List" , Space , Str "of" , Space , Str "Figures" ]+ , Div+ ( "" , [ "list" ] , [] )+ [ Para [ Str "1" , Space , Str "A" , Space , Str "figure" ]+ , Para+ [ Str "1.1" , Space , Str "First" , Space , Str "figure" ]+ , Para+ [ Str "1.2" , Space , Str "Second" , Space , Str "figure" ]+ , Para+ [ Str "1.3" , Space , Str "Third" , Space , Str "figure" ]+ , Para+ [ Str "1.4" , Space , Str "Subfigure" , Space , Str "a" ]+ , Para+ [ Str "1.4" , Space , Str "Subfigure" , Space , Str "b" ]+ , Para+ [ Str "1.4"+ , Space+ , Str "Subfigures"+ , Space+ , Str "caption"+ ]+ ]+ , Header+ 2+ ( "list-of-tables" , [] , [] )+ [ Str "List" , Space , Str "of" , Space , Str "Tables" ]+ , Div+ ( "" , [ "list" ] , [] )+ [ Para+ [ Str "3.1" , Space , Str "Table" , Space , Str "example" ]+ ]+ , Header+ 1+ ( "" , [] , [] )+ [ Str "List" , Space , Str "of" , Space , Str "Listings" ]+ , Div+ ( "" , [ "list" ] , [] )+ [ Para+ [ Str "4.1"+ , Space+ , Str "Listing"+ , Space+ , Str "caption"+ ]+ , Para+ [ Str "4.2"+ , Space+ , Str "Listing"+ , Space+ , Str "caption"+ ]+ , Para+ [ Str "4.3"+ , Space+ , Str "Listing"+ , Space+ , Str "caption"+ ]+ ]+ , Header+ 1+ ( "sec:appendix-a.-custom-labels"+ , []+ , [ ( "label" , "AppA" ) ]+ )+ [ Str "Appendix"+ , Space+ , Str "A."+ , Space+ , Str "Custom"+ , Space+ , Str "labels"+ ]+ , Header+ 2+ ( "sec:custlabs" , [] , [ ( "label" , "CustLab" ) ] )+ [ Str "This"+ , Space+ , Str "section"+ , Space+ , Str "will"+ , Space+ , Str "have"+ , Space+ , Str "custom"+ , Space+ , Str "label"+ ]+ ]
test/demo.inc view
@@ -1,114 +1,1022 @@- [Para [Str "This",Space,Str "is",Space,Str "a",Space,Str "demo",Space,Str "file",Space,Str "for",Space,Str "pandoc-crossref.",Space,Str "With",Space,Str "this",Space,Str "filter,",Space,Str "you",Space,Str "can",Space,Str "cross-reference",Space,Str "figures",Space,Str "(see",Space,Str "figs.\160\&2-4),",Space,Str "display",Space,Str "equations",Space,Str "(see",Space,Str "eq.\160\&1),",Space,Str "tables",Space,Str "(see",Space,Str "tbl.\160\&1)",Space,Str "and",Space,Str "sections",Space,Str "(",Str "secs.\160\&1,",Space,Str "2,",Space,Str "4.1-4.3)"]- ,Para [Str "For",Space,Str "immediate",Space,Str "example,",Space,Str "see",Space,Str "fig.\160\&1"]- ,Para [Image ("fig:figure0",[],[]) [Str "Figure",Space,Str "#",Space,Str "1:",Space,Str "A",Space,Str "figure"] ("img1.jpg","fig:")]- ,Para [Str "There",Space,Str "is",Space,Str "also",Space,Str "support",Space,Str "for",Space,Str "code",Space,Str "blocks,",Space,Str "for",Space,Str "example,",Space,Str "lsts.\160\&1-3"]- ,Para [Str "It\8217s",Space,Str "possible",Space,Str "to",Space,Str "capitalize",Space,Str "reference",Space,Str "prefixes,",Space,Str "like",Space,Str "this:",Space,Str "Fig.\160\&2."]- ,Para [Str "In",Space,Str "case",Space,Str "of",Space,Str "multiple",Space,Str "references,",Space,Str "capitalization",Space,Str "is",Space,Str "determined",Space,Str "by",Space,Str "first",Space,Str "reference.",Space,Str "Figs.\160\&2,",Space,Str "3",Space,Str "is",Space,Str "capitalized,",Space,Str "while",Space,Str "figs.\160\&2,",Space,Str "3",Space,Str "is",Space,Str "not."]- ,Para [Str "It",Space,Str "is",Space,Str "also",Space,Str "possible",Space,Str "to",Space,Str "mix",Space,Str "different",Space,Str "references,",Space,Str "like",Space,Str "fig.\160\&2,",Space,Str "tbl.\160\&1,",Space,Str "lsts.\160\&1,",Space,Str "2,",Space,Str "figs.\160\&3,",Space,Str "4,",Space,Str "which",Space,Str "will",Space,Str "be",Space,Str "grouped",Space,Str "in",Space,Str "order",Space,Str "they",Space,Str "are",Space,Str "specified.",Space,Str "You",Space,Str "can",Space,Str "even",Space,Str "intermix",Space,Str "this",Space,Str "with",Space,Str "regular",Space,Str "citations,",Space,Str "although",Space,Str "it\8217s",Space,Str "not",Space,Str "recommended:",Space,Str "fig.\160\&2,",Space,Str "tbl.\160\&1,",Space,Cite [Citation {citationId = "unprocessedCitation", citationPrefix = [], citationSuffix = [], citationMode = NormalCitation, citationNoteNum = 11, citationHash = 0}] [Str "[@unprocessedCitation]"]]- ,Para [Str "You",Space,Str "can",Space,Str "also",Space,Str "have",Space,Str "custom",Space,Str "chapter",Space,Str "reference",Space,Str "labels,",Space,Str "like",Space,Str "sec.\160AppA.CustLab"]- ,Para [Str "Subfigures",Space,Str "are",Space,Str "supported,",Space,Str "see",Space,Str "figs.\160\&5,",Space,Str "5",Space,Str "(b)"]- ,Header 1 ("sec:sec1",[],[]) [Str "Chapter",Space,Str "1.",Space,Str "Figures"]- ,Para [Image ("fig:figure1",[],[]) [Str "Figure",Space,Str "#",Space,Str "2:",Space,Str "First",Space,Str "figure"] ("img1.jpg","fig:")]- ,Para [Image ("fig:figure2",[],[]) [Str "Figure",Space,Str "#",Space,Str "3:",Space,Str "Second",Space,Str "figure"] ("img2.jpg","fig:")]- ,Para [Image ("fig:figure3",[],[]) [Str "Figure",Space,Str "#",Space,Str "4:",Space,Str "Third",Space,Str "figure"] ("img3.jpg","fig:")]- ,Para [Image ("",[],[]) [Str "Unlabelled",Space,Str "image"] ("img1.jpg","fig:")]- ,Div ("fig:subfigures",["subfigures"],[])- [Para [Image ("",[],[]) [Str "a"] ("img1.jpg","fig:")]- ,Para [Image ("fig:subfigureB",[],[]) [Str "b"] ("img1.jpg","fig:")]- ,Para [Str "Figure",Space,Str "#",Space,Str "5:",Space,Str "Subfigures",Space,Str "caption.",Space,Str "a",Space,Str "\8212",Space,Str "Subfigure",Space,Str "a,",Space,Str "b",Space,Str "\8212",Space,Str "Subfigure",Space,Str "b"]]- ,Header 1 ("sec:sec2",[],[]) [Str "Chapter",Space,Str "2.",Space,Str "Equations"]- ,Para [Str "Display",Space,Str "equations",Space,Str "are",Space,Str "labelled",Space,Str "and",Space,Str "numbered"]- ,Para [Span ("eq:eqn1",[],[]) [Math DisplayMath " P_i(x) = \\sum_i a_i x^i \\qquad(1)"]]- ,Para [Str "Since",Space,Str "0.1.6.0",Space,Str "those",Space,Str "can",Space,Str "also",Space,Str "appear",Space,Str "in",Space,Str "the",Space,Str "middle",Space,Str "of",Space,Str "paragraph",SoftBreak,Span ("eq:quadr",[],[]) [Math DisplayMath "a x^2 + b x^2 + c = 0\\qquad(2)"],Space,Str "like",Space,Str "this."]- ,Header 1 ("sec:chapter-3.-tables",[],[]) [Str "Chapter",Space,Str "3.",Space,Str "Tables"]- ,Div ("tbl:table1",[],[])- [Table ("",[],[]) (Caption Nothing- [Plain [Emph [Str "Table",Space,Str "1"],Str ":",Space,Str "Table",Space,Str "example"]])- [(AlignLeft,ColWidthDefault)- ,(AlignLeft,ColWidthDefault)]- (TableHead ("",[],[])- [Row ("",[],[])- [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)- [Plain [Str "First",Space,Str "Header"]]- ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)- [Plain [Str "Second",Space,Str "Header"]]]])- [(TableBody ("",[],[]) (RowHeadColumns 0)- []- [Row ("",[],[])- [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)- [Plain [Str "Content",Space,Str "Cell"]]- ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)- [Plain [Str "Content",Space,Str "Cell"]]]- ,Row ("",[],[])- [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)- [Plain [Str "Content",Space,Str "Cell"]]- ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)- [Plain [Str "Content",Space,Str "Cell"]]]])]- (TableFoot ("",[],[])- [])]- ,Para [Str "Table",Space,Str "without",Space,Str "caption:"]- ,Table ("",[],[]) (Caption Nothing- [])- [(AlignLeft,ColWidthDefault)- ,(AlignLeft,ColWidthDefault)]- (TableHead ("",[],[])- [Row ("",[],[])- [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)- [Plain [Str "First",Space,Str "Header"]]- ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)- [Plain [Str "Second",Space,Str "Header"]]]])- [(TableBody ("",[],[]) (RowHeadColumns 0)- []- [Row ("",[],[])- [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)- [Plain [Str "Content",Space,Str "Cell"]]- ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)- [Plain [Str "Content",Space,Str "Cell"]]]- ,Row ("",[],[])- [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)- [Plain [Str "Content",Space,Str "Cell"]]- ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)- [Plain [Str "Content",Space,Str "Cell"]]]])]- (TableFoot ("",[],[])- [])- ,Header 1 ("sec:chapter-4.-code-blocks",[],[]) [Str "Chapter",Space,Str "4.",Space,Str "Code",Space,Str "blocks"]- ,Para [Str "There",Space,Str "are",Space,Str "a",Space,Str "couple",Space,Str "options",Space,Str "for",Space,Str "code",Space,Str "block",Space,Str "labels.",Space,Str "Those",Space,Str "work",Space,Str "only",Space,Str "if",Space,Str "code",Space,Str "block",Space,Str "id",Space,Str "starts",Space,Str "with",Space,Code ("",[],[]) "lst:",Str ",",Space,Str "e.g.\160",Code ("",[],[]) "{#lst:label}"]- ,Header 2 ("sec:caption-attr",[],[]) [Code ("",[],[]) "caption",Space,Str "attribute"]- ,Para [Code ("",[],[]) "caption",Space,Str "attribute",Space,Str "will",Space,Str "be",Space,Str "treated",Space,Str "as",Space,Str "code",Space,Str "block",Space,Str "caption.",Space,Str "If",Space,Str "code",Space,Str "block",Space,Str "has",Space,Str "both",Space,Str "id",Space,Str "and",Space,Code ("",[],[]) "caption",Space,Str "attributes,",Space,Str "it",Space,Str "will",Space,Str "be",Space,Str "treated",Space,Str "as",Space,Str "numbered",Space,Str "code",Space,Str "block."]- ,Div ("lst:captionAttr",["listing","haskell"],[])- [Para [Str "Listing",Space,Str "1:",Space,Str "Listing",Space,Str "caption"]- ,CodeBlock ("",["haskell"],[]) "main :: IO ()\nmain = putStrLn \"Hello World!\""]- ,RawBlock (Format "tex") "\\pagebreak"- ,Header 2 ("sec:table-capts",[],[]) [Str "Table-style",Space,Str "captions"]- ,Para [Str "Enabled",Space,Str "with",Space,Code ("",[],[]) "codeBlockCaptions",Space,Str "metadata",Space,Str "option.",Space,Str "If",Space,Str "code",Space,Str "block",Space,Str "is",Space,Str "immediately",SoftBreak,Str "adjacent",Space,Str "to",Space,Str "paragraph,",Space,Str "starting",Space,Str "with",Space,Code ("",[],[]) "Listing:",Space,Str "or",Space,Code ("",[],[]) ":",Str ",",Space,Str "said",Space,Str "paragraph",Space,Str "will",Space,Str "be",SoftBreak,Str "treated",Space,Str "as",Space,Str "code",Space,Str "block",Space,Str "caption."]- ,Div ("lst:tableCaption",["listing","haskell"],[])- [Para [Str "Listing",Space,Str "2:",Space,Str "Listing",Space,Str "caption"]- ,CodeBlock ("",["haskell"],[]) "main :: IO ()\nmain = putStrLn \"Hello World!\""]- ,Header 2 ("sec:wrapping-div",[],[]) [Str "Wrapping",Space,Str "div"]- ,Para [Str "Wrapping",Space,Str "code",Space,Str "block",Space,Str "without",Space,Str "label",Space,Str "in",Space,Str "a",Space,Str "div",Space,Str "with",Space,Str "id",Space,Code ("",[],[]) "lst:...",Space,Str "and",Space,Str "class,",Space,Str "starting",Space,Str "with",Space,Code ("",[],[]) "listing",Str ",",Space,Str "and",Space,Str "adding",Space,Str "paragraph",Space,Str "before",Space,Str "code",Space,Str "block,",Space,Str "but",Space,Str "inside",Space,Str "div,",Space,Str "will",Space,Str "treat",Space,Str "said",Space,Str "paragraph",Space,Str "as",Space,Str "code",Space,Str "block",Space,Str "caption."]- ,Div ("lst:wrappingDiv",["listing","haskell"],[])- [Para [Str "Listing",Space,Str "3:",Space,Str "Listing",Space,Str "caption"]- ,CodeBlock ("",["haskell"],[]) "main :: IO ()\nmain = putStrLn \"Hello World!\""]- ,Header 1 ("sec:unnumbered-chapter.",["unnumbered"],[]) [Str "Unnumbered",Space,Str "chapter."]- ,Para [Str "This",Space,Str "chapter",Space,Str "doesn\8217t",Space,Str "change",Space,Str "chapter",Space,Str "prefix",Space,Str "of",Space,Str "referenced",Space,Str "elements,",Space,Str "instead",Space,Str "keeping",Space,Str "number",Space,Str "of",Space,Str "previous",Space,Str "chapter,",Space,Str "e.g.",SoftBreak,Span ("eq:eqn2",[],[]) [Math DisplayMath " S(x) = \\int_{x_1}^{x_2} a x+b \\ \\mathrm{d}x \\qquad(3)"]]- ,Header 1 ("sec:chapter-5.-reference-lists",[],[]) [Str "Chapter",Space,Str "5.",Space,Str "Reference",Space,Str "lists"]- ,Para [Str "It\8217s",Space,Str "also",Space,Str "possible",Space,Str "to",Space,Str "show",Space,Str "lists",Space,Str "of",Space,Str "figures",Space,Str "and",Space,Str "tables,",Space,Str "like",Space,Str "this:"]- ,Header 2 ("list-of-figures",[],[]) [Str "List",Space,Str "of",Space,Str "Figures"]- ,OrderedList (1,DefaultStyle,DefaultDelim)- [[Plain [Str "A",Space,Str "figure"]]- ,[Plain [Str "First",Space,Str "figure"]]- ,[Plain [Str "Second",Space,Str "figure"]]- ,[Plain [Str "Third",Space,Str "figure"]]- ,[Plain [Str "Subfigure",Space,Str "a"]]- ,[Plain [Str "Subfigure",Space,Str "b"]]- ,[Plain [Str "Subfigures",Space,Str "caption"]]]- ,Header 2 ("list-of-tables",[],[]) [Str "List",Space,Str "of",Space,Str "Tables"]- ,OrderedList (1,DefaultStyle,DefaultDelim)- [[Plain [Str "Table",Space,Str "example"]]]- ,Header 1 ("",[],[]) [Str "List",Space,Str "of",Space,Str "Listings"]- ,OrderedList (1,DefaultStyle,DefaultDelim)- [[Plain [Str "Listing",Space,Str "caption"]]- ,[Plain [Str "Listing",Space,Str "caption"]]- ,[Plain [Str "Listing",Space,Str "caption"]]]- ,Header 1 ("sec:appendix-a.-custom-labels",[],[("label","AppA")]) [Str "Appendix",Space,Str "A.",Space,Str "Custom",Space,Str "labels"]- ,Header 2 ("sec:custlabs",[],[("label","CustLab")]) [Str "This",Space,Str "section",Space,Str "will",Space,Str "have",Space,Str "custom",Space,Str "label"]]+ [ Para+ [ Str "This"+ , Space+ , Str "is"+ , Space+ , Str "a"+ , Space+ , Str "demo"+ , Space+ , Str "file"+ , Space+ , Str "for"+ , Space+ , Str "pandoc-crossref."+ , Space+ , Str "With"+ , Space+ , Str "this"+ , Space+ , Str "filter,"+ , Space+ , Str "you"+ , Space+ , Str "can"+ , Space+ , Str "cross-reference"+ , Space+ , Str "figures"+ , Space+ , Str "(see"+ , Space+ , Str "figs.\160\&2-4),"+ , Space+ , Str "display"+ , Space+ , Str "equations"+ , Space+ , Str "(see"+ , Space+ , Str "eq.\160\&1),"+ , Space+ , Str "tables"+ , Space+ , Str "(see"+ , Space+ , Str "tbl.\160\&1)"+ , Space+ , Str "and"+ , Space+ , Str "sections"+ , Space+ , Str "("+ , Str "secs.\160\&1,"+ , Space+ , Str "2,"+ , Space+ , Str "4.1-4.3)"+ ]+ , Para+ [ Str "For"+ , Space+ , Str "immediate"+ , Space+ , Str "example,"+ , Space+ , Str "see"+ , Space+ , Str "fig.\160\&1"+ ]+ , Para+ [ Image+ ( "fig:figure0" , [] , [] )+ [ Str "Figure"+ , Space+ , Str "#"+ , Space+ , Str "1:"+ , Space+ , Str "A"+ , Space+ , Str "figure"+ ]+ ( "img1.jpg" , "fig:" )+ ]+ , Para+ [ Str "There"+ , Space+ , Str "is"+ , Space+ , Str "also"+ , Space+ , Str "support"+ , Space+ , Str "for"+ , Space+ , Str "code"+ , Space+ , Str "blocks,"+ , Space+ , Str "for"+ , Space+ , Str "example,"+ , Space+ , Str "lsts.\160\&1-3"+ ]+ , Para+ [ Str "It\8217s"+ , Space+ , Str "possible"+ , Space+ , Str "to"+ , Space+ , Str "capitalize"+ , Space+ , Str "reference"+ , Space+ , Str "prefixes,"+ , Space+ , Str "like"+ , Space+ , Str "this:"+ , Space+ , Str "Fig.\160\&2."+ ]+ , Para+ [ Str "In"+ , Space+ , Str "case"+ , Space+ , Str "of"+ , Space+ , Str "multiple"+ , Space+ , Str "references,"+ , Space+ , Str "capitalization"+ , Space+ , Str "is"+ , Space+ , Str "determined"+ , Space+ , Str "by"+ , Space+ , Str "first"+ , Space+ , Str "reference."+ , Space+ , Str "Figs.\160\&2,"+ , Space+ , Str "3"+ , Space+ , Str "is"+ , Space+ , Str "capitalized,"+ , Space+ , Str "while"+ , Space+ , Str "figs.\160\&2,"+ , Space+ , Str "3"+ , Space+ , Str "is"+ , Space+ , Str "not."+ ]+ , Para+ [ Str "It"+ , Space+ , Str "is"+ , Space+ , Str "also"+ , Space+ , Str "possible"+ , Space+ , Str "to"+ , Space+ , Str "mix"+ , Space+ , Str "different"+ , Space+ , Str "references,"+ , Space+ , Str "like"+ , Space+ , Str "fig.\160\&2,"+ , Space+ , Str "tbl.\160\&1,"+ , Space+ , Str "lsts.\160\&1,"+ , Space+ , Str "2,"+ , Space+ , Str "figs.\160\&3,"+ , Space+ , Str "4,"+ , Space+ , Str "which"+ , Space+ , Str "will"+ , Space+ , Str "be"+ , Space+ , Str "grouped"+ , Space+ , Str "in"+ , Space+ , Str "order"+ , Space+ , Str "they"+ , Space+ , Str "are"+ , Space+ , Str "specified."+ , Space+ , Str "You"+ , Space+ , Str "can"+ , Space+ , Str "even"+ , Space+ , Str "intermix"+ , Space+ , Str "this"+ , Space+ , Str "with"+ , Space+ , Str "regular"+ , Space+ , Str "citations,"+ , Space+ , Str "although"+ , Space+ , Str "it\8217s"+ , Space+ , Str "not"+ , Space+ , Str "recommended:"+ , Space+ , Str "fig.\160\&2,"+ , Space+ , Str "tbl.\160\&1,"+ , Space+ , Cite+ [ Citation+ { citationId = "unprocessedCitation"+ , citationPrefix = []+ , citationSuffix = []+ , citationMode = NormalCitation+ , citationNoteNum = 11+ , citationHash = 0+ }+ ]+ [ Str "[@unprocessedCitation]" ]+ ]+ , Para+ [ Str "You"+ , Space+ , Str "can"+ , Space+ , Str "also"+ , Space+ , Str "have"+ , Space+ , Str "custom"+ , Space+ , Str "chapter"+ , Space+ , Str "reference"+ , Space+ , Str "labels,"+ , Space+ , Str "like"+ , Space+ , Str "sec.\160AppA.CustLab"+ ]+ , Para+ [ Str "Subfigures"+ , Space+ , Str "are"+ , Space+ , Str "supported,"+ , Space+ , Str "see"+ , Space+ , Str "figs.\160\&5,"+ , Space+ , Str "5"+ , Space+ , Str "(b)"+ ]+ , Header+ 1+ ( "sec:sec1" , [] , [] )+ [ Str "Chapter" , Space , Str "1." , Space , Str "Figures" ]+ , Para+ [ Image+ ( "fig:figure1" , [] , [] )+ [ Str "Figure"+ , Space+ , Str "#"+ , Space+ , Str "2:"+ , Space+ , Str "First"+ , Space+ , Str "figure"+ ]+ ( "img1.jpg" , "fig:" )+ ]+ , Para+ [ Image+ ( "fig:figure2" , [] , [] )+ [ Str "Figure"+ , Space+ , Str "#"+ , Space+ , Str "3:"+ , Space+ , Str "Second"+ , Space+ , Str "figure"+ ]+ ( "img2.jpg" , "fig:" )+ ]+ , Para+ [ Image+ ( "fig:figure3" , [] , [] )+ [ Str "Figure"+ , Space+ , Str "#"+ , Space+ , Str "4:"+ , Space+ , Str "Third"+ , Space+ , Str "figure"+ ]+ ( "img3.jpg" , "fig:" )+ ]+ , Para+ [ Image+ ( "" , [] , [] )+ [ Str "Unlabelled" , Space , Str "image" ]+ ( "img1.jpg" , "fig:" )+ ]+ , Div+ ( "fig:subfigures" , [ "subfigures" ] , [] )+ [ Para+ [ Image ( "" , [] , [] ) [ Str "a" ] ( "img1.jpg" , "fig:" )+ ]+ , Para+ [ Image+ ( "fig:subfigureB" , [] , [] )+ [ Str "b" ]+ ( "img1.jpg" , "fig:" )+ ]+ , Para+ [ Str "Figure"+ , Space+ , Str "#"+ , Space+ , Str "5:"+ , Space+ , Str "Subfigures"+ , Space+ , Str "caption."+ , Space+ , Str "a"+ , Space+ , Str "\8212"+ , Space+ , Str "Subfigure"+ , Space+ , Str "a,"+ , Space+ , Str "b"+ , Space+ , Str "\8212"+ , Space+ , Str "Subfigure"+ , Space+ , Str "b"+ ]+ ]+ , Header+ 1+ ( "sec:sec2" , [] , [] )+ [ Str "Chapter"+ , Space+ , Str "2."+ , Space+ , Str "Equations"+ ]+ , Para+ [ Str "Display"+ , Space+ , Str "equations"+ , Space+ , Str "are"+ , Space+ , Str "labelled"+ , Space+ , Str "and"+ , Space+ , Str "numbered"+ ]+ , Para+ [ Span+ ( "eq:eqn1" , [] , [] )+ [ Math DisplayMath " P_i(x) = \\sum_i a_i x^i \\qquad{(1)}"+ ]+ ]+ , Para+ [ Str "Since"+ , Space+ , Str "0.1.6.0"+ , Space+ , Str "those"+ , Space+ , Str "can"+ , Space+ , Str "also"+ , Space+ , Str "appear"+ , Space+ , Str "in"+ , Space+ , Str "the"+ , Space+ , Str "middle"+ , Space+ , Str "of"+ , Space+ , Str "paragraph"+ , SoftBreak+ , Span+ ( "eq:quadr" , [] , [] )+ [ Math DisplayMath "a x^2 + b x^2 + c = 0\\qquad{(2)}" ]+ , Space+ , Str "like"+ , Space+ , Str "this."+ ]+ , Header+ 1+ ( "sec:chapter-3.-tables" , [] , [] )+ [ Str "Chapter" , Space , Str "3." , Space , Str "Tables" ]+ , Div+ ( "tbl:table1" , [] , [] )+ [ Table+ ( "" , [] , [] )+ (Caption+ Nothing+ [ Plain+ [ Emph [ Str "Table" , Space , Str "1" ]+ , Str ":"+ , Space+ , Str "Table"+ , Space+ , Str "example"+ ]+ ])+ [ ( AlignLeft , ColWidthDefault )+ , ( AlignLeft , ColWidthDefault )+ ]+ (TableHead+ ( "" , [] , [] )+ [ Row+ ( "" , [] , [] )+ [ Cell+ ( "" , [] , [] )+ AlignDefault+ (RowSpan 1)+ (ColSpan 1)+ [ Plain [ Str "First" , Space , Str "Header" ] ]+ , Cell+ ( "" , [] , [] )+ AlignDefault+ (RowSpan 1)+ (ColSpan 1)+ [ Plain [ Str "Second" , Space , Str "Header" ] ]+ ]+ ])+ [ TableBody+ ( "" , [] , [] )+ (RowHeadColumns 0)+ []+ [ Row+ ( "" , [] , [] )+ [ Cell+ ( "" , [] , [] )+ AlignDefault+ (RowSpan 1)+ (ColSpan 1)+ [ Plain [ Str "Content" , Space , Str "Cell" ] ]+ , Cell+ ( "" , [] , [] )+ AlignDefault+ (RowSpan 1)+ (ColSpan 1)+ [ Plain [ Str "Content" , Space , Str "Cell" ] ]+ ]+ , Row+ ( "" , [] , [] )+ [ Cell+ ( "" , [] , [] )+ AlignDefault+ (RowSpan 1)+ (ColSpan 1)+ [ Plain [ Str "Content" , Space , Str "Cell" ] ]+ , Cell+ ( "" , [] , [] )+ AlignDefault+ (RowSpan 1)+ (ColSpan 1)+ [ Plain [ Str "Content" , Space , Str "Cell" ] ]+ ]+ ]+ ]+ (TableFoot ( "" , [] , [] ) [])+ ]+ , Para+ [ Str "Table"+ , Space+ , Str "without"+ , Space+ , Str "caption:"+ ]+ , Table+ ( "" , [] , [] )+ (Caption Nothing [])+ [ ( AlignLeft , ColWidthDefault )+ , ( AlignLeft , ColWidthDefault )+ ]+ (TableHead+ ( "" , [] , [] )+ [ Row+ ( "" , [] , [] )+ [ Cell+ ( "" , [] , [] )+ AlignDefault+ (RowSpan 1)+ (ColSpan 1)+ [ Plain [ Str "First" , Space , Str "Header" ] ]+ , Cell+ ( "" , [] , [] )+ AlignDefault+ (RowSpan 1)+ (ColSpan 1)+ [ Plain [ Str "Second" , Space , Str "Header" ] ]+ ]+ ])+ [ TableBody+ ( "" , [] , [] )+ (RowHeadColumns 0)+ []+ [ Row+ ( "" , [] , [] )+ [ Cell+ ( "" , [] , [] )+ AlignDefault+ (RowSpan 1)+ (ColSpan 1)+ [ Plain [ Str "Content" , Space , Str "Cell" ] ]+ , Cell+ ( "" , [] , [] )+ AlignDefault+ (RowSpan 1)+ (ColSpan 1)+ [ Plain [ Str "Content" , Space , Str "Cell" ] ]+ ]+ , Row+ ( "" , [] , [] )+ [ Cell+ ( "" , [] , [] )+ AlignDefault+ (RowSpan 1)+ (ColSpan 1)+ [ Plain [ Str "Content" , Space , Str "Cell" ] ]+ , Cell+ ( "" , [] , [] )+ AlignDefault+ (RowSpan 1)+ (ColSpan 1)+ [ Plain [ Str "Content" , Space , Str "Cell" ] ]+ ]+ ]+ ]+ (TableFoot ( "" , [] , [] ) [])+ , Header+ 1+ ( "sec:chapter-4.-code-blocks" , [] , [] )+ [ Str "Chapter"+ , Space+ , Str "4."+ , Space+ , Str "Code"+ , Space+ , Str "blocks"+ ]+ , Para+ [ Str "There"+ , Space+ , Str "are"+ , Space+ , Str "a"+ , Space+ , Str "couple"+ , Space+ , Str "options"+ , Space+ , Str "for"+ , Space+ , Str "code"+ , Space+ , Str "block"+ , Space+ , Str "labels."+ , Space+ , Str "Those"+ , Space+ , Str "work"+ , Space+ , Str "only"+ , Space+ , Str "if"+ , Space+ , Str "code"+ , Space+ , Str "block"+ , Space+ , Str "id"+ , Space+ , Str "starts"+ , Space+ , Str "with"+ , Space+ , Code ( "" , [] , [] ) "lst:"+ , Str ","+ , Space+ , Str "e.g.\160"+ , Code ( "" , [] , [] ) "{#lst:label}"+ ]+ , Header+ 2+ ( "sec:caption-attr" , [] , [] )+ [ Code ( "" , [] , [] ) "caption"+ , Space+ , Str "attribute"+ ]+ , Para+ [ Code ( "" , [] , [] ) "caption"+ , Space+ , Str "attribute"+ , Space+ , Str "will"+ , Space+ , Str "be"+ , Space+ , Str "treated"+ , Space+ , Str "as"+ , Space+ , Str "code"+ , Space+ , Str "block"+ , Space+ , Str "caption."+ , Space+ , Str "If"+ , Space+ , Str "code"+ , Space+ , Str "block"+ , Space+ , Str "has"+ , Space+ , Str "both"+ , Space+ , Str "id"+ , Space+ , Str "and"+ , Space+ , Code ( "" , [] , [] ) "caption"+ , Space+ , Str "attributes,"+ , Space+ , Str "it"+ , Space+ , Str "will"+ , Space+ , Str "be"+ , Space+ , Str "treated"+ , Space+ , Str "as"+ , Space+ , Str "numbered"+ , Space+ , Str "code"+ , Space+ , Str "block."+ ]+ , Div+ ( "lst:captionAttr" , [ "listing" , "haskell" ] , [] )+ [ Para+ [ Str "Listing"+ , Space+ , Str "1:"+ , Space+ , Str "Listing"+ , Space+ , Str "caption"+ ]+ , CodeBlock+ ( "" , [ "haskell" ] , [] )+ "main :: IO ()\nmain = putStrLn \"Hello World!\""+ ]+ , RawBlock (Format "tex") "\\pagebreak"+ , Header+ 2+ ( "sec:table-capts" , [] , [] )+ [ Str "Table-style" , Space , Str "captions" ]+ , Para+ [ Str "Enabled"+ , Space+ , Str "with"+ , Space+ , Code ( "" , [] , [] ) "codeBlockCaptions"+ , Space+ , Str "metadata"+ , Space+ , Str "option."+ , Space+ , Str "If"+ , Space+ , Str "code"+ , Space+ , Str "block"+ , Space+ , Str "is"+ , Space+ , Str "immediately"+ , SoftBreak+ , Str "adjacent"+ , Space+ , Str "to"+ , Space+ , Str "paragraph,"+ , Space+ , Str "starting"+ , Space+ , Str "with"+ , Space+ , Code ( "" , [] , [] ) "Listing:"+ , Space+ , Str "or"+ , Space+ , Code ( "" , [] , [] ) ":"+ , Str ","+ , Space+ , Str "said"+ , Space+ , Str "paragraph"+ , Space+ , Str "will"+ , Space+ , Str "be"+ , SoftBreak+ , Str "treated"+ , Space+ , Str "as"+ , Space+ , Str "code"+ , Space+ , Str "block"+ , Space+ , Str "caption."+ ]+ , Div+ ( "lst:tableCaption" , [ "listing" , "haskell" ] , [] )+ [ Para+ [ Str "Listing"+ , Space+ , Str "2:"+ , Space+ , Str "Listing"+ , Space+ , Str "caption"+ ]+ , CodeBlock+ ( "" , [ "haskell" ] , [] )+ "main :: IO ()\nmain = putStrLn \"Hello World!\""+ ]+ , Header+ 2+ ( "sec:wrapping-div" , [] , [] )+ [ Str "Wrapping" , Space , Str "div" ]+ , Para+ [ Str "Wrapping"+ , Space+ , Str "code"+ , Space+ , Str "block"+ , Space+ , Str "without"+ , Space+ , Str "label"+ , Space+ , Str "in"+ , Space+ , Str "a"+ , Space+ , Str "div"+ , Space+ , Str "with"+ , Space+ , Str "id"+ , Space+ , Code ( "" , [] , [] ) "lst:..."+ , Space+ , Str "and"+ , Space+ , Str "class,"+ , Space+ , Str "starting"+ , Space+ , Str "with"+ , Space+ , Code ( "" , [] , [] ) "listing"+ , Str ","+ , Space+ , Str "and"+ , Space+ , Str "adding"+ , Space+ , Str "paragraph"+ , Space+ , Str "before"+ , Space+ , Str "code"+ , Space+ , Str "block,"+ , Space+ , Str "but"+ , Space+ , Str "inside"+ , Space+ , Str "div,"+ , Space+ , Str "will"+ , Space+ , Str "treat"+ , Space+ , Str "said"+ , Space+ , Str "paragraph"+ , Space+ , Str "as"+ , Space+ , Str "code"+ , Space+ , Str "block"+ , Space+ , Str "caption."+ ]+ , Div+ ( "lst:wrappingDiv" , [ "listing" , "haskell" ] , [] )+ [ Para+ [ Str "Listing"+ , Space+ , Str "3:"+ , Space+ , Str "Listing"+ , Space+ , Str "caption"+ ]+ , CodeBlock+ ( "" , [ "haskell" ] , [] )+ "main :: IO ()\nmain = putStrLn \"Hello World!\""+ ]+ , Header+ 1+ ( "sec:unnumbered-chapter." , [ "unnumbered" ] , [] )+ [ Str "Unnumbered" , Space , Str "chapter." ]+ , Para+ [ Str "This"+ , Space+ , Str "chapter"+ , Space+ , Str "doesn\8217t"+ , Space+ , Str "change"+ , Space+ , Str "chapter"+ , Space+ , Str "prefix"+ , Space+ , Str "of"+ , Space+ , Str "referenced"+ , Space+ , Str "elements,"+ , Space+ , Str "instead"+ , Space+ , Str "keeping"+ , Space+ , Str "number"+ , Space+ , Str "of"+ , Space+ , Str "previous"+ , Space+ , Str "chapter,"+ , Space+ , Str "e.g."+ , SoftBreak+ , Span+ ( "eq:eqn2" , [] , [] )+ [ Math+ DisplayMath+ " S(x) = \\int_{x_1}^{x_2} a x+b \\ \\mathrm{d}x \\qquad{(3)}"+ ]+ ]+ , Header+ 1+ ( "sec:chapter-5.-reference-lists" , [] , [] )+ [ Str "Chapter"+ , Space+ , Str "5."+ , Space+ , Str "Reference"+ , Space+ , Str "lists"+ ]+ , Para+ [ Str "It\8217s"+ , Space+ , Str "also"+ , Space+ , Str "possible"+ , Space+ , Str "to"+ , Space+ , Str "show"+ , Space+ , Str "lists"+ , Space+ , Str "of"+ , Space+ , Str "figures"+ , Space+ , Str "and"+ , Space+ , Str "tables,"+ , Space+ , Str "like"+ , Space+ , Str "this:"+ ]+ , Header+ 2+ ( "list-of-figures" , [] , [] )+ [ Str "List" , Space , Str "of" , Space , Str "Figures" ]+ , OrderedList+ ( 1 , DefaultStyle , DefaultDelim )+ [ [ Plain [ Str "A" , Space , Str "figure" ] ]+ , [ Plain [ Str "First" , Space , Str "figure" ] ]+ , [ Plain [ Str "Second" , Space , Str "figure" ] ]+ , [ Plain [ Str "Third" , Space , Str "figure" ] ]+ , [ Plain [ Str "Subfigure" , Space , Str "a" ] ]+ , [ Plain [ Str "Subfigure" , Space , Str "b" ] ]+ , [ Plain [ Str "Subfigures" , Space , Str "caption" ] ]+ ]+ , Header+ 2+ ( "list-of-tables" , [] , [] )+ [ Str "List" , Space , Str "of" , Space , Str "Tables" ]+ , OrderedList+ ( 1 , DefaultStyle , DefaultDelim )+ [ [ Plain [ Str "Table" , Space , Str "example" ] ] ]+ , Header+ 1+ ( "" , [] , [] )+ [ Str "List" , Space , Str "of" , Space , Str "Listings" ]+ , OrderedList+ ( 1 , DefaultStyle , DefaultDelim )+ [ [ Plain [ Str "Listing" , Space , Str "caption" ] ]+ , [ Plain [ Str "Listing" , Space , Str "caption" ] ]+ , [ Plain [ Str "Listing" , Space , Str "caption" ] ]+ ]+ , Header+ 1+ ( "sec:appendix-a.-custom-labels"+ , []+ , [ ( "label" , "AppA" ) ]+ )+ [ Str "Appendix"+ , Space+ , Str "A."+ , Space+ , Str "Custom"+ , Space+ , Str "labels"+ ]+ , Header+ 2+ ( "sec:custlabs" , [] , [ ( "label" , "CustLab" ) ] )+ [ Str "This"+ , Space+ , Str "section"+ , Space+ , Str "will"+ , Space+ , Str "have"+ , Space+ , Str "custom"+ , Space+ , Str "label"+ ]+ ]
test/m2m/delim/expect.md view
@@ -13,18 +13,18 @@ Some of those can be labelled: This is a test file with some referenced equations, line-[$$ this \qquad(1)$$]{#eq:0}+[$$ this \qquad{(1)}$$]{#eq:0} Some equations might be inside of text,-[$$ for example \qquad(2)$$]{#eq:1} this one.+[$$ for example \qquad{(2)}$$]{#eq:1} this one. Some equations might be on start of paragraphs: -[$$ start \qquad(3)$$]{#eq:2} of paragraph.+[$$ start \qquad{(3)}$$]{#eq:2} of paragraph. Other might be on separate paragraphs of their own: -[$$ separate \qquad(4)$$]{#eq:3}+[$$ separate \qquad{(4)}$$]{#eq:3} Then they can be referenced:
+ test/m2m/eqnBlockTemplate/expect.md view
@@ -0,0 +1,3 @@+::: {#eq:1}+$$\int_0^x e^x dx$$ $$(1)$$+:::
+ test/m2m/eqnBlockTemplate/expect.tex view
@@ -0,0 +1,1 @@+\begin{equation}\protect\hypertarget{eq:1}{}{\int_0^x e^x dx}\label{eq:1}\end{equation}
+ test/m2m/eqnBlockTemplate/input.md view
@@ -0,0 +1,7 @@+---+eqnBlockTemplate: |+ $$t$$ $$i$$+tableEqns: true+---++$$\int_0^x e^x dx$${#eq:1}
test/m2m/equationNumberLaTeX/input.md view
@@ -1,5 +1,6 @@ --- equationNumberTeX: \\tag+eqnIndexTemplate: $$i$$ --- This is a test file with some referenced equations, line $$ this $$
test/m2m/equations-auto/expect.md view
@@ -1,32 +1,32 @@ This is a test file with some referenced equations, line-$$ this \qquad(1)$$+$$ this \qquad{(1)}$$ -Some equations might be inside of text, $$ for example \qquad(2)$$ this-one.+Some equations might be inside of text, $$ for example \qquad{(2)}$$+this one. Some equations might be on start of paragraphs: -$$ start \qquad(3)$$ of paragraph.+$$ start \qquad{(3)}$$ of paragraph. Other might be on separate paragraphs of their own: -$$ separate \qquad(4)$$+$$ separate \qquad{(4)}$$ Some of those can be labelled: This is a test file with some referenced equations, line-[$$ this \qquad(5)$$]{#eq:0}+[$$ this \qquad{(5)}$$]{#eq:0} Some equations might be inside of text,-[$$ for example \qquad(6)$$]{#eq:1} this one.+[$$ for example \qquad{(6)}$$]{#eq:1} this one. Some equations might be on start of paragraphs: -[$$ start \qquad(7)$$]{#eq:2} of paragraph.+[$$ start \qquad{(7)}$$]{#eq:2} of paragraph. Other might be on separate paragraphs of their own: -[$$ separate \qquad(8)$$]{#eq:3}+[$$ separate \qquad{(8)}$$]{#eq:3} Then they can be referenced:
test/m2m/equations-tables-auto/expect.md view
@@ -2,10 +2,10 @@ <div> - --------------------------------------------------------------- ---------- $$ this $$ $$(1)$$-- --------------------------------------------------------------- ---------++:-------------------------------------------------------------:+-----:++| $$ this $$ | $$( |+| | 1)$$ |++---------------------------------------------------------------+------+ </div> @@ -13,10 +13,10 @@ <div> - --------------------------------------------------------------- ---------- $$ for example $$ $$(2)$$-- --------------------------------------------------------------- ---------++:-------------------------------------------------------------:+-----:++| $$ for example $$ | $$( |+| | 2)$$ |++---------------------------------------------------------------+------+ </div> @@ -26,10 +26,10 @@ <div> - --------------------------------------------------------------- ---------- $$ start $$ $$(3)$$-- --------------------------------------------------------------- ---------++:-------------------------------------------------------------:+-----:++| $$ start $$ | $$( |+| | 3)$$ |++---------------------------------------------------------------+------+ </div> @@ -39,10 +39,10 @@ <div> - --------------------------------------------------------------- ---------- $$ separate $$ $$(4)$$-- --------------------------------------------------------------- ---------++:-------------------------------------------------------------:+-----:++| $$ separate $$ | $$( |+| | 4)$$ |++---------------------------------------------------------------+------+ </div> @@ -51,19 +51,19 @@ This is a test file with some referenced equations, line ::: {#eq:0}- --------------------------------------------------------------- ---------- $$ this $$ $$(5)$$-- --------------------------------------------------------------- ---------++:-------------------------------------------------------------:+-----:++| $$ this $$ | $$( |+| | 5)$$ |++---------------------------------------------------------------+------+ ::: Some equations might be inside of text, ::: {#eq:1}- --------------------------------------------------------------- ---------- $$ for example $$ $$(6)$$-- --------------------------------------------------------------- ---------++:-------------------------------------------------------------:+-----:++| $$ for example $$ | $$( |+| | 6)$$ |++---------------------------------------------------------------+------+ ::: this one.@@ -71,10 +71,10 @@ Some equations might be on start of paragraphs: ::: {#eq:2}- --------------------------------------------------------------- ---------- $$ start $$ $$(7)$$-- --------------------------------------------------------------- ---------++:-------------------------------------------------------------:+-----:++| $$ start $$ | $$( |+| | 7)$$ |++---------------------------------------------------------------+------+ ::: of paragraph.@@ -82,10 +82,10 @@ Other might be on separate paragraphs of their own: ::: {#eq:3}- --------------------------------------------------------------- ---------- $$ separate $$ $$(8)$$-- --------------------------------------------------------------- ---------++:-------------------------------------------------------------:+-----:++| $$ separate $$ | $$( |+| | 8)$$ |++---------------------------------------------------------------+------+ ::: Then they can be referenced:
test/m2m/equations-tables/expect.md view
@@ -15,19 +15,19 @@ This is a test file with some referenced equations, line ::: {#eq:0}- --------------------------------------------------------------- ---------- $$ this $$ $$(1)$$-- --------------------------------------------------------------- ---------++:-------------------------------------------------------------:+-----:++| $$ this $$ | $$( |+| | 1)$$ |++---------------------------------------------------------------+------+ ::: Some equations might be inside of text, ::: {#eq:1}- --------------------------------------------------------------- ---------- $$ for example $$ $$(2)$$-- --------------------------------------------------------------- ---------++:-------------------------------------------------------------:+-----:++| $$ for example $$ | $$( |+| | 2)$$ |++---------------------------------------------------------------+------+ ::: this one.@@ -35,10 +35,10 @@ Some equations might be on start of paragraphs: ::: {#eq:2}- --------------------------------------------------------------- ---------- $$ start $$ $$(3)$$-- --------------------------------------------------------------- ---------++:-------------------------------------------------------------:+-----:++| $$ start $$ | $$( |+| | 3)$$ |++---------------------------------------------------------------+------+ ::: of paragraph.@@ -46,10 +46,10 @@ Other might be on separate paragraphs of their own: ::: {#eq:3}- --------------------------------------------------------------- ---------- $$ separate $$ $$(4)$$-- --------------------------------------------------------------- ---------++:-------------------------------------------------------------:+-----:++| $$ separate $$ | $$( |+| | 4)$$ |++---------------------------------------------------------------+------+ ::: Then they can be referenced:
test/m2m/equations/expect.md view
@@ -13,18 +13,18 @@ Some of those can be labelled: This is a test file with some referenced equations, line-[$$ this \qquad(1)$$]{#eq:0}+[$$ this \qquad{(1)}$$]{#eq:0} Some equations might be inside of text,-[$$ for example \qquad(2)$$]{#eq:1} this one.+[$$ for example \qquad{(2)}$$]{#eq:1} this one. Some equations might be on start of paragraphs: -[$$ start \qquad(3)$$]{#eq:2} of paragraph.+[$$ start \qquad{(3)}$$]{#eq:2} of paragraph. Other might be on separate paragraphs of their own: -[$$ separate \qquad(4)$$]{#eq:3}+[$$ separate \qquad{(4)}$$]{#eq:3} Then they can be referenced:
test/m2m/links-names/expect.md view
@@ -13,18 +13,18 @@ Some of those can be labelled: This is a test file with some referenced equations, line-[$$ this \qquad(1)$$]{#eq:0}+[$$ this \qquad{(1)}$$]{#eq:0} Some equations might be inside of text,-[$$ for example \qquad(2)$$]{#eq:1} this one.+[$$ for example \qquad{(2)}$$]{#eq:1} this one. Some equations might be on start of paragraphs: -[$$ start \qquad(3)$$]{#eq:2} of paragraph.+[$$ start \qquad{(3)}$$]{#eq:2} of paragraph. Other might be on separate paragraphs of their own: -[$$ separate \qquad(4)$$]{#eq:3}+[$$ separate \qquad{(4)}$$]{#eq:3} Then they can be referenced:
test/m2m/links/expect.md view
@@ -13,18 +13,18 @@ Some of those can be labelled: This is a test file with some referenced equations, line-[$$ this \qquad(1)$$]{#eq:0}+[$$ this \qquad{(1)}$$]{#eq:0} Some equations might be inside of text,-[$$ for example \qquad(2)$$]{#eq:1} this one.+[$$ for example \qquad{(2)}$$]{#eq:1} this one. Some equations might be on start of paragraphs: -[$$ start \qquad(3)$$]{#eq:2} of paragraph.+[$$ start \qquad{(3)}$$]{#eq:2} of paragraph. Other might be on separate paragraphs of their own: -[$$ separate \qquad(4)$$]{#eq:3}+[$$ separate \qquad{(4)}$$]{#eq:3} Then they can be referenced:
test/m2m/multiple-eqn-same-para/expect.md view
@@ -1,3 +1,3 @@-Simple test [$$x=y\qquad(1)$$]{#eq:1} [$$x=y\qquad(2)$$]{#eq:2}+Simple test [$$x=y\qquad{(1)}$$]{#eq:1} [$$x=y\qquad{(2)}$$]{#eq:2} eqns. 1, 2
test/m2m/secLabels/expect.tex view
@@ -19,15 +19,15 @@ \hypertarget{tbl:mytable}{} \begin{longtable}[]{@{}lll@{}} \caption{\label{tbl:mytable}My table}\tabularnewline-\toprule+\toprule() a & b & c \\-\midrule+\midrule() \endfirsthead-\toprule+\toprule() a & b & c \\-\midrule+\midrule() \endhead 1 & 2 & 3 \\ 4 & 5 & 6 \\-\bottomrule+\bottomrule() \end{longtable}
test/m2m/setLabelAttribute/expect.md view
@@ -2,7 +2,7 @@ {#fig:1 label="1.1"} -[$$equation\qquad(1.1)$$]{#eq:1 label="1.1"}+[$$equation\qquad{(1.1)}$$]{#eq:1 label="(1.1)"} ::: {#tbl:1 label="1.1"} a b
test/m2m/setLabelAttribute/expect.tex view
@@ -14,16 +14,16 @@ \hypertarget{tbl:1}{} \begin{longtable}[]{@{}ll@{}} \caption{\label{tbl:1}Table}\tabularnewline-\toprule+\toprule() a & b \\-\midrule+\midrule() \endfirsthead-\toprule+\toprule() a & b \\-\midrule+\midrule() \endhead 1 & 2 \\-\bottomrule+\bottomrule() \end{longtable} \begin{codelisting}
test/test-integrative.hs view
@@ -41,7 +41,7 @@ input <- runIO $ readFile ("test" </> "m2m" </> dir </> "input.md") expect_md <- runIO $ readFile ("test" </> "m2m" </> dir </> "expect.md") let ro = def { readerExtensions = pandocExtensions }- wo = def { writerExtensions = pandocExtensions+ wo = def { writerExtensions = disableExtension Ext_raw_attribute pandocExtensions , writerHighlightStyle=Just pygments , writerListings = dir `elem` listingsDirs } p@(Pandoc meta _) <- runIO $ either (error . show) id <$> P.runIO (readMarkdown ro $ T.pack input)
test/test-pandoc-crossref.hs view
@@ -18,7 +18,7 @@ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -} -{-# LANGUAGE FlexibleContexts, CPP, OverloadedStrings, RankNTypes #-}+{-# LANGUAGE FlexibleContexts, CPP, OverloadedStrings, RankNTypes, ScopedTypeVariables #-} import Test.Hspec import Text.Pandoc hiding (getDataFileName) import Text.Pandoc.Builder@@ -50,7 +50,7 @@ describe "References.Blocks.replaceInlines" $ do it "Labels equations" $ testAll (equation' "a^2+b^2=c^2" "equation")- (spanWith ("eq:equation", [], []) (equation' "a^2+b^2=c^2\\qquad(1)" ""),+ (spanWith ("eq:equation", [], []) (equation' "a^2+b^2=c^2\\qquad{(1)}" ""), eqnRefs =: M.fromList $ refRec'' "eq:equation" 1) it "Labels equations in the middle of text" $ testAll (@@ -59,7 +59,7 @@ <> text " it should be labeled") ( text "This is an equation: "- <> spanWith ("eq:equation", [], []) (equation' "a^2+b^2=c^2\\qquad(1)" "")+ <> spanWith ("eq:equation", [], []) (equation' "a^2+b^2=c^2\\qquad{(1)}" "") <> text " it should be labeled", eqnRefs =: M.fromList $ refRec'' "eq:equation" 1) it "Labels equations in the beginning of text" $@@ -67,7 +67,7 @@ equation' "a^2+b^2=c^2" "equation" <> text " it should be labeled") (- spanWith ("eq:equation", [], []) (equation' "a^2+b^2=c^2\\qquad(1)" "")+ spanWith ("eq:equation", [], []) (equation' "a^2+b^2=c^2\\qquad{(1)}" "") <> text " it should be labeled", eqnRefs =: M.fromList $ refRec'' "eq:equation" 1) it "Labels equations in the end of text" $@@ -76,7 +76,7 @@ <> equation' "a^2+b^2=c^2" "equation") ( text "This is an equation: "- <> spanWith ("eq:equation", [], []) (equation' "a^2+b^2=c^2\\qquad(1)" ""),+ <> spanWith ("eq:equation", [], []) (equation' "a^2+b^2=c^2\\qquad{(1)}" ""), eqnRefs =: M.fromList $ refRec'' "eq:equation" 1) -- TODO:@@ -140,7 +140,7 @@ ) it "Labels equations" $ testAll (equation "a^2+b^2=c^2" "equation")- (para $ spanWith ("eq:equation", [], []) (equation' "a^2+b^2=c^2\\qquad(1)" ""),+ (para $ spanWith ("eq:equation", [], []) (equation' "a^2+b^2=c^2\\qquad{(1)}" ""), eqnRefs =: M.fromList $ refRec'' "eq:equation" 1) it "Labels equations in the middle of text" $ testAll (para $@@ -149,7 +149,7 @@ <> text " it should be labeled") (para $ text "This is an equation: "- <> spanWith ("eq:equation", [], []) (equation' "a^2+b^2=c^2\\qquad(1)" "")+ <> spanWith ("eq:equation", [], []) (equation' "a^2+b^2=c^2\\qquad{(1)}" "") <> text " it should be labeled", eqnRefs =: M.fromList $ refRec'' "eq:equation" 1) it "Labels equations in the beginning of text" $@@ -157,7 +157,7 @@ equation' "a^2+b^2=c^2" "equation" <> text " it should be labeled") (para $- spanWith ("eq:equation", [], []) (equation' "a^2+b^2=c^2\\qquad(1)" "")+ spanWith ("eq:equation", [], []) (equation' "a^2+b^2=c^2\\qquad{(1)}" "") <> text " it should be labeled", eqnRefs =: M.fromList $ refRec'' "eq:equation" 1) it "Labels equations in the end of text" $@@ -166,7 +166,7 @@ <> equation' "a^2+b^2=c^2" "equation") (para $ text "This is an equation: "- <> spanWith ("eq:equation", [], []) (equation' "a^2+b^2=c^2\\qquad(1)" ""),+ <> spanWith ("eq:equation", [], []) (equation' "a^2+b^2=c^2\\qquad{(1)}" ""), eqnRefs =: M.fromList $ refRec'' "eq:equation" 1) it "Labels tables" $ testAll (table' "Test table" "table")@@ -252,7 +252,7 @@ describe "Util.Template" $ it "Applies templates" $- let template=Util.Template.makeTemplate defaultMeta (toList $ displayMath "figureTitle" <> displayMath "i" <> displayMath "t")+ let (template :: Util.Template.Template)=Util.Template.makeTemplate defaultMeta (toList $ displayMath "figureTitle" <> displayMath "i" <> displayMath "t") in Util.Template.applyTemplate [Str "1"] [Str "title"] template `shouldBe` toList (str "Figure" <> str "1" <> str "title") @@ -313,7 +313,7 @@ it "Tbl labels" $ table' "A table" "some_table1" <> para (citeGen "tbl:some_table" [1])- `test` "\\hypertarget{tbl:some_table1}{}\n\\begin{longtable}[]{@{}@{}}\n\\caption{\\label{tbl:some_table1}A table}\\tabularnewline\n\\toprule\n\\endhead\n \\\\\n\\bottomrule\n\\end{longtable}\n\ntbl.~\\ref{tbl:some_table1}"+ `test` "\\hypertarget{tbl:some_table1}{}\n\\begin{longtable}[]{@{}@{}}\n\\caption{\\label{tbl:some_table1}A table}\\tabularnewline\n\\toprule()\n\\endhead\n \\\\\n\\bottomrule()\n\\end{longtable}\n\ntbl.~\\ref{tbl:some_table1}" #endif it "Code block labels" $ do