I’m writing a document in the latex and it contains some BNF grammar noations in several places of the documents. (I used verbatim package in order to write these BNF grammar notations)

Now I want to add a new section to the document that shows name of all grammar notation and their page numbers. This should be similar to “List of Figures” page.

I’m new to Latex and your help will be very helpful for me.



Use the tocloft package. For a short introduction see for example: http://texblog.org/2008/07/13/define-your-own-list-of/

  • If you need more specific advice, you should give a MWE. Otherwise "accepting" an answer is the proper way to show your content. – bodo Jun 25 '12 at 4:26

Example for the tocloft package:




\newcommand{\listexamplename}{List of mycustomfiction}

% Reset section numbering between unnumbered chapters
% https://tex.stackexchange.com/questions/71162/reset-section-numbering-between


    % How to remove double “Contents” heading generated by memoir?
    % https://tex.stackexchange.com/questions/47225/how-to-remove-double-contents-heading-generated-by-memoir

    \chapter{Two mycustomfiction}
    \mycustomfiction{Your first example}
    Your first example

    \mycustomfiction{Your second example}
    Your second example

    \chapter{One example}
    \mycustomfiction{Your third example. (See example \ref{1st_ex} and \ref{2nd_ex})}
    Your third example. (See example \ref{1st_ex} and \ref{2nd_ex})


enter image description here

For the memoir package you need to build more things using the memoir's class emulation of tocloft. See the question for memoir's example: Custom list throw LaTeX Error: Command \mycustomfiction already defined?

  • I would like to format each entry in the "List of mycustomfiction" so that it follows this pattern "Figure 1.1 - Caption.......pagenumber" any thoughts on how to attack the issue? – Fredrik Feb 4 '20 at 14:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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