Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- \documentclass[11pt,parskip=half,numbers=noenddot,bibliography=totoc,index=totoc,
- listof=leveldown
- ]{scrbook}
- \addtotoclist{loe}
- \newcounter{example}[chapter]
- \renewcommand{\theexample}{\thechapter.\arabic{example}}
- \newcommand{\listofloename}{List of Examples}
- \newcommand\listofexamples{\listoftoc{loe}}
- \setuptoc{loe}{chapteratlist,leveldown}
- \makeatletter
- \newcommand\l@example{\l@figure}
- \makeatother
- \usepackage{tcolorbox}
- \newenvironment{example}[1]{%
- \setlength\parfillskip{0pt plus 1fil}%
- \begin{tcolorbox}[
- before title={%
- \refstepcounter{example}%
- \addxcontentsline{loe}{section}[\theexample]{\ignorespaces #1}},
- title=Example\ \theexample:\ \ignorespaces #1]%
- }{\end{tcolorbox}}
- \begin{document}
- \chapter{First}
- \begin{example}{First example.}
- \end{example}
- \begin{table}
- \caption{First graph.}
- \end{table}
- \chapter{Second}
- \begin{example}{Second example.}
- Very nice!
- \end{example}
- \begin{table}
- \caption{Second graph.}
- \end{table}
- \begin{example}{Third example.}
- \end{example}
- \begin{table}
- \caption{Third graph.}
- \end{table}
- \chapter{Lists}
- \listoftables
- \listofexamples
- \end{document}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement