Joël Bleuse on Mon, 11 Mar 2024 11:28:17 +0100


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

which LaTeX package for Pari/GP scripts ?


Hello,

I'm currently writing an article where most results were computed with a Pari/GP script. I would like to include it in the methods section, and tried the 'listings' package to do so. Unfortunately, this package does not properly handle Pari comments (\\ seems to be a nightmare for LaTeX).

I even tired to define Pari as a new language, with :

\lstdefinelanguage{parigp}
{    morekeywords={for,if,sum,binomial,my,eval,print,return,vector,write},%
    sensitive=true,%
    morecomment=[l]{//},%
    morecomment=[s]{/*}{*/},%
    literate={//}{\textbackslash\textbackslash}{2},
}

but to no avail...

Which package would you recommend for Pari scripts ? Would it need tweaks ?

Thanks,

    Joël