41

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.

2

3 Answers 3

65

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.

4
  • Thank you! Finally it works!
    – Silva
    Commented May 1, 2020 at 16:04
  • @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.
    – moewe
    Commented May 1, 2020 at 16:09
  • Thank you! This worked seamlessly.
    – kaykae
    Commented Mar 2, 2021 at 7:09
  • +1: I ran into the exact same problem today! Commented Aug 22, 2021 at 22:47
4

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.

2
  • Welcome to TeX.SE!
    – Mensch
    Commented Mar 26, 2021 at 12:24
  • Thanks a lot @Mensch! Commented Mar 27, 2021 at 13:05
0

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
  • 1
    Welcome to TeX.SE!
    – Mensch
    Commented Apr 3, 2022 at 15:42

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .