3

I produce a document using the xeboiboites package, but I don´t know how to make a list of theorems because the theorems are boxed. In the theorem list the page number should be included.

Here is a MWE:

\documentclass{book}
\usepackage{amsthm}
\usepackage[dvipsnames]{color}
\usepackage[x11names]{xcolor}
\usepackage{xeboiboites}

\newbreakabletheorem[small box style={draw=RoyalBlue3,fill=RoyalBlue3, line width=0.02cm, rounded corners},
big box style={fill=white,draw=RoyalBlue3,rounded corners,line width=0.02cm}, size=1\textwidth, headfont=\bfseries\large\color{white}]
{CajaSolucion}{Problema}{section}

\begin{document}
\chapter{Resolucion de ejercicios I}

\begin{CajaSolucion}
EL presente ejercicios consta dela fuerzass..............
\end{CajaSolucion}

\chapter{Reslocion de ejercicios del CAp II}

\begin{CajaSolucion}
EL presente ejercicios consta dela fuerzas bbbbs..............
\end{CajaSolucion}

\begin{CajaSolucion}
EL presente ejercicios consta dela fuerzass....bbbb..........
\end{CajaSolucion}

\end{document}
Ruben
  • 13,448
  • The package you are referring to (xeboiboites) seems to be something unofficial. However, it's not listed on CTAN. – Ruben Dec 26 '16 at 02:47
  • @Ruben: http://alexisfles.ch/en/latex/boites2.html –  Dec 26 '16 at 09:31
  • 2
    @ChristianHupfer - Welcome back (I hope)! – Mico Dec 26 '16 at 21:16
  • 2
    @Mico: Someone asked me to look after some post, but I am not sure it was a good idea (but thanks!)... Consider me being more like a ghost ;-) –  Dec 26 '16 at 21:40
  • 1
    Don't load both the color and the xcolor packages. I suggest you use \usepackage[dvipsnames,x11names]{xcolor} to load xcolor with both sets of predefined color names. – Mico Dec 28 '16 at 18:03

1 Answers1

5

Basically you need to make use of the \@starttoc mechanism. Luckily, the tocloft package provides an interface for this, i.e. \newlistof. In this case you need to watch out for the counter names as you alredy have a counter for the theorem. (In the course of this I changed the counter name of your theorem. In your example it was misleading anyways.)

\documentclass{book}
\usepackage{amsthm}
\usepackage[dvipsnames]{color}
\usepackage[x11names]{xcolor}
\usepackage{xeboiboites}
  \newbreakabletheorem[
    small box style={draw=RoyalBlue3,fill=RoyalBlue3,line width=0.02cm, rounded corners},   
    big box style={fill=white,draw=RoyalBlue3,rounded corners,line width=0.02cm},
    size=1\textwidth, 
    headfont=\bfseries\large\color{white}
  ]{problema}{Problema}{problem}
\usepackage{tocloft}

\makeatletter
\renewcommand*\theproblem{\thechapter.\@arabic\c@problem}
\@addtoreset{problem}{chapter}
\newcommand*\problemsname{List of problems}
\newlistof{problems}{prb}{\problemsname}
\newenvironment{CajaSolucion}{%
  \problema
  \addcontentsline{prb}{problems}{\protect\numberline{Problem \theproblem}}
}{%
  \endproblema
}
\makeatother

\begin{document}
\listofproblems

\chapter{Resolucion de ejercicios I}

\begin{CajaSolucion}
EL presente ejercicios consta dela fuerzass..............
\end{CajaSolucion}

\chapter{Reslocion de ejercicios del CAp II}

\begin{CajaSolucion}
EL presente ejercicios consta dela fuerzas bbbbs..............
\end{CajaSolucion}

\begin{CajaSolucion}
EL presente ejercicios consta dela fuerzass....bbbb..........
\end{CajaSolucion}

\end{document}

output

Ruben
  • 13,448
  • How do I do if I have 2 different designs? – Dennis Miranda Dec 27 '16 at 22:03
  • 1
    @DennisMiranda two different designs of what? And "how do I do" ... what? – Ruben Dec 27 '16 at 22:57
  • Sorry, I don´t speak english..so I used google translate...but In this document there are two different boxed...one for "Problemas" and the other for "Definitions"... How to create a list?.. Help me please you are an hero XD – Dennis Miranda Dec 28 '16 at 17:53
  • @DennisMiranda, dont worry because of the English :) I Just need to know rather exactly what you mean in order to help you properly. As long as we manage to figure this out its all good. Regarding your query: As I understand you need another "List of ..." for your definitions. You can simply apply the same code twice, i.e. everything in between \makeatletter and \makeatother -- and of course taking into account how your "definitions" environment is named. – Ruben Dec 28 '16 at 23:42
  • @DennisMiranda, glad to hear! If the solution was helpful you might consider to upvote and accept it. – Ruben Dec 29 '16 at 10:50