# Results

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

## Other

1. Yiannis Lazarides – 38
2. szantaii – 20
3. Ant – 15
4. Paulo Cereda – 14
5. Count Zero – 13
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.

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

• 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.

# Prizes?

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.)

• Shouldn't it be "TeX" skills without the "La" part? – Khaled Hosny Nov 11 '11 at 16:56
• @KhaledHosny: Have a look at the discussion page I linked to in the comment above yours. – doncherry Nov 11 '11 at 17:23

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.

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.

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.

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:

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

\mypics@img1@caption
\mypics@img1@longdescription
\mypics@img1@date


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

\mypictures{img1,img2,img3,img4}


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.

Captions

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).

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.

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.

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

• Those look awesome, looking forward to seeing the code on CTAN. Also, thanks for the comment about filecontents. Although I have used filecontents numerous times to compose MWE for this site, it never occurred to me to use it the way you suggest. I will certainly start taking advantage of that right away. – Peter Grill Nov 18 '11 at 17:09
• Fantastic, Yiannis! :) – Paulo Cereda Nov 19 '11 at 9:02
• Sorry, no edits after the deadline, no matter how minute they may be. I rolled your answer back to the version submitted before the deadline. – doncherry Nov 19 '11 at 18:22
• @doncherry Sorry had a few typos, did not realize this was part of the rules. – Yiannis Lazarides Nov 19 '11 at 18:45
• I have to admit I find it strange this won, when it's really the only one without any actual (La)TeX! Nevertheless, beautiful pics. – Steve D Dec 7 '11 at 4:28

My contribution is the little package gridleno.sty whose code I include below. This package was designed to enhance the functionality of grid.sty regarding the difficult task of grid typesetting in double column LaTeX documents. The package still needs a lot of improvements, this is only a starting point.

The package was conceived to help producing lecture notes in the spirit of the question How to add some visual style and pizzazz to course notes? and the popular answer by Yiannis Lazarides. In fact, some days ago in the chat room, Yiannis himself suggested me the idea of writing this package for the contest.

The images below illustrate the basic layout and some of the features provided by the package. The code for the sample document can be found here in pastebin (it was the first time I used the LaTeX way $$...$$ for in-line math instead of $...$; all I can say is that old habits die hard and that it was probably also the last time ;-)).

# A brief description of the package:

Usage: load the package after having loaded the grid package in a LaTeX document :

\usepackage[<options>]{grid}
\usepackage{gridleno}


Some of the features implemented by the package

• Theorem-like structures:

Predefined styles= proofstyle, thmstyle, defistyle, remastyle (similar to those of the amsthm package).

Predefined environments: proof, theorem, proposition, corollary, lemma definition, example, remark.

• Special environments and commands:

summary: shaded environment, with a centerd "Summary" header and italiziced text indented 10pt on both sides.

grcmpage: a shaded minipage; it takes two mandatory arguments: the minipage width and the shading color (thanks to egreg for his decisive help in his answer to my question How to keep a constant baselineskip when using minipages (or \parboxes)?).

exercises: centered header "Exercises" with rules on both sides. Inside this environment enumerate is redefined to produce a list with 0pt left margin for the first level.

\makeheader produces a framed box in all the pages of the document. The box contains information about the course. This box borrows some code from the file rvdtx.sty (used toproduce the documentation of the grid package).

The commands \course, \courseid, \professor, \term, \topic (one mandatory argument) are used to define the course information; these commands do not typeset anything; the actual typesetting is done throught the \makeheader command.

Some commands to allow the redefinition of the predefined names.

Other features:

The caption headers are colored by default.

\refname has been redefined to produce "Suggested Readings".

\@biblabel was redefined to produce bullets instead of the standard labels inside the thebibliography environment.

The predefined colors can easily be changed.

The default color schema uses some of the colors of the TeX.SX site, as an homage to its first birthday.

# The file gridleno.sty:

%%
%% This is file gridleno.sty',
%%
%% Copyright (C) 2011 Gonzalo Medina
%%
%% --------------------------------------------------------------------------
%%
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either version 1.3
%%
\NeedsTeXFormat{LaTeX2e}[1994/12/01]
\ProvidesPackage{gridleno}

% some colors that will be used (taken form the colors used at TeX.sx)
\definecolor{grlngreen}{RGB}{208,212,171} %(green)
\definecolor{grlnblue}{RGB}{100,169,212} %(blue)
\definecolor{grlngray}{RGB}{76,76,74} %(gray)

% we set the colors for the different elements
\colorlet{summarybg}{grlngreen!60}

% definition of user commands to define course, professor, the course id,
% the topic and the term; the date is produced with the standard \date.
% \makeheader will actually typeset this information.
\def\course#1{\gdef\@course{#1}}
\def\@course{}
\def\professor#1{\gdef\@professor{#1}}
\def\@professor{}
\def\courseid#1{\gdef\@courseid{#1}}
\def\@courseid{}
\def\topic#1{\gdef\@topic{#1}}
\def\@topic{}
\def\term#1{\gdef\@term{#1}}
\def\@term{}

% default values for the different names used
\newcommand\lecturenotename{Lecture Notes}
\newcommand\coursename{Course}
\newcommand\termname{Term}
\newcommand\Proofname{Proof}
\newcommand\theoremname{Theorem}
\newcommand\propositionname{Proposition}
\newcommand\corollaryname{Corollary}
\newcommand\lemmaname{Lemma}
\newcommand\definitionname{Definition}
\newcommand\examplename{Example}
\newcommand\remarkname{Remark}
\newcommand\exercisesname{Exercises}
\newcommand\summaryname{Summary}

% with information about the course, topic, professor, term, date.
% The background package is used to place this header in all the pages
% of the document.
\SetBgContents{}
\pagestyle{plain}
\SetBgContents{%
\vbox{%
\setlength\hsize{\paperwidth}
\setlength\parindent{0pt}%
\parbox[t][1.5in][c]{\dimexpr\paperwidth-2\fboxsep-2\fboxrule\relax}{%
\hspace*{15mm}%
\parbox[c]{.35\paperwidth}{%
\raggedright\normalfont\sffamily
\fontfamily{cmr}\fontsize{17pt}{20pt}\selectfont\scshape\@topic \\[6pt]
{\normalsize\rmfamily\scshape\@professor}%
}%
\hfill
\parbox[c][1.5in][c]{1mm}{%
}%
\hfill
\parbox[c][1.5in][c]{.35\paperwidth}{
\vspace*{6pt}%
\coursename  & \@course\ \@courseid \\[1ex]
\termname & \@term \\[1ex]
\multicolumn{2}{@{}l@{}}{\@date}
\end{tabular}%
}\hspace*{15mm}%
}%
}%
}%
}
\SetBgPosition{current page.north}
\SetBgAnchor{below}
\SetBgVshift{3.5pt}
\SetBgScale{1}
\SetBgColor{black}
\SetBgAngle{0}
\SetBgOpacity{1}
}

% definitions for \section, \subsection and \subsubsection
\renewcommand\section{\@startsection {section}{1}{\z@}%
{-.999\baselineskip}%
{0.001\baselineskip}%
\renewcommand\subsection{\@startsection{subsection}{2}{\z@}%
{\baselineskip}%
{-.35\baselineskip}%
\renewcommand\subsubsection{\@startsection{subsubsection}{3}{\z@}%
{\baselineskip}%
{-.35\baselineskip}%

% predefined theorem-like styles defined with the thmtools front-end
% using amsthm as the back-end

% \qedsymbol will be a colored solid square
\renewcommand\qedsymbol{$\color{qedsym}\blacksquare$}

% style for the proof environment
\declaretheoremstyle[
spaceabove=\baselineskip, spacebelow=\baselineskip,
notefont=\mdseries, notebraces={(}{)},
bodyfont=\normalfont,
numbered=no,
qed=\qedsymbol,
]{proofstyle}

% style for theorems, propositions, corollaries, lemmata
\declaretheoremstyle[
spaceabove=\baselineskip, spacebelow=\baselineskip,
notefont=\mdseries, notebraces={(}{)},
bodyfont=\normalfont\itshape,
]{thmstyle}

% style for definitions and examples
\declaretheoremstyle[
spaceabove=\baselineskip, spacebelow=\baselineskip,
notefont=\mdseries, notebraces={(}{)},
bodyfont=\normalfont,
]{defistyle}

% style for remarks
\declaretheoremstyle[
spaceabove=\baselineskip, spacebelow=\baselineskip,
notefont=\normalfont, notebraces={(}{)},
bodyfont=\normalfont,
]{remastyle}

% predefined theorem-like structures
\declaretheorem[style=proofstyle,name=\Proofname]{Proof}

\declaretheorem[style=thmstyle,name=\theoremname]{theorem}
\declaretheorem[style=thmstyle,name=\corollaryname]{corollary}
\declaretheorem[style=thmstyle,name=\lemmaname]{lemma}
\declaretheorem[style=thmstyle,name=\propositionname]{proposition}

\declaretheorem[style=defistyle,name=\definitionname]{definition}
\declaretheorem[style=defistyle,name=\examplename]{example}

\declaretheorem[style=remastyle,name=Remark]{remark}

% enumerate-like environment designed for the exercises
% first level labels without indentation.
\def\exenumerate{%
\fi\fi
\setlength\leftmarginii{\dimexpr\labelwidth+\labelsep\relax}
\setlength\leftmarginiii{\dimexpr\labelwidth+\labelsep\relax}
\setlength\leftmargini{\dimexpr\labelwidth+\labelsep\relax}
\ifnum \@enumdepth >\thr@@\@toodeep\else
\edef\@enumctr{enum\romannumeral\the\@enumdepth}%
\expandafter
\list
\csname label\@enumctr\endcsname
{\usecounter\@enumctr\def\makelabel##1{\makebox[0pt][l]{##1}}%
\topsep\z@\partopsep\z@\parskip\z@\itemsep\z@%
\fi}
\let\endexenumerate =\endlist

% An environment similar to minipage but keeping a constant
% baseline before and after; it only has one mandatory argument
% controlling the minipage width
\newenvironment{grmnpage}[1]
{\noindent%
\begin{minipage}[t]{#1}}
{\par\xdef\tpd{\the\prevdepth}
\end{minipage}}

% An environment for shaded minipages but keeping a constant
% baseline before and after; the first mandatory argument sets the
% minipage width and the second mandatory argument sets the
\NewEnviron{grcmpage}[2]
{\noindent\setlength\fboxsep{0pt}%
\colorbox{#2}{%
\begin{grmnpage}{#1}
\BODY\par\xdef\tpd{\the\prevdepth}
\end{grmnpage}%
}%
}
\AtEndEnvironment{grcmpage}{\par\prevdepth\tpd}

% environment for a summary
\newenvironment{summary}
{\grcmpage{\linewidth}{summarybg}
\parshape 1 10pt \dimexpr\linewidth-20pt\relax\itshape}
{\par\endgrcmpage\par\prevdepth\tpd}

% similar to \hrule but above the base line

% environment for exercises: facy title and redefines enumerate as exenumerate
% to remove labels indentation
\newenvironment{exercises}
\let\enumerate\exenumerate\let\endenumerate\endexenumerate}
{}

% caption label will receive a color

% \refname will produce "Suggested Reading" and \@biblabel will
% produce a bullet
\renewcommand\@biblabel[1]{{\color{biblabel}$\bullet$}}
\endinput
%%
%% End of file gridleno.sty'.

• Awesome code, Gonzalo! Congrats! :) – Paulo Cereda Nov 19 '11 at 9:04
• @GonzaloMedina, awesome! I am trying to LaTeX your code, but I keep getting errors. One error is due to extra spaces in \ definecolor{grlngray}{RGB}{76,76,74} %(gray). After I fixed that, I still get the following error: miktex-makemf: The fourier-bb source file could not be found. – Ali Mehrizi Nov 29 '11 at 22:24
• @dochar: Thank you. Yes, those spaces are superfluous and shouldn't be there; it was something the site added automatically when I pasted the code... so, don't leave blank spaces between  and definecolor. As for the other error, it seems as if your system doesn't have the fourier fonts; try commenting out the line \usepackage{fourier}. – Gonzalo Medina Nov 29 '11 at 22:28
• That's a very good template! – user10130 Dec 19 '11 at 22:16
• @GonzaloMedina Just came across this and I can hardly believe it...this is incredible what you have done. Can't wait to use this for months to come! The design is awesome!! – Daniel W. Farlow Aug 6 '15 at 11:10

I prepared a two page sample of my lecture notes. The general book design is heavily inspired by Edward Tufte, R. Bringhurst and the tufte-latex-class. Then, with the advent of e-books, I wanted something that can be prepared for many different reader devices. It turned out that LaTeX is about the perfect tool to achieve this. I came up with some kind of markup in the document and different style files to optimize the text for different devices. I prepared a few book pages and a kindle document as an example. The main concern was to allow an automatic preparation of all output files out of one input file. It would consume to much time to optimize the handout, the book chapter, the kindle file etc.

I used lualatex, biblatex and the beta version of microtype. The style files are available on Github and the additional functionality is provided by the sidenotes package on CTAN.

Please note that recto and verso page and incorrectly next to each other in my screenshot to allow a 'book' look with only two pages.

\documentclass{caesar_book}

\usepackage{marginfix}
% -- provide more floats
\usepackage{morefloats}

% -- graphics --
\usepackage{graphicx}

% -- language: German --
\usepackage{csquotes}
\usepackage[ngerman]{babel}

% -- biblatex --
\usepackage[backend = biber, style = cleopatra,language=american]{biblatex}
\AtEveryCitekey{\clearfield{url}}
\AtEveryCitekey{\clearlist{language}}
% fix export function of papers
\DeclareBibliographyAlias{letter}{article}

%%
%% -- start --
%%
\begin{document}
\chapter{Einführung}
\smallfigure{c01_01_Onnes}{Heike Kamerlingh Onnes. © Museum Boerhaave.}
%
\smallfigure{c01_02_TransitionHg}{Erste Messkurve des supraleitenden Zustands, replot nach Kamerlingh Onnes.}
%
Der Begriff \emph{Supraleitung} geht auf die Beobachtung zurück, dass unterhalb einer kritischen Temperatur manche Materialien ihren elektrischen Widerstand sprunghaft verlieren. Dies wurde erstmals 1911 von Heike Kamerlingh Onnes beobachtet.\reference{}{}{Kamerlinghonnes:1911p1320} Abbildung \ref{c01_02_TransitionHg} zeigt eine Reproduktion der ersten Messkurve aus seiner Originalarbeit, die in Leiden veröffentlicht wurde. Kamerlingh Onnes erhielt 1913 den Nobelpreis für Physik \quotetext{for his investigations on the properties of matter at low temperatures which led, inter alia, to the production of liquid helium}.\reference{}{}{nobel:onnes} Das charakteristische Merkmal der Supraleitung ist jedoch der Meißner-Ochsenfeld-Effekt.
%
\section{Meissner-Ochsenfeld-Effekt}
Stellen wir uns folgendes vor: Ein hypothetisches Material \tinyfigure{c01_Meissner10} sei ein Metall, welches oberhalb einer bestimmten Temperatur einen endlichen elektrischen Widerstand besitzt. Nun kühlen wir das Material \tinyfigure{c01_Meissner8} ab und es verliert seinen elektrischen Widerstand. Schließlich wird ein magnetisches Feld \tinyfigure{c01_Meissner7} eingeschaltet. Die Änderung des Magnetfelds führt zu Induktionsströmen im Material. Diese wirken nach der Lenzschen Regel ihrer Ursache entgegen und führen zum Verschwinden des Magnetfelds \tinyfigure{c01_Meissner2} im Inneren des Materials. Da kein elektrischer Widerstand vorhanden ist, können die Induktionsströme ewig weiter fließen. Jetzt ändern wir die zeitliche Abfolge von Abkühlung und Anlegen des Magnetfelds. Zunächst wird das Magnetfeld \tinyfigure{c01_Meissner5} eingeschaltet und nach dem Abklingen der Induktionsströme ist das Material vom Magnetfeld \tinyfigure{c01_Meissner4} komplett durchdrungen. Dies ändert sich auch nicht, wenn es abgekühlt wird, da es keine Flussänderung gibt. Der Leiter bleibt in einem felddurchdrungenen \tinyfigure{c01_Meissner3} Zustand.

Nun werden diese beiden Experimente mit dem Supraleiter wiederholt. Auch dieser hat oberhalb einer Temperatur, die in diesem Fall kritische Temperatur genannt wird, einen endlichen elektrischen Widerstand \tinyfigure{c01_Meissner10}. Unterhalb der kritischen Temperatur ist er im supraleitenden Zustand \tinyfigure{c01_Meissner9} ohne elektrischen Widerstand. Wird im supraleitenden Zustand ein Magnetfeld \tinyfigure{c01_Meissner6} eingeschaltet, haben wir den gleichen Fall \tinyfigure{c01_Meissner} wie vorher. Nun wird in einem neuen Experiment der Supraleiter zunächst einem Magnetfeld ausgesetzt \tinyfigure{c01_Meissner4} und danach abgekühlt. Der Supraleiter \tinyfigure{c01_Meissner} verdrängt immer das Magnetfeld. Er kann nicht je nach Vorgeschichte in verschiedene Zustände gebracht werden. Der supraleitende Zustand ist also eine thermodynamische Phase und der Übergang vom normalleitenden in den supraleitenden Zustand ist demnach ein Phasenübergang.\reference{Siehe z. B.:}{}{nolting4}

Insgesamt wird das Verhalten \tinyfigure{c01_Meissner} nach den beiden Physikern Walther Meißner und Robert Ochsenfeld als Meißner-Ochsenfeld-Effekt bezeichnet.\reference{}{}{Meissner:1933p7229} Es kann nicht allein aus $R=0$ abgeleitet werden. Es sollte als charakteristisches Kennzeichen der Supraleitung angesehen werden, da ein Material ohne elektrischen Widerstand nicht alle Eigenschaften eines Supraleiters zeigt. Angemessener wäre der Begriff \emph{Superdiamagnet}, historisch hat sich aber der Begriff \emph{Supraleiter} durchgesetzt.
%
\section{Flussquantisierung}
Betrachten wir eine Minispule in der ein Kreisstrom fließt. Der Strom $I$ und der magnetische Fluss $Φ$ können über die Induktivität $L=Φ/I$ verknüpft werden. Die kleinste Einheit von sich bewegenden Ladungen ist die Elementarladung $e$ des Elektrons. Es sollte also auch der magnetische Fluss $Φ$ quantisiert sein, denn der Kreisstrom kann nicht stufenlos eingestellt werden, sondern es müssen Vielfache der Elementarladung in die Runde fließen. In einem supraleitenden Ring sollte dies besonders einfach untersucht werden können, da ein einmal induzierter Kreisstrom ewig weiter fließt. Doll und Nähbauer haben 1961 solche Messungen veröffentlicht,\reference{}{}{Doll:1961p3784} eine Wiedergabe dieser Messungen ist in Abbildung \ref{c01_06_FluxQuantization2} gezeigt. Deutlich sind die Stufen zu sehen, welche die beschriebene Quantisierung zeigen.
\smallfigure{c01_06_FluxQuantization2}{Magnetische Flussquantisierung in einem supraleitenden Ring.}

Wie im Abschnitt zuvor, wollen wir uns an dieser Stelle überlegen, was zu erwarten wäre. London sagte 1950 als erster die Flussquantisierung voraus. Laut neuerer \textsc{bcs}-Theorie erwarten wir Cooper-Paare, die die Träger des Suprastroms sind. Die kleinste Einheit des Flusses, das Flussquant $Φ_0$, sollte somit in Vielfachen der doppelten Elektronenladung auftreten. Lars Onsager hatte dies bereits 1959 realisiert und W.M. Fairbanks mitgeteilt.\reference{Dies brachte Onsager seinen Beinamen \emph{Lars, the oracle} ein.}{}{Careri:2000p12789}

\smallfigure{c01_07_FluxQuantization1}{Magnetischer Fluss in einem supraleitenden Zylinder}
Experimentell kann also aus dem Wert des Flussquants verifiziert werden, dass der Nenner tatsächlich $2e$ beträgt. Deaver und Fairbanks haben dies zeitgleich mit Doll und Nähbauer 1961 gezeigt.\reference{}{}{Deaver:1961p3782} In Abbildung \ref{c01_07_FluxQuantization1} sehen wir einen Neuplot der Daten, der Fluss ist dabei, genau wie in der Originalarbeit, schon normiert in Einheiten von $h/2e$ aufgetragen. Dies ist ein sehr starkes Indiz für Cooper-\emph{Paare} als supraleitende Ladungsträger.
%
\end{document}


To make it easier to gather all the parts, I prepared a zip-file with all documents and pictures and the microtype beta.

• What are the reasons for using the microtype beta version? – Federico Poloni Nov 19 '11 at 21:09
• I had some issues with letterspacing small caps in the non-beta version. I do not think it matters in my example code. – Andy Nov 20 '11 at 14:11
• Hi, Andy! Any chance to get the the zip-file operative again? Link to Dropbox is dead. Thanks!!! – José Jul 4 '16 at 15:21
• @Andy Just beautiful! But can you have a look at the link to your zip file? – samcarter_is_at_topanswers.xyz Aug 15 '16 at 17:08

This my submission in the other category for the Show Off Your Skillz in TeX & Friends Contest. I call it TypoTux, this is more like a hack than a usual typographic layout.

See source and detailed description below the picture.

% TypoTux
% Created by István Szántai
% Compiled with pdflatex using TeX Live 2011
%
% Use it as you like, but please send me an e-mail if you do.

\documentclass[10pt,a4paper]{article}

% Specifying input encoding
\usepackage[utf8]{inputenc}

% Using the TikZ library for drawing Tux, and clipping
\usepackage{tikz}

\usepackage{caption}

% For inserting lorem ipsum text
\usepackage{lipsum}

% Setting baselines smaller
\setlength{\baselineskip}{6pt}

\begin{document}

%\lipsum[1]

\begin{figure}[h!]
\centering
\begin{tikzpicture}[y=0.80pt,x=0.80pt,yscale=-1, inner sep=0pt, outer sep=0pt,scale=0.25]
\begin{scope}[shift={(-249.6684,-294.38903)}]
%\begin{scope}[cm={{0.55569,0.0,0.0,0.55569,(249.6684,292.4824)}}]
\begin{scope}

% Tux's path used for clipping
% Generated with Inkscape / http://inkscape.org/
% Using the inkscape2tikz extension / http://code.google.com/p/inkscape2tikz/
\path[clip] (265.5000,1063.0000) .. controls (252.9000,1061.0000) and
% Tux's path used for clipping cut from here because it's too long to include.
% See link for full compilable source at the end of the answer.

% Adding lorem ipsum text using TikZ nodes, and the lipsum package
\node[inner sep=0,text width=10cm] (text1) at (450,450) {\LARGE\textit{\lipsum[1]}};
\node[inner sep=0,text width=10cm] (text1) at (500,500) {\LARGE\textit{\lipsum[2]}};
\node[inner sep=0,text width=10cm] (text1) at (450,450) {\textit{\lipsum[3-4]}};
\node[inner sep=0,text width=10cm] (text1) at (500,500) {\textit{\lipsum[5-6]}};
\node[inner sep=0,text width=10cm] (text2) at (450,450) {\scriptsize\textit{\lipsum[7-11]}};
\node[inner sep=0,text width=10cm] (text2) at (475,475) {\scriptsize\textit{\lipsum[12-16]}};
\node[inner sep=0,text width=10cm] (text2) at (500,500) {\scriptsize\textit{\lipsum[17-21]}};
\end{scope}
\end{scope}
\end{tikzpicture}

\caption*{TypoTux}
\end{figure}

%\lipsum[2]

\end{document}


I always wanted to create something like this. After I read about this contest I decided to make a Tux who's drawn by text. I chose TikZ & PGF for this purpose since it's very powerful, and I used it several times before for path clipping.

Step-by-step description how I made this:

1. Grabbed a 2D vectorized Tux image from Wikipedia.
2. Removed colored and unnecessary white paths from the image, resized page with Inkscape.
3. Saved the black & white image as a standalone TikZ image with Inkscape using the inkscape2tikz extension.
4. Removed some unnecessary paths from the tex source file, changed path filling to clipping.
5. Added nodes filled with different size of lorem ipsum text using the lipsum package. Note: this was the hardest part, because there was no other way but trying to place the text under the clip path.
6. A little bit of fancying, and cleaning up.

Use it for whatever you want to, but please let me know if you do. I compiled it with pdflatex using TeX Live 2011.

Macro package: ConTeXt (ver: 2011.10.20)
Engine: LuaTeX
Category: Other

In \TEX\ \type{%} creates a line comment, i.e., \TEX    ignores the material % CHECK: use text instead?
from \type{%} until the end of the line. As a result,
often % CHECK: use sometimes instead?
you have to bream lines just to comment some material.

% The line comment mechanism also makes it hard to comment
% blocks of text. A \TEX\ aware engine makes it easier to
% hide the fact that \TEX\ does not have block comments.


It is possible to define a macro for block comments. For example

\define[1]\hide{\removeunwantedspace}


works well for simple comments. However, the content of such a macro is parsed by TeX, so such a macro fails miserably on input like

blah blah \hide{\iffalse} blah blah


Another option is to use buffers for block comments. ConTeXt already defines a hiding buffer for this purpose. For example

blah blah \starthiding \iffalse \stophiding blah blah


works fine. (For non-ConTeXt users, ConTeXt buffer is roughly equal to the functionality of the LaTeX fileconent and comment packages but on steroids. For the purpose of hiding content, the comment package can be used, but IIRC, the \end{comment} statement must be on a line of its own, defeating its purpose a block comment marker). Nonetheless, using buffers for block comments is not ideal. For one, it is a lot of typing! But more importantly, buffers cannot be part of the argument of another comment. So,

\section{Will this work \starthiding of course, not \stophiding}


does not work.

With LuaTeX, it is possible to have true block comments in TeX. LuaTeX allows you to intercept and filter text before it is passed on to TeX. We can write an appropriate Lua code to implement block comments as such a filter. An example, is the m-translate module which allows for creative solution to text substitution questions. For example, see:

The code below grew out of a question about block contents on the ConTeXt mailing list. Save the block below as t-comments.mkvi. Yes, that's right, the extension must be mkvi. This allows for named arguments for TeX macros (See comments on code below).

%D \module
%D      version=2011.11.14,
%D        title=\CONTEXT\ User Module,
%D       author=Hans Hagen and Aditya Mahajan,
%D         date=\currentdate,

\startluacode
thirddata          = thirddata or { }
local comments     = { filters = { } }

local textlineactions = resolvers.openers.helpers.textlineactions
local sequencers      = utilities.sequencers
local constants       = interfaces.constants

local gsub, find, format = string.gsub, string.find, string.format

local empty_line = "%%" -- FIXME Make catcode independent!

local settings = utilities.parsers.settings_to_hash(settings)
local start = string.escapedpattern(settings[constants.start] or "")
local stop  = string.escapedpattern(settings[constants.stop] or "")
local any   = ".-"
if start ~= "" and stop ~= "" then
local strip_inline     = function(s) return gsub(s, start .. any .. stop, "", 1) end
}


And I want to have the liturgical time being displayed in the song, so I wrote another code for it:

% draw a little square with #1 text
% inside it
\newcommand*\timebox[1]{%
\begin{tikzpicture}
\node[draw,inner sep=1pt, minimum height=0.3cm, minimum width=0.3cm] {\tt\raisebox{0pt}[\height][0pt]{#1}};
\end{tikzpicture}%
}

% print a timebox and add a space
\newcommand*\indextime[1]{%
\timebox{#1}~%
}


I love this part. Thanks to the etoolbox package, I can iterate through elements of a list, so I add a new list parser:

% declare a new list parser
\DeclareListParser*{\myforeach}{,}


Now I create a command to iterate through a list of times:

% create a command that will print a
% timebox for every letter found
\newcommand*\settime[1]{%
\myforeach{\indextime}{#1}%
}


This part is the heart of my implementation. I read the category of the current song and index it accordingly:

% index song according to the
% category
\newcommand*\indexsong[1]{%
\IfEq{#1}{F}{%
\resettitles%
\index[foo]{\songtitle@\songliturgy \songtitle}
\drawtype{F}~%
}{%
\IfEq{#1}{B}{%
\resettitles%
\index[bar]{\songtitle@\songliturgy \songtitle}
\drawtype{B}~%
}{%
\IfEq{#1}{FB}{%
\resettitles%
\index[foobar]{\songtitle@\songliturgy \songtitle}
\drawtype{FB}~%
}{%
\IfEq{#1}{Q}{%
\resettitles%
\index[qux]{\songtitle@\songliturgy \songtitle}
\drawtype{Q}~%
}{%
\textbf{Error!}%
}%
}%
}%
}%
}%


Again, for every category of every song, let's index it:

% create a command to index the current song
% according to the list of categories
\newcommand*\classify[1]{%
\myforeach{\indexsong}{#1}%
}


Now, I need to add support to these entries in my song environment:

% create a new song key to print the categories
\newsongkey{cla}{\def\songclassify{}}
{\def\songclassify{ #1 \par}}

% create a new song key to print the time
\newsongkey{tin}{\def\songliturgy{}}
{\def\songliturgy{#1}}

% Renew the song prelude to print
% the categories
\renewcommand{\extendprelude}{%
\showrefs{\footnotesize\showauthors}%
{\ttfamily\songclassify}%
}


Now I create both author and song indices required by the songs package and set the chorus font to be bold:

% create both song and author indices
\newindex{reltitleidx}{cbreltitle}
\newauthorindex{relauthidx}{cbrelauth}

% bold chorus font
\renewcommand{\chorusfont}{\bfseries}


Thanks to egreg, the following code will add the song number instead of the page number to my indices entries:

% add the song number instead of
% page number
\makeatletter
\patchcmd{\@wrindex}{\thepage}{\thesongnum}{}{}%
\makeatother


Now it's simple enough. The document begins and the songs are added:

\begin{document}

\showindex{My songs}{reltitleidx}

\begin{songs}{reltitleidx,relauthidx}

\beginsong{My cool song}[by={Some guy},sr={},cla={\classify{F,B}},cr={\settime{A,C}},tin={\drawbullets{A,C}}]

\beginchorus
This is a cool song, I wrote it by myself! \rep{2}
\endchorus

\beginverse
Meow, said the cat! Of course you will love this song!
\endverse

\endsong

\beginsong{Another cool song}[by={Some guy},sr={},cla={\classify{B}},cr={\settime{A}},tin={\drawbullets{A}}]

\beginchorus
This is a cool song, I wrote it by myself! \rep{2}
\endchorus

\beginverse
Meow, said the cat! Of course you will love this song!
\endverse

\endsong

\beginsong{Cool cool cool}[by={Some guy},sr={},cla={\classify{FB}},cr={\settime{D}},tin={\drawbullets{D}}]

\beginchorus
This is a cool song, I wrote it by myself! \rep{2}
\endchorus

\beginverse
Meow, said the cat! Of course you will love this song!
\endverse

\endsong

\beginsong{Cooler song}[by={Some guy},sr={},cla={\classify{Q}},cr={\settime{A,D}},tin={\drawbullets{A,D}}]

\beginchorus
This is a cool song, I wrote it by myself! \rep{2}
\endchorus

\beginverse
Meow, said the cat! Of course you will love this song!
\endverse

\endsong

\beginsong{Cool yeah}[by={Some guy},sr={},cla={\classify{F,FB}},cr={\settime{B,C}},tin={\drawbullets{B,C}}]

\beginchorus
This is a cool song, I wrote it by myself! \rep{2}
\endchorus

\beginverse
Meow, said the cat! Of course you will love this song!
\endverse

\endsong

\beginsong{Coolness}[by={Some guy},sr={},cla={\classify{B,Q}},cr={\settime{C}},tin={\drawbullets{C}}]

\beginchorus
This is a cool song, I wrote it by myself! \rep{2}
\endchorus

\beginverse
Meow, said the cat! Of course you will love this song!
\endverse

\endsong

\beginsong{Hallelujah cool!}[by={Some guy},sr={},cla={\classify{F,Q}},cr={\settime{B}},tin={\drawbullets{B}}]

\beginchorus
This is a cool song, I wrote it by myself! \rep{2}
\endchorus

\beginverse
Meow, said the cat! Of course you will love this song!
\endverse

\endsong

\beginsong{Coolest song!}[by={Some guy},sr={},cla={\classify{F}},cr={\settime{A,B}},tin={\drawbullets{A,B}}]

\beginchorus
This is a cool song, I wrote it by myself! \rep{2}
\endchorus

\beginverse
Meow, said the cat! Of course you will love this song!
\endverse

\endsong

\end{songs}

\printindex[foo]
\printindex[bar]
\printindex[foobar]
\printindex[qux]

\end{document}


The output is as we expect:

And the indices are correct:

I can now easily find the songs I want! By the way, my original songbook has now 2000+ songs, powered by LaTeX. :)

That's it, hope you guys like it! Happy birthday, TeX.sx! :)

I have a suspicion that I'm breaking too many rules with this submission. In particular:

1. Include things that a more-or-less everyday document can benefit from.

The purpose of this document is to provide a benefit for those times when you can't use TeX.

2. Limit your document to a few pages, maximally three or four.

I get kinda verbose when I get started. Oops.

3. Annotate your source extensively, so that non-expert users can understand which package and which hack does what.

I didn't do anything particularly amazing, so haven't annotated anything.

4. Your document should mainly be text, but content doesn't matter

Mine is all about the content.

As it's a bit long, the full source and resulting PDF can be found on my webpage. I'll confine myself to the highlights here.

The opening and closing pages:

The crucial part of the source:

\begin{tikzpicture}[scale=2]
\calligraphy[
copperplate,
heavy line width=8pt,
light line width=4pt,
weight=heavy,
annotate,
annotation style={thick,red,->,shorten >=1ex,shorten <=1ex},
annotation shift={(1em,1em)},
annotation node style={1}{fill=white,fill opacity=.5,circle,text     opacity=1,anchor=south west},
annotation node style={2}{fill=white,fill opacity=.5,circle,text     opacity=1,anchor=south west},
annotation node style={3}{fill=white,fill opacity=.5,circle,text     opacity=1,anchor=south},
]
(-.5,1.2) -- (-.5,-.3) .. controls +(60:.4) and +(120:.4) .. (.7,-.3)
(-.5,1.2) .. controls +(-60:.4) and +(-120:.4) .. (.7,1.2) -- (.7,-1.35) +(0,0) .. controls +(120:1) and +(140:1.5) .. (-.9,-1.7)
;
\end{tikzpicture}

• Is this a submission for academic or other? I'd say other since the "crucial part" is about calligraphy? – doncherry Nov 25 '11 at 14:34
• Sounds fine to me. I should have specified, sorry. – Andrew Stacey Nov 25 '11 at 14:46

Here's my contribution:

Like a lot of developers, I'm also a roleplayer who also happens to love DTP. In past years, I translated and/or laid out some free RPGs. One of these is The Shadow Of Yesterday, whose core rules are published under a CC license.

Using a converter written in python, I converted HTML in ConTeXt, added some flair and made available the whole package.

The Source, including fonts (free ones) and a resulting PDF, can be downloaded from here:.

So, here's my entry:

• Name: The Shadow Of Yesterday
• Category: Other
• I agree that all code of mine can be reused; TSOY core rules are under CC, and AFAIK they pose no copyright problems. Same can be said for fonts.
• The style and the font setup looks nice. I am also curious why you converted the HTML markup to ConTeXt markup. Usually, ConTeXt can handle HTML input fairly well. – Aditya Nov 19 '11 at 4:19
• I tried following these instructions: wiki.contextgarden.net/HTML_and_ConTeXt , but I somehow got stuck. So, since I know some other languages, I set off and built a converter in python (which is by no means complete, but it can and it has dealt with some 300kb sized xhtml files). – Max Lambertini Nov 19 '11 at 6:28
• No, I did not mean the method that you linked to. That method is using ruby to convert wiki markup to ConTeXt, so it is essentially same as what you did with python. What I meant was handling HTML as XML and processing it directly. For an example, see Thomas Schmitz's My way – Aditya Nov 19 '11 at 6:42
• Ah, yes: I read this doc, too but I chose to write a converter and work on generated ConTeXt file because: 1) it would help me learn ConTeXt better; 2) it would help me tweak more the generated code; 3) as a coder, it's more fun for me writing some code for conversion; – Max Lambertini Nov 21 '11 at 8:45

At the beginning of the semester, instead of a roll-call (which is impossible, since at my faculty the students are allowed to change groups during the first two weeks and thus there are no "official" lists of people enrolled to different courses) I ask all students to sign themselves on a sheet of paper. But then, it is quite time-consuming to convert this list (usually ordered by the place they are seated) into a nice, alphabetically ordered one. So I decided to prepare this sheet in ConTeXt, which essentially allows me to save work by doing the first step of a merge sort;). (The number of slots for different ranges of letters are chosen to be most pleasing visually for me and reasonable for Polish names; I've never run into "overfull" problems, my groups are usually less than 30 people.)

\setupbodyfont[sans] % I prefer sans-serif font for this kind of stuff

\setuppagenumbering[state=stop]   % I don't want a page number
\setuppapersize[A4]               % I'm European
\setuplayout[                     % Small margins are fine
width=180mm,
height=260mm,
backspace=15mm,
topspace=17mm,
grid=yes,
]
\setupfooter[state=none]          % and footers
\setupinterlinespace[line=6.5mm]  % height is now divisible by baselineskip
\setupbodyfont[4mm]               % This is about 11pt

\startMPinclusions                % Right hook definition
vardef rhook =
numeric r ; r := max(0.25 * OverlayHeight, 4pt);
(0,0) -- ((OverlayWidth,0) xshifted -r){right} .. {up}(OverlayWidth,r)
enddef;
\stopMPinclusions

\startuniqueMPgraphic{rhook}      % Gray right hook
draw rhook withpen pencircle scaled 3pt withcolor 0.4white;
setbounds currentpicture to OverlayBox;
\stopuniqueMPgraphic

\startuniqueMPgraphic{lhook}      % Right hook mirrored = left hook
withpen pencircle scaled 3pt withcolor 0.4white;
setbounds currentpicture to OverlayBox;
\stopuniqueMPgraphic

\defineoverlay[rhook][\uniqueMPgraphic{rhook}] % Overlay definitions
\defineoverlay[lhook][\uniqueMPgraphic{lhook}]

\defineframed[lhookframed][       % New framed-like command
location=low,     % this is equivalent to \inframed
background=lhook, % background picture
frame=off,        % no frame
width=85mm,
strut=no,
boffset=0.5ex,    % this is manual tuning
loffset=0.33em,
align=flushleft]
\defineframed[rhookframed][       % Analogous to the previous one
location=low,
background=rhook,
frame=off,
width=85mm,
strut=no,
boffset=0.5ex,
align=flushleft]

\starttext

\startalignment[middle]           % Title
\tfb
\leavevmode
\lhookframed[width=100mm,align=normal]{Class name}
\startlinecorrection           % Seemingly, this is needed because
\blank[3*small]                % of grid typesetting
\leavevmode
\rhookframed[width=30mm]{Date} % Happily, neither of "Date", "Hour"
\hfill                         % etc. does not have descenders; if
\rhookframed[width=30mm]{Hour} % they were present, I'd use \smash
\hfill
\rhookframed[width=30mm]{Room}
\hfill
\rhookframed[width=30mm]{Class no}
\stoplinecorrection
\stopalignment

\startcolumns[n=2] % two columns
\lhookframed{A--D}
\dorecurse{11}{\rhookframed{}} % numbers are based on my guts and
\lhookframed{E--H}             % aesthetics of this document, but
\dorecurse{11}{\rhookframed{}} % they worked so far
\lhookframed{I--K}
\dorecurse{12}{\rhookframed{}}
\lhookframed{L--O}
\dorecurse{10}{\rhookframed{}}
\lhookframed{P--T}
\dorecurse{13}{\rhookframed{}}
\lhookframed{U--Z}
\dorecurse{10}{\rhookframed{}}
\lhookframed{\hfill\em Marcin Borkowski} % in case the list gets lost
% at my university (this happened to
% me once!), they'll know who's the owner
\stopcolumns

\stoptext

• It may be worthwhile to create a ConTeXt (MkIV) module that allows one to use \framed[frame=off, bottomrule=lefthook]{...} to get similar results. See this gist for a proof of concept. This can be used using \useMPlibrary[hooks]. – Aditya Nov 19 '11 at 20:21
• Thanks for your comment. I read your file, and I have two questions: (1) what is the difference between \startMPinclusions and \startMPextensions? (2) What exactly is \installbottomframerenderer - I couldn't find it in the source browser? – mbork Nov 19 '11 at 21:10
• \startMPinclusions is a user level environment. The contents of \startMPinclusions are overwritten by the next call to \startMPinclusions, unless you add [+]. In contrast, \startMPextensions always appends its contents to the existing extensions. So, the latter is safer when writing a module. (2) \install...framerenderer are defined in pack-fen.mkiv. See meta-imp-fen.mkiv for an example (I followed the same structure for the above module). – Aditya Nov 19 '11 at 21:19