Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I found some discussions about the opacity parameter in pstricks, but I still can't make it work. Here is my tex file:

\documentclass{article}
\usepackage{pstricks}
\usepackage{pstricks-add} 

\begin{document}

\begin{pspicture}(-2,-2)(2,2)
    \psset{fillstyle=solid}
    \psline[linecolor=blue,linewidth=12pt](-2,-2)(2,2)
    \psframe[fillcolor=red,opacity=0.5](-1,-1)(1,1)
\end{pspicture}

\end{document}

I compile it on Ubuntu using:

latex opacity.tex
dvips opacity.dvi

but in the PS file, there is no transparency.

What should I do to see the picture with the transparency effect?

share|improve this question
    
As far as I know, PostScript does not know of transparency. Try to make a standalone .eps file from your picture/diagram and convert it .pdf then with epstopdf or something similar. –  Christian Hupfer Apr 22 at 6:55
    
@ChristianHupfer how can I make an eps file? –  Erel Segal Halevi Apr 22 at 6:58
1  
Just add ps2pdf opacity.ps to the sequence of commands. This makes transparency visible in a PDF viewer. –  AlexG Apr 22 at 7:01
    
@ErelSegalHalevi: See my 'answer' below. –  Christian Hupfer Apr 22 at 7:05
    
@AlexG thanks, this worked. –  Erel Segal Halevi Apr 22 at 7:05
add comment

1 Answer 1

This is rather the workflow than a true answer, but only for desired output as .pdf or as standalone .eps file.

\documentclass{article}


\usepackage{pstricks}
\usepackage{pstricks-add} 
\usepackage{pst-eps}


\begin{document}

\begin{TeXtoEPS}

\begin{pspicture}(-2,-2)(2,2)
    \psset{fillstyle=solid}
    \psline[linecolor=blue,linewidth=12pt](-2,-2)(2,2)
    \psframe[fillcolor=red,opacity=0.5](-1,-1)(1,1)
\end{pspicture}

\end{TeXtoEPS}

\end{document}

Run

latex foo.tex

dvips -E -o foo.eps foo.dvi

epstopdf foo.eps

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.