Giter VIP home page Giter VIP logo

Comments (17)

lierdakil avatar lierdakil commented on June 3, 2024

It seems that pandoc-crossref was built with different version of pandoc than you're running. Make sure that you build pandoc and pandoc-crossref in the same sandbox. Also run ghc-pkg check if you're not using sandboxes, it's possible that some packages are broken by updates.

from pandoc-crossref.

HJAllen avatar HJAllen commented on June 3, 2024

I reinstalled crossref and it will process and create the pdf. However it does not label the figures appropriately nor insert the reference. Unfortunately, I haven't used a sandbox, in fact I am not familiar with it. Perhaps I need to wipe the slate clean and start over.

from pandoc-crossref.

lierdakil avatar lierdakil commented on June 3, 2024

Let me know if it doesn't help. It's always possible I messed up somewhere.

from pandoc-crossref.

HJAllen avatar HJAllen commented on June 3, 2024

I reinstalled everything and got the same result. I am not familiar with the sandboxes. My preliminary investigation shows that sandboxes can be set up for each build. So, should I set up a sandbox for pandoc and a separate on for crossref? Sorry for the basic question...

from pandoc-crossref.

lierdakil avatar lierdakil commented on June 3, 2024

Wait. I think I might have misinterpreted error log you provided. Sorry. Sleep deprivation does that. Could you show what command do you use to run Pandoc?

from pandoc-crossref.

HJAllen avatar HJAllen commented on June 3, 2024

I have altered the paths to protect the innocent

"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\R\library\rmarkdown\rmd\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\\Lake-Harsha\\HABs.bib" 

from pandoc-crossref.

lierdakil avatar lierdakil commented on June 3, 2024

Okay... Could you change order of filters so that pandoc-crossref appears before pandoc-citeproc and test that one out?

from pandoc-crossref.

HJAllen avatar HJAllen commented on June 3, 2024

I am using Rstudio and don't know exactly how the pandoc command is generated. I am looking into it... Thanks for the help!

from pandoc-crossref.

HJAllen avatar HJAllen commented on June 3, 2024

i was able to run the command manually but didn't fix the problem. Here is a bit more description of what I am doing.

markdown snippet:

####Structure

Microcystins are cyclic heptapeptides @fig:MCStruct with @campos_molecular_2010

![Microcystin Structure](../figures/microcystin.png){#fig:MCStruct}

output in pdf

Structure
Microcystins are cyclic heptapeptides ??? with [1]

command:

"C:/path/cabal/bin/pandoc" +RTS -K512m -RTS HABsLitReview.utf8.md --to latex --from markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash-implicit_figures --output HABsLitReview.pdf --filter pandoc-citeproc --template "c:\path\R\library\rmarkdown\rmd\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" --filter pandoc-citeproc --bibliography "c:\\path\\HABs.bib"

from pandoc-crossref.

lierdakil avatar lierdakil commented on June 3, 2024

You're using pandoc-citeproc twice here:

"C:/path/cabal/bin/pandoc" +RTS -K512m -RTS HABsLitReview.utf8.md --to latex --from markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash-implicit_figures --output HABsLitReview.pdf --filter pandoc-citeproc --template "c:\path\R\library\rmarkdown\rmd\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" --filter pandoc-citeproc --bibliography "c:\path\HABs.bib"

while in fact --bibliography implies --filter pandoc-citeproc (as per README)

Please remove first instance of --filter pandoc-citeproc (in fact you can safely remove both, but that's up to you)

from pandoc-crossref.

lierdakil avatar lierdakil commented on June 3, 2024

Hell, there is one more problem. --include-in-header also overrides header-includes metadata that pandoc-crossref uses with LaTeX output. I should probably add this caveat to README.

You could probably add pandoc-crossref definitions yourself, but actual definitions depend on filter settings.

Here is the default verision for reference:

\AtBeginDocument{%
\renewcommand*\figurename{Figure}
\renewcommand*\tablename{Table}
}
\AtBeginDocument{%
\renewcommand*\listfigurename{List of Figures}
\renewcommand*\listtablename{List of Tables}
}
\usepackage{float}
\floatstyle{ruled}
\makeatletter
\@ifundefined{c@chapter}{\newfloat{codelisting}{h}{lop}}{\newfloat{codelisting}{h}{lop}[chapter]}
\makeatother
\floatname{codelisting}{Listing}
\newcommand*\listoflistings{\listof{codelisting}{List of Listings}}

from pandoc-crossref.

HJAllen avatar HJAllen commented on June 3, 2024

Further investigation revealed the following in the .tex file produced by pandoc

\paragraph{Structure}\label{structure}

Microcystins are cyclic heptapeptides Figure\ref{fig:MCStruct} with

\includegraphics{../figures/microcystin.png}

\paragraph{Mode of Action}\label{mode-of-action}

Is this the intended? The \includegraphics is not wrapped in \figure and has no label.

Also, I have read some other posts regarding the integration of cross referencing in pandoc and it seems this issue is still quite up in the air. can you provide any insight into where this is going?
Thanks!

from pandoc-crossref.

tolot27 avatar tolot27 commented on June 3, 2024

Maybe there is no label because of a bug in the latest pandoc version (1.16.x). See here for a pull reguest: 2637.

BTW: I run into the SoftBreak issue too but fix it by using the latest Haskell platform 7.10.3 and compiled everything again.

from pandoc-crossref.

lierdakil avatar lierdakil commented on June 3, 2024

Okay, so I messed up badly with 0.1.6.4 release, it pretty much broke LaTeX output for figures. 0.1.6.5 should work.

jgm/pandoc#2637 shouldn't affect anything until released, since pandoc-crossref manages LaTeX labels by itself. I will have to remove that after next pandoc release (since I have no idea which version will have that PR included, I can't do that until release)

@HJAllen, I have literally no idea why \includegraphics is not wrapped in figure environment. It should be. All I can suggest is try updating to pandoc-1.16.0.2 and pandoc-crossref-0.1.6.5.

from pandoc-crossref.

HJAllen avatar HJAllen commented on June 3, 2024

success. I updated pandoc and pandoc-crossref to latest. I am using Rstudio and knitr which has the pandoc options 'hard coded' in the knit function so I used a lower level command rmarkdown::pandoc_convert to provide the filters in the appropriate order as in:

rmarkdown::pandoc_convert("HABsLitReview.Rmd", to="latex",output='HABsLitReview.pdf',citeproc=FALSE,options=c('--filter','pandoc-crossref','--filter','pandoc-citeproc.exe'),verbose=TRUE)

from pandoc-crossref.

lierdakil avatar lierdakil commented on June 3, 2024

@HJAllen, FYI, rstudio/rmarkdown@07da257 fixes filter order issue. rmarkdown 0.9.3 should have that once released.

from pandoc-crossref.

HJAllen avatar HJAllen commented on June 3, 2024

great! thanks for the pointer.
Also, thank you for your hard work on this filter. As far as my workflow goes, cross-refs, or lack of, were the last thing holding me back and your solution makes markdown and pandoc a great tool!

from pandoc-crossref.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.