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.

0
votes
0answers
15 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 ...
0
votes
0answers
45 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 ...
3
votes
1answer
270 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
57 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 ...
1
vote
0answers
59 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
229 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
102 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
2answers
137 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
139 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
0answers
44 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
1answer
60 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
73 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[]{...
0
votes
1answer
52 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 ...
3
votes
1answer
62 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
82 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
2answers
215 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
0answers
227 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 ...
1
vote
2answers
178 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
76 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
169 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 ...
0
votes
2answers
337 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
0answers
63 views

sagetex plotting error [closed]

Plotting error problem closed.
1
vote
0answers
53 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
879 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
250 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
337 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 ...
4
votes
1answer
357 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
350 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
1answer
914 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 ...
2
votes
0answers
295 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 ...
1
vote
0answers
101 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
696 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 ...
0
votes
1answer
125 views

How can i compare values from sagetex with ifthenelse?

I do some calculations in my LaTeX document with sage. I want to include the results and do some comparisons. But to do that with \ifthenelse command, I need the value which is saved in the sage file. ...
1
vote
3answers
521 views

Truncates the value to two decimal places

Suppose you want to print pi with 2 decimal digits. The following code does not work $\sage{"%0.2f"%pi}$ What should be used instead?
1
vote
1answer
114 views

Emulate R in sagetex

What is the most direct way to include R code in Sagetex? I tried %r, which does not work. (I do not want to use both Sweave and Sagetex.)
1
vote
1answer
151 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/...
2
votes
1answer
183 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
606 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.
2
votes
1answer
465 views

Strange result when trying to use sagetex

As a result of another question I'm trying to use Sagetex. I performed the install as directed, and even got the compile to succeed, insofar as there are no fatal errors, but it appears that sagetex ...
1
vote
1answer
118 views

Sagetex : Avoiding printing code

I was trying to use the Sagetex code below. However when I generate the graph inside latex, I'd like to avoid the code being printed out before the graph. How could I go about doing that? \begin{...
1
vote
2answers
263 views

Sagetex: problems with layout, and sage results

I am writing an article with some embedded Sage code, using Sagetex for the purpose. Mostly it works well, with multiple uses of the sageexample environment. However, there are several things I'd ...
2
votes
2answers
766 views

Translate sage input to latex without simplifying

In sage it doesn't seem possible to print latex code of an expression without simplifying it in some way. For example \sage(x/x) should translate to \frac{x}{x} instead of 1, see this question on ask....
1
vote
1answer
238 views

Is it possible to emulate a Sage session with SageTeX?

I'm editing an existing calculus book that uses Sage to demonstrate concepts. The existing book has Sage code listings that show what output the user will see if they duplicate the commands. For ...
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/...
0
votes
1answer
134 views

Is it possible to sagetex without Sage installation?

Is it possible to use sagetex without Sage installation if I have an account in the Sagemath Cloud?
3
votes
1answer
380 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} \...
4
votes
2answers
549 views

How to store values in variables in sagetex?

The sagetex documentation (S. 5) says Also keep in mind that everything you send to Sage is done within one Sage session. This means you can define variables and reuse them throughout your LaTeX ...
4
votes
2answers
397 views

How to pass parameters to Sage from Sagetex?

I haven't found a way to pass parameters to a sagesilent environment, so I wonder if it's possible. My final purpose is to combine sagetex with probsoln. The package probsoln lets you manage a problem ...
1
vote
2answers
297 views

Is it possible to make Beamer pause-handout mode compatible with SageTeX?

I use SageTeX with Beamer for my classes. I need two sets of pdf files, one with the pause for the screen and the handout one to save trees. I use MikTeX under Windows. To get both I start with two ...