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

Incorrect conversion of inline math in markdown cell #50

Closed
matthew-brett opened this issue Jun 24, 2015 · 1 comment
Closed

Incorrect conversion of inline math in markdown cell #50

matthew-brett opened this issue Jun 24, 2015 · 1 comment
Milestone

Comments

@matthew-brett
Copy link
Contributor

I have the following notebook:

{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "$s_i = s_{i}\n",
    "$"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 2",
   "language": "python",
   "name": "python2"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.9"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}

The math $s_i = s_{i}$ renders correctly in the notebook interface, but ipython nbconvert --to html bad_mathjax.ipynb gives the following HTML for the math:

<p>$s<em>i = s</em>{i}
$</p>

So - the underscores in the math have been interpreted as markdown emphasis. This does not occur when the closing dollar is on the same line as the rest of the inline math, and does not occur when using pandoc to convert the equivalent pure markdown file.

takluyver added a commit to takluyver/nbconvert that referenced this issue Jun 24, 2015
@takluyver
Copy link
Member

I had assumed that you couldn't put a newline inside inline math, but it sounds like you can. #51 should fix it.

@minrk minrk closed this as completed in #51 Jul 5, 2015
@takluyver takluyver modified the milestone: 4.0 Jul 30, 2015
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

2 participants