Making visaully attractive posters in ConTeXt

Posters are not or rather were not too common in my research field, so I have never really had a need to create posters. But this is now changing and every now and then, we have to make a poster presentation. I have looked at the different options available for creating posters (see, for example, this TeX.SE post) but I find all of them to be boring. Given that poster sessions are crammed, it is important to create a poster that is visually distinct. So, when it came time to create a poster for a paper that we will be presenting at NecSys 2018 next week, we started looking at something visually distinct. Inspired by a template that my co-author, Mohammad, found, we created the poster shown below.

Read more →

Drawing Metapost animations

The animation module provides a nice interface for using FieldStacks to create a JavaScript controlled animations in ConTeXt.1 For example, the following code will show step-1.pdf, step-2.pdf, step-3.pdf, and step-4.pdf files one by one:

\usemodule[animation]

\startanimation[menu=yes]
  {\useexternalfigure[step-1.pdf]}
  {\useexternalfigure[step-2.pdf]}
  {\useexternalfigure[step-3.pdf]}
  {\useexternalfigure[step-4.pdf]}
\stopanimation

Sometimes, I use animation to give the illusion of motion. For example, to show a particle moving along a trajectory (drawn using Metapost). In principle, it is possible to use the animation module to draw such animations (e.g., see Wolfgang’s reply in on ntg-context mailing list), but the interface gets a bit cumbersome. In this post, I show a helper macro to simplify drawing such animations.

Read more →

Interfacing LuaTeX with Julia

One cool feature of LuaTeX is ability to interface with external libraries using Lua’s Foreign Function Interface (FFI). An extreme example of this is Luigi Scarso’s LuaTeX lunatic, which provides a two way bridge between Python and LuaTeX. Not being a Python fan, I never looked into the implementation details, in spite of Luigi’s impressive examples.

Recently, Henri Menke posted an interesting example that shows how to use a function from GNU Scientific Library (GSL) to inteface with pgfplots. This got me interested in looking into Lua’s FFI in detail. After a bit of trial and error, I finally figured out how to interface LuaTeX with my current favorite programming language: Julia.

Read more →

Using Font Awesome

Font Awesome is a font that provides pictographic icons and is commonly used to display icons for email, editing tasks, popular social media website, etc. It is easy to use Font Awesome in ConTeXt: the font ships with ConTeXt Standalone and ConTeXt includes a symbolset to easily access the icons using names rather than icon numbers.

To use FontAwesome icons in ConTeXt, simply load the symbolset fontawesome using

\usesymbols[fontawesome]

and then any icon is accessible using

\symbol[fontawesome][...]

where ... is the name of the icon is listed in the Font Awesome icon list.

Read more →

Comibined characters in Math

There is a new feature in ConTeXt that replaces some ascii math (I am using this term informally. The symbols do not match the asciimath symbol list). It is enabled using1

\setupmathematics[collapsing=3]

and replaces a combination of characters by a glyph. For example,

\setupmathematics[collapsing=3]
A function $f$ is an increasing function
  \startformula
    x <= y  ===> f(x) <= f(y)
  \stopformula

gives

Example of combined characters
Read more →

Typesetting differential equations

This semester I am teaching a course involving linear differential equations, so I have typeset many differential equations that look like this:

Simple example

Believe me, writing such equations by hand gets tedious very quickly. So, I wanted a macro \LDE (for Linear Differential Equation), so that I could just type

\LDE{1, -3, 2}{2, 1}

and get the above result. This post describes how to write such a macro using LuaTeX + ConTeXt.

Read more →

Frame with solid left line

Adding a solid line on the left side of a frame, block quote, etc. creates a simple, clean, and attractive visual effect that I like.

Simple example

I don’t know when I first came across this style, but it is used commonly on the Internet to show blockquotes. So, how do we get this style with ConTeXt?

Read more →

Drop shadows with lifted corners

There is an old question on TeX.SE asking how to draw drop shadows with a lifted corner. For fun, I decided to translate the code to Metapost and release it as a module: t-backgrounds. I hope to add a few other backgrounds to the module in the near future.

The module provides two overlays liftedshadow:big and liftedshadow:medium. These may be used like any other overlay. Let’s see an example:

Simple example
Read more →

Correct math escape in t-vim

There is a feature in t-vim module that allows the use of TeX code in comments, which is useful when typeset math in comments. For example:

\definevimtyping[C][syntax=c, escape=on]

\startC
/* The following function computes the roots of \m{ax^2+bx+c=0}
 * using the determinant \m{\Delta=\frac{-b\pm\sqrt{b^2-2ac}}{2a}}
 */

double root (double a, double b, double c) {....}
\stopC
Read more →

Rising from the ashes

I used to blog on Wordpress, mainly about ConTeXt, but occasionally about other stuff as well. It has been almost three years since I last posted there. I got busy. Both in my personal and professional life. This is an attempt to restart that blog.

Read more →