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

Julia source blocks produce no output #295

Open
aceross opened this issue Oct 23, 2020 · 4 comments
Open

Julia source blocks produce no output #295

aceross opened this issue Oct 23, 2020 · 4 comments

Comments

@aceross
Copy link

aceross commented Oct 23, 2020

Every time I execute a source block with Julia (e.g. C-c C-c), I get the message Code block produced no output The source blocks start a Julia REPL but do not send any lines to it. The error provided is:
Error running timer ‘jupyter-event-handler’: (wrong-type-argument number-or-marker-p t)

I have tried this in both Ubuntu 20.04 and MacOS 10.15 "Catalina".

Given that others seem to use the package without this issue, I am a bit baffled as to what is going on.

Thanks in advance for any advice that can be offered.

@aceross aceross changed the title Julia code blocks produce no output Julia source blocks produce no output Oct 23, 2020
@fleimgruber
Copy link

How did you set up emacs-jupyter with respect to Julia?

@jave
Copy link

jave commented Jul 4, 2021

This works for me at least.

like this:

#+begin_src jupyter-julia :session julia :results value :exports both
@variables A B a b c d e f g h i j k l m n o p q r
A=[a b c;
d e f;]

transpose(A)

#+end_src

#+RESULTS:
#+begin_export latex
\begin{equation}
\left[
\begin{array}{cc}
a & d \
b & e \
c & f \
\end{array}
\right]
\end{equation}
#+end_export

and installation:
(use-package jupyter
:ensure t)

(org-babel-do-load-languages
'org-babel-load-languages
'(
;;old
(dot . t)
(plantuml . t)
(gnuplot . t)
(ess-julia . t)
;;new
(emacs-lisp . t)
(julia . t)
(python . t)
(jupyter . t)))

sudo dnf install python3-jupyter-console

@dalanicolai
Copy link

dalanicolai commented Dec 1, 2022

FYI

I am trying out the Julia Symbolics package, but I prefer to see the latex-preview. However, we can make things work with org-latex-preview as follows:

As for latex equations, the export block is not required, I am using the header argument :results raw.
However, different from @jave his results, the output here gets wrapped between $$. Also, for the equation environment, the $$ is not required so I have added the following advice to remove them:

(defun jupyter-julia-trim-latex (orig-fun data)
  (apply orig-fun (list (string-trim data "[ $]+" "[ $]+"))))

(advice-add 'jupyter-org--parse-latex-element :around #'jupyter-julia-trim-latex)

Only problem is that the :RESULTS do not automatically get replaced. But we can use org-babel-remove-result(-one-or-many).

Hope this might be useful to anybody (and that users will find it here :)

@akirakyle
Copy link
Contributor

@dalanicolai Latexify with symbolics was working fine before JuliaSymbolics/Symbolics.jl#763

I made a comment on that PR to try to understand why that change was made so hopefully we can know what the right fix here might be.

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

5 participants