0

I need to put a background image on full page and I have several group elements, sometimes two groups on one page

I only get one Image on half of the page and on the next page the group elements start

I hope you can understand what my problem is

\documentclass[12pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[textwidth=15cm,centering]{geometry}
\usepackage[x11names]{xcolor}
\usepackage{graphicx}
\usepackage{background}

% colorize text
\newcommand*\ColText[1]{\textcolor{Goldenrod3}{#1}}

% a tabular* for each food group
\newenvironment{Group}[1]
{\noindent\begin{tabular*}{\textwidth}{@{}p{0.9\linewidth}@{\extracolsep{\fill}}r@{}}
        {\fontsize{30}{35}\selectfont\ColText{#1}}\\[0.8em]}
    {\end{tabular*}}

% to format each entry
\newcommand*\Entry[2]{%
    \sffamily#1 & #2}

% to format each subentry
\newcommand*\Expl[1]{%
    \hspace*{1em}\footnotesize #1}

\begin{document}

        \backgroundsetup{          
            scale=1,
            angle=0,
            opacity=.4,  
            contents={\includegraphics[width=\paperwidth,height=\paperheight]{exaple-image}}
        }
    \begin{Group}{group1}
        \Entry{entry1}\\

        \Entry{entry2}\\
    \end{Group}
    \vfill
    
    \begin{Group}{group2}
        \Entry{entry1}\\
        \Expl{expl1}\\
        \Entry{entry2}\\
        \Expl{expl2}\\
    \end{Group}

\end{document}
10
  • 3
    Welcome to TeX.SX! I am not sure whether I get your problem, so please make your code example compilable: Add a document class and \end{document} and provide the defintions for the Group environment and the \Entry command (or add the package that provides this environment) or, if this is meant to be a placeholder, use environments or commands that are available per default (such as itemize). Commented Oct 11, 2023 at 22:49
  • 1
    Note that the mwe package includes example images, so you can use those to replace images we don't have. Providing us with code we can compile to reproduce the problem is essential to getting useful answers.
    – cfr
    Commented Oct 12, 2023 at 1:27
  • There are two unwanted 8i characters behind \usepackage{xcolor}. Should be removed, otherwise it will produce an error. Plus your own Group environment is still unknown if I run your code.
    – lukeflo
    Commented Oct 12, 2023 at 9:17
  • Oh I didn't knew that, I had a template including these group elements
    – C. At
    Commented Oct 12, 2023 at 9:20
  • Then add the definitions of these commands to your example code. If the background image is always the same, it might be more straightforward to add it using shipout from the kernel.
    – lukeflo
    Commented Oct 12, 2023 at 9:22

0

You must log in to answer this question.

Browse other questions tagged .