I want to add remarks at different places in a document, using tcolorbox (which I found a very nice package) and at the end of the document to get a compilation of all the remarks added along the document.
Here is my MWE :
\documentclass[french]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{amsmath,amssymb,amsbsy,thmtools} % thmtools pour list of theorem
\usepackage[a4paper,
vmargin=2cm,
hmargin=2.5cm]{geometry}
\usepackage{xcolor}
\usepackage[many]{tcolorbox}
\usepackage{lipsum}
\usepackage{babel}
\renewcommand\familydefault{\sfdefault}
\newtcbtheorem[]{rema}{Remarque}%
{colback=white,colframe=gray!50,fonttitle=\bfseries,
enhanced,
coltitle=gray!75!black,
attach boxed title to top left={xshift=2ex,yshift=-2mm,yshifttext=-1mm},
boxed title style={colframe=red!50,colback=gray!25},
code=\bfseries
}{th}
\title{Comment faire une liste de remarques}
\author{}
\date{}
\begin{document}
\maketitle
\vspace{-1cm}
\noindent
\section*{Bla}
\lipsum[1]
\begin{rema}{}{foo}
\lipsum[2]
\end{rema}
\section*{Bli}
\lipsum[3]
\begin{rema}{}{bar}
\lipsum[4]
\end{rema}
\section*{Liste des remarques}
%\listofremarks% to be defined
%\setcounter{\therema}{0} % not working
\begin{rema}{}{foo}
\lipsum[2]
\end{rema}
\begin{rema}{}{bar}
\lipsum[4]
\end{rema}
\end{document}
What I would like to get is :
1) preferably some kind of command like `\listofremarks' which could list at the very end of the document all the remarks introduced previously, if this is possible.
2) if not possible, I could eventually add the remarks manually at the end of the document, but I would need to reset the remark counter to 0 and I did not found how to do this (I did not found the name of the counter involved).
I browsed through section 15.Theorem of the tcolorbox manual but did not found a satisfying solution.
EDIT: What I want is not exactly a list, it is a rather an extensive compilation of all the remarks of the document
EDIT2: Title changed (boxes, not list of boxes) and also the question slightly edited for a better explanation of the goal
saveboxis probably a good starting point, I will try to use it. However, since I got more than oneboxto restate, I still need to know the name of the counter involved. I'll have to dig intotcolorboxcode unless somebody already had to use this name. – DRi Aug 24 '18 at 06:38How to create a list of tcbtheorems, it is in fact not a list , but rather a compilation of the theorem, box, etc... Moreover, using @Troy suggestion, I came up to an answer which I would like to share. Thanks – DRi Aug 24 '18 at 10:21