Skip to main content
Chemistry LibreTexts

4.2: Jupyter Notebooks (Executable Programming Code & Figures)

  • Page ID
  • The Jupyter notebook system is a powerful aspect to the LibreTexts platform. The Jupyter Notebook is an open-source web application that allows you to create and share documents that contain live code, equations, visualizations and narrative text. Uses include: data cleaning and transformation, numerical simulation, statistical modeling, data visualization, machine learning, and much more.


    Figure \(\PageIndex{1}\): Python code used for making an interactive figure in the LibreTexts platform (

    Juptter code can be embedded in four steps:

    Step 1: Set Meta-Tag

    Flip the "Embed Jupyter" meta tag on the page under page settings. You need to select which code you want active on this page. Only one language per page for now.


    Figure \(\PageIndex{2}\):

    Step 2: Insert Jupyter Template

    You need to add the Jupyter template. You do this by selecting the Template section under "Elements" on the editing toolbar


    Figure \(\PageIndex{3}\):

    Then select "EmbedJupyter" template.


    Figure \(\PageIndex{4}\):

    The template box will be added.


    Figure \(\PageIndex{5}\):

    Step 3: Write Code

    Click on the "+" in upper left corner of the red DekiScriipt box to be able to insert python (or any other language) code.


    Figure \(\PageIndex{6}\):

    Step 4: Save and Execute

    You can execute the code. Via the green "run" button


    Figure \(\PageIndex{7}\):