List of Supplemental Tables/Figures/Videos in Table of Contents

84 views
Skip to first unread message

obi.don...@gmail.com

unread,
Apr 30, 2016, 5:02:06 PM4/30/16
to ucsd-thesis
Hi,

Could someone help me with adding a list of Supplemental Tables/Figures/Videos in the table of contents?  I have tables that are far too large and will need to be submitted as supplemental excel files, but I am not sure how to get this list into the table of contents.  Please let me know.

Best,
Don

Nathan Combes

unread,
May 5, 2016, 10:22:56 AM5/5/16
to ucsd-thesis, obi.don...@gmail.com
Hi Don, 

I'm not sure how clear it is, but I just had a thread (where I posted the question and then answered it myself a couple of times) about List of Images. This should work for any kind of "list" and adding it to the table of contents. There may be a more elegant way to do it (I'm not proficient at any kind of coding), but this worked for me. 

Several steps: 

%%%%% IN YOUR DISSERTATION TEX FILE %%%%%%%

- In the dissertation tex file, I've created a new float called images. What this does is it allows me to do a \begin{image} \end{image} and use it exactly as I would "figure", but it's a separate thing (in my case called "images". You may want to call it "Supplementary Figure". This goes in the preamble (before \begin{document}


\newfloat{image}{thp}{loi}   %the i in loi stands for images. So make it the first letter of whatever you use. 
\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


%%%%% IN DISSERTATION TEX FILE, BUT AFTER \begin{document}  %%%%%%%% 


%% The Table of Contents commands should look like this. I added a z after the "imagename" because I create an "imagename" command elsewhere in this process. The Z doesn't stand for anything, I just threw in a letter%%%

\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%
}



%%%%%%% MY UCSD CLASS %%%%%%%%%%%

- I've created a new class called myucsd.cls 

In that, I took all the things that referenced tables and figures, and copied it exactly to say "images". (In that, there are instances of lof that should be changed to loi (images instead of figures). Be on the lookout for the lof as you will need to change it to lo_ whatever letter you choose to use).  There are three places where I did this, in order. Look for the identical code for Figures and Tables to see where to place these. 



%%% Instance 1 %%%%

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

%%%% Instance 2 %%%%%

% 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 ``image 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 image length.
\addtolength{\@imagelength}{2.8em}
\def\l@image{\normalfont\@dottedtocline{1}{0em}{\@imagelength}}


%%%% Instance 3 %%%%%%%



% image

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

\def\fps@image{tbp}
\def\ftype@image{8}
\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}



I'm sure that this was not the clearest of explanations, but I hope that it helps you out! 

Nathan Combes

unread,
May 5, 2016, 3:14:30 PM5/5/16
to ucsd-thesis, obi.don...@gmail.com
A few minor changes. 

1) clarification myucsd.cls is simply a duplicate of the ucsd.cls so that I can make changes with less risk. Then I change my document class in the tex file to myucsd.cls. 


Here are a few alterations to the preamble to get the spacing to matching UCSD formatting guidelines exactly. 

\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@imagelength

\makeatletter
Reply all
Reply to author
Forward
0 new messages