Jump to content

  • Log in with Facebook Log in with Twitter Log in with Windows Live Log In with Google      Sign In   
  • Create Account

Submit your paper to J Biol Methods today!

- - - - -

LaTeX and a biological thesis

Posted by bob1, 12 February 2014 · 13,284 views

Some of you may know already that I am in the throes of a PhD, and since I like to learn new things I thought I would try to write my thesis in the LaTeX typesetting system (pronounced la-tech, as the "X" is actually a greek chi symbol), rather than Word.  My reasons for this are many, and I don't want to cover them too much here (comment and ask and I may go into them further), but the main one is the beauty and versatility of the documents produced (native output is PDF or dvi).  It is a "What you see is what you mean" typesetting system, so you just type and it does the work, rather than systems like word (what you see is what you get), where you need to tell it where to place everything, and it doesn't handle non standard spacings well (try adding superscripts or greek letters to your word file and see what I mean)
Now, don't get me wrong, LaTeX has its drawbacks too; it is time consuming to start with, has a steep learning curve, and can be frustratingly full of errors when typesetting, but the output is really really beautiful.
My university doesn't have an official LaTeX package, but our computer science department does, so I adapted that one to suit me, and there are quite a few online that can be similarly adapted to suit your needs.
Here's a list of the packages that I am currently using and some comments (after "%%) I have added to  explain usage I am sure I will add a few more as I reach situations where I need specific things:
\usepackage{times}              %% Times PostScript font. Don't use
				  %% if thesis contains lots of math.
\usepackage{textcomp}%%text companion fonts (I don't know, it came with the premade .sty)
\usepackage[nomain,nonumberlist,nopostdot,acronym]{glossaries} %%glossaries Duh...
\usepackage{epigraph} %%for epigraphs
\usepackage{upgreek}%% greek symbols in math mode
\usepackage[version=3]{mhchem} %% chemical formulae use format \ce{}
\usepackage[font=small,labelfont=bf,format=hang,textformat=period,position=top]{caption}  %%Captions 
\usepackage{mathabx} %% diameter symbol etc.
\usepackage[T1]{fontenc}%% for glyphs such as umlaut.
\usepackage{verbatim} %%for quotes, code etc., that you want kept as is.
\usepackage{tabu,booktabs,rotating}%% table environment
\usepackage{siunitx}%%SI units
\usepackage{fixltx2e}  %%patch for latex
\usepackage{MnSymbol} %%font family for diameter and a few others
\usepackage{seqsplit} %%wrap long sequences in tables
\usepackage{xfrac} %%display fractions correctly in text
\usepackage{texshade} %%DNA and protein alignments colouring
\usepackage{enumitem}  %% list environments
\usepackage[super]{nth} %% for 1st, 2nd etc. use \nth{<number>}
\usepackage{graphicx}             %% jpg, gif, tiff, and pdf graphics
\usepackage[caption=false]{subfig} %%figures
\usepackage[round,sort,semicolon]{natbib}%%bibtex reference format
\usepackage{hyperref} %%typeset urls
\usepackage[noabbrev,capitalise]{cleveref} %% must be last listed so as to format other refs correctly
\crefname{subsection}{section}{sections}%% adjust how cref names subsections in text
\crefname{subsubsection}{section}{sections}%% adjust how cref names subsubsections in text.
For those of you that don't use LaTeX, the system works by using a bunch of small packages that each do a different task, for instance the Caption package allows you to write captions on figures and tables, that will then automatically show up in the appropriate section in the table of contents.
I would like here to point out a few interesting wee packages from this list:
Cleveref - this handles internal references, so if you wanted to refer to a section (subsection, figure, etc.) somewhere else in the document, you would type "\cref{<label of reference>}" and the package will automatically determine the type (fig, table etc.) and put the appropriate word and number into the text.  It also works to refer to page numbers, and what's more, if you move the object elsewhere in your document, it automatically updates the TOC and any text references.
Mhchem - this package handles typesetting of chemical formulae and equations, so that they look like chemical they are supposed to - for instance try writing PO4- in Word - the - will come out as it did here, instead of being directly above the 4, it will be off to one side.
Texshade - this takes alignment files (DNA/RNA or protein) and automatically (or not, setting dependent) colours them so that you can see at a glance which residues are conserved.  It can also do other amazing things like demonstrate hydrophilicity, label residues certain distances from others,  charge distributions, make sequence logos, subfamily logos, and many many more.  It'll even print out sequence similarity tables.  One caveat that is easily fixed is that the package is slightly old, so it can give a "non-pdf special ignored" error if you are also using xcolor or graphicx.  This is easily fixed by opening the texshade.sty file and altering lines 19 and 20 so that they look like this, then saving:

19 \PassOptionsToPackage{}{xcolor}
20 \PassOptionsToPackage{}{graphicx}
Lastly - Siunitx - this one correctly formats SI units for all the volumes and other dimensions you use. Not only does it do that, it can also do ranges, and you can define new units if you want to. Don't underestimate the amount of time it can take you to type out micromole per litre each time... just use this package and it will do it for you with abbreviations.
Lastly, if you are using LaTeX, there are tons of resources out there on the web describing how to use all the packages and errors have usually been hit by someone else, and solved - google is your friend.
May your LaTeX compile smoothly

Hi Bob,

    thanks for sharing Latex info. How do you learn it? Can you import references to it like one from endnote? Why official package ? isn't it free, I one time tried to learn it by installing on my laptop.

I have it installed on my computer but feel I will never be able to use it since it is such a huge program. Instead I am using Adobe InDesign for typesetting. it is the best program for such purpose, but is not free.

Sorry for late replies - I should check this more often.


@Inbox - learning it takes some time - http://en.wikibooks.org/wiki/LaTeX has been a big help, but much of the information needed can be found in the package documentation for each package (online and installed when you install.  If you are using them I would recommend reading the documentation for siunitx and mhchem - really useful stuff). 


References can be used in a format called "bibtex" there are a number of programs (mostly freeware) that handle it well (I use JabRef), or you can just keep a text file and call it appropriately, it works just as well.  To see the bibtex format type your favourite paper into the bibtex front-end for Pubmed: http://www.bioinformatics.org/texmed/ and click the link(s) provided.


Official packages are ones provided by the TeX users group - there are a number of other places to get them, and a number of different varieties of LaTeX available.


@bioforum: The freeware version of InDesign (no small program itself) is Scribus.  Another good choice for this sort of thing - I convinced a friend to use that for his thesis.  I just found that LaTeX while less user friendly, let me worry more about the content rather than the putting it all together side of things.  I didn't get all that far into using Scribus, so I can't comment in too much detail, but the lack of cross-referencing, and autoformatted references, was what made me not use it.  I'm sure that with a bit more patience and time I would have got it working fine.

July 2022

    12 3

Recent Entries

Recent Entries


Home - About - Terms of Service - Privacy - Contact Us

©1999-2013 Protocol Online, All rights reserved.