1

I have been told that this has been asked on the site before, but I keep searching both through google and the stack exchange search bar, and none of the questions are what I am looking for.

I want to include an image, larger than the margins, as the Background of the title, which means I need the text on TOP of the image being use as a title, rather than below or besides it.

This is to be done for the Article class, not beamer.

An example would be:

enter image description here

How can I achieve this?

  • 1
    Packages like esopic or tikz or scrlayer-scrpage can do it. This question has been asked several times here on TeX.SX. You should be able to find one. Why reposting the question? – Johannes_B Apr 25 '18 at 5:03
  • Because none of the questions ask how to have the image as the BACKGROUND they ask how to have the image on top or besides. So the answers provide no explanation as to how to get the image to be wider than the margins, and having the text displayed on top of the image at a desired offset. – Makogan Apr 25 '18 at 5:05
  • 2
  • 1
    and here... – user121799 Apr 25 '18 at 5:11
  • Example 1, straigh up does not work. Example 2, the image has to occupy the entire page, attempting to make the image smaller and moving it up through page.north, results in the image disapearing. Third, only includes an image at top, does not allow to write text on top of image directly with the example. Fourth, creates it in every single page. – Makogan Apr 25 '18 at 5:19
3

Here is a simple code with eso-pic and its \AddToShipoutPictureBG* command. The starred version of the commands adds the image only once. In addition we use the titling package to conveniently place the title and have it in white, boldface characters without side effects.

\documentclass[12pt, a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{fourier, erewhon}
\usepackage{geometry}
\usepackage{lipsum}%
\usepackage{titling}
\setlength{\droptitle}{-12ex}
\renewcommand{\maketitlehooka}{\color{white}\bfseries}
\usepackage{eso-pic}
\usepackage{adjustbox}

\AddToShipoutPictureBG*{%
 \AtPageUpperLeft{\adjincludegraphics[width=\paperwidth, valign=t]{Paul_Gauguin}}
}%

\title{D’où venons-nous ? Que sommes nous ? Où allons-nous ?}
\author{Paul Gauguin (1897)}
\date{}

\begin{document}

 \maketitle

\lipsum[1-15]

\end{document} 

enter image description here

  • +1! I wonder from which artist your next example image will be? – user36296 Apr 25 '18 at 13:09
  • @samcarter: First answer the questions! ;o) – Bernard Apr 25 '18 at 13:20
1

Using \atxy{<x>}{<y>}{<content>}, made possible with the everypage macro \AddThispageHook, where <x> and <y> are coordinates relative to the upper left of the paper.

\documentclass[10pt,a4paper]{report}
%% Graphics
\usepackage{graphicx,xcolor}
\usepackage{everypage}
\usepackage{lipsum}
% THESE ARE LaTeX DEFAULTS; CAN CHANGE IF NEEDED.
\def\PageTopMargin{1in}
\def\PageLeftMargin{1in}
\newcommand\atxy[3]{%
 \AddThispageHook{\smash{\hspace*{\dimexpr-\PageLeftMargin-\hoffset+#1\relax}%
  \raisebox{\dimexpr\PageTopMargin+\voffset-#2\relax}{#3}}}}

\atxy{0in}{0in}{\raisebox{-\height}{\includegraphics[height=2in,width=\paperwidth]{example-image}}}
\atxy{.5\paperwidth}{\dimexpr1in+8pt\relax}{\makebox[0pt]{%
\Huge\color{red!90!black}\bfseries This is my added header test}}
\begin{document}
%% Titlepage
\vspace*{.2in}
\lipsum[1]
\end{document}

enter image description here

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.