On Tuesday, 5 September 2017 18:49:41 UTC-6, Jorge Manrique wrote:
>
> I have another question:
> I want to print something like this
>
> <https://lh3.googleusercontent.com/-6xCLK4wXPXo/Wa8_5ppb4BI/AAAAAAAAEMI/xiOqJM9S8KQ66HfDw1teN6eWKStTde0MgCLcBGAs/s1600/Captura1.JPG>
> As it can be noticed the size of the parenthesis in relation to the text
> is asymmetric
> I wish it looks like this:
>
>
> <https://lh3.googleusercontent.com/-ZrgIaQtUvak/Wa9CWNRBvfI/AAAAAAAAEMU/fWzS-5zd6U4fADe4D4EQhBX-4rkxs3MLQCLcBGAs/s1600/Captura.JPG>
>
>
>
>
>
>
> I have thought to use latex () but I do not know how to deal with the
> right parentesis in f () so it is not confused with the right parentesis of
> the pretty_print
> I searched for some escape sequence but I have not found any
>
You have to build a complete LaTeX expression and then display it as a
single entity, for example
x0 = 2/3
f(x) = x + 1
pretty_print("f(", x0, ")=", f(x0))
latex_code = r"f\left({}\right) = {}" # r in front to avoid escaping \ and
{} are places for expressions
expressions = [x0, f(x0)]
pretty_print(LatexExpr(latex_code.format(*map(latex, expressions))))
--
You received this message because you are subscribed to the Google Groups
"sage-cell" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/sage-cell/b08c8e61-6f5d-4d6f-990e-4e61d49e2220%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.