Hi Javier,
One of the main points of sagecommandline is to create examples with
*automatic* output, similar to doctests in modules. This is also the
reason why stuff without "sage:" or "..." in the beginning does not
show up: it is interpreted as output that should NOT be inserted into
the final r
On 26 Okt., 17:06, javier wrote:
> emph={access,and,break,class,continue,def,del,elif ,else,%
> except,exec,finally,for,from,global,if,import,in,is,%
>
> lambda,not,or,pass,print,raise,return,try,while,cached_method},
OTOH + with, local, yield
(Pe
Hi Dan,
I found a solution using listings indeed. I set up my own "sagecode"
environment by adding to my preamble the following
\usepackage{listings} % Used for code listing
\usepackage{textcomp} % Used for syntax highlighting.
\usepackage{setspace} % Used for changing linespace
% This gives syn
On Wed, 26 Oct 2011 at 02:03AM -0700, javier wrote:
> Basically what I want is to add "syntax highlight" to the code
> listing. I thought that worked out of the box with sagecommandline but
> now I realize it is only the sage prompt that gets colorized, so I
> will probably make my own environment
Hi Andrey and Dan,
thanks for the replies! I don't actually care for the "sage:" prompts,
just want to show the code.
sageblock typesets the text just fine, but id doesn't add
colorization.
Basically what I want is to add "syntax highlight" to the code
listing. I thought that worked out of the box
I think you should put "sage:" in front of all complete commands and
"..." in front of continuation lines. I was making multi-line cycles
this way. Triple quotes may conflict with the way how SageTeX produces
its files. Did you try triple single quotes? ( ' + ' + ' instead of "
+ " + ")
Andrey
O