I'm using the listings
package for showing code, as well as algorithms in pseudocode.
This is what I would like happen:
Algorithm 1.1: myFirstAlgorithm()
... content ...
Algorithm 1.2: mySecondAlgorithm()
... content ...
Code 1.1: My First Code Block
... content ...
Algorithm 1.3: myThirdAlgorithm()
... content ...
While this is what I get:
Algorithm 1.1: myFirstAlgorithm()
... content ...
Algorithm 1.2: mySecondAlgorithm()
... content ...
Code 1.3: My First Code Block
... content ...
Algorithm 1.4: myThirdAlgorithm()
... content ...
To change the caption name, I'm using \renewcommand*{\lstlistingname}{Code}
and \renewcommand*{\lstlistingname}{Algorithm}
.
There might be a better way to do this, but in any case I'm still clueless as to how to reset the numbering, or how to keep track of grouping. Any help would be greatly appreciated.