0

I got a solution that works for book class in [Adding words figure and page to list of figures] 1. unfortunately when I changed \documentclass[12pt,letterpaper,oneside]{book} to \documentclass[a4paper,12pt]{extreport} the code gives me error.

What I Want

  1. I want to Add the words figure and page to list of figures in the report class without underline.
  2. I want to Add the words table and page to list of tables in the same report class without the underline.
%\documentclass[12pt,letterpaper,oneside]{book}
\documentclass[a4paper,12pt]{extreport}
\usepackage{soul}
\usepackage{afterpage}
\usepackage{mwe}
\usepackage{tikz}
\begin{document}
    \frontmatter
    \listoffigures
    \addtocontents{lof}{{~\ul{Figure}}~\hfill{\ul{Page}}\par}
    \makeatletter
    \addtocontents{lof}{\protect\afterpage{\protect\hbox to \linewidth%
            {{~\ul{Figure}}~\hfill{\ul{Page}}}\par%
            \protect\addvspace{10\p@}}}
    \makeatother
    \mainmatter
    \chapter{one}
    \begin{figure}
        \includegraphics[width=\linewidth]{example-image-a}
        \caption{dummy figure}
    \end{figure}
    \begin{figure}
        \includegraphics[width=\linewidth]{example-image-a}
        \caption{dummy figure}
    \end{figure}
    \begin{figure}
        \includegraphics[width=\linewidth]{example-image-a}
        \caption{dummy figure}
    \end{figure}
    \begin{figure}
        \includegraphics[width=\linewidth]{example-image-a}
        \caption{dummy figure}
    \end{figure}
    \begin{figure}
        \includegraphics[width=\linewidth]{example-image-a}
        \caption{dummy figure}
    \end{figure}
    \begin{figure}
        \includegraphics[width=\linewidth]{example-image-a}
        \caption{dummy figure}
    \end{figure}
    \begin{figure}
        \includegraphics[width=\linewidth]{example-image-a}
        \caption{dummy figure}
    \end{figure}
    \begin{figure}
        \includegraphics[width=\linewidth]{example-image-a}
        \caption{dummy figure}
    \end{figure}
    \begin{figure}
        \includegraphics[width=\linewidth]{example-image-a}
        \caption{dummy figure}
    \end{figure}
    \begin{figure}
        \includegraphics[width=\linewidth]{example-image-a}
        \caption{dummy figure}
    \end{figure}
    \begin{figure}
        \includegraphics[width=\linewidth]{example-image-a}
        \caption{dummy figure}
    \end{figure}
    \begin{figure}
        \includegraphics[width=\linewidth]{example-image-a}
        \caption{dummy figure}
    \end{figure}
    \begin{figure}
        \includegraphics[width=\linewidth]{example-image-a}
        \caption{dummy figure}
    \end{figure}
    \begin{figure}
        \includegraphics[width=\linewidth]{example-image-a}
        \caption{dummy figure}
    \end{figure}
    \begin{figure}
        \includegraphics[width=\linewidth]{example-image-a}
        \caption{dummy figure}
    \end{figure}
    \begin{figure}
        \includegraphics[width=\linewidth]{example-image-a}
        \caption{dummy figure}
    \end{figure}
    \begin{figure}
        \includegraphics[width=\linewidth]{example-image-a}
        \caption{dummy figure}
    \end{figure}
    \begin{figure}
        \includegraphics[width=\linewidth]{example-image-a}
        \caption{dummy figure}
    \end{figure}
    \chapter{one}
    \begin{figure}
        \includegraphics[width=\linewidth]{example-image-a}
        \caption{dummy figure}
    \end{figure}
    \begin{figure}
        \includegraphics[width=\linewidth]{example-image-a}
        \caption{dummy figure}
    \end{figure}
    \begin{figure}
        \includegraphics[width=\linewidth]{example-image-a}
        \caption{dummy figure}
    \end{figure}
    \begin{figure}
        \includegraphics[width=\linewidth]{example-image-a}
        \caption{dummy figure}
    \end{figure}
    \begin{figure}
        \includegraphics[width=\linewidth]{example-image-a}
        \caption{dummy figure}
    \end{figure}
    \begin{figure}
        \includegraphics[width=\linewidth]{example-image-a}
        \caption{dummy figure}
    \end{figure}
    \begin{figure}
        \includegraphics[width=\linewidth]{example-image-a}
        \caption{dummy figure}
    \end{figure}
    \begin{figure}
        \includegraphics[width=\linewidth]{example-image-a}
        \caption{dummy figure}
    \end{figure}
    \begin{figure}
        \includegraphics[width=\linewidth]{example-image-a}
        \caption{dummy figure}
    \end{figure}
    \begin{figure}
        \includegraphics[width=\linewidth]{example-image-a}
        \caption{dummy figure}
    \end{figure}
    \begin{figure}
        \includegraphics[width=\linewidth]{example-image-a}
        \caption{dummy figure}
    \end{figure}
    \begin{figure}
        \includegraphics[width=\linewidth]{example-image-a}
        \caption{dummy figure}
    \end{figure}
    \begin{figure}
        \includegraphics[width=\linewidth]{example-image-a}
        \caption{dummy figure}
    \end{figure}
    \begin{figure}
        \includegraphics[width=\linewidth]{example-image-a}
        \caption{dummy figure}
    \end{figure}
    \begin{figure}
        \includegraphics[width=\linewidth]{example-image-a}
        \caption{dummy figure}
    \end{figure}
    \begin{figure}
        \includegraphics[width=\linewidth]{example-image-a}
        \caption{dummy figure}
    \end{figure}
    \begin{figure}
        \includegraphics[width=\linewidth]{example-image-a}
        \caption{dummy figure}
    \end{figure}
    \begin{figure}
        \includegraphics[width=\linewidth]{example-image-a}
        \caption{dummy figure}
    \end{figure}
