texfrag icon indicating copy to clipboard operation
texfrag copied to clipboard

Support for IPython notebook

Open balbirthomas opened this issue 4 years ago • 4 comments

Hi,

Is it possible to support LaTeX preview for emacs-ipython-notebooks in markdown cells, using Texfrag.

regards

balbirthomas avatar Mar 27 '20 01:03 balbirthomas

@balbirthomas I've got no experience with emacs-ipython-notebook. Maybe as an intro for myself: https://www.youtube.com/watch?v=OB9vFu9Za8w Could you give an example how the LaTeX fragments look like in that mode and how markdown cells are recognized?

TobiasZawada avatar Mar 27 '20 14:03 TobiasZawada

@TobiasZawada Here is a link an IPython notebook. Emacs IPython notebooks are standard IPython notebooks. The cell type being markdown is recognized by "cell_type": "markdown" attribute of the cell. Within markdown cells LaTeX fragments are embedded between $$ or $. Hope this helps.

balbirthomas avatar Apr 03 '20 15:04 balbirthomas

Do you really mean those text blocks of form

 {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "The architecture of IPython is built with reusable components. These components include:\n",
    "\n",
    "* The configuration system for processing command line arguments and configuration files\n",
    "* The IPython `InteractiveShell` object that provides the core interactive features across the entire code base\n",
    "* The IPython kernel, which provides the capabilities of the `InteractiveShell` object over a ZeroMQ/JSON based message protocol to various frontends\n",
    "* The IPython frontends (Notebook, Qt Console, Console, Terminal)\n",
    "\n",
    "These components can be embedded into other applications."
   ]
  },

in ipynb files?

I guess LaTeX environments and displayed formulae with equation boundaries marked by $$ can then be split into several lines in the source string array?

TobiasZawada avatar Apr 22 '20 20:04 TobiasZawada

Apologies for the delay. I am not sure I have understood your question. However the IPython notebook you linked does not seem to have LaTeX sections. This one does. As expected it does have sections delimited by '$' symbol. However I was mistaken to assume these were the only LaTeX fragments. It seems that LaTeX fragments can also be delimited by LaTeX keywords such as \begin{align} and \end{align}. All LaTeX fragments are seen in the source value of markdown cell types (cell_type). Does this answer your question. If not I can dig a bit further and see what I can figure out.

balbirthomas avatar Jul 14 '20 08:07 balbirthomas