Skip to main content
10 votes
Accepted

Remove subscript from string

A slightly more general version of JasonB's solution: ...
glS's user avatar
  • 7,673
10 votes
Accepted

How to avoid Replace substituting subscripts?

The real solution here is not to use B in a subscript, or better: not to use Subscript at all. If you can't or don't want to do ...
Szabolcs's user avatar
  • 236k
8 votes

Remove subscript from string

This would need to be modified for other forms, but it does what you are asking ...
Jason B.'s user avatar
  • 69k
7 votes
Accepted

An alternative to subscripts?

An alternative to subscripts as indices... Instead of: {Subscript[x, 1], Subscript[x, 2]} Let's use: x[1], x[2] And this ...
jackzellweger's user avatar
7 votes
Accepted

How to "clear" the downvalues of a subscripted variable?

This will remove all DownValues of Subscript that contain the symbol aa: ...
Michael E2's user avatar
  • 238k
7 votes

Does using subscripted variables decrease the performance of Mathematica?

Subscripts are generally more trouble than they are worth and cannot be used as variables. You can use Format to display variables as if subscripted. ...
Bob Hanlon's user avatar
  • 160k
7 votes

Remove subscript from string

The most straightforward approach is to convert your string representation of boxes into explicit boxes, and then apply a replacement rule. The internal function which does this was uncovered by John ...
Alexey Popkov's user avatar
7 votes

Unexpected interpretation of a variable with subscripts

A couple possible alternatives: Use "g" in the subscript instead: Subscript["g", 1] Subscript[g, 1] You can't tell the difference in ...
Carl Woll's user avatar
  • 131k
7 votes
Accepted

How to save/load (export/import) symbolized variables?

You could just save global variables and Subscript: Save[file, {"`*", "Subscript"}] If you really want to use the ...
Carl Woll's user avatar
  • 131k
7 votes

How to stop Mathematica from deriving index?

This can be solved by applying custom formatting to kx rather than using Subscript: ...
eyorble's user avatar
  • 9,488
6 votes

Remove subscript from string

ToString /@ ((Row[{##}] & @@ ToExpression[#, InputForm]) & /@ gases) {"Air", "He", "Ar", "N2", "CO2"} Not safe if <...
Kuba's user avatar
  • 137k
6 votes

Remove subscript from string

A string replacement method using the two lines obtained from ToString with mainly StringPosition and ...
Edmund's user avatar
  • 42.4k
6 votes
Accepted

Unexpected interpretation of a variable with subscripts

Mathematica does not evaluate expression like any other language I can think of. To use it successfully you will have to adjust to that fact. Subscript[g, 1] in ...
m_goldberg's user avatar
  • 108k
6 votes
Accepted

Variables with both super-subscripts on the same vertical axis

Use Subsuperscript: Subsuperscript[f, a, b] // Style[#, 20] & Keyboard shortcut (thanks: BobHanlon):
kglr's user avatar
  • 398k
6 votes
Accepted

How to clear a function with subscript?

Subscript[f, n_][x_] := x f[x - 1] + n; Subscript[f, n][x] Clear[Subscript] Subscript[f, n][x]
cvgmt's user avatar
  • 77k
6 votes

Apply central difference formula to a variable twice

You can use DifferenceQuotient and Format as follows: ...
kglr's user avatar
  • 398k
6 votes

Work around for subscripts and superscripts in text cells reverting to SuperScript[...]

This below is using V 14 on windows 10 pro. You need a space between them. So you can work around this by inserting VeryThinspace between them,. Like this So instead of this Do this Note that ...
Nasser's user avatar
  • 146k
5 votes
Accepted

How do I get Mathematica to invert a matrix with subscripts involved? (Subscript usage)

Rewrite your matrix (notice I'm fixing a the erroneous Subscript[towpx^2, i] that should be Subscript[towpx, i]^2. ...
rhermans's user avatar
  • 36.8k
5 votes
Accepted

assign 2 letters in a subscript

Use Equal rather than Set in an equation. I recommend that you use Format to display the ...
Bob Hanlon's user avatar
  • 160k
5 votes

assign 2 letters in a subscript

https://reference.wolfram.com/language/ref/Subscript.html Array[Subscript[a, #1, #2] &, {3, 3}] // MatrixForm
Chris Degnen's user avatar
5 votes
Accepted

Problems with Subsuperscript and Subscript Combination

When you type in a notebook the expression Style[ Subsuperscript[Subscript["E", 0] [τ], m, a]/ Subsuperscript[Subscript["E", 0][N], m, m], FontSize -> 28 ] ...
Jack LaVigne's user avatar
  • 14.5k
5 votes

Automatic variable naming

Subscripts are evil. Why don't you use an Association? This would get you rid of the whole numbering business. This could look like this: ...
Henrik Schumacher's user avatar
5 votes
Accepted

Is there a way to use a subscript as variable?

I would strongly recommend not using Subscript. One should think of Subscript as a typographical construct (which can be abused to use subscripting of a variable). Better is to use: ...
SHuisman's user avatar
  • 3,448
5 votes
Accepted

Symbolized, Subscripted Variable Doesn't Look Pretty

Assuming I understand your question the short answer is to produce your Symbols like this: ...
Mr.Wizard's user avatar
  • 272k
5 votes

How to extract the subscript from a variable?

If you have a variable y=Subscript[x, 1]; then to extract the index it suffices to do y[[2]] which in this case returns 1 as ...
Hans Olo's user avatar
  • 1,838
5 votes
Accepted

Apply central difference formula to a variable twice

You've made a bad design. The output of your CentralDiff is a complete difference formula, but the inputs of CentralDiff are ...
xzczd's user avatar
  • 67k
4 votes

The partial derivative symbol with subscript - what does it mean and how do I type it?

In Mathematica, $\partial_{b, c, \dots} a$ is completely equivalent to D[a, b, c, ...]. It's just a different notation. What follows the $\partial$ sign is the ...
Szabolcs's user avatar
  • 236k
4 votes

Mathematica can't differentiate when variable name has subscript component

You can use the Notation` package to get $x_p$ treated as a symbol. ...
m_goldberg's user avatar
  • 108k
4 votes

Mathematica can't differentiate when variable name has subscript component

A subscripted symbol is an expression involving the symbol. It is not a new symbol. Here is what you are asking Mma to do: D[Times[2, Subscript[x, p]], x] This ...
Alan's user avatar
  • 13.8k
4 votes
Accepted

Symbolic ticks with subscript - ListPlot

...
kglr's user avatar
  • 398k

Only top scored, non community-wiki answers of a minimum length are eligible