Advertisement
Guest User

Untitled

a guest
Jun 20th, 2019
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.33 KB | None | 0 0
  1. [![documentclass[a4paper,symmetric,twoside,justified]{tufte-book}
  2. usepackage{lipsum}
  3. usepackage{graphicx}
  4. usepackage{wrapfig}
  5. usepackage{mdframed}
  6. usepackage[many]{tcolorbox}
  7. usepackage{xcolor}
  8. definecolor{mycolor}{RGB}{0,125,98}
  9. usetikzlibrary{calc}
  10.  
  11. tcbset{mystyle/.style={
  12. breakable,
  13. enhanced,
  14. outer arc=0pt,
  15. arc=0pt,
  16. colframe=mycolor,
  17. colback=mycolor!20,
  18. attach boxed title to top left,
  19. boxed title style={
  20. colback=blue,
  21. outer arc=0pt,
  22. arc=0pt,
  23. top=3pt,
  24. bottom=3pt,
  25. },
  26. fonttitle=sffamily
  27. }
  28. }
  29.  
  30. newtcolorbox[auto counter,number within=section]{example}[1][]{
  31. mystyle,
  32. title=Example~thetcbcounter,
  33. overlay unbroken and first={
  34. path
  35. let
  36. p1=(title.north east),
  37. p2=(frame.north east)
  38. in
  39. node[anchor=west,font=sffamily,color=mycolor,text width=x2-x1]
  40. at (title.east) {#1};
  41. }
  42. }
  43.  
  44. begin{document}
  45. mainmatter
  46. chapter{First chapter}
  47.  
  48. section{A section}
  49.  
  50. % example env
  51. begin{example}[Example environment]
  52.  
  53. begin{wrapfigure}{r}{0.5textwidth}
  54. rule{4cm}{2cm}
  55. end{wrapfigure}
  56.  
  57. lipsum[1]
  58. end{example}
  59.  
  60. % example using tufte's fullwidth
  61. begin{fullwidth}
  62. begin{example}[Example environment inside tufte's fullwidth]
  63.  
  64. begin{wrapfigure}{r}{0.5textwidth}
  65. rule{4cm}{2cm}
  66. end{wrapfigure}
  67.  
  68. lipsum[1-6]
  69. end{example}
  70. end{fullwidth}
  71.  
  72. end{document}][1]][1]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement