I am trying to debug the problem with Paul Taylor's diagrams.sty (not in TeX Live or MiKTeX, but available from CTAN).

Minimal example:


The problem is that pdfTeX draws diagrams correct, but LuaTeX adds big vertical spaces. From macro level tracing shows that both engines does exactly the same.

Runing TL2012:

This is LuaTeX, Version beta-0.70.2-2012080612 (TeX Live 2012/W32TeX)    
(format=lualatex 2012.7.19)  19 JUN 2013 12:06  restricted \write18 enabled.
LaTeX2e <2011/06/27>
LuaTeX adaptation of babel <v3.8m-luatex-1.5> and hyphenation patterns for english, dumylang, nohyphenation, loaded.
Document Class: article 2007/10/19 v1.4h Standard LaTeX document class
File: size10.clo 2007/10/19 v1.4h Standard LaTeX file (size option)
 *File List*
 article.cls    2007/10/19 v1.4h Standard LaTeX document class
 size10.clo    2007/10/19 v1.4h Standard LaTeX file (size option)
 diagrams.sty    2011/04/19 v3.94 Paul Taylor's commutative diagrams

Any hints?

  • 2
    I can't get the code to run at all: something up with diagrams.sty, I guess. Could you add \listfiles to your input and edit in the *File list* into the question. The 'banner' lines with pdfTeX and LuaTeX versions you are using (start of the .log) would also be handy.
    – Joseph Wright
    Jun 19, 2013 at 8:16
  • 2
    The diagrams package uses various \fontdimen parameters and this might be the issue. Possibly a bug in LuaTeX, but it's almost impossible to trace it, because the code in diagrams.sty is obfuscated. Use another package for diagrams, for instance the more powerful tikz-cd.
    – egreg
    Jun 19, 2013 at 9:26
  • 1
    Since he require that you send him copies of your work, I'd say it would be better to use open solutions instead.
    – daleif
    Jun 19, 2013 at 9:36
  • Authors uses that package for diagrams and they use pdflatex. I can't tell them to use tikz. That happens not a first time :(
    – Linuxss
    Jun 19, 2013 at 11:28
  • 1
    @Linuxss -- report the problem to paul taylor and ask him to solve it. i believe his address is in the documentation. Jun 19, 2013 at 18:29

2 Answers 2


If you wish to discuss this or other issues arising from my TeX code, please email me directly because I do not read TeX websites and am not willing to conduct discussions in public.

Thanks to Sean for his welcome, but without meaning to be patronising I did my TeX stuff before he was born and I don't want to join any new TeX "communities", even less to gain "reputation" (I have more than enough of that game on MathOverFlow). As you can see from elsewhere on this page, TeX just caused me grief. Probably many of the other early adopters have similar stories. I maintained an off-the-shelf TeX system for Imperial College before texlive or any Linux package management systems existed and I was abused by the College management for doing so, eventually losing my job.

It would appear that there is a bug in LuaTeX (or a difference from Knuth's TeX) in that \par appears to generate an extra \baselineskip and \whatsit.

If someone intimately familiar with LuaTeX would like to contact me directly I can try to explain what I do with paragraphs within the diagrams package so that they can track this bug down.

For anyone who simply wants to use my package under LuaTeX the quick fix is this: after \usepackage{diagrams} add

% take this out when you update the diagrams package

Please tell me privately whether this is successful.

  • Welcome to TeX.SX! Usually, answers are to be self-contained. While it's very nice of you to offer help via email, this should rather be done as a comment when you get enough reputation. Thank you for all of your contributions to the TeX community. May 11, 2014 at 15:02

The version from


works without any error with lualatex on your example.

That version is now

\ProvidesPackage{diagrams}[2014/12/31 v3.94 Paul Taylor's commutative diagrams]

and produces the same output in luatex and pdftex.

Older answer below.

\ProvidesPackage{diagrams}[2011/04/19 v3.94 Paul Taylor's commutative diagrams]%%


enter image description here


enter image description here

The observant will notice that these are not identical. Might be worth raising on the luatex list.

The luatex code seems to get a double box at the start of a pararaph which means that after \setbox\z@\lastbox doesn't clear the horizontal list and you get an extra blank para generated:


\CD@r ->\CD@GB \lastpenalty \unpenalty \ifnum \CD@GB >\z@ \setbox \z@ \lastbox 
{internal vertical mode: \unskip}


\CD@r ->\CD@GB \lastpenalty \unpenalty \ifnum \CD@GB >\z@ \setbox \z@ \lastbox 
@\par via @0 b=0 p=-10000 d=81000000
@@1: line 1.2- t=81000000 -> @0

{internal vertical mode: \unskip}
  • 3
    Do remember to read the copyright conditions in that package.
    – daleif
    Jun 19, 2013 at 9:07
  • OK, that version at least compiles for me but I do see a difference in the output. Again, I think a list of versions would be very handy.
    – Joseph Wright
    Jun 19, 2013 at 9:13
  • David, do you see difference in the output pdf using lualatex and pdflatex?
    – Linuxss
    Jun 19, 2013 at 9:15
  • @josephwright what do you mean by “a list of versions”? paul taylor has this neat idea that (pretty much) every compilation using his package should fail, first time. i spent some time (on email) trying to talk him out of this, but he stood his ground. afaik, he is no longer working on the package -- he’s not provided us with a new version for ages, but still we have this irritating trapdoor. (similarly, i tried to persuade him to use a licence that would allow tl & miktex to hold the package, but no luck.) Jun 19, 2013 at 10:29
  • 1
    @josephwright this is a loooong-established package, and it seems to use \specials -- i've not checked, but it could well be in the graphics generation. if so, it's no surprise if luatex produces different results, surely? Jun 19, 2013 at 10:36

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .