2

I am currently creating a short advertisement in Latex. I would like to include a pretty transparent background image for that.

Including the background image per se is not the problem, I have managed that one. However, when I try to change the transparency of it, nothing changes but I would like to have it almost entirely transparent.

This is my LaTex source:

\documentclass[10pt,a4paper]{article}

\usepackage{transparent}

\usepackage{background}

\usepackage{tikz}

\usetikzlibrary{calc}

\usepackage{pst-node,graphicx}

\definecolor{darkpowderblue}{rgb}{0.0, 0.2, 0.6}

\begin{document}

Advertisement title 

\tikz[overlay, remember picture] \draw [darkpowderblue, thick] 

([xshift=0.5cm,yshift=-0.5cm]current page.north west) rectangle 

([xshift=-0.5cm,yshift=0.5cm]current page.south east); %---making a coloured box 

around ad




\begin{tikzpicture}[remember picture, overlay]

\node[opacity=0.6,inner sep=0pt] at (current page.center)

{\transparent{0.9}\includegraphics[width=0.9\paperwidth,height=0.6\paperheight]

{Download}}; %--- Including the background picture

\end{tikzpicture}


Ad text bla bla bla

\end{document}

When I change opacity, nothing happens; when I change \transparent{}, nothing happens.

Does someone of you know why the transparency is not adjusted?

Thanks a lot for your help

  • 1
    Why do you have all the blank lines in your code? – Mensch Apr 17 at 12:45
  • If pst-node means that you are compiling with latex+dvips: the transparent package doesn't work with it. – Ulrike Fischer Apr 17 at 12:54
4

Remove all blank lines. Please only add blank lines when you know what it is doing.

opacity only is enough. Adding transparent or background may cause conflicts (?).

Compilable code, with opacity=0.6:

\documentclass[10pt,a4paper]{article}
\usepackage{tikz}
\usetikzlibrary{calc}
\usepackage{graphicx}
\definecolor{darkpowderblue}{rgb}{0.0, 0.2, 0.6}
\usepackage{lipsum}
\begin{document}
\tikz[overlay, remember picture] \draw [darkpowderblue, thick] 
([xshift=0.5cm,yshift=-0.5cm]current page.north west) rectangle 
([xshift=-0.5cm,yshift=0.5cm]current page.south east); %---making a coloured box 
\begin{tikzpicture}[remember picture, overlay]
\node[opacity=0.6,inner sep=0pt] at (current page.center) {%
    \includegraphics[%
        width=0.9\paperwidth,%
        height=0.6\paperheight%
    ]{example-image-a}%
}; %--- Including the background picture
\end{tikzpicture}

\lipsum[1-5]
\end{document}

enter image description here

  • Wow cool! It seems to work for you, but somehow my background looks the same when I set opacity to 0.6 and when I set it to 0.9. I have also removed all blank lines as suggested. These two pictures look exactly the same and one has opacity= 0.6 and the other one has opacity=0.9 [link] (imgur.com/a/3AUOMiv) – user174854 Apr 17 at 13:03
  • @HelenaPokrivka Have you (1) removed \transparent and (2) removed the conflicting packages? – user156344 Apr 17 at 13:10
  • @HelenaPokrivka Please add your code to the question. Also the compiler you used – user156344 Apr 19 at 7:20
  • I am using TexStudio. And which code exactly do you mean? The source code is \documentclass[10pt,a4paper]{article} \tikz[overlay, remember picture] \draw [darkpowderblue, thick] ([xshift=0.5cm,yshift=-0.5cm]current page.north west) rectangle ([xshift=-0.5cm,yshift=0.5cm]current page.south east); \begin{tikzpicture}[remember picture, overlay] \node[opacity=0.6,inner sep=0pt] at (current page.center) {\includegraphics[width=0.87\paperwidth,height=0.65\paperheight]{Download}}; \end{tikzpicture} – user174854 Apr 19 at 7:23
  • @HelenaPokrivka Please add your code to the question. – user156344 Apr 19 at 7:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy