【问题标题】:Align line numbers on jupyter notebook在 jupyter 笔记本上对齐行号
【发布时间】:2020-12-03 00:47:42
【问题描述】:
  1. 问题:行号与单元格内的代码重叠。左边有足够的空间放置数字,但我不知道如何对齐它们。 line numbers overlapping.

  2. 上下文:我更新了我的主题,使其在 jupyter 主题 !jt -t gruvboxl -f fira -fs 14 -nf ptsans -nfs 14 -N -kl -cursw 2 -cursc r -cellw 95% -T -ofs 14 -dfs 11 的帮助下更加舒适 代码以防万一。

  3. 可能的原因:折叠代码(函数、循环)的笔记本扩展+行号+字体大小随jupyter主题增加都可能相互冲突。

  4. TLDR:如何操作行号扩展来对齐左侧的数字?

【问题讨论】:

    标签: jupyter-notebook jupyter


    【解决方案1】:

    我明白了。不是 CSS 专家,所以也许我弄坏了一些东西,它会在我注射的地方回来咬我。 无论如何,我将此添加到 .jupyter\custom\custom.css:

    div.CodeMirror-linenumber.CodeMirror-gutter-elt {
        left: 10px !important;
    }
    pre.CodeMirror-line {
        left: 2px !important;
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-10-17
      • 2022-07-21
      • 2020-12-23
      • 2017-05-25
      • 1970-01-01
      • 2018-09-23
      • 2018-09-04
      • 1970-01-01
      相关资源
      最近更新 更多