Skip to content

Instantly share code, notes, and snippets.

@nunomazer
Created March 22, 2011 17:26
Show Gist options
  • Save nunomazer/881623 to your computer and use it in GitHub Desktop.
Save nunomazer/881623 to your computer and use it in GitHub Desktop.
Install a new Latex class in your Ubuntu's system
#!/bin/bash
# script para instalacao de classes Latex
# installation script of Latex class
# v.0.1 - 22/03/2011
# Ademir Mazer Jr [ Nuno ]
# http://ademir.winponta.com.br
# testa se foi informado o nome da classe
# test if the class name is informed
if [ $# -lt 1 ]; then
echo "Nenhuma classe informada!"
exit 1
else
# testa se o arquivo existe
# test if exist the arq
if [ ! -f $1 ]; then
echo "Arquivo informado nao existe!"
exit 1
fi
fi
# testa se o diretorio destino existe
# test if target dir exist
targetDir="/usr/share/texmf/tex/latex/mycls"
if [ ! -d $targetDir ]; then
# se nao existe cria
sudo mkdir $targetDir
fi
# copia a classe para o dir de destino
# copy class to target dir
sudo cp $1 $targetDir
# executa o comando que atualiza o Latex
# execute the command to refresh Latex
sudo texhash
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment