Using the tcolorbox package to produce exercises for a textbook, I use the option invisible
to let space for students for writing their solutions.
For that, I want to let the blank space of the lower part, filled by horizontal lines, to let the students write comfortably. This must be done for the long exercises, taking more than one page, too, of course. How can I do this?
Note that we can obtain a grid with the option help lines
, but this option induces a grid not lines... So can we put a similar option what gives only horizontal and not vertical lines ?
I give a MWE:
\documentclass{article}
\usepackage{etoolbox}
\usepackage[most]{tcolorbox}
\NewTColorBox[auto counter]{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);
\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:
\vspace*{5cm} %% more space on solution for clarity
\[f^\prime(x) = \cos((\sin x)^2) 2\sin x \cos x.\]
\end{exercise}
\tcbstoprecording
\end{document}