Tengo el siguiente código:
\documentclass[a4paper,11pt]{book}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}
\usepackage{classicthesis}
\usepackage{hyperref}
\usepackage{graphicx}
\usepackage[english]{babel}
\usepackage{amsmath,mathtools}
\usepackage{amsfonts}
\usepackage{color}
\usepackage{url}
\usepackage{enumitem}
\usepackage{multicol}
\usepackage{tabu}
\usepackage{amsthm}
\usepackage{fourier-orns}
\usepackage{framed}
\usepackage{tcolorbox}
\usepackage[toc,page]{appendix}
\usepackage[all]{xy}
\begin{document}
\begin{enumerate}
\item For the function $y=x,$ find the derivative, $y'.$
\[y'=\lim_{h\to 0}\frac{(x+h)-x}{h}=\lim_{h\to 0}\frac{h}{h}=\lim_{h\to 0}1=1.\]
\item For the function $y=x^2,$ find the derivative, $y'.$
\begin{align*}
y'=\lim_{h\to 0}\frac{(x+h)^2-x^2}{h}&=\lim_{h\to 0}\frac{x^2+2xh+h^2-x^2}{h}\\
&=\lim_{h\to 0}\frac{2xh+h^2}{h}=\lim_{h\to 0}(2x+h)=2x.
\end{align*}
\begin{center}
\begin{framed}
For the next two examples, we will use the angle sum formula for sine, which is
\[\sin(\alpha+\beta)=\sin\alpha\cos\beta+\cos\alpha\sin\beta.\]
\end{framed}
\end{center}
\item For the function $y=\sin x,$ find the derivative, $y'.$
\begin{align*}
y'=\lim_{h\to 0}\frac{\sin (x+h)-\sin x}{h}&=\lim_{h\to 0}\frac{\sin x\cos h+\cos x\sin h-\sin x}{h}\\
&=\lim_{h\to 0}\frac{\sin x(\cos h-1)+\cos x\sin h}{h}\\
&=\left[\lim_{h\to 0}(\sin x)\left(\frac{\cos h-1}{h}\right)\right]\left[\lim_{h\to 0}(\cos x)\left(\frac{\sin h}{h}\right)\right]\\
&=(\sin x)\cdot 0+(\cos x)\cdot 1\\
&=\cos x,
\end{align*}
where we have used $\displaystyle\lim_{h\to 0}\frac{\sin h}{h}=1$ and $\displaystyle\lim_{h\to 0}\frac{\cos h-1}{h}=0$ from section (1.3).
\item Find $\dfrac{d}{dx}\tan x.$
\begin{align*}
\dfrac{d}{dx}\tan x=\displaystyle\lim_{h\to 0}\dfrac{\tan(x+h)-\tan x}{h}&=\displaystyle\lim_{h\to 0}\left(\dfrac{\sin(x+h)}{h\cos(x+h)}-\dfrac{\sin x}{h\cos x}\right)\\
&=\displaystyle\lim_{h\to 0}\left(\dfrac{\sin(x+h)\cos x-\cos(x+h)\sin x}{h\cos(x+h)\cos x}\right)\\
&=\displaystyle\lim_{h\to 0}\left(\dfrac{\sin[(x+h)-x]}{h\cos(x+h)\cos x}\right)\\
&=\displaystyle\lim_{h\to 0}\left[\left(\dfrac{\sin h}{h}\right)\left(\dfrac{1}{\cos(x+h)\cos x}\right)\right]\\
&=\dfrac{1}{\cos^2(x)}=\sec^2 x.
\end{align*}
\end{enumerate}
\end{document}
Y me sigue saliendo el error"Algo anda mal, tal vez falta un \elemento"
¿Cómo arreglar esto?
Respuesta1
Necesitas \leavevmode
ante el framed
medio ambiente; sin embargo, me gustaría sugerirle otro enfoque utilizando el tcolorbox
paquete (que ya está cargando). A continuación un ejemplo comparativo con el original framed
y luego con un tcolorbox
ancho definido ( \makebox
se usó a para centrar el cuadro respecto al \textwidth
):
\documentclass[a4paper,11pt]{book}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}
\usepackage{classicthesis}
\usepackage{hyperref}
\usepackage{graphicx}
\usepackage[english]{babel}
\usepackage{amsmath,mathtools}
\usepackage{amsfonts}
\usepackage{color}
\usepackage{url}
\usepackage{enumitem}
\usepackage{multicol}
\usepackage{tabu}
\usepackage{amsthm}
\usepackage{fourier-orns}
\usepackage{framed}
\usepackage[many]{tcolorbox}
\usepackage[toc,page]{appendix}
\usepackage[all]{xy}
\usepackage[margin=2cm,showframe]{geometry}
\begin{document}
\begin{enumerate}
\item For the function $y=x,$ find the derivative, $y'.$
\[y'=\lim_{h\to 0}\frac{(x+h)-x}{h}=\lim_{h\to 0}\frac{h}{h}=\lim_{h\to 0}1=1.\]
\item For the function $y=x^2,$ find the derivative, $y'.$
\begin{align*}
y'=\lim_{h\to 0}\frac{(x+h)^2-x^2}{h}&=\lim_{h\to 0}\frac{x^2+2xh+h^2-x^2}{h}\\
&=\lim_{h\to 0}\frac{2xh+h^2}{h}=\lim_{h\to 0}(2x+h)=2x.
\end{align*}
\begin{center}\leavevmode
\begin{framed}
For the next two examples, we will use the angle sum formula for sine, which is
\[\sin(\alpha+\beta)=\sin\alpha\cos\beta+\cos\alpha\sin\beta.\]
\end{framed}
\end{center}
\makebox[\linewidth]{%
\begin{tcolorbox}[arc=0pt,outer arc=0pt,colback=white,width=.6\textwidth]
For the next two examples, we will use the angle sum formula for sine, which is
\[\sin(\alpha+\beta)=\sin\alpha\cos\beta+\cos\alpha\sin\beta.\]
\end{tcolorbox}}
\item For the function $y=\sin x,$ find the derivative, $y'.$
\begin{align*}
y'=\lim_{h\to 0}\frac{\sin (x+h)-\sin x}{h}&=\lim_{h\to 0}\frac{\sin x\cos h+\cos x\sin h-\sin x}{h}\\
&=\lim_{h\to 0}\frac{\sin x(\cos h-1)+\cos x\sin h}{h}\\
&=\left[\lim_{h\to 0}(\sin x)\left(\frac{\cos h-1}{h}\right)\right]\left[\lim_{h\to 0}(\cos x)\left(\frac{\sin h}{h}\right)\right]\\
&=(\sin x)\cdot 0+(\cos x)\cdot 1\\
&=\cos x,
\end{align*}
where we have used $\displaystyle\lim_{h\to 0}\frac{\sin h}{h}=1$ and $\displaystyle\lim_{h\to 0}\frac{\cos h-1}{h}=0$ from section (1.3).
\item Find $\dfrac{d}{dx}\tan x.$
\begin{align*}
\dfrac{d}{dx}\tan x=\displaystyle\lim_{h\to 0}\dfrac{\tan(x+h)-\tan x}{h}&=\displaystyle\lim_{h\to 0}\left(\dfrac{\sin(x+h)}{h\cos(x+h)}-\dfrac{\sin x}{h\cos x}\right)\\
&=\displaystyle\lim_{h\to 0}\left(\dfrac{\sin(x+h)\cos x-\cos(x+h)\sin x}{h\cos(x+h)\cos x}\right)\\
&=\displaystyle\lim_{h\to 0}\left(\dfrac{\sin[(x+h)-x]}{h\cos(x+h)\cos x}\right)\\
&=\displaystyle\lim_{h\to 0}\left[\left(\dfrac{\sin h}{h}\right)\left(\dfrac{1}{\cos(x+h)\cos x}\right)\right]\\
&=\dfrac{1}{\cos^2(x)}=\sec^2 x.
\end{align*}
\end{enumerate}
\end{document}
El resultado:
solía
\usepackage[margin=2cm,showframe]{geometry}
en el ejemplo solo se trata de tener una guía visual del diseño de la página.
Respuesta2
Otra opción es utilizar minipage
el entorno como se ve en el código.
\documentclass[a4paper,11pt]{book}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}
\usepackage{classicthesis}
\usepackage{hyperref}
\usepackage{graphicx}
\usepackage[english]{babel}
\usepackage{amsmath,mathtools}
\usepackage{amsfonts}
\usepackage{color}
\usepackage{url}
\usepackage{enumitem}
\usepackage{multicol}
\usepackage{tabu}
\usepackage{amsthm}
\usepackage{fourier-orns}
\usepackage{framed}
\usepackage{tcolorbox}
\usepackage[toc,page]{appendix}
\usepackage[all]{xy}
\begin{document}
\begin{enumerate}
\item For the function $y=x,$ find the derivative, $y'.$
\[y'=\lim_{h\to 0}\frac{(x+h)-x}{h}=\lim_{h\to 0}\frac{h}{h}=\lim_{h\to 0}1=1.\]
\item For the function $y=x^2,$ find the derivative, $y'.$
\begin{align*}
y'=\lim_{h\to 0}\frac{(x+h)^2-x^2}{h}&=\lim_{h\to 0}\frac{x^2+2xh+h^2-x^2}{h}\\
&=\lim_{h\to 0}\frac{2xh+h^2}{h}=\lim_{h\to 0}(2x+h)=2x.
\end{align*}
\begin{minipage}[c]{0.75\textwidth}
\begin{framed}
For the next two examples, we will use the angle sum formula for sine, which is
\[\sin(\alpha+\beta)=\sin\alpha \cos\beta+\cos\alpha \sin\beta.\]
\end{framed}
\end{minipage}
\item For the function $y=\sin x,$ find the derivative, $y'.$
\begin{align*}
y'=\lim_{h\to 0}\frac{\sin (x+h)-\sin x}{h}&=\lim_{h\to 0}\frac{\sin x\cos h+\cos x\sin h-\sin x}{h}\\
&=\lim_{h\to 0}\frac{\sin x(\cos h-1)+\cos x\sin h}{h}\\
&=\left[\lim_{h\to 0}(\sin x)\left(\frac{\cos h-1}{h}\right)\right]\left[\lim_{h\to 0}(\cos x)\left(\frac{\sin h}{h}\right)\right]\\
&=(\sin x)\cdot 0+(\cos x)\cdot 1\\
&=\cos x,
\end{align*}
where we have used $\displaystyle\lim_{h\to 0}\frac{\sin h}{h}=1$ and $\displaystyle\lim_{h\to 0}\frac{\cos h-1}{h}=0$ from section (1.3).
\item Find $\dfrac{d}{dx}\tan x.$
\begin{align*}
\dfrac{d}{dx}\tan x=\displaystyle\lim_{h\to 0}\dfrac{\tan(x+h)-\tan x}{h}&=\displaystyle\lim_{h\to 0}\left(\dfrac{\sin(x+h)}{h\cos(x+h)}-\dfrac{\sin x}{h\cos x}\right)\\
&=\displaystyle\lim_{h\to 0}\left(\dfrac{\sin(x+h)\cos x-\cos(x+h)\sin x}{h\cos(x+h)\cos x}\right)\\
&=\displaystyle\lim_{h\to 0}\left(\dfrac{\sin[(x+h)-x]}{h\cos(x+h)\cos x}\right)\\
&=\displaystyle\lim_{h\to 0}\left[\left(\dfrac{\sin h}{h}\right)\left(\dfrac{1}{\cos(x+h)\cos x}\right)\right]\\
&=\dfrac{1}{\cos^2(x)}=\sec^2 x.
\end{align*}
\end{enumerate}
\end{document}