From c015324c5c2224a49f23aabdb6783ed796ac4ebd Mon Sep 17 00:00:00 2001 From: Changkun Ou Date: Sun, 26 Jul 2020 11:53:30 +0200 Subject: [PATCH] pdf: escape dollar sign in lstlistings fixes #106 --- pdf/en-us/Makefile | 1 - pdf/en-us/meta/cpp-listings.tex | 26 -------------------------- pdf/en-us/meta/template.tex | 2 -- pdf/zh-cn/Makefile | 1 - pdf/zh-cn/meta/cpp-listings.tex | 26 -------------------------- pdf/zh-cn/meta/template.tex | 3 +-- 6 files changed, 1 insertion(+), 58 deletions(-) delete mode 100644 pdf/en-us/meta/cpp-listings.tex delete mode 100644 pdf/zh-cn/meta/cpp-listings.tex diff --git a/pdf/en-us/Makefile b/pdf/en-us/Makefile index 9de3e75..7846a52 100644 --- a/pdf/en-us/Makefile +++ b/pdf/en-us/Makefile @@ -13,7 +13,6 @@ pdf: markdown @echo "Compiling PDF file..." pandoc -f markdown+smart -s $(filename).md -o $(filename).pdf \ --title-prefix $(title) \ - --listings -H meta/cpp-listings.tex \ --template=meta/template.tex \ --pdf-engine=`which xelatex` @echo "Done." diff --git a/pdf/en-us/meta/cpp-listings.tex b/pdf/en-us/meta/cpp-listings.tex deleted file mode 100644 index c57fcda..0000000 --- a/pdf/en-us/meta/cpp-listings.tex +++ /dev/null @@ -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, -} diff --git a/pdf/en-us/meta/template.tex b/pdf/en-us/meta/template.tex index 9c09040..10ecc91 100644 --- a/pdf/en-us/meta/template.tex +++ b/pdf/en-us/meta/template.tex @@ -47,9 +47,7 @@ $if(biblio-files)$ \bibliography{$biblio-files$} $endif$ $endif$ -$if(listings)$ \usepackage{listings} -$endif$ $if(lhs)$ \lstnewenvironment{code}{\lstset{language=Haskell,basicstyle=\small\ttfamily}}{} $endif$ diff --git a/pdf/zh-cn/Makefile b/pdf/zh-cn/Makefile index 72ad8cf..ac0b42a 100644 --- a/pdf/zh-cn/Makefile +++ b/pdf/zh-cn/Makefile @@ -13,7 +13,6 @@ pdf: markdown @echo "Compiling PDF file..." pandoc -f markdown+smart -s $(filename).md -o $(filename).pdf \ --title-prefix $(title) \ - --listings -H meta/cpp-listings.tex \ --template=meta/template.tex \ --pdf-engine=`which xelatex` @echo "Done." diff --git a/pdf/zh-cn/meta/cpp-listings.tex b/pdf/zh-cn/meta/cpp-listings.tex deleted file mode 100644 index c57fcda..0000000 --- a/pdf/zh-cn/meta/cpp-listings.tex +++ /dev/null @@ -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, -} diff --git a/pdf/zh-cn/meta/template.tex b/pdf/zh-cn/meta/template.tex index 993f49f..f7146d6 100644 --- a/pdf/zh-cn/meta/template.tex +++ b/pdf/zh-cn/meta/template.tex @@ -51,9 +51,8 @@ $if(biblio-files)$ \bibliography{$biblio-files$} $endif$ $endif$ -$if(listings)$ +\usepackage{textcomp} \usepackage{listings} -$endif$ $if(lhs)$ \lstnewenvironment{code}{\lstset{language=Haskell,basicstyle=\small\ttfamily}}{} $endif$