Jason, No, I've not tried those. However, I feel like we have solutions looking for a problem. What I'm asking is: what problem(s) are you trying to solve?
I'm unsure what I'm looking for in terms of an ideal mixture of LyX and Jupyter, because I'm generally happy with the way things work now. If anything, I'd like to have evaluatable, and collapsable, Python fields in LyX kind of like code blocks in Mathematica notebooks. However, I'm still unsure how I would incorporate something like that into an actual LyX document other than to have generated matplotlib figures. I also suspect other developers would have concerns about arbitrary code execution following this approach. Bottom line: I'd prefer not to have two separate documents to manage but rather have the two integrated into one. Thanks, Joel P.S. I switched to top-posting to try to maintain consistency with you so the thread doesn't become too chaotic. On Sun, Jul 7, 2019 at 9:13 PM Jason Sun <ds...@cornell.edu> wrote: > Have you tried knitr and reticulate? I can build an isomorphism between > the embedded browser and LyX. Maybe we could do this in another way. Could > you tell me what do you expect to see in an ideal mixture of Jupyter and > LyX? > > Sent from my iPhone > > On Jul 7, 2019, at 10:46 PM, Joel Kulesza <jkule...@gmail.com> wrote: > > On Sat, Jul 6, 2019 at 2:03 PM Jason Sun <ds...@cornell.edu> wrote: > >> The proper way to establish communication is to use ZeroMQ to interact >> with IPython directly from LyX. I read the jupyter docs, it is something >> we could try to do. I can communicate with the LyX main buffer now by >> letting the main Browser to as ccess LyX.h, and thus have access to call >> dispatch, and do the injection of variables. It does seem a bit naive >> compared to the zeroMQ approach. But I would argue that it might be >> sufficient for light uses. OTOH, if webengine is used, we should utilize >> its full potential and design the communication framework properly. >> >> To answer some of other question: yes, this widget is dockable in either >> 4 positions. It also could be dragged out as a single page view. >> >> I need to try see how hard it is to embed the zeroMQ communication layer. >> It can be done for sure, the question is if it is worth the effort or do we >> have some better alternatives. >> >> Sent from my iPhone >> >> On Jul 6, 2019, at 9:12 AM, Joel Kulesza <jkule...@gmail.com> wrote: >> >> On Tue, Jul 2, 2019 at 11:03 AM Jason Sun <ds...@cornell.edu> wrote: >> >>> I have built an example prototype widget that tries to combine LyX and >>> Jupyter Notebook together. >>> >>> Is it implemented via QtWebEngine. Basically, by embedding a mini >>> webpage browser inside LyX. >>> >>> A screenshot is here: >>> https://github.com/jupyter/notebook/issues/1604#issuecomment-507746234 >>> >>> A bidirectional communication between LyX and Jupyter Notebook could be >>> implemented via this browser. With the help of jupyter lab, we can get >>> cross platform terminal for free. >>> >>> Would this be something worth further pursuing down the road? >>> >>> Using Web, a lot could be implemented. Especially, Qt 5.13 introduces >>> Web Assembly. With the help of that, LyX could have it OverLeaf counter >>> part with stronger abilities! >>> >> >> Jason, >> >> Thanks for your thoughts and work on this. Sorry I've been quiet to this >> point, but I hoped to ask a few questions as I think about how I'd use your >> work. >> >> I'm a rather avid LyX user, and routinely use Jupyter notebooks. >> However, I'm still not entirely clear how these two will be integrated. I >> see the screenshot you provided on GitHub; however, it still seems like the >> LyX document and notebook are quite separate. It's not clear to me what is >> gained by putting them both within one window. Can you please help me >> understand how you foresee a user interacting with these two? >> >> Some more pointed questions based on the interface you provided in the >> screenshot: >> >> 1. I assume the browser component can be moved to be bottom half >> rather than right half. Is that correct? I usually run LyX on half my >> monitor, so I'd be reluctant to end up only running it in 1/4 (and Jupyter >> in the other 1/4). >> 2. Do you have a way to integrate Jupyter I/O with the LyX document? >> For example, as a Python variable gets updated in an evaluation it will >> then get captured the next time the LyX-produced PDF is compiled/viewed. >> 3. Will your .ipynb be included in the File -> Export -> LyX Archive? >> >> >> Thanks again, >> Joel >> >> > Jason, > > Thanks for your thoughts. However, my one main question still seems > unanswered: how you foresee a user interacting with these two applications > (LyX and Jupyter)? > > What is the workflow that you're imagining versus how it currently would > be: with LyX and a web browser open separately? What advantage is gained > through the coupling of the two applications? For example, are you working > toward a LyX document with Jupyter-driven evaluated Python cells? Or, > perhaps a Jupyter notebook that will generate a LyX document? Perhaps > something else? > > Thanks, > Joel > >