Comments (10)
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.
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.
Passing --standalone
to pandoc does not solve the error, not for the first nor for the second syntax.
from pandoc-crossref.
I will have to ask for a minimal testcase then.
from pandoc-crossref.
I will try to deliver...
from pandoc-crossref.
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.
Maaah, the header-includes
. Damn.
Thanks for your help, that fixed the error for me!
from pandoc-crossref.
Follow-up question: What if I do not have a custom template?
from pandoc-crossref.
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 theraw_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.
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)
- Influence of code page in MSYS2 bash shell in Windows 10
- Verbose debug of pandoc-crossref (figPrefix ignored)? HOT 4
- Start section number from n > 1 HOT 9
- Cannot get secPrefix to work for References to Chapters output multiple prefixes for docx file HOT 2
- add custom latex header with include in header HOT 1
- Arrange two images vertically for figure HOT 2
- numbers of subfigures are off by one HOT 9
- When setting chapter as {number=n}, subsequent chapter should become {number=n+1} etc. HOT 2
- subfigure images in docx does not rescale HOT 1
- fenced div/span syntax for subfigures HOT 1
- place pandoc crossref attributes in new line HOT 1
- Pandoc/Pandoc-crossref changing citation order
- Incorrect equation reference number in main text when convert .tex to .docx HOT 1
- Tests broken (pandoc dropped \hypertarget)
- Floats and equations have 2 LaTeX labels in pandoc 3.1.7+ HOT 4
- cabal install issue with ghc 9.6.2, cabal 3.10.2.0 HOT 3
- Consider adding `\MakeLinkTarget{}` before `\label` for tables HOT 4
- Add a link to Github repository on https://lierdakil.github.io/pandoc-crossref/
- ulr-encoded anchors in OOXML output HOT 2
- Is setting a custom chapter label officially supported? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pandoc-crossref.