summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/proflycee/tex/proflycee-tools-minted.tex
blob: 1a30544565143a42300b8ef5554bbe7d5a4717d4 (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
39
40
41
42
43
44
45
46
47
48
% proflycee-tools-minted.tex
% Copyright 2023  Cédric Pierquet
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
% of this license or (at your option) any later version.
% The latest version of this license is in
%   http://www.latex-project.org/lppl.txt
% and version 1.3 or later is part of all distributions of LaTeX
% version 2005/12/01 or later.

%%------PYTHONMINTED
\tcbset{pytmintedno/.style={%
	listing engine=minted,minted style=colorful,
	minted language=python,listing only,
	minted options={tabsize=4,fontsize=\footnotesize,autogobble},
	}
}

\tcbset{pytminted/.style={%
	listing engine=minted,minted style=colorful,
	minted language=python,listing only,
	minted options={tabsize=4,fontsize=\footnotesize,autogobble,xleftmargin=16pt,linenos,numbersep=10pt},
	}
}

\DeclareTCBListing{CodePythonMinted}{ s O{12cm} O{} }{% étoilée sans numéro, taille puis options...
	\IfBooleanTF{#1}{pytmintedno}{pytminted},
	enhanced,width=#2,#3,
	colframe=Green,colback=ForestGreen!5,%
	boxrule=1.25pt,
	sharp corners=downhill,arc=12pt,
	before skip=12pt,after skip=12pt,%
	leftupper=8pt,top=10pt,bottom=4pt,rightupper=4pt,%
	attach boxed title to top right={yshift=-\tcboxedtitleheight},
	boxed title style={
		size=small,colback=ForestGreen!25,boxrule=1.25pt,
		colframe=Green,boxsep=1.25pt,
		sharp corners=downhill,
		arc=12pt,
		top=2pt,bottom=1pt,left=6pt,right=6pt
	},
	fonttitle=\color{ForestGreen}\itshape\ttfamily\footnotesize,
	title={\scriptsize\faPython}\:Code Python\vphantom{y},
	watermark text={\faPython},watermark opacity=0.175,watermark zoom=0.50,
	before upper=\renewcommand{\theFancyVerbLine}{\scriptsize\ttfamily\color{Green}\arabic{FancyVerbLine}}
}

\endinput