1

I have a sty file which defines my institution's dissertation format. I have for the most part been able to get it to work with tagging (via TexLive 2025, LuaLaTeX and tweaking code) for accessibility. Likewise, I have gone from TaggedPDF reporting errors, to the document compiling with just some warnings. Accessibility checking (via Foxit) gives "Lbl and LBody - Failed" which I narrowed down to \chapter and \section macros.

For posterity, I had to tweak the \tableofcontents macro from:

\newlength\singlespacelength
\newlength\doublespacelength
\newlength\triplespacelength

\setlength\singlespacelength{15\p@}
\setlength\doublespacelength{26\p@}
\setlength\triplespacelength{40\p@}

\newcommand\startsinglespace{\setlength\baselineskip{\singlespacelength}}
\newcommand\startdoublespace{\setlength\baselineskip{\doublespacelength}}

\def\typesetHeading#1{{\normalfont\large{#1}}}
\def\intro{\clearpage \thispagestyle{intropage}
  \global\@topnum\z@ \@afterindenttrue \secdef\@chapter\@schapter }
\renewcommand\contentsname{TABLE OF CONTENTS}
\newcommand\contentsnameLC{Table of Contents}

\renewcommand\tableofcontents{%
   \intro*{\typesetHeading\bf\contentsnameLC
   \@mkboth{{\contentsnameLC}}{{\contentsnameLC}}}%
     \startsinglespace
     \@starttoc{toc}
     \startdoublespace
}

to

% ... other definitions left alone

\renewcommand\tableofcontents{%
    \if@openright\cleardoublepage\else\clearpage\fi
    \begingroup
    \startsinglespace
    \centering
    {\normalfont\large\bfseries \contentsnameLC}%
    \@mkboth{{\contentsnameLC}}{{\contentsnameLC}}%
    \par\vskip\medskipamount
    \@starttoc{toc}%
    \endgroup
}

Which fixed the errors. Now I am facing a tougher problem, the chapter macros. Unlike the other commands which I was able to get working, the chapter macros are a lot more coupled/complex, and I cannot tell where exactly are things breaking. I would appreciate instruction on how to begin to debug this, or working chapter macros that achieve the same thing (visually).

\def\chapter{\clearpage  \thispagestyle{chappage}
  \global\@topnum\z@ \@afterindenttrue \secdef\@chapter\@schapter }%\pagestyle{plain}

\def\@chapter[#1]#2{
%% Chapters are necessary, so checking secnumdepth is immaterial.
  \refstepcounter{chapter}%
  \ifapp
    \ifnum\value{chapter}=1
      \addtocontents{toc}{\vskip 1.0em %plus 1pt
         \hskip -\parindent \appendicesname\hfill%
      \vskip 0.25em
     \rm}
    \else
      {}
    \fi
  \else
    \ifnum\value{chapter}=1
    % Moving away from roman numerals
%     \pagenumbering{arabic}
      \pagestyle{plain}
            \addtocontents{toc}{\vskip 0.25em
        \rm}
    \fi
  \fi

  \ifnum \c@secnumdepth >\m@ne
    \typeout{\@chapapp\space\thechapter.}
    \addcontentsline{toc}{chapter}{\protect\numberline{\thechapter.}#1}%
  \else
    \addcontentsline{toc}{chapter}{#1}
  \fi
  \chaptermark{#1}%
  \@makechapterhead{#2}%
%  \pagestyle{reset}
}

% Chapter # is 2in from top, followed by 2 lines, followed by
% the title, 4 lines, and then the text.
\def\@makechapterhead#1{
    {

        % Change Chapter headings from 2in. to 1in.
        %\vspace*{0.25in}
        \vspace*{-0.75in}
        \parindent \z@ \raggedright \reset@font
        \ifnum \c@secnumdepth >\m@ne%
            \center\typesetHeading{\bf\@chapapp{} \bf\thechapter}%
            %\par
            %\vskip 30pt
        \fi
        \begin{center}
            % Remove Bold from Chapter Headings
            %\large\boldcmd\typesetChapterTitle{#1}
            \vskip -20pt
            \typesetChapterTitle{#1}
            %\par
        \end{center}
    \nobreak
    %\vskip 15\p@ % Too much space between chapter title and body
    }
}

\def\@schapter#1{%
     \@makeschapterhead{#1}%
}
% Placement of the Chapter headings
\def\@makeschapterhead#1{
    % Change heading in TOC, LOF, LOT, and Aknowledgements from 2in. to 1in.
    \vspace*{-0.5in}
    {
        \parindent \z@ \raggedright
        \reset@font
        \begin{center}
            \large\boldcmd\typesetChapterTitle{#1}
            \par
        \end{center}
        \nobreak
        % Reduce the spacing between the chapter heading and title
        \vskip 15\p@
    }
}
New contributor
MeljahU is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
4
  • 1
    welcome! off-topic: never use \rm or similar 2-letter font switches (except \em) in latex. this has not been defined in latex for decades. Commented Nov 26 at 7:50
  • 1
    a current LaTeX should not give an Lbl warning for sectioning commands as we no longer use Lbl for the numbers. Beside this: you seem to remove the warnings and errors by removing the tagging of headings instead of correcting it. That makes no sense, it breaks accessibility and is not UA-compatible. Commented Nov 26 at 8:36
  • I'll see about updating the STY file to not use them, didn't know about that, thanks! What is considered a current LaTeX? Using TeXLive 2025, and doing lualatex --version This is LuaHBTeX, Version 1.22.0 (TeX Live 2025) Development id: 7673 Is there some newer version? I checked for updates but found none. As for removing the tagging of the headings, that wasn't my intention, but without my change to the tableofcontents I get a "Package tagpdf Error: The number of automatic begin (34) and end (31)". How can I properly fix the tableofcontents command? Commented Nov 27 at 8:25
  • Interesting, using the report class, and making a basic document with chapter, section, and subsection, causes the Lbl and LBody Failed in the Foxit checker. So I am pretty sure I need a more current LaTeX, but I have no idea how to install the development version of LaTeX? Since I think I am on the latest release. Commented Nov 27 at 8:49

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.