Graphics, Figures & Tables ⇒ Formatting the List of a custom float
Formatting the List of a custom float
I have created a new float (called scheme) using the "float" package and want it to include spaces between the Schemes for each chapter in the List of Schemes, as is done for the List of Figures. I generate the list using
\listof{scheme}{List of Schemes}
and while the Figures and Tables list show the desired delineation with the extra space, the List of Schemes does not. The manual to the float package seems to give some guidance on the issue (below) but I do not know how to implement it. Any help?
\float@addtolists
This command allows LATEX programmers to add something to all currently defined lists of floats, such as some extra vertical space at the beginning of a new chapter in the main text (\float@addtolists{\protect\addvspace{10pt}}), without knowing exactly which lists of floats are currently being constructed. This command currently does not operate on the lot and lof lists.
116 \newcommand\float@addtolists[1]{%
117 \def\float@do##1{\addtocontents{##1}{#1}} \the\float@exts}
NEW: TikZ book now 40% off at Amazon.com for a short time.
And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Formatting the List of a custom float
Best regards
Thorsten¹
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
-
- Site Moderator
- Posts: 814
- Joined: Tue Jul 01, 2008 2:19 pm
Re: Formatting the List of a custom float
--
Joseph Wright
Re: Formatting the List of a custom float
I went with the use of trivfloat, and it worked beautifully!
Definitely the easiest way I've seen of doing what I wanted to do.
-Nick
-
- Site Moderator
- Posts: 814
- Joined: Tue Jul 01, 2008 2:19 pm
Re: Formatting the List of a custom float
--
Joseph Wright
Formatting the List of a custom float
Package caption is great but it still does not do this (i.e. put a space between lines for chapters) by default. Can you suggest any option that should be 'on' or a relevant parameter/command?localghost wrote: I suggest to use the \DeclareCaptionType command provided by the caption package as an alternative.
Best regards,
Greg.
Re: Formatting the List of a custom float
Latex is creating a dedicated file which contains s list of floats which will be included in output during next execution. I believe it can have different names depending on LaTeX distribution. In my case, for document.tex and float name: 'map' name of the file is: document.lomap
It is enough to put a command:
\addvspace {10\p@ }
to add a desired space between rows.
Unfortunately, document.lomap will be overwirtten every time latex is executed, but sometimes it is the only way.
BR,
gs
Formatting the List of a custom float
I cannot confirm this, this code is doing its job as expected:gregsa wrote:Package caption is great but it still does not do this (i.e. put a space between lines for chapters) by default.
Code: Select all
\documentclass{book}
\usepackage{caption}
\DeclareCaptionType{test}
\begin{document}
\listoftests
\chapter{A}
\begin{test}[!ht]
\caption{A1}
\end{test}
\begin{test}[!ht]
\caption{A2}
\end{test}
\chapter{B}
\begin{test}[!ht]
\caption{B1}
\end{test}
\begin{test}[!ht]
\caption{B2}
\end{test}
\end{document}
If you have a small but complete example for me with wrong behavior, I can take a look at it and try to fix it.
Axel
Formatting the List of a custom float
I tested your example in my environment and it works fine. My original document still has this problem. I have spent some time to re-create it in a small example which could be posted here but did not succed.sommerfee wrote: If you have a small but complete example for me with wrong behavior, I can take a look at it and try to fix it.
As I have a workaround and not so much time for investigations it will have to wait...