Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [![documentclass[a4paper,symmetric,twoside,justified]{tufte-book}
- usepackage{lipsum}
- usepackage{graphicx}
- usepackage{wrapfig}
- usepackage{mdframed}
- usepackage[many]{tcolorbox}
- usepackage{xcolor}
- definecolor{mycolor}{RGB}{0,125,98}
- usetikzlibrary{calc}
- tcbset{mystyle/.style={
- breakable,
- enhanced,
- outer arc=0pt,
- arc=0pt,
- colframe=mycolor,
- colback=mycolor!20,
- attach boxed title to top left,
- boxed title style={
- colback=blue,
- outer arc=0pt,
- arc=0pt,
- top=3pt,
- bottom=3pt,
- },
- fonttitle=sffamily
- }
- }
- newtcolorbox[auto counter,number within=section]{example}[1][]{
- mystyle,
- title=Example~thetcbcounter,
- overlay unbroken and first={
- path
- let
- p1=(title.north east),
- p2=(frame.north east)
- in
- node[anchor=west,font=sffamily,color=mycolor,text width=x2-x1]
- at (title.east) {#1};
- }
- }
- begin{document}
- mainmatter
- chapter{First chapter}
- section{A section}
- % example env
- begin{example}[Example environment]
- begin{wrapfigure}{r}{0.5textwidth}
- rule{4cm}{2cm}
- end{wrapfigure}
- lipsum[1]
- end{example}
- % example using tufte's fullwidth
- begin{fullwidth}
- begin{example}[Example environment inside tufte's fullwidth]
- begin{wrapfigure}{r}{0.5textwidth}
- rule{4cm}{2cm}
- end{wrapfigure}
- lipsum[1-6]
- end{example}
- end{fullwidth}
- end{document}][1]][1]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement