Separation of content and presentation in tables

18 November, 2012 (4 minute read). Category: Formatting. Tags: tables, separating content and presentation.

Separation of content and presentation is one of the selling points of TeX over word-processors. Strictly speaking, TeX is not superior compared to word-processors in this regard. It is possible to obtain a clean separation between content and presentation in word-processors (using styles) and it is possible to mix content and presentation in TeX code, as is illustrated by the following example from sample tex file for the IEEE Conference on Decision and Control:

\title{\LARGE \bf
Preparation of Papers for IEEE CSS Sponsored Conferences \& Symposia
}

(Seriously, how can anyone recommend writing TeX code like that!)

Read more >

Removing multiple blank lines when typesetting code listings

29 September, 2012 (2 minute read). Category: T-Vim. Tags: code formatting, blank lines.

The listings package in LaTeX has an option to collapse multiple empty lines into a single empty line when typesetting code lists. Today, there was a question on TeX.SE how to do something similar when using the minted package. The t-vim module uses the same principle as the minted package. So, I wondered how one could collapse multiple empty lines into a single line in t-vim?

Read more >

Preprocessing Markdown with GPP: Or how I stopped worrying and started using Markdown like TeX

1 June, 2012 (7 minute read). Category: Markdown. Tags: gpp, pandoc.

These days I type most of simple documents (short articles, blog entries, course notes) in markdown. Markdown provides only the basic structured elements (sections, emphasis, urls, lists, footnotes, syntax highlighting, simple tables and figures) which makes it easy to transform the input into multiple output formats. Most of the time, I still want PDF output and for that, I use pandoc to convert markdown to ConTeXt. At the same time, I have the peace of mind that if I need HTML or DOC output, I’ll be able to get that easily.

Read more >

Some thoughts on lowering the learning curve for using TeX

4 September, 2011 (6 minute read). Category: Learning. Tags: asciimode, catcodes.

TeX has a steep learning curve. Often times, steeper than it needs to be. Take, for example, the special characters in TeX. Almost every introduction to plain TeX, eplain, LaTeX, or ConTeXt has a section on these special characters

\ { } $ & # ^ _ & ~

A good introduction then goes on to explain why these special characters are important; sometimes dropping a hint about category codes. I feel that these details are useless and, at the user level, we should get rid of them.

Read more >

Syntax Highlighting engines: Clean TeX output

6 June, 2011 (2 minute read). Category: T-Vim. Tags: code formatting.

The vim module uses the vim editor to syntax highlight code snippets in ConTeXt. I thought that it should be straight forward to support other syntax highlighting engines: source-highlight, pygments, HsColor, etc. Unfortunately, that is not the case. None of these syntax highlighting engines were written with reuse in mind.

Read more >

TeX Programming: The past, the present, and the future

5 March, 2009 (6 minute read). Category: Programming. Tags: tables, separating content and presentation, luatex.

There was an interesting thread on the ConTeXt mailing list, which I am summarizing in this post. To make the post interesting, I changed the problem slightly. So, the solutions posted here were not part of the thread, but are in the same spirit. Suppose you want to typeset (in ConTeXt) all possible sum of roll of two die. Something like this: One way to do this will be to type the whole thing by hand:

Read more >
< Previous Page