14

I'd like a simple way to hide all the cell tags in my notebook, that is, things of the form In[..] and Out[..].

enter image description here

The reason being that they up a lot of the margin and are not useful to me (also they make the git history messy)!

Of course, I would like to keep line numbering within each code cell, so I have set 'lineNumbers':true in my config:

enter image description here

Is there another field I can use to set this, like 'in_out_prompts':false? Perhaps from some other extension? It would be great to at the very least remove the numbers inside the In and Out tag brackets.

Related:

1 Answer 1

10
+50

Jupyter lab doesn't follow the custom css that IPython/Jupyter used to. So the previous approaches may not work. But you can still customize the themes.

Based on how and where you install jupyter there will be themes folder

So in my case it was at below path

~/.virtualenvs/jlab/share/jupyter/lab/themes/@jupyterlab/theme-dark-extension/fonts.css

in this file I just added

.jp-InputArea-prompt {
   display: none;
}

And got the desired result

No execution

Edit-1: 11 Apr 2018

As per feedback from OP, doing this disables drag and drop. This is because the drag is controlled by the margin that we have hidden. So to fix the same we need few things

  • Hide the text but not element
  • Lower the width so drag can work

For the same you can use below css

.jp-InputArea-prompt {
     flex: none;
     width: 10px;
     text-indent: 100%;
 }
1
  • This works but as a consequence, I can no longer move cells by dragging them. Is there any there any way to still allow for drag and drop reordering?
    – M.R.
    Apr 11, 2018 at 17:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.