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}
- \newcommand{\example}[2] {
- \setlength\parfillskip{0pt plus 1fil}%
- \refstepcounter{example}%
- \addxcontentsline{loe}{section}[\theexample]{\ignorespaces #1}
- \theexample:\ \ignorespaces #1 #2}
- \begin{document}
- \chapter{First}
- \chapter{Second}
- \example{Second example.}{Very nice!}
- \example{Third example.}{Very nice too!}
- \chapter{Lists}
- \listofexamples
- \end{document}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement