[Tugindia] Re: List of Cases
Radhakrishnan CV
cvr at river-valley.org
Wed Dec 10 10:55:26 CET 2003
>>>>> "Venu" == Duvvuri Venu Gopal <venugopal_duvvuri at rediffmail.com> writes:
Venu> Earlier I posted a message for making list of cases. I
Venu> cannot use the list of tables or list of figures because I
Venu> have to sort the list of cases alphabetically
Venu> Presently using Index I gathered all the cases using
Venu> \newcommand{\case}[1]{\textbf{#1}\index{#1}}
Venu> Now using index.sty {with which we can create multiple
Venu> indexs} I collected all the cases in ***.cdx. Using this I
Venu> could name it as {List of cases} also
Venu> My problems are :
Venu> 1) It is coming in two columns. It should be in one column.
Venu> 2) Pagenumber is coming just after the entry. It should come
Venu> in the right margin (a leader may be there)
Venu> 3) If possible the cases may be numbered in the list.
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}
\newpage
\case{Case G}
\case{Case H}
\case{Case A}
\newpage
\case{Case D}
\case{Case E}
\case{Case F}
\end{document}
<------------------------ end of specimen ----------------->
Best
Radhakrishnan
More information about the tugindia
mailing list