I really like the
pxfont package for displaying code in listings. I would usually just do this to load
pxfont for the entire document;
However, this time I am required to use a template with mandatory fonts for the text. I would still like to use pxfonts for the code listings, but can not set it globally, as it would overwrite the mandatory non-listings font settings.
Is there any way to isolate the usage of pxfonts to listings only? I have tried various combinations of
\renewcommand to 'capture' the font settings, reset them to default, and use the captured version to set the listings' basicstyle. Sadly, I lack the experience and I didn't get anything working.