[IPython-dev] Using \( \), \[ \] instead of $...$, $$...$$ fox LaTeX math

Brian Granger ellisonbg at gmail.com
Sun Jan 15 15:16:07 EST 2012


Joon,

On Sat, Jan 14, 2012 at 10:35 AM, Joon Ro <joonpyro at gmail.com> wrote:
> You are right. Actually, if I change \(  \) to \\(  \\) in a markdown cell,
> it works.


OK, this is good to know.

> It seems this is caused by markdown parses those things, and regards them as
> its formatting syntax.
>
> It is affecting not only \[  \] stuff but also some other math expressions.
> For example, the following does not work:
>
> $$ \underline{x}_{1} x_{2} $$
>
> It works after escaping the first _ with \_:
>
> $$ \underline{x}\_{1} x_{2} $$

Ahh, that is a bummer and we should fix that.

> I wonder if there is a way to parse math stuff independently from the
> markdown texts.
> I found a discussion about this:
> http://doswa.com/2011/07/20/mathjax-in-markdown.html

Can you open github issue for this and put in this link?

Cheers,

Brian

> Thank you,
> Joon
>
>
>
>
> On Sat, 14 Jan 2012 11:22:39 -0600, Brian Granger <ellisonbg at gmail.com>
> wrote:
>
>> Hmm, the MathJax config looks to already have this configured:
>>
>>
>> https://github.com/ipython/ipython/blob/master/IPython/frontend/html/notebook/static/js/notebookmain.js#L18
>>
>> Can you test if it is working?
>>
>> Cheers,
>>
>> Brian
>>
>> On Fri, Jan 13, 2012 at 6:52 PM, Joon Ro <joonpyro at gmail.com> wrote:
>>>
>>> I'm sorry, but could you please tell me where I should look for this?
>>> I tried to find out but it was not apparent to me where those are defined
>>> in
>>> the source.
>>>
>>> Thank you,
>>> Joon
>>>
>>>
>>> On Wed, 11 Jan 2012 11:22:00 -0600, Brian Granger <ellisonbg at gmail.com>
>>> wrote:
>>>
>>>> On Tue, Jan 10, 2012 at 7:51 PM, Joon Ro <joonpyro at gmail.com> wrote:
>>>>>
>>>>>
>>>>> Thank you for the reply.
>>>>>
>>>>> Actually I was not talking about making it configurable, just
>>>>> additionally
>>>>> supporting \(  \) and \[  \] besides $ and $$. As far as I know \(  \)
>>>>> and
>>>>> \[  \] are as widely used as $ and $$ for latex math. I'm sorry I said
>>>>> "instead of" in the title. Should have used "in addition to." :)
>>>>>
>>>>> When I first started using latex in several years ago, I saw an
>>>>> documentation which recommended using \(  \) and \[  \] instead of
>>>>> $...$
>>>>> and $$...$$ somewhere (I don't remember where :)), so I have preferred
>>>>> them.
>>>>>
>>>>> In fact, in the Mathjax documentation
>>>>> (http://www.mathjax.org/docs/1.1/start.html), actually it says that
>>>>> "Note
>>>>> in particular that the $...$ in-line delimiters are not used by
>>>>> default,"
>>>>> because $ sign comes up too frequently in non-mathematical settings.
>>>>> Mathjax supports both \[...\] and \(...\) by default. I just tried
>>>>> matplotlib and I could use \(  \) there too. (It seems matplotlib does
>>>>> not
>>>>> support neither $$ nor \[  \].)
>>>>
>>>>
>>>>
>>>> If MathJax can support both styles simultaneously let's do that.  Can
>>>> you look into if that is possible and submit a pull request to
>>>> implement it?
>>>>
>>>> Cheers,
>>>>
>>>> Brian
>>>>
>>>>> -Joon
>>>>>
>>>>>
>>>>>
>>>>> On Tue, 10 Jan 2012 14:17:51 -0600, Brian Granger <ellisonbg at gmail.com>
>>>>> wrote:
>>>>>
>>>>>> There are a number of levels that this choice enters in:
>>>>>>
>>>>>> * Our display system enforces that latex means $ and $$.  This is
>>>>>> important as it provides a uniform interface for all people who want
>>>>>> to develop custom latex representations of their objects for display
>>>>>> in the notebook.  As time goes on, many third parties will rely on
>>>>>> this convention.
>>>>>> * The configuration of MathJax and matplotlib in the notebook and
>>>>>> qtconsole.  This has to line up with the conventions in the display
>>>>>> system, otherwise things won't work properly.
>>>>>>
>>>>>> I think this is one case where it doesn't make sense for this to be
>>>>>> configurable.  Otherwise we can't promise that everyones code will
>>>>>> "just work" in IPython.  Is there a reason you can't use $ and $$?
>>>>>>
>>>>>> Cheers,
>>>>>>
>>>>>> Brian
>>>>>>
>>>>>> On Tue, Jan 10, 2012 at 10:21 AM, Joon Ro <joonpyro at gmail.com> wrote:
>>>>>>>
>>>>>>>
>>>>>>> Hi,
>>>>>>>
>>>>>>> I just started using notebook, and it looks awesome. Thank you so
>>>>>>> much
>>>>>>> for
>>>>>>> your dedicated work. I cannot wait to try using it through a remote
>>>>>>> connection!
>>>>>>>
>>>>>>> Anyway, I was thinking it would be great if it is possible to use \(
>>>>>>> \),
>>>>>>> \[  \] instead of $...$, $$...$$ in the notebook for the math. Would
>>>>>>> this
>>>>>>> be easily implementable?
>>>>>>>
>>>>>>> Thank you,
>>>>>>> Joon
>>>>>>> _______________________________________________
>>>>>>> IPython-dev mailing list
>>>>>>> IPython-dev at scipy.org
>>>>>>> http://mail.scipy.org/mailman/listinfo/ipython-dev
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Using Opera's revolutionary email client: http://www.opera.com/mail/
>>>>> _______________________________________________
>>>>> IPython-dev mailing list
>>>>> IPython-dev at scipy.org
>>>>> http://mail.scipy.org/mailman/listinfo/ipython-dev
>>>>
>>>>
>>>>
>>>>
>>>>
>>>
>>>
>>> --
>>> Using Opera's revolutionary email client: http://www.opera.com/mail/
>>
>>
>>
>>
>
>
> --
> Using Opera's revolutionary email client: http://www.opera.com/mail/



-- 
Brian E. Granger
Cal Poly State University, San Luis Obispo
bgranger at calpoly.edu and ellisonbg at gmail.com



More information about the IPython-dev mailing list