Can I use variables on an IPython notebook markup cell?

前端 未结 4 1111
野的像风
野的像风 2020-12-05 01:43

I have an IPython notebook and I would like to use one of my variables inside a markup cell. Is this even possible? If so, how do you do it?

4条回答
  •  天命终不由人
    2020-12-05 02:14

    If you don't mind a code cell that does the job, there is a possibility without adding any extensions.

    from IPython.display import Markdown as md
    
    fr=2 #GHz
    
    md("$f_r = %i$ GHz"%(fr))
    

    This will show a markdown cell in a nicely LaTeX formatted output

提交回复
热议问题