使用 TColorbox 格式化

使用 TColorbox 格式化

我是 tcolorbox 包的新手。我在包含 tikz 图片的框中添加文本时遇到了麻烦。间距非常大。我想知道是否有一个简单的解决方法。这发生在开头,第 33 行。

缺口

\documentclass{exam}
\usepackage[utf8]{inputenc}
\usepackage[most]{tcolorbox}
\usepackage{amsfonts}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{tikz}
\usepackage{pgfplots}
\pgfplotsset{compat=1.17}
\usetikzlibrary{arrows,shapes,positioning}

\usepackage[margin=.5in]{geometry}
\setlength{\columnsep}{0pt}
\title{2.4 Connecting Differentiability and Continuity: \\ When Derivatives Do and Do Not Exist}
\date{}
\begin{document}

\maketitle
\noindent\rule{18cm}{0.4pt}

\begin{tcolorbox}[colback=white,enhanced,title=\Large{\textbf{How $f^\prime(a)$ Might Fail to Exist}},
attach boxed title to top center=
{yshift=-3mm,yshifttext=-1mm},
boxed title style={size=small,colback=blue!75}]
    \begin{tcbitemize}[raster columns=2,raster equal height,
colback=white,fonttitle=\bfseries]

A function will fail to have a derivative at a point if the limit at that point does not approach $a$.  There are four ways in which a derivative may fail to exist. 
    \vspace{.25in}
\tcbitem[center title,squeezed title*={Sharp Corner}]

\begin{tcolorbox}
a \emph{corner} where one-sided 
derivatives\fillin
\end{tcolorbox}

\begin{tikzpicture}
        \begin{axis}[
grid style={blue!75},
axis x line = center,
axis y line = center,
xmin = -5,   xmax = 5,
ymin = -5,  ymax = 5,
xtick = {-5,-4,...,5},
ytick = {-5,-4,...,5},
grid = both,
xlabel={$x$},
  ylabel={$y$},
  xlabel style={above right},
  ylabel style={above right},
axis line style={latex-latex},
]
\addplot[latex-latex,samples=200,color=red, ultra thick, domain=-3:3]{abs(x)};

\end{axis}
\end{tikzpicture}

\tcbitem[center title,squeezed title*={A Cusp}]
\begin{tikzpicture}
        \begin{axis}[
grid style={blue!75},
axis x line = center,
axis y line = center,
xmin = -5,   xmax = 5,
ymin = -5,  ymax = 5,
xtick = {-5,-4,...,5},
ytick = {-5,-4,...,5},
grid = both,
xlabel={$x$},
  ylabel={$y$},
  xlabel style={above right},
  ylabel style={above right},
axis line style={latex-latex},
]
\addplot[latex-latex,samples=200,color=red, ultra thick, domain=-3:3]{abs(x)^(2/3)};

\end{axis}
\end{tikzpicture}
\tcbitem[center title,squeezed title*={Vertical Tangent}]
 \begin{tikzpicture}
        \begin{axis}[
grid style={blue!75},
axis x line = center,
axis y line = center,
xmin = -5,   xmax = 5,
ymin = -5,  ymax = 5,
xtick = {-5,-4,...,5},
ytick = {-5,-4,...,5},
grid = both,
xlabel={$x$},
  ylabel={$y$},
  xlabel style={above right},
  ylabel style={above right},
axis line style={latex-latex},
]
\addplot[<->] expression[ultra thick,red,domain=-5:5,samples=100]{x/abs(x)*abs(x)^(1/3)};
\end{axis}
\end{tikzpicture}
 \tcbitem[center title, squeezed title*={Jump Discontinuity}]
 \begin{tikzpicture}
        \begin{axis}[
grid style={blue!75},
axis x line = center,
axis y line = center,
xmin = -5,   xmax = 5,
ymin = -5,  ymax = 5,
xtick = {-5,-4,...,5},
ytick = {-5,-4,...,5},
grid = both,
xlabel={$x$},
  ylabel={$y$},
  xlabel style={above right},
  ylabel style={above right},
axis line style={latex-latex},
]
\addplot[ultra thick,color=red,domain=0:3] {1};
\addplot[ultra thick,color=red,domain=-3:0] {-1};
\addplot[color=red,mark=*,only marks] coordinates {(0,1)};
\addplot[color=red,mark=*,fill=white,only marks] coordinates {(0,-1)};
\end{axis}
\end{tikzpicture}
\end{tcbitemize}

\end{tcolorbox}

\end{document}

答案1

在此处输入图片描述

更改以下代码行——添加[halign= left]

\begin{tcolorbox}[halign= left]
 a \emph{corner} where one-sided derivatives\fillin
\end{tcolorbox}

相关内容