1. Dan Drake
  2. SageTeX


SageTeX / example.tex

Diff from to

File example.tex

  • Ignore whitespace
 \title{Examples of embedding Sage in \LaTeX{} with \textsf{Sage\TeX}}
 \author{Dan Drake and others}
+% 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.
 \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.
 First define our graph:
 \sageplot[scale=.5]{G4plot, axes=False}
 \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
 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.
 \section{The \texttt{sagecommandline} environment}
 When writing a \TeX{} document about Sage, you may want to show some