General ⇒ List of "Figures and Tables"
List of "Figures and Tables"
Hi all,
In my document I have a list of tables and a list of figures, but I only have 1 table. I'm wondering if its possible to make a "List of Figures and Tables", like:
List of Figures and Tables
Figure 1. The number one
Figure 2. The number two
Table 1. The only table
Bests
In my document I have a list of tables and a list of figures, but I only have 1 table. I'm wondering if its possible to make a "List of Figures and Tables", like:
List of Figures and Tables
Figure 1. The number one
Figure 2. The number two
Table 1. The only table
Bests
"Show me your .emacs and I'll tell you who you are." -- modified proverb
NEW: TikZ book now 40% off at Amazon.com for a short time.

List of "Figures and Tables"
Hi,
the idea is to redefine the \ext@table command to force all references to tables to be listed in the .lof file (that usually contains information about only figures) so that the new list of figures (produced with \listoffigures) will now include the figures and the tables.
To include the words "Figure" and "Table" in the new list I used some of the features provided by the tocloft package.
the idea is to redefine the \ext@table command to force all references to tables to be listed in the .lof file (that usually contains information about only figures) so that the new list of figures (produced with \listoffigures) will now include the figures and the tables.
To include the words "Figure" and "Table" in the new list I used some of the features provided by the tocloft package.
Code: Select all
\documentclass{book}
\usepackage{tocloft}
\makeatletter
\renewcommand\ext@table{lof}
\makeatother
\newlength\mylen
\settowidth\mylen{Figure\ }
\addtolength\cftfignumwidth{\mylen}
\addtolength\cfttabnumwidth{\mylen}
\renewcommand\cftfigpresnum{Figure }
\renewcommand\cfttabpresnum{Table }
\renewcommand\listfigurename{List of Figures and Tables}
\begin{document}
\listoffigures
\clearpage
\begin{figure}[!ht]
\centering
\rule{4cm}{3cm}
\caption{test figure 1}
\label{fig:test1}
\end{figure}
\begin{figure}[!ht]
\centering
\rule{4cm}{3cm}
\caption{test figure 2}
\label{fig:test2}
\end{figure}
\begin{table}[!ht]
\centering
\rule{4cm}{3cm}
\caption{test table}
\label{tab:test}
\end{table}
\end{document}
1,1,2,3,5,8,13,21,34,55,89,144,233,...
List of "Figures and Tables"
Thanks for your reply gmedina.
It's possible to get something like:
List of Figures and Tables
Figures
1. The number one
2. The number two
Tables
1. The only table
Bests
It's possible to get something like:
List of Figures and Tables
Figures
1. The number one
2. The number two
Tables
1. The only table
Bests
"Show me your .emacs and I'll tell you who you are." -- modified proverb
Re: List of "Figures and Tables"
Another question... this solutions apparently to be not compatible with the option -titles- of the tocloft package. How can I make it compatible.
Bests
Bests
"Show me your .emacs and I'll tell you who you are." -- modified proverb
List of "Figures and Tables"
You are welcome, and yes, it is possible; an example:cbustaam wrote:Thanks for your reply gmedina.
It's possible to get something like:
List of Figures and Tables
Figures
1. The number one
2. The number two
Tables
1. The only table
Bests
Code: Select all
\documentclass{book}
\usepackage{tocloft}
\renewcommand\listfigurename{List of figures and Tables}
\renewcommand\listtablename{}
\begin{document}
\listoffigures
\listoftables
\addtocontents{lof}{\bfseries\Large Figures\vskip10pt}
\addtocontents{lot}{\vskip-70pt}
\addtocontents{lot}{\bfseries\Large Tables\vskip10pt}
\clearpage
\begin{figure}[!ht]
\centering
\rule{4cm}{3cm}
\caption{test figure 1}
\label{fig:test1}
\end{figure}
\begin{figure}[!ht]
\centering
\rule{4cm}{3cm}
\caption{test figure 2}
\label{fig:test2}
\end{figure}
\begin{table}[!ht]
\centering
\rule{4cm}{3cm}
\caption{test table}
\label{tab:test}
\end{table}
\end{document}
Of course they're not compatible, since the examples that I posted change the way the titles are formatted; please tell me exactly what you desire to achieve with the LoF and LoT and what document class you are using.cbustaam wrote:Another question... this solutions apparently to be not compatible with the option -titles- of the tocloft package. How can I make it compatible.
Bests
1,1,2,3,5,8,13,21,34,55,89,144,233,...
List of "Figures and Tables"
Hi gmedina,
I have the following code
Regards
I have the following code
Code: Select all
\documentclass{report}
\usepackage[titles]{tocloft}
\usepackage{array}
\usepackage[table,svgnames]{xcolor}
\usepackage{tikz}
\usepackage{kpfonts}
\usepackage[explicit]{titlesec}
\titleformat{\chapter}
{\gdef\chapterlabel{}
\normalfont\sffamily\Huge\bfseries\scshape}
{\gdef\chapterlabel{\thechapter.\ }}{0pt}
{\begin{tikzpicture}[remember picture,overlay]
\node[yshift=-3cm] at (current page.north west)
{\begin{tikzpicture}[remember picture, overlay]
\draw[fill=white!70!gray] (0,0) rectangle
(\paperwidth,3cm);
\node[anchor=east,xshift=.9\paperwidth,rectangle,
rounded corners=20pt,inner sep=11pt,
fill=MidnightBlue]
{\color{white}\chapterlabel#1};
\end{tikzpicture}
};
\end{tikzpicture}
}
\titlespacing*{\chapter}{0pt}{30pt}{10pt}
\renewcommand\listfigurename{List of figures and Tables}
\renewcommand\listtablename{}
\begin{document}
\listoffigures
\listoftables
\addtocontents{lof}{\bfseries\Large Figures\vskip10pt}
\addtocontents{lot}{\vskip-70pt}
\addtocontents{lot}{\bfseries\Large Tables\vskip10pt}
\clearpage
\chapter{Chap one}
\begin{figure}[!ht]
\centering
\rule{4cm}{3cm}
\caption{test figure 1}
\label{fig:test1}
\end{figure}
\begin{figure}[!ht]
\centering
\rule{4cm}{3cm}
\caption{test figure 2}
\label{fig:test2}
\end{figure}
\begin{table}[!ht]
\centering
\rule{4cm}{3cm}
\caption{test table}
\label{tab:test}
\end{table}
\end{document}
"Show me your .emacs and I'll tell you who you are." -- modified proverb
List of "Figures and Tables"
Hi,
in my previous response I simply used the tocloft package to avoid the LoT to begin in a new page; since the titles option for that package is incompatible with the chnages made, then a simpler solution is to redefine the \listoftables command appropriately, and now there's no need to load tocloft:
in my previous response I simply used the tocloft package to avoid the LoT to begin in a new page; since the titles option for that package is incompatible with the chnages made, then a simpler solution is to redefine the \listoftables command appropriately, and now there's no need to load tocloft:
Code: Select all
\documentclass{report}
\usepackage{array}
\usepackage[table,svgnames]{xcolor}
\usepackage{tikz}
\usepackage{kpfonts}
\usepackage[explicit]{titlesec}
\titleformat{\chapter}
{\gdef\chapterlabel{}
\normalfont\sffamily\Huge\bfseries\scshape}
{\gdef\chapterlabel{\thechapter.\ }}{0pt}
{\begin{tikzpicture}[remember picture,overlay]
\node[yshift=-3cm] at (current page.north west)
{\begin{tikzpicture}[remember picture, overlay]
\draw[fill=white!70!gray] (0,0) rectangle
(\paperwidth,3cm);
\node[anchor=east,xshift=.9\paperwidth,rectangle,
rounded corners=20pt,inner sep=11pt,
fill=MidnightBlue]
{\color{white}\chapterlabel#1};
\end{tikzpicture}
};
\end{tikzpicture}
}
\titlespacing*{\chapter}{0pt}{30pt}{10pt}
\renewcommand\listfigurename{List of figures and Tables}
\renewcommand\listtablename{}
\makeatletter
\renewcommand\listoftables{%
\if@twocolumn
\@restonecoltrue\onecolumn
\else
\@restonecolfalse
\fi
\vskip3cm%
\@starttoc{lot}%
\if@restonecol\twocolumn\fi
}
\makeatother
\begin{document}
\listoffigures
\listoftables
\addtocontents{lof}{\bfseries\Large Figures\vskip10pt}
\addtocontents{lot}{\vskip-70pt}
\addtocontents{lot}{\noindent\bfseries\Large Tables\vskip10pt}
\clearpage
\chapter{Chap one}
\begin{figure}[!ht]
\centering
\rule{4cm}{3cm}
\caption{test figure 1}
\label{fig:test1}
\end{figure}
\begin{figure}[!ht]
\centering
\rule{4cm}{3cm}
\caption{test figure 2}
\label{fig:test2}
\end{figure}
\begin{table}[!ht]
\centering
\rule{4cm}{3cm}
\caption{test table}
\label{tab:test}
\end{table}
\end{document}
1,1,2,3,5,8,13,21,34,55,89,144,233,...
List of "Figures and Tables"
Thanks, it works very well excetp for one thing:
When I load the babel package with spanish language, the line that rename the LoF, doesn't have any effect.
Why?
When I load the babel package with spanish language, the line that rename the LoF, doesn't have any effect.
Code: Select all
\usepackage[spanish]{babel}
\renewcommand\listfigurename{Lista de Figuras y Cuadros}
"Show me your .emacs and I'll tell you who you are." -- modified proverb
List of "Figures and Tables"
Because babel causes this redefinitions to have no effect; in this case, instead of simply
you have to use
Code: Select all
\renewcommand\listfigurename{Lista de Figuras y Cuadros}
Code: Select all
\addto\captionsspanish{%
\renewcommand\listfigurename{Lista de Figuras y Cuadros}}
1,1,2,3,5,8,13,21,34,55,89,144,233,...
List of "Figures and Tables"
Ops... I found what happend. The babel package redefine the names of some commands, so when I use the spanish language is needed to use \spanishlistfigurename instead of \listfigurename
A lot of thanks gmedina.
Bests
Code: Select all
\usepackage[spanish]{babel}
\renewcommand\spanishlistfigurename{Lista de Figuras y Cuadros}
Bests
"Show me your .emacs and I'll tell you who you are." -- modified proverb