# bclogo page breaks

I am using the Bclogo package http://www.ctan.org/pkg/bclogo. I have created environments for lemmas and proofs with it. The proof was too big to fit on the bottom of the page, so it just inserted a page break and moved it to the next page (see image below). Is there a way to have it start on the page below the lemma and then continue on the next page rather than moving everything to the next page and leaving a large gap between?

I currently have the following commands set up in a different file and just call them in the document for typing the lemmas and proofs.

\newcounter{LemmaBoxCounter}
\newcommand{\lem}[1]{\begin{bclogo}[logo=\bclampe, noborder=true, couleurBarre=Red, couleurBord=Black, couleur=blue!20, arrondi = 0.2, epBarre=0]{Lemma \arabic{LemmaBoxCounter}}
\raggedright #1
\end{bclogo}}

\newcounter{ProofBoxCounter}
\renewcommand{\proof}[1]{\begin{bclogo}[logo=\bclampe, noborder=true, couleurBarre=Red, couleurBord=Black, couleur=orange!10, arrondi = 0.2, epBarre=3.5]{Proof \arabic{ProofBoxCounter}}
\raggedright #1 \qed
\end{bclogo}}


• If bclogo package does not provide breakable environments, there will be no easy continuation of such an environment. My knowledge of French is very limited, but I'll try to read that documentation. Thanks for making this nice package prominent to me! – user31729 Aug 27 '14 at 22:16
• Thanks, Christian. I do not speak any French so I can't see if there is information in it about page breaks or not. Please let me know if you find out anything. I think it is a really nice package otherwise. – Tyler Clark Aug 27 '14 at 22:23
• I found so far nothing on page breaks etc. Sorry. Page breaking within an environment is quite difficult. Perhaps, it is possible to achieve the same behaviour with the tcolorbox environment and additional decorations. tcolorbox environments are breakable – user31729 Aug 27 '14 at 22:26
• I'm not sure how to add in the little logos that bclogo uses for the tcolorbox. Any suggestions? I created the following command: \newcounter{ExColorBoxCount} \newcommand{\eg}[1]{\begin{tcolorbox}[colback=green!5!white,colframe=green!75!black,title=\textbf{Example \arabic{ExColorBoxCount}}] #1 \addtocounter{ExColorBoxCount}{1} \end{tcolorbox}} – Tyler Clark Aug 27 '14 at 23:19
• I will look tomorrow – user31729 Aug 27 '14 at 23:50

I take over the relay from Christian Hupfer and give a tcolorbox based solution. I tried to mimicry the original macros to get an equivalent appearance. The main difference is that lemma and proof are now breakable boxes. I left out the \qed since I don't know what is used for that one.

The macros take an optional parameter (any tcolorbox option). E.g., use \lem[label=MyLabel]{....} to set a label for reference.

\documentclass[paper=a4,12pt]{scrbook}

\usepackage{etoolbox}%
\usepackage{blindtext}%
\usepackage[tikz]{bclogo}%
\usepackage[skins,breakable,xparse]{tcolorbox}%

