1

According to section 56.2 of the LaTeX2e sources (which is summarized here), it is possible to use the syntax *{N}{x} to specify xx...x (N times) in the preamble of an array.

I would like to be able to use *{0}{l}. I'm concerned with the fact that the following two pieces of code do not behave the same:

\[\begin{array}{*{0}{l} *{2}{l}}
  a & b
\end{array}\]

\[\begin{array}{*{2}{l} *{0}{l}}
  a & b
\end{array}\]

I'm able to compile the second array but not the first (pdflatex complains about a missing # inserted in alignment preamble).

Is there anything I need to be aware of? As far as I can see, there is no mention of the case N=0 in the documentation, and nothing is said about the first use of the star notation in an array preamble.

If this is a bug in the LaTeX2e implementation, who should I warn?

  • Mmh maybe my LaTeX distribution is faulty then, would you mind telling me if you also use TeX Live 2014? – Fabian Pijcke Feb 28 '17 at 15:43
  • Try to load the array package, i.e. \usepackage{array} – StefanH Feb 28 '17 at 15:51
  • @StefanH, this works, but as I'm writing a package myself, I would prefer not to rely on another package whereas it seems unnecessary for some users ... I'm currently updating my distribution to TeX Live 2015, but if this is a requirement, I would like to be aware of it to at least notify it in the documentation ... Do you think adding array as a package requirement is an acceptable solution? – Fabian Pijcke Feb 28 '17 at 15:54
  • Oh, I'm afraid I didn't the documentation up to page 312 :p Thanks for pointing this out, I'll just add array as a package requirement then :-) Thank you for your help ! @campa I will accept your answer if you post it – Fabian Pijcke Feb 28 '17 at 15:56
  • 1
    @FabianPijcke: If you don't want to rely on another package, then copy the necessary package code into yours and use it. – Werner Feb 28 '17 at 16:10
  • From the documentation of array.sty it seems you need version 2.1 or later. I don't know when this is in time, but the latest version seems to be 2.4d from October 2016. You can specify it in your sty-file as \RequirePackage[<options>]{array}[<version>] but then I think <version> is the date of the version. – StefanH Feb 28 '17 at 16:10
  • 2
    Considering that array has status as a required package, relying on it is probably fine. – Torbjørn T. Feb 28 '17 at 16:15
  • 2
    @FabianPijcke As noted array is absolutely required as part of a LaTeX installation and is therefore assume to be available by the standard documentation. – Joseph Wright Feb 28 '17 at 16:31
  • I didn't know of that list of required packages. Very useful indeed. I'll just add it as a dependency. Thank you all again! – Fabian Pijcke Feb 28 '17 at 16:54
  • Sorry but for what do you need to insert a type declaration for zero columns? Is this for ghost values? – Ulrike Fischer Feb 28 '17 at 17:30
  • @UlrikeFischer, No, this is for a command generating tables that are made of two parts, each of which may be empty. The command has the form \tbl{leftpartheader}{rightpartheader}{values} where each partheader is a (possibly empty) sequence of names and values is a semicolon-separated sequence of comma-separated tuples. – Fabian Pijcke Feb 28 '17 at 18:05

1 Answers1

4

This is more or less documented in the array package documentation (comparing actually against an earlier version of the package rather than against the version in the format), but it says

% \subsection{Comparisons with older versions of array.sty}

...

% \item A preamble of the form {wx*{0}{abc}yz} was treated by

% versions prior to 2.1 as {wx}. Version 2.1 treats it as {wxyz}

David Carlisle
  • 757,742