If you publish widgets in a jupyter book they might (depending on your implementation) require an active python kernel for the output to be interactive. Using the [thebe-integration](live_code.md), this is possible. Note: You can circumvent the use of a kernel by using packages which don't need such a kernel, for example the [non-kernel-based widgets using Plotly](interactive_element).
%% Cell type:markdown id: tags:
Please note:
- You might want to hide the output before the thebe has been activated.
- You can hide the code by adding a custom-made tag: `thebe-remove-input-init`.
- You can automatically start the thebe functionality when you add `auto-execute-page` to a cell. However, this won't work if the tag `thebe-remove-input-init` is in the same cell. The widget is not interactive when the the interactive mode is not activated.
## Example
The code below shows an example of the strain energy in a structure and work done by a force for different trial functions. Because of the actual python code, the plot 'refreshes' upon updating a widgets. This can be avoided by updating the current figure instead of plotting a new figure. Remember, first press {fa}`rocket` --> {guilabel}`Live Code` and then wait until all cells are executed: