The standard way to typeset labels in metapost is using label(btex ... etex, pos), which uses TeX to typeset the label and then includes it in the metapost graphic. ConTeXt simplifies the user interface a little: instead of using btex ... etex, one can simply use label("...", pos), and the string argument is typeset using ConTeXt and included in the meapost graphic. However, both of these are cumbersome to use for dynamically generated labels (i.e., labels whose text depends on the value of some metapost variable). In this post, I show how to use fmtlabel, makes it simple to use dynamically generated labels.
For some years now, I have been maintaining the course notes for my graduate course as a website rather than a PDF document. I started with handwritten course notes the first time I taught the course, and then I typed them up in ConTeXt the next year. However, I wanted to add interactivity to my notes and that was not possible with PDF. (Technically, it is possible using Javascript, but Javascript in PDF has very limited support). So I experimented with maintaining my notes as a website and have been doing so for multiple years now.
Sometimes, for example when sending a review of a paper, I do not want the pdf file to contain any metadata. Ideally, the editorial process should take care of this, but I do not want to take any chances. In this post1, I explain a simple method to strip metadata from PDF files.
This post is not really about ConTeXt but about how I could use ConTeXt to
quickly hash out an idea which involved some text processing.
One of my long running (for more than a decade now) ConTeXt projects is typesetting my CV. I maintain the list of publications as an XML file. I parse the
file using ConTeXt’s XML helper’s and convert the data to a Lua table, and
then typeset it using ConTeXt Lua Documents. When starting with this
project, I chose XML as a data format for two reasons. First, XML scema can be
validated using a Schema. Second, I thought that since XML is so popular,
there must be good tools for authoring XML documents.
As an academic, I often have to write letters and grant applications where I
need to need to prepare a single PDF which includes the letter or the grant
application with one of more research papers “attached” at the end. In
principle, I could generate the letter/grant separately and use a tool such as
qpdf to merge multiple files into a single file. But I find it much easier
to generate everything from a single tex file.
Today I was working on a LaTeX doc and needed to adjust spacing around the
LaTeX itemize environment. I wanted a list of item with no space before the
list environment and the list of items, no space between the items, but space
after the environment. The TeX FAQ has a summary of how to adapt
spacing around itemize environment in LaTeX. Reading that made me appreciate
the control provided by ConTeXt. So, I thought that it is worthwhile to show
that.
Unfortunately, I could not find any reliable method to play such movies in
linux. So, whenever I needed to make a presentation with embedded video, I
would take out a rusty 9 year old Macbook and lug that around. Not anymore!
A while back, a had created a git based tutorial for learning how to
create a presentation style in ConTeXt. I chose a git based style so that it
was easy to see what changed in each commit and what effect did the change
have on the output. But it is cumbersome to work with, especially if you are new
to ConTeXt as well as git.
29 April, 2020
(3 minute read).
Category:
T-Vim.
Tags:
efficiency.
Since I am looking at merging a few pull requests for t-vim, I thought that
this will also be a good time to implement a simple feature that was on hold
for a while: the ability to use the module with Neovim instead of vim.