TeXtalk: an interview with egreg

Welcome to the TeXtalk! We have a special guest for the very first episode of the series: our friend Enrico Gregorio, also known as egreg, one of the most active members of TeX.sx, a trusted user (40k+) with 1075+ answers so far. It’s a great honour and privilege to speak to him!

Paulo: Could you tell us a bit about you?

egreg: I’m a professor at “Università di Verona”, where I teach linear algebra to computer science students; but also didactic of mathematics to math students and future elementary school teachers. I graduated at Padova University (some years ago), my supervisor was A. Orsatti who followed also my PhD studies.

Paulo: You are an adventurer.


Do you have other hobbies?

egreg: You know: basketball and bike tours; unfortunately the bike season is almost over.

Paulo: Ah the winter, I believe.


And you are also a classical music connoisseur.


egreg: I like good music. And I believe that good music was written only before March 26, 1827.


Paulo: I miss him too.


9th Symphony is a masterpiece.

egreg: That’s a bit drastic statement, but I can’t stand Debussy or Ravel or Britten. Not to speak about Schönberg or R. Strauss. But I like the other Strausses.


Paulo: How was your first contact to TeX, LaTeX and friends?

egreg: I first saw the TeXbook lying beside a brand new Macintosh Plus back in 1985 and was instantly amazed by it. But there was no TeX for the Mac at the time. It arrived some months later: it was called MacTeX (a defunct project) and I produced the first paper in TeX! My supervisor stunned at the result: he was used to typewritten papers with symbols drawn by hand.

My first “real” work with the innards of TeX was preparing a “PlainIt” format for getting correct hyphenation for Italian. Before TeX3 only one language was possible. But I was caught.

Then it came OzTeX, with Computer Modern fonts (MacTeX used system fonts except for math and the result was actually not that good).

The first book I prepared were the lecture notes for a course in Linear Algebra; the two teachers had written them in Word. I used AMSTeX and had to define all cross-reference macros.

The manual for AMSTeX had been written by M. Spivak and was a delight to read: The Joy of TeX. The title is a joke based on the famous book The Joy of Sex and the book followed the same pattern: the chapter titles are almost the same.

Until the nineties LaTeX was out of the question for mathematicians: it simply lacked what was needed. But when AMSTeX was ported to LaTeX as AMSLaTeX (by Schöpf and Mittelbach), a new world opened.

I was appointed professor in 1992 and went to Catania, in Sicily. There I had the opportunity of studying better TeX. I still used AMSTeX, but soon I translated my lecture notes in AMSLaTeX, which wasn’t so difficult. Then two colleagues asked me to help them with a “Conference Proceedings” volume.

It was a very big work: more than 20 research papers in Mathematical Physics (which I didn’t understand) full of complicated alignments and big matrices. Some of them were written in Plain TeX, some in LaTeX, others in Word or in ChiWriter. Does anybody know ChiWriter?


It was an MS-DOS program which produced sort of typewritten documents, but was able to insert symbols.

Some months of work, but in the end I was quite proud of the result: the book had a uniform appearance, and many pagination problems had been solved.

Seen today, I see many weaknesses; maybe now I’d do some things differently.

Modern Group Analysis: Advanced Analytical and Computational Methods in Mathematical Physics”, Proceedings of the International Workshop Acireale, Catania, Italy, October 27-31, 1992; N.H. Ibragimov, M. Torrisi and A. Valenti (eds.); Kluwer Academic Publishers, 1993

Actually the papers were 41. Somebody may check their university library for it.

Paulo: CTAN lists some of your packages. Could you tell us a bit about your first package?

egreg: My first package was


. The head of the computer services in our department in Verona manages the abcplus page on SourceForge and asked me to check his macros for including “abcplus” snippets in LaTeX documents. This is an extension of the “abc” language for inputting music. It was, I believe, the first package which exploited the “shell-escape” feature in modern TeX distributions. One can insert “abcplus” input in the LaTeX document and have them compiled by the abcm2ps program for being inserted as graphics.

