1

Hello I am trying to create a document with multiple pages. However, I need to add a specific background to the first page and another background for the rest of the pages.

I am currently using:

\usepackage{graphicx}
\usepackage{lipsum}

\usepackage[pages=1,2]{background}

\backgroundsetup
{scale=1.0, color=black, opacity=1.0, angle=0, 
contents={
\checkoddpage
         \ifoddpage
            \includegraphics[width=\paperwidth,height=\paperheight]{1.pdf}
         \else
            \includegraphics[width=\paperwidth,height=\paperheight]{2.pdf}
        \fi}
}

I would like to use something like this instead of ifoddpages.

\if page = 1 
    \includegraphics{...} 
else 
    \includegraphics{...}
  • Please try the following: \ifnum\value{page}>1 \includegraphics{...}\else\includegraphics{...}\fi. There is a space between 1 and \includegraphics{...}. – logo_writer Aug 21 '17 at 6:45
0

I haven't tested this solution, but according to this thread, in order to detect the page number, you can do this:

\ifnum\value{page}>1 \includegraphics{...}\else\includegraphics{...}\fi
  • 1
    Thank you, my issue was resolved using \ifnum\thepage=1 command – Siva D Aug 21 '17 at 7:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.