Lest we forget: Typography & LaTeX

Martins Bruveris recently gave an introductory lecture on LaTeX at Brunel University, and the deck was based on my previous LaTeX: More Than Just Academic Papers and Theses slides. (Suffice to say that I’m extremely happy that people are still reading it since I first made it in 2011—I’ve since updated it a bit.)

I particularly like how Martins highlighted how important typography is in retaining the readers’ (ahem supervisors, examiners, reviewers…) interest/attention. That’s so true—I remain certain that I received an award for my paper at a student workshop, partly (or perhaps majorly) because I used LaTeX. One of the panels commented “it’s a very clear, very nice paper—not sure why but it was just very enjoyable to read.”

"Your paper makes no sense, but it's the most beautiful thing I have ever laid eyes on."
Image courtesy of somethingofthatilk

Lest we’ve forgotten at times amid all the exciting new packages in recent years that let us do various cool things in LaTeX, typography is why Knuth created TeX in the beginning, and why some (I’ll acknowledge not all) users prefer LaTeX over word processors. Martins included this quote on typography in his slides:

Typography matters because it helps conserve the most valuable resource you have as a writer—reader attention.
Attention is the reader’s gift to you. That gift is precious. It is finite. And if you fail to be a respectful steward of that gift, it will be revoked.
(Matthew Butterick, Typography for Lawyers)

I would add this quote by Robert Bringhurst in the opening chapter to The Elements of Typographic Style:

Like oratory, music, dance, calligraphy—like anything that lends its grace to language—typography is an art that can be deliberately misused. It is a craft by which the meanings of a text (or its absence of meaning) can be clarified, honored and shared, or knowingly disguised.

and later in Chapter 10:

Writing begins with the making of meaningful marks. That is to say, leaving the traces of meaningful gestures. Typography begins with arranging meaningful marks that are already made. In that respect, the practice of typography is like playing the piano—an instrument quite different from the human voice.

And personally, I do think writings convey the experience knowledge of humankind (I know that sounds a bit pompous, spare me the rod), and deserve to be typeset with ultimate quality for an enjoyable reading experience!

AltaCV, yet another LaTeX CV/Résumé class

It all started with this:

Leonardo was talking about a résumé of Marissa Mayer that Business Insider put together using enhancv.com.
I knew I had to do something about it. And so AltaCV was born.

This is how the re-created résumé looks like (view/open on Overleaf):

Marissa Mayer's résumé, re-created with AltaCV

Though if you’re creating your own CV/résumé, you’d probably prefer using the basic template (view/open on Overleaf):

sample barebones AltaCV template

You can create your own CV using AltaCV online with Overleaf (use the links above); or you can download a zip from here, or git-clone it from Github.

AltaCV uses fontawesome and academicons; they’re included in both TeX Live 2016 and MikTeX 2.9.

The samples here use the Lato font.

LuaLaTeX compilation is strongly recommended. If you want to use XeLaTeX instead, that’s fine, but you may need to make sure academicons.ttf is installed on your operating system, not just available in your TEXMF tree with the academicons LaTeX package.

LaTeX Cookbook and Beginner’s Guide ebooks at $5 Each

Until January 6, that is!

Both books are written by Stefan Kottwitz. The LaTeX Beginner’s Guide came out in 2011, and I still consider it as a very valuable book to newcomers — e.g. a useful tome to assign your new research student as prerequisite research-skills reading. (You can read my review of it here) (whoa where did I find the energy to write such long form back in the day?!)

The LaTeX Cookbook is actually still quite new, having been published just a couple of months ago in October. (Which makes this deal even more amazing, especially with the currency situation in this part of the world right now…) Anyway! amazing deal or no amazing deal, this book is another one in the “keeper’s” category. Kottwitz continues his style of accompanying lots of useful code with an equally illustrative amount of explanations and best-practice tips. You know how some cookbooks are all “You want to do this? OK take this code” without too much explanation? This isn’t one of them. So in a pinch, you may be thinking “why can’t I just slap this code in and get it done with” (well actually most code in this book will do that for you anyway), but trust me, you’ll learn much more about LaTeX if you spend a few minutes reading. It’s written in a very easy-to-ready way anyway.

This book doesn’t beat around the bush with introductory material much, but digs into all the interesting things that you’ve probably wanted to do after writing up that first paper with LaTeX, or for writing up your own thesis or book — How do I change the fonts exactly the way I want? Can I draw my circuits/plots/chemical diagrams/flowcharts in LaTeX now? (Yes I enjoyed the chapter on Creating Graphics a lot — in fact you can download it as a sample chapter!) Mmmm you think your doc needs some pretty decorations, let’s see how we can spruce it up — Ah! Ornaments, coloured lettrines, images with rounded corners or badge-shaped, so designer-ish! (Come on, admit it, you know when those creative/productive procrastination mood hits…)

Another chapter worthy of mention is on how to ask a good question, and formulate a minimal working example (MWE), to make it easier for others to help you solve a problem. Having lectured students myself, I cannot emphasise enough how important this skill is. *meaningful nod*

So. Should you get these books? You bet. $5 per book until 6 January 2016!

“LaTeX Beginner’s Guide” by Stefan Kottwitz Available for Free Today (4 March 2015)

The LaTeX Beginner’s Guide ebook by Stefan Kottwitz is available for free for 24 hours today (4 March 2015)! I’ve previously reviewed this book on this blog, and here’s further information about the event.

This is a great book if you prefer a step-by-step tutorial approach to learning LaTeX. So if you’re interested, go ahead and download it now!

Updates for mmuthesis and umalayathesis

