GeneralTransparent Backgrounds

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
rich86

Transparent Backgrounds

Post by rich86 »

Hi, i am making a poster in LaTeX using the a0 class. I have made it using a few boxes that have to have a filled background colour, i was going to put a background image as a wallpaper but it doesn't look very good with the text boxes filled in. Does anyone know of a package to allow me to fill with semi-transparent boxes? I think it has something to do with the alpha channel but i cannot find any packages that can do it.

Thanks for any help in advance
Richard
Last edited by rich86 on Mon Nov 26, 2007 11:11 pm, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Transparent Backgrounds

Post by localghost »

You could do that either with PSTricks (Examples) or with PGF/TikZ (Examples).


Best regards and welcome on Board
Thorsten
rich86

Transparent Backgrounds

Post by rich86 »

Hi thanks for your quick reply,
I tried compiling one of the examples and get these errors:

Code: Select all

richard@richards:/tmp$ ls                                                                       
richard@richards:/tmp$ latex color7.tex
This is pdfeTeX, Version 3.141592-1.30.5-2.2 (Web2C 7.5.5)
entering extended mode
(./color7.tex
LaTeX2e <2003/12/01>
Babel <v3.8g> and hyphenation patterns for english, usenglishmax, dumylang, noh
yphenation, croatian, ukrainian, russian, bulgarian, czech, slovak, danish, dut
ch, finnish, french, basque, german, ngerman, greek, monogreek, ancientgreek, i
bycus, hungarian, italian, latin, mongolian, norsk, slovene, estonian, welsh, i
nterlingua, icelandic, uppersorbian, romanian, indonesian, coptic, turkish, ser
bian, polish, portuguese, spanish, catalan, swedish, ukenglish, loaded.
(/usr/share/texmf-texlive/tex/latex/base/minimal.cls
Document Class: minimal 2001/05/25 Standard LaTeX minimal class
) (/usr/share/texmf-texlive/tex/latex/pstricks-add/pstricks-add.sty
(/usr/share/texmf-texlive/tex/latex/pstricks/pstricks.sty
(/usr/share/texmf-texlive/tex/generic/pstricks/pstricks.tex
`PSTricks' v1.12  <2005/10/25> (tvz)
(/usr/share/texmf-texlive/tex/generic/pstricks/pstricks.con))
(/usr/share/texmf/tex/latex/xcolor/xcolor.sty
(/usr/share/texmf-texlive/tex/latex/config/color.cfg)
(/usr/share/texmf-texlive/tex/latex/graphics/dvips.def)))
(/usr/share/texmf-texlive/tex/generic/pstricks-add/pstricks-add.tex
(/usr/share/texmf-texlive/tex/generic/pstricks/pst-plot.tex
 v97 patch 2, 1999/12/12
(/usr/share/texmf-texlive/tex/generic/multido/multido.tex
 v1.41, 2004/05/18 <tvz>))
(/usr/share/texmf-texlive/tex/generic/pstricks/pst-node.tex
 v97 patch 11, 2000/11/09)
(/usr/share/texmf-texlive/tex/latex/xkeyval/pst-xkey.tex
(/usr/share/texmf-texlive/tex/latex/xkeyval/xkeyval.sty
(/usr/share/texmf-texlive/tex/latex/xkeyval/xkeyval.tex
(/usr/share/texmf-texlive/tex/latex/xkeyval/keyval.tex))))
`pstricks-add' v2.70, 2005/10/18 (hv)))
(/usr/share/texmf-texlive/tex/generic/multido/multido.sty) (./color7.aux)
PSTricks error.  See User's Guide for further information.
                 Type  H <return>  for immediate help.
! Undefined fill style: `transparent'.
\@pstrickserr ... immediate help.}\errmessage {#1}
                                                  \endgroup
l.10 \psset{fillstyle=transparent,linestyle=none}

?

! Package xkeyval Error: `transpalpha' undefined in families `,pstricks-add'.

See the xkeyval package documentation for explanation.
Type  H <return>  for immediate help.
 ...

l.17 }

?

! Package xkeyval Error: `transpalpha' undefined in families `,pstricks-add'.

See the xkeyval package documentation for explanation.
Type  H <return>  for immediate help.
 ...

l.17 }

?

! Package xkeyval Error: `transpalpha' undefined in families `,pstricks-add'.

See the xkeyval package documentation for explanation.
Type  H <return>  for immediate help.
 ...

l.17 }

?

! Package xkeyval Error: `transpalpha' undefined in families `,pstricks-add'.

See the xkeyval package documentation for explanation.
Type  H <return>  for immediate help.
 ...

l.17 }

?

! Package xkeyval Error: `transpalpha' undefined in families `,pstricks-add'.

