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
1
vote
1answer
65 views

How to Plot General Form of a Linear Regression

I attempted to use both Mathcha which is an online website that assists in constructing topological diagrams and plots and I also tried to use Sage, in order to plot this linear regression figure ...
1
vote
1answer
44 views

Handling the numerical output of SageTeX with siunitx

Which one of the three methods below is correct to handle the numerical output of sagetex with siunitx? and how to do it correctly? \documentclass{article} \usepackage{sagetex,siunitx,mathtools} \...
1
vote
1answer
98 views

Automatically obtaining QPA quivers in tikz via Sage

I use the GAP-package QPA to obtain quivers (which are just directed graphs) and the QPA-output of a quiver looks for example as follows: ["v1","v2","v3","v4",&...
0
votes
0answers
57 views

Impossible to run the command: sage “Sage-example”.sagetex.sage (Windows 10)

Good evening guys. I've a big problem, as to simplify my school report, and don't do stupid mistakes while copy pasting some equations, I decided to try SageTex, and I've been struggling to make it ...
1
vote
0answers
27 views

%time inside sagecommandline environment

I want to show how to measure time with sage, sagetex and the environment sagecommandline. Here is a minimal example: \documentclass[a6paper,DIV=16]{scrartcl} \pagestyle{empty} \usepackage{sagetex} % ...
0
votes
1answer
63 views

sagetex linebreak

When using the environment sagecommandline of sagetex with long number output, how can I get automatic line breaks? I already tried to change sagetex.sty (putting breaklines=true at several places), ...
0
votes
0answers
153 views

sagetex/arara: SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape

Following up this answer, I have the following error in the arara's log file SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape when ...
3
votes
0answers
75 views

Texmaker configuration and SageTex

I recently installed SageMath on my linux and tried SageTex on Texmaker as follows: run pdflatex on Texmaker, run load("example.sagetex.sage") from the build folder with Sage, and run ...
1
vote
1answer
145 views

How to automatically ask tikz to produce the coordinates and plot the graph from adjacency matrix

I am curious about the following: I have an adjacency matrix of a graph of order 36. It is given by [0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1], [1,0,1,0,1,0,1,0,1,0,1,0,...
0
votes
0answers
42 views

How to plot graphs in Latex using sagetex

Now I have got the file sage-plots-for-example.tex in sage that contains all the plots. Do I also have to put all these .eps and .png into the same folder as the tex file?
0
votes
0answers
100 views

How to use sagetex?

I am trying to use sagetex. Now in the console in sage it is written:"Sage processing complete. Run LaTeX on Beiapiel5.tex again." But when I compile the latex code again nothing happens. ...
1
vote
1answer
88 views

\sagestr does not produce plots and sabotages others

For the sake of illustration, I want to plot three functions: linear with direct \sageplot invocation, quadratic with \sagestr and sinusoidal with \sageplot However, it seems that the \sagestr does ...
1
vote
0answers
52 views

Eigenvalue in Sagemath [closed]

I tried to obtained the eigenvalues of the matrix below using sagemath; sage: var('a b c d e f g h i j k l m n p q r s t u v') (a, b, c, d, e, f, g, h, i, j, k, l, m, n, p, q, r, s, t, u, v) sage: m ...
1
vote
1answer
33 views

sagetex not drawing pictures

Maybe someone aldready asked this, but I have the following problem. I tried to compile an example I found here https://tex.stackexchange.com/a/483113/217249. I don't get any errors. I have sage ...
0
votes
2answers
107 views

How to execute SageTeX code multiple times with \loop?

I got the following errors when compiling the following MWE. How to fix it? Paragraph ended before \verbatim@ was complete. ... First MWE \documentclass{article} \usepackage{sagetex} \newcount\i ...
0
votes
1answer
62 views

How to setup TeXnicCenter for compiling SageTeX-based input files?

Having found the solution through a dramatic struggle, I think I need to rephrase the question. Hopefully it is very useful for others with the same issue, nameely: "How to setup TeXnicCenter for ...
0
votes
1answer
138 views

sagetex in texstudio : define a new build tool

I am using latex and Sage (and sagetex) through TeXstudio and the terminal. I would like to have a build sequence that would do all the compilations with one signle button. Something like wha tis ...
0
votes
0answers
28 views

sagetex and mcexam

I would like to use mcexam and sagetex together. I managed to make things almost work. Well, I have the expected output, but I have too many errors, and don't see where do they come from. Here is my ...
0
votes
1answer
43 views

How do I show Sage results computation in my LaTeX file? [closed]

I am new to SageMath so I apologize in advance if this question is not exactly appropriate for this site but since I don't really have any other way to know the answers, I 'll ask it anyway. (I am ...
1
vote
2answers
58 views

passing mathematical function to sage function in sagetex

Would some body please help me in getting the plots, I have tried many things, like creating function('f') and then passing it like Q1 = question(1, f(x+1)) but the thing that only works is: output += ...
1
vote
2answers
115 views

SageTeX for posets

One can use SAGE to get a LaTeX output for posets. For example entering u=posets.BooleanLattice(4) print(display(u),print(latex(u))) in the sage cell (https://sagecell.sagemath.org/) will display ...
2
votes
1answer
106 views

latex(VAR) command converts other concatenated strings into mathemode when latex displays it

Using sagetex in latex; it appears that using the latex() command converts any concatenated strings to that term into math-mode, rather than strings. See the MWE below: \documentclass{article} \...
4
votes
2answers
155 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{...
3
votes
1answer
416 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....
6
votes
1answer
190 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 ...
2
votes
2answers
149 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
98 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
93 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
27 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 ...
6
votes
3answers
948 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
90 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
106 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 ...
6
votes
1answer
753 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 ...
1
vote
1answer
124 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
101 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
529 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
241 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
322 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
232 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
48 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
139 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
182 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
128 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
67 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
134 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
287 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
349 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
310 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
87 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 ...
2
votes
1answer
267 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.