0
\documentclass[11pt]{book}                                                  

\usepackage[top=1cm, bottom=1cm, lmargin=3cm, rmargin=1cm]{geometry}


\usepackage[english,spanish]{babel}
\usepackage[latin1]{inputenc}                      
\usepackage[T1]{fontenc}


\usepackage{xcolor}                                
\definecolor{grisamarillo}{RGB}{248,248,245} 
\definecolor{verdep}{RGB}{166,206,58}


\usepackage{xparse}
\usepackage{tcolorbox} 
\tcbuselibrary{skins,breakable}                   
\usepackage{tikz,tkz-tab}% Cajas de Teoremas, ejemplos, etc.
\usetikzlibrary{positioning,shadows,backgrounds,calc}%
\usepackage{tikzpagenodes}
\usepackage{xargs}                 
\DeclareGraphicsExtensions{.pdf,.png,.jpg}
\usepackage{amsmath,amssymb,amsfonts,latexsym,cancel,stmaryrd}%
\usepackage{framed}
\usepackage{titletoc}


\newcommand{\fhvb}[2]{{\fontfamily{pag}\fontseries{b}\fontsize{#1}{1}\selectfont{#2}}}

%ejemplo
\newcounter{tcbejem}[chapter]
\renewcommand{\thetcbejem}{\thechapter.\arabic{tcbejem}}
\colorlet{colorfondoejemplo}{gray!5}
\definecolor{colorejemplo}{rgb}{.0,.0,.3}
% Ejemplo
\newtcolorbox{wwejemplo}[3][]{%
arc=0mm,
breakable,drop fuzzy shadow,
enhanced,
colback=grisamarillo,
boxrule=0pt,
top=8mm, %Separación vertical - inicia texto
enlarge top by=1cm,
enlarge top at break by=0mm,pad at break=4cm,
fontupper=15cm,
step and label={tcbejem}{#3},
overlay unbroken  = {%
%barra vertical
\draw[color=verdep,line width=3pt] ([xshift=2pt] frame.north west)--([xshift=2pt] frame.south west);           
% Caja de imagen Ejemplo
\node[rectangle, 
         text=black, 
         inner sep=1mm,anchor=west,font=\small\bf\sffamily] at ([xshift=-14.3pt,yshift=-4.1mm]frame.north west)%
{};
% Caja numeración y descripción
\node[rectangle, 
 text=black, 
 inner sep=1mm,
 anchor=west,
 font=\normalsize] at ([xshift=1.1cm,yshift=-2.9mm]frame.north west)%
 {\fhvb{10}{\;\thetcbejem \;\;\;#2}};
     }, % overlay
overlay first  = {%
%barra vertical
\draw[color=verdep,line width=3pt] ([xshift=2pt] frame.north west)--([xshift=2pt] frame.south west);           
% Caja de imagen Ejemplo
\node[rectangle, 
         text=black, 
         inner sep=1mm,anchor=west,font=\small\bf\sffamily] at ([xshift=-14.3pt,yshift=-4.1mm]frame.north west)%
{};
% Caja numeración y descripción
\node[rectangle, 
 text=black, 
 inner sep=1mm,
 anchor=west,
 font=\normalsize] at ([xshift=1.1cm,yshift=-2.9mm]frame.north west)%
 {\fhvb{10}{\;\thetcbejem \;\;\;#2}};
     }, % overlay
%Borde cambio de páginas
overlay middle={\draw[color=grisamarillo,line width=3pt] ([xshift=3pt] frame.north west)--([xshift=2pt] frame.south west);},
overlay last={\draw[color=grisamarillo,line width=3pt] ([xshift=3pt] frame.north west)--([xshift=2pt] frame.south west);}
#1}
%-
\NewDocumentEnvironment{ejemplo}{O{} O{} O{}}{\smallskip\begin{wwejemplo}{#1}{#2}%
 #3}{\end{wwejemplo}\smallskip }
%EJEMPLO-----------------------------------------------------------------



\begin{document}


\begin{ejemplo}
\begin{minipage}[c]{0.2\textwidth}

faf
\end{minipage}\hfill \begin{minipage}[c]{0.8\textwidth}
\begin{center}
$A_s=\{s_1,...,s_n\}$
\par fdajf
\par d
\par dafja
\par fdafja
\par daf
\par dafjad
\par affjaf
\par fjajfa
\par fajñfa
\par fafajf
\par fajfa
\par fajfa
\par fafja
\par fajfja
\par fajfdaf
\par fa
\par fafd
\par fahfa
\par fajfja
\par fajfja
\par ajfja
\par fdajfa
\par dahf
\par afjja
\par jaffja
\par dajfja
\par afjfja
\par afjfja
\par jfajf
\par afjajf
\par afjafj
\par jaffjd
\par afjajf
\par khkvh
\par fajfa
\par akfhalh
\par faf
\par fajfja
\par ajfja
\par fdajfa
\par dahf
\par afjja
\par jaffja
\par dajfja
\par afjfja
\par afjfja
\par jfajf
\par afjajf
\par afjafj
\par jaffjd
\par afjajf
\par khkvh
\par fajfa
\par akfhalh
\par faf
\par fajfja
\par ajfja
\par fdajfa
\par dahf
\par afjja
\par jaffja
\par dajfja
\par afjfja
\par afjfja
\par jfajf
\par afjajf
\par afjafj
\par jaffjd
\par afjajf
\par khkvh
\par fajfa
\par akfhalh
\par faf
\end{center}
\end{minipage}

\end{ejemplo}
\end{document}

enter image description here

  • 1
    there is no page break in a minipage, so don't use it. – Ulrike Fischer Mar 25 at 22:45
  • 1
    Use a longtable instead. It is done to break across pages. – Bernard Mar 25 at 22:53
  • A breakable tcolorbox can break its contents if its contents is breakable.minipages, tabulars, figures, ...are not breakable, therefore if you place them inside a tcolorbox they will be placed in this page or next page accoding the available space but they won't show a fragment in this page and another fragment in next page. But if you explain what you want to do with this box and these minipages inside it, may be we can help to find a solution. – Ignasi Mar 26 at 8:24

Your Answer

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

Browse other questions tagged or ask your own question.