On Thursday, 7 September 2017 15:22:55 UTC-6, Jorge Manrique wrote:
>
> Hello Andrey
> I did not know LatexExpr() and I would not have realized its existence in 
> years. 
> Thanks for your help
>
> Now I have problems with the web page layout:
>
>    - The text is centered instead of left justified
>    - The spaces are not taken into account
>
>
>
> <https://lh3.googleusercontent.com/-cyc4wGsrgn8/WbG0uHTmViI/AAAAAAAAEMk/jO1xJXsnDgMvR1AONdnSVl7VZ3cSk7eawCLcBGAs/s1600/Captura.JPG>
>
>
>
>
>
>
>
>
>
>
>
> As you can see in the previous code, spaces are included when I use print 
> (in green) but this is not the case when I use pretty_print (in blue)
>

Well, this is how LaTeX works - space in math mode does not matter and is 
determined automatically according to some rules, but you can use commands 
to change it. Also, if you want to mix actual text and formulas, you can 
use HTML code with formulas via 
pretty_print(html(r"Arbitrary HTML code with <h1>any tags</h1> and math 
formulas in $delimiters$ of \[different\ kind\]"))


> Any help would be appreciated,
> Joge
>
> El martes, 5 de septiembre de 2017, 22:42:19 (UTC-4), Andrey Novoseltsev 
> escribió:
>>
>> 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/4597021b-bf9e-41e8-bacc-e1daaa33518d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to