diff options
Diffstat (limited to 'macros/latex/contrib/bmstu-iu8/bmstu-iu8/styles/20-IU8-listing.sty')
-rw-r--r-- | macros/latex/contrib/bmstu-iu8/bmstu-iu8/styles/20-IU8-listing.sty | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/macros/latex/contrib/bmstu-iu8/bmstu-iu8/styles/20-IU8-listing.sty b/macros/latex/contrib/bmstu-iu8/bmstu-iu8/styles/20-IU8-listing.sty new file mode 100644 index 0000000000..e0e7f96251 --- /dev/null +++ b/macros/latex/contrib/bmstu-iu8/bmstu-iu8/styles/20-IU8-listing.sty @@ -0,0 +1,38 @@ +% Author: CatInCosmicSpace +\NeedsTeXFormat{LaTeX2e}[1995/12/01] +\ProvidesPackage{20-IU8-listing}[2021/03/21 v1.1 Листинги] + +\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}% +} |