0

I'm trying to add an image as the background for the "Title Page" only

I used the following code

\usepackage{background}     % I insert it in the main.tex file 
\backgroundsetup{           % I insert it in the "title_page.tex" file
 scale=1,
 angle=0,
 opacity=.4,  %% adjust
 contents={\includegraphics[width=\paperwidth,height=\paperheight]{rubik.jpg}}
 }

I end up with a very suitable background for the title page. However, the rest of the pages now contain the word Draft in large italics as a background.

My question is: How can I restrict this code to the "Title Page" only?

Or, if there is another way to get the same result?

6
  • as always on the site you're more likely to get help if you provide a full but minimal self contained example. In that case it is also a good idea to use one of the images that comes with the mwe package (ctan.org/tex-archive/macros/latex/contrib/mwe) as these are images that every one have access to
    – daleif
    May 20, 2021 at 9:47
  • 1
    Have you tried adding \backgroundsetup{contents={}} , i.e. an empty background, after your titlepage?
    – Markus G.
    May 20, 2021 at 9:56
  • @daleif Thank you May 20, 2021 at 10:12
  • @MarkusG. It works! Thanks a lot May 20, 2021 at 10:13
  • @IyadWalweel Happy to help. Feel free to also accept my answer below. (Which is typically the way of saying "Thank you, it works" on stackexchange.)
    – Markus G.
    May 20, 2021 at 10:14

1 Answer 1

1

I will briefly elaborate on the comment: The default of the background package is to add Draft to all pages as a default at an angle and a specified size. This is explained in the package documentation really.

To avoid this behaviour, you simply have to re-define the content of the added text to be empty.

Here is an example to illustrate a way to achieve this:

\documentclass{scrartcl}
\usepackage{background}
\usepackage{lipsum}

\begin{document}
    \begin{titlepage}
        \backgroundsetup{ 
            scale=3,
            angle=0,
            opacity=1,
            contents={I am a title page}
        }
    Test
    \end{titlepage}
    \newpage
    \backgroundsetup{contents={}}
    \lipsum[1-5]
\end{document}

EDIT: Or you can use the firstpage option that comes with the package. Its default is false, so simply set it to true to achieve essentially the same thing:

\documentclass{scrartcl}
\usepackage[firstpage=true]{background}
\usepackage{lipsum}

\begin{document}
    \begin{titlepage}
        \backgroundsetup{ 
            scale=3,
            angle=0,
            opacity=1,
            contents={I am a title page}
        }
        Test
    \end{titlepage}
    \newpage
    \lipsum[1-5]
\end{document}

You must log in to answer this question.

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