0

I do have a customized examples environment, now I need a table of content for it, I don't know how is that possible. Here is my environment

\newcounter{example}
\renewcommand{\theexample}{\thesection.\arabic{example}}
\usepackage{multicol}
\mdfdefinestyle{example}{%
         linecolor=black,
         outerlinewidth=1pt,
         bottomline=true,
         leftline=false,rightline=false,
         skipabove=\baselineskip,
         skipbelow=\baselineskip,
         frametitle=\mbox{},
 }
 \newmdenv[%
        style=example,
        settings={\global\refstepcounter{example}},
        frametitlefont={\bfseries Exemple~\theexample\quad},
 ]{example}

thanks.

Hind Dev
  • 641
  • 1
    You're a member of TeX.SE for more than 2 years and have 324 rep and yet again a fragment of code? Your request is very easy with tcolorbox instead of mdframed (which you're using, apparently), however. Perhaps it is possible with the startcode option, i.e. startcode=\addcontentsline{exa}{section}{Title of the box}, but this might get tedious –  Apr 11 '18 at 20:50
  • sorry but I didn't learned yet how to build environments and macros, and the majority of the example environment code, I piked it from here at TEX – Hind Dev Apr 11 '18 at 20:56
  • Well, apart from some users most of us provide compilable documents as answers for good reasons, that anybody can make use of it, not meaning to be disrupted and reposted again –  Apr 11 '18 at 20:57
  • 1
    Here is a answer of mine doing what is requested with tcolorbox: https://tex.stackexchange.com/questions/276345/how-can-i-create-a-custom-directory-like-table-of-contents-e-g-list-of-exampl –  Apr 11 '18 at 21:03
  • Possible dupplicate of https://tex.stackexchange.com/q/276345/120578 (it is not a flag but a question to the OP) – koleygr Apr 11 '18 at 22:42
  • it is not a duplicate post because the environment used in this one is different from the other – Hind Dev Apr 12 '18 at 23:39
  • @HindDev: It is no duplicate because you're using mdframed, but as long as you don't post a compilable document instead of fragments there will be not much help –  Apr 15 '18 at 06:47
  • @Christian Hupfer, ah! I see, it is because I have used your code in the link you gave to me, I found it more butiful – Hind Dev Apr 16 '18 at 17:20

0 Answers0