Asking by request to get a screenshot answer to figure out how to enable Sage in Texmaker as I apparently can't figure it out on my own.


First: Under "Options" select Configure Texmaker. enter image description here Running Sage isn't any of the options but we can redefine one of the commands so it calls Sage. I chose to redefine Metapost. Fill in the box with sage "%.sagetex.sage" as shown above.

Next: Click on Quickbuild. enter image description here Select "User" to define our own command and then select the "Wizard" button which will open up the window to select the commands. Select pdflatex from the list on the left, click the "Add" button and it will appear on the right hand side. Then select metapost from the left, click "Add" to get it on the right (this will activate Sage) and continue process to get pdflatex followed by PDF Viewer. Press OK to finalize the command. Now pressing the arrow to the left of Quickbuild will run Quickbuild resulting in all 4 steps: enter image description here

  • Tried it as listed here and got the oh-so-helpful error: "Error : could not start the command" It is possible in all the playing around trying to get latexmk to work earlier that I might have broken something there? – Jason Jun 24 '15 at 5:19
  • I doubt that. I think it's trying to start Sage but can't. I'm wondering about the latexmkrc file that you added the extra lines to. My system has more than one such file. I modified the one in the the asymptote file of the tex distribution as is discussed in more depth here. – DJP Jun 24 '15 at 5:31
  • I don't have a local/texlive file, but the one I edited is in the directory: /usr/share/texmf/tex/latex/asymptote/ And I edited it to look like: sub asy {return system("asy '$_[0]'");} add_cus_dep("asy","eps",0,"asy"); add_cus_dep("asy","pdf",0,"asy"); add_cus_dep("asy","tex",0,"asy"); add_cus_dep('sage', 'sout', 0, 'makesout'); $hash_calc_ignore_pattern{'sage'} = '^( _st_.goboom|print .SageT)'; sub makesout { system("sage '$_[0].sage'"); } – Jason Jun 24 '15 at 5:33
  • That should be the one. I'm not sure what could be the problem. I'll need to think about this..... – DJP Jun 24 '15 at 5:41
  • Sorry, can't seem to get the formatting to display correctly here for that file, but I took the old content and added the lines to the bottom of the file. I also checked with a find command and that's the only asymptote folder with a latexmkrc file anywhere, so I assume that's the right one. – Jason Jun 24 '15 at 5:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.