Skip to content

Commit

Permalink
Make label mandatory for listing environment
Browse files Browse the repository at this point in the history
  • Loading branch information
cdlm committed Feb 29, 2016
1 parent ed9f653 commit 37b78b4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions sbabook.cls
Original file line number Diff line number Diff line change
Expand Up @@ -311,11 +311,12 @@
/tcb/code = {\appto\tcb@new@colopt{,before title={\tcb@blend@beforetitle{\lstlistingname~\thefigure}}}}
% crefname={listing}{listings},
% Crefname={Listing}{Listings}
]{listing}[3][]{
]{listing}[4][]{
sba={#2},
title={#3},
label=#3,
title={#4},
bottomtitle = 1ex,
list entry = {\protect\numberline{\thefigure}{\ignorespaces #3}},
list entry = {\protect\numberline{\thefigure}{\ignorespaces #4}},
#1
}

Expand Down
2 changes: 1 addition & 1 deletion sbabook.tex
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ \section{Source code and listings}
Similarly, use the \code{list text} option from \code{tcolorbox} if the caption
should be worded differently in the table of contents.

\begin{listing}[label=lst:fooNewWith]{Smalltalk}
\begin{listing}{Smalltalk}{lst:fooNewWith}
{A factory method in class \code{Foo}}
Foo class>>with: parameter
^ self new
Expand Down

0 comments on commit 37b78b4

Please sign in to comment.