Wednesday, October 17, 2012

pdflatex vs pdftex

I have a document with lot of .eps figures embedded in it. These figures were of high quality but also large size. To cut down on the size I converted them to .png which were a tenth of the .eps format. Now using
latex file.tex (with eps figures)
worked well. But to use .png figures I thought I had to use pdftex.
pdftex file.tex (with png figures)
Turns out I should have used pdflatex instead. I ended up losing quite some time on this. The switch to pdflatex did the job and gave me a file which was a tenth of the original size. More on this from here:

"pdftex expects the file to be plain TeX. pdflatex expects it to be LaTeX. These
are two different dialects of TeX. You do not expect a C compiler to work with
Java, do you?

Note that in practice pdftex and pdflatex are often the same command, which
analyzes how it was called to switch to the proper input language. On some
systems gcc behaves in the same way, compiling C if it is called as gcc or
Fortran if it is called as gfortran."

Bottom line, figures can be heavily compressed by converting them to png format w/o a large loss in clarity; and pdflatex can handle png figures. Even if there is a loss of clarity, this is usually just fine for supporting information; maybe not so much for main article.

Tuesday, October 16, 2012

Monday, October 15, 2012

Handling references using BibTex










Scientific journals with arbitrary requirements for reference styles can be a source of great heart-ache. When writing articles using Latex-BibTex, ability to handle reference styles can be useful. These articles are a great starting point to learn more about this:
http://amath.colorado.edu/documentation/LaTeX/reference/faq/bibstyles.html#styles
http://chenfuture.wordpress.com/2007/09/24/diy-your-bibtex-style-file/
http://www.math.washington.edu/tex-archive/macros/latex/contrib/custom-bib/merlin.pdf

Tuesday, October 9, 2012

Controlling axis properties in R

http://www.programmingr.com/content/controlling-margins-and-axes-oma-and-mgp/

The mgp option
In addition to changing the margin size of your charts, you may also want to change the way axes and labels are spatially arranged. One method of doing so is the mgp parameter option. The mgp setting is defined by a three item vector wherein the first value represents the distance of the axis labels or titles from the axes, the second value is the distance of the tick mark labels from the axes, and the third is the distance of the tick mark symbols from the axes. As with the oma option discussed above, the distances are given in line widths. The defaults for the mgp setting are c(3, 1, 0). The examples below illustrate the effects of changing the various mgp values. Note: the mgp.axis() function in the Hmisc package can be used to change these settings for each axis individually.

Tuesday, October 2, 2012

ImageJ Resources

http://rsbweb.nih.gov/ij/
http://www.fmhs.auckland.ac.nz/sms/biru/facilities/analysis_resources.aspx

Learning ImageJ

ImageJ is a fantastic light-weight tool to analyze and manipulate images. I needed to use it for quickly analyzing microscopy images. Here I will list features of ImageJ that I found particularly useful for my purposes:
- I took a bunch of images at various gains to find out the point where bleaching starts occurring. So I have a series of images in which the pixel intensity varies from 0 to 255.

ImageJ allows me to load the images as a stack and calculate the maximum pixel value in each image by selecting the whole image and hitting 'm' (for measure). Plotting the maximum value gives this:


So, bleaching occurs somewhere between a gain of 450 and 475.