A message from our CEO about the future of Stack Overflow and Stack Exchange. Read now.

Questions tagged [sagetex]

SageTeX is a package enabling Sage mathematics software to be used from within LaTeX documents in a wide variety of ways, similar to Sweave in R.

Filter by
Sorted by
Tagged with
4
votes
2answers
120 views

SageTeX: 1000sep for sage-calculated number (siunitx?)

How to add a '1000 sep' on i.e. \sage{2^333}? \documentclass{report} \usepackage{sagetex} \usepackage{siunitx} \sisetup{group-separator = \text{\,}} \begin{document} Works: \num{9000123} \begin{...
4
votes
1answer
118 views

arara: sage - A Sage(math)-rule for arara

Completely edited! The normal run of a tex-file which contains sagetex, say \documentclass{report} \usepackage{sagetex} \begin{document} \sage{2^1234} \end{document} is pfdlatex example.tex ...
1
vote
1answer
46 views

SageTeX: How to run Sage in the command line

The normal run of a tex-file which contains sagetex, say \documentclass{report} \usepackage{sagetex} \begin{document} \sage{2^1234} \end{document} is pfdlatex example.tex sage example.sagetex....
0
votes
1answer
40 views

Directly input a sage file in a sagetex block

Is there a command similar to \lstinputlisting with sagetex, which would import directly a .sage file in the relevant block, and have it evaluated by sagetex? If not, how would one write such a ...
2
votes
1answer
68 views

Number formatting in PythonTeX with `sage` family

I am trying to get a special number formatting in pythontex with sage family but it doesn't work. Here is an example which shows how it should look like and what I tried so far. How can I make it ...
1
vote
1answer
45 views

How to display the output of a loop in SageTex

I am preparing a class on Sage, and i want the following code on my document. \documentclass{article} \usepackage{sagetex} \begin{document} \begin{sagecommandline} sage: for i in range(0,4): ....: ...
1
vote
0answers
88 views

String check against a sage command, issue of expansion order? [closed]

I am trying to write a macro to do a conditional check against two strings. The problem I'm having is that I want to check the output of a \sage command and do a string comparison without expanding ...
0
votes
0answers
23 views

SageTex on PC MikTeX issue

I am trying to run the LaTeX/SageTeX code presented in John Palmieri answer. The file compiles, but the output PDF is missing all mathematical Sage answers and yet there are no error messages (e.g, no ...
5
votes
1answer
396 views

SageTeX and Commenting Out Code

I'm struggling to find a way to get SageTex and any of the commenting (comment or verbatim) packages to play nicely together. I'd like to be able to comment out a section of LaTeX code, containing ...
5
votes
3answers
247 views

How to use sagetex package

I'm trying to use sagetex package, but then I found this kind of problem when running the code, may anyone help? Here is the code: \documentclass{article} \usepackage{sagetex} \begin{document} ...
6
votes
2answers
2k views

Using SageTeX within Windows

Sage 5.5 was just released. It is a Linux native, is there a way to use it within windows with minimal constraints?
0
votes
0answers
73 views

SageTex installed, but not compiling

I've installed SageTex in my texmf tree. Latex is running using WinEdt and appears to see the style file, as I have the output files example.sagetex.sage from example.tex. My issue is the second ...
4
votes
1answer
486 views

Call Sage in TeXstudio (Windows)

I have installed and tried SageTeX (using pdflatex, opening the sage console and using pdflatex again). This works fine. I want to get a user command in TeXstudio that calls sage without the need to ...
0
votes
0answers
72 views

VimLatex-suite SageTex compile shortcut

I am using LaTeX in Vim with VimLaTeX-Suite and i just started using Sage and i want to implement SageTex in my documents, but everytime i want to compile a have to follow this process in the terminal ...
2
votes
1answer
355 views

How do i use SageTex in TexStudio

I just recently found the CAS-application SageMath. SageMath has a TeX plugin called SageTex, and I would like to use this with the TeX editor TeXstudio, however I am quite a noob, so I don't know ...
1
vote
0answers
72 views

Simplifying fractions in SageTEX

I'm new to SageTex. Here's my code: \documentclass[10pt]{article} \usepackage{sagetex} \begin{document} \begin{sageblock} var('a,b') a = 3 \end{sageblock}\\ $\sage{(a-6)/(b-1)}$ \end{...
2
votes
1answer
205 views

sagetex with breqn ? break line sagetex equations

When using sagetex, it often produces very long equations that are not visible anymore because they go over the page width. How to fix that? I could work around it by loading the .sagetex.sage into ...
1
vote
1answer
91 views

How to change background color of a sagetex sageblock-environment?

When using sagetex the background of sagecommandline environments can be easily changed via lstlistings setup. How can the background of a sageblock environment be changed? MWE: \documentclass[]{...
1
vote
1answer
82 views

format sagetex code like console or notebook

I'd like to put sage code in my LaTeX document that looks mostly like how an interactive session would appear, except that I want LaTeX formatted output. So, I'd like to write something like this in ...
1
vote
1answer
162 views

Is it possible to call/reference sagetex within a latex command?

I'm doing a few projects in which it would be very helpful to get some numbers from a sagetex environment, and then directly using them within latex. I know Latex isn't great at storing numbers/...
1
vote
2answers
173 views

Help with writing base 10 addition/subtraction formula

I am preparing this small tutorial for addition and subtraction formulas for kids who have a strong understanding of base-10 representation and also have a good enough understanding of addition and ...
1
vote
0answers
168 views

Change the output of the sage function latex() on a string

Currently if you run the sage command latex('a string') using sage (or sagetex) the latex output looks like: \text{\texttt{a{ }string}}. I would like to eliminate either of these (preferably the \...
1
vote
0answers
198 views

Create new command python

I want create a new command in python, in https://tex.stackexchange.com/a/234232/153360 add the command sage to pythontex. How can I change or add a command which output a string instead of a latex ...
0
votes
1answer
79 views

Is there a workaround for Packages Comment and Sagetex incompatibility?

I use the "Comment package" to write exercises with or without solutions. But I also want to use the "Sagetex package" to write the solution without typos. There seems to be an incompatibility between ...
0
votes
0answers
45 views

Relaxing a command's requirement to be run in mathmode (specifically \sage in tikz \draw command)

I would like to be able to build a dynamic tikz picture using some random numbers generated via sage. Presently this seems to fail because tikz doesn't like the mathmode that sage has to be run inside ...
1
vote
2answers
247 views

Comma separated number representation fed to latex math mode from \sage{}

I came across other tex questions where people asked ways to represent numbers in comma-separated format. That is writing 1234567 as 1,234,567. I need this while teaching addition/subtraction to my ...
1
vote
2answers
234 views

import counter value from .aux file

Note: This seems like it has to be asked somewhere, but my Google-foo is failing me. If someone can point me to it, I can delete this question. I am trying to save a number to the .aux file, and then ...
1
vote
1answer
663 views

How do I write a custom command to enable Sage in Texmaker?

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.
3
votes
1answer
63 views

Babel with french option mess with SageTeX and `\addplot`

I'm trying to easily plot with pgfplots some python outputs. I really don't like the matplotlib2tikz default behavior, which is to copy the default parameters of matplotlib, and I can't find how to ...
1
vote
0answers
109 views

I have a problem when I use tikz package with Sage [duplicate]

I used Sage 8.0 to get crystal graph : $ sage: B = crystals.Tableaux(['A',2], shape=[2,1]) $ sage: latex(B) and then I got the latex code: \documentclass{paper} \usepackage{dot2texi} \usepackage{...
1
vote
0answers
264 views

Integrating SageTex and Kile/TexStudio in Linux

I had followed the instructions given in the answer to a similar question, but it seems that sage never gets launched once pdf is created in that integration. I am attaching screenshot of log and ...
6
votes
2answers
1k views

How to just print the calculation using sagetex

I want a command \simp which takes an algebraic expression E_1 and outputs E_1 = E_2 where E_2 is the simplified form of E_2. To do so I tried to use sagetex like this: \documentclass{article} \...
3
votes
1answer
320 views

Passing files to SAGE on Mac OS X

System: Mac OS X 10.9.2 Sage Version 6.1.1, Release Date: 2014-02-04 TexLive 2013 installation I'm trying to pass a file generated by LaTex (sagetex.sty) that is in SAGE format to my local ...
1
vote
0answers
66 views

sagetex plotting error [closed]

Plotting error problem closed.
0
votes
2answers
399 views

How to use sage commands in a loop?

I would like to create a worksheet with randomized questions and their solution. The following attempt has not been successful, throwing "Paragraph ended before \multido@@ was complete." \...
1
vote
1answer
80 views

Evaluating limits restricted to real field with sagetex

I am trying to use sagetex to calculate some limits and it is having difficulties with the branch cuts for roots. Specifically, things like (-1)^(1/3) won't simplify to -1, presumably because it's on ...
1
vote
1answer
201 views

Is there a TeX/LaTeX maths workbook like Sympy live shell?

I am looking for a mathematics workbook like Sympy live shell that you can do plots in, that has a TeX or LaTeX output.
1
vote
0answers
46 views

Bug with optional arguments in sagetex?

I can't seem to find where to report this bug, and I wanted to see if it was either known about, or repeatable by others. When you compile sage code using the sagetex package it is suppose to ...
2
votes
1answer
954 views

Is it possible to use `lualatex`'s DVI output with `fontspec` without getting font-related errors?

Is it possible to use lualatex's DVI output with fontspec without getting font-related errors? I want to use the (eps-based) output of sagetex with a lualatex generated document with fontspec. As ...
1
vote
0answers
56 views

Using sagetex with preamble

I want to use Sage via sagetex in my TeX files. It works. But if I use a precompiled preamble and use it in the tex document with %&preamble in the first line, the already computed sageoutputs ...
7
votes
4answers
996 views

How to NOT render a part of a document

I would like to use an environment that makes everything inside... invisible! I would like that during the .tex compilation to read everything but not render some parts of my LaTeX document. The ...
1
vote
0answers
275 views

\sagestr(output) does not insert “output” in the LaTeX code.

This question is related to "Using sageTeX to define a variable for a TikZ picture" . To simplify the answer I want to introduce in my LaTeX code the new command "\def \crt{6.00000000000000}" where ...
4
votes
3answers
359 views

Using sageTeX to define a variable for a TikZ picture

I want to pass parameters to a TikZ picture. The computation of the parameters is lengthy and done with sage. So I want to use both TikZ and sageTeX. Either the compilation enters an endless loop or I ...
2
votes
1answer
1k views

sagetex.sty not found

I have ubuntu 15.10 and sage 6.9 installed, and texlive/texmaker, and have been trying to get sagetex to work. I followed the instructions in the reference manual, and first attempted the 3rd, and ...
5
votes
3answers
394 views

SageTeX: Number formatting

The following example: \documentclass{article} \usepackage{sagetex} \begin{document} \sage{0.1*0.1} \end{document} gives which is totally undesirable. A brief googling shows that Sage does ...
2
votes
0answers
333 views

How to use sagesilent (or verbatim) environment in pgffor loops?

I want to create different versions of an exam paper and corresponding sample solutions using sagetex. I need to assign variables for more involved computations, so I am reliant on the sagesilent ...
3
votes
1answer
400 views

How to pass a function defined in sagetex to pgfplots

Is there any way to pass a function defined in sagtex to pgfplots for plotting? See the following example. \documentclass{article} \usepackage{pgfplots} \usepackage{sagetex} \begin{document} \...
2
votes
2answers
2k views

Having trouble getting SageTeX working

According to the Make SageTeX known to TeX, the preferred way to let TeX know about SageTeX is to copy the tex folder found at SAGE_ROOT/local/share/texmf/tex (which in my OS X case is /Applications/...
1
vote
0answers
106 views

A \newcommand type option that runs all subarguments and saves static text

I am trying to write code that uses sage in it, and have a bit of a problem with randomizing stuff around the code. The sagetex part isn't too important (I don't think), what is important is that if I ...
3
votes
1answer
728 views

User defined Quick Build command (sage) does not work in Texmaker

I use LaTex a lot in Ubuntu 14.04. Recently I came to know about the sagetex package and installed sage-6.8-x86_64-Linux . Suppose the tex file is example.tex , then one has to run the following ...