Dan Drake  committed 5a1e5e0


  • Participants
  • Parent commits 3193b70
  • Branches main

Comments (0)

Files changed (7)
+include example.pdf
+include example.tex
+include sagetexpackage.dtx
+include sagetexpackage.ins
+include sagetexpackage.pdf
+include sagetex.sty
+include README.spkg
+include spkg-install
+# the subdir stuff makes the tarball have the directory correct
+srcs=../sagetex/example.tex ../sagetex/README ../sagetex/sagetexpackage.dtx ../sagetex/sagetexpackage.ins
 all: ins
 	latex $(pkg).dtx
 	latexcleanup clean .
-	rm -fr sage-plots-for-* E2.sobj *.pyc sagetex.tar.gz sagetex.pyc sagetex.sty
+	rm -fr sage-plots-for-* E2.sobj *.pyc sagetex.tar.gz sagetex.pyc sagetex.sty dist MANIFEST
 	cp $(dest)
 	    -e 's|directory with|$(dest)|'\
 		-e '50,55 s/\\fi//' sagetex.sty > $(dest)/sagetex.sty
-dist: all
+# make a tarball suitable for CTAN uploads, or for someone who knows how
+# to handle .dtx files
+ctandist: all
 	@echo Did you turn off Imagemagick in example.tex?
-	@tar zcf sagetex.tar.gz ../sagetex/example.pdf ../sagetex/example.tex ../sagetex/README ../sagetex/sagetexpackage.dtx ../sagetex/sagetexpackage.ins ../sagetex/sagetexpackage.pdf
+	tar zcf sagetex.tar.gz $(srcs) ../sagetex/example.pdf ../sagetex/sagetexpackage.pdf
+# make a spkg for Sage
+	python sdist
+	cd dist
+	gunzip dist/sagetex-$(ver).tar.gz
+	bzip2 dist/sagetex-$(ver).tar
+	cp dist/sagetex-$(ver).tar.bz2 dist/sagetex-$(ver).spkg
+This is the SageTeX package. It allows you to embed code, results of
+computations, and plots from the Sage mathematics software suite
+( into LaTeX documents.
+If you're reading this, you already have Sage, so if you also have TeX
+installed, you are ready to use SageTeX!
+To install SageTeX, you need only make the necessary files available to
+TeX; Sage already has the necessary bits built in. The easiest thing to
+do is copy this directory to a texmf directory in your home directory;
+something like this for Linux/Unix users:
+  cp -r $SAGE_ROOT/local/share/texmf/ $HOME/texmf/
+For OS X users with TeXLive:
+  cp -r $SAGE_ROOT/local/share/texmf/ $HOME/Library/texmf/
+I don't use Windows, so I don't know what MiKTeX users should do. Let me
+know and I'll add it here!
+After you've copied over the necessary files, you'll need to update
+TeX's database so that it can find them. Run "texhash $HOME/texmf"
+(replace the texmf directory as appropriate) to do this.
+Now check out the PDF files in this directory for more information on
+using SageTeX. If you have problems or suggestions see the sage-support
+group (
+Dan Drake
-* should I switch over entirely to the Sweave strategy, where we parse a
-  file into LaTeX format?
-* hyperlinks in documentation between LaTeX and Python functions that
-  are interdependent
 * What about graphs and TikZ?
 * desagetexparser -- leave Sage commands in as comments? document usage!
 * UPDATE v2.0 date in .dtx file when it's ready!
-* Jason's suggestions from September
+* finish spkg-ification; don't include CTAN readme, make up a
+  README.spkg
+from distutils.core import setup
+      description='Embed Sage code and plots into LaTeX',
+      long_description="""The SageTeX package allows you to embed code,
+  results of computations, and plots from the Sage mathematics
+  software suite ( into LaTeX documents.""",
+      version='2.0',
+      author='Dan Drake',
+      author_email='',
+      url='',
+      license='GPLv2+',
+      py_modules=['sagetex'],
+      data_files = [('share/texmf/tex/generic/sagetex',
+        ['example.pdf',
+         'example.tex',
+         '',
+         '',
+         'sagetexpackage.dtx',
+         'sagetexpackage.ins',
+         'sagetexpackage.pdf',
+         '',
+         'sagetex.sty',
+         'README.spkg'])])

File spkg-install

+#!/usr/bin/env bash
+if [ "$SAGE_LOCAL" = "" ]; then
+   echo "SAGE_LOCAL undefined ... exiting";
+   echo "Maybe run 'sage -sh'?"
+   exit 1
+python install
+if [ $? -ne 0 ]; then
+   echo "Error installing SageTeX."
+   exit 1