Generalpst-infixplot conflicting with listings?

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
User avatar
Bozack
Posts: 117
Joined: Wed Feb 06, 2008 4:21 pm

pst-infixplot conflicting with listings?

Post by Bozack »

I was trying to insert some MATLAB code with the listings package, but couldn't get the syntax highlighting colors as I wanted them: The text was simply black.

So I started debugging by commenting out lines in my preamble, and found that the colors came back whenever I commented out my use of the pst-infixplot package.

Below is a MWE that gives me the error:

Code: Select all

\documentclass{article}
\usepackage[dvipsnames]{xcolor}
\usepackage{pstricks}
\usepackage{pst-infixplot}
\usepackage{listings}
 \lstloadlanguages{Matlab}
 \lstset{ commentstyle=\color{Periwinkle}, stringstyle=\color{PineGreen} }
 \lstdefinestyle{mystyle}{ language=Matlab, morekeywords={sin,plot,fprintf}, morecomment=[l][\color{Periwinkle}]{\%} }

\begin{document}

\begin{lstlisting}[style=mystyle]
% Dette er en test-m-fil til at se hvordan listings klarer sig
x = 1:10:10000;  y = sin(x);
plot(x,y,'.')
fprintf(['hej med dig - ',num2str(x(2)),' ja den var lidt kedelig'])
\end{lstlisting}

\end{document}
If I comment out the line with \usepackage{pst-infixplot}, the compiled file is just as I want it. It doesn't matter whether or not I load the PSTricks packages before or after the listings package.

My system is the newest version of MikTeX (2.9) and TeXnicCenter.

