How do I reference a cell in a IPython notebook markdown?
I know how to make a reference to an external link. But is there a way to assign an ID to a cell and then refer to the cell in the markdown?
Just add the anchor to the Markdown cell you want to refer to, and link to it using standard Markdown syntax. and the reference can be like: For more details, see [Section 1](#section_1).
You can change the cell type of any cell in Jupyter Notebook using the Toolbar. The default cell type is Code. To use the Keyboard Shortcuts, hit the esc key. After that, you can change a cell to Markdown by hitting the m key, or you can change a cell to Code by hitting the y key.
Markdown cell displays text which can be formatted using markdown language. In order to enter a text which should not be treated as code by Notebook server, it must be first converted as markdown cell either from cell menu or by using keyboard shortcut M while in command mode.
Using Jupyter Lab, and coding in r, the way to enter code blocks in a markdown cell is easy and has good and predictable results. Just follow the same steps each time. Press Esc key, type m for markdown cell, press Enter key. The cursor is now in the markdown cell waiting for instructions.
Yes, there's way to do just that in IPython.
First, define the destination in the cell you want to link with a html
anchor tag and give it an Id
. For example:
<a id='another_cell'></a>
Note - When you run the above cell in markdown, it will become invisible. You can add some text above the anchor to identify the cell.
Second, create the internal hyperlink to the destination created above using Markdown syntax in another cell and run it:
[Another Cell](#another_cell)
Now, clicking on link should take you to the destination.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With