diff --git a/nbconvert/filters/markdown.py b/nbconvert/filters/markdown.py index ebe49e5..7265d57 100755 --- a/nbconvert/filters/markdown.py +++ b/nbconvert/filters/markdown.py @@ -48,7 +48,7 @@ def markdown2latex(source): print(err, file=sys.stderr) #print('*'*20+'\n', out, '\n'+'*'*20) # dbg - return unicode(out, 'utf-8') + return unicode(out, 'utf-8')[:-1] def markdown2rst(source): diff --git a/nbconvert/templates/latex/base.tplx b/nbconvert/templates/latex/base.tplx index a97579f..1a1e3aa 100644 --- a/nbconvert/templates/latex/base.tplx +++ b/nbconvert/templates/latex/base.tplx @@ -86,7 +86,7 @@ it introduces a new line ((* endblock markdowncell *)) ((* block headingcell scoped *)) -\section{((( cell.source)))} +\section{((( cell.source | markdown2latex)))} ((* endblock headingcell *)) ((* block rawcell scoped *)) diff --git a/nbconvert/templates/latex/sphinx_base.tplx b/nbconvert/templates/latex/sphinx_base.tplx index 19feeea..f79a84a 100644 --- a/nbconvert/templates/latex/sphinx_base.tplx +++ b/nbconvert/templates/latex/sphinx_base.tplx @@ -209,7 +209,7 @@ Note: For best display, use latex syntax highlighting. =)) ((= It's important to make sure that underscores (which tend to be common in IPYNB file titles) do not make their way into latex. Sometimes this causes latex to barf. =)) - ((*- endif -*)){((( escape_underscores(cell.source | markdown2latex ) )))} + ((*- endif -*)){((( cell.source | markdown2latex )))} ((*- endblock headingcell *)) %============================================================================== @@ -429,11 +429,3 @@ Note: For best display, use latex syntax highlighting. =)) \par \end{center} ((*- endmacro *)) - -% Name: escape_underscores -% Purpose: Underscores cause a problem in latex. It's important that we -% escape any underscores that appear. -((* macro escape_underscores(text) -*)) - ((*- set text = text|replace("_","\\_") -*)) - ((( text ))) -((*- endmacro *)) \ No newline at end of file