[Tex/LaTex] scaling an image to pagewidth

graphicskoma-script

I want to scale an image in my document to the whole pagewidth. I googled on how to do it and people were recommending the use of \paperwidth in additional arguments of \includegraphics. When I try to do it in my scrartcl document, it doesn't work. Apparently it only works in the article documentclass. Do you know a workaround for scrartcl?

image not scaled to pagewidth

\documentclass[bibliography=totoc, ngerman]{scrartcl}
\usepackage{graphicx}

\begin{document}
    \begin{figure}
        \includegraphics[width=\paperwidth]{EM_Spektrum.pdf}
    \end{figure}
\end{document}

Best Answer

This has nothing to do with the document class, but only with the fact that you forgot to center the figure.

\documentclass[bibliography=totoc, ngerman]{scrartcl}
\usepackage{graphicx}
\begin{document}
    \begin{figure}
        \centerline{\includegraphics[width=\paperwidth]{EM_Spektrum.pdf}}
    \end{figure}
\end{document}

enter image description here

Related Question