Generallisting both tables and figures in addtolist in PDFPages

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
seadawg
Posts: 2
Joined: Tue Sep 08, 2015 11:35 pm

listing both tables and figures in addtolist in PDFPages

Post by seadawg »

Hi,
I am using the pdfpages package to include a reprint of a journal article in my dissertation. I am using the addtolist command to add the figures and tables from the included pages into the main document's list of figures and list of tables. It is only partly working. Here is what is happening:

1) If I just do figures, in order of included page number, it works fine.

Code: Select all

\includepdf[pages=-, addtolist={2,figure,Location Figure,fig:2.1[,3,figure,Space-time Evolution of Mw $\ge$ 5.0 Earthquakes on Discovery,fig:2.2[,4,figure,Bathymetry of the Discovery Transform Fault,fig:2.3[,7,figure,Example of a Relative Relocation,fig:2.4[,8,figure,Relocation of the 1998 Mw 5.5 Earthquake,fig:2.5[,9,figure,Repeating Rupture Patches on the Discovery Transform Fault,fig:2.6[,9,figure,Microseismicity on the Discovery Transform Fault,fig:2.7[,10,figure,Differential First Arrival Times for P- and S-waves between Stations D01 \& D07,fig:2.8[,11,figure,Map View and Cross-section of the Combined Seismicity on Discovery, fig:2.9]]]]]]]]}, pagecommand={\thispagestyle{plain}}, scale=0.85, noautoscale=true]{chapters/chap2/paper.pdf}
2) If I do the figures and include the two tables in the right page order and stop there, it works as well:

Code: Select all

\includepdf[pages=-, addtolist={2,figure,Location Figure,fig:2.1[,3,figure,Space-time Evolution of Mw $\ge$ 5.0 Earthquakes on Discovery,fig:2.2[,4,figure,Bathymetry of the Discovery Transform Fault,fig:2.3[,7,figure,Example of a Relative Relocation,fig:2.4[,7,table,Hydroacoustic Events Used in the Relocation of the 1998 Mw 5.5 Event,tab:2.1[,8,table,Estimated Centroid Locations of the 15 Mw $\ge$ 5.4 Repeating Earthquakes,tab:2.2]]]]]}, pagecommand={\thispagestyle{plain}}, scale=0.85, noautoscale=true]{chapters/chap2/paper.pdf}
3) However, there are more figures that occur after page 8. If I try to include these after the two tables in the recursive list (such that all included page entries are in numerical order, and then try to compile the latex, I get an error:

Code: Select all

PDFpages error: missing number.
4) If I try to group all figure entries and all table entries in my recursive addtolist, I get the same error.

5) If I make separate addtolist options, one for tables and one for figures, only the second one works.

Does anyone know how to get addtolist to work with both figure and table entries?

Thank you so much.
Page number in option "addtolist" is not a number.
Last edited by cgnieder on Wed Sep 09, 2015 8:09 pm, edited 1 time 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.

seadawg
Posts: 2
Joined: Tue Sep 08, 2015 11:35 pm

Re: listing both tables and figures in addtolist in PDFPages

Post by seadawg »

Nevermind.

I answered my own question.

The recursive list gets quite long, and as such, I was actually missing a comma after one of the brackets. The key was in the error message "Page number in 'addtolist' is not a number."

So the answer is that you keep the pages in numerical order, and you can then mix figure and table types in the addtolist and it works just fine.
User avatar
cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

Re: listing both tables and figures in addtolist in PDFPages

Post by cgnieder »

Thanks for providing the answer! :)
site moderator & package author
User avatar
Stefan Kottwitz
Site Admin
Posts: 10345
Joined: Mon Mar 10, 2008 9:44 pm

listing both tables and figures in addtolist in PDFPages

Post by Stefan Kottwitz »

Welcome to the forum!

Also from me, thanks for telling us that you found the cause and what it was. It may also help somebody who comes in via google, searching for that error message.

Also good to see that syntax: I used pdfpages, but never with addtolist.

Stefan
LaTeX.org admin
Post Reply