Message Boards Message Boards

0
|
3697 Views
|
1 Reply
|
0 Total Likes
View groups...
Share
Share this post:

Replacing \hbar occurrence in Latex for Mathematica input?

Posted 2 years ago

I need to understand how to convert the following Latex so Mathematica can accept some alternative version of \hbar such as {HBar], ℏ or hbar:

$\frac{m_{e}}{2 \pi \frac{\hbar}{m_{e} c^{2}}} \cdot \frac{c^{2} \frac{\hbar}{m_{e} c}}{2 G m_{e}}$

I've tried replacing it with {HBar], ℏ, hbar and \operatorname{hbar} none of which work when I paste the string as Latex into Mathematica. Putting just plain hbar inplace of \hbar results in the product of variables h b a r

For instance, \hbar results in the error:

The wrong number of arguments (1) was given to a box ("FractionBox") in the BoxForm of the expression. Check the format rules for the expression.

However, alpha handles it properly:

enter image description here

POSTED BY: James Bowery
Posted 2 years ago

I found I could use \mathrm{hbar} to get "hbar" accepted as a variable name.

POSTED BY: Updating Name
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract