For an interesting contrast, please see the document/app mentioned at:

https://email.esm.psu.edu/pipermail/macosx-tex/2019-June/056685.html

LyX being able to author such would be huge.

William

On Tue, Jun 25, 2019 at 2:50 PM Jason Sun <ds...@cornell.edu> wrote:

> Sorry, forgot to include the list. Here is another iteration:)
>
> I have attached a prototype in the screenshots in the attachment.
>
> This is what I am trying to achieve - combining the computing power of
> jupyter and the latex power of LyX. It is still in early stages. More
> testing and further extension could easily be developed. Ideally, one could
> do the following few things with this feature
>
> 1. Edit the ERT box inside a code editor that is embeded in LyX powered by
> QScintilla2 with syntax highlighting and clangformat.
> 2. Copy and paste the code in the ERT or codeListing  in the lyx editing
> pane or the code in the embeded code editor  and execute them in the
> embeded jupyter-console and get output(plots) displayed in the console(a
> separate plot pane) inside LyX.
> 3. Save a code piece in the embeded code editor to file, or insert them to
> the main LyX workarea with the click of one button.
>
> Now I have embeded successfully a quite powerful terminal (true terminal,
> separate process) inside LyX that allows to me to do some of the things
> listed above. In my opinion, the code editor part is not hard.
>
> I looked at the current 2.4 dev source files, the design for external
> editor is a good idea. However, it does not seem to close the external
> editor properly. At least I tried on vscode and atom. I also think that the
> tmp file approach could be internalized.
>
> The end goal is to enable LyX be stronger if not as strong as jupyter
> notebook.
>
> On Tue, Jun 25, 2019 at 2:40 PM Jason Sun <ds...@cornell.edu> wrote:
>
>> I have attached a prototype in the screenshots in the attachment.
>>
>> This is want I am trying to achieve - combining the computing power of
>> jupyter and the latex power of LyX. It is still in early stages. More
>> testing and further extension could easily be developed. Ideally, one could
>> do the following few things with this feature
>>
>> 1. Edit the ERT box inside a code editor that is embeded in LyX powered
>> by QScintilla2 with syntax highlighting and clangformat.
>> 2. Copy and paste the code in the ERT or codeListing  in the lyx editing
>> pane or the code in the embeded code editor  and execute them in the
>> embeded jupyter-console and get output(plots) displayed in the console(a
>> separate plot pane) inside LyX.
>> 3. Save a code piece in the embeded code editor to file, or insert them
>> to the main LyX workarea with the click of one button.
>>
>> Now I have embeded successfully a quite powerful terminal (true terminal,
>> separate process) inside LyX that allows to me to do some of the things
>> listed above. In my opinion, the code editor part is not hard.
>>
>> I looked at the current 2.4 dev source files, the design for external
>> editor is a good idea. However, it does not seem to close the external
>> editor properly. At least I tried on vscode and atom. I also think that the
>> tmp file approach could be internalized.
>>
>> The end goal is to enable LyX be stronger if not as strong as jupyter
>> notebook.
>>
>> On Tue, Jun 25, 2019 at 12:42 PM Richard Kimberly Heck <rikih...@lyx.org>
>> wrote:
>>
>>>
>>> Hi, Jason,
>>>
>>> Thanks for these ideas. I'm not an R user myself, though, so it would be
>>> helpful to me if you could explain what it is you are trying to achieve.
>>> It's best when thinking through issues like this one to separate the
>>> problem from the solution. What's below seems to be a mix between those.
>>>
>>> One reason I ask about this is that LyX 2.3.3 has added the ability to
>>> edit the LaTeX preamble or the contents of an ERT inset using some
>>> external editor. LyX 2.4.0 will extend that to 'collapsible' insets
>>> generally, controlled by a layout tag EditExternal. So by activating
>>> this tag for the appropriate kind of inset, you can edit its contents in
>>> whatever editor you define for its format. That seems, if I'm reading
>>> you right, to give you much of what you want---and to use your editor of
>>> choice.
>>>
>>> Riki
>>>
>>>
>>> On 6/20/19 10:42 AM, Jason Sun wrote:
>>> > I thought about this long and hard. It is possible to extend Lyx's
>>> > functionality beyond the document processer. With the help you pybind
>>> > 11 and Qt5, I think is it possible to implement some of the IDE
>>> > features(think RStudio) in LyX. This would be extremely helpful in
>>> > writing scientific document. Currently, my workflow is to write code
>>> > in VS Code/Emacs and copy and paste everything back and forth between
>>> > LyX and code editor.
>>> >
>>> > * It is not terribly cumbersome. But if we can development LyX into
>>> > something like RStudio, it would definitely save some time.
>>> >
>>> > * Because LyX has support for knitr. Provided the script editor
>>> > QtWidget and console Widget has been implemented, it won't be very
>>> > hard to build a communication mechanism between the IDE portion and
>>> > the LyX main buffer&main view portion. This is a little bit like
>>> > Jupyter Console (think IPython), but with much better Latex support.
>>> >
>>> > My rough idea:
>>> >
>>> > * I think the GUI and UI design part it not so hard. We could just
>>> > create another ViewSource-like class that inherit DockView but with
>>> > editable text field. As for console portion, there are quite a few
>>> > example QtConsole, are we could develop our own wheel. I remember in
>>> > my undergrad OS class. the first project was to implement a
>>> > terminal-ish stuff. As far as I am concerned it is not terribly
>>> > difficult as long as the signals child processes are handled right.
>>> >
>>> > * The major work should be in the building a python repl inside LyX. I
>>> > think LyX has its own Python for some of the scripting procedures, but
>>> > it is not ideal to use this one. The better solution, IMO, is to
>>> > enable loading the Python Interpreter the user assigned. This gives a
>>> > larger flexibility for various reasons (say, some user might want to
>>> > use TensorFlow. This would be greatly helpful).
>>> >
>>> > * with pybind11, it is not really hard to open up a python interpreter
>>> > inside c++ applications. The developers of pybind11 gave various
>>> > examples on how to do it. Moreover, pybind11 is a header only library,
>>> > which makes it easy to be built into other applications.
>>> >
>>> >
>>> > These are my thoughts so far. Would be nice to hear some of your ideas
>>> > on this.
>>> >
>>> >
>>> > Jason Sun
>>> > Cornell University
>>>
>>>
>>>
>>
>> --
>> *Daqian Sun*
>>
>> *Tel:607-379-5149*
>> *Department of Mathematics *
>> *Department of Economics*
>> *Cornell University*
>>
>>
>
> --
> *Daqian Sun*
>
> *Tel:607-379-5149*
> *Department of Mathematics *
> *Department of Economics*
> *Cornell University*
>
>

Reply via email to