davibarreira / NotebookToLaTeX.jl

A Julia package for converting your Pluto and Jupyter Notebooks into beautiful Latex.
MIT License
72 stars 4 forks source link

Pluto Notebook Environments and @bind #12

Open stefanbringuier opened 1 year ago

stefanbringuier commented 1 year ago

Nice package, I could see this useful for writing journal articles. I was running into a few issues when converting Pluto.jl notebooks:

  1. The Pluto.jl @bind macro isn't in scope so notebooks with code lines using it throw:
    notebooktolatex("MyNotebook.jl",template=:book)
    ERROR: LoadError: UndefVarError: @bind not defined
  2. Similarly the environment/package setup within a pluto notebook isn't activated, so these have to be manually added in the working julia environment. Seems like somewhere before this function call: https://github.com/davibarreira/NotebookToLaTeX.jl/blob/841a022840277c50be8fca0210cd8ddbe54d29bb/src/NotebookToLaTeX.jl#L56 you should be able to use Pluto.activate_notebook_environment("MyNotebook.jl") to achieve configuring the environment if Pluto is added as a dependency.
davibarreira commented 1 year ago

Thanks, I'll check. BTW, if you think you know how to solve this, feel free to send a PR.