[IPython-User] Printing a string and latex together in a notebook

Matthias BUSSONNIER bussonniermatthias@gmail....
Mon Nov 19 01:46:21 CST 2012


> I mean, objects can define their own rich printing types in the notebook.  Latex() renders LaTeX because it's output type is LaTeX.  I am suggesting to create Markdown(), whose output type is markdown rendered text (if one does not already exist).

I understand better now. 
This could be a good project for json plugin.

> And we are also working on having the ability to do
> 
> the value of x is ::x::
> in a markdown cell,
> where ::x:: will be replace by the actual repr of x in the kernel.
> Still thinking on the best syntax and how to choose between tex/html/.../ repr.
> --
> Matthias
> 
> That would also work, though obviously for non-trivial string manipulations, it would be better to do it directly in code (for example, appending "s" to the end of a word iff a certain variable is greater than 1).

Good point.

> Also, would this allow arbitrary code to be executed, or just variable names?

To make it work with any code could be done easily.
Though I would like to avoid side effect, and nothing prevent you from precomputing part of the string in the previous code-cell.
-- 
Matthias


More information about the IPython-User mailing list