[Tex/LaTex] Redefining \listoffigures and \listoftables to flow like regular two-column text

front-mattertable of contentstwo-column

I found this redefinition of a table of contents very useful for my very long table of contents within my two-column book. With a slightly modified version of the command in the link, I got what I wanted:

\makeatletter
\renewcommand\tableofcontents{%
    \section*{\huge\contentsname
        \@mkboth{%
           \MakeUppercase\contentsname}{\MakeUppercase\contentsname}}
    \@starttoc{toc}%
}
\makeatother

The problem is that I can't figure out how to do the same for listoffigures and listoftables. Does anyone know how?

I took a guess at what might do the job (below), but that definitely didn't work. If anyone can point me to documentation, that would also be appreciated. I know how to get rid of any undesired page breaks; that's not an issue.

\makeatletter
\renewcommand\listoffigures{%
    \section*{\huge\contentsname
        \@mkboth{%
           \MakeUppercase\contentsname}{\MakeUppercase\contentsname}}
    \@startlof{lof}%
}
\makeatother

A minimal working example:

\documentclass[9pt,openany,twocolumn]{book}

\makeatletter
\renewcommand\tableofcontents{%
    \section*{\huge\contentsname
        \@mkboth{%
           \MakeUppercase\contentsname}{\MakeUppercase\contentsname}}
    \@starttoc{toc}%
}
\makeatother

\begin{document}

\let\cleardoublepage\relax
\frontmatter
\begingroup
\let\clearpage\relax
\tableofcontents
\listoffigures
\endgroup

\mainmatter
\chapter{Armadillo}
\section{Grubs}
\begin{figure}
  \caption{Pink Fairy armadillo}
  \label{fig1}
\end{figure}

\chapter{Beetle}
\section{Leaves}
\begin{figure}
  \caption{Dung beetle}
  \label{fig2}
\end{figure}

\chapter{Cat}
\section{Birds}
\begin{figure}
  \caption{Siamese cat}
  \label{fig3}
\end{figure}

I think I'm hungry??

\end{document}

enter image description here

Best Answer

As noted in the comments, you have to use \listfigurename and \listtablename for the LoF and the LoT, respectively.

Also the command for generating them is \@starttoc in every case:

\makeatletter
\renewcommand\tableofcontents{%
    \section*{\huge\contentsname
        \@mkboth{%
           \MakeUppercase\contentsname}{\MakeUppercase\contentsname}}
    \@starttoc{toc}%
}
\renewcommand\listoffigures{%
    \section*{\huge\listfigurename
        \@mkboth{%
           \MakeUppercase\listfigurename}{\MakeUppercase\listfigurename}}
    \@starttoc{lof}%
}
\renewcommand\listoftables{%
    \section*{\huge\listtablename
        \@mkboth{%
           \MakeUppercase\listtablename}{\MakeUppercase\listtablename}}
    \@starttoc{lot}%
}
\makeatother

MWE (9pt is not a valid option, minimum is 10):

\documentclass[openany,twocolumn]{book}

\makeatletter
\renewcommand\tableofcontents{%
    \section*{\huge\contentsname
        \@mkboth{%
           \MakeUppercase\contentsname}{\MakeUppercase\contentsname}}
    \@starttoc{toc}%
}
\renewcommand\listoffigures{%
    \section*{\huge\listfigurename
        \@mkboth{%
           \MakeUppercase\listfigurename}{\MakeUppercase\listfigurename}}
    \@starttoc{lof}%
}
\renewcommand\listoftables{%
    \section*{\huge\listtablename
        \@mkboth{%
           \MakeUppercase\listtablename}{\MakeUppercase\listtablename}}
    \@starttoc{lot}%
}
\makeatother

\begin{document}

\let\cleardoublepage\relax
\frontmatter
\begingroup
\let\clearpage\relax
\tableofcontents
\listoffigures
\endgroup

\mainmatter
\chapter{Armadillo}
\section{Grubs}
\begin{figure}
  \caption{Pink Fairy armadillo}
  \label{fig1}
\end{figure}

\chapter{Beetle}
\section{Leaves}
\begin{figure}
  \caption{Dung beetle}
  \label{fig2}
\end{figure}

\chapter{Cat}
\section{Birds}
\begin{figure}
  \caption{Siamese cat}
  \label{fig3}
\end{figure}

I think I'm hungry??

\end{document} 

enter image description here

Related Question