如何更改降价单元 ipython/jupyter notebook 中的颜色? [英] How to change color in markdown cells ipython/jupyter notebook?

查看:32
本文介绍了如何更改降价单元 ipython/jupyter notebook 中的颜色?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只想格式化单元格中的特定字符串.我将该单元格的格式更改为Markdown",但我不确定如何更改单个单词的文本颜色.

I'm only looking to format a specific string within a cell. I change that cell's format to "Markdown" but I'm not sure how to change text color of a single word.

我不想改变整个笔记本的外观(通过 CSS 文件).

I don't want to change the look of the whole notebook (via a CSS file).

推荐答案

您可以简单地使用原始 html 标签,例如

You can simply use raw html tags like

foo <font color='red'>bar</font> foo

请注意,将笔记本电脑转换为乳胶后,这将无法继续使用.

Be aware that this will not survive a conversion of the notebook to latex.

因为有人抱怨提议的解决方案被弃用.它们是完全有效的,Scott 已经用更新的方式回答了这个问题,即基于 CSS 的方法.尽管如此,这个答案还是展示了一些在 IPython 中使用 html 标签来设置超出可用纯 Markdown 功能之外的 Markdown 单元格内容样式的通用方法.

As there are some complaints about the deprecation of the proposed solution. They are totally valid and Scott has already answered the question with a more recent, i.e. CSS based approach. Nevertheless, this answer shows some general approach to use html tags within IPython to style markdown cell content beyond the available pure markdown capabilities.

这篇关于如何更改降价单元 ipython/jupyter notebook 中的颜色?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