Using the tcolorbox package to produce exercises for a textbook, I use the option invisible to let space for students for writing their solutions. In practice, the students need more space to write the solution than take the solution written. So how can I add a vertical space, say 20mm, for the option invisible
? More, how can I play on this space, so add 10mm in the invisible
part for short exercises, and 20mm for long ones ?
I give the program used:
\documentclass{book}
\usepackage{etoolbox}
\usepackage[most]{tcolorbox}
\NewTColorBox[auto counter,number within=chapter]{exercise}{m+O{}}{%
enhanced,
breakable,
colframe=green!20!black,
colback=yellow!10!white,
coltitle=green!40!black,
fonttitle=\bfseries,
underlay={\begin{tcbclipinterior}
\shade[inner color=green!80!yellow,outer color=yellow!10!white]
(interior.north west) circle (2cm);
\draw[help lines,step=5mm,yellow!80!black,shift={(interior.north west)}]
(interior.south west) grid (interior.north east);
\end{tcbclipinterior}},
title={Exercise~ \thetcbcounter:},
label={exercise:#1},
attach title to upper=\quad,
segmentation style={double=white,draw=green!20!black,double distance=1pt,solid},
lowerbox=invisible,
savelowerto=solutions/exercise-\thetcbcounter.tex,
record={\string\solution{#1}{solutions/exercise-\thetcbcounter.tex}},
#2
}
\begin{document}
\pagestyle{empty}
\tcbstartrecording
\begin{exercise}{Ex1}[coltitle=cyan!80!black]
Compute the derivative of the following function:
\begin{equation*}
f(x)=\sin((\sin x)^2)
\end{equation*}
\tcblower
The derivative is:
\[f^\prime(x) = \cos((\sin x)^2) 2\sin x \cos x.\]
\end{exercise}
\tcbstoprecording
\end{document}
invisible
option where you used to place it. (And may be comment it out)lowerbox=invisible,