LaTeX forum ⇒ General! TeX capacity exceeded, sorry [semantic nest size=500].

LaTeX specific issues not fitting into one of the other forums of this category.
Chris Jones XL
Posts: 2
Joined: Fri Feb 01, 2019 1:43 am

! TeX capacity exceeded, sorry [semantic nest size=500].

Postby Chris Jones XL » Sat Mar 09, 2019 3:26 am

Compiling a fairly large document with xelatex gives this error message followed by 'no pages of output'.

I have some tabular data in a footnote invoked from a cell in a table in the document's text.

I eventually managed to isolate the problem and am now able to provide a one-page non-working document as well as a version that does not incur the error.

This works:

Code: [Select all] [Expand/Collapse] [Download] ({untitled.tex})
  1. \documentclass[10pt]{book}
  2. \usepackage{longtable}
  3. \setlength{\tabcolsep}{1.75pt}
  4.  
  5. \begin{document}
  6.  
  7. \chapter*{\centering Lièvre farci.}
  8.  
  9. \begin{longtable}{rrrl}
  10. 750 & grammes & de & foie gras d'oie de Strasbourg ou de Nancy, \\
  11. 500 & grammes & de & foies de volaille et de gibier, \\
  12. 500 & grammes & de & lard frais, \\
  13. 250 & grammes & de & champignons de couche, \\
  14. 30 & grammes & de & beurre, \\
  15. 30 & grammes & de & cognac, \\
  16. 20 & grammes & d' & échalotes, \\
  17. 15 & grammes & de & farine, \\
  18. 3 & litres & de & gelée de veau et de volaille, \\
  19. & & 1 & beau lièvre jeune et tendre, \\
  20. & & & marinade, p. 660, ou p. 669, \\
  21. & & & madère, \\
  22. & & & porto \\
  23. & & & mélange d'épices\footnote{Par exemple : \\
  24. \begin{tabular}{ p{16em} l r l l }
  25. & Clous de girofle \dotfill & 27,50 & pour & 100, \\
  26. & Muscade \dotfill & 27,50 & pour & 100, \\
  27. & Thym \dotfill & 10,00 & pour & 100, \\
  28. & Laurier \dotfill & 10,00 & pour & 100, \\
  29. & Poivre blanc \dotfill & 10,00 & pour & 100, \\
  30. & Marjolaine \dotfill & 5,00 & pour & 100, \\
  31. & Romarin \dotfill & 5,00 & pour & 100, \\
  32. & Cayenne \dotfill & 5,00 & pour & 100, \\
  33. \end{tabular}}, \\
  34. \end{longtable}
  35.  
  36. \end{document}


This does not work:

Code: [Select all] [Expand/Collapse] [Download] ({untitled.tex})
  1. \documentclass[10pt]{book}
  2. \usepackage{longtable}
  3. \setlength{\tabcolsep}{1.75pt}
  4.  
  5. \begin{document}
  6.  
  7. \chapter*{\centering Lièvre farci.}
  8.  
  9. \begin{longtable}{rrrp{16em}}
  10. 750 & grammes & de & foie gras d'oie de Strasbourg ou de Nancy, \\
  11. 500 & grammes & de & foies de volaille et de gibier, \\
  12. 500 & grammes & de & lard frais, \\
  13. 250 & grammes & de & champignons de couche, \\
  14. 30 & grammes & de & beurre, \\
  15. 30 & grammes & de & cognac, \\
  16. 20 & grammes & d' & échalotes, \\
  17. 15 & grammes & de & farine, \\
  18. 3 & litres & de & gelée de veau et de volaille, \\
  19. & & 1 & beau lièvre jeune et tendre, \\
  20. & & & marinade, p. 660, ou p. 669, \\
  21. & & & madère, \\
  22. & & & porto \\
  23. & & & mélange d'épices\footnote{Par exemple : \\
  24. \begin{tabular}{ p{16em} l r l l }
  25. & Clous de girofle \dotfill & 27,50 & pour & 100, \\
  26. & Muscade \dotfill & 27,50 & pour & 100, \\
  27. & Thym \dotfill & 10,00 & pour & 100, \\
  28. & Laurier \dotfill & 10,00 & pour & 100, \\
  29. & Poivre blanc \dotfill & 10,00 & pour & 100, \\
  30. & Marjolaine \dotfill & 5,00 & pour & 100, \\
  31. & Romarin \dotfill & 5,00 & pour & 100, \\
  32. & Cayenne \dotfill & 5,00 & pour & 100, \\
  33. \end{tabular}}, \\
  34. \end{longtable}
  35.  
  36. \end{document}


The only difference between the two versions seems to be the layout of the table that invokes the footnote:

The version that fails has:

Code: [Select all] [Expand/Collapse] [Download] ({untitled.tex})
  1. \begin{longtable}{rrrp{16em}}


… where the version that compiles succesfully has

Code: [Select all] [Expand/Collapse] [Download] ({untitled.tex})
  1. \begin{longtable}{rrrl}


I may be able to get over this difficulty and get on with my life but I thought I might as well ask for an explanation and understand what I am doing wrong.

Especially since I have hundreds of similar "longtable" definitions and would prefer to have all their columns aligned when they happen to live on the same page.

Thanks,

CJ

PS. I see in the preview of this post that the '\\''s (next line) on the right of the code samples are not visible. Hopefully this will right itself when actualy post (?). All apologies if not - I have never used this forum before and will post amended versions of the two versions (after testing them) if it does not.

