List of Images

40 views
Skip to first unread message

Nathan Combes

unread,
May 4, 2016, 11:16:43 PM5/4/16
to ucsd-thesis
Hi all, 

Trying to create a "List of Images". I duplicated the ucsd.cls and titled it myucsd.cls. 

In the new class I replicated everything about figures for "images" 


\def\includeimageindex#1{\gdef\@includeimageindex{#1}}


% LIST OF Images
%
% Single-space list of images, add it to the table of contents.
\def\listofimages{%
  \@restonecolfalse%
  \if@twocolumn\@restonecoltrue\onecolumn\fi%
  \newpage%
  \centerline{\MakeUppercase{\listimagename}}%
  \bigskip%
  \phantomsection%
  \addcontentsline{toc}{frontmatter}{\protect\numberline{}\listimagename }%
  %This group overloads \numberline to output ``Figure 1.3'' instead of ``1.3''
  \begingroup%
    \let\ORIG@numberline\numberline%
    \renewcommand*{\numberline}[1]{% 
    \ORIG@numberline{\imagename~##1:}}%
    {\ssp\@starttoc{loi}}%
    \if@restonecol\twocolumn\fi%
  \endgroup %
  }

\newlength{\@imagelength}
\settowidth{\@imagelength}{\imagename }
% Magic value, but consistent with the standard figure length
\addtolength{\@imagelength}{2.8em}
\def\l@image{\normalfont\@dottedtocline{1}{0em}{\@imagelength}}



% Image

\newcounter{image}[chapter]
\def\theimage{\thechapter.\@arabic\c@image}

\def\fps@image{tbp}
\def\ftype@image{1}
\def\ext@image{loi}
\def\fnum@image{\textbf{\imagename~\theimage}}
\def\image{\@float{image}}
\def\endimage{\end@float}
\@namedef{image*}{\@dblfloat{image}}
\@namedef{endimage*}{\end@dblfloat}



Within my dissertation tex file I created a new float. (requires the float package) 

%In Preamble 

\newfloat{image}{tbp}{loi}
\floatname{image}{Image}


%Table of Contents command looks like 

%% SETUP THE TABLE OF CONTENTS
%
\tableofcontents
\listoffigures  % Comment if you don't have any figures
\listofimages % 
\listoftables   % Comment if you don't have any tables



This accomplishes MOST of the tasks. It labels the images as Image 6.1 Image 6.2, etc as it is supposed to. It creates a page for the List of Images, but only lists the Images. It does not do any of the other formatting things. 

It also creates a space in the Table of Contents for that List of Images, but doesn't actually list it (it's just a row of .......) 

Any thoughts on what else I need to change? 



Nathan Combes

unread,
May 5, 2016, 2:16:22 AM5/5/16
to ucsd-thesis
I got one step closer by adding the following to my .tex preamble. 


\newfloat{image}{tbp}{loi}[chapter]
\floatname{image}{Image}

\makeatletter
% the following is adapted from the definition of the "List of Tables" in article.cls
\newcommand{\listimagename}{List of Images}
\newcommand\listofimages{%
    \section*{\listimagename}%
      \@mkboth{%
          \MakeUppercase\listimagename}%
         {\MakeUppercase\listimagename}%
    \@starttoc{loi}%
    }
\let\l@image\l@figure

\makeatother



This creates an almost properly formatted List of Images page. The only problem is that the images are labeled as 6.1 and 6.2 instead of Image 6.1 and Image 6.2. Any ideas? 

Nathan Combes

unread,
May 5, 2016, 10:07:48 AM5/5/16
to ucsd-thesis
Finally got it. 

Preamble for TOC becomes. 

\newcommand{\imagenamez}{Image}


%% SETUP THE TABLE OF CONTENTS
%
\tableofcontents
\listoffigures  % Comment if you don't have any figures
\listoftables   % Comment if you don't have any tables
{%
\let\oldnumberline\numberline%
\renewcommand{\numberline}{\imagenamez~\oldnumberline}%
\listofimages%
}
Reply all
Reply to author
Forward
0 new messages