Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I am searching a script that will do the following.

  1. Removing all old PGF/TikZ files in my local texmf tree
  2. Installation of all new PGF/TikZ in my local texmf tree of the csv repository:
    PGF and TikZ -- Graphic systems for TeX --cvs
  3. Creating the new user manual based on the new files (The csv version provides a Makefile)

I have no favourite language.

The best way would be to have script for the platforms Unix / Mac / Windows -- something like biber, whereby I use Unix.

I ask this question here because it's mostly PGF/TikZ related.

share|improve this question
    
It's PGF not pgf. Initialisms are written capitalized. For the same reason it's "a PDF file", not "a pdf file", which technically uses it as an adjective. –  Martin Scharrer May 18 '12 at 15:55
    
@MartinScharrer: Edited. –  Marco Daniel May 18 '12 at 15:57
    
Thanks Macro. Good question btw. –  Martin Scharrer May 18 '12 at 16:06
    
@MartinScharrer: I am sure I am not the first person who wants to ask this question. ;-) –  Marco Daniel May 18 '12 at 16:14
1  
Another good question would be: Why is CVS still used for PGF/TikZ? It got outdated by Subversion years ago. Also, using Mercurial or Git would be a good idea. –  Martin Scharrer May 18 '12 at 16:35

2 Answers 2

up vote 5 down vote accepted

It's not a script but the method I use with OS X it's possible with Linux

I put the version CVS in my home. You have a PGF folder

 inside /tex/generic          
 inside /tex/latex  
 inside /tex/context 
 inside /tex/plain.

Personally I use only generic and latex.

You can get without CVS the files here sourceforge and you click on Download GNU tarball. You get pgf-pgf.tar.gz, you decompress and you install manually the folders.

To remove, it's possible to remove the folders "pgf" manually. Personally I compress (.zip) the folders and then I remove the uncompressed folders. If I have a problem with the new version, I decompress the archives (.zip)

For the manual with the CVS version :

  1. I get the sources sources via CVS (in the directory ~/pgf). I proceed like this :

    cd ~
    cvs -z3 -d:pserver:anonymous@pgf.cvs.sourceforge.net:/cvsroot/pgf co -P pgf
    
  2. then for the pgfmanual with pdftex

    cd ~/pgf/doc/generic/pgf/version-for-pdftex/en
    
  3. Create the folder 'plots' if this folder doesn't exist.

    mkdir plots
    
  4. You compile a first time:

    TEXINPUTS=".:~/pgf//:" make
    
  5. then you compile several times with :

    TEXINPUTS=".:~/pgf//:" make dist
    

    (You need to see if the links are fine. makefile uses the good texmf.cnf.)

    The link colors has been disabled by one of the PGF team (probably a matter of taste): you need to write colorlinks=true in the next file pgfmanual-en-main.tex:

    remark from Christian Feuersänger

    \usepackage{hyperref}
      \hypersetup{%
      colorlinks=false, % use true to enable colors below:
      linkcolor=blue,%red,
      filecolor=blue,%magenta,
      pagecolor=blue,%red,
      urlcolor=blue,%cyan,
      citecolor=blue,
      pdfborder=0 0 0,
    }
    
  6. Now you can create pgfmathtestsuite.pdf via :

    cd ~/pgf/generic/pgf/testsuite/mathtest
    pdflatex pgfmathtestsuite.tex
    
  7. Finally you can create an archive TDS via :

    cd ~; make -f pgf/scripts/pgf/Makefile.pgf_release
    

    You get three files :

    ~/pgf_2.10-CVS.ChangeLog
    ~/pgf_2.10-CVS.pdf
    ~/pgf_2.10-CVS.tds.zip
    

Remark 1

With this method you don't have the part about the graphs. To get this section you need to use LuaLaTeX, but sometimes there are several problems. The last time, (15 days) It was not possible to get the entire manual. I get a part with pdflatex and another part with LuaLaTeX. You need to inspect the file pgfmanual-en-main.tex to see what you need to make.

Remark 2

I put on my site the version 25-04-2012 files + pgfmanual

altermundus.com

share|improve this answer

I tried to write a shell script which does the job. However to use this script you have to install CVS.

Test the file by your own risk.

#!/bin/bash
# small script to download // install the cvs version of pgf
# I hereby relicense under the GPL (version 3 or later).
# Author: Marco Daniel
# Year: 2012

################################################################
# Declare variables
################################################################
## Name settings
TEMPFOLDER=temppgftempinstall
TEMPDIR=$HOME/Desktop
## Color settings
RED=$(tput setaf 1) #  red
GREEN=$(tput setaf 2) #  blue
BLUE=$(tput setaf 4) #  blue
WHITE=$(tput setaf 7)
## Flag settings
DOCUMENTATION=false
COLORLINKS=false
HELP=false
QUIET=false
REMOVE=false


################################################################
# Options
################################################################
# Loop until we run out of arguments.
while [ "$#" -gt 0 ]
do
        case "$1" in
        -d | --documenation )
                shift
                DOCUMENTATION=true
                ;;
        -c | --colorlinks )
                shift
                COLORLINKS=true
                DOCUMENTATION=true
                ;;
        -h | --help )
                shift
                HELP=true
                ;;
        -q | --quite )
                shift
                QUIET=true
                ;;
        -r | --remove )
                shift
                REMOVE=true
                ;;
        *)
                echo "Unknown argument '$1'" >&2
                ;;
        esac
        # Delete $1 argument, set $1=$2, $2=$3, ...
        shift
