pandoc-crossref 0.2.1.3 → 0.2.2.0
raw patch · 6 files changed
+195/−127 lines, 6 filesdep ~basedep ~data-defaultdep ~pandoc
Dependency ranges changed: base, data-default, pandoc, pandoc-types
Files
- README.md +93/−19
- ghc-8/Text/Pandoc/CrossRef/Util/Settings/Template.hs +74/−0
- lib/Text/Pandoc/CrossRef/References/Blocks.hs +2/−7
- lib/Text/Pandoc/CrossRef/Util/Settings/Template.hs +0/−75
- pandoc-crossref.cabal +19/−11
- test/test-pandoc-crossref.hs +7/−15
README.md view
@@ -266,42 +266,46 @@ There are several parameters that can be set via YAML metadata (either by passing `-M` to `pandoc`, or by setting it in source markdown) -Following variables are supported:+A list of variables follows. +#### General options+ * `cref`: if True, latex export will use `\cref` from cleveref package. Only relevant for LaTeX output. `\usepackage{cleveref}` will be automatically added to `header-includes`. * `chapters`: if True, number elements as `chapter.item`, and restart `item` on each first-level heading (as `--chapters` for latex/pdf output) * `chaptersDepth`, default `1`: header level to treat as "chapter". If `chaptersDepth>1`, then items will be prefixed with several numbers, corresponding to header numbers, e.g. `fig. 1.4.3`. * `listings`: if True, generate code blocks for `listings` package. Only relevant for LaTeX output. `\usepackage{listings}` will be automatically added to `header-includes`. You need to specify `--listings` option as well. * `codeBlockCaptions`: if True, parse table-style code block captions.+* `autoSectionLabels`, default `false`: Automatically prefix all section labels with `sec:`. Note that this messes with pandoc's automatic header references.++#### Item title format+ * `figureTitle`, default `Figure`: Word(s) to prepend to figure titles, e.g. `Figure 1: Description` * `tableTitle`, default `Table`: Word(s) to prepend to table titles, e.g. `Table 1: Description` * `listingTitle`, default `Listing`: Word(s) to prepend to listing titles, e.g. `Listing 1: Description` * `titleDelim`, default `:`: What to put between object number and caption text.++##### Subfigure-specific++See [Subfigures](#subfigures)++* `ccsDelim`, default `, `: delimiter for collected subfigure captions. See [Subfigures](#subfigures) and [Templates](#templates)+* `ccsLabelSep`, default ` — `: delimiter used between subfigure label and subfigure caption in collected captions. See [Subfigures](#subfigures) and [Templates](#templates)++#### List titles++* `lofTitle`, default `# List of Figures`: Title for list of figures (lof)+* `lotTitle`, default `# List of Tables`: Title for list of tables (lot)+* `lolTitle`, default `# List of Listings`: Title for list of listings (lol)++#### Reference format+ * `figPrefix`, default `fig.`, `figs.`: Prefix for references to figures, e.g. `figs. 1-3` * `eqnPrefix`, default `eq.`, `eqns.`: Prefix for references to equations, e.g. `eqns. 3,4` * `tblPrefix`, default `tbl.`, `tbls.`: Prefix for references to tables, e.g. `tbl. 2` * `lstPrefix`, default `lst.`, `lsts.`: Prefix for references to lists, e.g. `lsts. 2,5` * `secPrefix`, default `sec.`, `secs.`: Prefix for references to sections, e.g. `secs. 2,5`-* `autoSectionLabels`, default `false`: Automatically prefix all section labels with `sec:`. Note that this messes with pandoc's automatic header references. * `chapDelim`, default `.`: Delimiter between chapter number and item number. * `rangeDelim`, default `-`: Delimiter between reference ranges, e.g. `eq. 2-5`-* `lofTitle`, default `# List of Figures`: Title for list of figures (lof)-* `lotTitle`, default `# List of Tables`: Title for list of tables (lot)-* `lolTitle`, default `# List of Listings`: Title for list of listings (lol)-* `figureTemplate`, default `\\[figureTitle\\] \\[i\\]\\[titleDelim\\] \\[t\\]`: template for figure captions, see [Templates](#templates)-* `tableTemplate`, default `\\[tableTitle\\] \\[i\\]\\[titleDelim\\] \\[t\\]`: template for table captions, see [Templates](#templates)-* `listingTemplate`, default `\\[listingTitle\\] \\[i\\]\\[titleDelim\\] \\[t\\]`: template for listing captions, see [Templates](#templates)-* `subfigureTemplate`, default `\\[figureTitle\\] \\[i\\]\\[titleDelim\\] \\[t\\]. \\[ccs\\]`: template for subfigure divs captions. See [Subfigures](#subfigures)-* `subfigureChildTemplate`, default `\\[i\\]`: template for actual subfigure captions. See [Subfigures](#subfigures)-* `ccsTemplate`, default `\\[i\\]\\[ccsLabelSep\\]\\[t\\]`: template for collected subfigure captions. See [Subfigures](#subfigures), [Templates](#templates)-* `figLabels`, default unset: custom numbering scheme for figures. See [Custom Numbering Schemes](#custom-numbering-schemes)-* `subfigLabels`, default `alpha a`: custom numbering scheme for subfigures. See [Custom Numbering Schemes](#custom-numbering-schemes)-* `eqnLabels`, default unset: custom numbering scheme for equations. See [Custom Numbering Schemes](#custom-numbering-schemes)-* `tblLabels`, default unset: custom numbering scheme for tables. See [Custom Numbering Schemes](#custom-numbering-schemes)-* `lstLabels`, default unset: custom numbering scheme for listings. See [Custom Numbering Schemes](#custom-numbering-schemes)-* `secLabels`, default unset: custom numbering scheme for sections. See [Custom Numbering Schemes](#custom-numbering-schemes)-* `ccsDelim`, default `, `: delimiter for collected subfigure captions. See [Subfigures](#subfigures) and [Templates](#templates)-* `ccsLabelSep`, default ` — `: delimiter used between subfigure label and subfigure caption in collected captions. See [Subfigures](#subfigures) and [Templates](#templates) `figPrefix`, `eqnPrefix`, `tblPrefix`, `lstPrefix` can be YAML arrays. That way, value at index corresponds to total number of references in group, f.ex. @@ -323,6 +327,43 @@ They can also be used with first character capitalized, i.e. `FigPrefix`, etc. In this case, these settings will override default reference capitailzation settings. +#### Custom numbering++See [Custom Numbering Schemes](#custom-numbering-schemes)++* `figLabels`, default unset: custom numbering scheme for figures.+* `subfigLabels`, default `alpha a`: custom numbering scheme for subfigures.+* `eqnLabels`, default unset: custom numbering scheme for equations.+* `tblLabels`, default unset: custom numbering scheme for tables.+* `lstLabels`, default unset: custom numbering scheme for listings.+* `secLabels`, default unset: custom numbering scheme for sections.++#### Item title templates++See [Templates](#templates)++* `figureTemplate`, default `\\[figureTitle\\] \\[i\\]\\[titleDelim\\] \\[t\\]`: template for figure captions+* `tableTemplate`, default `\\[tableTitle\\] \\[i\\]\\[titleDelim\\] \\[t\\]`: template for table captions+* `listingTemplate`, default `\\[listingTitle\\] \\[i\\]\\[titleDelim\\] \\[t\\]`: template for listing captions++##### Subfigure templates++See [Subfigures](#subfigures)++* `subfigureTemplate`, default `\\[figureTitle\\] \\[i\\]\\[titleDelim\\] \\[t\\]. \\[ccs\\]`: template for subfigure divs captions.+* `subfigureChildTemplate`, default `\\[i\\]`: template for actual subfigure captions.+* `ccsTemplate`, default `\\[i\\]\\[ccsLabelSep\\]\\[t\\]`: template for collected subfigure captions.++#### Reference templates++See [Templates](#templates)++* `figPrefixTemplate`, defualt `\\[p\\] \\[i\\]` -- figure reference template+* `eqnPrefixTemplate`, defualt `\\[p\\] \\[i\\]` -- equation reference template+* `tblPrefixTemplate`, defualt `\\[p\\] \\[i\\]` -- table reference template+* `lstPrefixTemplate`, defualt `\\[p\\] \\[i\\]` -- listing reference template+* `secPrefixTemplate`, defualt `\\[p\\] \\[i\\]` -- section reference template+ #### LaTeX customization Support for above variables with LaTeX/PDF output is limited. In particular, the following variables are honored:@@ -357,8 +398,25 @@ * `t` -- object caption, as given in source Markdown * `ccs` -- collected subfigure captions. Only applicable to `subfigureTemplate`. Collected captions will be separated by `ccsDelim` and individual captions will be printed with `ccsTemplate`. See [Subfigures](#subfigures) +`xPrefixTemplate`, where `x` is `fig`, `eqn`, etc, are a special case. Those don't have `t` variable, since there is no caption in source markdown, but instead have `p` variable, that binds to relevant `xPrefix`. This is done this way, since actual prefix vaule can depend on `i`.+ Please note that at the moment, templates are not supported with LaTeX/PDF output. +### Custom Numbering Schemes++It's possible to use other numbering schemes apart from arabic. This is controlled by several metadata options, consult [Customization](#customization) for a list. Possible values are:++- `arabic` -- arabic numbers (1, 2, 3 ...)+- `roman` -- roman numbers (I, II, III, IV, ...)+- `alpha x`, where `x` is first letter to start from. This will work for any letter, but will use UTF-8 codepage to determine what's next, so using something strange is not advised. For example, you can safely use `alpha a` to get lowercase latin letters for 26 figures. After that, it will get weird (since basic latin alphabet has 26 letters). Specifically, it will go into characters space (`{`, `|`, `}`, etc). You can consult http://www.fileformat.info/info/unicode/block/basic_latin/utf8test.htm for general idea on letter progression.+- list of strings. You can define a YAML array for numbers. Mapping is 1:1. For example,+ ```yaml+ figLabels: [α, β, γ, 1, 2, 3, I, II, III]+ ```+ will give first figure label 'α', second -- 'β', etc.++ Note that it will repeat last item in list indefinitely if there are more images than items in list.+ ### Settings file It is also possible to set variables used by pandoc-crossref with a separate YAML file. If a given variable is not set in metadata, then pandoc-crossref will attempt to read it from file specified by `crossrefYaml` metadata variable, or, if not set, from `pandoc-crossref.yaml` from current working directory. This allows for reusable configurations. One possible application is ad-hoc internationalization.@@ -380,3 +438,19 @@ One could use this with pandoc-crossref as follows: `pandoc -F pandoc-crossref.hs -M "crossrefYaml=$HOME/misc/pandoc-crossref-es.yaml"`++# License++This software is licensed under GNU GPL 2. See [LICENSE.md](https://github.com/lierdakil/pandoc-crossref/blob/master/LICENSE.md) for details.++© 2016 Nikolay Yakimov et al++Contributors (per GPL, holders of copyright on their respective contributions):+* Nikolay Yakimov+* Wlad+* scoavoux+* Matthew Salganik+* Hadrien Mary+* Felix Yan+* Chris Black+* Bart Mesuere
+ ghc-8/Text/Pandoc/CrossRef/Util/Settings/Template.hs view
@@ -0,0 +1,74 @@+{-# 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 qualified Data.Map as M+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.CrossRef.Util.CustomLabels (customLabel)++namedFields :: Con -> [VarStrictType]+namedFields (RecC _ fs) = fs+namedFields (ForallC _ _ c) = namedFields c+namedFields _ = []++fromRecDef :: forall t a r. Name -> t -> (Name -> Name -> Q [a]) -> (t -> [a] -> r) -> Q r+fromRecDef t cname f c = do+ info <- reify t+ reified <- case info of+ TyConI dec -> return dec+ _ -> fail "No cons"+ (_, cons) <- case reified of+ DataD _ _ params _ cons' _ -> return (params, cons')+ NewtypeD _ _ params _ con' _ -> return (params, [con'])+ _ -> fail "No cons"+ decs <- fmap concat . mapM (\ (name,_,_) -> f t name) . nub $ concatMap namedFields cons+ return $ c cname decs++nameDeriveSetters :: Name -> Q [Dec]+nameDeriveSetters t = fromRecDef t undefined (const makeAcc) (const id)++dropQualifiers :: Name -> Name+dropQualifiers (Name occ _) = mkName (occString occ)++makeAcc :: Name -> Q [Dec]+makeAcc (dropQualifiers -> accName) = do+ body <- [| Meta . M.singleton $(liftString $ show accName) . toMetaValue |]+ sig <- [t|forall a. ToMetaValue a => a -> Meta|]+ return+ [ SigD accName sig+ , ValD (VarP accName) (NormalB body) []+ ]++makeCon :: Name -> Name -> Q Exp+makeCon t cname = fromRecDef t cname makeCon' RecConE++makeCon' :: Name -> Name -> Q [(Name, Exp)]+makeCon' t accName = do+ VarI _ t' _ <- reify accName+ funT <- [t|$(conT t) -> Bool -> Int -> [Inline]|]+ inlT <- [t|$(conT t) -> [Inline]|]+ blkT <- [t|$(conT t) -> [Block]|]+ fmtT <- [t|$(conT t) -> Maybe Format|]+ boolT <- [t|$(conT t) -> Bool|]+ intT <- [t|$(conT t) -> Int|]+ tmplT <- [t|$(conT t) -> Template|]+ clT <- [t|$(conT t) -> String -> Int -> Maybe String|]+ let varName | Name (OccName n) _ <- accName = liftString n+ let dtv = return $ VarE $ mkName "dtv"+ body <-+ if+ | t' == boolT -> [|getMetaBool $(varName) $(dtv)|]+ | t' == intT -> [|read $ getMetaString $(varName) $(dtv)|]+ | t' == funT -> [|tryCapitalizeM (flip (getMetaList toInlines) $(dtv)) $(varName)|]+ | t' == inlT -> [|getMetaInlines $(varName) $(dtv)|]+ | t' == blkT -> [|getMetaBlock $(varName) $(dtv)|]+ | t' == tmplT -> [|makeTemplate $(dtv) $ getMetaInlines $(varName) $(dtv)|]+ | t' == clT -> [|customLabel $(dtv)|]+ | t' == fmtT -> return $ VarE $ mkName "fmt"+ | otherwise -> fail $ show t'+ return [(accName, body)]
lib/Text/Pandoc/CrossRef/References/Blocks.hs view
@@ -1,4 +1,4 @@-{-# LANGUAGE Rank2Types, MultiWayIf, CPP #-}+{-# LANGUAGE Rank2Types, MultiWayIf #-} module Text.Pandoc.CrossRef.References.Blocks ( replaceAll ) where@@ -198,12 +198,7 @@ | "fig:" `isPrefixOf` label -> do idxStr <- replaceAttr opts label (lookup "label" attrs) alt imgRefs let alt' = case outFormat opts of- f | isFormat "latex" f ->-#if MIN_VERSION_pandoc(1,17,0)- alt-#else- RawInline (Format "tex") (mkLaTeXLabel label) : alt-#endif+ f | isFormat "latex" f -> alt _ -> applyTemplate idxStr alt $ figureTemplate opts return $ Image attr alt' img | otherwise ->
− lib/Text/Pandoc/CrossRef/Util/Settings/Template.hs
@@ -1,75 +0,0 @@-{-# LANGUAGE TemplateHaskell, RankNTypes, ViewPatterns, UnicodeSyntax, MultiWayIf #-}-module Text.Pandoc.CrossRef.Util.Settings.Template where--import Text.Pandoc.Definition-import Text.Pandoc.Builder-import Text.Pandoc.CrossRef.Util.Meta-import qualified Data.Map as M-import Language.Haskell.TH hiding (Inline)-import Language.Haskell.TH.Syntax hiding (Inline)-import Data.List-import Control.Monad-import Text.Pandoc.CrossRef.Util.Template-import Text.Pandoc.CrossRef.Util.CustomLabels (customLabel)--namedFields :: Con -> [VarStrictType]-namedFields (RecC _ fs) = fs-namedFields (ForallC _ _ c) = namedFields c-namedFields _ = []--fromRecDef :: ∀ t a r. Name -> t -> (Name -> Name -> Q [a]) -> (t -> [a] -> r) -> Q r-fromRecDef t cname f c = do- info <- reify t- reified <- case info of- TyConI dec -> return dec- _ -> fail "No cons"- (_, cons) <- case reified of- DataD _ _ params cons' _ -> return (params, cons')- NewtypeD _ _ params con' _ -> return (params, [con'])- _ -> fail "No cons"- decs <- liftM concat . mapM (\ (name,_,_) -> f t name) . nub $ concatMap namedFields cons- return $ c cname decs--nameDeriveSetters :: Name -> Q [Dec]-nameDeriveSetters t = fromRecDef t undefined (const makeAcc) (const id)--dropQualifiers :: Name -> Name-dropQualifiers (Name occ _) = mkName (occString occ)--makeAcc :: Name -> Q [Dec]-makeAcc (dropQualifiers -> accName) = do- body <- [| Meta . M.singleton $(liftString $ show accName) . toMetaValue |]- sig <- [t|forall a. ToMetaValue a => a -> Meta|]- return- [ SigD accName sig- , ValD (VarP accName) (NormalB body) []- ]--makeCon :: Name -> Name -> Q Exp-makeCon t cname = fromRecDef t cname makeCon' RecConE--makeCon' :: Name -> Name -> Q [(Name, Exp)]-makeCon' t accName = do- VarI _ t' _ _ <- reify accName- funT <- [t|$(conT t) -> Bool -> Int -> [Inline]|]- inlT <- [t|$(conT t) -> [Inline]|]- blkT <- [t|$(conT t) -> [Block]|]- fmtT <- [t|$(conT t) -> Maybe Format|]- boolT <- [t|$(conT t) -> Bool|]- intT <- [t|$(conT t) -> Int|]- tmplT <- [t|$(conT t) -> Template|]- clT <- [t|$(conT t) -> String -> Int -> Maybe String|]- let varName | Name (OccName n) _ <- accName = liftString n- let dtv = return $ VarE $ mkName "dtv"- body <-- if- | t' == boolT -> [|getMetaBool $(varName) $(dtv)|]- | t' == intT -> [|read $ getMetaString $(varName) $(dtv)|]- | t' == funT -> [|tryCapitalizeM (flip (getMetaList toInlines) $(dtv)) $(varName)|]- | t' == inlT -> [|getMetaInlines $(varName) $(dtv)|]- | t' == blkT -> [|getMetaBlock $(varName) $(dtv)|]- | t' == tmplT -> [|makeTemplate $(dtv) $ getMetaInlines $(varName) $(dtv)|]- | t' == clT -> [|customLabel $(dtv)|]- | t' == fmtT -> return $ VarE $ mkName "fmt"- | otherwise -> fail $ show t'- return [(accName, body)]
pandoc-crossref.cabal view
@@ -2,7 +2,7 @@ -- documentation, see http://haskell.org/cabal/users-guide/ name: pandoc-crossref-version: 0.2.1.3+version: 0.2.2.0 synopsis: Pandoc filter for cross-references description: pandoc-crossref is a pandoc filter for numbering figures, equations, tables and cross-references to them. license: GPL-2@@ -25,7 +25,7 @@ source-repository this type: git location: https://github.com/lierdakil/pandoc-crossref- tag: v0.2.1.3+ tag: v0.2.2.0 library exposed-modules: Text.Pandoc.CrossRef@@ -46,12 +46,12 @@ , Text.Pandoc.CrossRef.Util.Settings.Template , Text.Pandoc.CrossRef.Util.Gap build-depends: base >=4.2 && <5- , pandoc >= 1.16 && <1.18+ , pandoc >= 1.17.1 && <1.18 , mtl >= 1.1 && <2.3 , containers >= 0.1 && <0.6- , pandoc-types >= 1.12.4.1 && < 1.17+ , pandoc-types >= 1.16 && < 1.17 , yaml >= 0.8 && <0.9- , data-default >= 0.4 && <0.7+ , data-default >= 0.4 && <0.8 , bytestring >=0.9 && <0.11 , data-accessor >= 0.2.2.6 && < 0.3.0.0 , data-accessor-template >= 0.2.1.12 && < 0.3.0.0@@ -60,18 +60,22 @@ , roman-numerals == 0.5.* , syb >= 0.4 && < 0.7 hs-source-dirs: lib+ if impl(ghc >= 8.0.1)+ hs-source-dirs: ghc-8+ else+ hs-source-dirs: ghc-7 Ghc-Options: -Wall default-language: Haskell2010 executable pandoc-crossref main-is: pandoc-crossref.hs build-depends: base >=4.2 && <5- , pandoc >= 1.16 && <1.18+ , pandoc >= 1.17.1 && <1.18 , mtl >= 1.1 && <2.3 , containers >= 0.1 && <0.6- , pandoc-types >= 1.12.4.1 && < 1.17+ , pandoc-types >= 1.16 && < 1.17 , yaml >= 0.8 && <0.9- , data-default >= 0.4 && <0.7+ , data-default >= 0.4 && <0.8 , bytestring >=0.9 && <0.11 , pandoc-crossref hs-source-dirs: src@@ -82,13 +86,17 @@ Type: exitcode-stdio-1.0 Main-Is: test-pandoc-crossref.hs hs-source-dirs: test, lib+ if impl(ghc >= 8.0.1)+ hs-source-dirs: ghc-8+ else+ hs-source-dirs: ghc-7 Build-Depends: base >=4.2 && <5- , pandoc >= 1.16 && <1.18+ , pandoc >= 1.17.1 && <1.18 , mtl >= 1.1 && <2.3 , containers >= 0.1 && <0.6- , pandoc-types >= 1.12.4.1 && < 1.17+ , pandoc-types >= 1.16 && < 1.17 , yaml >= 0.8 && <0.9- , data-default >= 0.4 && <0.7+ , data-default >= 0.4 && <0.8 , bytestring >=0.9 && <0.11 , hspec , process >=1 && <1.5
test/test-pandoc-crossref.hs view
@@ -1,4 +1,4 @@-{-# LANGUAGE FlexibleContexts, CPP #-}+{-# LANGUAGE FlexibleContexts #-} import Test.Hspec import Text.Pandoc hiding (readMarkdown) import Text.Pandoc.Builder@@ -276,40 +276,32 @@ it "Section labels" $ headerWith ("sec:section_label1", [], []) 1 (text "Section") <> para (citeGen "sec:section_label" [1])- `test` "\\section{Section}\\label{sec:sectionux5flabel1}\n\nsec.~\\ref{sec:sectionux5flabel1}"+ `test` "\\section{Section}\\label{sec:section_label1}\n\nsec.~\\ref{sec:section_label1}" it "Image labels" $ figure "img.png" [] "Title" "figure_label1" <> para (citeGen "fig:figure_label" [1])-#if MIN_VERSION_pandoc(1,17,0)- `test` "\\begin{figure}[htbp]\n\\centering\n\\includegraphics{img.png}\n\\caption{Title}\\label{fig:figureux5flabel1}\n\\end{figure}\n\nfig.~\\ref{fig:figureux5flabel1}"-#else- `test` "\\begin{figure}[htbp]\n\\centering\n\\includegraphics{img.png}\n\\caption{\\label{fig:figureux5flabel1}Title}\n\\end{figure}\n\nfig.~\\ref{fig:figureux5flabel1}"-#endif+ `test` "\\begin{figure}[htbp]\n\\centering\n\\includegraphics{img.png}\n\\caption{Title}\\label{fig:figure_label1}\n\\end{figure}\n\nfig.~\\ref{fig:figure_label1}" it "Eqn labels" $ equation "x^2" "some_equation1" <> para (citeGen "eq:some_equation" [1])- `test` "\\begin{equation}x^2\\label{eq:someux5fequation1}\\end{equation}\n\neq.~\\ref{eq:someux5fequation1}"+ `test` "\\begin{equation}x^2\\label{eq:some_equation1}\\end{equation}\n\neq.~\\ref{eq:some_equation1}" it "Tbl labels" $ table' "A table" "some_table1" <> para (citeGen "tbl:some_table" [1])-#if MIN_VERSION_pandoc(1,17,0)- `test` "\\begin{longtable}[]{@{}@{}}\n\\caption{\\label{tbl:someux5ftable1}A table }\\tabularnewline\n\\toprule\n\\tabularnewline\n\\midrule\n\\endfirsthead\n\\toprule\n\\tabularnewline\n\\midrule\n\\endhead\n\\tabularnewline\n\\bottomrule\n\\end{longtable}\n\ntbl.~\\ref{tbl:someux5ftable1}"-#else- `test` "\\begin{longtable}[c]{@{}@{}}\n\\caption{\\label{tbl:someux5ftable1}A table }\\tabularnewline\n\\toprule\n\\tabularnewline\n\\midrule\n\\endfirsthead\n\\toprule\n\\tabularnewline\n\\midrule\n\\endhead\n\\tabularnewline\n\\bottomrule\n\\end{longtable}\n\ntbl.~\\ref{tbl:someux5ftable1}"-#endif+ `test` "\\begin{longtable}[]{@{}@{}}\n\\caption{\\label{tbl:some_table1}A table }\\tabularnewline\n\\toprule\n\\tabularnewline\n\\midrule\n\\endfirsthead\n\\toprule\n\\tabularnewline\n\\midrule\n\\endhead\n\\tabularnewline\n\\bottomrule\n\\end{longtable}\n\ntbl.~\\ref{tbl:some_table1}" it "Code block labels" $ do codeBlock' "A code block" "some_codeblock1" <> para (citeGen "lst:some_codeblock" [1])- `test` "\\begin{codelisting}\n\\caption{A code block}\n\n\\hypertarget{lst:someux5fcodeblock1}{\\label{lst:someux5fcodeblock1}}\n\\begin{verbatim}\nmain :: IO ()\n\\end{verbatim}\n\n\\end{codelisting}\n\nlst.~\\ref{lst:someux5fcodeblock1}"+ `test` "\\begin{codelisting}\n\\caption{A code block}\n\n\\hypertarget{lst:some_codeblock1}{\\label{lst:some_codeblock1}}\n\\begin{verbatim}\nmain :: IO ()\n\\end{verbatim}\n\n\\end{codelisting}\n\nlst.~\\ref{lst:some_codeblock1}" let test1 = test' $ setMeta "codeBlockCaptions" True nullMeta infixr 5 `test1` codeBlockForTable "some_codeblock1" <> paraText ": A code block" <> para (citeGen "lst:some_codeblock" [1])- `test1` "\\begin{codelisting}\n\n\\caption{A code block}\n\n\\hypertarget{lst:someux5fcodeblock1}{\\label{lst:someux5fcodeblock1}}\n\\begin{verbatim}\nmain :: IO ()\n\\end{verbatim}\n\n\\end{codelisting}\n\nlst.~\\ref{lst:someux5fcodeblock1}"+ `test1` "\\begin{codelisting}\n\n\\caption{A code block}\n\n\\hypertarget{lst:some_codeblock1}{\\label{lst:some_codeblock1}}\n\\begin{verbatim}\nmain :: IO ()\n\\end{verbatim}\n\n\\end{codelisting}\n\nlst.~\\ref{lst:some_codeblock1}" citeGen :: String -> [Int] -> Inlines citeGen p l = cite (mconcat $ map (cit . (p++) . show) l) $ text $