{ "cells": [ { "cell_type": "markdown", "metadata": { "nbsphinx": "hidden" }, "source": [ "This notebook is part of the `nbsphinx` documentation: https://nbsphinx.readthedocs.io/." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Hidden Cells\n", "\n", "You can remove cells from the HTML/LaTeX output by adding this to the cell metadata:\n", "\n", "```\n", "\"nbsphinx\": \"hidden\"\n", "```\n", "\n", "Hidden cells are still executed but removed afterwards.\n", "\n", "For example, the following hidden cell defines the variable `answer`." ] }, { "cell_type": "code", "execution_count": null, "metadata": { "nbsphinx": "hidden" }, "outputs": [], "source": [ "answer = 6 * 7" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "This is the cell after the hidden cell.\n", "Although the previous cell is not visible, its result is still available:" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "answer" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Don't overuse this, because it may make it harder to follow what's going on in your notebook.\n", "\n", "Also Markdown cells can be hidden.\n", "The following cell is hidden." ] }, { "cell_type": "markdown", "metadata": { "nbsphinx": "hidden" }, "source": [ "I am a *hidden* Markdown cell!" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "This is the cell after the hidden cell." ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.6.7" } }, "nbformat": 4, "nbformat_minor": 2 }