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
7
votes
4answers
997 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 ...
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?
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} \...
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 ...
5
votes
3answers
257 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} ...
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 ...
4
votes
2answers
587 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
420 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 ...
4
votes
2answers
121 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
491 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 ...
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 ...
4
votes
1answer
119 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 ...
4
votes
1answer
326 views

Making AUCTeX aware of SageTeX

When you compile a file with AUCTeX, it will prompt you to re-run LaTeX and BibTeX as necessary. Is there a way to get it to also run sage when using SageTeX?
4
votes
0answers
650 views

Sage + Latex - How to change a font for axes label? [closed]

I use Sage and LaTeX and when I do this: \begin{sagesilent} p2 = list_plot(zip(H, f(5)), True, color='blue', axes_labels=[u'$H,$ км',u'$\mu, c$']) p2.fontsize(14) \end{sagesilent} and run sage ...
3
votes
1answer
401 views

Using SageTeX with siunitx

I have the following problem: I'd like to do calculations using SageTeX and use the result in an siunitx expression, so that (for example) \SI{\sage{3.5^2}}{kg m} would give me the same result as \...
3
votes
1answer
729 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 ...
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} \...
3
votes
1answer
322 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 ...
3
votes
1answer
653 views

Is it possible to integrate sage in kile?

I'm using sagetex to output the result of computations directly on LaTeX. I'm using Kile as my editor. The usual procedure for compilation is: compile LaTeX on Kile. goto terminal and load the Sage ...
3
votes
1answer
468 views

Layout of Sagetex in Tex (using Kile)

If you have something like: \begin{sagesilent} G=Graphics() H=Graphics() var('x') G+=plot(cos(x),(x,0,pi)) H+= text("$\cos(x)$", (1, 1), fontsize=16, color='black') \end{sagesilent} \[ \sageplot{G+H}\...
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 ...
3
votes
0answers
108 views

Using comma as a decimal mark with SageTeX [closed]

There are a lot of questions about how-to use comma instead of dot in standart LaTeX documents. But how i can do this in documents with SageTeX? P.S. I use online editor cloud.sagemath.com
2
votes
2answers
307 views

Runaway argument error when creating a macro for code that works outside a macro

I'm certain my problem is due to my almost complete lack of understanding of LaTeX's expansion rules... I wrote some code, which uses the SageTeX package to keep track of a list of answers to ...
2
votes
1answer
546 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 ...
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/...
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 ...
2
votes
2answers
862 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....
2
votes
1answer
69 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 ...
2
votes
1answer
361 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 ...
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 ...
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 ...
2
votes
0answers
334 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
3answers
601 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
2answers
175 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
2answers
235 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
2answers
727 views

Using quotes inside sageplot environment in SageTeX

Here's the question: how do I get the following to work in SageTeX? The quotes always lead to an error. \sageplot{plot(cos(x),(x,0,pi),label='$\cos(x)$')} Double quotes, escaping them, ... nothing ...
1
vote
1answer
138 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
1answer
163 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
1answer
669 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.
1
vote
2answers
280 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 ...
1
vote
1answer
247 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 ...
1
vote
2answers
309 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 ...
1
vote
1answer
48 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....
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
1answer
85 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
92 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
2answers
248 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
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
1answer
117 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
131 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{...