[IPython-dev] Latex highlighting for markdown cells?

Doug Blank doug.blank at gmail.com
Sun Aug 31 14:37:49 EDT 2014


Here is an example of the codemirror overlay with IPython's mode:

https://bitbucket.org/ipre/calico/src/master/notebooks/nbextensions/calico-spell-check.js

That code is a little bit complicated as it has a function, makeOverlay,
that makes a function overlay. That is so you can make spell-check overlays
for as many modes as you want.

BTW, this appears that it will need some changes to work with
IPython3/Jupyter.

Hope that helps,

-Doug


On Sun, Aug 31, 2014 at 2:14 PM, Matthias Bussonnier <
bussonniermatthias at gmail.com> wrote:

>
> Le 29 août 2014 à 18:38, Zoltán Vörös <zvoros at gmail.com> a écrit :
>
> Hi Matthias,
>
> I have recently been wondering myself about this. What I wanted to do is
> insert the closing \end{environment} tags in the markdown cell, and
> insert e.g., \frac{}{} and move the cursor back to the first curly
> bracket, if the user types \fra, but syntax highlighting would also be
> useful. Could you point me to some sort of documentation as to how one
> starts out writing a plugin for this? I would be willing to work on this.
>
>
> Sorry for the short mail :
>
> http://codemirror.net/doc/manual.html#modeapi
>
> Have also a look at this part of code mirror doc :
>
> Sometimes, it is useful for modes to nest—to have one mode delegate work
> to another mode. An example of this kind of mode is the mixed-mode HTML
> mode. To implement such nesting, it is usually necessary to create mode
> objects and copy states yourself. To create a mode object, there
> are CodeMirror.getMode(options, parserConfig), where the first argument is
> a configuration object as passed to the mode constructor function, and the
> second argument is a mode specification as in the mode option. To copy a
> state object, call CodeMirror.copyState(mode, state), where mode is the
> mode that created the given state.
>
>>
>
>
> Cheers,
> Zoltán
>
> On 08/29/2014 06:05 PM, Matthias Bussonnier wrote:
>
> Le 29 août 2014 à 17:00, Klymak Jody <jklymak at gmail.com> a écrit :
>
> Sorry if I've double posted this - I keep sending from the wrong account...
>
> Hi all,
>
> I am using a lot of <equation> tags in my markdown cells, and that works
> great for what I am writing.  However, is there a way to get latex-style
> highlighting in my cells rather than markdown (or some combination of
> both)?  As soon as you put an underscore in the cell, everything until the
> next underscore is rendered as oblique, which is not very easy to read.
>
> Someone would have to write a markdown+latex mode in code mirror that
> detect $/$$ et switch to latex.
> It would have the advantage of also highlighting latex correctly.
> But it need to be done.
>
> is not hard, but not trivial either.
>> M
>
>
> _______________________________________________
> IPython-dev mailing list
> IPython-dev at scipy.org
> http://mail.scipy.org/mailman/listinfo/ipython-dev
>
>
>
> _______________________________________________
> IPython-dev mailing list
> IPython-dev at scipy.org
> http://mail.scipy.org/mailman/listinfo/ipython-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140831/cbe1c524/attachment.html>


More information about the IPython-dev mailing list