\end{document} 

I got another example yet with no column headers for both figures and tables.

\documentclass[a4paper,12pt]{extreport}
\usepackage{mwe}
\usepackage{tikz}
\begin{document}
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    \begin{center}
        {%
            \let\oldnumberline\numberline%
            \renewcommand{\numberline}{\tablename~\oldnumberline}%
            \listoftables%
        }
    \end{center}
    \addcontentsline{toc}{chapter}{List of Tables}% add "list of table" to table of content
    %%%\addtocontents{lot}{\textbf{Table Name}~\vfill\textbf{Page}\par}% put "page" on rigt top of the first page "List of Tables"
    %\newpage
    \begin{center}
        {%
            \let\oldnumberline\numberline%
            \renewcommand{\numberline}{\figurename~\oldnumberline}%
            \listoffigures%
        }
    \end{center}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    \chapter{one}
    \begin{figure}
        \includegraphics[width=\linewidth]{example-image-a}
        \caption{dummy figure}
    \end{figure}
    \begin{figure}
        \includegraphics[width=\linewidth]{example-image-a}
        \caption{dummy figure}
    \end{figure}
    \begin{figure}
        \includegraphics[width=\linewidth]{example-image-a}
        \caption{dummy figure}
    \end{figure}
    \begin{figure}
        \includegraphics[width=\linewidth]{example-image-a}
        \caption{dummy figure}
    \end{figure}
    \begin{figure}
        \includegraphics[width=\linewidth]{example-image-a}
        \caption{dummy figure}
    \end{figure}
    \begin{figure}
        \includegraphics[width=\linewidth]{example-image-a}
        \caption{dummy figure}
    \end{figure}
    \begin{figure}
        \includegraphics[width=\linewidth]{example-image-a}
        \caption{dummy figure}
    \end{figure}
    \begin{figure}
        \includegraphics[width=\linewidth]{example-image-a}
        \caption{dummy figure}
    \end{figure}
    \begin{figure}
        \includegraphics[width=\linewidth]{example-image-a}
        \caption{dummy figure}
    \end{figure}
    \begin{figure}
        \includegraphics[width=\linewidth]{example-image-a}
        \caption{dummy figure}
    \end{figure}
    \begin{figure}
        \includegraphics[width=\linewidth]{example-image-a}
        \caption{dummy figure}
    \end{figure}
    \begin{figure}
        \includegraphics[width=\linewidth]{example-image-a}
        \caption{dummy figure}
    \end{figure}
    \begin{figure}
        \includegraphics[width=\linewidth]{example-image-a}
        \caption{dummy figure}
    \end{figure}
    \begin{figure}
        \includegraphics[width=\linewidth]{example-image-a}
        \caption{dummy figure}
    \end{figure}
    \begin{figure}
        \includegraphics[width=\linewidth]{example-image-a}
        \caption{dummy figure}
    \end{figure}
    \begin{figure}
        \includegraphics[width=\linewidth]{example-image-a}
        \caption{dummy figure}
    \end{figure}
    \begin{figure}
        \includegraphics[width=\linewidth]{example-image-a}
        \caption{dummy figure}
    \end{figure}
    \begin{figure}
        \includegraphics[width=\linewidth]{example-image-a}
        \caption{dummy figure}
    \end{figure}
    \chapter{one}
    \begin{figure}
        \includegraphics[width=\linewidth]{example-image-a}
        \caption{dummy figure}
    \end{figure}
    \begin{figure}
        \includegraphics[width=\linewidth]{example-image-a}
        \caption{dummy figure}
    \end{figure}
    \begin{figure}
        \includegraphics[width=\linewidth]{example-image-a}
        \caption{dummy figure}
    \end{figure}
    \begin{figure}
        \includegraphics[width=\linewidth]{example-image-a}
        \caption{dummy figure}
    \end{figure}
    \begin{figure}
        \includegraphics[width=\linewidth]{example-image-a}
        \caption{dummy figure}
    \end{figure}
    \begin{figure}
        \includegraphics[width=\linewidth]{example-image-a}
        \caption{dummy figure}
    \end{figure}
    \begin{figure}
        \includegraphics[width=\linewidth]{example-image-a}
        \caption{dummy figure}
    \end{figure}
    \begin{figure}
        \includegraphics[width=\linewidth]{example-image-a}
        \caption{dummy figure}
    \end{figure}
    \begin{figure}
        \includegraphics[width=\linewidth]{example-image-a}
        \caption{dummy figure}
    \end{figure}
    \begin{figure}
        \includegraphics[width=\linewidth]{example-image-a}
        \caption{dummy figure}
    \end{figure}
    \begin{figure}
        \includegraphics[width=\linewidth]{example-image-a}
        \caption{dummy figure}
    \end{figure}
    \begin{figure}
        \includegraphics[width=\linewidth]{example-image-a}
        \caption{dummy figure}
    \end{figure}
    \begin{figure}
        \includegraphics[width=\linewidth]{example-image-a}
        \caption{dummy figure}
    \end{figure}
    \begin{figure}
        \includegraphics[width=\linewidth]{example-image-a}
        \caption{dummy figure}
    \end{figure}
    \begin{figure}
        \includegraphics[width=\linewidth]{example-image-a}
        \caption{dummy figure}
    \end{figure}
    \begin{figure}
        \includegraphics[width=\linewidth]{example-image-a}
        \caption{dummy figure}
    \end{figure}
    \begin{figure}
        \includegraphics[width=\linewidth]{example-image-a}
        \caption{dummy figure}
    \end{figure}
    \begin{figure}
        \includegraphics[width=\linewidth]{example-image-a}
        \caption{dummy figure}
    \end{figure}
\end{document} 
economia
  • 259

1 Answers1

1

The only error you got is that the commands \frontmatter and \mainmatter are not defined in the report class. Do you have any front matter chapters, which don't need to be numbered, in your document (e.g. abstract, dedication and acknowledgements)? If not, you just simply delete the commands \frontmatter and \mainmatter. If you don't want a underline, just replace the {~\ul{Figure}} with {~Figure} and {\ul{Page}} with {Page}. And do the same for table and page commands.

%\documentclass[12pt,letterpaper,oneside]{book}
\documentclass[a4paper,12pt]{extreport}
\usepackage{soul}
\usepackage{afterpage}
\usepackage{mwe}
\usepackage{tikz}
\begin{document}
    \listoffigures
    \addtocontents{lof}{{~Figure}~\hfill{Page}\par}
    \makeatletter
    \addtocontents{lof}{\protect\afterpage{\protect\hbox to \linewidth%
            {{~Figure}~\hfill{Page}}\par%
            \protect\addvspace{10\p@}}}
    \makeatother
    \listoftables
    \addtocontents{lot}{{~Table}~\hfill{Page}\par}
    \makeatletter
    \addtocontents{lot}{\protect\afterpage{\protect\hbox to \linewidth%
            {{~Table}~\hfill{Page}}\par%
            \protect\addvspace{10\p@}}}
    \makeatother
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% add some dummy list entries %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    \setcounter{figure}{1}
    \setcounter{table}{1}
    \loop
    \addcontentsline{lof}{figure}{\protect\numberline{\thefigure}{\ignorespaces dummy figure}}%
    \stepcounter{figure}%
    \ifnum\value{figure}<51 
    \repeat
    \loop
    \addcontentsline{lot}{table}{\protect\numberline{\thetable}{\ignorespaces dummy table}}%
    \stepcounter{table}%
    \ifnum\value{table}<51 
    \repeat
%%%%%%%%%%%%%%%%%%%%%%%%%%%
% start the main contents %
%%%%%%%%%%%%%%%%%%%%%%%%%%%
\chapter{one}
\end{document}

enter image description here enter image description here

Tom
  • 7,318
  • 4
  • 21