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.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  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. % Symbolbox
  66. % ----------------------------------------------------------------------
  67. \global\mdfdefinestyle{symbolbox}{
  68. % basic style
  69. style=specialbox,
  70. % background color
  71. backgroundcolor=col_symbolbox!5,
  72. % orange outer line
  73. linecolor=col_symbolbox
  74. }
  75. % Bluebox
  76. % ----------------------------------------------------------------------
  77. \global\mdfdefinestyle{bluebox}{
  78. % basic style
  79. style=specialbox,
  80. % show only top and bottom line
  81. hidealllines=true,
  82. topline=true,
  83. bottomline=true,
  84. % background
  85. backgroundcolor=col_cookbox!5,
  86. % Line color
  87. linecolor=col_cookbox,
  88. % Title
  89. frametitlerule=true,
  90. frametitlebackgroundcolor=col_cookbox!5,
  91. frametitlealignment=\centering,
  92. frametitleaboveskip=1mm,
  93. frametitlebelowskip=1mm
  94. }
  95. % Tablebox
  96. % ----------------------------------------------------------------------
  97. \global\mdfdefinestyle{tablebox}{
  98. % basic style
  99. style=specialbox,
  100. % show only top and bottom line
  101. hidealllines=true,
  102. topline=true,
  103. bottomline=true,
  104. % inner margin
  105. innerleftmargin=0em,
  106. innerrightmargin=0em,
  107. % Color
  108. backgroundcolor=col_table!5,
  109. % Title
  110. frametitlerule=true,
  111. frametitlebackgroundcolor=col_table!5,
  112. frametitleaboveskip=1mm,
  113. frametitlebelowskip=1mm,
  114. % line color
  115. linecolor=col_table
  116. }
  117. % ======================================================================
  118. % Environments
  119. % ======================================================================
  120. % sectionbox
  121. % ----------------------------------------------------------------------
  122. \newmdenv[style=sectionbox]{sectionbox}
  123. % bluebox
  124. % ----------------------------------------------------------------------
  125. \newmdenv[style=bluebox]{bluebox}
  126. % emphbox
  127. % ----------------------------------------------------------------------
  128. \newmdenv[style=emphbox, startinnercode={\centering}]{emphbox}
  129. \newmdenv[style=emphbox]{emphbox*}
  130. % symbolbox
  131. % ----------------------------------------------------------------------
  132. \newmdenv[style=symbolbox]{symbolbox}
  133. % tablebox
  134. % ----------------------------------------------------------------------
  135. \newmdenv[style=tablebox]{tableboxframe}
  136. \newenvironment{tablebox}[1]{
  137. % beginning
  138. \setlength{\tabcolsep}{4pt}
  139. \begin{tableboxframe}%[frametitle=\begin{tabular*}{\columnwidth}{@{\extracolsep\fill}#1@{}}#2\end{tabular*}]
  140. \begin{tabular*}{\columnwidth}{@{\extracolsep\fill}#1@{}}%
  141. }{
  142. %ending
  143. \end{tabular*}%
  144. \end{tableboxframe}
  145. }
  146. \newenvironment{tablebox*}[1]{
  147. % beginning
  148. \setlength{\tabcolsep}{4pt}
  149. \begin{tableboxframe}
  150. \centering
  151. \begin{tabular}{@{}#1@{}}%
  152. }{
  153. %ending
  154. \end{tabular}%
  155. \end{tableboxframe}
  156. }
  157. % cookbox
  158. % ----------------------------------------------------------------------
  159. \newenvironment{cookbox}[1]{
  160. \begin{bluebox}[frametitle=#1]
  161. \begin{enumerate}[label=\bfseries\arabic*.]
  162. }{
  163. \end{enumerate}
  164. \end{bluebox}
  165. }
  166. % Ende von \input
  167. \endinput