xparse revisited

2016-10-29 by . 1 comments

At the recent UK-TUG meeting, I spoke about one of the most popular parts of the code written by the LaTeX3 Project, xparse. TeX-sx regulars will doubtless have come across xparse, either in one of the tagged questions or from one of the over 2400 posts featuring \NewDocumentCommand!

At the UK-TUG meeting, I was revisiting xparse following a talk I gave back in 2009. Since then, the LaTeX team have worked on xparse, we’ve learned what it’s good at and we’ve had a lot of user feedback. So it seemed like a good opportunity to take about it again.

I focussed on two areas: what xparse can do for the end user and how that leads on to seeing it’s syntax as a language for described LaTeX commands. For end users, xparse is a more-or-less complete way to describe document commands, and goes well beyond what \newcommand can do.  My usual example is the syntax of \newcommand itself:

  { s +m O{0} +o +m }
  % #1 = Star: \BooleanTrue or \BooleanFalse
  % #2 = Command name
  % #3 = Number of arguments
  % #4 = Default for first argument if 
  %      optional or \NoValue otherwise
  % #5 = Code

What you’ll notice here is that we can collect up all of the arguments in one place with no need to use (La)TeX code to pick up stars, multiple optional arguments and so on.

The xparse package offers several different types of argument, some of which are more common than others. Once I’d briefly outlined them, I talked about some things that xparse can do that ‘normal’ LaTeX commands can’t, for example correctly parsing nested arguments:

\DeclareDocumentCommand\foo{ O{} m }
  {Code using #1 and #2}


% #1 = \baz[arg1] % #2 = arg2

I also talked about how we can get more helpful error messages from TeX by some clever internal set in xparse.

Taking the idea of abstracting different kinds of LaTeX arguments took me to the concept of xparse as a language to describe LaTeX syntax. That’s not limited to being implemented in TeX, and it is also a very convenient shorthand (I use xparse-like descriptors whenever I’m taking about LaTeX commands nowadays, even if the underlying implementation is different). We had some lively discussion at the meeting about how that might fit in to efforts such as LaTeXML, and I’m sure I’ll be following that up in the future.

Filed under Conferences, LaTeX3

TeXtalk: an interview with Mico

2016-05-22 by . 0 comments

Welcome to TeXtalk! Our interviewee is Mico. Mico has collected 158k+ rep, 3,000+ answers, and 730+ badges on TeX.sx. He is a regular participant in the chat room.

more »

Filed under Interviews, TeX.sx

LaTeX Cookbook available to pre-order with 35% discount – updated

Update: extended by 1 week, plus print book availability, see updated image.

As I’m proud of the book: any TeX.SE user who took the pre-order discount but doesn’t like the print book at first sight, could send it to me if in original shape and I would refund personally. Can take copies for friends. :-) But this is limited to already registered TeX.SE users, 20 pcs in total, and 1 per person. For safety. :-D

Dear friends of TeX.SE,

after more than a year of work, I finished the LaTeX Cookbook. It’s a great moment for me, and I’d like to share it with you. Especially, because the years here gave me a lot of inspiration and enlightenment.

The book is a collection of useful and interesting LaTeX recipes. Those are examples with step by step instructions. Each how-to is followed by an explanation of how it works. Then additional tuning details follow.

LaTeX books

Even though each recipe is self-contained, they run like a thread through the common fields in LaTeX. Some are:
  • Starting with document types such as books, presentations, leaftlets, and posters
  • Shaping and tuning text and fonts
  • Working with images and tables
  • Creating bibliographies, glossaries, and indexes
  • Using PDF specific features
  • Doing math with a focus on advanced tasks such as plotting functions, drawing geometry, and doing actual calculations
  • Creating diagrams such as flowcharts, pie charts, bar charts, and trees
  • Applying LaTeX for various sciences

Take a look: Table of Contents.

To give you a better look at the style of this book, I made a website for it: LaTeX-Cookbook.net. The website shows you

more »

Filed under Books

Registering for the DANTE autumn meeting 2015

I already wrote it on LaTeX-Community.org: at http://www.dante.de/events/Herbst2015/anmeldung.html you can now register to the autumn meeting 2015 of DANTE e.V. It takes place on September 5th at the TU Graz. Besides the member’s meeting and the program with talks, there will be an evening gathering the day before, and a tourist program afterwards. Early registering is extremely helpful for the organizers!

The meeting is also open for TeX friends who are not member of DANTE e.V. Participation at the meeting and at the talks is free.

I registered already, and I will fly Sep 4 from Hamburg to Graz and Sep 6 back. If anybody likes to join me, send me an email: I can get up to 2 cheaper tickets for traveling partners, because I work at the airline.

All information regarding place, travel information, and program can be found here.


Filed under Conferences

Meanwhile, at egreg’s desk…

2015-08-05 by . 1 comments


Congratulations for the new milestone, Enrico! :)

Filed under TeX.sx

TeX User Group Meeting 2015

From 20th to 22nd of July, the TUG 2015 conference took place in Darmstadt, Germany. It was a splendid time, and it was so great to meat you brilliant TeX Stack Exchange friends there!

We had

  • awesome presentations, some of the best done by TeX.SE members
  • an excursion to the underground and to the deep past
  • a lot of discussions
  • WiFi :-)
  • a tasty banquet and daily lunch
  • coffee and icecream
  • some beer at night

Joseph posted daily reviews on his blog, so you could follow the proceedings close to the time, or now see a summary.

I posted notes and thoughts on LaTeX-Community.org, you can find daily posts right on the front page. I tried to tell details about the presentations too, so it’s a bit longish. I need to write another post there what happened on day 3, so stay tuned!

I don’t repeat what Joseph and I wrote in the reports in detail, except the most important: thanks to the TUG, thanks to the sponsors DANTE and River Valley Technologies, special thanks to Klaus Hoeppner who did a marvelous job of organizing the meeting!

We made a photo of our TeX.SE group, so guess who is who!

Stack Exchange members


Filed under Conferences, TUG

Thank you, Hermann Zapf

2015-06-06 by . 4 comments

Screen Shot 2015-06-05 at 23.08.04

Yesterday, we lost Hermann Zapf. Brilliant type designer, a very special person. Hermann was 96.

He lived in Darmstadt, Germany and had been an Honorary member of the board of the TeX Users Group since 1980, with the deserved title of “Wizard of Fonts”.

Hermann Zapf directly contributed to the TeX world with the Euler fonts and with several discussions with Donald Knuth about the design of the Computer Modern fonts. His legacy to the world of typography and type design is too big to be reduced to a list of his contributions: just the mention of Palatino, Optima and Zapfino, three fonts he designed, can illustrate his craftsmanship in type design.

Hermann was also a precursor of micro-typography in computer aided typesetting, with his HZ system on which the micro-typographic features of pdfTeX, XeTeX and LuaTeX are based.

Thank you for everything, Hermann.

Hermann Zapf at EuroTeX 2005 in Pont-a-Mousson, France (by Adam Twardoch).

Filed under Fonts

LaTeX Beginner’s Guide available for free download March 4, 2015

As announced a week ago, the ebook version of “LaTeX Beginner’s Guide” written by me is available for free download today, March 4, 2015.

Download LaTeX Beginner's Guide

There’s some background information on LaTeX-Community.org and specifically in a forum thread, and also here on this blog.

I will answer any question to the book’s contents in the LaTeX Community forum. Experts: our forum also needs your help, perhaps have a look at the unanswered questions. Are you able to answer one, even if it’s older? Orginal poster and later readers would be happy!

Some details, simply copied from what I provided to the publisher earlier:

About This Book

  • Use LaTeX’s powerful features to produce professionally designed texts
  • Install LaTeX; download, set up, and use additional styles, templates, and tools
  • Typeset math formulas and scientific expressions to the highest standards
  • Include graphics and work with figures and tables
  • Benefit from professional fonts and modern PDF features

Who This Book Is For

If you are about to write mathematical or scientific papers, seminar handouts, or even plan to write a thesis, then this book offers you a fast-paced and practical introduction. Particularly during studying in school and university you will benefit much, as a mathematician or physicist as well as an engineer or a humanist. Everybody with high expectations who plans to write a paper or a book will be delighted by this stable software.

What You Will Learn

  • Install LaTeX and use the TeXworks editor to compile documents
  • Design the page layout; create dynamic headers and footers
  • Fine-tune appearances and the space of words, symbols, and lines
  • Apply intelligent justification and customized hyphenation to achieve fine text design
  • Typeset professional-looking tables and create bulleted and enumerated lists
  • Write sophisticated math formulas, from in-text expressions to complex multi-line equations with various alignments
  • Cross-reference objects such as figures, tables, and equations
  • Load fonts and vary their shape and style; choose between thousands of LaTeX symbols from specialized fonts
  • Use macros to save time and effort; load packages to extend LaTeX’s capabilities
  • Generate an index, cite books, and create bibliographies
  • Use external pictures, color, PDF bookmarks, and hyperlinks
  • Structure and manage large documents by splitting the input
  • Manage large documents containing lists, index, and bibliography

More details, including table of contents and sample chapter: Publisher’s LaTeX book page.


Filed under Books

LaTeX Beginner’s Guide ebook for free

In agreement with the publisher, the “LaTeX Beginner’s Guide” ebook will soon be officially available for free download. But this will be for a single day only, within the next two weeks. I cannot tell the date yet, not even if it’s tomorrow or next week. Otherwise, the regular price is € 24.97, just € 0,00 during 24 hours, as the publisher allowed.

LaTeX Beginners GuideI’m the author of the book; and I want to make it freely available for our LaTeX friends who support or share our hobby without getting paid or rewarded for it. So, while on Stack Exchange we get reputation points and shiny badges for producing content and for various kinds of activity, there are still older web forums without that game. That’s why my personal reward gets there at first: the whole story with more information and updates is here on LaTeX-Community.org.

Though it’s an internal subforum thread to honor members, everybody can easily join to read it. A small LaTeX challenge question prevents bots from entering, but it won’t be an obstacle for a LaTeX friend.

Life is peaceful there. No race to be the first, and room for all. There are hundreds if not thousands of unanswered questions, and even more unsolved questions

Would you like to help out a bit? If I see some of our fellow TeX friends from here helping with their experience to solve some topics and to answer some lonely question, I’ll thank by sharing the upcoming download link for here as well.

Have a gut feeling that it’s kind of site promotion? Well, LaTeX-Community.org already promotes TeX.SE, for example Luca’s recent articles on the front page are purely advertising TeX.SE solutions.

Filed under Advocacy, Books

TeXtalk: an interview with Paulo Cereda

2015-01-25 by . 0 comments


Image courtesy of David Carlisle (MS Paint skillz FTW)

Welcome to TeXtalk! Our interviewee is Paulo Cereda. Paulo has collected 24k+ rep, 160+ answers, and 240+ badges on TeX.sx. He is an avid participant in the chat rooms, and a lover of ducks. Paulo is usually our interviewer, but today we’ve turned the tables.

more »

Filed under Interviews, TeX.sx