Preventing Square Brackets from Italicizing in Mathematical Expressions

  • Thread starter Stephen Tashi
  • Start date
In summary, the conversation discusses different ways to prevent an array index "i" from being interpreted as code and italicizing text by the forum editor. The suggested workarounds include adding a space before the "i" in Latex expressions, using different symbols, and adding spaces in the source code. The main issue is the lack of communication between MathJax and XF BBcode.
  • #1
Stephen Tashi
Science Advisor
7,861
1,599
What's the simplest way to prevent an array index "i" inside square brackets in a mathematical expression from being interpreted as code to italicize text by the forum editor?

My work around is to put a space before the "i" in Latex expressions, but this is slightly inconvenient.

For example [itex] A[\ i][j] = \beta [/itex] displays properly.

and [itex] A[j] = \beta [/itex] doesn't.
 
Physics news on Phys.org
  • #2
[plain][i][/plain]
[i[b][/b]]
[^{}i]

Choose your favorite one. They all work:
##[i]
[i]
[^{}i]##
 
  • #3
The is an unfortunate problem with MathJax and XF BBcode not communicating with each other.
 
  • #4
mfb said:
[plain][i][/plain]
[i[b][/b]]
[^{}i]

Choose your favorite one. They all work.

Also \left[ i \right].

[tex] \left[ i \right]. [/tex]
 
  • #5
Everything that breaks the string [i] in the source code.
I just noted it is as easy as adding spaces (not LaTeX spaces): [ i ] becomes ##[ i ]##
 
  • Like
Likes DrGreg

Related to Preventing Square Brackets from Italicizing in Mathematical Expressions

1. How do I prevent text from being italicized?

To prevent text from being italicized, you can use the font-style: normal; CSS property. This will override any existing font-style property and display the text in a normal, non-italicized font.

2. Can I prevent a specific word or phrase from being italicized?

Yes, you can prevent a specific word or phrase from being italicized by wrapping it in a <span> tag and applying the font-style: normal; CSS property to that <span> element.

3. Why is my text being automatically italicized?

There are a few possible reasons for this. It could be due to a font-style: italic; CSS property being applied to the text, or it could be part of the font itself. You can override this by using the font-style: normal; CSS property.

4. Can I prevent italics from being applied to a specific element?

Yes, you can use the font-style: normal; CSS property to prevent italics from being applied to a specific element. This will override any font-style: italic; property that may be inherited from a parent element.

5. How can I prevent my text from being italicized on certain devices or screen sizes?

You can use media queries in your CSS to target specific devices or screen sizes and apply the font-style: normal; property to prevent italics on those devices or screen sizes. This gives you more control over how your text is displayed on different devices.

Similar threads

  • Programming and Computer Science
Replies
9
Views
1K
  • Special and General Relativity
Replies
1
Views
709
  • Engineering and Comp Sci Homework Help
Replies
10
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
3
Views
325
  • Engineering and Comp Sci Homework Help
Replies
8
Views
1K
  • Programming and Computer Science
Replies
7
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
  • Feedback and Announcements
Replies
4
Views
2K
  • Programming and Computer Science
Replies
2
Views
1K
Back
Top