Installing Latex Packages in Linux

Install LaTeX packages in Linux is quite simple. Lemme say we want to install the package called booktabs. So you have to:

  • Download the .zip
  • Extract its content somewhere (for example ~/booktabs)
  • Enter in /booktabs directory, and generate the .sty file trough the command latex booktabs.ins
  • Copy the just generated file booktabs.sty to /usr/share/texmf-tetex/tex/latex/booktabs (if you are using tetex), or to /usr/share/texmf-texlive/tex/latex/booktabs (if you are using texlive). Probably you have to create the “booktabs” directory.
  • It is necessary to “tell” to LaTeX that you just installed a new package, just enter this command sudo mktexlsr in the console.
  • In your .tex file, just add \usepackage{booktabs}

and voilà.

[Versão em Português]

Advertisements

wget output conflicting options

I was trying to download some image with wget and set both a name and directory for its output. Reading the wget man page, it shows different options to deal with each one of the situations, -O to set the downloaded file’s name and -P to set its directory.

Anyway, if you try to use both one there is a kind of overwriting options. Let’s try the following example to realize this unexpected behavior, at least in my opinion:

I want to download the Google’s logo with a customized name “downloaded.gif” and also want that the output file to be take to /tmp directory. So, the following command should do the work:

wget http://www.google.com.br/intl/en/images/logo.gif -P /tmp -O downloaded.gif

What we have here is, wget (google logo) -P (the directory where I want the downloaded logo output) -O (the name of the output file). But the resulting file “downloaded.gif” goes to ‘.‘ directory. It seems that the default output directory did not change even when using the -P parameter. The parameters order does not matter, i.e., the following command does the same unwanted thing:

wget http://www.google.com.br/intl/en/images/logo.gif -O downloaded.gif -P /tmp

To solve this problem I did forget the -P parameter, and used just the -O writing together both the output directory and file name. So, the following command solved my problem:

wget http://www.google.com.br/intl/en/images/logo.gif -O /tmp/downloaded.gif

Ubuntu : Real transparence in Terminator

Hi fellows,

Following a tip to configure the terminator terminal to real transparence.

First, if you don’t know terminator take a look (it’s a useful tool!)

Once you have installed it:

sudo apt-get install terminator

You’ll see that even if you mark “real transparency” through righ click in the screen > Edit Profile > Appearence tab, it didn’t work.

So the workaround to this issue is to use transset-df tool that turn any window transparent:

Unfortunately, the transset that are found in apt is not the right one, so you should install it from the source:

wget http://forchheimer.se/transset-df/transset-df-4.tar.gz
tar -xvzf transset-df-4.tar.gz
rm transset-df-4.tar.gz
cd transset-df-4/
make
sudo make install
cd ..
rm -r transset-df-4

Once installed, create a launcher to terminator (at /usr/local/bin for instance):

sudo touch /usr/local/bin/terminator
sudo chmod +x /usr/local/bin/terminator

And paste the following commands (using vim with sudo for instance):

#!/bin/sh
exec /usr/bin/terminator $@ &
sleep 2s
transset-df --id `xprop -root |
grep "_NET_ACTIVE_WINDOW(WINDOW): window id # " |
grep -o -E -e 0x[a-z0-9]+` 0.75 &> /dev/null
exit

Now run terminator from this launcher and it should be transparent!

transparent terminator

Some useful shortcuts:

Ctrl + Shift + O: Split horizontally
Ctrl + Shift + E: Split vertically
Ctrl + Shift + P: Turn to the previous terminal view (ou Ctrl + Shift + Tab)
Ctrl + Shift + N: Turn to the next terminal view

Ctrl + Shift + W: Close the current terminal view
Ctrl + Shift + Q: Quit terminator

If the Terminator’s title-bar is showing “None” in spite of the current directory it is because your environment does not know the variable PROMPT_COMMAND. So, add the following line to your .bashrc file:

PROMPT_COMMAND=’echo -ne “33]0;${USER}@${HOSTNAME}: ${PWD/$HOME/~}07″‘

See ya

See more:

http://crunchbanglinux.org/forums/topic/1003/terminator-transparency-workaround/
https://help.ubuntu.com/community/TransparentTerminals

Instalando pacotes no LaTeX em Linux

Para os acostumados com o Miktex Package Manager e suas facilidades, vai a dica de como instalar um pacote novo no Linux, mais especificamente Ubuntu e seus derivados.

Digamos que você quer instalar o booktabs. Faça:

  • Baixe o .zip
  • Extraia o conteúdo em algum lugar (digamos ~/booktabs)
  • Entre em /booktabs e gere arquivo .sty através do comando latex booktabs.ins
  • Copie booktabs.sty gerado e coloque-o em /usr/share/texmf-tetex/tex/latex/booktabs se você estiver usando o tetex, ou em /usr/share/texmf-texlive/tex/latex/booktabs caso esteja usando o texlive. Provavelmente o diretório “booktabs” terá que ser criado.
  • Para que o tex saiba que você instalou um novo pacote faça sudo mktexlsr no terminal.
  • Em seu documento.tex é só colocar \usepackage{booktabs}

E voilà.

Reusando comandos antigos no terminal do Linux

Para evitar ficar procurando comandos antigos no history do terminal, usando a seta para cima, faça o seguinte:

  • history | grep -i “palavra chave” ou
  • Ctrl+R e digite as palavras chave, que podem estar em qualquer parte do comando.

That’s all folks.