TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am using the covington package to manage my examples. I would now like to create my list of examples, right after my list of figures and tables. Is there any way to do it?

example of an example:

\item blabla
share|improve this question
Have a look at the answers here and see if they work for you. I don't know whether using covington would change anything. – Scott H. Nov 29 '12 at 7:40
Welcome to TeX.sx! The examples in the covington package are numbered using the equation counter, so this Table of Equations question may help you. – Andrew Swann Nov 29 '12 at 7:47
What should be typeset in the list of examples in the case you mention? – egreg Nov 29 '12 at 7:49

The example environment provided by the covington package is a list environment with the individual items labelled via the equation counter. This does not fit too well with standard solutions to this type of problem: e.g. thmtools works for theorem like environments instead.

The code below uses the tocloft package. However, the standard set-up involves using a new counter. I have chosen to change the counter used by the example environment, so these are now numbered differently from equations.



\newcommand{\listofexamples}{List of Examples}






\item An example
\item Another example


  Last example


Sample output

The above code sets up the list of examples mechanism in the standard tocloft way and then provides a new version of the example environment with the equation counter replaced by an example counter at each instance. The labelling command is extended to add an appropriate line to the table of examples via the \lentry command. I have also included a redfinition of the only other command in the covington package that uses the equation counter for examples.

Finally, remember to run latex on such a file twice to get the correct numbering in the list of examples.

share|improve this answer

Here's a solution that uses the \@starttoc to start a new file \jobname.exs which stores contentsline information about the example and examples environment. I've borrowed some ideas from Creating list of for \newtheoremstyle

I've used the etoolbox to append \item with the crucial part about \addcontentsline, but only if it is inside an example or examples environment (we wouldn't want it to happen inside of another list such as enumerate, itemize, etc) as both are set up in terms of a list environment; I've set up a bool to check if we're inside example or examples.


\usepackage{lipsum}% just to generate text

% this sets up \jobname.exs which will store the 
% contentslines added on each example or examples
\newcommand\listexamplename{List of Examples}

% Note that the example and examples environment are defined
% in terms of a list; we test if we're inside either environment
% by setting up a boolean; note that this boolean will only 
% be local to the environment, and will be false outside of it
% so there's no need to make it false again

% This adds a contents line to \jobname.exs
% this does it for each \item inside of an examples environment
      % if the \item is inside \begin{examples}, then
      % update the example list
        % otherwise do nothing




\item first
\item second




share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.