custom.sty 2.89 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
\NeedsTeXFormat{LaTeX2e}[1994/06/01]
\ProvidesPackage{custom}[2018/11/23 Slide Customization]

\RequirePackage{twcolors}
\RequirePackage{listings}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Listings
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\lstloadlanguages{[ISO]C++}

% \lst@Key{matchrangestart}{f}{\lstKV@SetIf{#1}\lst@ifmatchrangestart}
% \def\lst@SkipToFirst{%
%     \lst@ifmatchrangestart\c@lstnumber=\numexpr-1+\lst@firstline\fi
%     \ifnum \lst@lineno<\lst@firstline
%         \def\lst@next{\lst@BeginDropInput\lst@Pmode
%         \lst@Let{13}\lst@MSkipToFirst
%         \lst@Let{10}\lst@MSkipToFirst}%
%         \expandafter\lst@next
%     \else
%         \expandafter\lst@BOLGobble
%     \fi}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% C Syntax Highlighting
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\definecolor{c-violett}{RGB}{120,28,206}

\lstdefinestyle{c} {
    language={[ISO]C++},
    frame=shadowbox,
    framexleftmargin=8mm,
    rulesepcolor=\color{\accentcolor!50},
    basicstyle=\ttfamily\footnotesize,
    commentstyle=\color{\secondarycolor},
    stringstyle=\color{ttw-violett},
    keywordstyle=\bfseries\color{\primarycolor},
    directivestyle=\color{c-violett},
    emphstyle=\color{c-violett},
    captionpos=b,
    numbers=left,
    numberstyle=\ttfamily\color{\accentcolor},
    tabsize=3,
    morekeywords={nullptr},
    % matchrangestart=t,
    showlines=true
}
Alija Sabic's avatar
Alija Sabic committed
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Sliced Circular Progressbar
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\newcommand{\slicedcircularprogressbar}[9]{% Syntax: \twprogressbar{\coordinate}{\oradius}{\iradius}{\oangle}{\total}{\number}{\basecol}{\fillcol}{\bgcol}
\begin{tikzpicture}[overlay]
    \def\ratio{#6/#5}

    \def\outerradius{#2}
    \def\innerradius{#3}

    \coordinate (centerprogressbar) at #1;

    \draw[draw=none,fill=#7] (centerprogressbar) circle (\outerradius);
    \draw[draw=none,fill=#8] (centerprogressbar) -- (centerprogressbar) ++(0,\outerradius) arc (90:90-360*\ratio:\outerradius) -- (centerprogressbar);
    \draw[draw=none,fill=#9] (centerprogressbar) circle (\innerradius);

    \pgfmathparse{#5-1}
    \pgfmathsetmacro{\nums}{\pgfmathresult}

    \foreach \x in {0,...,\nums} {
        \pgfmathparse{360/#5*\x}
        \pgfmathsetmacro{\angl}{\pgfmathresult}
        \def\slice{#4}
        \draw[draw=none,fill=#9,line width=0.1mm] (centerprogressbar) -- +(90-\angl+\slice:\outerradius+0.1) arc (90-\angl+\slice:90-\angl-\slice*2:\outerradius) -- cycle;
    }
\end{tikzpicture}
}