0

I am formatting my thesis and have been using a template for which a custom style file was created. The template had the front matter, such as "list of tables", acknowledgements, etc., listed in the Table of Content. This was to be removed. In this front matter, I also needed to change the headings from "all-cap" to lower case, bold face and left justified. Without any knowledge of style file formatting, I was able to make all these changes in the .cls file but I was left with at-symbols between chapters in the list of tables and list of figures.

enter image description here

I commented out the two lines listed JAH.

\def\listoftables{%
  \@restonecolfalse%
  \if@twocolumn\@restonecoltrue\onecolumn\fi%
  \newpage%
  \centerline{\expandafter
%\uppercase %remove JAH
\bfseries%
\expandafter{
\begin{flushleft}%
\listtablename}
\end{flushleft}%
}%
  \bigskip%
  \phantomsection%
%  \addcontentsline{toc}{frontmatter}{\protect\numberline{}\listtablename }%
%%This removes item from TOC. JAH
  % This group overloads \numberline to output ``Table 1.3'' instead of ``1.3''
  \begingroup%
    \let\ORIG@numberline\numberline%
    \renewcommand*{\numberline}[1]{\ORIG@numberline{\tablename~##1:}}%
    {\ssp\@starttoc{lot}}%
    \if@restonecol\twocolumn\fi%
  \endgroup %
  }

I am using basic trial and error to make these changes and I need some help from someone who understands style file code .cls .sty

Thanks, Adam

  • 3
    This is not enough information to resolve the problem. – Werner Dec 8 '15 at 3:18
  • Welcome! We need a small, minimal example of code which we can compile to reproduce the problem. All we can say right now is that the problem is pretty much surely not in the code you've posted. – cfr Dec 8 '15 at 3:32
  • @Werner Should \phantomsection be removed, too? – cfr Dec 8 '15 at 3:34
  • 1
    It's in general not a good idea to change a class or package file directly – user31729 Dec 8 '15 at 9:50
  • 1
    are you saying the original was \expandafter\uppercase \bfseries surely that just gives an error? also \expandafter{ is applying \expandafter to the space token after the { but that is not expandable so this does nothing. – David Carlisle Dec 8 '15 at 13:39
1

The @ are not generated by the code shown, presumably your \chapter command is writing something to the .lot file. It would be useful to show what is in that file (even more useful would be a reproducible example)

the heading code is

  \centerline{\expandafter
%\uppercase %remove JAH
\bfseries%
\expandafter{
\begin{flushleft}%
\listtablename}
\end{flushleft}%
}%

Is there any reason not to simply use \section*{\listtablename} ?

\centerline is not really a latex command it is left over from plain TeX and would not normally produce something that matches other headings in the document. If you do use it, the content must be horizontal mode material (it is like \hbox) so can not contain a flushleft environment. As it is it generates the error

! LaTeX Error: Something's wrong--perhaps a missing \item.

Note that after an error, any output in the pdf is essentially arbitrary TeX's error correction is not designed to make sensible typeset output, merely to get itself back into state so that it can process more of the document, mainly for error checking purposes.

The code is probably missing a % after the { and after \listtablename} and the \expandafter are not doing anything, the same result would be obtained without them.

| improve this answer | |
  • Thanks @DavidCarlisle, I ended up making a quick fix by finding the "@" signs in the .lot file and removing them. We are then constrained to only running compile once, but it worked for now. Thanks everyone for the comments. – adm Dec 8 '15 at 23:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.