{"action":"created","issue":{"url":"https://api.github.com/repos/jupyter/nbconvert/issues/480","repository_url":"https://api.github.com/repos/jupyter/nbconvert","labels_url":"https://api.github.com/repos/jupyter/nbconvert/issues/480/labels{/name}","comments_url":"https://api.github.com/repos/jupyter/nbconvert/issues/480/comments","events_url":"https://api.github.com/repos/jupyter/nbconvert/issues/480/events","html_url":"https://github.com/jupyter/nbconvert/issues/480","id":193171051,"number":480,"title":"Error while exporting notebook with links","user":{"login":"pprzetacznik","id":2965785,"avatar_url":"https://avatars.githubusercontent.com/u/2965785?v=3","gravatar_id":"","url":"https://api.github.com/users/pprzetacznik","html_url":"https://github.com/pprzetacznik","followers_url":"https://api.github.com/users/pprzetacznik/followers","following_url":"https://api.github.com/users/pprzetacznik/following{/other_user}","gists_url":"https://api.github.com/users/pprzetacznik/gists{/gist_id}","starred_url":"https://api.github.com/users/pprzetacznik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pprzetacznik/subscriptions","organizations_url":"https://api.github.com/users/pprzetacznik/orgs","repos_url":"https://api.github.com/users/pprzetacznik/repos","events_url":"https://api.github.com/users/pprzetacznik/events{/privacy}","received_events_url":"https://api.github.com/users/pprzetacznik/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-12-02T17:20:37Z","updated_at":"2016-12-02T17:32:30Z","closed_at":null,"body":"Hi,\r\n\r\nwhile using version 4.2 I've noticed such problem. I've got `(abcd)[http://link.to.some.page.com]` markdown which causes such error after using nbconvert to convert my notebook to pdf:\r\n```\r\n(jupyter)[pankracy@piotrek-fedora rbm]$ jupyter nbconvert --to latex Untitled1.ipynb \r\n[NbConvertApp] Converting notebook Untitled1.ipynb to latex\r\nTraceback (most recent call last):\r\n  File \"/home/Pankracy/Envs/jupyter/bin/jupyter-nbconvert\", line 11, in <module>\r\n    load_entry_point('nbconvert', 'console_scripts', 'jupyter-nbconvert')()\r\n  File \"/home/Pankracy/Envs/jupyter/lib/python2.7/site-packages/jupyter_core/application.py\", line 267, in launch_instance\r\n    return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)\r\n  File \"/home/Pankracy/Envs/jupyter/lib/python2.7/site-packages/traitlets/config/application.py\", line 658, in launch_instance\r\n    app.start()\r\n  File \"/home/Pankracy/Envs/jupyter/src/nbconvert/nbconvert/nbconvertapp.py\", line 305, in start\r\n    self.convert_notebooks()\r\n  File \"/home/Pankracy/Envs/jupyter/src/nbconvert/nbconvert/nbconvertapp.py\", line 473, in convert_notebooks\r\n    self.convert_single_notebook(notebook_filename)\r\n  File \"/home/Pankracy/Envs/jupyter/src/nbconvert/nbconvert/nbconvertapp.py\", line 444, in convert_single_notebook\r\n    output, resources = self.export_single_notebook(notebook_filename, resources, input_buffer=input_buffer)\r\n  File \"/home/Pankracy/Envs/jupyter/src/nbconvert/nbconvert/nbconvertapp.py\", line 373, in export_single_notebook\r\n    output, resources = self.exporter.from_filename(notebook_filename, resources=resources)\r\n  File \"/home/Pankracy/Envs/jupyter/src/nbconvert/nbconvert/exporters/exporter.py\", line 166, in from_filename\r\n    return self.from_file(f, resources=resources, **kw)\r\n  File \"/home/Pankracy/Envs/jupyter/src/nbconvert/nbconvert/exporters/exporter.py\", line 184, in from_file\r\n    return self.from_notebook_node(nbformat.read(file_stream, as_version=4), resources=resources, **kw)\r\n  File \"/home/Pankracy/Envs/jupyter/src/nbconvert/nbconvert/exporters/latex.py\", line 82, in from_notebook_node\r\n    return super(LatexExporter, self).from_notebook_node(nb, resources, **kw)\r\n  File \"/home/Pankracy/Envs/jupyter/src/nbconvert/nbconvert/exporters/templateexporter.py\", line 220, in from_notebook_node\r\n    output = self.template.render(nb=nb_copy, resources=resources)\r\n  File \"/home/Pankracy/Envs/jupyter/lib/python2.7/site-packages/jinja2/environment.py\", line 989, in render\r\n    return self.environment.handle_exception(exc_info, True)\r\n  File \"/home/Pankracy/Envs/jupyter/lib/python2.7/site-packages/jinja2/environment.py\", line 754, in handle_exception\r\n    reraise(exc_type, exc_value, tb)\r\n  File \"/home/Pankracy/Envs/jupyter/src/nbconvert/nbconvert/exporters/../templates/latex/article.tplx\", line 8, in top-level template code\r\n    ((* extends cell_style *))\r\n  File \"/home/Pankracy/Envs/jupyter/src/nbconvert/nbconvert/exporters/../templates/latex/style_ipython.tplx\", line 56, in top-level template code\r\n    ((( text | add_prompts(first='{\\color{' ~ prompt_color ~ '}' ~ prompt ~ '[{\\\\color{' ~ prompt_color ~ '}' ~ execution_count ~ '}]:} ', cont=indention) )))\r\n  File \"/home/Pankracy/Envs/jupyter/src/nbconvert/nbconvert/exporters/../templates/latex/base.tplx\", line 6, in top-level template code\r\n    ((*- extends 'document_contents.tplx' -*))\r\n  File \"/home/Pankracy/Envs/jupyter/src/nbconvert/nbconvert/exporters/../templates/latex/document_contents.tplx\", line 50, in top-level template code\r\n    ((*- block figure scoped -*))\r\n  File \"/home/Pankracy/Envs/jupyter/src/nbconvert/nbconvert/exporters/../templates/latex/skeleton/display_priority.tplx\", line 5, in top-level template code\r\n    ((*- extends 'null.tplx' -*))\r\n  File \"/home/Pankracy/Envs/jupyter/src/nbconvert/nbconvert/exporters/../templates/latex/skeleton/null.tplx\", line 30, in top-level template code\r\n    ((*- block body -*))\r\n  File \"/home/Pankracy/Envs/jupyter/src/nbconvert/nbconvert/exporters/../templates/latex/base.tplx\", line 173, in block \"body\"\r\n    ((( super() )))\r\n  File \"/home/Pankracy/Envs/jupyter/src/nbconvert/nbconvert/exporters/../templates/latex/skeleton/null.tplx\", line 32, in block \"body\"\r\n    ((*- block any_cell scoped -*))\r\n  File \"/home/Pankracy/Envs/jupyter/src/nbconvert/nbconvert/exporters/../templates/latex/skeleton/null.tplx\", line 76, in block \"any_cell\"\r\n    ((*- block markdowncell scoped-*))\r\n  File \"/home/Pankracy/Envs/jupyter/src/nbconvert/nbconvert/exporters/../templates/latex/document_contents.tplx\", line 67, in block \"markdowncell\"\r\n    ((( cell.source | citation2latex | strip_files_prefix | convert_pandoc('markdown', 'json',extra_args=[]) | resolve_references | convert_pandoc('json','latex'))))\r\n  File \"/home/Pankracy/Envs/jupyter/src/nbconvert/nbconvert/filters/filter_links.py\", line 16, in resolve_references\r\n    return applyJSONFilters([resolve_one_reference], source)\r\n  File \"/home/Pankracy/Envs/jupyter/lib/python2.7/site-packages/pandocfilters.py\", line 197, in applyJSONFilters\r\n    altered = walk(altered, action, format, meta)\r\n  File \"/home/Pankracy/Envs/jupyter/lib/python2.7/site-packages/pandocfilters.py\", line 120, in walk\r\n    array.append(walk(item, action, format, meta))\r\n  File \"/home/Pankracy/Envs/jupyter/lib/python2.7/site-packages/pandocfilters.py\", line 113, in walk\r\n    array.append(walk(item, action, format, meta))\r\n  File \"/home/Pankracy/Envs/jupyter/lib/python2.7/site-packages/pandocfilters.py\", line 124, in walk\r\n    x[k] = walk(x[k], action, format, meta)\r\n  File \"/home/Pankracy/Envs/jupyter/lib/python2.7/site-packages/pandocfilters.py\", line 111, in walk\r\n    item['c'] if 'c' in item else None, format, meta)\r\n  File \"/home/Pankracy/Envs/jupyter/src/nbconvert/nbconvert/filters/filter_links.py\", line 29, in resolve_one_reference\r\n    target = val[2][0]\r\nIndexError: list index out of range\r\n```\r\n\r\nI would be grateful for any help.\r\n\r\nCheers,\r\nPIotrek"},"comment":{"url":"https://api.github.com/repos/jupyter/nbconvert/issues/comments/264512406","html_url":"https://github.com/jupyter/nbconvert/issues/480#issuecomment-264512406","issue_url":"https://api.github.com/repos/jupyter/nbconvert/issues/480","id":264512406,"user":{"login":"takluyver","id":327925,"avatar_url":"https://avatars.githubusercontent.com/u/327925?v=3","gravatar_id":"","url":"https://api.github.com/users/takluyver","html_url":"https://github.com/takluyver","followers_url":"https://api.github.com/users/takluyver/followers","following_url":"https://api.github.com/users/takluyver/following{/other_user}","gists_url":"https://api.github.com/users/takluyver/gists{/gist_id}","starred_url":"https://api.github.com/users/takluyver/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/takluyver/subscriptions","organizations_url":"https://api.github.com/users/takluyver/orgs","repos_url":"https://api.github.com/users/takluyver/repos","events_url":"https://api.github.com/users/takluyver/events{/privacy}","received_events_url":"https://api.github.com/users/takluyver/received_events","type":"User","site_admin":false},"created_at":"2016-12-02T17:32:30Z","updated_at":"2016-12-02T17:32:30Z","body":"What version of pandoc do you have? Run `pandoc --version` at a command line to find out.\r\n\r\n@mdpacer I remember running into this with bookbook, but I'd forgotten about it when we put it into nbconvert. We probably need to make the code robust to older versions of pandoc."}}
{"actor":{"display_login":"takluyver"}}