2

I have a new Mactex installation and in pstricks, using "fillcolor=..." inside \pspolygon no longer works--the polygon comes out empty. Has something changed in pstricks?

I know VERY little about latex and pstricks beyond the simplest level, so please answer at the 5th grade level or less.

Here is a sample file:

\documentclass[pstricks,border=12pt]{standalone}

\begin{document}

% !TEX TS-program = latex

\begin{pspicture}(-16,-3)(2.5,3) \newgray{extralight}{.85}

\pspolygonlinewidth=1.5pt,linecolor=extralight,fillcolor=extralight(-14.67,2)(-14.33,-2)(-.33,-2)(-.67,2)

\end{pspicture} \end{document}

I am using TexShop. I get this message:

%%%% WARNING: Transparency operations ignored - need to use -dALLOWPSTRANSPARENCY

Edit: when I run my original version included in this question, with \listfiles added, I get the file list below. When I try adding \listfiles to the version in the answer, there is no list of files in the log file.

 *File List*
standalone.cls    2018/03/26 v1.3a Class to compile TeX sub-files standalone
shellesc.sty    2019/11/08 v1.0c unified shell escape interface for LaTeX
ifluatex.sty    2019/10/25 v1.5 ifluatex legacy package. Use iftex instead.
   iftex.sty    2020/03/06 v1.0d TeX engine tests
 xkeyval.sty    2020/11/20 v2.8 package option processing (HA)
 xkeyval.tex    2014/12/03 v2.7a key=value parser (HA)
standalone.cfg    2018/03/26 v1.3a Default configuration file for 'standalone' 
class
 article.cls    2020/04/10 v1.4m Standard LaTeX document class
  size10.clo    2020/04/10 v1.4m Standard LaTeX file (size option)
