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

Traceback on import #5

Open
langston-barrett opened this issue Sep 8, 2017 · 3 comments
Open

Traceback on import #5

langston-barrett opened this issue Sep 8, 2017 · 3 comments

Comments

@langston-barrett
Copy link

Hi, I'm getting the following traceback:


Import failed. Debugging info:
Traceback (most recent call last):
  File "/nix/store/j2lcps7zkkm558r1v27mj3xx27wclijx-anki-2.0.36/lib/python2.7/site-packages/aqt/importing.py", line 294, in importFile
    importer.open()
  File "/home/siddharthist/Documents/Anki/addons/latexbiport/lateximport.py", line 56, in open
    self.cacheFile()
  File "/home/siddharthist/Documents/Anki/addons/latexbiport/lateximport.py", line 62, in cacheFile
    self.openFile()
  File "/home/siddharthist/Documents/Anki/addons/latexbiport/lateximport.py", line 68, in openFile
    self.processFile(unicode(self.fileobj.read(), "utf-8"))
  File "/home/siddharthist/Documents/Anki/addons/latexbiport/lateximport.py", line 207, in processFile
    self.preamble, document, ci = pieces[0]
IndexError: list index out of range

on the following .tex file: https://pastebin.com/raw/E27DJAmv

Any ideas why?

@langston-barrett
Copy link
Author

Ah, it's because I didn't have a

\documentclass{article}
\begin{document}

at the beginning nor a

\end{document}

at the end. Perhaps there's a better way to notify the user of their silly mistake?

@TentativeConvert
Copy link
Owner

Yes, there probably are better ways of notifying the user. On the other hand, there's probably more than one possible cause for this error. For example, what happens if you only have

\documentclass{article}
\begin{document}
\end{document

in your document with nothing in between? Plan:

(1) Find out all possible causes of this error.
(2) Catch the bug.
(3) Write up a helpful error message.

Unfortunately, I don't have any time to put this plan into action right now …

@TentativeConvert
Copy link
Owner

Should be fixed in the 2.1-version by 05584da. Waiting for user feedback before deploying this via Ankis website. See #8 (comment).

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