Print JuMP model in IJulia in plain text (i.e. non-LaTeX)

I want to use JuMP with the IJulia server, but in a reduced editing environment, i.e. not inside a browser. For this reason I want a call to print(model) to print in plain text instead of LaTeX. I found (old) code examples where I tried print(model; latex=false) but that does not work. The docs say that IJulia will use LaTeX per default, but no mention of changing that behaviour.

What is the motivation?

Try print(stdout, model)

Thanks for the answer! Motivation: I am using a plain text interface, specifically Org mode inside Emacs with emacs-jupyter to interact with an IJulia server. emacs-jupyter and Org mode can render LaTeX as well, but sometimes just plain text works better for me.

1 Like

Thanks for the answer!

Did it work?

I think we decided against keeping latex = false because the only situation where it would be needed is somewhere with a text/latex backend that the user didn’t want to use. It still seems sufficiently niche that I don’t know if we want to bring it back. Often printing the model isn’t very helpful anyway. It works for toy models when teaching, but it isn’t helpful for printing any models of a reasonable size.

Did it work?

Yes, thanks, that’s why I marked your answer as a solution.

My situation is exactly the one you described. I agree to your reasoning about it being niche and indeed it is only for teaching purposes. latex = false was just something I found and tried. Your solution works well and I would even consider it better than the API option.

1 Like