<document source="with_glue">
    <section ids="glue-tests" names="glue\ tests">
        <title>
            Glue Tests
        <container cell_index="1" cell_metadata="{}" classes="cell" exec_count="1" nb_element="cell_code">
            <container classes="cell_input" nb_element="cell_code_source">
                <literal_block language="ipython3" linenos="False" xml:space="preserve">
                    from myst_nb import glue
        <container cell_index="2" cell_metadata="{}" classes="cell" exec_count="2" nb_element="cell_code">
            <container classes="cell_input" nb_element="cell_code_source">
                <literal_block language="ipython3" linenos="False" xml:space="preserve">
                    glue("key_text1", "text1")
                    glue("key_float", 3.14159)
            <container classes="cell_output" nb_element="cell_code_output">
                <literal_block classes="output text_plain" language="myst-ansi" linenos="False" xml:space="preserve">
                    'text1'
                <literal_block classes="output text_plain" language="myst-ansi" linenos="False" xml:space="preserve">
                    3.14159
        <container cell_index="3" cell_metadata="{}" classes="cell" exec_count="3" nb_element="cell_code">
            <container classes="cell_input" nb_element="cell_code_source">
                <literal_block language="ipython3" linenos="False" xml:space="preserve">
                    glue("key_undisplayed", "undisplayed", display=False)
        <container cell_index="4" cell_metadata="{'scrolled': True}" classes="cell" exec_count="4" nb_element="cell_code">
            <container classes="cell_input" nb_element="cell_code_source">
                <literal_block language="ipython3" linenos="False" xml:space="preserve">
                    import pandas as pd
                    
                    df = pd.DataFrame({"header": [1, 2, 3]})
                    glue("key_df", df)
            <container classes="cell_output" nb_element="cell_code_output">
                <raw classes="output text_html" format="html" xml:space="preserve">
                    <div>
                    <style scoped>
                        .dataframe tbody tr th:only-of-type {
                            vertical-align: middle;
                        }
                    
                        .dataframe tbody tr th {
                            vertical-align: top;
                        }
                    
                        .dataframe thead th {
                            text-align: right;
                        }
                    </style>
                    <table border="1" class="dataframe">
                      <thead>
                        <tr style="text-align: right;">
                          <th></th>
                          <th>header</th>
                        </tr>
                      </thead>
                      <tbody>
                        <tr>
                          <th>0</th>
                          <td>1</td>
                        </tr>
                        <tr>
                          <th>1</th>
                          <td>2</td>
                        </tr>
                        <tr>
                          <th>2</th>
                          <td>3</td>
                        </tr>
                      </tbody>
                    </table>
                    </div>
        <container cell_index="5" cell_metadata="{}" classes="cell" exec_count="5" nb_element="cell_code">
            <container classes="cell_input" nb_element="cell_code_source">
                <literal_block language="ipython3" linenos="False" xml:space="preserve">
                    import matplotlib.pyplot as plt
                    
                    plt.plot([1, 2, 3])
                    glue("key_plt", plt.gcf(), display=False)
            <container classes="cell_output" nb_element="cell_code_output">
                <image candidates="{'*': '_build/jupyter_execute/8b394c6cdc09dc10c73e2d5f785aedc8eee615a4d219218f09d6732f7f8ef150.png'}" uri="_build/jupyter_execute/8b394c6cdc09dc10c73e2d5f785aedc8eee615a4d219218f09d6732f7f8ef150.png">
        <section ids="referencing-the-figs" names="referencing\ the\ figs">
            <title>
                Referencing the figs
            <paragraph>
                <inline classes="output text_plain">
                    ‘text1’
                , 
                <image candidates="{'*': '_build/jupyter_execute/8b394c6cdc09dc10c73e2d5f785aedc8eee615a4d219218f09d6732f7f8ef150.png'}" uri="_build/jupyter_execute/8b394c6cdc09dc10c73e2d5f785aedc8eee615a4d219218f09d6732f7f8ef150.png">
            <raw classes="output text_html" format="html" xml:space="preserve">
                <div>
                <style scoped>
                    .dataframe tbody tr th:only-of-type {
                        vertical-align: middle;
                    }
                
                    .dataframe tbody tr th {
                        vertical-align: top;
                    }
                
                    .dataframe thead th {
                        text-align: right;
                    }
                </style>
                <table border="1" class="dataframe">
                  <thead>
                    <tr style="text-align: right;">
                      <th></th>
                      <th>header</th>
                    </tr>
                  </thead>
                  <tbody>
                    <tr>
                      <th>0</th>
                      <td>1</td>
                    </tr>
                    <tr>
                      <th>1</th>
                      <td>2</td>
                    </tr>
                    <tr>
                      <th>2</th>
                      <td>3</td>
                    </tr>
                  </tbody>
                </table>
                </div>
            <paragraph>
                and 
                <inline classes="pasted-text">
                    text1
                 inline…
            <paragraph>
                and formatted 
                <inline classes="pasted-text">
                    3.14
            <image candidates="{'*': '_build/jupyter_execute/8b394c6cdc09dc10c73e2d5f785aedc8eee615a4d219218f09d6732f7f8ef150.png'}" uri="_build/jupyter_execute/8b394c6cdc09dc10c73e2d5f785aedc8eee615a4d219218f09d6732f7f8ef150.png">
            <paragraph>
                and 
                <inline classes="pasted-text">
                    undisplayed
                 inline…
            <figure ids="abc" names="abc">
                <image candidates="{'*': '_build/jupyter_execute/8b394c6cdc09dc10c73e2d5f785aedc8eee615a4d219218f09d6732f7f8ef150.png'}" uri="_build/jupyter_execute/8b394c6cdc09dc10c73e2d5f785aedc8eee615a4d219218f09d6732f7f8ef150.png">
                <caption>
                    A caption….
                    
                    ```## A test title 
                    <inline classes="output text_plain">
                        ‘text1’
        <section ids="math" names="math">
            <title>
                Math
            <container cell_index="8" cell_metadata="{}" classes="cell" exec_count="6" nb_element="cell_code">
                <container classes="cell_input" nb_element="cell_code_source">
                    <literal_block language="ipython3" linenos="False" xml:space="preserve">
                        import sympy as sym
                        
                        f = sym.Function("f")
                        y = sym.Function("y")
                        n = sym.symbols(r"\alpha")
                        f = y(n) - 2 * y(n - 1 / sym.pi) - 5 * y(n - 2)
                        glue("sym_eq", sym.rsolve(f, y(n), [1, 4]))
                <container classes="cell_output" nb_element="cell_code_output">
                    <math_block classes="output text_latex" nowrap="False" number="True" xml:space="preserve">
                        \displaystyle \left(\sqrt{5} i\right)^{\alpha} \left(\frac{1}{2} - \frac{2 \sqrt{5} i}{5}\right) + \left(- \sqrt{5} i\right)^{\alpha} \left(\frac{1}{2} + \frac{2 \sqrt{5} i}{5}\right)
            <target refid="equation-eq-sym">
            <math_block classes="pasted-math" docname="with_glue" ids="equation-eq-sym" label="eq-sym" nowrap="False" number="1" xml:space="preserve">
                \displaystyle \left(\sqrt{5} i\right)^{\alpha} \left(\frac{1}{2} - \frac{2 \sqrt{5} i}{5}\right) + \left(- \sqrt{5} i\right)^{\alpha} \left(\frac{1}{2} + \frac{2 \sqrt{5} i}{5}\right)
