##// END OF EJS Templates
fix overescaped underscores
Bussonnier Matthias -
Show More
@@ -48,7 +48,7 b' def markdown2latex(source):'
48 print(err, file=sys.stderr)
48 print(err, file=sys.stderr)
49 #print('*'*20+'\n', out, '\n'+'*'*20) # dbg
49 #print('*'*20+'\n', out, '\n'+'*'*20) # dbg
50
50
51 return unicode(out, 'utf-8')
51 return unicode(out, 'utf-8')[:-1]
52
52
53
53
54 def markdown2rst(source):
54 def markdown2rst(source):
@@ -86,7 +86,7 b' it introduces a new line'
86 ((* endblock markdowncell *))
86 ((* endblock markdowncell *))
87
87
88 ((* block headingcell scoped *))
88 ((* block headingcell scoped *))
89 \section{((( cell.source)))}
89 \section{((( cell.source | markdown2latex)))}
90 ((* endblock headingcell *))
90 ((* endblock headingcell *))
91
91
92 ((* block rawcell scoped *))
92 ((* block rawcell scoped *))
@@ -209,7 +209,7 b' Note: For best display, use latex syntax highlighting. =))'
209 ((= It's important to make sure that underscores (which tend to be common
209 ((= It's important to make sure that underscores (which tend to be common
210 in IPYNB file titles) do not make their way into latex. Sometimes this
210 in IPYNB file titles) do not make their way into latex. Sometimes this
211 causes latex to barf. =))
211 causes latex to barf. =))
212 ((*- endif -*)){((( escape_underscores(cell.source | markdown2latex ) )))}
212 ((*- endif -*)){((( cell.source | markdown2latex )))}
213 ((*- endblock headingcell *))
213 ((*- endblock headingcell *))
214
214
215 %==============================================================================
215 %==============================================================================
@@ -429,11 +429,3 b' Note: For best display, use latex syntax highlighting. =))'
429 \par
429 \par
430 \end{center}
430 \end{center}
431 ((*- endmacro *))
431 ((*- endmacro *))
432
433 % Name: escape_underscores
434 % Purpose: Underscores cause a problem in latex. It's important that we
435 % escape any underscores that appear.
436 ((* macro escape_underscores(text) -*))
437 ((*- set text = text|replace("_","\\_") -*))
438 ((( text )))
439 ((*- endmacro *)) No newline at end of file
General Comments 0
You need to be logged in to leave comments. Login now