Archive for the ‘LaTeX’ Category
Install vim-template vim plugin
The vim-template plugin allows for the use of templates for different file types: *.html, *.py and so on. Following the installation instructions (see above link), we use pathogen to install the plugin:
cd ~/.vim/bundle git clone git://github.com/aperezdc/vim-template.git
Use of plugin
Now, you can make use of the templates when starting vim. For example, a python template is loaded by recognition of the *.py filename:
vim test.py
Or, if you have new buffer, type the following for the template to be loaded inside vim:
:Template py
The available templates can be seen here. Using the pathogen installation described above, these templates are located (on your machine) at ~/.vim/bundle/vim-template/templates/
.
Customization
If you want to customize certain fields, like email and username, you can add the following to your .vimrc file:
" Customize the settings for vim-template plugin let g:email = "desiredemail@gmail.com" let g:user = "Desired Name" let g:license = "Desired License"
If you want to customize the templates, there is a search order for templates (see here) allowing you to write your own template-files and store them in the local directory.
Install Tagbar vim plugin
The vim plugin Tagbar provides a listing of classes, functions, etc when coding in vim.
Tagbar requires Vim 7.0 and Exuberant ctags 5.5. We install the later in Ubuntu 12.04 with the command
sudo apt-get install exuberant-ctags
Next, install tagbar with pathogen
cd ~/.vim/bundle git clone git://github.com/majutsushi/tagbar
Toggle the code browser between visible and hidden using
:TagbarToggle
Testing with *.py and *.tex files indicate the basics are working.
pdftk on Ubunt 12.04
pdftk is a wonderful (command line) tool for manipulating pdf documents in all kinds of ways. See the list of examples at this page to get an idea of what can be done.
To install the version in the repository type
sudo apt-get install pdftk
As an example, I often like to combine many pdf plots into a single document to make viewing easier. This can be done with the command
pdftk *.pdf cat output combinedplots.pdf
This takes all pdfs in the directory and creates a single file called combinedplots.pdf — the source pdfs are not changed, only the new, merged document is created.
Install Geany 1.22 on Ubuntu 12.04
Update 2013-04-11: I recently started to have `partial upgrade’ issues with this ppa (it seems like the plugins did not build for 64bit machines). This caused update issues with other, more important parts of Ubuntu. As a result, I removed geany, geany-plugins and the ppa. I would carefully investigate before using the ppa.
In a previous post I installed Geany from the repository. A new version is available with plugins — I will install using the details described here and here for the plugins (and color schemes, if desired).
Note: I removed the repository version of Geany before the install — you only need to do this is you have already installed an earlier Geany version. The remove command with apt-get is (this removes the application while preserving the configuration files)
sudo apt-get remove geany
The following commands will add the ppa and install Geany along with the plugins:
sudo add-apt-repository ppa:geany-dev/ppa sudo apt-get update sudo apt-get install geany geany-plugins
Install JabRef
JabRef is a Java-based reference manager with an emphasis on LaTeX. Installation involves downloading the *.jar file (find a link to the most current version here).
Change permission on file to allow execution (of course, use your version of JabRef jar):
chmod u+x JabRef-2.8.1.jar
Starting JabRef from the command line is done with:
java -jar JabRef-2.8.1.jar
In practice, it is probably best to create a launcher for the application.
Install geany
Geany is a simple development environment that I use for both python and latex. This is in the repository and easy to install:
sudo apt-get install geany
Install Acrobat Reader
For many purposes the default pdf/ps viewer evince is very good. However, I find that sometimes Adobe Reader is needed. Following the instructions here, the install is accomplished by the following commands (execute each line seperately):
sudo apt-add-repository "deb http://archive.canonical.com/ $(lsb_release -sc) partner" sudo apt-get update sudo apt-get install acroread
Type acroread at the dash home to find Adobe Reader — no desktop icons will be installed. Once open, you can lock to the launcher if you like.
Install Tex Live 2012
The default LaTeX version (the one you find in the repository) for Ubuntu 12.04 LTS is Tex Live 2009. For most purposes, the Tex Live 2009 version is fine, and I would suggest using the repository version to make your life easier. However, I want to use the latest elements of pgf and pgfplots for creating graphics and plots, so I need a current Tex Live install. Previously I have done this manually, but it seems there is now an “official backport” of Tex Live 2012 —
NOTE — this all assumes that you have NOT already added the LaTeX version from the repository. If you have, you will have to do slightly different commands. Again, see here.
Using the information for the links above, we first add the ppa, then update and install (as always, enter each line separately):
sudo apt-add-repository ppa:texlive-backports/ppa sudo apt-get update sudo apt-get install texlive
Add fonts
I needed to install the fonts-extra, not found in the ppa — reflected, in may case, by LaTeX not finding bbm.sty.
sudo apt-get install texlive-fonts-extra
Adding packages
Unfortunately, this is not a full distrbution and many packages are not included. I will add details for adding specific packages here. In general, the install process is pretty simple.
pgfplots
The pgfplots website is here, and provides a download link. This provides a zip archive, in my case: pgfplots_1.6.1.tds.zip
Using ideas from the pgfplots manual, and this nice blog entry, we do the following:
- Create a directory in the LaTeX search path:
mkdir -p ~/texmf/tex/latex
- Unzip the contents of the package, downloaded above, in this directory.
- The pgfplots manual suggests that you run texhash at this point:
sudo texhash
Other packages
Adding other packages is the same as above, except there is no need to create the ~/texmf/tex/latex directory. Just find the package, place the unzipped folder in ~/texmf/tex/latex, and run sudo texhash
, as above.