Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to use pythontex with mwrep document class #101

Open
kopasiak opened this issue May 23, 2017 · 1 comment
Open

Unable to use pythontex with mwrep document class #101

kopasiak opened this issue May 23, 2017 · 1 comment

Comments

@kopasiak
Copy link

Hi,

I'm trying to use pythontex with mwrep document class but when I try to compile mwe like this one:

\documentclass{mwrep}
\usepackage{pythontex}

\begin{document}
test
\end{document}

I get error:
! Undefined control sequence.
\newfloat@setwithin ...apter}@chapterlistsgap@on
{#1}\newfloat@@setwithin {...

If I change document class to report or anything like this then it works fine. The same when I remove \usepackage{pythontex} but together they don't want to work.

Any ideas what can be wrong and how to fix this?

@gpoore
Copy link
Owner

gpoore commented May 23, 2017

pythontex creates a listing environment using the newfloat package, unless such an environment already exists. It looks like the newfloat package conflicts with mwrep. If you don't need the listing environment, you can work around the conflict by using

\newenvironment{listing}{}{}
\usepackage{pythontex}

This creates a (useless) listing environment before pythontex is loaded, so pythontex never creates one, and thus newfloat is never actually used.

If you do need to use newfloat, you might ask a question on https://tex.stackexchange.com/ about the conflict. I don't know enough about newfloat and mwrep to be able to make any quick progress in resolving a conflict.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants