lierdakil / pandoc-crossref Goto Github PK
View Code? Open in Web Editor NEWPandoc filter for cross-references
Home Page: https://lierdakil.github.io/pandoc-crossref/
License: GNU General Public License v2.0
Pandoc filter for cross-references
Home Page: https://lierdakil.github.io/pandoc-crossref/
License: GNU General Public License v2.0
If I set up a custom template for something, for example to give a title of Figure B1, then when I reference it, pandoc-crossref adds a space after the figPrefix variable. So if I set figPrefix to "Fig. B", I will get
Fig. B 1
instead of Fig. B1
Moving the space to the template means that users have control over that space instead of it being hardcoded.
The same might be useful with titles as well, though it's less necessary with the templates.
It's probably an easy change and if I can find the spot in Refs.hs I may try to submit a pull request.
How difficult would it be to add Context support to this? The referencing syntax is fairly simple at its most basic:
"The command \in provides the number of a chapter, section, figure, table, etc. The command \at produces a pagenumber and \about produces a complete title."
You can refer simply by using \in[fig:thefigure], which will create a reference link to the number where only the number is a clickable link. If you want the link to include more than just the number you can do \in {figure} [fig:thefigure], which would create a clickable link of "Figure 1".
Hi,
I could not get the figures to cross reference initially, but this is because I was running pandoc with citeproc first. When I ran just pandoc-crossref it worked. I don't know if this is a problem with crossref or citeproc or just the way I'm doing it. Either way I'm letting other people know if they face a similar issue.
This didn't work:
pandoc -s -S -c test.css --csl default.csl --metadata link-citations=true --filter pandoc-citeproc --filter pandoc-crossref --bibliography mybib.bib --number-sections input.markdown -o manual.html
When I changed them round to the following it worked:
pandoc -s -S -c test.css --csl default.csl --metadata link-citations=true --filter pandoc-crossref --filter pandoc-citeproc --bibliography mybib.bib --number-sections input.markdown -o manual.html
Hi,
Would it be possible to have a setting to number all equations by default?
I like to have all my equations numbered, although I do not necessarily reference them further in the document, and would be great if it could be done without having to introduce extra useless labels or using \begin{equation} … \end{equation}
.
Thanks!
With the newest pandoc version 1.16/1.17 and pandoc-crossref the referencing and numbering of figures is completely broken.
The caption changes to Figure 1: Figure 1: caption
and the reference just to See fig. .
I applied pandoc pull request 2637 already but it did not help.
How to reproduce:
# Figure Test
See @fig:figure1.
![First figure](img1.jpg){#fig:figure1}
pandoc -s -o test_figures.pdf -F pandoc-crossref.exe test_figures.md
Putting the variables/parameters into the YAML metadata block of the source markdown (i.e. demo.md) does not work. Supplying it with -M does work.
Other metadata variables like title work well.
Here's my markdown:
<div id="fig:gen">
![](../figures/AZ_VARIED_scatter.png)
![](../figures/EL_VARIED_scatter.png)
![](../figures/LIGHT_AZ_VARIED_scatter.png)
Captions are great!
</div>
and here's the tex it renders to:
\hypertarget{fig:gen}{}
\begin{figure}[htbp]
\centering
\includegraphics{../figures/AZ_VARIED_scatter.png}
\caption{}
\end{figure}
\begin{figure}[htbp]
\centering
\includegraphics{../figures/EL_VARIED_scatter.png}
\caption{}
\end{figure}
\begin{figure}[htbp]
\centering
\includegraphics{../figures/LIGHT_AZ_VARIED_scatter.png}
\caption{}
\end{figure}
Captions are great!
I'm using up-to-date master, and I'd love to help debug.
This is not really an issue, more of a feature suggestion. Currently, if the yaml setting file starts with an empty line or a line of three dashes (like yaml front matter in a pandoc document), it is silently ignored. Subsequent blank lines do not seem to matter, but options are not read after a --- line somewhere in the yaml file.
It would be great if:
We could also mention in the README that the yaml file's first line needs to be setting an option.
Since latex is the interemediate output format for pdf, \label
and \ref
could be used for pdf output, too.
Implementation should be straight forward, but I'm just beginning to learn Haskell.
The dependency on pandoc
has an upper limit of < 1.15
and the latest version at the moment is 1.15.0.4. Any chance of getting a new release soon?
Hello! Sorry for my question, but I don't know Haskell.
I want to get standalone executable file for pandoc-crossref and run it in portable way on machines where no Haskell distributive. How can I do this?
Hi! Thanks for paddoc-crossref! =)
The config figureTitle
works fine for HTML output. But it seems not to work with PDF output. I'm getting "Figure: ..." anyway.
Didn't set the Latex template, so it should be using Pandoc's default.
Tried setting figureTemplate
, but made no difference neither.
Using: pandoc-crossref-0.1.0.2
Hi,
I'm trying to put bibtex and pandoc-crossref to work in a Hakyll wiki config.
I have this almost default code:
match "posts/*" $ do
route $ setExtension "html"
compile $ do
-- modification begin
item <- getUnderlying
bibFile <- liftM (fromMaybe "") $ getMetadataField item "biblio"
cslFile <- liftM (fromMaybe "chicago") $ getMetadataField item "csl"
let compiler = if bibFile /= ""
then bibtexCompiler cslFile bibFile
else pandocCompilerWithTransformM defaultHakyllReaderOptions pandocOptions (transformer "pandoc-crossref" defaultHakyllReaderOptions pandocOptions)
compiler
-- modification end
>>= loadAndApplyTemplate "templates/post.html" postCtx
>>= loadAndApplyTemplate "templates/default.html" postCtx
>>= relativizeUrls
If the post has a bibtex file attached, process the bibtex, else skip bibtex processing, working only with the pandoc-crossref.
My problem is the bibtexCompiler code. I want to put pandoc-crossref inside it:
bibtexCompiler :: String -> String -> Compiler (Item String)
bibtexCompiler cslFileName bibFileName = do
csl <- load (fromFilePath $ "csl/"++cslFileName)
bib <- load (fromFilePath $ "bib/"++bibFileName)
--liftM (writePandocWith pandocOptions)
-- (getResourceBody >>= readPandocBiblio def csl bib)
writePandocWith pandocOptions <$>
(traverse transformer "pandoc-crossref" def pandocOptions =<< readPandocBiblio def csl bib =<< getResourceBody)
transformer :: Script -> ReaderOptions -> WriterOptions -> (Pandoc -> Compiler Pandoc)
transformer script reader_opts writer_opts pandoc =
do let input_json = writeJSON writer_opts pandoc
output_json <- unixFilter script [] input_json
return $
either (error.show) id $ -- this line needs to be uncommented atm.
readJSON reader_opts output_json
I've seen the code for pandocCompilerWithTransformM:
pandocCompilerWithTransformM :: ReaderOptions -> WriterOptions
-> (Pandoc -> Compiler Pandoc)
-> Compiler (Item String)
pandocCompilerWithTransformM ropt wopt f =
writePandocWith wopt <$>
(traverse f =<< readPandocWith ropt =<< getResourceBody)
That's why I'm trying to use this code, replacing readPandocWith ropt
with readPandocBiblio def csl bib
, which has the same return type. But it doesn't work.
It compiles and runs correctly, and it shows the bibliography and the Figure 1, but the citation shows [@author], even though it shows [1]. The reason I create the issue here is that whether I remove the traverse transformer ...
, the citation works (it shows [1]), but the pandoc-crossref not.
Thanks
Seems like titleDelimiter
is not added to the code listings.
With pandoc 1.13.2 on OS X 10.10.3, pandoc-crossref is unusable (at least on my system):
~/.../filters/pandoc-crossref : pandoc -F pandoc-crossref.hs -i demo.md -o blah.html
pandoc-crossref.hs:152:50:
Couldn't match expected type ‘Pandoc’
with actual type ‘Either Text.Pandoc.Error.PandocError Pandoc’
In the second argument of ‘($)’, namely ‘readMarkdown def s’
In the second argument of ‘($)’, namely
‘getInlines $ readMarkdown def s’
pandoc-crossref.hs:167:48:
Couldn't match expected type ‘Pandoc’
with actual type ‘Either Text.Pandoc.Error.PandocError Pandoc’
In the second argument of ‘($)’, namely ‘readMarkdown def s’
In the second argument of ‘($)’, namely
‘getBlocks $ readMarkdown def s’
pandoc-crossref.hs:179:9:
Non type-variable argument
in the constraint: MonadState References m
(Use FlexibleContexts to permit this)
When checking that ‘withTmplV’ has the inferred type
withTmplV :: forall (m :: * -> *) b.
MonadState References m =>
(String -> Maybe MetaValue) -> m b -> m b
In an equation for ‘applyTemplate’:
applyTemplate i t tmpl
= withTmplV internalVars $ replaceTemplate tmpl
where
withTmplV f g
= do { modify $ ...;
.... }
internalVars "i" = Just $ MetaInlines i
internalVars "t" = Just $ MetaInlines t
internalVars _ = Nothing
pandoc: Error running filter pandoc-crossref.hs
I have updated to the latest version but still get figure labels as
fig 1.
I have added to the yaml header
figureTitle: 'Figure'
tableTitle: 'Table'
using RStudio-knitr-pandoc writing output to word .docx
Thanks,
Joel
[@fig:lab]
always gives lower case.
bla bla. Figure \ref{fig:lab}
is a workaround.
Hi and thanks for the package!
I've installed pandoc via brew and to use this filter I have to get haskell (1.6Gb installed) plus 83 packages. In the meantime, I've managed to drink a cup of coffee and create this issue, and the compiling is still not done!
Not sure there is an easy fix of this, I guess the dependencies are mainly due to pandoc? Anyhow, seems cumbersome just for some text parsing.
Here are the packages:
base64-bytestring-1.0.0.1 (new package)
blaze-builder-0.4.0.1 (new package)
blaze-markup-0.7.0.2 (new package)
blaze-html-0.8.0.2 (new package)
byteable-0.1.1 (new package)
cereal-0.4.1.1 (new package)
cryptohash-0.11.6 (new package)
data-default-class-0.0.1 (new package)
cookie-0.4.1.5 (new package)
data-default-instances-base-0.0.1 (new package)
data-default-instances-containers-0.0.1 (new package)
data-default-instances-old-locale-0.0.1 (new package)
deepseq-generics-0.1.1.2 (new package)
digest-0.0.1.2 (new package)
dlist-0.7.1.1 (new package)
data-default-instances-dlist-0.0.1 (new package)
data-default-0.5.3 (new package)
extensible-exceptions-0.1.1.4 (new package)
hourglass-0.2.9 (new package)
asn1-types-0.3.0 (new package)
http-types-0.8.6 (new package)
mime-types-0.1.0.6 (new package)
nats-1 (new package)
network-2.6.1.0 (new version)
scientific-0.3.3.8 (new package)
attoparsec-0.11.3.4 (latest: 0.13.0.0) (new version)
securemem-0.1.7 (new package)
crypto-cipher-types-0.0.9 (new package)
cipher-aes-0.2.10 (new package)
cipher-des-0.0.6 (new package)
cipher-rc4-0.1.4 (new package)
crypto-random-0.0.9 (new package)
crypto-numbers-0.2.7 (new package)
semigroups-0.16.2.2 (new package)
socks-0.5.4 (new package)
tagsoup-0.13.3 (new package)
transformers-0.4.3.0 (new version)
haddock-library-1.2.0 (new package)
mmorph-1.0.4 (new package)
mtl-2.2.1 (new version)
JuicyPixels-3.2.4 (new package)
aeson-0.7.0.6 (latest: 0.8.1.0) +new-bytestring-builder (new package)
asn1-encoding-0.9.0 (new package)
asn1-parse-0.9.1 (new package)
crypto-pubkey-types-0.4.3 (new package)
crypto-pubkey-0.2.8 (new package)
hslua-0.3.13 (new package)
pandoc-types-1.12.4.2 (new package)
parsec-3.1.9 (new version)
network-uri-2.6.0.3 (new package)
HTTP-4000.2.19 (new version)
pem-0.2.2 (new package)
regex-base-0.93.2 (reinstall) changes: mtl-2.1.3.1 -> 2.2.1
regex-pcre-builtin-0.94.4.8.8.35 (new package)
streaming-commons-0.1.12 (new package)
transformers-compat-0.4.0.4 (new package)
exceptions-0.8.0.2 (new package)
http-client-0.4.11.2 (new package)
temporary-1.2.0.3 (new package)
transformers-base-0.4.4 (new package)
monad-control-1.0.0.4 (new package)
lifted-base-0.2.3.6 (new package)
enclosed-exceptions-1.0.1.1 (new package)
resourcet-1.1.4.1 (new package)
utf8-string-1 (new package)
highlighting-kate-0.5.15 (new package)
void-0.7 (new package)
conduit-1.2.4.2 (new package)
x509-1.5.0.1 (new package)
x509-store-1.5.0 (new package)
x509-system-1.5.0 (new package)
x509-validation-1.5.2 (new package)
tls-1.2.17 (new package)
connection-0.2.4 (new package)
http-client-tls-0.2.2 (new package)
xml-1.3.14 (new package)
texmath-0.8.2 (new package)
yaml-0.8.11 (new package)
zip-archive-0.2.3.7 (new package)
pandoc-1.13.2.1 (new package)
pandoc-crossref-0.1.0.2 (new package)
Might note also that the install needs --force-reinstall
on a clean system:
cabal: The following packages are likely to be broken by the reinstalls:
regex-posix-0.95.2
regex-compat-0.95.1
Use --force-reinstalls if you want to install anyway.
I'm working on a book with a few unnumbered chapters without images as front-matter.
If I use per-chapter numbering, the pandoc-crossref chapter seems to also increment for these chapters.
Therefore, my chapter 2 figures are numbered Figure 5.1
, Figure 5.2
,...
Is this expected behaviour and if so, is there a workaround to manually reset the internal counter so I can make the pandoc chapter numbers and the pandoc-crossref chapter numbers match?
Hi, are .docx
files supported?. With the following foo.tex
file:
\documentclass{article}
\usepackage{amsmath}
\usepackage{cleveref}
\begin{document}
\begin{equation}
\label{eq:first}
1 + 1 = 2
\end{equation}
\cref{eq:first}
\end{document}
If I run pandoc -s --filter pandoc-crossref foo.tex -o foo.docx
I get:
Thanks!
Add support for referencing sections with the same @ syntax. Section labels are already available in pandoc.
Thank you for a great package - works great!
Is it possible to create references in text without the link? Either for the entire document or on a per reference basis.
I tried redefining the \ref to use \ref* in the metadata of my file but couldn't make it work. I then tried hiding the links with \hypersetup[hidelinks] - this hid the links but broke my custom "figureTitle" and "figPrefix" (by the way, I can never make "titleDelimiter" work).
I was thinking that, selective suppression might be accomplished by using /ref* instead of /ref when the reference is called with a "-" before the reference like this "-@fig:figure1". This syntax is similar to "pandoc-citeproc" where "-@citekey" suppresses mention of the author in the citation. Unfortunately, I don't have the coding skills to contribute to the this.
And again, thank you for the great work on this package!
Working on a win 7 professional system with RStudio/R/rmarkdown/pandoc. Updated to pandoc 1.16 and crossref 0.1.6.3 via cabal. Seems something else needs to be updated. Result is:
pandoc-crossref.exe: Error in $[2][29]: The key "SoftBreak" was not found
pandoc.exe: Error running filter pandoc-crossref
Filter returned error status 1
Error: pandoc document conversion failed with error 83
Full output:
"C:/path/cabal/bin/pandoc" +RTS -K512m -RTS 2015HarshaText.utf8.md --to latex --from markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash-implicit_figures --output 2015HarshaText.pdf --filter pandoc-citeproc --template "c:\path\default-1.14.tex" --highlight-style tango --latex-engine pdflatex --include-in-header "c:\\;path\\HABsPDFheader.tex" --filter pandoc-crossref --variable "geometry:margin=1in" --bibliography "c:\\path\\HABs.bib"
output file: 2015HarshaText.knit.md
pandoc-citeproc: reference fig:MCStruct not found
pandoc-crossref.exe: Error in $[2][29]: The key "SoftBreak" was not found
pandoc.exe: Error running filter pandoc-crossref
Filter returned error status 1
Error: pandoc document conversion failed with error 83
In addition: Warning message:
running command '"C:/path/pandoc" +RTS -K512m -RTS 2015HarshaText.utf8.md --to latex --from markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash-implicit_figures --output 2015HarshaText.pdf --filter pandoc-citeproc --template "c:\path\latex\default-1.14.tex" --highlight-style tango --latex-engine pdflatex --include-in-header "c:\\path\\HABsPDFheader.tex" --filter pandoc-crossref --variable "geometry:margin=1in" --bibliography "c:\\path\\HABs.bib"' had status 83
Execution halted
pandoc-crossref is a great unified filter for figure/table/equation numbering.
But equation label only works if display math and label specification are in a paragraph of its own. That results in a big skip before the equation and a new paragraph after it, whereas the equation and texts around it should remain in a same paragraph in most cases.
Would you please make the equation labels can be used with equations NOT in a paragraph of its own?
It'd be nice if equation labels can be used as pandoc-eqnos does, its demo.md shows this feature.
For some reason, pandoc-crossref won't compile/install on Windows 7. I've tried on several machines, first installing pandoc as a binary + the Haskell Platform, and then installing pandoc from source. Pandoc works fine in both instances, but pandoc-crossref does not.
Building pandoc-crossref-0.1.5.2...
Preprocessing library pandoc-crossref-0.1.5.2...
[ 1 of 17] Compiling Text.Pandoc.CrossRef.Util.Settings.Template ( src\Text\Pandoc\CrossRef\Util\Settings\Template.hs, dist\build\Text\Pandoc\CrossRef\Util\Settings\Template.o )
[ 2 of 17] Compiling Text.Pandoc.CrossRef.Util.Meta ( src\Text\Pandoc\CrossRef\Util\Meta.hs, dist\build\Text\Pandoc\CrossRef\Util\Meta.o )
[ 3 of 17] Compiling Text.Pandoc.CrossRef.Util.Template ( src\Text\Pandoc\CrossRef\Util\Template.hs, dist\build\Text\Pandoc\CrossRef\Util\Template.o )
[ 4 of 17] Compiling Text.Pandoc.CrossRef.Util.Util ( src\Text\Pandoc\CrossRef\Util\Util.hs, dist\build\Text\Pandoc\CrossRef\Util\Util.o )
[ 5 of 17] Compiling Text.Pandoc.CrossRef.Util.Accessor ( src\Text\Pandoc\CrossRef\Util\Accessor.hs, dist\build\Text\Pandoc\CrossRef\Util\Accessor.o )
[ 6 of 17] Compiling Text.Pandoc.CrossRef.References.Types ( src\Text\Pandoc\CrossRef\References\Types.hs, dist\build\Text\Pandoc\CrossRef\References\Types.o )
[ 7 of 17] Compiling Text.Pandoc.CrossRef.References.Accessors ( src\Text\Pandoc\CrossRef\References\Accessors.hs, dist\build\Text\Pandoc\CrossRef\References\Accessors.o )
[ 8 of 17] Compiling Text.Pandoc.CrossRef.Util.Settings.Gen ( src\Text\Pandoc\CrossRef\Util\Settings\Gen.hs, dist\build\Text\Pandoc\CrossRef\Util\Settings\Gen.o )
ghc.exe: unable to load package `hslua-0.4.1'
ghc.exe: warning: WSACleanup from ws2_32 is linked instead of __imp_WSACleanup
ghc.exe: warning: WSAStartup from ws2_32 is linked instead of __imp_WSAStartup
ghc.exe: warning: WSACleanup from ws2_32 is linked instead of __imp_WSACleanup
ghc.exe: warning: accept from ws2_32 is linked instead of __imp_accept
ghc.exe: warning: inet_ntoa from ws2_32 is linked instead of __imp_inet_ntoa
ghc.exe: warning: getnameinfo from ws2_32 is linked instead of __imp_getnameinfo
ghc.exe: warning: getaddrinfo from ws2_32 is linked instead of __imp_getaddrinfo
ghc.exe: warning: freeaddrinfo from ws2_32 is linked instead of __imp_freeaddrinfo
ghc.exe: warning: _tzset from msvcrt is linked instead of __imp__tzset
ghc.exe: warning: isalpha from msvcrt is linked instead of __imp_isalpha
ghc.exe: warning: GetVersionExA from kernel32 is linked instead of __imp_GetVersionExA
ghc.exe: warning: GetModuleHandleA from kernel32 is linked instead of __imp_GetModuleHandleA
ghc.exe: warning: GetProcAddress from kernel32 is linked instead of __imp_GetProcAddress
ghc.exe: warning: _snprintf from msvcrt is linked instead of __imp__snprintf
ghc.exe: warning: GetSystemInfo from kernel32 is linked instead of __imp_GetSystemInfo
ghc.exe: warning: GetSystemMetrics from user32 is linked instead of __imp_GetSystemMetrics
ghc.exe: warning: GetVersionExA from kernel32 is linked instead of __imp_GetVersionExA
ghc.exe: warning: _snprintf from msvcrt is linked instead of __imp__snprintf
ghc.exe: warning: GetSystemInfo from kernel32 is linked instead of __imp_GetSystemInfo
ghc.exe: warning: GetComputerNameA from kernel32 is linked instead of __imp_GetComputerNameA
ghc.exe: warning: CryptAcquireContextA from advapi32 is linked instead of __imp_CryptAcquireContextA
ghc.exe: warning: CryptGenRandom from advapi32 is linked instead of __imp_CryptGenRandom
ghc.exe: warning: _stat64 from msvcrt is linked instead of __imp__stat64
ghc.exe: warning: _open from msvcrt is linked instead of __imp__open
ghc.exe: warning: _stat64 from msvcrt is linked instead of __imp__stat64
ghc.exe: warning: tolower from msvcrt is linked instead of __imp_tolower
ghc.exe: warning: toupper from msvcrt is linked instead of __imp_toupper
ghc.exe: warning: isalpha from msvcrt is linked instead of __imp_isalpha
ghc.exe: warning: isalnum from msvcrt is linked instead of __imp_isalnum
ghc.exe: warning: isupper from msvcrt is linked instead of __imp_isupper
ghc.exe: warning: isgraph from msvcrt is linked instead of __imp_isgraph
ghc.exe: warning: isprint from msvcrt is linked instead of __imp_isprint
ghc.exe: warning: ispunct from msvcrt is linked instead of __imp_ispunct
ghc.exe: warning: iscntrl from msvcrt is linked instead of __imp_iscntrl
ghc.exe: warning: isupper from msvcrt is linked instead of __imp_isupper
ghc.exe: C:\Users\James\AppData\Roaming\cabal\x86_64-windows-ghc-7.10.2\hslua-0.4.1-DAXOloNJurRCYy4KgxvZeZ\HShslua-0.4.1-DAXOloNJurRCYy4KgxvZeZ.o: unknown symbol `mingw_getsp'
With output to latex and when the minted
package is loaded for source code highlighting, there is a conflict which prevents the latex document from compiling.
minted
by default loads the float
package and also provides a listoflistings
command which conflicts with that in pandoc-crossref
. If thispandoc-crossref
command is changed in the source document to \renewcommand*\listoflistings{\listof{codelisting}{List of Listings}}
then it compiles. There should be a test to see if minted
is loaded and then either provide a new or renew command for listoflistings
or just use the minted
command.
Just a tiny issue and maybe only for documentation purposes:
Currently, it is not allowed to have some characters or even latex commands after a label definition.
I. e. ![First figure](img1.jpg){#fig:figure1}\todo{write better description}
is not allowed. Just {#fig:figure1}
is printed. Spaces are allowed.
Okay, it even does not work without the label definition. So probably a pandoc parsing issue or just a syntax violation?
For a paper with a large supplemental section, I needed to maintain two separate sets of figure and table numberings, e.g. (See @fig:fig1, @fig:fig4, @supfig:figS1)
==> "(See Figures 1, 4, and S1)". I've hacked together most of a solution for this at https://github.com/infotroph/pandoc-crossref/tree/supplemental.
This is not a pull request, because I doubt you want my code: It duplicates nearly all of the existing figure and table code, provides no way to support other supplements (equations, listings, etc) other than also duplicating their code, and the numbering is broken in LaTeX and would probably need a custom Pandoc writer to fix it. I'm only posting it here in case it can help someone else who'd otherwise be hassling you for a real fix :)
Input md:
<div id="fig:gen">
![](../figures/AZ_VARIED_scatter.png){height=20%}
![](../figures/EL_VARIED_scatter.png){height=20%}
![](../figures/LIGHT_AZ_VARIED_scatter.png){height=20%}
Captions are great!
</div>
output tex:
\begin{figure}
{\subfloat[]{\includegraphics{../figures/AZ_VARIED_scatter.png}\label{fig:}}}
{\subfloat[]{\includegraphics{../figures/EL_VARIED_scatter.png}\label{fig:}}}
{\subfloat[]{\includegraphics{../figures/LIGHT_AZ_VARIED_scatter.png}\label{fig:}}}
\caption{{Captions are great!}}
\label{fig:gen}
\end{figure}
resulting pdf:
A major new release of pandoc/pandoc-types now comes. Would be really appreciated to support them!
If I use either
Listing: Foo
```{#lst:mypython .python .numberLines}
..somecode...
Or
```{#lst:mypython .python .numberLines caption="Foo"}
...somecode...
This produces following latex compilation error:
! LaTeX Error: Environment codelisting undefined.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...
l.48 \begin{codelisting}
pandoc: Error producing PDF from TeX source
I cannot find any package for a codelisting
environment with google, so would you please tell me how I can fix this?
For compiling to HTML, everything works as expected.
Using this patch (jgm/pandoc#2447) allow to use image alt text to convert in latex short caption. When it is used with pandoc-crossref, the short caption becomes empty...
See :
![My long caption](figure.png "SHORT CAPTION"){#fig:figure-label}
produces
\begin{figure}[htbp]
\centering
\includegraphics{figure.png}
\caption[]{\label{fig:figure-label}My long caption}
\end{figure}
Instead of :
\begin{figure}[htbp]
\centering
\includegraphics{figure.png}
\caption[SHORT CAPTION]{\label{fig:figure-label}My long caption}
\end{figure}
Any idea to fix it ?
If the parameter --chapters
is given to pandoc, all crossref numbers should be prefixed with the chapter number and restarted at 1 for each chapter.
Currently, they will be simply incremented across the whole document.
Currently, a normal space is inserted between figPrefix, tblPrefix, eqnPrefix and its corresponding reference number. At line ends, this sometimes breaks the number to the next line wich should be avoided. Therefore, a non-breaking space should be inserted instead.
The pandoc-citeref filter has an option (link-citations
) to link the cross references in html and latex output: clicking on the reference jumps to the corresponding entry in the bibliography.
Would it be possible to add something alike to pandoc-crossref?
One of the things that needs to happen for this is adding id's to the figures and tables in html. This would also be beneficial for other things such as targeting specific images with css, or adding page numbers (using target-counter(attr(href), page)
in css) to the list of figures in html.
Currently, the filter requires that all images are labeled (in contrast to tables). If one image is unlabeled, the following error occurs and conversion is stopped:
pandoc-crossref.hs: Prelude.last: empty list
pandoc: Error running filter ./pandoc-crossref.hs
It took a while to figure this out in my large multiple file project.
It would be nice if the filter would just print a warning message (maybe in verbose mode only).
FIrst of all, thanks for creating such filter, it was something I was looking for for a long time.
I am having issues running crossref along citeproc. The problem is that once crossref has run, it splits my in text references from
[@Dean1998a; @Verpoorter2014]
to
[@Dean1998a], [@Verpoorter2014]
Making it so that I can't have my in text references as "(Dean and Gorham, 1998; Verpoorter et al., 2014)" but as (Dean and Gorham, 1998), (Verpoorter et al., 2014).
Is there anyway that this can be fixed?
Cheers!
Evidently, import Text.Pandoc.Shared (normalizeInlines)
triggers the following behavior:
D:\Develop\git\pandoc-crossref>pandoc --filter ./pandoc-crossref.hs -o demo.pdf test.md
pandoc-crossref.hs: warning: inet_ntoa from ws2_32 is linked instead of __imp_inet_ntoa
pandoc-crossref.hs: warning: getnameinfo from ws2_32 is linked instead of __imp_getnameinfo
pandoc-crossref.hs: warning: getaddrinfo from ws2_32 is linked instead of __imp_getaddrinfo
pandoc-crossref.hs: warning: freeaddrinfo from ws2_32 is linked instead of __imp_freeaddrinfo
pandoc-crossref.hs: warning: accept from ws2_32 is linked instead of __imp_accept
pandoc-crossref.hs: warning: WSACleanup from ws2_32 is linked instead of __imp_WSACleanup
pandoc-crossref.hs: warning: WSAStartup from ws2_32 is linked instead of __imp_WSAStartup
pandoc-crossref.hs: warning: WSACleanup from ws2_32 is linked instead of __imp_WSACleanup
pandoc-crossref.hs: warning: _vsnprintf from msvcrt is linked instead of __imp__vsnprintf
pandoc-crossref.hs: warning: GetVersionExA from kernel32 is linked instead of __imp_GetVersionExA
pandoc-crossref.hs: warning: GetModuleHandleA from kernel32 is linked instead of __imp_GetModuleHandleA
pandoc-crossref.hs: warning: GetProcAddress from kernel32 is linked instead of __imp_GetProcAddress
pandoc-crossref.hs: warning: _snprintf from msvcrt is linked instead of __imp__snprintf
pandoc-crossref.hs: warning: GetSystemInfo from kernel32 is linked instead of __imp_GetSystemInfo
pandoc-crossref.hs: warning: GetSystemMetrics from user32 is linked instead of __imp_GetSystemMetrics
pandoc-crossref.hs: warning: GetVersionExA from kernel32 is linked instead of __imp_GetVersionExA
pandoc-crossref.hs: warning: _snprintf from msvcrt is linked instead of __imp__snprintf
pandoc-crossref.hs: warning: GetSystemInfo from kernel32 is linked instead of __imp_GetSystemInfo
pandoc-crossref.hs: warning: GetComputerNameA from kernel32 is linked instead of __imp_GetComputerNameA
pandoc-crossref.hs: warning: CryptAcquireContextA from advapi32 is linked instead of __imp_CryptAcquireContextA
pandoc-crossref.hs: warning: CryptGenRandom from advapi32 is linked instead of __imp_CryptGenRandom
pandoc-crossref.hs: warning: _stat64 from msvcrt is linked instead of __imp__stat64
pandoc-crossref.hs: warning: _open from msvcrt is linked instead of __imp__open
pandoc-crossref.hs: warning: _stat64 from msvcrt is linked instead of __imp__stat64
pandoc-crossref.hs: warning: tolower from msvcrt is linked instead of __imp_tolower
pandoc-crossref.hs: warning: toupper from msvcrt is linked instead of __imp_toupper
pandoc-crossref.hs: warning: isalpha from msvcrt is linked instead of __imp_isalpha
pandoc-crossref.hs: warning: isalnum from msvcrt is linked instead of __imp_isalnum
pandoc-crossref.hs: warning: isupper from msvcrt is linked instead of __imp_isupper
pandoc-crossref.hs: warning: isgraph from msvcrt is linked instead of __imp_isgraph
pandoc-crossref.hs: warning: isprint from msvcrt is linked instead of __imp_isprint
pandoc-crossref.hs: warning: ispunct from msvcrt is linked instead of __imp_ispunct
pandoc-crossref.hs: warning: iscntrl from msvcrt is linked instead of __imp_iscntrl
pandoc-crossref.hs: warning: isupper from msvcrt is linked instead of __imp_isupper
pandoc-crossref.hs: C:\Users\Walter\AppData\Roaming\cabal\x86_64-windows-ghc-7.8.3\hslua-0.3.13\HShslua-0.3.13.o: unknown symbol `mingw_getsp'
pandoc-crossref.hs: pandoc-crossref.hs: unable to load package `hslua-0.3.13'
pandoc: Error running filter ./pandoc-crossref.hs
May be related to https://ghc.haskell.org/trac/ghc/ticket/9868
pandoc: 1.16.0.2
pandoc-crossref: 0.1.6.3
When images are used in subsequent paragraphs of lists, multiple labels will be produced.
to reproduce, just save the following code as a file test.md
1. list item1
* Bullet list1
1) inner list 1
This paragraph will following the inner list 1.
![This image will not break the list](image1.png){#fig:image1}
2) inner list 2
$ pandoc -t latex -o test.tex --filter pandoc-crossref test.md
The test.tex
shows:
\begin{enumerate}
\def\labelenumi{\arabic{enumi}.}
\item
list item1
\begin{itemize}
\item
Bullet list1
\begin{enumerate}
\def\labelenumii{\arabic{enumii})}
\item
inner list 1
This paragraph will following the inner list 1.
\begin{figure}[htbp]
\centering
\includegraphics{image1.png}
\caption{\label{fig:image1}\label{fig:image1}\label{fig:image1}\label{fig:image1}This
image will not break the list}
\end{figure}
\item
inner list 2
\end{enumerate}
\end{itemize}
\end{enumerate}
There are four \label
.
If the image paragraph is not indented by spaces, the inner list 2 will not be generated properly.
BTW, It would be better if \label
is not in the \caption
field. That's the expected latex way.
\begin{figure}[htbp]
\centering
\includegraphics{image1.png}
\caption{This image will not break the list}
\label{fig:image1}
\end{figure}
With \label
embedded in \caption
, problems will arise if caption (of figure, table) appear in multiple places.
Is subfigures possible?
Something like this would be great:
![Caption for (a).](img.png) ![Caption for (b).](img2.png) {#fig:two_figs}
or
![Caption for (a).](img.png) {#fig:one}
![Caption for (b).](img2.png) {#fig:two}
Referencing directly to [@fig:one].
Appending {#tbl:table1}
right after the table caption won't work. But it works if separated by a space. Either fix this or enhance README.md.
This is more of a question than an issue. I currently maintain a docker repository with an image that contains pandoc, pandoc-citeproc and pandoc-crossref. If there's interest, I can add to the README a quick how-to section on running the demo using this docker image.
Often, labels are printed in bold or italics, i. e.
Figure 1: The solar system.
It would be great to use markdown syntax in the YAML parameters to format the table and figure labels. I. e. -M "figureTitle:**Figure #**"
BTW: In Latex it works out of the box because it can be configured with the package ccaption, for instance.
Currently I do:
\begin{lstlisting}[language=Python, caption=Caption., label=code:label] for file in files: ..do stuff \end{lstlisting}
Then I reference with \ref{code:label}
. This gives me two syntaxes for referencing. It would be nice if @code:label
would create \ref{code:label}
regardless if pandoc-crossref finds a label named code:label
in its own list of figures/equations/tables. Any ideas?
Hi,
I am converting from markdown to HTML.
I am currently creating a figure like this:
![LC male and female duplex connector](images/lcconnector.png){#fig:lcconnector}
and I am referencing it like this:
An LC connector [[@fig:lcconnector]] is a common connection type seen on fibre cables.
The reference is parsed correctly and the correct figure number appears in the output. However there is no internal hyperlink in the citation. I looked at the raw HTML and the img tag already has an id attribute set (fig:lcconnector). The citation (in raw HTML) only needs to change from:
[Fig 5.] to <a href="#fig:lcconnector">[Fig. 5]</a>
Am I missing the way to do this or is this feature not available?
I'm using the latest version of all tools as far as I can tell.
I am using the following command line:
pandoc -s -S -c test.css --csl default.csl --metadata link-citations=true --filter pandoc-crossref --filter pandoc-citeproc --bibliography mybib.bib --number-sections input.markdown -o manual.html
Thanks for your efforts on this filter, it's been very useful for me so far and much more enjoyable than using Microsoft Word. That's a compliment even if it doesn't sound like one. :)
Best Regards,
I'm currently writing in markdown and use pandoc and pandoc-crossref to convert markdown to LaTeX. But my collaborators only use LaTeX. So after they modified my LaTeX file, are there any chances to convert it back to markdown, with the same cross-reference format suggested by pandoc-crossref? Currently when I tried to do that, the format of both the labels and the references are messed up.
Thanks a lot!
This works and displays as an equation on its own line:
$$(a^2 + b^2 = c^2)/\pi$$ {#eq:equation2}
This displays an inline equation, but it's not referenced, and saying [@eq:equation3] leads to eq. ??
$(a^2 + b^2 = c^2)/\pi$ {#eq:equation3}
Does {#sec:label}
works when specified after \appendix
and called in the main text before \appendix
with something like that @sec:label
.
In my case it generates the following : Section ??
Any idea ?
If {#fig:test}
and {#tbl:test}
used in the same document, referencing would not work. This is more or less a cosmetic bug. But users who used Latex labels before, may expect that the label is kept in its etirety. For instance, in Latex it is valid to use \label{fig:test}
and \label{tbl:test}
at the same time.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.