Miscellaneous things

I am Linux user !! More precisely, I’m working mainly under Ubuntu since my PhD thesis.

Usefull commands

  • Convert a dvi to a pdf compliant with most of the IEEE conference’s format
    Those command lines permits to embed the fonts on the pdf file and to set a USletter format

    $dvips -t letter papier.dvi
    $ps2pdf14 -dEmbedAllFonts=true -dSubsetFonts=true papier.ps papier.pdf
  • Start XFig with LatexFonts enabled
     $xfig -specialtext -latexfonts -startlatexFont default
  • Delete folders with a given name (.svn for instance) recursively
     $find . -name ".svn" -type d -exec rm -rf {} \;
  • Modifying PDF properties
    You can use the toolkit pdftk (available on repositories), a Swiss army knife for PDF…
    1) Get the properties

    $pdftk myfile.pdf dump_data output properties.txt

    2) Modify the file properties.txt

    3) Create the new pdf with those properties

    $pdftk myfile.pdf update_info properties.txt output myfilewithgoodprop.pdf

    pdftk provides other many usefull tools to merge pdf, extract some pages …etc (refer to http://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/)

  • Convert the format for images on the flyThe following bash script can be used:
    #!/bin/sh
    for i in *.pgm;do
    convert -quality 100 $i ${i%.pgm}.jpg;
    done

    This script requires ImageMagick package. It will convert all .pgm files into .jpg files (with a full quality), with the same name (51-69.pgm => 51-69.jpg)