2

I just wondered if anyone could help me with an issue that I am having?

I am trying to use the tcolorbox environment and also use the table of contents features for the headings of the tcolorboxes.

Code below: Thank you in advance!!!!

\documentclass{book}
\usepackage[dvipsnames]{xcolor}
\usepackage{tcolorbox}
\usepackage{graphicx}
\usepackage[utf8]{inputenc}

\usepackage{graphicx}
\usepackage{url}
\usepackage{background}
\usepackage{lastpage}



\backgroundsetup{
  scale=1,
  color=black,
  opacity=1,
  angle=0,
  position=current page.south,
  vshift=60pt,
  contents={%
  \small\sffamily%
  \begin{minipage}{.8\textwidth}
  \parbox[b]{.6\textwidth}{%
    Page \thepage\ of   \pageref{LastPage}}\hfill
  \parbox[b]{.4\textwidth}{%
    \raggedleft xxxxxxx, My street 1 \\ 1234 city, Country}\      \textcolor{SkyBlue}{\rule{\textwidth}{1.5pt}}\      \url{www.xxxx.com}
  \end{minipage}\hspace{.02\textwidth}%
  \begin{minipage}{.18\textwidth}
  \includegraphics[width=\linewidth,height=70pt,keepaspectratio]{foot}
  \end{minipage}%
  }
}

\pagestyle{empty}

\begin{document}


\begin{tcolorbox}[width=\textwidth,colback={white},title={\textbf{The Mission}},colbacktitle=SkyBlue,coltitle=black,colupper=black]   
The mission statement for this plan is \textbf{to inspire ambition and purpose through cricket by}:
\begin{itemize}
\item Promoting cricket for a younger target audience
\item Producing successful, competitive and entertaining cricket
\end{itemize}

The objectives for the update of the english T20 system in this plan are:
\begin{enumerate}
    \item To compete with the other growing T20 leagues across the world
    \begin{itemize}
        \item Increase  television coverage across the world through the appeal of the tournament to a wider audience
    \end{itemize}
    \item Improve fan attendance and engagement
    \begin{itemize}
        \item Continue to increase the number of spectators at each T20 Blast match
        \item Change the schedule of the T20 season to coincide with the school summer holidays
        \item Attract more 'International Stars' to the english game
    \end{itemize}
    \item Support the counties to become more financially independent
    \begin{itemize}
        \item Generate larger incomes for the county clubs
        \begin{itemize}
            \item Membership system
            \item Fan attendance
            \item Television revenues
        \end{itemize}
        \item Reduce the high cost to income ratio of costs associated with the large number of matches 
    \end{itemize}
\end{enumerate}
\end{tcolorbox}    
\newpage

\begin{tcolorbox}[width=\textwidth,colback={white},title={\textbf{Executive Summary}},colbacktitle=SkyBlue,coltitle=black,colupper=black]   
\end{tcolorbox}  

\newpage
\tableofcontents

\newpage
\listoffigures

\listoftables



\newpage

\begin{tcolorbox}[width=\textwidth,colback={white},title={\textbf{Executive Summary}},colbacktitle=SkyBlue,coltitle=black,colupper=black]   
\end{tcolorbox}  

\begin{tcolorbox}[width=\textwidth,colback={white},title={\textbf{Introduction}},colbacktitle=SkyBlue,coltitle=black,colupper=black]   
\end{tcolorbox}  

\begin{tcolorbox}[width=\textwidth,colback={white},title={\textbf{Strategic Audit}},colbacktitle=SkyBlue,coltitle=black,colupper=black]   
\end{tcolorbox}  

\begin{tcolorbox}[width=\textwidth,colback={white},title={\textbf{Generating Strategic Options}},colbacktitle=SkyBlue,coltitle=black,colupper=black]   
\end{tcolorbox}  

\begin{tcolorbox}[width=\textwidth,colback={white},title={\textbf{Conclusions}},colbacktitle=SkyBlue,coltitle=black,colupper=black]  
\end{tcolorbox}  

\begin{tcolorbox}[width=\textwidth,colback={white},title={\textbf{Recommendations}},colbacktitle=SkyBlue,coltitle=black,colupper=black]   
\end{tcolorbox}  

\begin{thebibliography}{}
\end{thebibliography}


\end{document}
4
  • Your document is not compilable ... and what is your issue?
    – user31729
    Apr 2 '17 at 14:50
  • Why don't you define a "newtcolorbox"? Just type in: [code]\newtcolorbox{mybox}[1]{width=\textwidth,colback={white},colbacktitle=SkyBlue,coltitle=black,colupper=black} and \newcommand{\mysection}[2]{ \begin{headerbox}{#1} #2 \end{headerbox} }[/code] But I don't know what u mean by "use the tcolorbox environment and also use the table of contents features for the headings of the tcolorboxes" could you explain this a bit more?
    – Shalec
    Apr 2 '17 at 15:01
  • Hi, edited code to be compilable, and my table of contents is not pulling the headings of the tcolorbox through. Apr 2 '17 at 15:01
  • @shalec: It's much easier ;-)
    – user31729
    Apr 2 '17 at 15:03
