Ask Your Question

Code highlighting and execution in sagetex

asked 2017-09-05 07:44:22 -0500

Is there a version of \begin{sageblock} my multiline code \end{sageblock} that has code highlighting and line numbering like the sagecommandline environment and code execution?

Of course typesetting with lstlistings and execution with sagesilent could be a workaround, but it would seem to require me to have the same code in my document twice. And that I find unacceptable.

edit retag flag offensive close merge delete

1 answer

Sort by » oldest newest most voted

answered 2017-09-05 20:54:41 -0500

slelievre gravatar image

Is sagecommandline what you are looking for?

I found it by searching the sagetex github repo for "highlighting":

Try this (from the documentation).

  sage: 1+1
  sage: factor(x^2 + 2*x + 1)
edit flag offensive delete link more

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


Asked: 2017-09-05 07:44:22 -0500

Seen: 34 times

Last updated: Sep 05 '17