forked from tecosaur/BMC
-
Notifications
You must be signed in to change notification settings - Fork 0
/
marginInfoBulle.sty
executable file
·152 lines (123 loc) · 5.08 KB
/
marginInfoBulle.sty
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% marginInfoBulle %
% %
% %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Copyright Yves Zumbach 2017
%-------------------------------------------------------------------------------
% This work is distributed under the LPPL
%-------------------------------------------------------------------------------
% 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.
%
% This work has the LPPL maintenance status `maintained'.
%
% The Current Maintainer of this work is Yves Zumbach
% This work has been modified by tecosaur (https://github.com/tecosaur) for use with the file bmc.cls
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{marginInfoBulle}[2017/02/18 An add-on for the infoBulle package that defines commands for infoBulles in the margin of a document]
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Required Packages
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\RequirePackage{infoBulle}
\RequirePackage{yMarginDesign}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% marginInfoBulle Style
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\colorlet{marginInfoBulleBackground}{white}
\colorlet{marginInfoBulleText}{black}
\mdfdefinestyle{marginInfoBulle}
{
skipabove=0mm,
skipbelow=0mm,
innertopmargin=1mm,
innerbottommargin=1mm,
innerleftmargin=3mm,
innerrightmargin=0mm,
leftmargin=0mm,
rightmargin=0mm,
rightline=false,
topline=false,
bottomline=false,
linewidth=1mm,
frametitlebelowskip=1mm,
frametitleaboveskip=1mm,
backgroundcolor=marginInfoBulleBackground,
fontcolor=marginInfoBulleText,
frametitlefontcolor=marginInfoBulleText
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% General marginSomething Command
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Arguments: 1)boolean footnotemark 2)icon 3)color 4)title default string 5)title string 6)content
\DeclareDocumentCommand{\marginInfoAbstract}{s m m m m m}{%
\IfBooleanF{#1}{
{%
\textsuperscript{\color{#3}#2}%
}%
}
\marginElement{%
\begin{mdframed}[style=marginInfoBulle, linecolor=#3, frametitle={%
\parbox{\linewidth}{%
\mbox{}%
\parbox[t]{.5cm}{\leavevmode\color{#3}#2}%
\parbox[t]{\linewidth-.5cm}{\fontfamily{\headingsFont}\selectfont\bfseries\IfNoValueTF{#5}{#4}{#5}}%
}%
}]%
#6%
\end{mdframed}%
}%
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Instantiating Special Commands
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% marginCritical
%-------------------------------------------------------------------------------
\DeclareDocumentCommand{\marginCritical}{s o m}{%
\IfBooleanTF{#1}
{\marginInfoAbstract*{\faTimes}{criticalColor}{\GetTranslation{difficulty}}{#2}{#3}}
{\marginInfoAbstract{\faTimes}{criticalColor}{\GetTranslation{difficulty}}{#2}{#3}}%
}
% marginInfo
%-------------------------------------------------------------------------------
\DeclareDocumentCommand{\marginInfo}{s o m}{%
\IfBooleanTF{#1}
{\marginInfoAbstract*{\faInfo}{informationColor}{\GetTranslation{info}}{#2}{#3}}
{\marginInfoAbstract{\faInfo}{informationColor}{\GetTranslation{info}}{#2}{#3}}%
}
% marginTip
%-------------------------------------------------------------------------------
\DeclareDocumentCommand{\marginTip}{s o m}{%
\IfBooleanTF{#1}
{\marginInfoAbstract*{\faLightbulb}{tipColor}{\GetTranslation{tip}}{#2}{#3}}
{\marginInfoAbstract{\faLightbulb}{tipColor}{\GetTranslation{tip}}{#2}{#3}}%
}
% marginQuestion
%-------------------------------------------------------------------------------
\DeclareDocumentCommand{\marginQuestion}{s o m}{%
\IfBooleanTF{#1}
{\marginInfoAbstract*{\faQuestion}{questionColor}{\GetTranslation{question}}{#2}{#3}}
{\marginInfoAbstract{\faQuestion}{questionColor}{\GetTranslation{question}}{#2}{#3}}%
}
% marginCheck
%-------------------------------------------------------------------------------
\DeclareDocumentCommand{\marginCheck}{s o m}{%
\IfBooleanTF{#1}
{\marginInfoAbstract*{\faCheck}{checkColor}{\GetTranslation{check}}{#2}{#3}}
{\marginInfoAbstract{\faCheck}{checkColor}{\GetTranslation{check}}{#2}{#3}}%
}
% marginWarning
%-------------------------------------------------------------------------------
\DeclareDocumentCommand{\marginWarning}{s o m}{%
\IfBooleanTF{#1}
{\marginInfoAbstract*{\faExclamation}{warningColor}{\GetTranslation{warning}}{#2}{#3}}
{\marginInfoAbstract{\faExclamation}{warningColor}{\GetTranslation{warning}}{#2}{#3}}%
}
\endinput