Source

SageTeX / example.tex

Diff from to

example.tex

 \title{Examples of embedding Sage in \LaTeX{} with \textsf{Sage\TeX}}
 \author{Dan Drake and others}
 \usepackage{hyperref}
-\usepackage{tkz-berge}
+% If you want to see the examples in the section "Plotting
+% (combinatorial) graphs with TikZ" remove the \begin{comment}
+% and \end{comment} in that section and uncomment the following line.
+%\usepackage{tkz-berge}
+
 
 \usepackage{sagetex}
 %
 
 \begin{center} \sageplot[scale=.2]{p} \end{center}
 
-On second thought, use the default size of $3/4$ the \verb|\textwidth|
-and don't use axes:
+On second thought, use a size of $3/4$ the \verb|\textwidth| and don't
+use axes:
 
 \sageplot{p, axes=False}
 
 \href{http://www.texample.net/tikz/}{TikZ}. Here, we mean things with
 vertices and edges, not graphs of a function of one or two variables.
 
+The graphics in this section depends on the \texttt{tkz-berge} package,
+which is generally only available in newer \TeX{} distributions (for
+example, \TeX Live 2011 and newer). That package depends in turn on
+TikZ 2.0, which is also only available in newer \TeX{} distributions.
+Installing both of those is in some cases nontrivial, so this section is
+disabled by default.
+
+If you have TikZ and \texttt{tkz-berge} and friends, remove the
+\texttt{comment} environments below.
+
+\begin{comment}
+
 First define our graph:
 
 \begin{sageblock}
 
 \sageplot[scale=.5]{G4plot, axes=False}
 
+\end{comment}
+
 \subsection{3D plotting}
 
 3D plotting right now (Sage version 4.3.4) is problematic because
 
 \section{Plotting functions in Ti\emph{k}Z with Sage\TeX}
 
+(The code in this section should work with any reasonable version of
+Ti\emph{k}Z, which means it should work with all but the most terribly
+out-of-date \TeX{} installations---but to make sure we can accomodate
+everyone, the code here is commented out. You can almost certainly
+uncomment and run them. Make sure you do \verb|\usepackage{tikz}| in the
+preamble.)
+
+\begin{comment}
+
 The wonderful graphics package TikZ has the ability to plot functions by
 reading in a sequence of points from an external file---see chapter 18,
 page 193 of the TikZ manual. This facility is designed around files
 to feed TikZ a bunch of data points, and it automatically make a very
 nice plot for you, including axes, labels, and so on.
 
+\end{comment}
+
 \section{The \texttt{sagecommandline} environment}
 
 When writing a \TeX{} document about Sage, you may want to show some