Questions tagged [subscript]

A subscript is a number, figure, symbol, or indicator that is smaller than the normal line of type and is set slightly below the baseline.

Subscripts are common in mathematical notation (generally indicating position, such as the index of a variable in a vector) and chemistry formulas (e.g. H2O).

Subscript and superscript (Wikipedia)

625 questions
16
votes
6 answers

How to create vertically aligned superscript and subscript in TextView

In the example of image below: How can I make both the superscript and subscript numbers to be aligned to produce a common scientific notation like below in TextView? If there is a way using Spannable or ReplacementSpan I would like to see a…
Neoh
  • 15,906
  • 14
  • 66
  • 78
14
votes
5 answers

How to convert Int to String.CharacterView.Index

This is driving me nuts. In Swift 2.2, it makes it impossible to subscript String with Int. For example: let myString = "Test string" let index = 0 let firstCharacter = myString[index] This will result with a compile error, saying 'subscript' is…
nekonari
  • 480
  • 1
  • 6
  • 13
13
votes
8 answers

how to add subscript(or superscript) in notion block?

i am new in using notion as a notebook.Before this,i use oneNote instead,because i found that notion is more convinient in same ways.But one thing making me annoyed is that i can't add subscript(or superscript) in notion text block。Are there any…
sayno
  • 131
  • 1
  • 1
  • 4
13
votes
4 answers

c++ two versions of overloading subscript operator

My question is about the difference between: const T& operator[](const int nIndex) const; and: T& operator[](const int nIndex); Why would I need both of them defined in a class, what's the purpose? Wouldn't the latter suffice?
Simon Righley
  • 4,538
  • 6
  • 26
  • 33
12
votes
4 answers

UTF8 symbols for subscript letters

I have been looking online for the UTF8 character table. And all I could find for subscripts were numbers 1 to 9 and some of latin letters. I need to find S and B as subscripts for UTF8 Thanks for the help. here is the link for a UTF8 character…
Don Code
  • 781
  • 3
  • 12
  • 25
11
votes
3 answers

How can I subscript names in a table from kable()?

Given a data.frame A, how can I use subscripted rows and columns names? Eventually I want produce a table through kable() in rmarkdown (output: word document). A <- data.frame(round(replicate(3, runif(2)),2)) rownames(A) <- c("Hola123",…
AJMA
  • 1,134
  • 2
  • 13
  • 28
11
votes
8 answers

How can I fake superscript and subscript with Core Text and an Attributed String?

I'm using an NSMutableAttribtuedString in order to build a string with formatting, which I then pass to Core Text to render into a frame. The problem is, that I need to use superscript and subscript. Unless these characters are available in the font…
jowie
  • 8,028
  • 8
  • 55
  • 94
11
votes
4 answers

Overloading subscript operator "["

I am trying to overload the subscript operator ("[") for a custom class I've created. I am trying to figure out how to deal with the following issues. How can you figure out if the operator is on lhs or rhs ? i.e. a[x] = foo vs foo = a[x] When…
Pavan Yalamanchili
  • 12,021
  • 2
  • 35
  • 55
10
votes
4 answers

How to trim characters in Python?

Very new to Python and have very simple question. I would like to trim the last 3 characters from string. What is the efficient way of doing this? Example I am going becomes I am go
Amy W
  • 111
  • 1
  • 1
  • 3
10
votes
4 answers

Type Has No Subscript Members?

I get the error "Type 'Ship' has no subscript members when I try to do: var coor = ship[index] I tried to do var coor = ship?[index] as? Coordinate But I get this error: "Cannot use optional chaining on non-optional value of type 'Ship'" Here's my…
Mr_CryptoPrime
  • 628
  • 2
  • 11
  • 25
10
votes
2 answers

How can I use a super-or-subscript tag in a HTML select option's display text?

I have a dropdown field like this: Can I use a superscript tag like this?