aboutsummaryrefslogtreecommitdiff
path: root/latex_docutils/texmf/tex/latex/docUtils/DUStyle
diff options
context:
space:
mode:
authorSébastien Dailly <sebastien@chimrod.com>2018-02-25 12:09:44 +0100
committerSébastien Dailly <sebastien@chimrod.com>2018-02-25 12:09:44 +0100
commitfb8e4dff30d84d0c81d4b7762bacf5c57ea6e1e2 (patch)
treebaaa4fcb47dc0806b4045f774d29c4705c00de38 /latex_docutils/texmf/tex/latex/docUtils/DUStyle
parent68b91fae3b623d719ada6d5d15b5ced4871ec0b0 (diff)
Update configuration
Diffstat (limited to 'latex_docutils/texmf/tex/latex/docUtils/DUStyle')
-rw-r--r--latex_docutils/texmf/tex/latex/docUtils/DUStyle/DUStyle.sty44
1 files changed, 44 insertions, 0 deletions
diff --git a/latex_docutils/texmf/tex/latex/docUtils/DUStyle/DUStyle.sty b/latex_docutils/texmf/tex/latex/docUtils/DUStyle/DUStyle.sty
new file mode 100644
index 0000000..45092b2
--- /dev/null
+++ b/latex_docutils/texmf/tex/latex/docUtils/DUStyle/DUStyle.sty
@@ -0,0 +1,44 @@
+\NeedsTeXFormat{LaTeX2e}[1994/06/01]
+\ProvidesPackage{DUStyle}[2018/02/25 DUStyle Package]
+
+\RequirePackage{tikz}
+\RequirePackage{mdframed}
+\RequirePackage{xcolor}
+
+\definecolor{lightGray}{RGB}{245, 245, 245}
+
+% arg1 : The circle backround color
+% arg2 : The dot text
+% arg3 : The title command prefix
+% arg4 : The title
+\newcommand{\DUIconizedTitle}[4]{%
+ \begin{#3}
+ \tikz[baseline]{
+ \node[circle,fill=#1,inner sep=3pt,anchor=base] at (0, 0)
+ {\color{lightGray}#2};
+ }
+ {#4}
+ \end{#3}
+}
+
+\newcommand{\colorBox}[2]{%
+ \begin{mdframed}[topline=false,
+ bottomline=false,
+ rightline=false,
+ linecolor=#1,
+ linewidth=3pt,
+ skipabove=0.5cm,
+ backgroundcolor=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]{\colorBox{#2}{##1}}
+ \expandafter\newcommand\csname DUtitle#1\endcsname[1]{\DUIconizedTitle{#2}{#3}{#4}{##1}}
+}
+
+