1

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{document}

So this is what I get:

enter image description here

The point is I don't think it's a "pretty" fraction. I expected something like this: enter image description here

I wonder if I could get what I expected? Thank you in advance. I really appreciate your help.

  • possibly var('a,b') doesn't needed and $\sage{(a-6)/(b-1)}$ should be $\frac{\sage{a-6}}{b-1}$ – koleygr Sep 10 '18 at 7:45
  • @koleygr I want it to be simplified, like $\sage{2/4}$ then it gives 1/2 :D If I use $\frac{\sage{a-6}}{b-1}$, that may not be simplified :D – dienhosp3 Sep 10 '18 at 10:26
  • Sorry, I have no way to test it because I can't run with this library. I just supposed that what I wrote would give what you expect... Did you tried it? If so, then maybe an \expandafter could do the job – koleygr Sep 10 '18 at 12:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.