4

First of all: Use a specialized \newtcolorbox for this, which has some individual style.

Use the auto counter and list inside options to generate a separate ToC like file.

If list inside=rawlings is used, \tcblistof{rawlings}{List of Rawlings Boxes} is possible afterwards, if needed.

Otherwise say list inside=toc to enter the boxes in the usual ToC.

\documentclass{book}
\usepackage[dvipsnames]{xcolor}
\usepackage{graphicx}
\usepackage[utf8]{inputenc}

\usepackage[most]{tcolorbox}

\usepackage{url}
\usepackage{background}
\usepackage{lastpage}

\usepackage{glossaries}

\makenoidxglossaries %glossaries

\backgroundsetup{
  scale=1,
  color=black,
  opacity=1,
  angle=0,
  position=current page.south,
  vshift=60pt,
  contents={%
  \small\sffamily%
  \begin{minipage}{.8\textwidth}
  \parbox[b]{.6\textwidth}{%
    Page \thepage\ of   \pageref{LastPage}}\hfill
  \parbox[b]{.4\textwidth}{%
    \raggedleft xxxxxxx, My street 1 \\ 1234 city, Country}\      \textcolor{SkyBlue}{\rule{\textwidth}{1.5pt}}\      \url{www.xxxx.com}
  \end{minipage}\hspace{.02\textwidth}%
  \begin{minipage}{.18\textwidth}
  \includegraphics[width=\linewidth,height=70pt,keepaspectratio]{ente}
  \end{minipage}%
  }
}

\tcbset{rawlings/.style={width=\textwidth,colback={white},colbacktitle=SkyBlue,coltitle=black,colupper=black}}

% A separate box with a separate list type named rawlings
\newtcolorbox[auto counter,list inside=rawlings]{rawlingsbox}[1][]{rawlings,#1}%

\newcommand{\listofrawlings}{%
  \tcblistof[\chapter*]{rawlings}{List of Rawlings Boxes}
}



\pagestyle{empty}

\begin{document}


\begin{rawlingsbox}[width=\textwidth,colback={white},title={\textbf{The Mission}},colbacktitle=SkyBlue,coltitle=black,colupper=black]   
The mission statement for this plan is \textbf{to inspire ambition and purpose through cricket by}:
\begin{itemize}
\item Promoting cricket for a younger target audience
\item Producing successful, competitive and entertaining cricket
\end{itemize}

The objectives for the update of the english T20 system in this plan are:
\begin{enumerate}
    \item To compete with the other growing T20 leagues across the world
    \begin{itemize}
        \item Increase  television coverage across the world through the appeal of the tournament to a wider audience
    \end{itemize}
    \item Improve fan attendance and engagement
    \begin{itemize}
        \item Continue to increase the number of spectators at each T20 Blast match
        \item Change the schedule of the T20 season to coincide with the school summer holidays
        \item Attract more 'International Stars' to the english game
    \end{itemize}
    \item Support the counties to become more financially independent
    \begin{itemize}
        \item Generate larger incomes for the county clubs
        \begin{itemize}
            \item Membership system
            \item Fan attendance
            \item Television revenues
        \end{itemize}
        \item Reduce the high cost to income ratio of costs associated with the large number of matches 
    \end{itemize}
\end{enumerate}
\end{rawlingsbox}    
\clearpage

\begin{rawlingsbox}[title={\textbf{Executive Summary}}]   
\end{rawlingsbox}  

\clearpage
\tableofcontents

\clearpage
\listoffigures

\listoftables

\clearpage
\listofrawlings


\printnoidxglossaries

\clearpage

\begin{rawlingsbox}[title={\textbf{Executive Summary}}]   
\end{rawlingsbox}  

\begin{rawlingsbox}[title={\textbf{Introduction}}]   
\end{rawlingsbox}  

\begin{rawlingsbox}[title={\textbf{Strategic Audit}}]   
\end{rawlingsbox}  

\begin{rawlingsbox}[title={\textbf{Generating Strategic Options}}]   
\end{rawlingsbox}  

\begin{rawlingsbox}[title={\textbf{Conclusions}}]  
\end{rawlingsbox}  

\begin{rawlingsbox}[title={\textbf{Recommendations}}]   
\end{rawlingsbox}  

\begin{thebibliography}{}
\end{thebibliography}


\end{document}

enter image description here

9
  • Hi thank you very much for that. That is exactly, what I am after, I just have a few errors that are popping up, which are meaning compiling is unavailable. These errors are over these lines: \clearpage \tableofcontents \clearpage \listoffigures \listoftables \clearpage \listofrawlings Thank you in advance Apr 2 '17 at 15:50
  • @DanielRawlings: Actually the code should run of the box. I've added another version with some typos corrected (that weren't syntactical errors, however)
    – user31729
    Apr 2 '17 at 15:55
  • Have you added this to your original? Apr 2 '17 at 16:05
  • @DanielRawlings: I updated the answer 10 minutes ago.
    – user31729
    Apr 2 '17 at 16:06
  • This wont compile for me either unfortunately :) Apr 2 '17 at 16:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.