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

wrong \input resolution order #33

Open
Ohjeah opened this issue Feb 16, 2018 · 3 comments
Open

wrong \input resolution order #33

Ohjeah opened this issue Feb 16, 2018 · 3 comments

Comments

@Ohjeah
Copy link
Contributor

Ohjeah commented Feb 16, 2018

15:12 $ flap tex/main.tex compressed -v
FLaP 0.5.0
File                            Line Column LaTeX Command                      
-------------------------------------------------------------------------------
main.tex                           6      1 \input{misc/header.tex}            
main.tex                          13      1 \input{content/abstract.tex}       
main.tex                          14      1 \input{misc/frontmatter.tex}       
main.tex                          15      1 \input{content/introduction.tex}   
main.tex                          16      1 \input{content/sota.tex}           
main.tex                          17      1 \input{content/methods.tex}        
content/methods.tex               17      5 \includegraphics[width=\columnwi...
content/methods.tex               73      5 \includegraphics[width=\columnwi...
main.tex                          18      1 \input{content/results.tex}        
content/results.tex               12      1 \input{"../tables/grid.tex"}       
Traceback (most recent call last):
  File "/home/mq/.miniconda/bin/flap", line 11, in <module>
    sys.exit(main())
  File "/home/mq/.miniconda/lib/python3.6/site-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/home/mq/.miniconda/lib/python3.6/site-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/home/mq/.miniconda/lib/python3.6/site-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/mq/.miniconda/lib/python3.6/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/home/mq/.miniconda/lib/python3.6/site-packages/flap/ui.py", line 102, in main
    Controller(OSFileSystem(), Display(sys.stdout, verbose)).run(tex_file, output)
  File "/home/mq/.miniconda/lib/python3.6/site-packages/flap/ui.py", line 43, in run
    request.execute()
  File "/home/mq/.miniconda/lib/python3.6/site-packages/flap/engine.py", line 79, in execute
    flattened = self._rewrite(self.read_root_tex, str(self.root_tex_file.resource()))
  File "/home/mq/.miniconda/lib/python3.6/site-packages/flap/engine.py", line 88, in _rewrite
    return parser.rewrite()
  File "/home/mq/.miniconda/lib/python3.6/site-packages/flap/latex/parser.py", line 78, in rewrite
    result += self._rewrite_one()
  File "/home/mq/.miniconda/lib/python3.6/site-packages/flap/latex/parser.py", line 86, in _rewrite_one
    return self._evaluate_one()
  File "/home/mq/.miniconda/lib/python3.6/site-packages/flap/latex/parser.py", line 138, in _evaluate_one
    return self.evaluate_command(str(self._next_token))
  File "/home/mq/.miniconda/lib/python3.6/site-packages/flap/latex/parser.py", line 164, in evaluate_command
    return macro.invoke(self)
  File "/home/mq/.miniconda/lib/python3.6/site-packages/flap/latex/macros.py", line 124, in invoke
    return self._execute(parser, invocation)
  File "/home/mq/.miniconda/lib/python3.6/site-packages/flap/latex/macros.py", line 317, in _execute
    return parser._spawn(parser._create.as_tokens(content, link), dict()).rewrite()
  File "/home/mq/.miniconda/lib/python3.6/site-packages/flap/latex/parser.py", line 78, in rewrite
    result += self._rewrite_one()
  File "/home/mq/.miniconda/lib/python3.6/site-packages/flap/latex/parser.py", line 86, in _rewrite_one
    return self._evaluate_one()
  File "/home/mq/.miniconda/lib/python3.6/site-packages/flap/latex/parser.py", line 138, in _evaluate_one
    return self.evaluate_command(str(self._next_token))
  File "/home/mq/.miniconda/lib/python3.6/site-packages/flap/latex/parser.py", line 164, in evaluate_command
    return macro.invoke(self)
  File "/home/mq/.miniconda/lib/python3.6/site-packages/flap/latex/macros.py", line 124, in invoke
    return self._execute(parser, invocation)
  File "/home/mq/.miniconda/lib/python3.6/site-packages/flap/latex/macros.py", line 314, in _execute
    content = self._flap.content_of(link, invocation)
  File "/home/mq/.miniconda/lib/python3.6/site-packages/flap/engine.py", line 118, in content_of
    file = self._find(location, [self.root_directory], ["tex"], TexFileNotFound(None))
  File "/home/mq/.miniconda/lib/python3.6/site-packages/flap/engine.py", line 175, in _find
    raise error
flap.engine.TexFileNotFound: None

The file structure is:

tables
figures
tex
|___main.tex
|___content
    |___results.tex

results.tex has the \input{../tables/grid.tex} command.

It compiles just fine, but I think flap resolves the inner most input first, hence the file cannot be found.

@Ohjeah
Copy link
Contributor Author

Ohjeah commented Feb 20, 2018

Found the error, I actually wrote \input{"../tables/grid.tex"} which apparently causes an error.

@fchauvel
Copy link
Owner

fchauvel commented Feb 21, 2018 via email

@Ohjeah
Copy link
Contributor Author

Ohjeah commented Feb 21, 2018

Yes, that file contains a complex, auto-generated table. It works just fine if I don't use quotes or place it so that I don't have to use the "..".

Btw, I get a similar issue with figures.

\includegraphics{"../figures/figure1.pdf"}

is translated to ".._figures_figure1.pdf". The file get's copied but pdflatex cannot handle such a filename.

@fchauvel fchauvel pinned this issue Mar 8, 2021
fchauvel pushed a commit that referenced this issue Mar 9, 2021
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

2 participants