You can remove cells from the HTML/LaTeX output by adding this to the cell metadata:
Hidden cells are still executed but removed afterwards.
For example, the following hidden cell defines the variable
This is the cell after the hidden cell. Although the previous cell is not visible, its result is still available:
Don’t overuse this, because it may make it harder to follow what’s going on in your notebook.
Also Markdown cells can be hidden. The following cell is hidden.