Guest User

Untitled

a guest
Apr 23rd, 2018
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 15.61 KB | None | 0 0
  1. % !TeX program = xelatex
  2.  
  3. documentclass[fromlogo = true]{article}
  4. usepackage{varwidth,cancel}
  5.  
  6. usepackage{eso-pic,mathtools}
  7. usepackage{tikz}
  8. usepackage[many]{tcolorbox}
  9. tcbuselibrary{skins,breakable,xparse}
  10. tikzset{coltria/.style = {fill = bllue}}
  11. tikzset{cccoltria/.style= {fill = bllack}}
  12. tikzset{cccccoltria/.style = {fill=red}}
  13. usepackage{refcount}
  14. usetikzlibrary{backgrounds,calc}
  15. usepackage{tikzpagenodes}
  16. usepackage{lipsum}
  17.  
  18. usepackage{fontspec}
  19. usepackage[first=-90, last = 90]{lcg}
  20. newcommand{random}{0.2*rand}
  21. newcommand{rulewidth}{5 mm}
  22. usepackage{xstring}
  23. usepackage{marginnote}
  24.  
  25. definecolor{grey}{RGB}{220,220,220}
  26.  
  27. usepackage{varwidth}
  28.  
  29. allowdisplaybreaks
  30.  
  31. usepackage{polyglossia}
  32. usepackage{amsmath}
  33. usepackage{graphics}
  34. usepackage{color}
  35. usepackage{xcolor}
  36. usepackage{graphics}
  37. usepackage{graphicx}
  38. usetikzlibrary{shapes.callouts,shapes.arrows,matrix,shapes.misc,shadows.blur,shapes,arrows, patterns, hobby,shapes.multipart}
  39. usepackage{pgfplots}
  40. pgfplotsset{compat=1.6}
  41. usepackage{float}
  42. usepackage{libertine}
  43. usepackage{courier}
  44. usepackage{enumitem}
  45. usepackage{arydshln}
  46. usepackage{booktabs}
  47. usepackage{bm}
  48. usepackage[framemethod = tikz]{mdframed}
  49. usepackage{framed}
  50. usepackage[framed]{ntheorem}
  51. usepackage{titlesec}
  52. usetikzlibrary{backgrounds}
  53. usepackage{comment}
  54. usepackage{courier}
  55. usepackage{verbatim}
  56.  
  57.  
  58. definecolor{bllue}{RGB}{0,0,255}
  59. definecolor{bllack}{RGB}{0,255,0}
  60.  
  61.  
  62. newcommand{bllackpicture}{textcolor{black}{Box}}
  63.  
  64. newcommand{redpicture}{
  65. textcolor{red}{Box}}
  66.  
  67. newcommand{blluepicture}{
  68. textcolor{bllue}{Box}}
  69.  
  70.  
  71.  
  72. newcommand{Rn}{purple}
  73.  
  74. tcbset{setskinf/.style = {skin first is subskin of={emptyfirst}{
  75. oversize, enhanced,
  76. frame code = {path[tcb fill frame,rounded corners] (frame.south west)--(frame.north west) -- (frame.north east)--(frame.south east)--cycle;
  77. path[#1] ([xshift = 2.5mm, yshift = 1mm]frame.south west) -- +(120:2mm) -- +(60:2mm)-- cycle;},
  78. interior code={path[tcb fill interior,rounded corners] (interior.south west|-frame.south)--(interior.north west)--([xshift=-4.8mm]interior.north east)--([yshift=-4.8mm]interior.north east)--(interior.south east|-frame.south)--cycle;}
  79. ,}}}
  80. tcbset{setskinm/.style = {
  81. skin middle is subskin of={emptymiddle}{
  82. oversize, enhanced,
  83. frame code = {path[tcb fill frame,rounded corners] (frame.south west)--(frame.north west) -- (frame.north east)--(frame.south east)--cycle;
  84. path[#1] ([xshift = 2.5mm, yshift = -1mm]frame.north west) -- +(240:2mm) -- +(300:2mm)-- cycle;
  85. path[#1] ([xshift = 2.5mm, yshift = 1mm]frame.south west) -- +(120:2mm) -- +(60:2mm)-- cycle;},
  86. interior code={path[tcb fill interior,rounded corners] (interior.south west|-frame.south)--(interior.north west)--([xshift=-4.8mm]interior.north east)--([yshift=-4.8mm]interior.north east)--(interior.south east|-frame.south)--cycle;}
  87. ,}}}
  88. tcbset{setskinl/.style = {
  89. skin last is subskin of={emptylast}{
  90. oversize, enhanced,
  91. frame code = {path[tcb fill frame,rounded corners] (frame.south west)--(frame.north west) -- (frame.north east)--(frame.south east)--cycle;
  92. path[#1] ([xshift = 2.5mm, yshift = -1mm]frame.north west) -- +(240:2mm) -- +(300:2mm)-- cycle;},
  93. interior code={path[tcb fill interior,rounded corners] (interior.south west|-frame.south)--(interior.north west)--([xshift=-4.8mm]interior.north east)--([yshift=-4.8mm]interior.north east)--(interior.south east|-frame.south)--cycle;}
  94. ,}}}
  95.  
  96. tcbset{boxedtitle/.style = {attach boxed title to top left = {xshift = 1cm, yshift*=1mm-tcboxedtitleheight}, varwidth boxed title*=-3cm,
  97. boxed title style={frame code = {
  98. path[fill=tcbcol@back!30!black]
  99. ([yshift = -1mm,xshift = -1mm] frame.north west)
  100. arc[start angle=0,end angle=180,radius=1mm]
  101. ([yshift = -1mm,xshift = 1mm] frame.north east)
  102. arc[start angle = 180, end angle = 0, radius = 1mm];
  103. path[left color = tcbcol@back!60!black, right color = tcbcol@back!60!black, middle color = tcbcol@back!80!black]
  104. ([xshift=-2mm]frame.north west)--([xshift=2mm]frame.north east) [rounded corners=1mm]--([xshift=1mm,yshift=-1mm]frame.north east) --(frame.south east)--(frame.south west)
  105. --([xshift=-1mm,yshift=-1mm]frame.north west)
  106. [sharp corners]-- cycle;
  107. },interior engine=empty,
  108. },
  109. fonttitle=bfseries}}
  110.  
  111. tcbset{normal/.style n args = {1}{enlarge top initially by = 1cm,enlarge bottom finally by = 7mm,enlarge left by = 5mm,
  112. enlarge right by = 5mm,
  113. width = linewidth+2cm,
  114. overlay unbroken = {draw[Rn!70!black, line width = .8mm, rounded corners]
  115. ([xshift = -5mm, yshift = -5mm]frame.south west)|-([yshift = 9mm]frame.north)-|
  116. ([xshift = 5mm, yshift = -5mm]frame.south east) -- cycle;
  117. coordinate (outernw) at ([shift = {(-5mm,1cm)}]frame.north west);
  118. node[fill=Rn!70!black, minimum height = 5mm,
  119. anchor = north west, text = white, rounded corners] at ([xshift = 1cm]outernw) (outertitle) {Title #1};
  120. path[fill = Rn!30!black]
  121. ([yshift = -1mm, xshift = -1mm]outertitle.north west)
  122. arc[start angle = 0, end angle = 180, radius = 1mm]
  123. ([yshift = -1mm, xshift = 1mm]outertitle.north east)
  124. arc[start angle = 180, end angle = 0, radius = 1mm];
  125. path[left color = Rn!60!black, right color = Rn!60!black, middle color = Rn!80!black]
  126. ([xshift = -2mm]outertitle.north west) -- ([xshift = 2mm]outertitle.north east)[rounded corners = 1mm]
  127. -- ([xshift = 1mm, yshift = -1mm]outertitle.north east) -- (outertitle.south east) -- (outertitle.south west)
  128. -- ([xshift = -1mm, yshift = -1mm]outertitle.north west)
  129. [sharp corners] -- cycle;
  130. node[text = white] at (outertitle) {Title #1};
  131. },
  132. overlay first = {draw[Rn!70!black, line width = .8mm, rounded corners]
  133. ([xshift = -5mm]frame.south west)|-([yshift = 9mm]frame.north)-|
  134. ([xshift = 5mm]frame.south east);
  135. coordinate (outernw) at ([shift = {(-5mm,1cm)}]frame.north west);
  136. node[fill=Rn!70!black, minimum height = 5mm,
  137. anchor = north west, text = white, rounded corners] at ([xshift = 1cm]outernw) (outertitle) {Question #1};
  138. path[fill = Rn!30!black]
  139. ([yshift = -1mm, xshift = -1mm]outertitle.north west)
  140. arc[start angle = 0, end angle = 180, radius = 1mm]
  141. ([yshift = -1mm, xshift = 1mm]outertitle.north east)
  142. arc[start angle = 180, end angle = 0, radius = 1mm];
  143. path[left color = Rn!60!black, right color = Rn!60!black, middle color = Rn!80!black]
  144. ([xshift = -2mm]outertitle.north west) -- ([xshift = 2mm]outertitle.north east)[rounded corners = 1mm]
  145. -- ([xshift = 1mm, yshift = -1mm]outertitle.north east) -- (outertitle.south east) -- (outertitle.south west)
  146. -- ([xshift = -1mm, yshift = -1mm]outertitle.north west)
  147. [sharp corners] -- cycle;
  148. node[text = white] at (outertitle) {Question #1};
  149. },
  150. overlay middle = {
  151. draw[Rn!70!black, line width = .8mm]
  152. ([xshift = -5mm]frame.north west)--([xshift = -5mm]frame.south west)
  153. ([xshift = 5mm]frame.north east)--([xshift = 5mm]frame.south east);
  154. },
  155. overlay last = {draw[Rn!70!black, line width = .8mm, rounded corners]
  156. ([xshift = -5mm]frame.north west)|-([yshift = -5mm]frame.south)-|
  157. ([xshift = 5mm]frame.north east);
  158. }
  159. }}
  160.  
  161. tcbset{top/.style n args = {1}{enlarge top initially by = 1cm, enlarge bottom finally by = 1mm,
  162. enlarge left by = 5mm,
  163. enlarge right by = 5mm,
  164. width = linewidth+2cm,
  165. overlay unbroken and first = {
  166. draw[Rn!70!black, line width = .8mm, rounded corners]
  167. ([xshift = -5mm, yshift = -2mm]frame.south west)|-([yshift = 9mm]frame.north)-|
  168. ([xshift = 5mm, yshift = -2mm]frame.south east);
  169. coordinate (outernw) at ([shift = {(-5mm,1cm)}]frame.north west);
  170. node[fill=Rn!70!black, minimum height = 5mm,
  171. anchor = north west, text = white, rounded corners] at ([xshift = 1cm]outernw) (outertitle) {Title #1};
  172. path[fill = Rn!30!black]
  173. ([yshift = -1mm, xshift = -1mm]outertitle.north west)
  174. arc[start angle = 0, end angle = 180, radius = 1mm]
  175. ([yshift = -1mm, xshift = 1mm]outertitle.north east)
  176. arc[start angle = 180, end angle = 0, radius = 1mm];
  177. path[left color = Rn!60!black, right color = Rn!60!black, middle color = Rn!80!black]
  178. ([xshift = -2mm]outertitle.north west) -- ([xshift = 2mm]outertitle.north east)[rounded corners = 1mm]
  179. -- ([xshift = 1mm, yshift = -1mm]outertitle.north east) -- (outertitle.south east) -- (outertitle.south west)
  180. -- ([xshift = -1mm, yshift = -1mm]outertitle.north west)
  181. [sharp corners] -- cycle;
  182. node[text = white] at (outertitle) {Title #1};
  183. },
  184. overlay middle and last = {
  185. draw[Rn!70!black, line width = .8mm]
  186. ([xshift = -5mm]frame.north west)--([xshift = -5mm]frame.south west)
  187. ([xshift = 5mm]frame.north east)--([xshift = 5mm]frame.south east);
  188. }}}
  189.  
  190. tcbset{middle/.style n args = {1}{enlarge top initially by = 1mm, enlarge bottom finally by = 1mm,
  191. enlarge left by = 5mm,
  192. enlarge right by = 5mm,
  193. width = linewidth+2cm,
  194. overlay unbroken = {
  195. draw[Rn!70!black,line width = .8mm]
  196. ([shift = {(-5mm,3mm)}]frame.north west)--([shift = {(-5mm,-3mm)}]frame.south west)
  197. ([shift = {(5mm,3mm)}]frame.north east)--([shift = {(5mm,-3mm)}]frame.south east);
  198. },
  199. overlay first = {
  200. draw[Rn!70!black,line width = .8mm]
  201. ([shift = {(-5mm,5mm)}]frame.north west)--([xshift = -5mm]frame.south west)
  202. ([shift = {(5mm,5mm)}]frame.north east)--([xshift = 5mm]frame.south east);
  203. },
  204. overlay middle = {
  205. draw[Rn!70!black,line width = .8mm]
  206. ([xshift = -5mm]frame.north west)--([xshift = -5mm]frame.south west)
  207. ([xshift = 5mm]frame.north east)--([xshift = 5mm]frame.south east);
  208. },
  209. overlay last = {
  210. draw[Rn!70!black,line width = .8mm]
  211. ([xshift = -5mm]frame.north west)--([shift = {(-5mm,-5mm)}]frame.south west)
  212. ([xshift = 5mm]frame.north east)--([shift = {(5mm,-5mm)}]frame.south east);
  213. },
  214. }}
  215.  
  216. tcbset{bottom/.style = {enlarge bottom finally by = 7mm, enlarge top initially by = 1mm,
  217. enlarge left by = 5mm,
  218. enlarge right by = 5mm,
  219. width = linewidth+2cm,
  220. overlay unbroken and last = {
  221. draw[Rn!70!black, line width = .8mm, rounded corners]
  222. ([xshift = -5mm, yshift = 2mm]frame.north west)|-([yshift = -5mm]frame.south)-|
  223. ([xshift = 5mm, yshift = 2mm]frame.north east);
  224. },
  225. overlay first and middle = {
  226. draw[Rn!70!black, line width = .8mm]
  227. ([xshift = -5mm]frame.north west)--([xshift = -5mm]frame.south west)
  228. ([xshift = 5mm]frame.north east)--([xshift = 5mm]frame.south east);
  229. }}}
  230.  
  231. newtcolorbox{generic}[5][]{empty,leftrule=rulewidth,oversize, enhanced,
  232. frame style = {left color = #2!20, right color = white},interior style = {left color = #2!5, right color = white}, left = 0pt, right = 0pt, %top = 4pt, bottom = 4pt,
  233. before skip = 0pt, after skip = 0pt,% boxrule = 0.1pt,
  234. title = #3, underlay={begin{tcbclipinterior}
  235. shade[inner color = #2!10, outer color = white] (interior.north west) circle (2cm);
  236. draw[help lines, step = 5mm, #2!5,shift={(interior.north west)}] (interior.south west) grid (interior.north east);
  237. end{tcbclipinterior}
  238. }, drop small lifted shadow,
  239. breakable,rotate = random
  240. ,
  241. frame code = {path[tcb fill frame,rounded corners] (frame.south west)--(frame.north west) -- (frame.north east)--(frame.south east)--cycle;
  242. },
  243. interior code={path[tcb fill interior,rounded corners] (interior.south west|-frame.south)--(interior.north west)--([xshift=-4.8mm]interior.north east)--([yshift=-4.8mm]interior.north east)--(interior.south east|-frame.south)--cycle;},
  244. % test
  245. setskinf = {#4},setskinm = {#4},setskinl = {#4},#5, #1}
  246.  
  247. newcommand{bllack}[3][]{begin{generic}[#1]{bllack}{bllackpicture}{cccoltria}
  248. {normal = #2}
  249. #3
  250. end{generic}}
  251.  
  252. newcommand{tbllack}[3][]{begin{generic}[#1]{bllack}{bllackpicture}{cccoltria}
  253. {top = #2}
  254. #3
  255. end{generic}}
  256. newcommand{mbllack}[2][]{begin{generic}[#1]{bllack}{bllackpicture}{cccoltria}
  257. {middle}
  258. #2
  259. end{generic}}
  260. newcommand{bbllack}[2][]{begin{generic}[#1]{bllack}{bllackpicture}{cccoltria}
  261. {bottom}
  262. #2
  263. end{generic}}
  264.  
  265. newcommand{red}[3][]{
  266. begin{generic}[#1]{red}{redpicture}{cccccoltria}
  267. {normal = #2}
  268. #3
  269. end{generic}}
  270. newcommand{tred}[3][]{
  271. begin{generic}[#1]{red}{redpicture}{cccccoltria}
  272. {top = #2}
  273. #3
  274. end{generic}}
  275. newcommand{mred}[2][]{
  276. begin{generic}[#1]{red}{redpicture}{cccccoltria}
  277. {middle}
  278. #2
  279. end{generic}}
  280. newcommand{bred}[2][]{
  281. begin{generic}[#1]{red}{redpicture}{cccccoltria}
  282. {bottom}
  283. #2
  284. end{generic}}
  285.  
  286. newcommand{bllue}[3][]{
  287. begin{generic}[#1]{bllue}{blluepicture}{coltria}
  288. {normal = #2}
  289. #3
  290. end{generic}}
  291. newcommand{tbllue}[3][]{
  292. begin{generic}[#1]{bllue}{blluepicture}{coltria}
  293. {top = #2}
  294. #3
  295. end{generic}}
  296. newcommand{mbllue}[2][]{
  297. begin{generic}[#1]{bllue}{blluepicture}{coltria}
  298. {middle}
  299. #2
  300. end{generic}}
  301. newcommand{bbllue}[2][]{
  302. begin{generic}[#1]{bllue}{blluepicture}{coltria}
  303. {bottom}
  304. #2
  305. end{generic}}
  306.  
  307. newcommand{tcblowerr}{begin{tcblowerbox}%{middle}
  308. tcblower
  309. end{tcblowerbox}}
  310.  
  311. begin{document}
  312. %
  313. tbllack{1}{lipsum[1-1]}
  314. mred{lipsum[1-1]}
  315. bbllue{lipsum[1-1]}
  316. tbllack{2}{lipsum[1-1]}
  317. bred{lipsum[1-1]}
  318. bllue{3}{lipsum[1-1]}
  319. tred{4}{lipsum[1-1]}
  320. mbllue{lipsum[1-1]}
  321. bbllack{lipsum[1-1]}
  322. bllack{6}{lipsum[1-1]}
  323. %
  324. tbllack{1}{lipsum[1-1]}
  325. mred{lipsum[1-1]}
  326. bbllue{lipsum[1-1]}
  327. tbllack{2}{lipsum[1-1]}
  328. bred{lipsum[1-1]}
  329. %newpage
  330. %section{Title}
  331. bllue{3}{lipsum[1-1]}
  332. tred{4}{lipsum[1-1]}
  333. mbllue{lipsum[1-1]}
  334. bbllack{lipsum[1-1]}
  335. bllack{6}{lipsum[1-1]}
  336. %
  337. tbllue{7}{lipsum[1-1]}
  338. mbllack{lipsum[1-1]}
  339. bred{lipsum[1-1]}
  340. red{{8}}{lipsum[1-1]}
  341. %
  342. %newpage
  343. %section{Title}
  344. bllue{3}{lipsum[1-1]}
  345. tred{4}{lipsum[1-1]}
  346. mbllue{lipsum[1-1]}
  347. bbllack{lipsum[1-1]}
  348. bllack{6}{lipsum[1-1]}
  349. %
  350. tbllue{7}{lipsum[1-1]}
  351. mbllack{lipsum[1-1]}
  352. bred{lipsum[1-2]}
  353. red{{8}}{lipsum[1-1]}
  354. %
  355. tbllack{1}{lipsum[1-1]}
  356. mred{lipsum[1-1]}
  357. bbllue{lipsum[1-1]}
  358. tbllack{2}{lipsum[1-1]}
  359. bred{lipsum[1-1]}
  360. bllue{3}{lipsum[1-1]}
  361. tred{4}{lipsum[1-1]}
  362. mbllue{lipsum[1-1]}
  363. bbllack{lipsum[1-1]}
  364. bllack{6}{lipsum[1-1]}
  365. %
  366. tbllack{1}{lipsum[1-1]}
  367. mred{lipsum[1-1]}
  368. bbllue{lipsum[1-1]}
  369. tbllack{2}{lipsum[1-1]}
  370. bred{lipsum[1-1]}
  371. %newpage
  372. %section{Title}
  373. bllue{3}{lipsum[1-1]}
  374. tred{4}{lipsum[1-1]}
  375. mbllue{lipsum[1-1]}
  376. bbllack{lipsum[1-1]}
  377. bllack{6}{lipsum[1-1]}
  378. %
  379. tbllue{7}{lipsum[1-1]}
  380. mbllack{lipsum[1-1]}
  381. bred{lipsum[1-1]}
  382. red{{8}}{lipsum[1-1]}
  383. %
  384. %newpage
  385. %section{Title}
  386. bllue{3}{lipsum[1-1]}
  387. tred{4}{lipsum[1-1]}
  388. mbllue{lipsum[1-1]}
  389. bbllack{lipsum[1-1]}
  390. bllack{6}{lipsum[1-1]}
  391. %
  392. tbllue{7}{lipsum[1-1]}
  393. mbllack{lipsum[1-1]}
  394. bred{lipsum[1-2]}
  395. red{{8}}{lipsum[1-1]}
  396.  
  397. end{document}
Add Comment
Please, Sign In to add comment