[IPython-dev] First experiences and usability suggestions for notebook and nbconvert

Jakob Gager gager at ilsb.tuwien.ac.at
Wed Jul 17 02:11:08 EDT 2013

Hi David,

you did a great list of issues! May I comment on this one...

>     - New LaTeX commands:
>     I defined various LaTeX shortcuts like
>     \newcommand{\yy}{\mathbf{y}}
>     inside $$...$$ in markdown cells.
>     (Is this the correct / canonical way to do this?)
>     Markdown seems to respect these in the rest of the document, and in the HTML output, but running
>     pdflatex on the LaTeX output forgot about them immediately after they were defined.

The problem here, is that mathjax allows to embed the \newcommand call within a math environment 
(otherwise it wouldn't be recognized by mathjax at all!). However, original LaTeX does not allow such 
calls to be placed with in math environments. The markdown2latex filter does what it should do and 
converts plain markdown text to plain LaTeX text and math environments into math environments.

To get your tex files to compile simply remove the math environment around the \newcommand (in the .tex 
or the notebook) and it should work fine.

I'll add this to my github issue list #3603 of "upcomming issues with nbconvert".


More information about the IPython-dev mailing list