summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/bmstu-iu8/20-IU8-listing.sty
blob: c90194a1d253b8d312b45c57571bfe4f5b1faab1 (plain)
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
% Author: CatInCosmicSpace
\NeedsTeXFormat{LaTeX2e}[1995/12/01]
\ProvidesPackage{20-IU8-listing}[2021/03/21 v1.2 Листинги]

\RequirePackage{listings}
\RequirePackage{xcolor}

% http://latexcolor.com/
\definecolor{seashell}{rgb}{1.0, 0.96, 0.93}

\lstdefinestyle{IU8}{
    frame=single,
    backgroundcolor=\color{seashell},
    commentstyle=\color{blue},
    keywordstyle=\color{magenta},
    basicstyle=\ttfamily\footnotesize,
    breakatwhitespace=false,         
    breaklines=true,                 
    captionpos=tl,
    keepspaces=false,                  
    showspaces=false,                
    showstringspaces=false,
    showtabs=false,         
    extendedchars=\true,         
    tabsize=2,
}
\lstset{style=IU8}

\DeclareCaptionFormat{listing}{#1#2#3}
\captionsetup[lstlisting]{
    format=listing,
    singlelinecheck=false,
    labelsep=endash,
}

\newcommand{\listing}[2][]{%
    \lstinputlisting[caption={\texttt{\detokenize{#2}}},#1]{#2}%
}