Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
codelistings error with pandoc-crossref
\documentclass[$if(fontsize)$$fontsize$,$endif$$if(lang)$$babel-lang$,$endif$$if(papersize)$$papersize$,$endif$$for(classoption)$$classoption$$sep$,$endfor$]{$documentclass$}
\usepackage[sort]{natbib}
\usepackage{fancyhdr}
\usepackage{hyperref}
\usepackage{listings} % source code listings
\usepackage{longtable} % tables
\usepackage{booktabs} % tables
\usepackage{mathtools}
\usepackage{enumitem}
\providecommand{\tightlist}{ % pandoc wants this
\setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}
}
\oddsidemargin 0.2cm
\topmargin -1.0cm
\textheight 24.0cm
\textwidth 15.25cm
\parindent=0pt
\parskip 1ex
\renewcommand{\baselinestretch}{1.1}
\pagestyle{fancy}
$if(title)$
\lhead{\normalsize \textrm{$title$}}
$endif$
\chead{}
$if(version)$
\lfoot{\normalsize \textrm{$version$}}
$endif$
\cfoot{}
$if(date)$
\rfoot{$date$}
$endif$
\setlength{\fboxrule}{4pt}\setlength{\fboxsep}{2ex}
\renewcommand{\headrulewidth}{0.4pt}
\renewcommand{\footrulewidth}{0.4pt}
\begin{document}
\begin{center}
{\bf $title$}
\end{center}
$body$
\end{document}
#
#
#
# Variables
#
#
#
DOCUMENT_CLASS=article
SETTING_FONTSIZE=11pt
DOCUMENT_SETTINGS_PDF= \
--listings \
--variable fontsize=$(SETTING_FONTSIZE) \
--variable papersize=a4paper \
--variable classoption=cleardoublepage=empty \
--variable classoption=index=totoc \
--variable classoption=openright \
--variable classoption=final \
--variable classoption=listof=nochaptergap \
--variable documentclass=$(DOCUMENT_CLASS) \
--variable babel-lang=english \
--variable geometry=portrait
PANDOC=$(shell which pandoc)
PANDOC_PARAMS=-r markdown+simple_tables+table_captions+yaml_metadata_block+definition_lists+raw_html+markdown_in_html_blocks \
--filter pandoc-crossref
PANDOC_CC=$(PANDOC) $(PANDOC_PARAMS)
export PANDOC_CC_PDF=$(PANDOC) \
$(PANDOC_PARAMS) \
--latex-engine=pdflatex \
$(DOCUMENT_SETTINGS_PDF)
all:
@$(PANDOC_CC_PDF) \
--template ./default.latex \
test.md -o out.pdf
.PHONY: $(TARGET_PDF) $(TARGET_HTML)

title: example version: 0.1 date: January 2016 codeBlockCaptions: true figureTitle: "Figure" tableTitle: "Table" listingTitle: "Listing" titleDelimiter: ":" figPrefix:

  • "Figure"
  • "Figures" eqnPrefix:
  • "Equation"
  • "Equations" tblPrefix:
  • "Table"
  • "Tables" lstPrefix:
  • "Listing"
  • "Listings" secPrefix:
  • "Section"
  • "Sections" chapDelim: "." rangeDelim: "-" loftitle: "# List of Figures" lotTitle: "# List of Tables" lolTitle: "# List of Listings" ...

Code examples {#sec:codeexamples}

In @sec:codeexamples we show some code examples.

Listing: Foo

def foo():
    return 1;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment