TobiasZawada / texfrag

Emacs package for previewing LaTeX fragments such as in doxygen comments.
GNU General Public License v3.0
68 stars 4 forks source link

Support for IPython notebook #21

Open balbirthomas opened 4 years ago

balbirthomas commented 4 years ago

Hi,

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

regards

TobiasZawada commented 4 years ago

@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?

balbirthomas commented 4 years ago

@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.

TobiasZawada commented 4 years ago

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?

balbirthomas commented 4 years ago

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.