SquareBracketAssociates / EnterprisePharo

A new book describing Pharo librairies to make business.
http://books.pharo.org/enterprise-pharo/
Other
71 stars 24 forks source link

Captions and labels in listings are mixed #74

Closed DamienCassou closed 8 years ago

DamienCassou commented 8 years ago

Both the sbabook documentation and old issue say that listings have 2 mandatory arguments, the caption being the second one:

\begin{listing}[float]{ston}{Export into a specific folder}
{
  "title" : "My first document while reading the 5 minutes Pillar tutorial",
  "outputDirectory" : "result"
}
\end{listing}

but, this does not work. I have the impression that this environment expects a third mandatory argument for the label. With no 3rd argument, the listing content is used as the caption, and Export into a specific folder is used as a label. Indeed, in an sbabook example, this is how listings are used:

\begin{listing}{Smalltalk}{lst:fooNewWith}
{A factory method in class \code{Foo}}
Foo class>>with: parameter
  ^ self new
    initializeWith: parameter
\end{listing}

What should I do?

DamienCassou commented 8 years ago

/cc @cdlm

cdlm commented 8 years ago

Use the source, Luke :) Documentation is by definition out of date…

DamienCassou commented 8 years ago

what should pillar output when the author provides a caption and no label? Previously you said that was fine.