[Tex/LaTex] Contest: Show Off Your Skillz in TeX & Friends [TeX.sx birthday]


Submission Deadline and Voting are over, thank you for participating!



  1. Gonzalo Medina – 31
  2. Andy – 19
  3. cmhughes – 11
  4. mbork – 6


  1. Yiannis Lazarides – 38
  2. szantaii – 20
  3. Ant – 15
  4. Paulo Cereda – 14
  5. Count Zero – 13
  6. Aditya – 12
  7. Andrew Stacey – 9
  8. Max Lambertini – 7

The votes were counted at the end of the one week voting period, Nov. 25, 2011 14:00 UTC.

Congratulations to Gonzalo and Yiannis! And a big thank you to the twelve submitters, the high number of votes and views shows that the community took great interest in your work. As for the prizes, I think we're still waiting to hear back from Stack Exchange, so you'll have to be patient, sorry :(.

And here's the contest post itself:

What's going on?

TeX.sx turned one on November 11, 2011. This contest is part of our celebrations. This question doesn't meet the normal question form requirements on this site, but it is considered an exception, and was approved of on meta.

What's the task?

Show off the knowledge in TeX & friends that you've gathered over the time. Include things that a more-or-less everyday document can benefit from.

Final number of submissions: 12

Any conditions my document has to fulfill?

  • Form

    • Limit your document to a few pages, maximally three or four. Additional pages for a title page, table of contents, an index etc. are allowed.
    • All common formats (LaTeX, Plain TeX, ConTeXt) and engines (pdfTeX, XeTeX, LuaTeX) are allowed. However, the "ingredients" are limited to things provided on CTAN or otherwise easily publicly and freely available, so that everybody can reproduce and compile the document.
    • The source must be included and you agree that other users can reuse your code.
    • Annotate your source extensively, so that non-expert users can understand which package and which hack does what.
  • Contents

    • Your document should mainly be text, but content doesn't matter — feel free to show the most beautiful lorem ipsum ever. Reuse of something you have already written earlier is fine as well.
    • Academic paper-like submissions are as welcome as cooking recipes, role-playing game sheets, CVs or anything text-based that can be produced with TeX & friends. [see "Update"]
    • Include whatever visual stimuli you can think of, e.g. figures, tables, margin notes, background pictures, drop caps / initials — but in the end, it has to look good, not cluttered.
    • Make it typographically, aesthetically and perhaps even funwise maximally appealing.

How do I participate?

  • Post your submission, in an answer to this question and delete it immediately — in consequence, it won't be publicly visible, but the site moderators can restore it later.

  • When you add a new answer, please edit the question to update the current number of submissions.

  • Include 1) screenshots of your output, 2) the full compilable code, and 3) links to any additional material that needs to be downloaded. Specify if a particular compiler or compiling sequence is required. This question will be locked on Nov. 18, 14:00h UTC, so that no more answers can be added. Then all answers will be undeleted and voting starts.


Yes, there will most likely be prizes, but it hasn't been decided yet which in particular, see Which prizes for contests?. Besides that, chances are you enjoy TeX & friends at any rate, there are the usual answer badges to win (no reputation though), and the community can benefit from contributions enormously!

Who determines the winner; who votes?

You do!

Once the submissions are visible, you can vote for all submissions that you want to support. Thus, each TeX.sx user has as many votes as there are submissions, but each submission can only get one vote from each user. Downvoting is possible but, but strongly discouraged. If you feel you have to downvote, please explain why in a comment (e.g. if a document is in HTML instead of TeX or one of its friends). You can determine what you consider a good contribution, things to consider are:

  • Are above conditions met?
  • Is the submissions useful for other users of TeX & friends?
  • Is the source comprehensibly annotated?
  • Do you enjoy the submission?

Voting ends after a week, I'll try to note down the vote counts Nov. 25 around 14h UTC, these will determine the winner, regardless of votes cast afterwards.

A note to high rep users

You might be able to see the temporarily deleted submissions. You've proven trustworthy to the community in the past, so just pretend you couldn't see them.

Please lock the question on Nov. 18, 14:00h UTC and undelete the answers. Rollback any edits to the contributions after this deadline.

Any help in overseeing this contest is highly appreciated.

Update (per meta)

  1. There is a limit of three submissions per user.
  2. There are two categories: academic and other. Please indicate to which one your submission belongs. The result of the voting will be split into these categories.

None of this is in any way legally binding. TeX.sx and I reserve the right to change all conditions of this contest at any point as it seems reasonable to us. (We don't plan to, though.)

Best Answer

Here is a small bag of tips and tricks that I use to improve the handling and presentation of images in publications, which I want to share with you.

enter image description hereenter image description here

Use non-floating images

Most people think that the only way to insert an image in a publication is by using the LaTeX environment \begin{figure}...\end{figure}. This has many advantages but also many disadvantages. Inserting images directly into the text i.e., by using the macro \includegraphics[]{} gives you full control, but also full responsibility for the layout.

Enclose them in minipages

It is better to use an approach similar to HTML/CSS and use divs to enclose these, except these boxes are now minipages. You can the resize them to suit the layout as well as move them in any direction using vskip and hskip or the LaTeX equivalent of hspace and vspace. All the page layouts shown here were achieved using such an approach.

enter image description hereenter image description here

Use \newgeometry and \restoregeometry.

Sometimes it is much easier to adjust a layout by simply using the geometry package's new commands, \newgeometry and \restoregeometry.

enter image description hereenter image description here

Create a TeX Database

Another useful technique is to store all the images in a TeX database. This is not as complicated as it sounds. Remember that any macro actually can be used to store information. What I do is something resembling the following:

enter image description hereenter image description here

Create variations of commands using \csname..endcsname holding the data for each image.


These are created automatically via a command \addtoDB{}{}{} or similar. This also adds the original name into a list, which acts as the index.


This enable easy use of multiple images, in a @for loop. This is how the images above were inserted. The techniques can be used for almost everything, for example see some of the code at Cunning (La)TeX tricks and Adding a list of bios to the book class.

Keep the main file code to a minimal by leverage the filecontents package.

While developing pages, if you write everything in one file the code becomes bloated and confusing. What I do is to develop the page, first in the main file and then to use filecontents to write it to the file. I then delete the relevant section and use \input to load it onto the main file. I find it easier than opening and closing too many windows. I also use this to develop small packages, have the code first in the preamble, test as you go and when I am happy delete the filecontents. An example of how to use this can be found at internationalization. In What is a good strategy to internationalize a document class?, I used this technique to create a package-on-the-fly for whoever was to use the MWE.


Use a bit of innovation for these layouts see for example the images below which have a three column caption. (I use the caption package for numbering).

enter image description hereenter image description here

I am currently incorporating all these into a class. Unfortunately the code is too lengthy to post here and also the class is not in a shape that I would feel comfortable to upload it to ctan yet. With LaTeX's 3 coffins, I think I can also leverage the layouts a bit more and publish it sometimes over the next few months.

In the meantime if you need any help to incorporate these suggestions with what you are busy with, post a question and I can extract some of the code to help you out.

enter image description hereenter image description here

Not only for Modern books

The last example is from mathematics, from Newton's Principia. The left figure below shows my attempt using LaTeX and a bit of modern approach. The image on the right below is a scan of the original page. This was achieved using wrapfig and a minimum of manual adjustment, just a negative vskip a few points up to position the image better.

enter image description here enter image description here

All the tools are here, go and make great books. thanks for reading this far.