Welcome to the TeXtalk! We have a very special guest for today: our friend Aditya Mahajan, one of the most active members of TeX.sx, 18k+ rep, 91+ badges (including the ConTeXt badge), 310+ answers so far, and our resident ConTeXt expert. Get ready for this awesome interview!
- Paulo Cereda
- Friends, welcome to the TeXtalk! Our interviewee today is Aditya.
- Aditya
- Thanks for asking me for an interview, Paulo.
- Paulo
- We are honoured to have you here with us.
:)
Could you tell us a bit about yourself?
:) - Aditya
- I grew up in India, did my graduate studies in US and now am working in Montreal, Canada (as an Assistant Professor in Electrical and Computer Engineering in McGill).
- Paulo
- Cool! Any hobbies?
:)
- Aditya
- You mean apart from TeX hacking.
:)
Well, I usually like outdoor activities like hiking and canoeing/kayaking. And also play volleyball and squash.
- Andrew Stacey
- In my mind, you are most associated with ConTeXt. Did you start out (meaning, when you started using TeX) using ConTeXt?
- Aditya
- No, I started with using LyX, back in 2002 or so.
This was when I was an undergrad, and personal computers were not, well, personal. You had to go to a lab to work on a computer… and I started using LyX to write project reports, etc. Soon, I moved to LaTeX because I found LyX very limiting.
- Andrew
- What was your progression to ConTeXt? (I’m assuming that your main TeX tool is ConTeXt – correct me if I’m wrong)
- Aditya
- Believe it or not, I mostly use LaTeX!
I started using ConTeXt for drawing MetaPost diagrams (it was easier to get labels etc in ConTeXt), and you could compile a ConTeXt file online (on contextgarden.net; thanks Patrick Gundlach).
I always liked to tweak the layout of my documents, and soon found LaTeX to be very frustrating.
- Joseph Wright
- Very true: ConTeXt is, I’ve always thought, closer to plain TeX in terms of letting the user make design decisions than LaTeX is.
- Aditya
- I remember, I was using the Koma-Script classes, and wanted to change the color of the rule in a footer but there was no option for it. I had to create my own copy of the core class, and color tags to the rule. So I started thinking that there should be something better, and discovered ConTeXt.
- Joseph
- We don’t get many MetaPost questions: do you find it easier to use than the alternatives (assuming you have tried them)?
- Aditya
- I find MetaPost easier to use than TikZ and Asymptote (I haven’t tried others), mainly because I understand metapost very well. TikZ is more powerful and provides a higher level interface that I like, but I always have to hunt around options in the (great!) manual. With MetaPost, I mostly know how to get a particular affect.
- Andrew
- How do you find the “double life”? Is it easy to switch between LaTeX and ConTeXt?
- Aditya
- I usually switch effortlessly between LaTeX and ConTeXt. But then, I don’t try to tweak the output in LaTeX too much. Mostly I use LaTeX to write journal articles and normally the publishers provide a style file and I simply use that. With ConTeXt, I experiment around with layout and features more often.
- percusse
- 5 posts in and we are in TikZ business.
:)
What exactly keeps you going with ConTeXt? Is there any particular application that you have to maintain with it or just the intellectual challenge?
- Aditya
- At some stage, I used to write papers in ConTeXt and then convert them to LaTeX when the final version was due. But that was simply extra work with very little reward. So, now I just write in LaTeX.
Actually, I prefer ConTeXt because I don’t like the intellectual challenge of using LaTeX.
:) - percusse
- Blasphemy!
:)
- Andrew
- And what sort of documents do you use ConTeXt for, then?
- Aditya
- I use ConTeXt for presentations and course handouts. I find the usual LaTeX layout to be too boring… so I like to change things a little. LaTeX can be very inflexible at times. ConTeXt is much easier to tweak, and that is why I keep using ConTeXt when I want to create a personalized look for my articles.
As an example, the first serious project that I did in ConTeXt was writing homework solutions for a course that I was TAing.
I had used the exam class in LaTeX, but with ConTeXt I could get something more interesting.
- Andrew
- Beyond layouts, is there another feature that you consider easier in ConTeXt than LaTeX (to give a context – ha ha [editor’s note: I couldn’t resist. – PC] – I’m curious as to whether there would be a “must have” that would persuade someone like me to give it a whirl)?
- Aditya
- Feature wise, ConTeXt and LaTeX are equally good (or equally bad). What I like about ConTeXt is the consistent interface. Most of the time, you can just guess the name of the command that will achieve a particular feature; so there is no need to hunt around manuals or online forums for how to do X and Y. With LaTeX, each package author chooses his/her own interface, and I find it very hard to remember the names of different commands.
In addition, ConTeXt interfaces very nicely with MetaPost. So, you can add fancy backgrounds etc.
But the biggest reason for me to use ConTeXt is that I can program packages in ConTeXt, while I am not good at writing code in LaTeX. The reason for this is that the core ConTeXt code is very readable.
- Joseph
- Funny, I always find the opposite, as there seem to be far too few comments, but then I’m used to the
.dtx
format I guess.
- Aditya
- ConTeXt code has few coding comments, but it has comments which explain why a particular decision was made. But my main difficulty with LaTeX code is all those
@
at weird places and omitting vowels (
\infnty, I am looking at you) ConTeXt uses readable command names.
- Andrew
- Okay, so if I wanted to give ConTeXt a fair try, what type of document would give it “the best chance to shine”? (Hope that’s clear)
(I promise I’ll try to think up something non-ConTeXtual for my next question!)
- Aditya
- Anything for which there is not an existing LaTeX class.
:)
On a more serious note, suppose you want to make a presentation that looks good but doesn’t look like a “beamer presentation”. ConTeXt lets you easily create your own presentation style.
- Harish Kumar
- Hi Aditya: can you point us to a good source of information for (a) installing ConTeXt, (b) a manual for absolute beginners, (c) some templates to start with?
- Aditya
- (a): I would recommend ConTeXt Standalone.
(b): “ConTeXt an excursion” (although it is a bit dated now).
(c): Hello World.
- Harish
- Looks like you are a mathematician?
- Aditya
- Not a mathematician, but an engineering working in a math heavy subfield.
- percusse
- Didn’t know you are a control guy! Robust LMIs here.
:)
So it is possible to work in control theory and actually do something good. You are my idol from hereafter.
:) - Aditya
- Good to meet another control theorist (we are becoming an endangered species).
- percusse
- Indeed.
- Andrew
- Would I still be using beamer – albeit in ConTeXt mode – or do you mean that ConTeXt has its own presentation code that is easier to style than beamer?
- Aditya
- No I mean developing your own individual style for presentation; something that is different from the run of the mill. For example, this is the style that I use (although it keeps on evolving).
- Andrew
- Something I pick up from your blog – though I may be reading more into it than you mean – is that you are interested in the general problem of writing for the web as much as for “traditional” outlets and how to make use of TeX for that. What got you interested in that?
- Aditya
- I am interested in using a single source to generate multiple output formats, and of course, web is an important output format. I think that this is especially important for course handouts etc. I find that students are more likely to read online (HTML) course notes than PDFs, especially in non-mathy subjects.
I want to use the same source to generate my lecture slides, the course handouts, and the online notes (HTML + someday, epub).
- Andrew
- Do you feel that you have a working system (perhaps that needs a few more manual tweaks than ideal, but working nonetheless) or that you have some of the pieces but are still missing major functionality?
- Aditya
- Presently I use markdown input, preprocess it with GPP, and generate multiple outputs using Pandoc (I blogged about it here). I like this setup.
- Andrew
- I’d just noticed that one and “bookmarked” it for later reading. The preprocessing step gives a hint that you wouldn’t list Markdown as an ideal input syntax.
- Aditya
- Markdown in too inflexible. I would have preferred something like
rst
or
asciidoc(because you can define new “environments”), but Pandoc doesn’t complete parse those formats, and I don’t know of any other converter that generates ConTeXt.
- Andrew
- What would you think of a ConTeXt-to-Markdown package?
- Aditya
- I think that a ConTeXt-to-Markdown package will be interesting… based on your question on TeX.SX I had worked on a prototype that worked for simple things (section headings, emphasize, bold, etc).
- Andrew
- You’ve mentioned epub a couple of times. Do you attach a particular importance to being able to produce epub format? Do you think that being able to produce documents with mathematics (as that seems to be the real sticking point at the moment) is very important or is it more that it’s a current “hot topic” that would be nice to have, but if it doesn’t materialise then no real harm done?
- Aditya
- Nothing as grandiose. Just that I prefer to read on an eink device rather than a LCD screen; so I would like to have an epub output so that I can use it.
:)
- Andrew
- Perhaps not grandiose, but for me that’s more towards the end of the scale where it would be a significant advance rather than just following a current trend.
- Aditya
- I agree. But currently the best bet for reading mathematics on an eink device is to format a PDF with an appropriate size. I hope that at some stage eink devices start understanding MathML.
- David Carlisle
- perhaps, once epub3 starts to take hold.
- Aditya
- I hope that eink devices will implement the whole standard and not just bits and pieces that they find convenient. It has taken so much time for MathML to become workable on the Web that I am not too optimistic about eink devices.
- Joseph
- Very true: one issue is that there is probably not much money in it, out of the entire scope of e-ink tools (there are a lot of books that don’t need math support).
- David
- Implementers always try to implement as little as they can get away with.
- Aditya
-
:)
- Paulo
- out of curiosity, which editor do you use for LaTeX/ConTeXt?
:)
- Aditya
- Vim, FTW.
- Paulo
- Yay! /me pokes David Carlisle
The
t-vimmodule for syntax highlighting is very impressive. Could you tell us a bit about it?
:) - Aditya
- This started as part of my first ConTeXt project: Writing homework solutions. One of the assignments required Matlab code. ConTeXt provides syntax highlighting features for a few languages, but Matlab was not one of them. I tried creating my own syntax highlighting style in ConTeXt. I got something working but it was too much effort. At the same time, there was some discussion on the context mailing list about using tweaking
2HTML
command of Vim to get it to work with ConTeXt, and Nicola and Mojca posted some proof of concept code. I cleaned it up a bit and released the first version of
t-vimwith Mojca after a few years, I wrote the filter module (for preprocessing Markdown), and realized that I could redo all the boilerplate code in
t-vimusing the filter module as a backend. And this is where
t-vimstands today.
- Paulo
- How did you become aware of the TeX.sx community?
:)
- Aditya
- I think from a blog post by Joseph.
- Andrew
- I’d also like to ask about the TeX-SX site. Again, my perception of you is as a tireless campaigner for ConTeXt-rights. Do you feel that the site gives you an opportunity to show off what ConTeXt can do (in the nicest possible way), or do you sometimes feel as though you’re fighting against the hoards of LaTeX?
- Aditya
- I have found the TeX.SX community to be very receptive of my (sometime bordering on trolling) ConTeXt answers to LaTeX questions.
I usually do not answer to show off ConTeXt abilities, but rather to make a point that TeX need not be difficult… as LaTeX often gives that impression to new users.
- Joseph
- There’s a reason I’m working on LaTeX3.
:-)
- Aditya
- I know. And LaTeX3 is a great effort in the right direction. Hopefully with a consistent core, it’ll be easier to develop an easily configurable macro package on top.
- Joseph
- That’s the plan. Also to address the design issues. But that’s for an interview with Frank Mittelbach. 😉
- Andrew
- To be clear, I meant “show off” in the best possible sense: to exhibit a showcase of ConTeXt’s abilities.
- Aditya
- I understood that.
- Andrew
- Another of my impressions of you from this site is as an answerer rather than a questioner. Whilst perhaps not on egreg’s scale – you have asked 3 questions, after all – you are by that measure more of a giver than a receiver. Do you see your participation here as part of giving something back to TeX, or do you find yourself learning from the site as well?
- Aditya
- Again, nothing that noble. I just browse the site at the end of the day to relax, and answer the easy questions (the one’s that ask how to I do X in LaTeX and I give a one line ConTeXt reply).
:)
- Andrew
- That’s pretty noble! You’re helping people you’ll probably never meet, and often in ways that they aren’t quite expecting (ConTeXt answer to a LaTeX problem). I’m still curious as to the draw of this site for you…
- Aditya
- I used to follow
ctt
when I started with LaTeX and learnt a lot from that. But after a while I stopped following it (I don’t remember the reason now). I find TeX.SX to be similar in spirit to
ctt, without the spam, trolling, and flame wars.
- David
- I think everyone would agree that the mass of packages makes LaTeX bewildering for a newcomer (or someone who stepped out of the loop for a decade) but do you think conTeXt has developed methods that make it possible to manage 30 years worth of contributed code and maintain order, or does it just benefit (for now) by not having the volume of contributions?
- Aditya
- I think that one big difference between ConTeXt and LaTeX is that ConTeXt developers are not afraid of modifying the core macro package to add more features, often breaking backward compatibility. LaTeX, on the other hand, works very hard to maintain backward compatibility. So, some packages like
fix2e
will never exist in ConTeXt.
The other difference is that ConTeXt provides lots of hooks for customization, so packages like (the one that indents the paragraph after section headings) will not exist.
- David
- So the question is for example would journals ever switch to a format that took that approach (that they need to archive the format used for each article rather than rely on the format being stable) (yes more hooks is clearly a good thing although it was hard to add in 1993 when we only had about 10 csnames left after latex2e loaded to fit into a DOS emtex).
- Aditya
- In general, I think that big publishers will never choose a moving target. There is one Dutch journal that uses ConTeXt, and I think that the approach that they have followed is to freeze the ConTeXt distribution that they use. But, on the other hand, the same is true, to some extent, with LaTeX as well. I think that there are a very few journal who will accept packages written with the
breqn
package, for example.
- David
- Yes true although it may be easier to “ban” an experimental package than to ban use of an experimental format (or at least that view has traditionally shaped LaTeX development).
- Aditya
- Another difference in ConTeXt modules right now is that once you release a module, experienced users give you feedback on the coding style and the interface (I have received a lot of advice from both Wolfgang Schuster and Hans Hagen on my code). This ensures that the modules follow the same style as the core macros, leading to fewer interface conflicts. I am not sure if such a method will scale.
- Joseph
- That’s why I’m keen on having proper style/API guidelines for the LaTeX3 work I do. Same concept, done in a slightly different way.
- Paulo
- Amen to that. Gotta love code guidelines.
:)
- Aditya
- (tongue in cheek remark, no offence meant): and on a different timescale.
- Joseph
-
:)
- barbara beeton
- regarding your comment about few journals willing to accept submissions using the
breqn
package, it might interest you to know that development of this package was initiated at AMS by Michael Downes with exactly that intent in mind, to make it easier for authors who needed matching delimiters that fell on different lines in multi-line displays. work on the package stopped with Michael’s death in 2003.
rights to the
breqnpackage were released to a then-member of the latex3 team with the understanding that it would be brougnt to completion in such a way that it would be usable by AMS as originally intended. work has once again stalled before completion, hence the hesitancy in recommending its use. we do intend to allow, even encourage, its use upon successful completion according to the original design.
- Aditya
- I did not mean to single out
breqn
package. In my comment, I meant that there are LaTeX packages that drastically change TeX/LaTeX internals (
breqnjust being the most powerful of all such packages). Hence, before introducing it into their work flow, a journal will need to test that the package does not break anything. The situation with ConTeXt is similar in some respect.
If a journal is using ConTeXt and wishes to move to a newer version, they will need to test it thoroughly.
- Kannappan Sampath
- May I ask you about your undergraduate studies at India?
- Aditya
- Sure.
- Kannappan
- So, what did you major in as an undergraduate?
- Aditya
- Electrical Engineering.
- Paulo
- CTAN lists some ConTeXt modules of yours. Any plans for a LaTeX package?
:)
- Aditya
- I actually tried porting the
mathsets
package to LaTeX but failed miserably. (I think that this was before Joseph’s article on parsing key-value options in LaTeX, which was the main hurdle that I faced; I did not try again after reading Joseph’s article). At some stage I’ll like to port the filter module to LaTeX, but that’s a long term project.
- Paulo
- I’m always impressed to read your ConTeXt answers.
:)
Is there anything that is more difficult to achieve in ConTeXt than in LaTeX?
- Aditya
- Bibliography for one. ConTeXt bibliography support is not as mature as LaTeX’s. Also display math. Although ConTeXt provides most of the features provided by
amsmath
package, the display math support in ConTeXt is not as polished as that of LaTeX.
- Kannappan
- What is the average time you take to typeset in ConTeXt (and in LaTeX), a file of say ~5 pages?
- Aditya
- I guess around 5-10 minutes. I normally compose everything with pen-and-paper, before I start typesetting, so the actually time to typeset is simply the time taken to type. But sometimes tweaking the layout to something that I like could take an hour or so, but most of the time is spent on experimenting different options.
- Kannappan
- 5-10 minutes is simply too fast!
:-)
- Aditya
- Perhaps I underestimated. I have never timed my typing speed, and of course, it depends on what you mean by a page.
:)
- Kannappan
- And, that you teach, I would like to ask you – do you like meeting younger(-than-graduate-students) generation of people, why or why not?
- Aditya
- I generally like meeting people. As a professor, I do meet a lot more undergraduate students than graduate students, but I don’t interact with anyone differently based on their age.
- Kannappan
- Cool!
- Paulo
- Do you have a favorite answer of yours?
:)
- Aditya
- I’ll have to search for the exact link, but it was an answer by Frank on using coffins.
- Paulo
-
:)
- Aditya
- Before this, I did not know what
xcoffin
package does. This entire relative position concept is very interesting. I sometimes need something like this for presentations, and I usually resort to MetaPost for positioning.
- Paulo
- Can you name something you really like in ConTeXt? And is there something you dislike?
:)
- Aditya
- At the interface level, I really like ConTeXt’s consistent user interface; in terms of features; the buffer mechanism in ConTeXt is really great (think of it as copy-paste on steroids); and at the community level, the speed at which Hans implements a feature request.
Sometimes, the constantly changing core is a headache. As a user, I have learnt to work with it (one copy of the context standalone for each long term project); but as a module writer, it can be frustrating. I also wished that the “stable releases” in ConTeXt were more well tested than they currently are.
One of the biggest strength’s of ConTeXt is the community. Most questions on the context mailing lists are answered within minutes… I remember when I first started using ConTeXt, one of my complaints was that ConTeXt did not have any support for multiline display math, and Hans sent a patch that implemented those features the next day.
- Paulo
- How nice!
Ready for LaTeX3?
:) - Aditya
- To be honest, I have not followed LaTeX3 code too closely. I have read a lot of LaTeX3 code in the
mathtools
and the
breqnpackage, but I tend to ignore everything after the
:.
But sometimes, LaTeX3 vs ConTeXt feels like the Right thing vs worse is better (LaTeX3 trying to do the right thing).
- Paulo
-
:)
What do you recommend for a newbie eager to learn ConTeXt? (/me is included)
:) - Aditya
- I’ll assume that the newbie is familiar and comfortable with using logical markup (either in LaTeX or HTML or any other markup language). Otherwise the answer will be too long.
:)
I’d suggest that you start on a non-critical project (that is, hell does not break loose if you don’t get the exact format/layout that you want) when you have time to learn (everything said and done, ConTeXt still has a learning curve). Read “ConTeXt an Excursion” (it can be read in a single sitting) and start typing… use logical markup, even if you don’t get the right output that you want. That is, if you don’t know how to get a particular effect, just use
\definestartstop[logicalname]and use
\startlogicalname ... \stoplogicalname(you can come back to this later). Once you are done, look in the main manual and the wiki to see how to achieve the particular effects that you wanted, and if you cannot figure it out, ask on the context mailing list.
I think that it is important to start small. Your first ConTeXt document may not look too different from your typical LaTeX document, but once you get the basics of ConTeXt, you can use can start adding more features to the output.
I actually think that a version control system is a great way to teach LaTeX/ConTeXt. I thought about writing a git repo, where the first commit is just a bare bones article, and then each commit adds one additional feature, until you get the final result.
- Paulo
- That’s a clever idea.
:)
Thanks a million for this awesome interview!
:) - Aditya
- Thanks a lot for interviewing me. It was a great experience.
- Joseph
- Thanks for a great interview!
Stay tuned for the next episode of TeXtalk!