rais
Posts: 243
Joined: Sun Nov 16, 2014 8:51 pm

Postby rais » Sat Mar 09, 2019 5:51 am

Welcome to the LaTeX Community :)

Looks like the p-columns cannot be nested this way.
Since you seem to misuse the p-column of the footnote's tabular for horizontal spacing, you might want to try
Code: [Select all] [Expand/Collapse] [Download] ({untitled.tex})
  1. \documentclass[10pt]{book}
  2. \usepackage{longtable}
  3. \setlength{\tabcolsep}{1.75pt}
  4.  
  5. \begin{document}
  6.  
  7. \chapter*{\centering Lièvre farci.}
  8.  
  9. \begin{longtable}{rrrp{16em}}
  10. 750 & grammes & de & foie gras d'oie de Strasbourg ou de Nancy,\\
  11. 500 & grammes & de & foies de volaille et de gibier,\\
  12. 500 & grammes & de & lard frais,\\
  13. 250 & grammes & de & champignons de couche,\\
  14. 30 & grammes & de & beurre,\\
  15. 30 & grammes & de & cognac,\\
  16. 20 & grammes & d' & échalotes,\\
  17. 15 & grammes & de & farine,\\
  18. 3 & litres & de & gelée de veau et de volaille,\\
  19. & & 1 & beau lièvre jeune et tendre,\\
  20. & & & marinade, p. 660, ou p. 669,\\
  21. & & & madère,\\
  22. & & & porto\\
  23. & & & mélange d'épices\footnote{Par exemple :\\
  24. \hspace*{16em}%
  25. \begin{tabular}{l r l l }
  26. Clous de girofle \dotfill & 27,50 & pour & 100,\\
  27. Muscade \dotfill & 27,50 & pour & 100,\\
  28. Thym \dotfill & 10,00 & pour & 100,\\
  29. Laurier \dotfill & 10,00 & pour & 100,\\
  30. Poivre blanc \dotfill & 10,00 & pour & 100,\\
  31. Marjolaine \dotfill & 5,00 & pour & 100,\\
  32. Romarin \dotfill & 5,00 & pour & 100,\\
  33. Cayenne \dotfill & 5,00 & pour & 100,\\
  34. \end{tabular}},\\
  35. \end{longtable}
  36.  
  37. \end{document}

And yes, the \\ were there (just shifted out to the right).

KR
Rainer

Chris Jones XL
Posts: 2
Joined: Fri Feb 01, 2019 1:43 am

Postby Chris Jones XL » Sat Mar 09, 2019 9:00 pm

The workaround that I found by accident while trying to put together a (non) MWE is good enough where I'm concerned… even though the look of the table is messed up if I don't specify a length in the defininition of the first column of the 'footnote table': it automatically takes the width of the longest literal string… 'Clous de girofle' IIRC… and leaves no space for the dotfill in the first line of the table.

I hesitated to post my question and then I thought I might as well do. Now at least this peculiarity that appears to affect all table-oriented packages (?) is documented.

Not sure why you would call my resorting to the p{length} column definition specified in the packages documentation… "misuse". Is this behavior documented anywhere? Unless I misunderstood your reply to my post I would have rather qualified it by the word "bug"...!

I am entirely new to latex and I have no idea how you folks are organized… but should I report this anywhere so a developer gets a chance to look into it … and perhaps provide some form of explanation - i.e. what's happening under the covers.. and what do they recommend to work around this limitation?

Thanks,

CJ

rais
Posts: 243
Joined: Sun Nov 16, 2014 8:51 pm

Postby rais » Sun Mar 10, 2019 8:32 am

Chris Jones XL wrote:I hesitated to post my question and then I thought I might as well do. Now at least this peculiarity that appears to affect all table-oriented packages (?) is documented.

Yes, good thing you did.
I wouldn't put it as `all table-oriented packages' are affected by it, though: the default (for tabular) is to disallow footnotes in them (they're basically ignored).
Chris Jones XL wrote:Not sure why you would call my resorting to the p{length} column definition specified in the packages documentation… "misuse".

I didn't.
The p-column's purpose is the line breaking of text (within its cells). I did not see any text in any of the cells of that p-column in the tabular environment within the footnote you posted, hence the `misuse'.
Chris Jones XL wrote: Is this behavior documented anywhere? Unless I misunderstood your reply to my post I would have rather qualified it by the word "bug"...!

Let me put it this way: If a tabular (containing---or starting with?---a p column) within a footnote within a longtable's p-column is a valid construct, then yes, this qualifies as a bug.
I am curious, though: Which part of which documentation gave you the idea that a tabular within a footnote is supposed to work? (and I'm not saying it shouldn't, just wondering)
Chris Jones XL wrote:I am entirely new to latex and I have no idea how you folks are organized… but should I report this anywhere so a developer gets a chance to look into it … and perhaps provide some form of explanation - i.e. what's happening under the covers.. and what do they recommend to work around this limitation?

The longtable's documentation tells you where to report related bugs on its first page.

I gave you a workaround that doesn't need the p-column in the tabular within the footnote.
I could think of another one, putting the tabular into a box before putting it into a footnote, but I did not see any reason to do that for a tabular that only uses its first column as a spacer;-)

KR
Rainer


Return to “General”

Who is online

Users browsing this forum: No registered users and 14 guests