Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

You may use something like this:

var('A, x, y, alpha, beta')
U = A*x^(alpha)*y^(beta)
text = fr"""
<h3>This is a title</h3>
<p>This is some text explaining several
interesting things. <strong>HTML</strong> can be used
to format these lines.</p>
<p>Now we write an inline mathematical expression
$U(x,y)={latex(U)}$, as well as a displayed one:
$$\frac{{\partial U^2}}{{\partial x \partial y}}(x,y)=
  {latex(diff(U,x,y))}$$
"""
show(html(text))

The result is similar to:


This is a title

This is some text explaining several interesting things. HTML can be used to format these lines.

Now we write an inline mathematical expression $U(x,y)=A x^{\alpha} y^{\beta}$ as well as a displayed one: $$\frac{{\partial U^2}}{{\partial x \partial y}}(x,y)=A \alpha \beta x^{\alpha - 1} y^{\beta - 1}$$


You may use something like this:

var('A, x, y, alpha, beta')
U = A*x^(alpha)*y^(beta)
text = fr"""
<h3>This is a title</h3>
<p>This is some text explaining several
interesting things. <strong>HTML</strong> can be used
to format these lines.</p>
<p>Now we write an inline mathematical expression
$U(x,y)={latex(U)}$, as well as a displayed one:
$$\frac{{\partial U^2}}{{\partial x \partial y}}(x,y)=
  {latex(diff(U,x,y))}$$
"""
show(html(text))

The result is similar to:


This is a title

This is some text explaining several interesting things. HTML can be used to format these lines.

Now we write an inline mathematical expression $U(x,y)=A x^{\alpha} y^{\beta}$ as well as a displayed one: $$\frac{{\partial U^2}}{{\partial x \partial y}}(x,y)=A \alpha \beta x^{\alpha - 1} y^{\beta - 1}$$1}$$


You may use something like this:

var('A, x, y, alpha, beta')
U = A*x^(alpha)*y^(beta)
text = fr"""
<h3>This is a title</h3>
<p>This is some text explaining several
interesting things. <strong>HTML</strong> can be used
to format these lines.</p>
<p>Now we write an inline mathematical expression
$U(x,y)={latex(U)}$, as well as a displayed one:
$$\frac{{\partial U^2}}{{\partial x \partial y}}(x,y)=
  {latex(diff(U,x,y))}$$
{latex(diff(U,x,y))}$$</p>
"""
show(html(text))

The result is similar to:


This is a title

This is some text explaining several interesting things. HTML can be used to format these lines.

Now we write an inline mathematical expression $U(x,y)=A x^{\alpha} y^{\beta}$ as well as a displayed one: $$\frac{{\partial U^2}}{{\partial x \partial y}}(x,y)=A \alpha \beta x^{\alpha - 1} y^{\beta - 1}$$


You may use something like this:

var('A, x, y, alpha, beta')
U = A*x^(alpha)*y^(beta)
text = fr"""
<h3>This is a title</h3>
<p>This is some text explaining several
interesting things. <strong>HTML</strong> can be used
to format these lines.</p>
<p>Now we write an inline mathematical expression
$U(x,y)={latex(U)}$, as well as a displayed one:
$$\frac{{\partial U^2}}{{\partial $$\frac{{\partial^2 U}}{{\partial x \partial y}}(x,y)=
  {latex(diff(U,x,y))}$$</p>
"""
show(html(text))

The result is similar to:


This is a title

This is some text explaining several interesting things. HTML can be used to format these lines.

Now we write an inline mathematical expression $U(x,y)=A x^{\alpha} y^{\beta}$ as well as a displayed one: $$\frac{{\partial U^2}}{{\partial $$\frac{{\partial^2 U}}{{\partial x \partial y}}(x,y)=A \alpha \beta x^{\alpha - 1} y^{\beta - 1}$$