pstricks.sty    2020/06/11 v0.70 LaTeX wrapper for `PSTricks' (RN,HV)
  xcolor.sty    2016/05/11 v2.12 LaTeX color extensions (UK)
   color.cfg    2016/01/02 v1.6 sample color configuration
   dvips.def    2017/06/20 v3.1d Graphics/color driver for dvips
pst-xkey.tex    2005/11/25 v1.6 PSTricks specialization of xkeyval (HA)
pst-xkey.tex    2005/11/25 v1.6 PSTricks specialization of xkeyval (HA)
pstricks.tex    2020/09/18 v3.01 `PSTricks' (tvz,hv)
  pst-fp.tex    2020/09/18 v3.01 `PST-fp' (hv)
l3backend-dvips.def    2021-03-18 L3 backend support: dvips
Ken_A
  • 21
  • 2
    you need to use the specified option to ps2pdf (it's a change in ghostscript) – David Carlisle Feb 08 '22 at 01:57
  • Thanks, but I don't know what that means in terms of how I change the sample file I included. Is that explained somewhere? – Ken_A Feb 08 '22 at 02:49
  • I really need 5th-grade level--I don't know what ps2pdf is, what the role of ghostscript is, or what "the specified option" refers to. – Ken_A Feb 08 '22 at 02:56
  • You're compiling with LaTeX, and therefore also using dvips to convert the resultant output of LaTeX (dvi) to PostScript (ps), and possibly ps2pdf to convert the PostScript to PDF. Somewhere in your list of options for that compilation sequence in TeXshop, you should should be able to see what options are being passed to dvips and/or ps2pdf. Can you show that dialog? – Werner Feb 08 '22 at 05:05
  • @Werner In the TeXShop source window, there is a menu to choose between Plain TeX, LaTex, BibTeX, XeLaTeX, etc. I have chosen LaTeX. With that selection made, one just clicks “Typeset”. I don’t see any reference to dvips or to ps2pdf, nor do I see any kind of list of options related to compilation besides the menu I mentioned. – Ken_A Feb 08 '22 at 05:19
  • your latex menu option is using latex then dvips then ps2pdf to generate the pdf you need the option on that last step I do not use that editor so can not tell you where the setting is. – David Carlisle Feb 08 '22 at 07:04
  • @Ken_A: The following will be of help: How to customize the default xelatex command in TexShop for OSX Find the script associated with LaTeX and add the -dALLOWPSTRANSPARENCY option to ps2pdf. – Werner Feb 08 '22 at 07:25
  • @Werner Under TeXShop Preferences—>Engine, there are 3 windows:

    Path settings, pdfTeX, TeX+dvips+distiller.

    (1) Inside “pdfTeX” window are 2 editable lines, one under “Tex”, and another under “Latex” which says:

    pdflatex --file-line-error --synctex=1

    (2) Inside “TeX+dvips+distiller” window are 2 editable lines, one under “Latex” which says:

    simpdftex latex --maxpfb --extratexopts "-file-line-error -synctex=1"

    So, somewhere in all this, I need to insert -dALLOWPSTRANSPARENCY, is that right? Where? And can it be in there all the time, even when I’m not using pstricks?

    – Ken_A Feb 08 '22 at 16:42
  • @Ken_A: Yes and yes. It's probably under the second editable line inside "TeX+dvips+distiller" (which you didn't mention). – Werner Feb 08 '22 at 16:48
  • @Werner Thanks! Inside “TeX+dvips+distiller” window, the other editable line is under “Tex”, and it says: simpdftex etex --maxpfb --extratexopts "-file-line-error -synctex=1" . Should I be adding -dALLOWPSTRANSPARENCY in both the editable lines (Tex and Latex ones) inside TeX+dvips+distiller window? – Ken_A Feb 08 '22 at 17:34
  • The options you mention seems to point to pdflatex, or something similar (simpdftex). It needs to be in lines using ps2pdf, but you haven't listed that. – Werner Feb 08 '22 at 18:02
  • @Ken_A: Are you able to/interested in switching engines? That is, not use LaTeX but XeLaTeX or LuaLaTeX? – Werner Feb 08 '22 at 19:11
  • @Werner Nothing under TeXShop Preferences—>Engine mentions ps2pdf. If I go to TeXShop Preferences—>Misc, there is a “Personal Script” window with places (now blank) for 2 entries, one under “Tex Program (no default)” and one “Latex Program (no default)”. – Ken_A Feb 08 '22 at 20:07
  • @Werner If all my old files written for regular LaTeX will still run, then I don’t know of a downside (though maybe that’s a big “if”.) But I guess I’m a bit incredulous that a simple thing like “make a polygon and fill it with light gray” in pstricks should require such a thing. – Ken_A Feb 08 '22 at 20:07
  • @Ken_A: How about using fillcolor=black!15 rather than using extralight (since that may use/need transparency). May need to add \usepackage{xcolor} to your preamble. Just trying out things. – Werner Feb 08 '22 at 20:19
  • @Werner nothing I do fills the polygon, not even fillcolor=black. – Ken_A Feb 08 '22 at 20:25
  • @Ken_A: Even when you change the linecolor option to black as well? What if, instead of using standalone, you try with a default \documentclass{article} \usepackage{pstricks,xcolor}? – Werner Feb 08 '22 at 20:47
  • @Werner no change from doing what you suggest. – Ken_A Feb 08 '22 at 22:27
  • @Ken_A: Then it's best someone with a Mac + TeXShop to help out. – Werner Feb 08 '22 at 22:31
  • @Werner OK, thanks for trying! – Ken_A Feb 08 '22 at 23:01

2 Answers2

1

Two things:

(1) use \pspolygon* (note the *) as given in the answer below or add the fillstyle=solid option to the \pspolygon command.

(2) In this case it isn't necessary but, in general if you are using Ghostscript version 9.51 or later (MacTeX-2021 installs version 9.53 so that's probably true) you need to use an engine that uses the correct call to ps2pdf to allow transparency.

To get that engine activated go to ~/Library/TeXShop/ using TeXShop's TeXShop->Open ~/Library/TeXShop menu command. Then open the Engines/Inactive/GhostscriptTransparencyEngines/For TeXShop/Engines folder. Copy the latexTR.engine file into the Engines folder itself to activate it. Restart TeXShop.

To use the engine place the line % !TEX program = latexTR near the top of the file and typeset using TeXShop's Typeset->Typeset (Cmd-T) menu command.

Herb Schulz
  • 3,410
0

Run it with lualatex instead of latex:

% !TEX TS-program = lualatex

\RequirePackage{pdfmanagement-testphase} \DeclareDocumentMetadata{} \documentclass[pstricks,border=12pt]{standalone} \begin{document}

\begin{pspicture}xunit=0.5(2.5,3) \newgray{extralight}{.65} \pspolygon*linewidth=1.5pt,linecolor=extralight(-14.67,2)(-14.33,-2)(-.33,-2)(-.67,2) \end{pspicture} \end{document}

enter image description here

If your system is up-to-date you should see something like this (except the TeXLive version which is 2022 for me):

enter image description here

user187802
  • 16,850