I was quite proud of finding the package described in the second edition of The LaTeX Graphics Companion.

Later the package was extended to support another music language, “Mup”.

My second package is not for LaTeX, but for Plain TeX. It has a curious history.

Paulo: Please do tell us.


egreg: It’s called


, for “hyphenation plain”.

Babel claims to support also Plain TeX, but I never succeeded in making it work. However, when I was in Catania, I tried to better support multiple languages in Plain TeX (and AMSTeX): just switching hyphenation patterns was not sufficient. So I found a set of macros written by two French, Daniel Flipo and Laurent Siebenmann, and tried to adapt them to my needs.

By the way, Laurent Siebenmann was the author of the first set of macros for graphics inclusion in TeX documents (EPS, but also some formats for the Mac).

I forgot about those macros, because with LaTeX and babel they were not needed any more.

In 2007, a user on the GuIT forum asked about some macros for Plain TeX that claimed to be able to do language switching; he had some difficulties in preparing a format for using them. When I saw the macros I recognized that I was the author!

The discussion is here.

Paulo: What a nice surprise.

egreg: “I seem to recognize myself in the initials e.g.”.


In a few days I rewrote those macros and, borrowing some ideas from


, prepared a package that I sent to CTAN. I don’t know if there’s someone around the world that uses them. I should finish version 2.0, sooner of later: it should support also XeTeX.

Paulo: Speaking of packages, what would be the most popular one? I believe it’s


. Claudio Beccari and you did a wonderful job,


is undoubtedly a capolavoro. I use that package a lot.

egreg: The next package was


for converting numbers into words in Italian, say for getting “Capitolo uno” from the


command. I don’t remember who asked me about it; there is


that claims support for Italian, but it’s just wrong, as it’s derived from Spanish where numbers are spelled out in a very different way. We say “ventuno”, not “venti e uno”. I tried to make fmtcount work for Italian, but did not succeed. So I wrote my package.

When I was writing it, I met on the train a former student of mine who was travelling from Milan where he worked to Padova. So I told him about my problems and he suggested a way to solve the “trentatré” problem I had: you see, all numbers ending in 3 must take an accent, but not “tre” itself. Once I solved that, the rest was already in place and the package was released.

The next package was


; it’s a small package that provides the Steinmetz notation for phases that’s used in electrotechnics; this too originated from a post in the GuIT forum.

Then it came



At a GuIT meeting Claudio Beccari, the first Italian TeX guru (the author of the hyphenation patterns for Italian and of the Greek fonts


), presented a paper about running MakeIndex during the compilation of a LaTeX document. They were the days when the restricted shell escape feature of TeX Live was being proposed; it was planned for insertion in TeX Live 2009, but was withdrawn for technical problems.

It consists in allowing a small set of “safe” programs to be run via shell escape even if the option is not used in the command line. MakeIndex is among them, since it can’t run other programs from itself, along with BibTeX and some others. The main purpose is to allow automatic conversion from EPS to PDF.

The small macros presented by Claudio caught my attention and soon I had a prototype. Then we added support for multiple indices and also for doing indices in one or more columns, not only the two provided by standard LaTeX. It’s quite customizable and I think it’s a good package.

I learned something when I was writing it, particularly for the support of



Paulo: How nice! I watched one of his keynotes, called “Uso del comando


per comporre l’indice analitico in modo sincrono” (available here). You are by his side. I found it very interesting.

egreg: That’s exactly the contribution I was mentioning. I already had some experience from abc and saw the potential of the idea.

Paulo: You’ve been using TeX, LaTeX and friends for a considerable amount of time. How do you see the future, specially with new gems like LuaTeX, an extended version of pdfTeX using Lua as an embedded scripting language, and LaTeX3?

egreg:I should tell that I like XeTeX very much, but probably LuaTeX is the way to go. I’ve never really plunged into LaTeX3 programming, but it’s something that I need to do.

Paulo: Will I see you programming in Lua?


egreg: Maybe, if I find the time to study it instead of answering questions on TeX.SE or the GuIT forum (where I have 10446 messages).

