Graphics, Figures & TablesCustom "list of <float>" without page numbers?

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
geois
Posts: 11
Joined: Tue Apr 06, 2010 8:47 am

Custom "list of <float>" without page numbers?

Post by geois »

Hi,

For my PhD thesis I have a number of maps and cross-section which are quite large, and so will be included in an envelope in the rear of the thesis. I call these “sheets.”

It is quite desirable for me to have in the front of the thesis a list of sheets, just as I have a list of figures and a list of tables.

To this end I have created a new type of float using

Code: Select all

 \DeclareCaptionType[within=none]{sheet}
So that at the end of the document (on a page which I ultimately remove) I can just give references to the sheets, e.g.

Code: Select all

 \begin{sheet}%
\caption{Bore logs cross-section 1}%
\end{sheet}
and thus easily use

Code: Select all

\listofsheets
to get my list of sheets.

At the moment the list of sheets tells me that “Bore logs cross-section 1” is on page XXX, which is not helpful, as it isn’t actually on any page at all.

My question is: is it possible to suppress the page numbers given for the sheets in the list of sheets?

Is there some other command in the caption package I have overlooked? Or, do I need to create the “list of sheets” manually, so it doesn’t have page numbers?

Many thanks,

Alastair.
Last edited by geois on Tue Sep 07, 2010 11:00 pm, edited 2 times in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

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

gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

Custom "list of <float>" without page numbers?

Post by gmedina »

Hi, Alastair

from the description of your problem I think that you could simply define the new list without using any packages; after all it seems that you don't really need a new floating object. Take a look at the following example in which I provide the necessary commands to build a "List of Sheets"; the \sheetcap command will only add the corresponding entry (its mandatory argument without any page number) to the list, and it will not print anything in your document:

Code: Select all

\documentclass{book}

\newcounter{sheet}
\newcommand\listsheetname{List of Sheets}
\newcommand\sheetcap[1]{%
  \stepcounter{sheet}\addtocontents{sht}{\protect\makebox[2em][l]{\thesheet}#1}%
  \addtocontents{sht}{\vskip7pt\noindent}}
\makeatletter
  \newcommand\listofsheets{\chapter*{\listsheetname}\@starttoc{sht}}
\makeatother

\begin{document}
\listofsheets

\sheetcap{Test sheet one}

\sheetcap{Test sheet two}

\sheetcap{Test sheet three}

\end{document}
Of course, if the document class that you are using does not admit chapters, you can use \section* instead of \chapter* in my code. Feel free to make any adjustments to meet your needs.
1,1,2,3,5,8,13,21,34,55,89,144,233,...
geois
Posts: 11
Joined: Tue Apr 06, 2010 8:47 am

Custom "list of <float>" without page numbers?

Post by geois »

Hi gmedina,

Thanks for your suggestion, it does almost exactly what I require, and has given me some new thoughts to experiment with.

One follow-up question: how can I get the list of sheets from your example to appear in the table of contents, given that it uses chapter* ?

Many thanks,

Alastair.
User avatar
frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

Custom "list of <float>" without page numbers?

Post by frabjous »

Try something like changing \listofsheets (where it is used) above to:

Code: Select all

\clearpage%      to get on the right page
\phantomsection% probably necessary only if using hyperref package
\addcontentsline{toc}{chapter}{List of Sheets}%
\listofsheets
geois
Posts: 11
Joined: Tue Apr 06, 2010 8:47 am

Custom "list of <float>" without page numbers?

Post by geois »

Thank you gmedina!

I answered my own question about adding the list of sheets entry to the table of contents, using \addcontentsline{toc}{chapter}{List of Sheets}

Here is the original example, modified:

Code: Select all

    \documentclass{book}

    \newcounter{sheet}
    \newcommand\listsheetname{List of Sheets}
    \newcommand\sheetcap[1]{%
      \stepcounter{sheet}\addtocontents{sht}{\protect\makebox[2em][l]{\thesheet}#1}%
      \addtocontents{sht}{\vskip7pt\noindent}}
    \makeatletter
      \newcommand\listofsheets{\chapter*{\listsheetname}\@starttoc{sht}}
    \makeatother

    \begin{document}
    
    %Add the line to the TOC
    \addcontentsline{toc}{chapter}{List of Sheets}
    \listofsheets
    %Explicitly make sure the chapter title changed - might be required if
    % using listofsheets after some other listof
    \chaptermark{List of sheets}

    \sheetcap{Test sheet one}

    \sheetcap{Test sheet two}

    \sheetcap{Test sheet three}

    \end{document}
Some notes: The sheetcap commands need to come immediately after the \listofsheets command. Moving them elsewhere in the document does not work. It is not a problem to have them straight after the \listofsheets command, I just thought I would mention this in case someone, like myself, wanted to move them for some organisational reason, and then wondered why it no longer worked.

Another note: I have fancy headers supplied by fancyhdr. In particular at the top of the page I have the chapter title. The list of sheets comes directly after my list of tables, and so it seems that the list of table chapter title persists. This can be remedied by issusing \chaptermark{List of sheets} directly after the \listofsheets command.

Many thanks,

Alastair.
geois
Posts: 11
Joined: Tue Apr 06, 2010 8:47 am

Re: Custom "list of <float>" without page numbers?

Post by geois »

Thank you frabjous,

Our comments must have crossed - your suggestion works exactly.
Post Reply