Can someone explain how to solve this problem: LaTeX Error: File `scrpage2.sty' not found? I read all the answers but didn't understand what to do. Today I install miktex 2.9 and winedt 10.3.
-
9scrpage2.sty is obsolete, and is moved. Read the documentation. Use ` scrlayer-scrpage` instead, see message at CTAN from the author.– SveinungCommented May 1, 2020 at 15:39
-
2See also komascript.de/faq_scrpage2_en (English) and komascript.de/faq_scrpage2 (German).– moeweCommented May 1, 2020 at 15:45
3 Answers
The author has declared the package scrpage2
obsolete. It is no longer included in TeX live and MikTeX. The package is still available on CTAN (https://ctan.org/pkg/scrpage2, https://ctan.org/pkg/koma-script-obsolete), but it would have to be installed manually from the .dtx
source. See also https://komascript.de/faq_scrpage2_en.
Users are advised to switch to the successor package scrlayer-scrpage
. If you have
\usepackage[<options>]{scrpage2}
in your preamble, replace it with
\usepackage[<options>]{scrlayer-scrpage}
Apparently all commands and options of scrpage2
are also recognised by scrlayer-scrpage
, so a switch should be possible. But users are strongly encouraged to double check the results and consult the .log
file as well as the manual for hints about deprecated, obsolete or otherwise outdated commands.
(Just to be clear, scrlayer-scrpage
is part of the regular KOMA-Script bundle and can be installed as the package koma-script
in both MiKTeX and TeX live if it isn't installed already.)
If some code/package beyond your control loads scrpage2
, contact the author and look into alternatives (scrpage2
has been up for deprecation for quite a while [about six years; it has thrown warnings for at least two years according to https://komascript.de/faq_scrpage2_en], so if the code author hasn't reacted until now, that suggests they might not follow the development of their code that closely any more). If you must use external code that uses scrpage2
, you can try the workaround suggested at https://komascript.de/faq_scrpage2_en:
Add
\RequirePackage{scrlfile}
\ReplacePackage{scrpage2}{scrlayer-scrpage}
to your preamble before the \documentclass
line. That will load scrlayer-scrpage
when any code requests scrpage2
.
-
-
@Silva I'm glad it works for you. But don't just make the changes, actively look at the
.log
files and the documentation to make sure you are not using outdated commands/options. If this is not code you wrote yourself, tell the author about the deprecation and be wary of its overall quality.– moeweCommented May 1, 2020 at 16:09 -
-
If anyone (like me) is using Overleaf and gets the scrpage2.sty error, you can choose to work on your document with a previous version of TeXLive that still supports the obsolete package (see here).
On the long run this will create problems to your doc, but it works for me when need a quick fix to a non-important file.
This is meant as a comment to the first reply, but I don't have enough "reputation" yet. (just linked my account with tex.stackexchange), but I think it's important to note.
I use documentclass scrreprt
and the solution by moewe (replacing scrpage2
with scrlayer-scrpage
) worked for me, although I got new errors and had to include definitions for the layout of \section
etc. to fix them:
\begin{document}
\titleformat{\section}{\Large\sffamily\bfseries}{\thesection}{1em}{}
\titleformat{\subsection}{\large\sffamily\bfseries}{\thesubsection}{1em}{}
\titleformat{\subsubsection}{\large\sffamily\bfseries}{\thesubsubsection}{1em}{}
\sffamily
makes text sans-serif, \bfseries
makes it bold.
This might help others struggling with this unexpected deprecation of an otherwise stable system ....
-
1