Paulo: You are one of the most active members of TeX.sx. How did you become aware of this community?

egreg: I saw some references to TeX.SX when Googling for answers to TeX problems and I started to look at the site. I discovered a very friendly place and registered after a few days; I already had given my first answers. The first was on March 25, 2011, which got 2 upvotes.

The second one was accepted!

Paulo: You mentioned a very friendly place. How do you feel about TeX.sx?

egreg: It’s different from the other TeX site I’m active in, the GuIT forum. Here there’s much more people from every part of the world and also many great experts. It’s always nice to see answers and to get hints for improving my own. It’s also nice to be able to help out. To be honest, in the GuIT forum I’m seen as the deus ex machina, but I’m glad to see somebody that contributes good macros and solutions.

Paulo: I’m sure everybody wants to ask you this: when will you post your first question at TeX.sx?


egreg: When I’ll have a problem that I’m not able to solve.


Paulo: You just hit 40k and will soon earn the Legendary badge. It’s a great achievement. How do you see another year for TeX.sx? Will you reach 80k, perhaps?


egreg: It’s kind of addictive. But I’m trying to restrain from answering as soon as I see a question, maybe giving just a comment that others can use to build a real solutions. However it’s always thrilling to see that my answers are upvoted.

Of course I’d like to get the Legendary badge before Martin.


Paulo: We are trying to restrain him, but it’s difficult!


I had the opportunity to watch your keynotes (archived in the River Valley website), and you are very didactic. It seems so easy when you explain the ways of the TeX force. What is your secret?


egreg: I started teaching when I was in high school. We had a math teacher who was not very good and I went to my classmates’ to help them. It’s a very good training. I’ve never had any formal education in teaching. But I found myself in a classroom with high school students just when I was finishing my PhD thesis and I had to do something about it. I already did private lessons, but it’s quite different.

Probably it’s something that you’re born with.

Paulo: Your examples through “la faccina sorridente” made me smile. It was very intuitive and didatic. And I really understood everything you explained!


egreg: One has to build complex explanations from the basics up to the roof.

That’s what I use also for answering questions. First trying to do a small prototype and then build up on it.

Paulo: In one of your keynotes for the GuIT, you paraphrased your “Maestro” by saying that “when talking about TeX it doesn’t matter what language you are using.” Is that true?


egreg: TeX is a universal language. One has to know some English, but just to grasp the meaning of the primitives. Then you only have to follow the macro expansions.

Probably the training with Plain TeX in my first years with TeX helps me in finding where things go wrong.

Another thing that I find useful is to write about something. You learn very much. I used this method when studying: I took notes and then I completely rewrote them once or twice.

Paulo: What do you recommend for a newbie eager to learn TeX, LaTeX and friends? (/me is included)

egreg: The TeXbook is the source. I’ve always it at hand and I consult it very often.

lockstep: What are your “most wanted” features for LaTeX3?

egreg: Well, I don’t know precisely. I see much space for improvements in package and class writing: all the hacks that hyperref has to do, for instance, can be already incorporated in the macro. What I like is the multilayer structure: basic macros, interface builders and user macros, well distinct from one another.

Yiannis Lazarides: What you think about the LaTeX3 syntax? Does it need some syntactic sugar?

egreg: Honestly I’ve some difficulties in reading LaTeX3 packages, but it’s probably due to old habits. What’s needed is an effort in expanding documentations. But they also have a big deal of syntactic sugar, I believe.

Yiannis Lazarides: I posted a question in January this year asking the community what they think about TeX and the new media. What do you think? As a sidenote I was quite thrilled to have a book I was working on, talk back to me!

egreg: I can see a place for TeX in ebooks and some works is ongoing, it seems. But I agree with Ryan’s answer that a piece of software should do well one thing.

Paulo: Thanks a lot for your time! Grazie mille.


egreg: Grazie a te!

Stay tuned for the next episode of TeXtalk!

Leave a Reply

Your email address will not be published. Required fields are marked *