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{...}
1
  • Please try the following: \ifnum\value{page}>1 \includegraphics{...}\else\includegraphics{...}\fi. There is a space between 1 and \includegraphics{...}. Aug 21, 2017 at 6:45

1 Answer 1

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
  • 1
    Thank you, my issue was resolved using \ifnum\thepage=1 command
    – Siva D
    Aug 21, 2017 at 7:12

You must log in to answer this question.

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