LaTeX Templates

Many of you might have wished to have proper templates for different types of documents. Indeed there is a website that offers a bunch of these, www.latextemplates.com. I must say I am not particularly fond of templates since they tend to do two things: prevent people from properly learning LaTeX and thus copying the same preamble over and over without knowing what the different parts do. Second — and this is worse — there are way too many bad templates out there which means they teach people bad practice. Some are merely too old and outdated, others use bad or even wrong code. I am not saying this is the case for the ones on the website I mentioned above. I haven’t checked the templates there. That is, I have checked one of the templates: the laboratory report. And I can’t say I like that one much, though, which sadly seems to prove my point.

I have expressed my concerns about that specific template on the site itself in comments and I had email contact with the maintainer of the templates, Vel[ref]who was as responsive as one could ask for, by the way, and seemed to be very nice![/ref], and have sent him various suggestions regarding the template. Now, since then the template has changed but unfortunately not in the points that bug me the most. Obviously Vel and I have different priorities. Or maybe he is just too busy. (Or I have forgotten how bad the now improved parts have been before.) Anyway, I still want people to be able to know what could be improved, IMHO. Here are the main points:

  1. The most obvious part is this: the template is meant for people doing chemistry or more generally natural sciences and yet there is no mention of amsmath, mhchem, siunitx, chemmacros or chemfig, i.e. none of the packages I’d call basic knowledge when doing chemistry
  2. This leads straight to the next point: since none of the above packages are used there are many places of bad typography. Don’t we want to use LaTeX to have beautiful documents? And all at the same time use it’s powers to have handy macros? So don’t write
    \begin{center}\makebox{2 Mg + O$_{2}$ $\rightarrow$ 2 Mg O}\end{center}

    which looks like this:

    Rendered by QuickLaTeX.com

    but rather use the above mentioned chemmacros and write

    \ch{2 Mg + O2 -> 2 MgO}

    which looks like this:

    Rendered by QuickLaTeX.com

    I’m sure you’ll notice the subtle differences. The same holds for mathematical equations and physical units. Compare

    atomic weight of magnesium = 16.00 $\times \frac{1.31}{0.87}$ = 24.1 = 24 g/mol

    Rendered by QuickLaTeX.com

    to

    $M_{\ch{Mg}} = 16.00 \times \frac{1.31}{0.87} = 24.1 = \SI{24}{g/mol}$

    Rendered by QuickLaTeX.com

    (Please don’t comment on the missing units. Although they make the equation wrong they are not the point.) It easy to see that the spacing is much better in the second version. And that is because I don’t mix text and math mode but use math mode for the entire equation. That’s how it should be done. There are various other occurrences regarding the same point. I won’t list them here.

  3. The template uses a manually set bibliography. Although this is nice regarding flexibility and maybe for learning how certain parts of LaTeX work I am quite surprised about this. Shouldn’t the template help you in having less work? One could at least mention the good old BiBTeX way. Better yet: there’s biblatex. It is not easier to learn but once one has learned the basics it’s much easier to work with. There’s excellent support for various biblatex problems on TeX.sx and it is actively developed. And don’t let us forget this point: someone who has to write a laboratory report like the one the template is for is most probably a student which means he or she sooner or later will have to write a bachelor’s thesis or a master’s thesis… You’ll be glad if you have figured out by then how to do a bibliography properly with biblatex (and maybe with a reference manager like JabRef, too).

I guess the template probably still suffers from errors the original author made. I hope the other templates do a better service, although I’m neither going to use nor to check them. (I might have expressed before that I am no big fan of document templates.) Hopefully I’ve simply picked the odd man out. I do want, though, that people who want to use templates get good ones. So in principle I think www.latextemplates.com is on the right track for these people and maybe my suggestions will be at least discussed.

5 Comments

  1. Vel

    Hey,

    I came across this post and wanted to thank you for pointing out the errors in this template. I’ve fixed them all (hopefully) in a new version of the template (v3.0), check it out here: http://www.latextemplates.com/template/university-school-laboratory-report

    I encourage any suggestions for improvements to existing templates, preferably with worked examples as here. I am also always looking for new templates so please feel free to submit any you may have!

    Another template your readers may be interested in is the Chemical Equations one here: http://www.latextemplates.com/template/chemical-equations

    Cheers,
    Vel

    • Hi Svend,

      You’re right, of course. I didn’t use this notation mainly for one reason: I figured people who want to use templates may not easily be convinced that there are actual advantages of typing 14 characters (\gram\per\mole) instead of five (g/mol). Actually I wouldn’t use the optional argument of \SI but set the options globally in the preamble with \sisetup.

      Regards

Leave a Reply

Your email address will not be published. Required fields are marked *