I am writing descriptive ipynb file and need to give output in markdown with space, but unable to add tab space for printing structured data.
5 Answers
- Type "nbsp" to add a single space.
- Type "ensp" to add 2 spaces.
- Type "emsp" to add 4 spaces.
- Use the non-breaking space (nbsp) 4 times to insert a tab.
eg. This is an example.
I just had this problem and resorted to the following:
This is text with $\;\;\;\;\;\;$ some space inserted.
Markdown is used primarily to generate HTML, and HTML collapses white spaces by default. Use " " instead of space characters.
Type " " to add a single space.
Type "&ensp" to add 2 spaces.
Type "&emsp" to add 4 spaces.
If I understand your question then I don't think this has anything to do with Jupyter cells. For example, are you able to type a tab key into a Stackoverflow question box? Most browsers do not allow tab keys in most dialogs on most websites -- instead, tab switches to the next area.
Some options:
- cut a tab from a text application, paste into a Jupyter cell. (works)
- try using a browser-specific extension, like TabMeansTab for Chrome or Tabinta for Firefox.
See also further discussions of typing tab keys in browsers in general on SuperUser:
I'm trying to write some descriptive fancy script in my Jupyter Notebook Markdown cell but there is no answer that could help me to make it copy-pastable in my Jupyter Notebook Code cell when I run it. For example:
`def my_fancy_code():`
 <s>`n = 'some name that has a special effect'`</s>
  <s>`n = 'some name that has a special effect'`</s>
<s>`n = 'some name that has a special effect'`</s>
$\;\;\;\;\;\;$<s>`n = 'some name that has a special effect'`</s> gives me some fancy output, but after I paste it in mu Jupyter Notebook Code cell I get something like this:
def my_fancy_code():
n = 'some name that has a special effect'
n = 'some name that has a special effect' n = 'some name that has a special effect'
n = 'some name that has a special effect'Actualy, ,  , &mnsp; are substitutes for SPACE character that can't used in Python code in order to replace TABs. Also $\;\;\;\;\;\;$ won't make any copyable spaces at all. The best solution I found is to use this way:
<code> </code>Or you can simply use just <code> </code> with 4 spaces inside.
It makes a perfect gap of 4 spaces length which can be copied in Python scripts instead of TAB characters.