From 29f0b0efcee3b462b5469aec45763e820f3311a2 Mon Sep 17 00:00:00 2001
From: Sébastien Dailly <sebastien@dailly.me>
Date: Thu, 13 Jun 2024 10:25:52 +0200
Subject: Added all the styles requirements

---
 common/classes/tex/DUStyle/DUStyle.sty | 63 ++++++++++++++++++++++++++++++++++
 1 file changed, 63 insertions(+)
 create mode 100644 common/classes/tex/DUStyle/DUStyle.sty

(limited to 'common/classes/tex/DUStyle/DUStyle.sty')

diff --git a/common/classes/tex/DUStyle/DUStyle.sty b/common/classes/tex/DUStyle/DUStyle.sty
new file mode 100644
index 0000000..666d703
--- /dev/null
+++ b/common/classes/tex/DUStyle/DUStyle.sty
@@ -0,0 +1,63 @@
+\NeedsTeXFormat{LaTeX2e}[1994/06/01]
+\ProvidesPackage{DUStyle}[2018/02/25 DUStyle Package]
+
+% The macro can be used to create your own style :
+% the style will apply by declaring a custom class :
+
+%\createIconifiedDUStyle{warning}{orange}{!}{large}
+%\createIconifiedDUStyle{note}{blue}{}{large}
+
+% .. admonition:: Title
+%   :class: warning
+
+% .. sidebar:: Title
+%  :class: note
+
+\RequirePackage{tikz}
+\RequirePackage{mdframed}
+\RequirePackage{xcolor}
+\RequirePackage{ifthen}
+
+% Background color for the frame.
+\definecolor{DUStyle@lightGray}{RGB}{245, 245, 245}
+
+% arg1 : The circle backround color
+% arg2 : The dot content
+% arg3 : The title environment
+% arg4 : The title
+\newcommand{\DUStyle@iconizedTitle}[4]{%
+  \begin{#3}%
+  \ifthenelse{\equal{#2}{}}
+    {}
+    {%
+      \tikz[baseline]{%
+        \node[circle,fill=#1,inner sep=3pt,anchor=base] at (0, 0)%
+        {\color{DUStyle@lightGray}#2};
+      }%
+    }
+  {#4}
+  \end{#3}
+}
+
+\newcommand{\DUStyle@colorBox}[2]{%
+  \begin{mdframed}[topline=false,
+    bottomline=false,
+    rightline=false,
+    linecolor=#1,
+    linewidth=3pt,
+    skipabove=0.5cm,
+    %backgroundcolor=DUStyle@lightGray
+    ]%
+    #2
+  \end{mdframed}
+}
+
+% Create two commands with the same style :
+% - for the admonition colored box
+% - for the titles in styles (sidebar, admonitions...)
+\newcommand\createIconifiedDUStyle[4]{%
+  \expandafter\newcommand\csname DUadmonition#1\endcsname[1]{\DUStyle@colorBox{#2}{##1}}
+  \expandafter\newcommand\csname DUtitle#1\endcsname[1]{\DUStyle@iconizedTitle{#2}{#3}{#4}{##1}}
+}
+
+
-- 
cgit v1.2.3

