Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I am trying to create a newsletter with Latex, but I am not expert at all. My goal is, for the moment, to create a first page (the cover), with an image in the background, and some text overprinted. Looking around this SE, I found the tikzpicture as a possible environment for this purpose. Copying and pasting here and there, I came out with a MWE:

\documentclass{article}
\usepackage[hmargin=2cm,bmargin=3cm,tmargin=4.5cm,centering]{geometry}
\usepackage{tikzpagenodes}
\usetikzlibrary{calc}
\usepackage{lmodern}
\usepackage{multicol}
\usepackage{lipsum}
\usepackage{atbegshi}

\begin{document}
\thispagestyle{empty}
\begin{tikzpicture}
\node[anchor=south west,inner sep=0] (image) at (0,0) {\includegraphics[width=0.8\textwidth]{LiberGMA.eps}};
\end{tikzpicture}

\pagestyle{empty}
%\AtBeginShipout{\Header\Footer} # comments are where the line is in the code from which I copied, but I don't know the meaning
%\AtBeginShipoutFirst{\Header\Footer} 


\begin{multicols}{2}
%\lipsum[1-15]
\end{multicols}
\end{document}

Now, it happens that I want the image to take all the first page, but I have to set the size, and after a certain size, the image is moved in the second page, leaving the first blank. How can I fix this?

share|improve this question

2 Answers 2

up vote 5 down vote accepted

To include a big image without creating a new page, you may add remember picture and overlay options to your tikzpicture environment.

To anchor your picture to the corner of the page, you may use the special node current page (p. 250 of pgfmanual v3.0.0).

Example:

enter image description here

\documentclass{article}
\usepackage[hmargin=2cm,bmargin=3cm,tmargin=4.5cm,centering]{geometry}
\usepackage{tikz}
\usepackage{lmodern}
\usepackage{multicol}
\usepackage{lipsum}
\usepackage{mwe}
\begin{document}
\thispagestyle{empty}
\begin{tikzpicture}[remember picture,overlay]
  \node[anchor=south west,inner sep=0,text opacity=.5]
  (image) at (current page.south west)
  {\includegraphics[width=\paperwidth,height=\paperheight]{example-image-a}};
\end{tikzpicture}
\begin{multicols}{2}
  \lipsum[4-10]
\end{multicols}
\end{document}
share|improve this answer
    
This seems to work very well, thanks! Could you please just tell me what the "text opacity=.5" do? I guess it works on the transparency. So, how to set it to make the text overprinted? –  Py-ser Jun 28 at 14:27
    
@Py-ser For TikZ, the content of a node is a "text". With text opacity=.5, the big image is semi-transparent and we can read the overprinted text. –  Paul Gaborit Jun 29 at 6:44
    
thanks, but I don't want the image became transparent. The text must be overprinted, not in the background. The image is in the background. I am sorry for not being able to express it technically, I hope it is clear enough. –  Py-ser Jun 29 at 7:02
    
Besides, the image in the first page, is cut at the bottom. –  Py-ser Jun 29 at 7:26
    
@Py-ser The text (lipsum) is not in the background... but a black text over a black image is unreadable. With text opacity, the black image is overprinted transparently over the white background and thus the image seems gray. –  Paul Gaborit Jun 29 at 7:33

A second alternative is the use of background package. Here BackGroundImage macro taking 2 arguments is defined to add a background image.

Edit: If keeping the aspectratio is desired, then modify the macro a little bit, as shown below.

\newcommand\BackGroundImage[2][1]{% the default value is one
\BgThispage
\backgroundsetup{
contents={\includegraphics [width=#1\paperwidth, height=#1\paperheight, keepaspectratio] {#2}}
 }
}

and execute it as

\BackGroundImage[2]{example-image-a}  % magnified by 2

enter image description here

Code

\documentclass{article}
\usepackage[hmargin=2cm,bmargin=3cm,tmargin=4.5cm,centering]{geometry}
\usepackage[pages=some,scale=1,angle=0,opacity=0.7]{background}
\usetikzlibrary{calc}
\usepackage{lmodern}
\usepackage{multicol}
\usepackage{lipsum}
\usepackage{atbegshi}

\thispagestyle{empty}
\newcommand\BackGroundImage[2][scale=1]{%
\BgThispage
\backgroundsetup{
  contents={\includegraphics[#1]{#2}}
  }
}

\begin{document}
\BackGroundImage[width=\paperwidth,height=\paperheight]{example-image-a}% image on page 1
\begin{multicols}{2}

\lipsum[2]

\lipsum[4-10]

\lipsum[4-10]
\end{multicols}
\end{document}
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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