ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Wed, 14 Jun 2023 20:11:23 +0200Failing render of long latex expression in jupyter notebook.https://ask.sagemath.org/question/69165/failing-render-of-long-latex-expression-in-jupyter-notebook/ I have a ridiculously long latex expression in a jupyter notebook that does not render. Does anybody know if/how to expand the accepted latex expression length so it might render? It's 10547 characters long.BobBWed, 14 Jun 2023 20:11:23 +0200https://ask.sagemath.org/question/69165/How to flip normals of Graphics3d faces?https://ask.sagemath.org/question/61908/how-to-flip-normals-of-graphics3d-faces/Is there an easy way to flip the normals for all the faces of a `sage.plot.plot3d.base.Graphics3d` or `sage.plot.plot3d.base.Graphics3dGroup` object?
I checked the source of https://github.com/sagemath/sage/blob/develop/src/sage/plot/plot3d/base.pyx but couldn't find any answers there.
### Background:
I am generating a 3-dimensional surface on the YZ plane via `sage.plot.plot.parametric_plot` using long-running functions and want to mirror this surface by the XY plane to produce a final mesh which includes both the original and mirrored surfaces.
mySurface = parametric_plot(
[
0,
lambda u, v: longRunningYFunction(u, v),
lambda u, v: longRunningZFunction(u, v)
],
...
)
The reason I want to mirror the original surface instead of regenerating it is because the long-running functions take a very long time to complete, so doing it this way effectively cuts down the processing time in half.
I tried a few ways to mirror the surface:
- Rotating by `180°` around the Y axis
mirroredSurface = mySurface.rotateY(pi)
- Scaling by `-1` in the Z direction:
mirroredSurface = mySurface.scale([1, 1, -1])
and when I display or write both surfaces it looks ok:
show(mySurface + mirroredSurface)
but when inspected more closely, the normals of `mirroredSurface` are in the opposite direction of `mySurface`. This requires me to manually flip the surfaces with Blender.
### Question:
Is there any extension or function I can apply on the `Graphics3d` object `mirroredSurface` that would flip all the surface normals?
Something like the following?
mirroredSurface.flip_normals()
# or
flip_normals(mirroredSurface)
Dan-KSun, 10 Apr 2022 23:53:00 +0200https://ask.sagemath.org/question/61908/Render LaTeX expression in SageMath 9.3https://ask.sagemath.org/question/57396/render-latex-expression-in-sagemath-93/ In SageMath up to version 9.2 calling a cell consisting of the line show(LatexExpr(r'\infty')) in a Jupyter notebook would display the infinity symbol using LaTeX rendering. In SageMath 9.3 it displays the LaTeX string itself. How do I revert to the previous behavior?
This is unrelated to whether or not one has set %display latex. The command view is not an option because it opens a separate viewer which is not what I want.
Since this change of behavior breaks a lot of my notebooks, any help is much appreciated.CBaerWed, 02 Jun 2021 08:53:35 +0200https://ask.sagemath.org/question/57396/how to render a latex string in a notebook cellhttps://ask.sagemath.org/question/52357/how-to-render-a-latex-string-in-a-notebook-cell/Say we have a string variable `s = "some context: $x = 3$"`. The string s is rather simple latex, but is not just an equation. I would like to display the typeset version of `s` in a notebook cell, without having to retype the string by hand in the cell. Thanks for any help.jbaxterMon, 06 Jul 2020 17:03:24 +0200https://ask.sagemath.org/question/52357/Error rendering 3d scenehttps://ask.sagemath.org/question/29510/error-rendering-3d-scene/I'm working in the SageMath Cloud. The code block
x,y,t = var('x,y,t')
f = lambda x,y: x*abs(y)/sqrt(x^2+y^2) if (x,y)<>(0,0) else 0
a,b = 1,6
e = 0.1
parametric_plot3d( [b*t, -a*t, f(b*t,-a*t)], [t,-e,e], color="yellow", size=15 )
produces an error message:
error rendering 3d scene -- error downloading /blobs/682b952d-d577-45ce-98ff-4e7a06ddad32.sage3d?uuid=682b952d-d577-45ce-98ff-4e7a06ddad32
But if I change the fourth line to `e = 1`, then it works just fine.
A similar error was reported in http://ask.sagemath.org/question/27300/error-rending-3d-scene, but the fix there was easier.
Jeremy MartinSun, 20 Sep 2015 14:03:28 +0200https://ask.sagemath.org/question/29510/Is there a function to render latex or html in a notebook from a string ?https://ask.sagemath.org/question/7769/is-there-a-function-to-render-latex-or-html-in-a-notebook-from-a-string/Some user-interface method are:
1. set the "typeset" flag at the top of the notebook.
2. Use %html or %latex in the beginning of a cell.
3. Use "shift+click" to open a new "tinymce" cell (for both: latex and html and more)
or code can be called like:
1. view(...some sage expression...): to produce rendered latex
2. print '...some html...no latex....': renders html without latex
I'm looking for a "render" command like
render('< html > < b > Header < /b > < p >Some $ x ^ 2 $ formula< /p >< /html >')
for mix html and latex formulas.
Maybe calling tinymce functionality from my code, but how ?
**Header**
Some $ x ^ 2 $ formula.
PedroSat, 20 Nov 2010 13:08:27 +0100https://ask.sagemath.org/question/7769/