LaTeX forum ⇒ GeneralTransparent Backgrounds

LaTeX specific issues not fitting into one of the other forums of this category.
rich86
Posts: 4
Joined: Mon Nov 26, 2007 4:09 pm

Transparent Backgrounds

Postby rich86 » Mon Nov 26, 2007 4:14 pm

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.

User avatar
localghost
Site Moderator
Posts: 9204
Joined: Fri Feb 02, 2007 12:06 pm

Postby localghost » Mon Nov 26, 2007 4:41 pm

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


Best regards and welcome on Board
Thorsten
LaTeX Community Moderator
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes


¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1

rich86
Posts: 4
Joined: Mon Nov 26, 2007 4:09 pm

Postby rich86 » Mon Nov 26, 2007 7:29 pm

Hi thanks for your quick reply,
I tried compiling one of the examples and get these errors:
  1. richard@richards:/tmp$ ls
  2. richard@richards:/tmp$ latex color7.tex
  3. This is pdfeTeX, Version 3.141592-1.30.5-2.2 (Web2C 7.5.5)
  4. entering extended mode
  5. (./color7.tex
  6. LaTeX2e <2003/12/01>
  7. Babel <v3.8g> and hyphenation patterns for english, usenglishmax, dumylang, noh
  8. yphenation, croatian, ukrainian, russian, bulgarian, czech, slovak, danish, dut
  9. ch, finnish, french, basque, german, ngerman, greek, monogreek, ancientgreek, i
  10. bycus, hungarian, italian, latin, mongolian, norsk, slovene, estonian, welsh, i
  11. nterlingua, icelandic, uppersorbian, romanian, indonesian, coptic, turkish, ser
  12. bian, polish, portuguese, spanish, catalan, swedish, ukenglish, loaded.
  13. (/usr/share/texmf-texlive/tex/latex/base/minimal.cls
  14. Document Class: minimal 2001/05/25 Standard LaTeX minimal class
  15. ) (/usr/share/texmf-texlive/tex/latex/pstricks-add/pstricks-add.sty
  16. (/usr/share/texmf-texlive/tex/latex/pstricks/pstricks.sty
  17. (/usr/share/texmf-texlive/tex/generic/pstricks/pstricks.tex
  18. `PSTricks' v1.12 <2005/10/25> (tvz)
  19. (/usr/share/texmf-texlive/tex/generic/pstricks/pstricks.con))
  20. (/usr/share/texmf/tex/latex/xcolor/xcolor.sty
  21. (/usr/share/texmf-texlive/tex/latex/config/color.cfg)
  22. (/usr/share/texmf-texlive/tex/latex/graphics/dvips.def)))
  23. (/usr/share/texmf-texlive/tex/generic/pstricks-add/pstricks-add.tex
  24. (/usr/share/texmf-texlive/tex/generic/pstricks/pst-plot.tex
  25. v97 patch 2, 1999/12/12
  26. (/usr/share/texmf-texlive/tex/generic/multido/multido.tex
  27. v1.41, 2004/05/18 <tvz>))
  28. (/usr/share/texmf-texlive/tex/generic/pstricks/pst-node.tex
  29. v97 patch 11, 2000/11/09)
  30. (/usr/share/texmf-texlive/tex/latex/xkeyval/pst-xkey.tex
  31. (/usr/share/texmf-texlive/tex/latex/xkeyval/xkeyval.sty
  32. (/usr/share/texmf-texlive/tex/latex/xkeyval/xkeyval.tex
  33. (/usr/share/texmf-texlive/tex/latex/xkeyval/keyval.tex))))
  34. `pstricks-add' v2.70, 2005/10/18 (hv)))
  35. (/usr/share/texmf-texlive/tex/generic/multido/multido.sty) (./color7.aux)
  36. PSTricks error. See User's Guide for further information.
  37. Type H <return> for immediate help.
  38. ! Undefined fill style: `transparent'.
  39. \@pstrickserr ... immediate help.}\errmessage {#1}
  40. \endgroup
  41. l.10 \psset{fillstyle=transparent,linestyle=none}
  42.  
  43. ?
  44.  
  45. ! Package xkeyval Error: `transpalpha' undefined in families `,pstricks-add'.
  46.  
  47. See the xkeyval package documentation for explanation.
  48. Type H <return> for immediate help.
  49. ...
  50.  
  51. l.17 }
  52.  
  53. ?
  54.  
  55. ! Package xkeyval Error: `transpalpha' undefined in families `,pstricks-add'.
  56.  
  57. See the xkeyval package documentation for explanation.
  58. Type H <return> for immediate help.
  59. ...
  60.  
  61. l.17 }
  62.  
  63. ?
  64.  
  65. ! Package xkeyval Error: `transpalpha' undefined in families `,pstricks-add'.
  66.  
  67. See the xkeyval package documentation for explanation.
  68. Type H <return> for immediate help.
  69. ...
  70.  
  71. l.17 }
  72.  
  73. ?
  74.  
  75. ! Package xkeyval Error: `transpalpha' undefined in families `,pstricks-add'.
  76.  
  77. See the xkeyval package documentation for explanation.
  78. Type H <return> for immediate help.
  79. ...
  80.  
  81. l.17 }
  82.  
  83. ?
  84.  
  85. ! Package xkeyval Error: `transpalpha' undefined in families `,pstricks-add'.
  86.  
  87. See the xkeyval package documentation for explanation.
  88. Type H <return> for immediate help.
  89. ...
  90.  
  91. l.17 }
  92.  
  93. ?
  94.  
  95. ! Package xkeyval Error: `transpalpha' undefined in families `,pstricks-add'.
  96.  
  97. See the xkeyval package documentation for explanation.
  98. Type H <return> for immediate help.
  99. ...
  100.  
  101. l.17 }
  102.  
  103. ?
  104.  
  105. ! Package xkeyval Error: `transpalpha' undefined in families `,pstricks-add'.
  106.  
  107. See the xkeyval package documentation for explanation.
  108. Type H <return> for immediate help.
  109. ...
  110.  
  111. l.17 }
  112.  
  113. ?
  114.  
  115. ! Package xkeyval Error: `transpalpha' undefined in families `,pstricks-add'.
  116.  
  117. See the xkeyval package documentation for explanation.
  118. Type H <return> for immediate help.
  119. ...
  120.  
  121. l.17 }
  122.  
  123. ?
  124.  
  125. ! Package xkeyval Error: `transpalpha' undefined in families `,pstricks-add'.
  126.  
  127. See the xkeyval package documentation for explanation.
  128. Type H <return> for immediate help.
  129. ...
  130.  
  131. l.17 }
  132.  
  133. ?
  134.  
  135. ! Package xkeyval Error: `transpalpha' undefined in families `,pstricks-add'.
  136.  
  137. See the xkeyval package documentation for explanation.
  138. Type H <return> for immediate help.
  139. ...
  140.  
  141. l.17 }
  142.  
  143. ?
  144.  
  145. ! Package xkeyval Error: `transpalpha' undefined in families `,pstricks-add'.
  146.  
  147. See the xkeyval package documentation for explanation.
  148. Type H <return> for immediate help.
  149. ...
  150.  
  151. l.17 }
  152.  
  153. ?
  154.  
  155. ! Package xkeyval Error: `transpalpha' undefined in families `,pstricks-add'.
  156.  
  157. See the xkeyval package documentation for explanation.
  158. Type H <return> for immediate help.
  159. ...
  160.  
  161. l.17 }
  162.  
  163. ?
  164.  
  165. Underfull \hbox (badness 10000) in paragraph at lines 17--18
  166.  
  167.  
  168. Underfull \vbox (badness 10000) has occurred while \output is active [1]
  169. [2] (./color7.aux) )
  170. Output written on color7.dvi (2 pages, 3056 bytes).
  171. Transcript written on color7.log.
  172. 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

