Is is possible to use the LaTeX \tensor command?

There is a LaTeX package called “tensor”, which defines two commands “\indices” and “\tensor” for typesetting tensors with horizontally spaced mixed upper and lower indices. I would like to know whether the same function can be achieved in Obsidian.

What I’m trying to do

I would like to have the “\tensor” command as in LaTeX with the “tensor” package. For example, $\tensor{T}{^\mu_\nu^\rho}$ should produce a tensor with mixed indices.

Things I have tried

There is a plugin called MathJax Extended which seems to do the job, but I don’t really know what to put into the “preamble.sty” file.

Could you share a screenshot of how it looks in Latex?

tensor
Sure! Here’s a screenshot. This is generated by the tex code $\tensor{T}{^\alpha_\beta^\gamma}$. Sorry I didn’t post it at first.

Using the typst-renderer plugin, you can include arbitrary typst packages.

For example, by adding #import "@preview/physica:0.9.3":* to the typst-renderer preamble, you can access the tensor command. For example, the following

$tensor(Gamma,+i,-j,-k) = -pdv(e^i,x^j) e_k$

will render as
image

That seems indeed very complicated to achieve without that package.

Maybe this thread can help you

Here is an example of loading the physics package

$$\require{physics}$$

$$F = \dv{p}{t}$$

But I don’t know what package to load for tensor.

The solution that @haemeah gives could work for you.

However I was interested myself to recreate it with Mathjax (and therefore it should be compatible with LaTeX) and I found this relatively simple solution. Although if you have to use this often it is better to have the plugin of course.

$$
{}_{\alpha} {}^{\beta\phi} T {}_{\alpha} {}^{\beta\phi} {}_{\gamma\pi}
$$

Does this mean that I have to use both typst and LaTeX grammar? I’ve never used typst before.

I guess this is what I’m suppose to do, but I’m a noob at editing the plugin and stuff. I’ll learn about it later, and if I figure out a solution I’ll post it here.

I’ve found a simple solution: ${{T^{\alpha}}_{\beta}}^{\gamma}$ will generate a symbol similar to the screenshot given above.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.