Wednesday, September 28, 2011

pdf eps conversion and cropping

pdf -> eps: pdftops -eps input
crop eps: epstool --copy -b input output
eps -> pdf: epstopdf input --outfile=output

compiling python: pdflatex -escape-shell input

VIM tips

* spelling
:setlocal spell spelllang=en_us / :set nospell
]s move to next misspelled word, [s move to prev. misspelled word
z= suggests correctly spelled words under cursor,
1z= takes the first word from the suggestion list
^Xs does the same in insert mode.
:spellr repeats replacements done with z= for all matches

For more info about spellchecking in vim ->:h spell

* save all open buffers (and quit)
:wa " write (save) any changed files and keep working
:xa " write any changed files and exit

* double click open into vim in a terminal
/usr/bin/gnome-terminal -x /usr/bin/vim

* default tabstop in vim (in vimrc file)
set tabstop=4 softtabstop=4 shiftwidth=4 noexpandtab

* install plugin (in vimrc file)
filetype plugin on
source /usr/share/vim/addons/plugin/(plugin).vim
...
my file:
source /usr/share/vim/addons/plugin/cscope_macros.vim
source /usr/share/vim/addons/plugin/taglist.vim
source /usr/share/vim/addons/plugin/NERD_tree.vim
source /usr/share/vim/addons/plugin/exec_menuitem.vim
source /usr/share/vim/addons/plugin/fs_menu.vim
...

* global copy paste: "+y --> "+p (in vim) / ctrl-v (across any application)

* view filename: ctrl-g

Tuesday, September 27, 2011

install latex addon and packages in ubuntu

install addon:
make directory 'mypkgs' in /ur/share/texmf/tex/ or /usr/share/texmf/latex
copy the .sty file into mypkgs
run 'texhash'

drawing addons: 1. pgf/tikz, 2. pstricks, 3. Animate

needed packages in ubuntu:
1. use synaptic to install anything related to texlive, do a texhash
2. subfiles package
download from here
then: latex subfiles.ins
latex subfiles.dtx
3. same goes with algorithms package:
download from here