1

I have a problem as shown in the attached picture. I guest that it comes from colorbox inside minipage. My document is a thesis of more than 150 pages. When I test this piece of latex code individually, it works properly. But I add it into the large file (i.e. my thesis), the bug is happened like in the figure.
Have you ever seen this bug before?

Below is my MWE:


\documentclass[a4paper,10pt]{report}
\usepackage[utf8]{inputenc}
\usepackage{xcolor}
\usepackage{color}
\usepackage{eqparbox}

\begin{document}
\subsection{Determining MCSs}
The MCS algorithm devised by Klamt and Gilles relies on the 
fact that:
\begin{itemize}
 \item any feasible steady state flux distribution in a given network, 
expressed by a vector of the net reaction rates, $r$, can be represented by a 
non-negative linear combination of EFMs as illustrated in 
\Cref{eq:steady-state2} (reused from Klamt2006):
\begin{equation}\label{eq:steady-state2}
 r = \sum_{i=1}^{N}\alpha_{i}E_{i}, (\alpha_{i} \geq 0)
\end{equation}
 \item where $N$ is the number of EFMs.
 \item the removal of reactions from the network results in a new set of EFMs 
constituted by those EFMs that do not involve the deleted reactions.
\end{itemize}
\paragraph{}Before MCSs are computed, the set of $EFMs$ is split into 
two disjoint sets:
\begin{itemize}
 \item the set of target modes ($EFM^t$), i.e., all EFMs ($e^{t,j}$) involving 
the objective reactions $t$.
 \item the set of non-target modes ($EFM^{nt}$), i.e., EFMs not involving the 
objective reaction $nt$.
\end{itemize}
\paragraph{}
\paragraph{}This MCS algorithm can be divided into two phases as follows:
\paragraph{}

\noindent\colorbox{TeaGreen}{%
\begin{minipage}{\dimexpr\textwidth-1\fboxsep}
\paragraph{Preparatory phase}
\small{
\begin{enumerate}[(1)]
 \item Calculate the EFMs in the given networks.
 \item Define the objective reaction \texttt{obR}.
 \item Choose all EFMs where the reaction \texttt{obR} is non-zero and store it 
in the binary array \texttt{efms\_obR}.
 \item Initialise the arrays \texttt{mcss} and \texttt{precutsets} as follows:\;
Append $\{j\}$ to \texttt{mcss} if the reaction $j$ is essential, otherwise to 
\texttt{precutsets}.
\end{enumerate}
}
\paragraph{Main phase}
\small{
\begin{enumerate}[(5)]
 \item FOR i = 2 TO MAX\_CUTSETSIZE
  \begin{enumerate}[(5.1)]
   \item $new\_precutsets = \varnothing $;
   \item FOR j = 1 TO q
    \begin{enumerate}[(5.2.1)]
     \item Remove all sets from \texttt{precutsets} where the reaction
$j$ participates;
     \item Find all sets of reactions in \texttt{precutsets} that do not
cover any EFM in \texttt{efms\_obR} where reaction $j$ participates. Combine 
each
of these sets with reaction $j$ and store the new preliminary cut sets in
\texttt{temp\_precutsets};
     \item Drop all \texttt{temp\_precutsets} which are a superset of any of
the already determined minimal cut sets stored in \texttt{mcss};
     \item Find all retained \texttt{temp\_precutsets} which do now cover all
EFMs and append them to \texttt{mcss}. Append all others to
\texttt{new\_precutsets};
    \end{enumerate}
   \item IF \texttt{isEmpty(new\_precutsets)} BREAK; ELSE \texttt{precutsets} = 
\texttt{new\_precutsets};
  \end{enumerate}
 \begin{enumerate}[(6)]
  \item return \texttt{mcss};
 \end{enumerate}
\end{enumerate}
}
\end{minipage}
}
\end{document}

P/S: My purpose is to fill in color the box. I want to create several filled color boxes in the document.

