Advertisement
Guest User

Untitled

a guest
Sep 2nd, 2014
200
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.07 KB | None | 0 0
  1. usepackage{xcolor}
  2. usepackage[framemethod=tikz]{mdframed}
  3. usetikzlibrary{shadows,shadings}
  4. usepackage{calc}
  5. usepackage{tikz}
  6. usetikzlibrary{shapes,snakes}
  7.  
  8. newcounter{demo_counter}
  9.  
  10. renewcommandthetheorem{Demonstration ~arabic{demo_counter}}
  11.  
  12.  
  13. makeatletter
  14. mdf@dolist{mdf@do@stringoption}{%
  15. {theoremtitle=={}}%
  16. }
  17. renewrobustcmdmdfcreateextratikz{%
  18. node[anchor=west,rounded corners,draw=orange,thick,fill=blue!20,xshift=2cm,minimum height=.7cm,minimum width=2cm] at (P-|O)
  19. {~mdf@frametitlefont{thetheorem}%
  20. ifdefempty{mdf@theoremtitle}%
  21. {~}%
  22. {:~mdf@theoremtitle~}%
  23. };
  24. }
  25. makeatother
  26.  
  27. mdfdefinestyle{theoremstyle}{%
  28. outerlinewidth=1pt,
  29. innerlinewidth=3pt,
  30. roundcorner=5pt,
  31. linecolor=orange,
  32. splittopskip=1cm, % THIS IS THE REQUIRED OPTION FOR SPACE ABOVE THE SPLIT ON THE SECOND PAGE
  33. splitbottomskip=1cm, % THIS IS THE REQUIRED OPTION FOR SPACE BELOW THE SPLIT ON THE FIRST PAGE
  34. tikzsetting={fill=blue!5},
  35. innertopmargin=1.2baselineskip,
  36. skipabove={dimexpr0.5baselineskip+topskiprelax},
  37. needspace=3baselineskip,
  38. frametitlefont=sffamilybfseries,
  39. settings={globalstepcounter{demo_counter}},
  40. }
  41.  
  42. newenvironment{demo}[1][]
  43. {begin{mdframed}[style=theoremstyle,theoremtitle={#1}]
  44. relax}{
  45. end{mdframed}
  46. }
  47.  
  48. newcounter{remark_counter}
  49. renewcommandtheremark{Remark ~arabic{remark_counter}}
  50. renewrobustcmdmdfcreateextratikz{%
  51. node[anchor=west,rounded corners,draw=green,thick,fill=blue!20,xshift=2cm,minimum height=.7cm,minimum width=2cm] at (P-|O)
  52. {~mdf@frametitlefont{theremark}%
  53. ifdefempty{mdf@remarktitle}%
  54. {~}%
  55. {:~mdf@remarktitle~}%
  56. };
  57. }
  58.  
  59.  
  60. mdfdefinestyle{remarkstyle}{%
  61. outerlinewidth=1pt,
  62. innerlinewidth=3pt,
  63. roundcorner=5pt,
  64. linecolor=green,
  65. splittopskip=1cm,
  66. splitbottomskip=1cm,
  67. tikzsetting={fill=blue!5},
  68. innertopmargin=1.2baselineskip,
  69. skipabove={dimexpr0.5baselineskip+topskiprelax},
  70. needspace=3baselineskip,
  71. frametitlefont=sffamilybfseries,
  72. settings={globalstepcounter{remark_counter}},
  73. }
  74.  
  75. newenvironment{remark}[1][]
  76. {begin{mdframed}[style=remarkstyle,remarktitle={#1}]
  77. relax}{
  78. end{mdframed}
  79. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement