The LaTeX Notebook 1-3 (repost)

July 16, 2009 by Daniel Stender · 3 comments · Printer friendly version
Filed under: TeX 

Document classes

The KOMA script (3.0) document classes and packets developed by Markus Kohm and Jens-Uwe Morawski are replacements for the standard LaTeX classes and are widely used and very rich in features. A basic attribute is that in difference to the standard classes of LaTeX they implement typical European typestting defaults like the principle of the Golden Section (Der goldene Schnitt) following the highly influential 20th century typographer legend Jan Tschichold. The developers run a special page for documentation, the documentation is here, and a short reference is to be found here. Read the Practex 3 (2006) article Replacing LaTeX2e standard classes with KOMA-Scipt.

Confproc (0.4f) is a document class for conference proceedings created for the DAFx-06 (9th International Conference on Digital Audio Effects Montréal). A packet like this demonstrates the power of a macro based typesetting system like LaTeX. It features an own BibTeX style and is mend to produce Pdf, so it makes full integrated use of the Hyperref packet. The documentation is here, there is a Report on the making of the DAFX-06 proceedings and finally here are the proceedings. A broad use of tools like this might help speeding up the publishing of conference proceedings in the future. Cf. Vefaille’s A new package for conference proceedings [Confproc] {PracTeX Journal 2007,4}.

Wordlike (1.2b) simply manipulates the standard LaTeX layout in a way that the output looks like made with Word. For whatever reason (being spoiled or the fact that in certain situations something else would be considered as behind), with Wordlike you are able to look like Word but you can use everything else which comes with LateX. Product of the year! The documentation (here) selfevidently is written in Wordlike.

Papertex (1.2a) is a highly customizable class for creating little newspapers, newsletters etc. The developers say that “it is possible to change the aspect of (almost) everything”. There are special environments for news, shortnews etc. Very interesting. Package documentation, example newspaper page here. It seems that the Vidūaka was also made with Papertex. Cf. Tortosa/Bleda’s PaperTeX: Creating newspapers using LaTeX 2e {Tugboat 28 (2007), 20-23}.

Exam (2.3) is a class for easy typesetting of exam scripts (Klausuren). There are environments for apropriate headers and footers, fields for student’s name, multiple choice questions environments, answer fields for the master copy etc. etc. Might be very useful for teachers (there are alternative packets Examdesign and Exams. Documentation here.

Refman (2.0e) provides report and article-style classes for classy (technical) references and manuals with the main feature of a wide left margin for notes, inspired by manuals of Adobe (but a wide right margin would be useful, too). There is a demo document Changing the layout with LaTeX, the package documentation is here.

Some minor hacks

⚫ Setting section titles and description label the same font like the rest:

\setkomafont{sectioning}{\normalfont}
\setkomafont{descriptionlabel}{\normalfont}

Let every new section begin on a fresh page, this can be done with Titlesec:

\usepackage{titlesec}
\newcommand{\sectionbreak}{\clearpage}

⚫ No reset of the footnote counter at a new chapter (book and report classes) is possible with Remreset:

\usepackage{remreset}
\makeatletter
\@removefromreset{footnote}{chapter}
\makeatother

⚫ \pagestyle{empty} for multi-page toc:

\makeatletter
\let\myTOC\tableofcontents
\renewcommand{\tableofcontents}{\begingroup\let\ps@plain%
\ps@empty\pagestyle{empty}\myTOC\clearpage\endgroup}
\makeatother

Footnotes

⚫ Prevent footnotes to be broken to the next page (a standard hack):

\interfootnotelinepenalty=10000

⚫ Proposal for custom footnotes:

\renewcommand{\footnoterule}{\rule{0ex}{0ex}}
\setlength{\footnotesep}{2.5ex}
\deffootnote[1.5em]{0em}{1em}{\textsuperscript%
{\thefootnotemark}
\hspace{0.5em}}

⚫ Continuing (”paragraphed”) footnotes could be done with the Fnpara packet, but the same code is also part of the more versatile Footmisc (option “para”). Multiple levels of footnotes could be realized with the Manyfoot packet (part of the Ncctools bundle by Alexander Rozhenko), but both functions and other features like per page numbering are also provided by the comparatively new Bigfoot packet by David Kastrup. So it’s a good idea to choose Bigfoot until you need even a much more fancier functionality provided only by special much complex critical edition packets like Ledmac (a post on that coming up). For Bigfoot cf. (if available) Kastrup’s Benefits, care and feeding of the bigfoot package {TugBoat 29 (2008), 181 ff.}.

A useful collection of footnote related packets (usually treated together with endnotes and marginnotes) could be found here

Sloppy typesetting and hack ressources

When typing a lot of Sanskrit LaTeX usually has to deal with comparatively long text blocks while often the system is not able to locate hyphenation spots within an English or German or other non-Sanskrit environments (no to mention that proper hyphenation patterns for romanized Sanskrit are still a desideratum). For this it’s widespread to turn the spacing tolerance to \sloppy even if to turn to sloppypar somewhere and in the preamble in particular is considered to be inappropriate (c.f. Trettin/Fenn – Obsolete commands and packages, 1.8: Should I use \sloppy? ). But there are compromising solutions around slightly changing several linebreaking and spacing parameters in a balanced way to to loose up the normally very strict specifications of LaTeX like the hack invented by Axel Reichert:

\tolerance 1414
\hbadness 1414
\emergencystretch 1.5em
\hfuzz 0.3pt
\widowpenalty=10000
\vfuzz \hfuzz
\raggedbottom

I’ve found that hack on Texnik.de which is generally a very good ressource for hacks resp. workarounds. Another very useful ressource for solutions like this or for finding the right packet is the Tex-faq by the German usergroup DANTE. I also recommend Anselm Lingnau’s LaTeX Hacks (O’Reilly 2007, ISBN 978-3-89721-477-4, also German) and a title can’t be missed is certainly Frank Mittelbach/Michel Goossens’ LaTeX Companion (2nd ed. Addison-Wesley 2004, ISBN 0-201-36299-6).

Parallel typesetting

The parallel typesetting of different texts esp. of text and its translation is common and in Indology there are the famous editions made by Ernst Waldschmidt (1897-1985) for example. There are different packets for LaTeX to deal with parallel typesetting of text streams, basically that means providing and aligning custom boxes.

Parrun by M. Dominci (1.1) provides two environments fframe and sframe, which makes the usage a little bit complicated I think. It seems unless not invoked with the option multicol the packet is mend for vertical parallel typesetting (not tested).

Parcolumns (1.2) is part of the sophisticated Sauerj bundle by J. Sauer. The packet provides an environment parcolumns in which the columns are generated with the command \colchunk. Even more than 2 columns are possible on the same page, it’s possible to customize colwidth and distance, it’s possible to leave out column fills … works fine.

The ‘classic’ for parallel typesetting is Parallel (beta 4) by M. Eckermann. That one has basically the same basic usage using an environment Parallel with subcommands ParallelLText and ParallelRText while only two columns are possible. The names are displeasing to type and even for auto 50/50 width there must be empty braces invoking the environment (\begin{Parallel}{}{}). A nice feature is that it’s possible to arrange the columns on different (odd/even) pages. C.f. Mittelbach/Goossens, LaTeX Companion {2nd ed., Addison-Wesley 2004}, p. 3.5 seq. (3.5.2: parallel – Two text streams aligned).

Generally there are some conspicuities dealing with footnotes in the tested packets. Parcolumns withdraw footnotes as far as I can see it completely (a workaround is the use of the packet Footnote (1.13) being a part of the fabulous Mdwtools by M. Wooding: the command \makesavenoteenv which makes footnotes emerge even in traping environments like tabular [!] and parcolumns or one can wrap the environment savenotes around). Parallel generates an own layer of footnotes and places them immediately after the environment ends (if demanded or not) but employs an option SeparatedFootnotes for columnwise handling of its footnotes.

Another solution is Ledpar (03b patch 0.4) by P.R. Wilson which belongs to the Ledmac package for critical editions. Ledmac is one of the most versatile LaTeX packets for textediting available and will be the issue in this series in the future. If one uses Ledmac and wants additional parallel typesetting support surely Ledpar is going to be the choice because it’s somewhat guaranteed to be compatible. Ledpar runs nested environments for the columns (\begin{pairs} \begin{Leftside} \end{Leftside} \begin{Rightside} \end{Rightside} \end{pairs}) and I think that could be improved in the future, but there are a lot of options incl. setting on facing pages, line enumeration, verse typesetting etc. which makes the packet interesting for users which are interested in parallel typesetting but have demands going beyond what is provided by the other ones described above.

When typesetting poetry resp. verses an ordinary tabular might be just enough because there are always comparatively short single corresponding lines and not text streams which have to be aligned. Custom linewidth wide cells could be done for example with the tabular* environment like:

\begin{tabular*}{\textwidth}[]{p{0.4\textwidth}p{0.6\textwidth}}
Test test test & Test test test \\
Test test test & Test test test
\end{tabular*}

To use a tabular for typesetting parallel verses is a highly customizeable method.