3

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):

MWE:

\RequirePackage{pdfmanagement-testphase}

\DeclareDocumentMetadata{testphase=phase-II}

\documentclass{book}

\usepackage{xpatch}
\usepackage{tagpdf}
\tagpdfsetup{tabsorder=structure,%
uncompress,%
activate-all,%
%add-new-tag=Title/P,%
interwordspace=true,%
%add-new-tag = Table/TNote/P,
%add-new-tag = FNote,
%tagunmarked=false,
add-new-tag = Footnote/Note,
%%,paratagging,log=v,show-spaces
newattribute = {TH-col}{/O /Table /Scope /Column}%
}

\usepackage{enumitem,xpatch}

\renewenvironment{itemize}
               {\if@keypoints\abovelistskipi0pt\belowlistskipi0pt\itemleftmargin0pt\hsize\abswidth\fi\begin{iitemize}}
               {\end{iitemize}}

\renewenvironment{enumerate}{\begin{eenumerate}}{\end{eenumerate}}

\AddToHook{env/description/begin}{\par\tagstructbegin{tag=L}}
\AddToHook{env/description/end}{\par\tagstructend\tagstructend\tagstructend}%LBody,LI,L

\makeatletter
\ExplSyntaxOn
%We detect is this is the first or a follow up item where we have to end a structure first:  
\newcommand\tag@enit@format@preset[1]{%
 \str_if_eq:eeTF { \prop_item:cn { g__tag_struct_\g__tag_struct_stack_current_tl _prop }{S} }{/L}
  {
   %\typeout{BEGIN~OF~LIST}
  }
  {%\typeout{NEXT ITEM}
   \tagstructend\tagstructend} % for the LBody/LI
  \tagstructbegin{tag=LI}
  \tagstructbegin{tag=Lbl}
  \tagmcbegin{tag=Lbl}
    #1
  \tagmcend
  \tagstructend
  \tagstructbegin{tag=LBody}
  }
  
\ExplSyntaxOff

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

\makeatother


\def\refauthor#1{#1}

\RequirePackage[%draft=false,
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}


\begin{document}


\begin{thebibliography}{[100]}
\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?}, 
\href{https://science.osti.gov/-/media/bes/pdf/reports/2021/International_Benchmarking-Report.pdf%20}
{https://{\allowbreak}science.{\allowbreak}osti.{\allowbreak}gov/{\allowbreak}-{\allowbreak}/{\allowbreak}media/{\allowbreak}bes/{\allowbreak}pdf/{\allowbreak}reports/{\allowbreak}2021/{\allowbreak}International\_Benchmarking-{\allowbreak}Report.{\allowbreak}pdf\%20}(\hyperlink{backref:cit0044}{2021})
\end{thebibliography}

\end{document}
4
  • 1
    How current is you tex system? Commented Jun 3, 2023 at 7:22
  • @UlrikeFischer, currently I am using texlive 2022 edition and compiler is lualatex
    – pdy-ind
    Commented Jun 3, 2023 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). Commented Jun 3, 2023 at 10:57
  • @ulrikeFischer, Thanks for your suggestion. I will ensure
    – pdy-ind
    Commented Jun 4, 2023 at 2:19

1 Answer 1

5

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):

\DocumentMetadata{testphase=phase-III}

\documentclass{book}

\tagpdfsetup{tabsorder=structure,%
 newattribute = {TH-col}{/O /Table /Scope /Column}%
}

\def\refauthor#1{#1}

\RequirePackage[%draft=false,
pdfpagelayout={OneColumn},
pdffitwindow=true,
pdfstartview={FitH 800},
pdfdisplaydoctitle=true,
pdfborderstyle={/S/U/W 0},
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}

\begin{document}

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 .