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.Thu, 30 Sep 2021 14:30:26 +0200Use LaTeX symbols (like \prime) in variableshttps://ask.sagemath.org/question/59203/use-latex-symbols-like-prime-in-variables/ So as we know declarations such as `theta=var("theta")` when output as LaTeX, they're automatically converted to corresponding LaTeX symbols (`$\theta$` in this case), but it makes me wonder is it possible for us to use more complicated symbols? Like `thetaprime=var("\\theta\\prime")` (which obviously doesn't work, I've tried), but I would like to achieve something like this, so when I call `latex(eq)`, all `thetaprime` variables are converted to `$\theta\prime$`.andrewygThu, 30 Sep 2021 14:30:26 +0200https://ask.sagemath.org/question/59203/how to bold and embiggen variable using latex_namehttps://ask.sagemath.org/question/57515/how-to-bold-and-embiggen-variable-using-latex_name/ I am attempting to recreate variables and expressions from an academic paper.
I would like to be able to calculate with the variables/expressions and to typeset
them using Latex.
Here is what is working in Command-Line, CoCalc, jupyter notebook but not SageMath Cell (which
just show a blank after evaluation):
P = var('P', latex_name='\mathscr{P}'); view(P)
An uppercase cursive/script P is shown.
If I try to em-bold it, like so:
P = var('P', latex_name='\bold\mathscr{P}'); view(P)
Then:
1) Command line SageMath produces about 200 lines of error message beginning with:
An error occurred.
This is pdfTeX, Version 3.141592653-2.6-1.40.22 (TeX Live 2021) (preloaded format=pdflatex 2021.6.3) 9 JUN 2021 13:50
...
2) SageMath cell server -- using doubled '\\'s -- again, produces blanks after evaluation
3) CoCalc -- again, using doubled '\\'s -- outputs "\bold" followed by a properly typeset cursive-script uppercase P
4) jupyter notebook produces 200+ error message lines beginning with:
An error occurred.
This is pdfTeX, Version 3.141592653-2.6-1.40.22 (TeX Live 2021) (preloaded format=pdflatex 2021.6.3) 9 JUN 2021 13:56
So...it may well be that using the MacOS 9.3.rc4 has issues, or that I have failed to properly install MacTex
but CoCalc should work -- if only I input the correct argument.
I apologize if this is/seems like a RTFM situation.
enthorWed, 09 Jun 2021 23:00:51 +0200https://ask.sagemath.org/question/57515/latex_name and derivatives in sagemanifoldshttps://ask.sagemath.org/question/55540/latex_name-and-derivatives-in-sagemanifolds/Hi,
I think there is a small bug on displaying derivatives of tensors w.r.t a parameter with latex_name.
For symbolic expressions,
from sage.manifolds.utilities import ExpressionNice
var('t')
dq1 = function('dq_1', latex_name=r'\dot{q}_1')(t)
L = function('L')(dq1)
ExpressionNice(diff(L,t))
works nicely. However, when I define the same `L` as a scalar field (or any tensor),
M = manifolds.Minkowski()
L1 = M.scalar_field(L)
L1.derivative().display()
the latex_name is ignored and `dq_1` is used instead. The problem does not occur when there is no index in dq.cav_rtMon, 01 Feb 2021 22:00:37 +0100https://ask.sagemath.org/question/55540/simplify and latex_namehttps://ask.sagemath.org/question/10122/simplify-and-latex_name/In a notebook (with typesetting enabled), whenever I apply simplify to a simbolic function, the result is expressed in terms of the identifier of the function, rather than its latex name.
For example,
var('x')
my_func = function('df',x,latex_name='\Delta f')
my_func
returns ?f(x)
but
my_func.simplify()
returns df(x)
Is there any retain the latex name throughout simplification?bolverkWed, 15 May 2013 00:42:01 +0200https://ask.sagemath.org/question/10122/