Ask Your Question
2

Code highlighting and execution in sagetex

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

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
0

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

Is sagecommandline what you are looking for?

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

Try this (from the documentation).

\begin{sagecommandline}
  sage: 1+1
  2
  sage: factor(x^2 + 2*x + 1)
\end{sagecommandline}
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

Stats

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

Seen: 29 times

Last updated: Sep 05