3

I have a problem with package Boiboites I'm writting an exercise enunciate with this package who occupies more than one page, but i cannot break the page. Here's the code:

\documentclass[11pt,a4paper,oneside]{scrbook}
\usepackage{enumerate}

\usepackage{mathpazo}

\usepackage{graphicx}
\usepackage{xcolor}
\usepackage{tikz, pgf, pgfplots}
\usetikzlibrary{arrows,backgrounds,plotmarks,shapes.geometric,calc}
\pgfplotsset{width=7cm,compat=newest}
\pgfplotsset{plot coordinates/math parser=false}

\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{etex,boiboites}

\definecolor{color1}{RGB}{44,42,37}% borde general
\definecolor{color2}{RGB}{240,240,240}% fondo del cuerpo
\definecolor{color3}{RGB}{44,42,37}% fondo del encabezado
\definecolor{color4}{RGB}{255,255,255}% borde del encabezado

\newboxedtheorem[boxcolor=orange, background=blue!5, titlebackground= blue!20, 
titleboxcolor = black,thcounter=section ] {bteo}{Teorema}{thCounter}
\newboxedtheorem[boxcolor=orange, background=blue!5, titlebackground= blue!20, 
titleboxcolor = black,thcounter=section ] {bpropo}{Proposición}{thCounter}
\newboxedtheorem[boxcolor=orange, background=blue!5, titlebackground= blue!20, 
titleboxcolor = black,thcounter=section ] {bcorolario}{Corolario}{thCounter}
\newboxedtheorem[boxcolor=orange, background=blue!5, titlebackground= blue!20, 
titleboxcolor = black,thcounter=section ] {bdefi}{Definición}{thCounter}
\newboxedtheorem[boxcolor=orange, background=blue!5, titlebackground= blue!20, 
titleboxcolor = black,thcounter=section ] {bexercise}{Ejercicio}{thCounter}
\newboxedtheorem[boxcolor=orange, background=blue!5, titlebackground= blue!20, 
titleboxcolor = black,thcounter=section ] {bexercise2}{Ejercicio}{thCounter}
\newboxedtheorem[boxcolor=orange, background=blue!5, titlebackground= blue!20, 
titleboxcolor = black,thcounter=section ] {bejem}{Ejemplo}{thCounter}


\usepackage{upquote}


\usepackage{icomma} 
\usepackage{fancyhdr} %activamos el paquete
\usepackage{endnotes} 
\usepackage{fancyvrb}

\let\footnote=\endnote
\def\footnotetext{\endnotetext[\number\numexpr\value{endnote}+1]}
\let\footnotemark\endnotemark 

\pagestyle{fancy} %seleccionamos un estilo
\fancyhf{} % borra cabecera y pie actuales
 \lhead{ECUACIONES} %texto izquierda de la cabecera
 \rhead{\thepage }
\chead{TEORÍA Y EJERCICIOS} %texto centro de la cabecera
 \rfoot{RESOLUCIÓN ECUACIONES} %texto izquierda del pie
\rhead{\thepage } %número de página a la derecha
\renewcommand{\footrulewidth}{1.0pt} 
\renewcommand{\headrulewidth}{1.0pt}




\usepackage{helvet}
%Helvética
\newcommand{\helv}{\fontfamily{phv}\fontsize{9}{11}\selectfont}


\usepackage[colorlinks=true,linkcolor=black,citecolor=blue, urlcolor=blue]{hyperref}


\usepackage[total={15cm,21cm},left=2cm,top=2cm]{geometry}
\parindent=0mm
\renewcommand{\baselinestretch }{1.2}



\title{\textbf{Pruebas Octave}}
\author{Cristobal López}
\date{}

