[Tugindia] Re: List of Cases

Duvvuri Venu Gopal venugopal_duvvuri at rediffmail.com
Thu Dec 11 09:06:23 CET 2003



>
>     Venu> Presently using Index I gathered all the cases using
>
>     Venu> \newcommand{\case}[1]{\textbf{#1}\index{#1}}
>
>
>Could you try the following code and tell me if this does what you
>needed? (You might use the Unix sort command to sort the entries in
>the <file>.loc, which is the list of cases file written by LaTeX).
>
><--------------------------- start ----------------->
>
>\documentclass{article}
>
>\makeatletter
>\newcounter{case}
>\newcommand{\case}[1]{\par\textbf{#1}%
>     \addcontentsline{loc}{case}%
>     {\string\numberline{\string\caseno}#1}{\thepage}}
>\def\caseno{\stepcounter{case}{\thecase.}}
>\def\listcasename{List of Cases}
>\def\listofcases{%
>     \section*{\listcasename}%
>       \@mkboth{\listcasename}%
>          {\listcasename}%
>     \@starttoc{loc}}
>\let\l at case\l at figure
>\makeatletter
>
>\begin{document}
>
>\listofcases
>
>\newpage
>
>\case{Case A}
>\case{Case B}
>\case{Case C}
>\end{document}
>

I have tried the code. The following is the result -

I used case in \section with a \footnote. But probably it is not working there. As I got some error message saying it encountered some \par etc.

Whereas the index generated more cases, case environment generated only 5 or 6 cases.

After generating *.loc I sorted it using linux sort. The problem is when I run latex again it is over written. So I could not get the cases in alphabetical order!!

Some cases come again and again (3 - 4 times), Index shows case and page numbers. But the case above may show them as separate entries.

The simplet way I think is - can I get index in a single column? It will solve most of my problem (with some compromising on Sl. No. and Page number in right column)

Thanking you.

VenuGopal



More information about the tugindia mailing list