Tung
  • 291
  • 1
    The content of the colorbox can't break over pages. Use tcolorbox with it's breakable feature, for instance. Please provide a MWE to get some more specific help –  Dec 26 '14 at 17:26
  • For the definition of a MWE see (http://meta.tex.stackexchange.com/q/228) please –  Dec 26 '14 at 17:31
  • Your example does not compile at all –  Dec 26 '14 at 17:38

1 Answers1

2

The 'MWE' has several issues (missing packages,commands, unknown color definitions, a missing algorithm environment)

This uses the breakable feature of the tcolorbox package.

\documentclass[a4paper,10pt]{report}
\usepackage{enumerate}
\usepackage[utf8]{inputenc}
\usepackage[dvipsnames]{xcolor}
\usepackage{eqparbox}

\usepackage[breakable]{tcolorbox}

\usepackage{cleveref}

\usepackage{blindtext}
\tcbuselibrary{skins,breakable}

\begin{document}

\chapter{First}
\section{First}

\subsection{Determining MCSs}
The MCS algorithm devised by Klamt and Gilles relies on the 
fact that:
\begin{itemize}
 \item any feasible steady state flux distribution in a given network, 
expressed by a vector of the net reaction rates, $r$, can be represented by a 
non-negative linear combination of EFMs as illustrated in 
\Cref{eq:steady-state2} (reused from Klamt2006):
\begin{equation}\label{eq:steady-state2}
 r = \sum_{i=1}^{N}\alpha_{i}E_{i}, (\alpha_{i} \geq 0)
\end{equation}
 \item where $N$ is the number of EFMs.
 \item the removal of reactions from the network results in a new set of EFMs 
constituted by those EFMs that do not involve the deleted reactions.
\end{itemize}
\paragraph{}Before MCSs are computed, the set of $EFMs$ is split into 
two disjoint sets:
\begin{itemize}
 \item the set of target modes ($EFM^t$), i.e., all EFMs ($e^{t,j}$) involving 
the objective reactions $t$.
 \item the set of non-target modes ($EFM^{nt}$), i.e., EFMs not involving the 
objective reaction $nt$.
\end{itemize}
\paragraph{}
\paragraph{}This MCS algorithm can be divided into two phases as follows:
\paragraph{}


\begin{tcolorbox}[breakable,colback=LimeGreen,width=\textwidth-1\fboxsep,arc=0mm,auto outer arc]
\paragraph{Preparatory phase}
\small{
\begin{enumerate}[(1)]
 \item Calculate the EFMs in the given networks.
 \item Define the objective reaction \texttt{obR}.
 \item Choose all EFMs where the reaction \texttt{obR} is non-zero and store it 
   in the binary array \texttt{efms\_obR}.
 \item Initialise the arrays \texttt{mcss} and \texttt{precutsets} as follows: 
   Append $\{j\}$ to \texttt{mcss} if the reaction $j$ is essential, otherwise to 
   \texttt{precutsets}.
 \end{enumerate}
}
\paragraph{Main phase}
\small{%
\begin{enumerate}[(5)]
 \item FOR i = 2 TO MAX\_CUTSETSIZE
  \begin{enumerate}[(5.1)]
%  \item $new\_ precutsets = \varnothing $;
   \item FOR j = 1 TO q
    \begin{enumerate}[(5.2.1)]
     \item Remove all sets from \texttt{precutsets} where the reaction
$j$ participates;
     \item Find all sets of reactions in \texttt{precutsets} that do not
cover any EFM in \texttt{efms\_obR} where reaction $j$ participates. Combine 
each
of these sets with reaction $j$ and store the new preliminary cut sets in
\texttt{temp\_precutsets};
     \item Drop all \texttt{temp\_precutsets} which are a superset of any of
the already determined minimal cut sets stored in \texttt{mcss};
     \item Find all retained \texttt{temp\_precutsets} which do now cover all
EFMs and append them to \texttt{mcss}. Append all others to
\texttt{new\_precutsets};
    \end{enumerate}
   \item IF \texttt{isEmpty(new\_precutsets)} BREAK; ELSE \texttt{precutsets} = %
\texttt{new\_precutsets};
  \end{enumerate}
 \begin{enumerate}[(6)]
  \item return \texttt{mcss};
 \end{enumerate}
\end{enumerate}
}%
\end{tcolorbox}

\blindtext

\end{document}

enter image description here

  • I am trying to modify the MWE but it has not compiled yet. In the thesis, I do not include the package enumerate but the compiling can do well. Do you know why there is an error if we add [dvipsnames] inside the loading package \usepackage[dvipsnames]{xcolor}? – Tung Dec 26 '14 at 17:51
  • @Tung: Then drop the enumerate package –  Dec 26 '14 at 17:53
  • Try the enumitem package instead of enumerate if you need to customise the itemisation environments. It is superior in nearly every aspect. – MaxNoe Dec 26 '14 at 18:24
  • @ChristianHupfer: Your solution runs properly if it is compiled separately. In the case of combination with my thesis, I does not work because the error
    
    [109] (./thesis.lot)
    ! No room for a new \write .
    \alloc@ ...else \errmessage {No room for a new #2}
                                                      \fi \fi 
    l.161 \listoftables
    
    – Tung Dec 26 '14 at 18:49
  • @Tung: Your thesis and my trial solution differ in a lot of aspects, as your version contains code I have no access to. –  Dec 26 '14 at 19:12