\draw[smooth, red] plot file {example-tikz2.table};

+\section{The \texttt{sagecommandline} environment}

+When writing a \TeX{} document about Sage, you may want to show some

+examples of commands and their output. But naturally, you are lazy and

+don't want to cut and paste the output into your document. ``Why should

+I have to do anything? Why can't Sage and \TeX{} cooperate and do it for

+me?'' you may cry. Well, they \emph{can} cooperate:

+Note that the output of the commands is not included in the source file,

+but are included in the typeset output.

+Because of the way the environment is implemented, not everything is

+exactly like using Sage in a terminal: the two commands below would

+produce some output, but don't here:

+ sage: x = 2010; len(x.divisors())

+ sage: print 'Hola, mundo!'

+The difference lies in the Python distinction between statements and

+One nice thing is that you can set labels by using an @ sign:

+ sage: l = matrix([[1,0,0],[3/5,1,0],[-2/5,-2,1]])

+ sage: d = diagonal_matrix([15, -1, 4]) #@\label{diagonal}

+ sage: u = matrix([[1,0,1/3],[0,1,2],[0,0,1]])

+ sage: l*d*u # this is a comment

+And then refer to that label: it was on line \ref{diagonal}, which is on

+page \pageref{diagonal}.

+You can also typeset the output:

+\renewcommand{\sagecommandlinetextoutput}{False}

+ sage: (1-cos(x)^2).trig_simplify()

+\renewcommand{\sagecommandlinetextoutput}{True}

+The Sage input and output is typeset using the \texttt{listings} package

+with the styles \texttt{SageInput} and \texttt{SageOutput},

+respectively. If you don't like the defaults you can change them. It is

+recommended to derive from \texttt{DefaultSageInput} and

+\texttt{DefaultSageOutput}, for example\ldots

+\lstdefinestyle{SageInput}{style=DefaultSageInput,basicstyle={\color{red}}}

+\lstdefinestyle{SageOutput}{style=DefaultSageOutput,basicstyle={\color{green}}}

+makes things overly colorful:

+\lstdefinestyle{SageInput}{style=DefaultSageInput}

+\lstdefinestyle{SageOutput}{style=DefaultSageOutput}