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

Comment #idx{with text here} before tex environment crashes when compiling to notebook #103

Open
simetenn opened this issue Feb 13, 2017 · 0 comments

Comments

@simetenn
Copy link
Contributor

Doconce does something unexpected with comments. In the following cases a commented idx command crashes Doconce when trying to
convert to a notebook.

# This example does not fail
!bt
tex here
!et

# idx{with text here this example fails}
!bt
tex here
!et

# idx{This works}

!bt
tex here
!et

idx{this works}
!bt
tex here
!et

This works
# idx{}
!bt
tex here
!et


# idx{with text here this example fails}
!bc
tex here
!ec

The error message is:

Traceback (most recent call last):
  File "/home/simen/src/anaconda3/envs/doconce/bin/doconce", line 6, in <module>
    exec(compile(open(__file__).read(), __file__, 'exec'))
  File "/home/simen/phd/projects/doconce/bin/doconce", line 1721, in <module>
    bg_session = main()
  File "/home/simen/phd/projects/doconce/bin/doconce", line 1710, in main
    retval = eval(command + '()')
  File "<string>", line 1, in <module>
  File "/home/simen/phd/projects/doconce/bin/doconce", line 103, in format
    bg_session = doconce.doconce.format_driver()
  File "/home/simen/phd/projects/doconce/lib/doconce/doconce.py", line 5326, in format_driver
    out_filename, bg_session = file2file(filename_preprocessed, format, basename)
  File "/home/simen/phd/projects/doconce/lib/doconce/doconce.py", line 4173, in file2file
    filestr, bg_session = doconce2format(filestr, format)
  File "/home/simen/phd/projects/doconce/lib/doconce/doconce.py", line 4665, in doconce2format
    tex_blocks, format)
  File "/home/simen/phd/projects/doconce/lib/doconce/ipynb.py", line 569, in ipynb_code
    n = int(words[0])
ValueError: invalid literal for int() with base 10: '<!--'
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

1 participant