Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

That's two (very different) questions in one.

1) To concatenate various $\LaTeX$ (math) elements, the LatexExp function is well suited. In your case,

LatexExpr("U(x)="+latex(U))

yelds:

$$U(x)= A x^{\alpha} y^{\beta}$$.

2) "I would like to print some sentences before to display a result".

Your best bet is to write your text in $\LaTeX$, using Sagetex macros to insert relevant Sage snippets and their results.

This needs some learning ; I'd recommend reading "The not so short introduction to $\LaTeX2\epsilon$" tor deciding if $\LaTeX$ is for you. If you intend to spend more than a few weeks in your life using mathematics or writing structured texts (i. e. witth explicit outlines, cross-references and/or citations, etc..), it is probably worth it.

An alternative solution is to use Sage's Jupyter notebook. This will allow you to intersspede math or graphics "cells" between tet cells, that can receive some Markdown formatting. Markdown is much lighter than $\LaTeX$, therefore faster to learn, and might be sufficient for quick n' dirty tasks. But its possibilities are much more limited.