1. Ivan Andrus
  2. sage-mode
Issue #35 resolved

sage-view inline output conversion keeps failing.

Anonymous created an issue

Initially, sage-view's inline output kept failing. I believed that it was due to a memory error, and so deleted all the files in the ~/.sage/tmp directory. Now, the inline output feature never works...

Please let me know how I can get the inline output feature to work. It is a great feature!

Comments (7)

  1. Ivan Andrus repo owner

    Very recently I started to have problems, and I noticed that running (preview-set-texinputs 1) caused AUCTeX's directory to be removed from TEXINPUTS which then fixed my problem. If this also solves your problem, then I will add that information to the documentation.

    Assuming not, what versions of Sage, Emacs, LaTeX, and Operating System are you using? More importantly, what does the log file say? When you see "Conversion failed..." you can click on that line and it will take you to the tex log. The input tex file would also be of interest.

  2. Johan S. R. Nielsen

    I also have this problem: sage-view works perfectly fine on a freshly openened Emacs until I open a tex-file. Then I get "Conversion failed" errors from some obscure thing.

    I also tracked down the bug to be the environment variable TEXINPUTS: when opening the first tex-file, AUCTeX will add its local install directory to this environment (in my case, this is in .emacs.d/elpa/auctex-11.87.2/latex) to enable its local install of preview.sty. This seems to cause the break.

    My workaround was more crude than Ivan's:

    (defun sage-fix-preview ()
      "This is a workaround for a bug in sage-mode preview, where opening a tex file
      in the Emacs process will break further sage-view functionality.
      AUCTeX sets a variable TEXINPUTS to make latex look for its version of
      preview.sty, but it seems that this version does not work with sage-mode."
      (interactive)
      (setenv "TEXINPUTS" "")
      )
    

    Call this function after you open a tex-file for the first time in an Emacs window which you use for Sage. I don't know what impact it can have on AUCTeX's live preview, if you use this. I personally have different Emacs sessions for writing tex and for running Sage.

  3. Log in to comment