I am trying to compile a long document and I got this error message:
Command \titlefont already defined
So, I've opened the .log file to understand what was happening. The lines around the eror message are these ones:
("C:\Program Files\MiKTeX 2.9\tex\latex\koma-script\scrlfile.sty"
Package: scrlfile 2017/09/07 v3.24 KOMA-Script package (loading files)
)))
LaTeX Warning: Command \@footnotemark has changed.
Check if current package is valid.
! LaTeX Error: Command \titlefont already defined.
Or name \end... illegal, see p.192 of the manual.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...
l.1225 \newcommand*\titlefont{\sectfont}
%
So, it seemed to me that the scrlfile.sty
contained a new definition of the \titlefont
command. But it doesn't. As you can see, whatever file contains that new definition, it has it at the line 1225, whereas the file scrlfile.sty
is only 492 lines long. So, my question is:
How can I determine which package is trying to redefine the
\titlefont
command?
Note: My LaTeX doesn't define the \titlesec
command.
renewcommand
instead.scrlfile.sty
has already been closed when the error occurs (look at the closing parentheses). A class that defines a\titlefont
command is, for example,scrbook
.\errorcontextlines 5
to your preamble to get more context.