summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/proflycee/tex/proflycee-tools-minted.tex
blob: 4fcf8b8c9270fe89af49e6c902b0062aae4b8c8a (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
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
77
78
79
80
81
82
83
84
85
86
87
% 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.

%2.5.8	Style alternatif + Modification marges

%%------PYTHONMINTED

%v1
\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} m }{% é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=0.5\baselineskip,after skip=0.5\baselineskip,%
	left=0.6em,top=\baselineskip,bottom=2mm,right=5mm,%
	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{DarkGray}\arabic{FancyVerbLine}}
}

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

\tcbset{pytmintedalt/.style={%
	listing engine=minted,minted style=colorful,
	minted language=python,listing only,
	minted options={tabsize=4,fontsize=\footnotesize,autogobble,xleftmargin=16pt,linenos,numbersep=10pt},
	underlay={%
		\begin{tcbclipinterior}
			\filldraw[lightgray!25] (interior.south west) rectangle ([xshift=1.3em]interior.north west) ;
		\end{tcbclipinterior}%
		}
	}
}

\DeclareTCBListing{CodePythonMintedAlt}{ s O{12cm} m }{% étoilée sans numéro, taille puis options...
	\IfBooleanTF{#1}{pytmintedaltno}{pytmintedalt},
	width=#2,#3,
	enhanced,boxrule=0.75pt,colframe=DarkGray!50!Black,%
	sharp corners,top=0mm,bottom=0mm,left=0.2em,right=5mm,%
	before skip=0.5\baselineskip,after skip=0.5\baselineskip,%
	colback=white,
	fontupper=\footnotesize,fontlower=\footnotesize,%
	watermark text={\faPython},watermark opacity=0.25,watermark zoom=0.50,%
	title={{\scriptsize\faCode} Code Python},
	lefttitle=0.4em,
	fonttitle=\bfseries\footnotesize\sffamily,colbacktitle=DarkGray!50!Black,%
	before upper=\renewcommand{\theFancyVerbLine}{\scriptsize\ttfamily\color{DarkGray}\arabic{FancyVerbLine}}
}

\endinput