summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMZuenni <michi.zuendorf@gmail.com>2023-03-02 13:52:36 +0100
committerMZuenni <michi.zuendorf@gmail.com>2023-03-02 13:52:36 +0100
commitf5bf51c2a1a7664e7a39c279aa00938d698a41cf (patch)
treeb1e98a71f82dd709ba4fb863b0e93feb9855fd4b
parentb512c0b6e3db58fb8030c34c6dacb1500bbc98e3 (diff)
more colors
-rw-r--r--latexHeaders/code.sty21
-rw-r--r--tcr.pdfbin647231 -> 648939 bytes
2 files changed, 17 insertions, 4 deletions
diff --git a/latexHeaders/code.sty b/latexHeaders/code.sty
index 5c39be5..d35221b 100644
--- a/latexHeaders/code.sty
+++ b/latexHeaders/code.sty
@@ -12,10 +12,11 @@
%\colorlet{string}{safeRed}
%\colorlet{comment}{safeGreen}
%\colorlet{identifier}{black}
-\definecolor{keyword}{HTML}{2750A0}
+\definecolor{type}{HTML}{2750A0}
\definecolor{string}{HTML}{7B3294}
\definecolor{comment}{HTML}{1A9641}
\definecolor{identifier}{HTML}{000000}
+\definecolor{keyword}{HTML}{900000}
% Source code listings.
\usepackage[scaled=0.80]{beramono}
@@ -33,6 +34,7 @@
numberblanklines=true,
postbreak=\space,
tabsize=2,
+ upquote=true,
basicstyle=\ttfamily\normalsize,
showspaces=false,
showstringspaces=false,
@@ -41,18 +43,29 @@
stringstyle=\color{string}\bfseries,
commentstyle=\color{comment}\bfseries\itshape,
identifierstyle=\color{identifier},
+ directivestyle=\color{keyword}\bfseries,
+ emph={auto, int, long, long long, float, double, long double, char, bool, ll, ld, lll, __int128, __float128, true, false, nullptr, INF, inf, EPS, eps},
+ emphstyle=\color{type}\bfseries,
frame=trbl,
aboveskip=3pt,
belowskip=3pt,
- deletestring=[b]{'},%lose char heighlighting but win digit separator
- morekeywords={ll, ld, lll, __int128, __float128},
+ deletestring=[b]{'},%fix digit separator but break char highlighting (fixed again with literate)
escapechar=@
%moredelim=**[is][{\btHL[fill=green!30,draw=red,dashed,thin]}]{@}{@}
}
+\newcommand{\formatChar}[1]{{\color{string}\bfseries\textquotesingle{}#1\textquotesingle{}}}
-% Listings doesn't support UTF8. This is just enough for German umlauts.
+% Listings doesn't support UTF8. This is just enough for German umlauts. and commonly used chars
\lstset{literate=%
+ {'a'}{{\formatChar{a}}}3
+ {'z'}{{\formatChar{z}}}3
+ {'A'}{{\formatChar{A}}}3
+ {'Z'}{{\formatChar{Z}}}3
+ {'0'}{{\formatChar{0}}}3
+ {'1'}{{\formatChar{1}}}3
+ {'\$'}{{\formatChar{\$}}}3
+ {'\#'}{{\formatChar{\#}}}3
{Ö}{{\"O}}1
{Ä}{{\"A}}1
{Ü}{{\"U}}1
diff --git a/tcr.pdf b/tcr.pdf
index 1bd5697..ddbb9f4 100644
--- a/tcr.pdf
+++ b/tcr.pdf
Binary files differ