brentthorne | 507f273 | 2019-01-15 22:17:15 -0500 | [diff] [blame^] | 1 | \documentclass{report} |
| 2 | \usepackage[most]{tcolorbox} |
| 3 | \usepackage{lmodern} |
| 4 | \usepackage{lipsum} |
| 5 | \usepackage[explicit]{titlesec} |
| 6 | \usepackage{varwidth} |
| 7 | |
| 8 | \tcbset{ |
| 9 | orange/.style={ |
| 10 | enhanced, |
| 11 | colback=orange!10, |
| 12 | colframe=orange, |
| 13 | fonttitle=\bfseries, |
| 14 | colbacktitle=orange!40, |
| 15 | coltitle=black, |
| 16 | attach boxed title to top left={% |
| 17 | yshift*=-\tcboxedtitleheight/2, |
| 18 | xshift=5mm}, |
| 19 | boxed title style={colframe=gray} |
| 20 | } |
| 21 | } |
| 22 | |
| 23 | \newtcbtheorem[auto counter]{mylemma}{Lemma}{% |
| 24 | orange |
| 25 | }{lm} |
| 26 | |
| 27 | \titleformat{\chapter}[display] |
| 28 | {\normalfont\Large\bfseries} |
| 29 | {} |
| 30 | {} |
| 31 | {% |
| 32 | \begin{tcolorbox}[orange, halign=center, valign=center, title=test, overlay={\node[draw=gray, fill=orange!40, rounded corners, anchor=east, font=\small\bfseries] at ([xshift=-5mm]frame.south east){2016-2017};}]%, title=Title] |
| 33 | #1 |
| 34 | \end{tcolorbox}% |
| 35 | } |
| 36 | |
| 37 | \titleformat{\section} |
| 38 | {\normalfont\large\bfseries}{}{0em} |
| 39 | {% |
| 40 | \setbox0=\hbox{\large\bfseries\thesection}% |
| 41 | \begin{tikzpicture} |
| 42 | \draw[orange, ultra thick](0,0) -- ++(0:\linewidth); |
| 43 | \node[draw=orange, |
| 44 | rounded corners, |
| 45 | fill=orange!10, |
| 46 | ultra thick, |
| 47 | anchor=west, |
| 48 | outer sep=0pt |
| 49 | ] {\thesection\hspace{.5em}\hangindent\wd0\strut#1\strut}; |
| 50 | \end{tikzpicture}% |
| 51 | } |
| 52 | |
| 53 | \titleformat{name=\section,numberless}[display] |
| 54 | {\normalfont\Large\bfseries}{}{0em} |
| 55 | {% |
| 56 | \begin{tikzpicture} |
| 57 | \draw[orange, line width=1mm](0,0) -- ++(0:\linewidth); |
| 58 | \node[draw=orange, |
| 59 | rounded corners, |
| 60 | fill=orange!10, |
| 61 | line width=1mm, |
| 62 | anchor=west, |
| 63 | outer sep=0pt |
| 64 | ] {\strut#1\strut}; |
| 65 | \end{tikzpicture}% |
| 66 | } |
| 67 | \titlespacing*{\section} |
| 68 | {0pt}{4.5ex plus 1ex minus .2ex}{1ex plus .2ex} |
| 69 | |
| 70 | \begin{document} |
| 71 | |
| 72 | \chapter*{Diagonalizar matrices} |
| 73 | \section{Test numbered section} |
| 74 | \begin{mylemma}{Test}{a} |
| 75 | \lipsum[3] |
| 76 | \end{mylemma} |
| 77 | |
| 78 | \begin{mylemma}{Test}{a} |
| 79 | \lipsum[3] |
| 80 | \end{mylemma} |
| 81 | |
| 82 | \section*{Test unnumbered section} |
| 83 | \lipsum[4] |
| 84 | %\section{Test numbered section with a long title; in fact, it spans two lines} |
| 85 | %\lipsum[4] |
| 86 | |
| 87 | \end{document} |