You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

latex4ei_boxes.sty 5.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205
  1. %
  2. % Boxes for LaTeX4EI
  3. %
  4. % Authors: Emanuel Regnath, Martin Zellner
  5. % Contact: info@latex4ei.de
  6. % Version: 1.1
  7. % License: TBD
  8. %
  9. % © 2011-2019, LaTeX4EI
  10. \NeedsTeXFormat{LaTeX2e}
  11. \ProvidesPackage{latex4ei_boxes}[2015/02/06 Boxes for LaTeX4EI]
  12. % Packages
  13. % ----------------------------------------------------------------------
  14. \RequirePackage{mdframed} % package to make frames for exaples, definitions and theorems
  15. \RequirePackage{enumitem}
  16. \RequirePackage{latex4ei/latex4ei_colors} % color definitions
  17. % ======================================================================
  18. % Styles
  19. % ======================================================================
  20. % Basic box
  21. % ----------------------------------------------------------------------
  22. \mdfdefinestyle{specialbox}{
  23. % Outer Margins
  24. leftmargin=0mm,
  25. rightmargin=0mm,
  26. startcode={\vspace{0.4em}}, % FIX: spacing bug on nested frames
  27. endcode={\vspace{0.4em}}, % FIX: spacing bug on nested frames
  28. skipabove=0mm, % FIX: spacing bug on nested frames
  29. skipbelow=0mm, % FIX: spacing bug on nested frames
  30. % inner margins
  31. innertopmargin=1mm,
  32. % frame
  33. linewidth=0.3mm
  34. }
  35. % Sectionbox: provides grey boxes for better readablitity of sections
  36. % ----------------------------------------------------------------------
  37. \global\mdfdefinestyle{sectionbox}{
  38. startcode={\makeatother\if@nobreak\vspace{3cm}\null\vspace{-3cm}\fi\makeatletter}, % FIX: breaks 3cm after section
  39. nobreak=true, % FIX: unwanted behavior with multicolumn
  40. % Margin left, right, bottom and top of the boxes (-1 mm for higher width)
  41. leftmargin=-1mm,
  42. rightmargin=-1mm,
  43. skipbelow=1mm,
  44. skipabove=1mm,
  45. % Inner margin of the content of the box
  46. innerleftmargin=1mm,
  47. innerrightmargin=1mm,
  48. innertopmargin=1mm,
  49. % Colors of lines and background
  50. % backgroundcolor=col_sectionbox!3, % grey
  51. backgroundcolor=col_sectionbox!0, % white
  52. linecolor=col_sectionbox
  53. }
  54. % Emphbox: box with red line around for important definitions
  55. % ----------------------------------------------------------------------
  56. \global\mdfdefinestyle{emphbox}{
  57. % basic style
  58. style=specialbox,
  59. align=center,
  60. % background color
  61. backgroundcolor=lightyellow,
  62. % frame color
  63. linecolor=col_emphbox
  64. }
  65. % Basicbox: white box
  66. % ----------------------------------------------------------------------
  67. \global\mdfdefinestyle{basicbox}{
  68. % basic style
  69. style=specialbox,
  70. align=center,
  71. % background color
  72. backgroundcolor=col_sectionbox!0, %white%
  73. % frame color
  74. linecolor=col_sectionbox
  75. }
  76. % Symbolbox
  77. % ----------------------------------------------------------------------
  78. \global\mdfdefinestyle{symbolbox}{
  79. % basic style
  80. style=specialbox,
  81. % background color
  82. backgroundcolor=col_symbolbox!5,
  83. % orange outer line
  84. linecolor=col_symbolbox
  85. }
  86. % Bluebox
  87. % ----------------------------------------------------------------------
  88. \global\mdfdefinestyle{bluebox}{
  89. % basic style
  90. style=specialbox,
  91. % show only top and bottom line
  92. hidealllines=true,
  93. topline=true,
  94. bottomline=true,
  95. % background
  96. backgroundcolor=col_cookbox!5,
  97. % Line color
  98. linecolor=col_cookbox,
  99. % Title
  100. frametitlerule=true,
  101. frametitlebackgroundcolor=col_cookbox!5,
  102. frametitlealignment=\centering,
  103. frametitleaboveskip=1mm,
  104. frametitlebelowskip=1mm
  105. }
  106. % Tablebox
  107. % ----------------------------------------------------------------------
  108. \global\mdfdefinestyle{tablebox}{
  109. % basic style
  110. style=specialbox,
  111. % show only top and bottom line
  112. hidealllines=true,
  113. topline=true,
  114. bottomline=true,
  115. % inner margin
  116. innerleftmargin=0em,
  117. innerrightmargin=0em,
  118. % Color
  119. backgroundcolor=col_table!5,
  120. % Title
  121. frametitlerule=true,
  122. frametitlebackgroundcolor=col_table!5,
  123. frametitleaboveskip=1mm,
  124. frametitlebelowskip=1mm,
  125. % line color
  126. linecolor=col_table
  127. }
  128. % ======================================================================
  129. % Environments
  130. % ======================================================================
  131. % sectionbox
  132. % ----------------------------------------------------------------------
  133. \newmdenv[style=sectionbox]{sectionbox}
  134. % bluebox
  135. % ----------------------------------------------------------------------
  136. \newmdenv[style=bluebox]{bluebox}
  137. % emphbox
  138. % ----------------------------------------------------------------------
  139. \newmdenv[style=emphbox, startinnercode={\centering}]{emphbox}
  140. \newmdenv[style=emphbox]{emphbox*}
  141. % symbolbox
  142. % ----------------------------------------------------------------------
  143. \newmdenv[style=symbolbox]{symbolbox}
  144. % basicbox
  145. % ----------------------------------------------------------------------
  146. \newmdenv[style=basicbox]{basicbox}
  147. % tablebox
  148. % ----------------------------------------------------------------------
  149. \newmdenv[style=tablebox]{tableboxframe}
  150. \newenvironment{tablebox}[1]{
  151. % beginning
  152. \setlength{\tabcolsep}{4pt}
  153. \begin{tableboxframe}%[frametitle=\begin{tabular*}{\columnwidth}{@{\extracolsep\fill}#1@{}}#2\end{tabular*}]
  154. \begin{tabular*}{\columnwidth}{@{\extracolsep\fill}#1@{}}%
  155. }{
  156. %ending
  157. \end{tabular*}%
  158. \end{tableboxframe}
  159. }
  160. \newenvironment{tablebox*}[1]{
  161. % beginning
  162. \setlength{\tabcolsep}{4pt}
  163. \begin{tableboxframe}
  164. \centering
  165. \begin{tabular}{@{}#1@{}}%
  166. }{
  167. %ending
  168. \end{tabular}%
  169. \end{tableboxframe}
  170. }
  171. % cookbox
  172. % ----------------------------------------------------------------------
  173. \newenvironment{cookbox}[1]{
  174. \begin{bluebox}[frametitle=#1]
  175. \begin{enumerate}[label=\bfseries\arabic*.]
  176. }{
  177. \end{enumerate}
  178. \end{bluebox}
  179. }
  180. % Ende von \input
  181. \endinput