done


################################################################
# Help
################################################################
if [ "$HELP" == "false" ] 
then
 :
else
  echo -e "\n${BLUE}Script to install TikZ/PGF to local texmf folder$WHITE"
  echo -e "${BLUE}Script by Marco Daniel$WHITE"
  echo -e "\n${GREEN}Option\t\tExplanation"
  echo -e "--------------------------------------------------"
  echo -e "${GREEN}-d\t\tcreate documenation"
  echo -e "${GREEN}-c\t\tuse colorlinks in documenation"
  echo -e "${GREEN}-h\t\tprint help"
  echo -e "${GREEN}-q\t\tquiet compilation"
  echo -e "${GREEN}-r\t\tremove temp folder"
  echo -e "--------------------------------------------------"
  echo -e "\n${RED}Note:\t\tThe compilation of the manual"
  echo -e "\t\ttake some time${WHITE}"
  exit 0
fi


################################################################
# Starting script
################################################################
echo -e "${BLUE}Update pgf in texmflocal$WHITE\n"

################################################################
# create temp folder and cvs-download
################################################################
## create new folder in $HOME to download the files
cd $TEMPDIR                          # go to temp dir
rm -r -f $TEMPFOLDER                 # remove older file (if exits)
mkdir $TEMPDIR/$TEMPFOLDER && cd $_  # create new folder and go to

## CVS-Settings
## login to cvs-server of pgf
echo -e "${GREEN}Password -- press return $RED"
 cvs -d:pserver:anonymous@pgf.cvs.sourceforge.net:/cvsroot/pgf login
## download developing branch
echo -e "\n${GREEN}Download pgf in $TEMPFOLDER"
 cvs -z3 -d:pserver:anonymous@pgf.cvs.sourceforge.net:/cvsroot/pgf -Q checkout -P pgf 
## remove unnecessary folders CVS
echo -e "\n${RED}remove unnecessary folders CVS"
 find * -name CVS  | xargs rm -r -f
echo -e "${GREEN}Done"




################################################################
# Provide TDS-Structure of the downloaded files
################################################################
# provide TDS-Structure
echo -e "\n${RED}create TDS structure"
cd $TEMPDIR/$TEMPFOLDER/pgf
mkdir tex
FOLDERLIST=(context generic incoming latex plain)
for i in "${FOLDERLIST[@]}"
do
   cp -a $i tex
   rm -r -f $i
done
echo -e "${GREEN}Done"


################################################################
# Go to TEXMFHOME
################################################################

echo -e "\n${RED}Your local texmf path is"
PATHTEXHOME=$(kpsewhich --var-value TEXMFHOME)
echo $GREEN$PATHTEXHOME$WHITE
## test if TEXMFHOME exists
if [ -d "$PATHTEXHOME" ]
then
 :
else
  echo -e "${RED}$PATHTEXHOME directory doesn't exist!"
  echo -e "create"
  mkdir $PATHTEXHOME
fi
cd $PATHTEXHOME


################################################################
# Remove older versions and copy the new one
################################################################
## removing
echo -e "${RED}remove older version of pgf in texmf local"
find * -name pgf  | xargs rm -r -f
echo -e "${GREEN}Done"

## install files in local texmftree
echo -e "\n${RED}Install to local texmf tree"
echo -e "${RED}Install new files"
cd $TEMPDIR/$TEMPFOLDER/pgf
cp -a tex $PATHTEXHOME
cp -a doc $PATHTEXHOME
echo -e "${GREEN}Done"



################################################################
# Documenation
################################################################

if [ "$DOCUMENTATION" == "false" ] 
then
  echo -e "\n${GREEN}Create no documenation$WHITE"
else
  echo -e "\n${RED}Create documenation -- this take a while$WHITE"
  if [ "$COLORLINKS" == "true" ] 
  then
   echo -e "\n${RED}Using colorlinks option -- replace command$WHITE"
   cd $TEMPDIR/$TEMPFOLDER/pgf/doc/generic/pgf/text-en
    sed -rie "s/(colorlinks=false)/colorlinks=true/" pgfmanual-en-main.tex
  fi
  cd $TEMPDIR/$TEMPFOLDER/pgf/doc/generic/pgf/version-for-pdftex/en
  mkdir plots
  TEXINPUTS=".:~/pgf//:" make
  TEXINPUTS=".:~/pgf//:" make dist
  TEXINPUTS=".:~/pgf//:" make dist
  TEXINPUTS=".:~/pgf//:" make dist
  cp pgfmanual.pdf $PATHTEXHOME/doc/generic/pgf/
  echo -e "\n${GREEN}DONE"
fi

################################################################
# Remove temp folder
################################################################
if [ "$REMOVE" == "true" ] 
then
  cd $TEMPDIR                          # go to temp dir
  rm -r -f $TEMPFOLDER                 # remove older file (if exits)
fi

echo -e "\n${BLUE}COMPLETE ${WHITE}"

################################################################
# End
################################################################
exit 0
################################################################
# End
################################################################
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.