\DeclareTotalTColorBox[auto counter]{\lem}{ O{} m }
{ enhanced,breakable,
colframe=blue!20!white,interior hidden,
coltitle=black,fonttitle=\bfseries\large,title={Lemma~\thetcbcounter},
overlay unbroken and first={\node at ([xshift=4mm,yshift=-5mm]frame.north west) {\bclampe};},
#1}
{\raggedright #2}

\DeclareTotalTColorBox[auto counter]{\proof}{ O{} m }
{ enhanced,breakable,
colframe=orange!10!white,interior hidden,
coltitle=black,fonttitle=\bfseries\large,title={Proof~\thetcbcounter},
overlay unbroken and first={\node[inner sep=0pt] (logo) at ([xshift=4mm,yshift=-5mm]frame.north west) {\bclampe};
\draw[red,line width=3.5pt] (logo) -- ([xshift=4mm,yshift=1.5mm]frame.south west);  },
overlay middle and last={\draw[red,line width=3.5pt] ([xshift=4mm,yshift=-1.5mm]frame.north west) -- ([xshift=4mm,yshift=1.5mm]frame.south west); },
#1}
{\raggedright #2%\qed
}

\begin{document}

\chapter{First}

\section{First}

\lem{\blindtext[1]}

\proof{\blindtext[1]}

\lem{\blindtext[2]}

\proof{\blindtext[4]}

\end{document}


UPDATE:

• To number within the chapter, add number within=chapter to the initialization options of the boxes.

• To label an individual box, add label=mylabel to the option list of a lemma or proof.

Here is the code to show the application:

\documentclass[paper=a4,12pt]{scrbook}

\usepackage{etoolbox}%
\usepackage{blindtext}%
\usepackage[tikz]{bclogo}%
\usepackage[skins,breakable,xparse]{tcolorbox}%

\DeclareTotalTColorBox[auto counter,number within=chapter]{\lem}{ O{} m }
{ enhanced,breakable,
colframe=blue!20!white,interior hidden,
coltitle=black,fonttitle=\bfseries\large,title={Lemma~\thetcbcounter},
overlay unbroken and first={\node at ([xshift=4mm,yshift=-5mm]frame.north west) {\bclampe};},
#1}
{\raggedright #2}

\DeclareTotalTColorBox[auto counter,number within=chapter]{\proof}{ O{} m }
{ enhanced,breakable,
colframe=orange!10!white,interior hidden,
coltitle=black,fonttitle=\bfseries\large,title={Proof~\thetcbcounter},
overlay unbroken and first={\node[inner sep=0pt] (logo) at ([xshift=4mm,yshift=-5mm]frame.north west) {\bclampe};
\draw[red,line width=3.5pt] (logo) -- ([xshift=4mm,yshift=1.5mm]frame.south west);  },
overlay middle and last={\draw[red,line width=3.5pt] ([xshift=4mm,yshift=-1.5mm]frame.north west) -- ([xshift=4mm,yshift=1.5mm]frame.south west); },
#1}
{\raggedright #2%\qed
}

\begin{document}

\chapter{First}

Lemma~\ref{A} on page~\pageref{A}, followed by
Lemma~\ref{B} on page~\pageref{B}.

Also see Proof~\ref{pA} on page~\pageref{pA}
and Proof~\ref{pB} on page~\pageref{pB}.

\section{First}

\lem[label=A]{\blindtext[1]}

\proof[label=pA]{\blindtext[1]}

\lem[label=B]{\blindtext[2]}

\proof[label=pB]{\blindtext[4]}

\end{document}


• Thanks for the reply! I should definitely learn TikZ ;-) – user31729 Sep 16 '14 at 9:30
• Great answer! How would I make the counter depend on the current chapter though? Such as "Lemma 1.3" where "1" is the current chapter? – lukas.coenig May 14 '16 at 7:50
• @lukas.coenig Using [auto counter,number within=chapter] instead of [auto counter] should do the trick. – Thomas F. Sturm May 15 '16 at 9:45
• @ThomasF.Sturm: Sorry to bother again, but where do I have to put the label to get the correct reference to such a lemma? I tried virtually everything, but always get only a reference to the current section. – lukas.coenig Jun 2 '16 at 6:48
• @lukas.coenig See my updated answer. – Thomas F. Sturm Jun 2 '16 at 8:43

## This is not a full solution, rather a starting point, due to lack of time and lack of knowledge on TikZ ;-)

I tried to use the tcolorbox breakable and overlay features and its theorem style to make the boxes. The logos from bclogo packages can be inserted, but I fail at the positioning them correctly. This leads to a right shift of the box content as well.

\documentclass[paper=a4,12pt]{scrbook}

\usepackage{etoolbox}%
\usepackage{blindtext}%
\usepackage{bclogo}%
\usepackage[theorems,skins,breakable]{tcolorbox}%

\begin{document}

\chapter{First}

\section{First}

\newtcbtheorem[number within=section]{lem}{Lemma}%
{overlay={\bclampe},left=5pt,breakable,colback=green!5,colframe=green!35!black,fonttitle=\bfseries,title after break={Lemma \csuse{the\tcbcounter} -- \raggedleft Continued}}{lem}

\newtcbtheorem[number within=section]{proof}{Proof}{breakable,overlay={\bclampe},colback=green!5,colframe=green!35!black,fonttitle=\bfseries,title after break={Proof \csuse{the\tcbcounter} -- \raggedleft Continued}}{prf}

\begin{lem}{On Brontosaurs}{}
\textbf{By Ann Elk (Misses)}

Brontosaurs are thin at one end, thick in the middle and thin again on the other end.
\end{lem}

\begin{proof}{On Brontosaurs}{}
\textbf{By Ann Elk (Misses)}

See the excavations ;-)

\blindtext[4]%
\end{proof}

\end{document}