[Tex/LaTex] How to install memoir package from ctan

ctanmemoir

How do I download the memoir package from this page? http://www.ctan.org/tex-archive/macros/latex/contrib/memoir/

I can see the directory tex-archive/macros/latex/contrib/memoir/ but i'm not sure how to access it. Do I use ftp from the command line terminal? I was expecting to see a .zip file on the page. I am new to CTAN. Running OS X 10.8.4 MacTeX.

Best Answer

As a patch you can use the following script:

#!/bin/sh

#me he ayudado de http://tex.stackexchange.com/questions/30307/how-to-install-latex-zip-package-from-ctan-using-texhash-on-a-nix-system
#listado de archivos tds disponibles: http://www.ctan.org/tex-archive/install/macros/latex/contrib

DIR_TEX=$(kpsewhich --expand-var '$TEXMFMAIN') #Devuelve el directorio donde TeX está instalado, en mi caso /usr/share/texmf
PAQUETE="memoir"
if [ $PAQUETE = "oberdiek" -o $PAQUETE = "environ" -o $PAQUETE = "footmisc" -o $PAQUETE = "hyperref" -o $PAQUETE = "titlesec" -o $PAQUETE = "tocloft" -o $PAQUETE = "enumitem" -o $PAQUETE = "fmtcount" -o $PAQUETE = "glossaries" -o $PAQUETE = "datatool"  -o $PAQUETE = "caption" -o $PAQUETE = "babel" -o "memoir" ] ; then #algunos paquetes están en /usr/share/texmf-texlive
    DIR_TEX=$(kpsewhich --expand-var '$TEXMFDIST')
    #DIR_TEX="$DIR_TEX-texlive"
fi 

if [ ! -f "$PAQUETE.tds.zip" ] ; then
    if [ $PAQUETE = "babel" ] ; then
        wget http://www.ctan.org/tex-archive/macros/latex/contrib/latex-tds/$PAQUETE.tds.zip
    else
        wget http://mirrors.ctan.org/install/macros/latex/contrib/$PAQUETE.tds.zip
    fi
fi

unzip -o $PAQUETE.tds.zip -d $DIR_TEX
test -e $DIR_TEX/ls-R && texhash $DIR_TEX

#echo $DIR_TEX

This was done to be used with GNU/Linux, but probably with some minor fixes (like getting wget) will work in Mac. It can be used to update and install other packages as well.

Unfortunately whether to install in TEXMFMAIN or TEXMFDIST is not automatical, although most of them, like the one you want, goes in TEXMFDIST.

That's why I would recommend you to find a proper updater with your distribution that does things automatically.