See the xkeyval package documentation for explanation.
Type  H <return>  for immediate help.
 ...

l.17 }

?

! Package xkeyval Error: `transpalpha' undefined in families `,pstricks-add'.

See the xkeyval package documentation for explanation.
Type  H <return>  for immediate help.
 ...

l.17 }

?

! Package xkeyval Error: `transpalpha' undefined in families `,pstricks-add'.

See the xkeyval package documentation for explanation.
Type  H <return>  for immediate help.
 ...

l.17 }

?

! Package xkeyval Error: `transpalpha' undefined in families `,pstricks-add'.

See the xkeyval package documentation for explanation.
Type  H <return>  for immediate help.
 ...

l.17 }

?

! Package xkeyval Error: `transpalpha' undefined in families `,pstricks-add'.

See the xkeyval package documentation for explanation.
Type  H <return>  for immediate help.
 ...

l.17 }

?

! Package xkeyval Error: `transpalpha' undefined in families `,pstricks-add'.

See the xkeyval package documentation for explanation.
Type  H <return>  for immediate help.
 ...

l.17 }

?

! Package xkeyval Error: `transpalpha' undefined in families `,pstricks-add'.

See the xkeyval package documentation for explanation.
Type  H <return>  for immediate help.
 ...

l.17 }

?

! Package xkeyval Error: `transpalpha' undefined in families `,pstricks-add'.

See the xkeyval package documentation for explanation.
Type  H <return>  for immediate help.
 ...

l.17 }

?

Underfull \hbox (badness 10000) in paragraph at lines 17--18


Underfull \vbox (badness 10000) has occurred while \output is active [1]
[2] (./color7.aux) )
Output written on color7.dvi (2 pages, 3056 bytes).
Transcript written on color7.log.
richard@richards:/tmp$  
Any idea what packages i am missing or what is wrong? it doesn't seem to recognise the transparent option.
I am using TexLive on Linux (ubuntu 7.04)
User avatar
Juanjo
Posts: 657
Joined: Sat Jan 27, 2007 12:46 am

Re: Transparent Backgrounds

Post by Juanjo »

You are using an outdated version of PSTricks. Actualize it.

Just to test if there is other problem, try

\psset{fillstyle=solid,linestyle=none}

instead of

\psset{fillstyle=transparent,linestyle=none}
rich86

Transparent Backgrounds

Post by rich86 »

i thought about versions after posting and now have PSTricks v1.15a and updated xkeyval PSTricks-add as well. They all seem to be the newest versions on CTAN, and yes i have run sudo texhash so it finds all the updates!
i still get the same output with the same errors something todo with transpalpha not being defined in pstricks-add. here is the specific error that i think it causing the problems:

Code: Select all

! Package xkeyval Error: `transpalpha' undefined in families `,pst-3d,pstricks-
add'.

See the xkeyval package documentation for explanation.
Type  H <return>  for immediate help.
i have tested pstricks-add and other packages on their own and they seem to work ok.
I am trying to run the 2nd and 3rd ones of the examples on this page
User avatar
Juanjo
Posts: 657
Joined: Sat Jan 27, 2007 12:46 am

Transparent Backgrounds

Post by Juanjo »

It seems that transalpha is defined in the file pstricks-add.tex, located in my computer at

/usr/local/texlive/2007/texmf-dist/tex/generic/pstricks-add/pstricks-add.tex

The relevant code in this file is

Code: Select all

%--------------------------------------- small stuff -------------------------------
% transalpha needs a run through latex -> dvips -> ps2pdf14(!) 
% and view with Acrobat >= 5.0
% use transpalpha=<mumber> to the the opacity level
%
\define@key[psset]{pstricks-add}{transpalpha}{\pst@checknum{#1}\pstranspalpha }
%\psset[pstricks-add]{transpalpha=1}
\def\psfs@transparent{%
  \addto@pscode{/Normal .setblendmode \pstranspalpha .setshapealpha }%
  \psfs@solid}
I attach this file. Put it in the same directory as color7.tex and try again.
Attachments
pstricks-add.tex
(98.76 KiB) Downloaded 512 times
rich86

Re: Transparent Backgrounds

Post by rich86 »

That's sorted thanks very much, seems pstricks-add wasn't being updated to the newest version.
Thanks again
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Transparent Backgrounds

Post by localghost »

The current version (v2.91) of pstricks-add defines those transparent colours in another way than older versions did. Unfortunately, the examples on the homepage of PSTricks seem not to be updated. Refer to the documentation of pstricks-add (Section 10 - Color, p. 33ff). There are mentioned some predefined transparent colours. Note that the effect of transparency won't appear until the code is compiled via PS to PDF.
Post Reply