ASKSAGE: Sage Q&A Forum - Latest question feedhttp://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Sun, 26 Oct 2014 22:02:29 -0500Typesetting Simple Student Worksheet Question & need to defer computationhttp://ask.sagemath.org/question/24637/typesetting-simple-student-worksheet-question-need-to-defer-computation/ I have
eq1=2*(x+10)/5==3*(6-5*x)/7
the command
print latex(eq1)
simplifies the equation to $$\frac{2}{5} x + 4 = -\frac{15}{7} x + \frac{18}{7}$$
is there something like latex(eq1.hold()) that would produce
$$\frac{2(x+3)}{5}=\frac{3(6-5x)}{7}$$
edit:
I must apologize in advanced as my code may seem infantile but I am very new to this and trying to learn. That said, I was able to get something going but it seems to me there must be a million better ways to do this. Can you point me in the right direction to generalize this process and improve this code. Keep in mind the point of this is to write a student worksheet with problem sets and solutions. can be seen here [link text](https://sagecell.sagemath.org/?z=eJydUk2P2jAQvSPxHywXae18LeHrQJuVeqmE1ENBvREOXnDAlbFZ27Rmq_3vHQfYBKRKVS_O8ObNmzfDGIEKJNn-ecOQT05ThCqptSFGH9WGGKY2ek9oRE6pp7Gn9GO3s-EVVDjuvwrrZgSq6BQZ7o5GIZxlWYLjU_ZDC0VwD8fWGVKzCaM0BgRV2iCGhEKgiBMowCD6Lnhn51-VkABTXBFPn_qIS8sRwkqDLSaR1fLohFY2NGL2711QaBHU0X9JC7sIWCM9Rd_NkYf6WiCowwqLovmRGX6QbM0JFjhBWAiBW9gsYLPZDIOjuvEXBu_lL2CHg9GetJaPliwzO0topshGbIWzxYQ2k5xWUPkB5k1ei5_MEOzRCb1iWqPgej5fPviHVdbvdhbZJ_8E0DctT0rvBZMLobZkPg9kaSGzNIKk4yTNaQJRngzr7yDJx00Q-pkrGZB-nUqH16p0kqSDW3oYrD4ExZn5TFzrsnplWRm2_t0-BLfsr8ItlKXklSO3qbxOxbfgoAZ9WRqx3Tn6dic3rNNvPXzxYtmWt834y-Zga-9bDyaiul8c9CNPH4MQKHQ7_CWH-VsTSQv6BY5bkLFhq_xlAMx2P6AWRRu4EodABHok13sgQavEhPecHBVASH0E7-UY1ppXlVgLrhxcXE0aA2mUEngyGTg0s8dn64Q7Ok580acX8xPgjSOSP8LnzLxTOxO7nZ3bS5DLabdjd_oXhIMmHDbhqAnHTTihQeMPn4JaLg==&lang=sage)
ri = lambda x,y: floor(round(random()*(y-x)+x)); #random integer from x to y
ls = [ri(-5,-1),ri(1,3),ri(2,15),ri(2,15)];
rs = [ri(2,10),ri(-3,-1),ri(-6,-2),ri(2,15)];
def texLinearA(t): return "$\\frac{"+str(latex(t[0]))+"\\left("+str(latex(t[1]))+"+"+str(latex(t[2]))+"x\\right)}{"+str(latex(t[3]))+"}$";
def sageLinearA(t): x=var("x"); return t[0]*(t[1]+t[2]*x)/t[3];
eq1 = texLinearA(ls)+"="+texLinearA(rs);
eq2 = sageLinearA(ls)==sageLinearA(rs);
eq3 = eq2*lcm(ls[3],rs[3]);
eq4=eq3-x*eq3.rhs().coefficient(x);
eq5=eq4-(eq4.lhs()).substitute(x=0);
eq6=eq5*(1/eq5.lhs().coefficient(x));
html(eq1);
show(eq2);
show(eq3);
show(eq4);
show(eq5);userXSun, 26 Oct 2014 22:02:29 -0500http://ask.sagemath.org/question/24637/