The Stack Overflow podcast is back! Listen to an interview with our new CEO.

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
0
votes
1answer
31 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
84 views

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

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
20 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 ...
4
votes
3answers
136 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} ...
0
votes
1answer
30 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
61 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
344 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
67 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
67 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
305 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
136 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
145 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
187 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
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
1answer
74 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
82 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
62 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
97 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
235 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
249 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
204 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
77 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
188 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
382 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
64 views

sagetex plotting error [closed]

Plotting error problem closed.
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
944 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
270 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
355 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 ...
5
votes
1answer
380 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
368 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
987 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
317 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
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
709 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
130 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
562 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
116 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
155 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
193 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
635 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
499 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
126 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
272 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
813 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
244 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
137 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?