Document ClassesCompatibility between "pstricks" and "color" packages

Information and discussion about specific document classes and how to create your own document classes.
Post Reply
john99
Posts: 2
Joined: Fri Jul 25, 2008 5:50 am

Compatibility between "pstricks" and "color" packages

Post by john99 »

Dear All,

Recently I upgrated to MikTek 2.7 version, but have found that I now cannot use package "pstricks" and package "color" simutaneously. My LaTeX file is as follows:

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\documentclass[12pt]{article}
\usepackage{epsfig}
\usepackage{pstricks}
\usepackage{color}

\begin{document}

\colorbox[named]{GreenYellow}{\textcolor[named]{BrickRed}{\LARGE \bf Compatibility Issue}}

\colorbox[named]{GreenYellow}{\textcolor[named]{MidnightBlue}{\LARGE \bf pstricks \& color}}

\begin{pspicture}[linewidth=1cm](4,4)
\psline[linecolor=red](0,0)(4,4)
\psline[linecolor=blue,strokeopacity=0.5](0,4)(4,0)
\psline[linecolor=green,strokeopacity=0.5](0,3.5)(4,3.5)
\psline[linecolor=yellow,strokeopacity=0.5](0,0.5)(4,0.5)
\end{pspicture}

\end{document}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Each time I get an error message when compiling. But I had no problems before I upgrated to MikTek 2.7.

Your help is appreciated.

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

Compatibility between "pstricks" and "color" packages

Post by localghost »

The first issue is that you didn't declare the colours you want to use. I don't know if they were predefined by the color package. The second is that the PSTricks package uses xcolor by default. So there may be a collision hence you can omit the color package. You should refer to the documentation of these packages. Instead of PSTricks you can use the pstricks-add package which contains enhancements and bug fixes.

Replace the obsolete epsfig package with the graphicx package. More information about packages and especially their documentations are available on the servers of the CTAN. If all these hints above don't help you should give the exact error message so we can find out more.


Best regards and welcome to the board
Thorsten¹
john99
Posts: 2
Joined: Fri Jul 25, 2008 5:50 am

Re: Compatibility between "pstricks" and "color" packages

Post by john99 »

Hi Thorsten,

Thnaks for your reply. Yes, you're right. I noticed the error message that the color package clashes with the PSTricks package. Now I use

\usepackage{pstcol}
\usepackage{pstricks-add}

to replace

\usepackage{pstricks}
\usepackage{color}

and it seems that the compatibility issue is resolved. But if I use \usepackage{pstricks-add} only (not together with \usepackage{pstcol}), then the problem remains. I don't why.

Also, thanks for your comment on the graphicx package.

Best regards,

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

Compatibility between "pstricks" and "color" packages

Post by localghost »

Make sure that you have the latest version of the pstricks-add package (and the xcolor package). If necessary, provide a minimal working example (MWE) that reproduces the error together with the produced log file. To find out the version of the used package, insert a \listfiles command right at the beginning of the source file.
CrazyHorse
Posts: 351
Joined: Sat Aug 02, 2008 8:47 am

Compatibility between "pstricks" and "color" packages

Post by CrazyHorse »

Code: Select all

\documentclass[12pt]{article}
\usepackage[dvipsnames]{pstricks}

\begin{document}

\colorbox[named]{GreenYellow}{\textcolor[named]{BrickRed}{\LARGE \bf Compatibility Issue}}
....
Post Reply