From 0ea80c0bc079ba6819665ee6cef496e11a5c6639 2014-02-04 20:20:40 From: jakobgager Date: 2014-02-04 20:20:40 Subject: [PATCH] Crop if no endtag is given --- diff --git a/IPython/nbconvert/filters/citation.py b/IPython/nbconvert/filters/citation.py index 2ee7e13..6874d42 100644 --- a/IPython/nbconvert/filters/citation.py +++ b/IPython/nbconvert/filters/citation.py @@ -44,8 +44,8 @@ def citation2latex(s): for citation in parser.citelist: outtext += s[startpos:citation[1]] outtext += '\\cite{%s}'%citation[0] - startpos = citation[2] - outtext += s[startpos:] + startpos = citation[2] if len(citation)==3 else -1 + outtext += s[startpos:] if startpos <> -1 else '' return outtext #-----------------------------------------------------------------------------