2

I was wondering if I can force an image to be behind the text; without affecting the text. Or the other way around which is to place the text on top of the image.

Here are the examples of my trials:

\begin{figure}[h!]
    \begin{center}
    \resizebox{1\textwidth}{!}{\includegraphics{Figures/Chapter_3/browserWindow}}
    \end{center}
\end{figure}

I also tried \begin{figure}[htb], and \begin{figure}[H]. I tried following this suggestion but nothing happens so I use the regular way of creating a figure. notice that the middle of the figure is also transparent. Also as you can see from the size of the figure is not matching with the \textwidth. How to adjust this so that the lines of the window frame would match the \textwidth?

\begin{figure}[htb]
    \centering
    \includegraphics[width = 1\textwidth]{Figures/Chapter_3/browserWindow}
\end{figure}

Here is he demo and in case you want to work with the image here is a link.

enter image description here

UPDATE:

    \begin{tikzpicture}[remember picture, overlay]
    \node[opacity=1,inner sep=0pt] at (current page.center) {%
        \includegraphics[%
            width=0.82\paperwidth,%
            height=0.43\paperheight%
        ]{Figures/Chapter_3/browserWindow}%
    }; %--- Including the background picture
    \end{tikzpicture}

Is there a way to adjust the position so that it can at the beginning of the chapter?

enter image description here


FINAL SOLUTION:

Thanks to @Marian G's answer, I was able to adjust this as I wanted. I simply used this:

\includegraphics[%
    width=1.15\textwidth,
    height=0.83\textwidth,
    align=t,
    smash=br,
    vshift=1cm,     % adjust the vertical position
    hshift=-1.5cm     % adjust the horizontal position
]{Figures/Chapter_3/browserWindow}%

Some text in the paragraph.

\vskip 0.2in %I had to use some space because the images was overlapping.

\begin{figure}[htb]
    \centering
    \includegraphics[width=0.7\textwidth{Figures/Chapter_3/technology_icons}
    \caption{Technologies used : (a) HTML5, (b) CSS3, (c) JavaScript with external libraries} 
    \label{fig:htmlIcons}
\end{figure}

enter image description here

1 Answers1

4

The following approach doesn't use tikz macros and can be of your interest. As far as I understand your claim, I will present a solution based on the package graphbox that enables to add some keys to the usual \includegraphics-command.

Code

\documentclass{article}

\usepackage{graphbox}   % allows to add keys to \includegraphics
\usepackage{lipsum}     % only for testing purposes


\begin{document}

\section{My dummy title}
%-----------------------
\lipsum[1]


\section{Another title}
%-----------------------
\includegraphics
    [%
    width=\textwidth,
    align=t,
    smash=br,
%   hide,           % hides graphics (if required)
%   vshift=-1cm     % adjust the vertical position
    ]
    {example-image}%% add your graphics file
\lipsum[2-4]

\end{document}

Output enter image description here

Marian G.
  • 1,951
  • 1
  • 9
  • 14