Just a quick note that updated classes of mmuthesis and umalayathesis has been uploaded at my website.

mmuthesis

Based on feedback from a MMU student who submitted her thesis recently, IPS now requires that the Publications List be categorised in to Journal Articles and Conference Proceedings, and that text in the appendices should be 10pt. Please read the updated user manual on how to prepare the Publication List under the new scheme.

umalayathesis

Bug fixes of some spacing of appendices entries in the ToC, as well as adjusting the overall line spacing to conform with the expected output by IPS. Font of the cover page now uses Arial Narrow look-alike.

New uumthesis LaTeX Class and LyX Layout

On request, I have created a LaTeX class and LyX layout for writing Universiti Utara Malaysia theses. Credit goes to Dr. Mohd. Hasbullah bin Omar for getting the output endorsed by UUM’s Graduate Office.

The uumthesis LaTeX class, LyX layout, sample files and user manual can be downloaded from my website. Happy LaTeXing to UUMians!

Putting Dates in Watermarks

It’s been rather a long time sine I last posted anything as I’ve been working on my thesis and article… sorry!

Theses and articles typically go through many versions, ding-dong to-and-fro between supervisors and co-authors. Some people keep track of the version number (or date-last-modified) by giving each draft a different file name. Personally, though, I tend to get inconsistent with the file naming, especially when it’s 2:30am. So I figured it might work better for me if the date-last-modified was printed in the PDF of the thesis/article draft itself.

One could always put the date in the header or footer, but there might already be some content in those regions. Besides, it’s probably not a good idea to mess with the formattings for a journal article. Instead, I put \today in a watermark, so the date would get updated I compile my draft:

\usepackage{draft watermark}
\usepackage{datetime}
\ddmmyydate
\SetWatermarkLightness{.9}
\SetWatermarkText{Draft\string@\today}
\SetWatermarkScale{.6}

The colour, lightness, font and other attributes of the watermark are configurable. I also used the datetime package to configure the date formatting. Here’s how the output looks like (a page from my thesis draft):

Creating an Online Academic Portfolio with LaTeX and TeX4ht

This was originally asked on TeX.SX, the requirements being:

Any one know of a good script to turn a bibtex file into a nice academic portfolio that:

  • links to electronic versions where known (from url or doi)
  • works with local files (e.g. with bibdesk’s format or otherwise)
  • automatically creates a thumbnail of the first page
  • and generally produces a polished web page suitable for showing off your work?

Well, I maintain my own online publication list by generating the HTML code from my BibTeX, using BibLaTeX, Biber and TeX4ht. So my answer to the above question was a quick modification of my own workflow, adding Ghostscript to the mix to generate thumbnail images of the papers. The output looks like this: (The publication lists can be split according to their types)

(BibLaTeX is a complete reimplementation of the bibliographic facilities provided by LaTeX in conjunction with BibTeX. It’s very flexible, and many find it easier to deal with compared to the BST language. Biber is the replacement of the BibTeX binary, for users of BibLaTeX.)

The source codes can be downloaded here as a .zip file. Further elaborations follow.

The Bibliography File

Back to the task at hand. First we have the BibTeX file, the content of which is pretty much the norm, except that I used the custom BibLaTeX field to hold the local PDF file name. My publications.bib contains entries like:

@ARTICLE{Lim:Ranaivo:Tang:2011,
author = {Lim, Lian Tze and Ranaivo-Malan\c{c}on, Bali and Tang, Enya Kong},
title = {Low Cost Construction of a Multilingual Lexicon from Bilingual Lists},
journal = {Polibits},
year = {2011},
volume = {43},
pages = {45–51},
url = {http://polibits.gelbukh.com/2011_43/43-06.htm},
usera = {LLT-polibits.pdf}
}

The LaTeX Source File

Next is the portfolio.tex file, in which I set up a hook at every bibliography item to include the first page of the file pointed to by usera. I’ve also added a bibmacro called string+hyperlink, to make the publication title link to the url or doi field if these are available, as shown in this answer.

\documentclass{article}
\usepackage[backend=biber,bibstyle=authoryear,sorting=ydnt]{biblatex}
\usepackage{graphicx}
\bibliography{publications}
\usepackage{hyperref}

\ExecuteBibliographyOptions{doi=false,url=false}
\newbibmacro{string+hyperlink}[1]{%
\iffieldundef{url}{%
\iffieldundef{doi}{#1}{\href{http://dx.doi.org/\thefield{doi}}{#1}}}
{\href{\thefield{url}}{#1}}}
\DeclareFieldFormat*{title}{\usebibmacro{string+hyperlink}{#1}}

\newbibmacro{usera}{%
\iffieldundef{usera}{}{%
\savefield*{usera}{\filename}%
\usebibmacro{string+hyperlink}{\includegraphics[width=100pt]{\filename}}\\}%
}
\AtEveryBibitem{\usebibmacro{usera}}

\begin{document}
\section{My Academic Portfolio}
\nocite{*}
\printbibliography[title={Articles},type={article}]
\printbibliography[title={Conference Proceedings},type={inproceedings}]

\end{document}

TeX4ht Configuration File

I then set up a TeX4ht personal configuration file, called portfolio.cfg (included in the .zip file). It contains some simple CSS, and tells TeX4ht to convert the first page of the local PDFs into PNGs using ghostscript. (So yes you will need to have ghostscript installed for this to work.)

Generating the HTML

Right, now we can run the following commands:

$  htlatex portfolio “portfolio”
$  biber portfolio
$  htlatex portfolio “portfolio”

And you should then get portfolio.html, which you can further embellish with more CSS. Well that was fun!