Does everyone else get the same error, or is there something wrong with my code? Can anyone figure out why this error is there? :(
Last edited by Bozack on Sat Apr 30, 2011 10:02 pm, edited 2 times in total.
OS, LaTeX-system, editor: Arch Linux 64bit, TeXlive, Kile | Windows 10 Professional 64bit, MikTeX 4.9, TeXnicCenter 2.02 64bit

Recommended reading 2024:

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

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

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

pst-infixplot conflicting with listings?

Post by localghost »

Bozack wrote:[…] My system is the newest version of MikTeX (2.9) and TeXnicCenter. […]
But probably you don't have the newest versions of the involved packages. Insert \listfiles as very first line to your example and compare.

Code: Select all

 *File List*
 article.cls    2007/10/19 v1.4h Standard LaTeX document class
  size10.clo    2007/10/19 v1.4h Standard LaTeX file (size option)
  xcolor.sty    2007/01/21 v2.11 LaTeX color extensions (UK)
   color.cfg    2007/01/18 v1.5 color configuration of teTeX/TeXLive
   dvips.def    1999/02/16 v3.0i Driver-dependant file (DPC,SPQR)
dvipsnam.def    1999/02/16 v3.0i Driver-dependant file (DPC,SPQR)
pstricks.sty    2011/03/27 v0.49 LaTeX wrapper for `PSTricks' (RN,HV)
   ifpdf.sty    2011/01/30 v2.3 Provides the ifpdf switch (HO)
ifluatex.sty    2010/03/01 v1.3 Provides the ifluatex switch (HO)
pstricks.tex    2011/03/25 v2.19 `PSTricks' (tvz,hv)
pst-xkey.tex    2005/11/25 v1.6 PSTricks specialization of xkeyval (HA)
 xkeyval.sty    2008/08/13 v2.6a package option processing (HA)
 xkeyval.tex    2008/08/13 v2.6a key=value parser (HA)
  pst-fp.tex    2011/03/25 v2.19 `PST-fp' (hv)
pst-infixplot.sty    2004/07/14 package wrapper for pst-infixplot.tex
listings.sty    2007/02/22 1.4 (Carsten Heinz)
 lstmisc.sty    2007/02/22 1.4 (Carsten Heinz)
listings.cfg    2007/02/22 1.4 listings configuration
lstlang1.sty    2004/09/05 1.3 listings language file
 ***********
Bozack wrote:[…] Does everyone else get the same error, or is there something wrong with my code? Can anyone figure out why this error is there? […]
No problem here with an up-to-date MiKTeX 2.9 system except two warnings concerning overfull boxes (see above).


Thorsten
User avatar
Bozack
Posts: 117
Joined: Wed Feb 06, 2008 4:21 pm

pst-infixplot conflicting with listings?

Post by Bozack »

Putting in the \listfiles command, I got the following:

Code: Select all

*File List*
 article.cls    2007/10/19 v1.4h Standard LaTeX document class
  size10.clo    2007/10/19 v1.4h Standard LaTeX file (size option)
  xcolor.sty    2007/01/21 v2.11 LaTeX color extensions (UK)
   color.cfg    2007/01/18 v1.5 color configuration of teTeX/TeXLive
   dvips.def    1999/02/16 v3.0i Driver-dependant file (DPC,SPQR)
dvipsnam.def    1999/02/16 v3.0i Driver-dependant file (DPC,SPQR)
pstricks.sty    2011/03/27 v0.49 LaTeX wrapper for `PSTricks' (RN,HV)
   ifpdf.sty    2010/01/28 v2.1 Provides the ifpdf switch (HO)
ifluatex.sty    2010/03/01 v1.3 Provides the ifluatex switch (HO)
pstricks.tex    2011/03/25 v2.19 `PSTricks' (tvz,hv)
pst-xkey.tex    2005/11/25 v1.6 PSTricks specialization of xkeyval (HA)
 xkeyval.sty    2008/08/13 v2.6a package option processing (HA)
 xkeyval.tex    2008/08/13 v2.6a key=value parser (HA)
  pst-fp.tex    2011/03/25 v2.19 `PST-fp' (hv)
pst-infixplot.sty    2004/07/14 package wrapper for pst-infixplot.tex
listings.sty    2007/02/22 1.4 (Carsten Heinz)
 lstmisc.sty    2007/02/22 1.4 (Carsten Heinz)
listings.cfg    2007/02/22 1.4 listings configuration
lstlang1.sty    2004/09/05 1.3 listings language file
I then made a full update with the MikTeX updater: There were only a little more than a single page, so my system was ALMOST up to date :P. The \listfiles command now gives me:

Code: Select all

*File List*
 article.cls    2007/10/19 v1.4h Standard LaTeX document class
  size10.clo    2007/10/19 v1.4h Standard LaTeX file (size option)
  xcolor.sty    2007/01/21 v2.11 LaTeX color extensions (UK)
   color.cfg    2007/01/18 v1.5 color configuration of teTeX/TeXLive
   dvips.def    1999/02/16 v3.0i Driver-dependant file (DPC,SPQR)
dvipsnam.def    1999/02/16 v3.0i Driver-dependant file (DPC,SPQR)
pstricks.sty    2011/03/27 v0.49 LaTeX wrapper for `PSTricks' (RN,HV)
   ifpdf.sty    2011/01/30 v2.3 Provides the ifpdf switch (HO)
ifluatex.sty    2010/03/01 v1.3 Provides the ifluatex switch (HO)
pstricks.tex    2011/03/25 v2.19 `PSTricks' (tvz,hv)
pst-xkey.tex    2005/11/25 v1.6 PSTricks specialization of xkeyval (HA)
 xkeyval.sty    2008/08/13 v2.6a package option processing (HA)
 xkeyval.tex    2008/08/13 v2.6a key=value parser (HA)
  pst-fp.tex    2011/03/25 v2.19 `PST-fp' (hv)
pst-infixplot.sty    2004/07/14 package wrapper for pst-infixplot.tex
listings.sty    2007/02/22 1.4 (Carsten Heinz)
 lstmisc.sty    2007/02/22 1.4 (Carsten Heinz)
listings.cfg    2007/02/22 1.4 listings configuration
lstlang1.sty    2004/09/05 1.3 listings language file
However, this didn't fix the problem. There are still only black colors when pst-infixplot is loaded :(

Any other ideas?
OS, LaTeX-system, editor: Arch Linux 64bit, TeXlive, Kile | Windows 10 Professional 64bit, MikTeX 4.9, TeXnicCenter 2.02 64bit
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

pst-infixplot conflicting with listings?

Post by localghost »

You should not talk about errors if there is none. That's misleading. Here you face a misbehaviour. I have no idea how to fix this. The culprit is definitely the pst-infixplot package. As you already said, the code works at least with an included pstricks(-add) package. I suggest to submit a bug report to the maintainers. By the way, there is no conflict with minted. But this needs Python installed with »pygments«.

Addendum:
Looking at the »algebraic« option for plot commands in pst-plot, I see no sense in using this package any more.
User avatar
Bozack
Posts: 117
Joined: Wed Feb 06, 2008 4:21 pm

pst-infixplot conflicting with listings?

Post by Bozack »

localghost wrote:[...] Here you face a misbehaviour. I have no idea how to fix this. The culprit is definitely the pst-infixplot package. As you already said, the code works at least with an included pstricks(-add) package. I suggest to submit a bug report to the maintainers. [...]
I might just go do that :)
localghost wrote:[...] Looking at the »algebraic« option for plot commands in pst-plot, I see no sense in using this package any more. [...]
I will take a look at that - if pst-infixplot is deprecated because of a better solution, I might as well just use that one :) Thank you for your help!
OS, LaTeX-system, editor: Arch Linux 64bit, TeXlive, Kile | Windows 10 Professional 64bit, MikTeX 4.9, TeXnicCenter 2.02 64bit
Post Reply