Postby Juanjo » Mon Nov 26, 2007 9:31 pm

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
Posts: 4
Joined: Mon Nov 26, 2007 4:09 pm

Postby rich86 » Mon Nov 26, 2007 10:07 pm

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:
  1. ! Package xkeyval Error: `transpalpha' undefined in families `,pst-3d,pstricks-
  2. add'.
  3.  
  4. See the xkeyval package documentation for explanation.
  5. 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

Postby Juanjo » Mon Nov 26, 2007 10:29 pm

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

  1. %--------------------------------------- small stuff -------------------------------
  2. % transalpha needs a run through latex -> dvips -> ps2pdf14(!)
  3. % and view with Acrobat >= 5.0
  4. % use transpalpha=<mumber> to the the opacity level
  5. %
  6. \define@key[psset]{pstricks-add}{transpalpha}{\pst@checknum{#1}\pstranspalpha }
  7. %\psset[pstricks-add]{transpalpha=1}
  8. \def\psfs@transparent{%
  9. \addto@pscode{/Normal .setblendmode \pstranspalpha .setshapealpha }%
  10. \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 317 times

rich86
Posts: 4
Joined: Mon Nov 26, 2007 4:09 pm

Postby rich86 » Mon Nov 26, 2007 10:54 pm

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: 9204
Joined: Fri Feb 02, 2007 12:06 pm

Postby localghost » Mon Nov 26, 2007 10:55 pm

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.
LaTeX Community Moderator
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes


¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1


Return to “General”

Who is online

Users browsing this forum: No registered users and 7 guests