pdf: escape dollar sign in lstlistings

fixes #106
This commit is contained in:
Changkun Ou
2020-07-26 11:53:30 +02:00
parent 1421f372e0
commit c015324c5c
6 changed files with 1 additions and 58 deletions

View File

@@ -13,7 +13,6 @@ pdf: markdown
@echo "Compiling PDF file..." @echo "Compiling PDF file..."
pandoc -f markdown+smart -s $(filename).md -o $(filename).pdf \ pandoc -f markdown+smart -s $(filename).md -o $(filename).pdf \
--title-prefix $(title) \ --title-prefix $(title) \
--listings -H meta/cpp-listings.tex \
--template=meta/template.tex \ --template=meta/template.tex \
--pdf-engine=`which xelatex` --pdf-engine=`which xelatex`
@echo "Done." @echo "Done."

View File

@@ -1,26 +0,0 @@
\usepackage{xcolor}
\definecolor{keyword}{HTML}{BA2CA3}
\definecolor{string}{HTML}{D12F1B}
\definecolor{comment}{HTML}{008400}
\lstset{
basicstyle={\small\ttfamily},
keywordstyle={\color[rgb]{0.13,0.29,0.53}\bfseries},
breaklines=true,
emphstyle={\bfseries\color{Rhodamine}},
commentstyle={\color[rgb]{0.56,0.35,0.01}\itshape},
stringstyle={\color[rgb]{0.31,0.60,0.02}},
showstringspaces=false,
frame=shadowbox,
breakatwhitespace=false,
captionpos=b,
extendedchars=true,
keepspaces=true,
numbers=left,
numberstyle=\tiny,
rulecolor=\color{black},
rulesepcolor={\color{blue!20!white}},
showspaces=false,
}

View File

@@ -47,9 +47,7 @@ $if(biblio-files)$
\bibliography{$biblio-files$} \bibliography{$biblio-files$}
$endif$ $endif$
$endif$ $endif$
$if(listings)$
\usepackage{listings} \usepackage{listings}
$endif$
$if(lhs)$ $if(lhs)$
\lstnewenvironment{code}{\lstset{language=Haskell,basicstyle=\small\ttfamily}}{} \lstnewenvironment{code}{\lstset{language=Haskell,basicstyle=\small\ttfamily}}{}
$endif$ $endif$

View File

@@ -13,7 +13,6 @@ pdf: markdown
@echo "Compiling PDF file..." @echo "Compiling PDF file..."
pandoc -f markdown+smart -s $(filename).md -o $(filename).pdf \ pandoc -f markdown+smart -s $(filename).md -o $(filename).pdf \
--title-prefix $(title) \ --title-prefix $(title) \
--listings -H meta/cpp-listings.tex \
--template=meta/template.tex \ --template=meta/template.tex \
--pdf-engine=`which xelatex` --pdf-engine=`which xelatex`
@echo "Done." @echo "Done."

View File

@@ -1,26 +0,0 @@
\usepackage{xcolor}
\definecolor{keyword}{HTML}{BA2CA3}
\definecolor{string}{HTML}{D12F1B}
\definecolor{comment}{HTML}{008400}
\lstset{
basicstyle={\small\ttfamily},
keywordstyle={\color[rgb]{0.13,0.29,0.53}\bfseries},
breaklines=true,
emphstyle={\bfseries\color{Rhodamine}},
commentstyle={\color[rgb]{0.56,0.35,0.01}\itshape},
stringstyle={\color[rgb]{0.31,0.60,0.02}},
showstringspaces=false,
frame=shadowbox,
breakatwhitespace=false,
captionpos=b,
extendedchars=true,
keepspaces=true,
numbers=left,
numberstyle=\tiny,
rulecolor=\color{black},
rulesepcolor={\color{blue!20!white}},
showspaces=false,
}

View File

@@ -51,9 +51,8 @@ $if(biblio-files)$
\bibliography{$biblio-files$} \bibliography{$biblio-files$}
$endif$ $endif$
$endif$ $endif$
$if(listings)$ \usepackage{textcomp}
\usepackage{listings} \usepackage{listings}
$endif$
$if(lhs)$ $if(lhs)$
\lstnewenvironment{code}{\lstset{language=Haskell,basicstyle=\small\ttfamily}}{} \lstnewenvironment{code}{\lstset{language=Haskell,basicstyle=\small\ttfamily}}{}
$endif$ $endif$