27.9.13

Create Beamer-Theorem like boxes using the LaTeX package tcolorbox - version 2.51 (2013/09/16)

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

\colorlet{xlightblue}{blue!5}

\newtcolorbox{beamerlikethm}[1]{
  title=#1,
  beamer,
  colback=xlightblue,
  colframe=blue!30,
  fonttitle=\bfseries,
  left=1mm,
  right=1mm,
  top=1mm,
  bottom=1mm,
  middle=1mm
}

\begin{document}

\begin{beamerlikethm}{Theorem (Pythagoras)}
\[ a^2 + b^2 = c^2 \]
\end{beamerlikethm}

\end{document}
enter image description here
Could happen that your box necessitate of being split on different pages. The library breakable of the package deal with this problem.
\documentclass{article}
\usepackage{tcolorbox}
\tcbuselibrary{breakable,skins}
\usepackage{lipsum}
\colorlet{xlightblue}{blue!5}
\newtcolorbox{beamerlikethm}[1]
{
title=#1,
beamer, 
colback=xlightblue,
colframe=blue!30,
fonttitle=\bfseries,
left=1mm,
right=1mm,
top=1mm,
bottom=1mm,
middle=1mm,
breakable,
}
\begin{document}
\begin{beamerlikethm}{Theorem (Pythagoras)}
\[ a^2 + b^2 = c^2 \]
\end{beamerlikethm}
\lipsum[1-4]
\begin{beamerlikethm}{Something}
\lipsum[5]
\end{beamerlikethm}
\end{document}

enter image description here

1 comentario:

  1. Hola espero estés bien, me gusta mucho tu blog, estoy aprendiendo a utilizar lyx y me gustaría sabes si en lyx puedo utilizar figuras flotantes entre el texto y este tipo de cajas? si podrías enseñarme estaría genial.

    ResponderEliminar