I am getting the error message below, my compiler is LuaLaTeX:

enter image description here

My file has a large amount of text, figures and references (ref count more than 250). From the particular position in the file showing the error, the TeX capacity exceeded exactly from ref 44. When closing the \end{thebibliography}\end{document} before the ref 44, the file is compiling and pdf is produced, when using tagpdf, I am getting the error. The code below has been copied a little bit from my file for MWE purposes (it will compile, but when compile file it is not compiling):





%add-new-tag = Table/TNote/P,
%add-new-tag = FNote,
add-new-tag = Footnote/Note,
newattribute = {TH-col}{/O /Table /Scope /Column}%





%We detect is this is the first or a follow up item where we have to end a structure first:  
 \str_if_eq:eeTF { \prop_item:cn { g__tag_struct_\g__tag_struct_stack_current_tl _prop }{S} }{/L}
  {%\typeout{NEXT ITEM}
   \tagstructend\tagstructend} % for the LBody/LI

%close mc from paratagging and reopen ...
\xpatchcmd\@item{\box\@labels}{\tagmcend \box\@labels \tagmcbegin{tag=P}}{}{\fail}



pdfpagelayout={OneColumn},pdffitwindow=true,pdfstartview={FitH 800},pdfdisplaydoctitle=true,pdfborderstyle={/S/U/W 0},breaklinks=true,bookmarks=true, bookmarksnumbered,bookmarksopen=true, colorlinks=true, hyperfootnotes=true,hyperindex=false,linkcolor=blue,citecolor=blue,urlcolor=blue,linktoc=all,hyperfootnotes=false,hyperindex=false,pdfview={XYZ null null 1.00}]{hyperref}


\bibitem[{[43]}]{cit0043}{}\hypertarget{2220363:cit0043}{}\refauthor{Kirilyuk A}, \refauthor{Kimel AV}, \refauthor{Rasing T}. Laser-induced magnetization dynamics and reversal in ferrimagnetic alloys. Rep Prog Phys. \hyperlink{backref:cit0043}{2013};76:026501.


\bibitem[{[44]}]{cit0044}{}\hypertarget{2220363:cit0044}{}\emph{CAN the U.S. COMPETE in basic energy sciences?}, 

  • 1
    How current is you tex system? Jun 3 at 7:22
  • @UlrikeFischer, currently I am using texlive 2022 edition and compiler is lualatex
    – RCV
    Jun 3 at 10:50
  • 1
    then update. Sorry but this is not yet stable code but is in development and if you want to use it, you must keep track of the newest versions (and be willing to adapt your code if we change something). Jun 3 at 10:57
  • @ulrikeFischer, Thanks for your suggestion. I will ensure
    – RCV
    Jun 4 at 2:19

1 Answer 1


The documentation of tagpdf says quite clearly that this is experimental and development code and not meant for production, at least not for large and complex documents.

If you nevertheless want to use it: Tagging in LaTeX is currently evolving quite a lot. So ensure that you have an really up-to-date texlive and then try to compile with lualatex-dev (!) and the following preamble (clean up the hyperref options, you have conflicting settings there):



 newattribute = {TH-col}{/O /Table /Scope /Column}%


pdfstartview={FitH 800},
pdfborderstyle={/S/U/W 0},
hyperfootnotes=false,hyperindex=false,pdfview={XYZ null null 1.00}]{hyperref}


If this still errors you will have to make a minimal example that demonstrates the problem.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .