Giter VIP home page Giter VIP logo

Comments (10)

lierdakil avatar lierdakil commented on June 3, 2024 3

Apparently, you're using custom template. That explains things.

Add this to your template header (before \begin{document}, but probably after everything else)

$for(header-includes)$
$header-includes$
$endfor$

This will allow pandoc-crossref to include its definitions into your template.

You can also define codelisting environment yourself if you want. Again, see here for a general idea on how pandoc-crossref does that.

P.S. You also seem to be including \usepackage{listings} in your template. If you want to use that one, pandoc-crossref supports that, but needs some coercion. See https://github.com/lierdakil/pandoc-crossref#customization (in particular, listings metadata attribute)

from pandoc-crossref.

lierdakil avatar lierdakil commented on June 3, 2024

You need to run pandoc with -s (--standalone) option in order to include definitions for pandoc-crossref-specific environments. Alternatively, you can see here to figure out what the definition should be.

from pandoc-crossref.

matthiasbeyer avatar matthiasbeyer commented on June 3, 2024

Passing --standalone to pandoc does not solve the error, not for the first nor for the second syntax.

from pandoc-crossref.

lierdakil avatar lierdakil commented on June 3, 2024

I will have to ask for a minimal testcase then.

from pandoc-crossref.

matthiasbeyer avatar matthiasbeyer commented on June 3, 2024

I will try to deliver...

from pandoc-crossref.

matthiasbeyer avatar matthiasbeyer commented on June 3, 2024

https://gist.github.com/matthiasbeyer/193105fd42de66fdb1dd

This is as minimal as I can get in such a short time.

I'm using

pandoc --version
pandoc 1.15.2.1

btw.

from pandoc-crossref.

matthiasbeyer avatar matthiasbeyer commented on June 3, 2024

Maaah, the header-includes. Damn.

Thanks for your help, that fixed the error for me!

from pandoc-crossref.

matthiasbeyer avatar matthiasbeyer commented on June 3, 2024

Follow-up question: What if I do not have a custom template?

from pandoc-crossref.

qaisjp avatar qaisjp commented on June 3, 2024

People that get here from Google will find my comment useful.

If you are using include-in-header, read this caveat: https://lierdakil.github.io/pandoc-crossref/#latex-output-and---include-in-header

The solution is to put your entire include-in-header file inside your metadata file.

It's also useful if you read the bottom of the "Metadata blocks" section (in pandoc's docs itself) - https://pandoc.org/MANUAL.html#metadata-blocks, copied below:

Raw content to include in the document’s header may be specified using header-includes; however, it is important to mark up this content as raw code for a particular output format, using the raw_attribute extension, or it will be interpreted as markdown. For example:

header-includes:
- |
  ```{=latex}
  \let\oldsection\section
  \renewcommand{\section}[1]{\clearpage\oldsection{#1}}
  ```

Do this and your code listings will work!


P.S. You also seem to be including \usepackage{listings} in your template. If you want to use that one, pandoc-crossref supports that, but needs some coercion. See lierdakil/pandoc-crossref#customization (in particular, listings metadata attribute)

This link is now: https://github.com/lierdakil/pandoc-crossref/blob/master/lib/Text/Pandoc/CrossRef/Util/ModifyMeta.hs

from pandoc-crossref.

vinayakakv avatar vinayakakv commented on June 3, 2024

Apart from @lierdakil's fix, I had to add

$if(highlighting-macros)$
$highlighting-macros$
$endif$

to solve Shaded environment undefined error, as suggested by https://stackoverflow.com/a/47122900.

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.