\begin {document}
\maketitle
\begin{bexercise}
Se considera un flujo turbulento en una tubería, sea $\mathcal{R}\geq 3500$ el número de Reynolds asociado a su diámetro D. Se desea calcular el coeficiente $\lambda$ de pérdida de carga lineal utilizando la relación de Colebrook:
\[ \lambda ^{-\frac{1}{2}} =-2\log_{10}\left( \dfrac{\epsilon}{3.71\cdot D}+\dfrac{2.51}{\mathcal{R}\lambda^{\frac{1}{2}}}\right) \]
donde: \\
\begin{itemize}
\item $\lambda$ es el coeficiente de pérdida de carga lineal o factor de fricción de Moody. Es adimensional.
\item $\epsilon$ es la rugosidad de la tubería.
\end{itemize}
Para obtener una estimación inicial de $\lambda$ se usará el valor suministrado por la fórmula empírica de Hermann
\[ \lambda_0 =0.0054+0.395\mathcal{R}^{-0.3}\]
El objetivo del ejercicio es calcular aproximadamente $\lambda$ para los siguientes valores de $\mathcal{R}$ y de $\frac{\epsilon}{D}$ \\

\begin{center}
\begin{tabular}{|c|c|}
\hline
    $\mathcal{R}$ & $\frac{\epsilon}{D}$\\ \hline
    $10^4$ & 0.05\\
    $10^5$ & 0.003\\
    $10^6$ & 0.003\\
\hline
\end{tabular}
\end{center}
Se utilizarán para ello los siguientes métodos:
\begin{enumerate}
\item Método de las aproximaciones sucesivas.
    \begin{enumerate}
    \item[1.1] Efectuar un análisis previo de la existencia y unicidad de la solución y de la convergencia de la sucesión aproximadamente.
    \item[1.2] Hacer una estimación a priori del número de iteraciones necesarias para obtener la solución con un error $\epsilon <10^{-6}$ para cada pareja de valores $\left(\mathcal{R},\: \frac{\epsilon}{D}\right)$.
    \item[1.3] Resolver la ecuación. \clearpage \newpage
    \item[1.4] Efectuar estimaciones "a priori" y "a posteriori" del error en cada caso comparando los resultados.
    \item[1.5] Efectuar.
    \end{enumerate}
\end{enumerate}
\end{bexercise}
\end{document}

How can I follow the exercise in a new page? Break Page

  • 1
    would you consider an alternative to the boiboites package? You would need to modify the package so that the boxes can break over multiple pages, but there are already packages that implement this feature like mdframed and tcolorbox. – Old Nick Nov 24 '13 at 11:11
6

Here is the result with the tcolorbox package and your complete code.

enter image description here

To achieve this you need to add the following MWE to your code

\documentclass{article}
\usepackage{tcolorbox}
\tcbuselibrary{breakable,skins}

\newcounter{exe}                           % this will create a new counter for auto numbering the exercises

\newcommand{\mytitle}{                     %this will create the the box with the "title" of the exercise
   \node[fill=blue!20,
      rounded corners,
      draw=black,
      text=black,
      line width=1pt,
      inner sep=4pt,
      anchor=west,
      xshift=12pt]
   at (frame.north west){\bfseries Ejercicio \stepcounter{exe}\theexe.};
}

\newtcolorbox{mybox}{                       % this will create the main box
   enhanced,
   overlay unbroken and first={\mytitle},   % this will ensure that the title will not be printed two times in broken boxes
   colframe=orange,
   boxrule=1pt,
   arc=3mm,
   breakable,                               % this will make the box breaks when the end of the page is reached
   top=15pt,
   before=\vskip18pt,
}

\begin{document} 

   \begin{mybox}
      % your content goes here
   \end{mybox} 

\end{document}
| improve this answer | |
  • I need compile with LuaLatex, but it doesn't work with LuaLatex – Tobal Nov 24 '13 at 17:53
  • Just tried and it compiles fine with LuaLaTeX here. To compile with LuaLaTeX you should remove the fontenc and inputenc packages from your code and add fontspec. Other adjustements might be needed for the math font but this has nothing to do with the use of tcolorbox or mdframed. – Old Nick Nov 24 '13 at 17:58
2

This is an old topic but as I'm releasing a new version of boiboites I hope it's appropriate to dig it up.

You can now use xeboiboites to draw your boxes over multiple pages. Plus, you can control the style of the edges that "break" from one page to another. For example, you can achieve this: enter image description here

It's a work in progress but seems stable, you can check everything out here : http://alexisfles.ch/en/latex/boites2.html

where you'll find a detailed documentation with examples.

| improve this answer | |

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.