Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QUESTION: how to include julia scripts #215

Open
rafaelmgallego opened this issue Jun 12, 2023 · 2 comments
Open

QUESTION: how to include julia scripts #215

rafaelmgallego opened this issue Jun 12, 2023 · 2 comments

Comments

@rafaelmgallego
Copy link

I am using Julia with pythontex, and I want to include a script with all the variables and functions at the beginning. I have read the Issue #27, which address the same topic for python. In the case of python I use, (I found this way before reading #27 issue)

\pyc{exec(open('myscript.py').read())}

In my case the myscript.py in the same directory as the tex file.

For Julia I have tried

\jlc{include("./myscript.jl")}

where both myscript.jl and myfile.tex are in the folder 'mydir', but pythontex looks for 'myscript.jl' in the folder 'mydir/pythontex-files-myfile' instead of 'mydir'

I want the julia script to execute, to use variables and functions in my latex document.

@rafaelmgallego
Copy link
Author

rafaelmgallego commented Jun 12, 2023

I have just used

\jlc{include("../myscript.jl")}

This solves my problem (for the time being :-) )

@gpoore
Copy link
Owner

gpoore commented Jun 13, 2023

I believe that all of that is behaving as expected. For Python, open() is relative to working directory. For Julia, include() is relative to source file location, which will be a temp file in mydir/pythontex-files-myfile.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants