Ask Your Question
0

Add a text in Latex in front of a result

asked 2019-09-19 12:31:46 -0600

Cyrille gravatar image

%display latex var('A, x, y, l, alpha, beta, R, p_x, p_y'); U= Ax^(alpha)y^(beta); show(U)

this print U. But I would like to see "U(x) = ..." in a larger font that the standard one which is too small printed on a large device. More generaly , I would like to print some sentences before to disply a result

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
1

answered 2019-09-19 14:12:45 -0600

Emmanuel Charpentier gravatar image

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.

edit flag offensive delete link more

Comments

I use BakomaTeX since 20 years and before other Latex systems. My question was only for a notebook presentation

Cyrille gravatar imageCyrille ( 2019-09-19 15:22:53 -0600 )edit

I use BakomaTeX since 20 years and before other Latex systems. My question was only for a notebook presentation

You didn't specify that in your question.My answer stands.

Since you already know $\LaTeX$, you might try to (ab)use LatexExpr to create a minipage rendering what you want. But I have trouble seeing the point...

Emmanuel Charpentier gravatar imageEmmanuel Charpentier ( 2019-09-20 03:02:25 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2019-09-19 12:31:46 -0600

Seen: 32 times

Last updated: Sep 19