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

Maximum recursion depth exceeded #32

Open
Shaunakde opened this issue Sep 12, 2017 · 7 comments
Open

Maximum recursion depth exceeded #32

Shaunakde opened this issue Sep 12, 2017 · 7 comments

Comments

@Shaunakde
Copy link

I am using flap to flatten a fairly standard journal file. When I run the command flap source.tex out.tex I get the following error:

 File "/home/shaunak/anaconda/envs/Python3x/lib/python3.6/site-packages/flap/latex/parser.py", line 153, in _evaluate_until
    tokens += self._evaluate_one()
  File "/home/shaunak/anaconda/envs/Python3x/lib/python3.6/site-packages/flap/latex/parser.py", line 138, in _evaluate_one
    return self.evaluate_command(str(self._next_token))
  File "/home/shaunak/anaconda/envs/Python3x/lib/python3.6/site-packages/flap/latex/parser.py", line 164, in evaluate_command
    return macro.invoke(self)
  File "/home/shaunak/anaconda/envs/Python3x/lib/python3.6/site-packages/flap/latex/macros.py", line 124, in invoke
    return self._execute(parser, invocation)
  File "/home/shaunak/anaconda/envs/Python3x/lib/python3.6/site-packages/flap/latex/macros.py", line 150, in _execute
    return parser._spawn(self._body, invocation.arguments)._evaluate_group()
  File "/home/shaunak/anaconda/envs/Python3x/lib/python3.6/site-packages/flap/latex/parser.py", line 146, in _evaluate_group
    tokens = self._evaluate_until(lambda token: token.ends_a_group)
  File "/home/shaunak/anaconda/envs/Python3x/lib/python3.6/site-packages/flap/latex/parser.py", line 153, in _evaluate_until
    tokens += self._evaluate_one()
  File "/home/shaunak/anaconda/envs/Python3x/lib/python3.6/site-packages/flap/latex/parser.py", line 138, in _evaluate_one
    return self.evaluate_command(str(self._next_token))
  File "/home/shaunak/anaconda/envs/Python3x/lib/python3.6/site-packages/flap/latex/parser.py", line 161, in evaluate_command
    if command not in self._definitions:
  File "/home/shaunak/anaconda/envs/Python3x/lib/python3.6/site-packages/flap/latex/parser.py", line 43, in __contains__
    return key in self._definitions or (self._parent and key in self._parent)
  File "/home/shaunak/anaconda/envs/Python3x/lib/python3.6/site-packages/flap/latex/parser.py", line 43, in __contains__
    return key in self._definitions or (self._parent and key in self._parent)
  File "/home/shaunak/anaconda/envs/Python3x/lib/python3.6/site-packages/flap/latex/parser.py", line 43, in __contains__
    return key in self._definitions or (self._parent and key in self._parent)
  [Previous line repeated 77 more times]
RecursionError: maximum recursion depth exceeded

My python version is:

Python 3.6.2 |Continuum Analytics, Inc.| (default, Jul 20 2017, 13:51:32) 
[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] on linux

I have attached the directory structure of the project to this issue. The main file is called 0_Trento_2016.tex. There are image files in the Figures folder.

TREE.txt

@Shaunakde
Copy link
Author

Shaunakde commented Sep 12, 2017

I ran the PERL script mkjobtexmf --jobname 0_Trento_2016 --cmd-tex pdflatex to make a list of dependent files. The output log file is attached. Hopefully, that will help investigate the issue.

SD_2017.txt

@fchauvel
Copy link
Owner

fchauvel commented Sep 12, 2017 via email

@Shaunakde
Copy link
Author

Shaunakde commented Sep 12, 2017 via email

@fchauvel
Copy link
Owner

fchauvel commented Sep 12, 2017 via email

@Shaunakde
Copy link
Author

Shaunakde commented Sep 12, 2017 via email

@fchauvel
Copy link
Owner

I am able to reproduce the error you get: FLaP fails because it tries to parse the IEEETrans.cls. There are probably bugs in the way FLaP handles commands/macros that themselves contain \input and other inclusions directives. Class definitions contain many ;-).

I suggest to add a flag on the command line to deactivate such the rewriting of macros. Let see if solve your issue.

I will keep you updated of any progress.

@MartinHjelm
Copy link

I circumvented this by switching to another cls and then switching back once the merge was done.

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

No branches or pull requests

3 participants