Sciencemadness Discussion Board

Subscript

bfesser - 15-2-2011 at 14:39

Would it be possible to have a subscript button added to the posting/editing form, for those of us who are unaware or incapable of the HTML markup for it? It might help the "kewls" to be less "kewl", and would make formulae easier to read for the rest of us. :)

For those who aren't familiar; typing H&lt;sub&gt;2&lt;/sub&gt;O will appear as H<sub>2</sub>O when posted.

[Edited on 2/15/11 by bfesser]

Sedit - 15-2-2011 at 15:15

Thanks Bfesser because on other forums I use command but it does not work here so I dont bother although I think it makes reading the formulas much simpler.

hissingnoise - 16-2-2011 at 03:43

H<sub>2</Sub>SO<sub>4</sub> ---It does work here but who can be bothered?
Then again . . .
It doesn't help on patents!


[Edited on 16-2-2011 by hissingnoise]

Arthur Dent - 16-2-2011 at 17:21

@ bfesser: Hey thanks for the tip dude, didn't know that one!

Let's try this... C<sub>16</sub>H<sub>21</sub>NO<sub>3</sub>

Neat! :D

Robert


[Edited on 17-2-2011 by Arthur Dent]

bfesser - 28-2-2011 at 15:06

Polverone; any comment?

mr.crow - 11-3-2011 at 12:58

Any modern forum software would have a nice little Javascript text formatting editor. Basically you select some characters, press a button and it puts the SUB around your selection. Also makes it easier to add links and images

Relevant HTML

bfesser - 26-2-2012 at 09:00

Quick code to remember:

&amp;rarr; produces &rarr;
&amp;uarr; produces &uarr;
&amp;darr; produces &darr;
&amp;deg; produces &deg;
&amp;micro; produces &micro;
&amp;middot; produces &middot; as in MgSO<sub>4</sub> &middot; <em>n</em>H<sub>2</sub>O
&lt;sub>subscript&lt;/sub> produces<sub>subscript</sub>
&lt;sup>superscript&lt;/sup> produces<sup>superscript</sup>

[used in this post]
&amp;amp; produces "&" without invoking it as markup, as in &amp;amp;
&amp;lt; produces "<" without invoking it as markup, as in &lt;sub>
Witout using these codes, your browser will try to interpret the code as markup. This can also be avoided by using the BB Code &#91;code]&#91;/code] available by hitting the <strong>#</strong> button above the primary text box in reply mode.

[Edited on 2/26/12 by bfesser]

Neil - 26-2-2012 at 09:09

Usefull post thank you.

AirCowPeaCock - 26-2-2012 at 12:48

Would it be possible to represent both a subscript and superscript directly above and bellow eachother. It would only be marginally useful on this forum, but still...

bfesser - 26-2-2012 at 18:32

Yes, but it requires CSS. I'm a little tired tonight, but tomorrow morning--if I remember--I'll revise this post with the necessary code.

Bot0nist - 26-2-2012 at 19:35

Thanks bfesser. My HTML was a bit rusty. I always used sup and sub, but the rest were very helpful.

bfesser - 8-3-2012 at 21:04

Quote: Originally posted by AirCowPeaCock  
Would it be possible to represent both a subscript and superscript directly above and bellow eachother. It would only be marginally useful on this forum, but still...


I haven't forgotten about this question. I took some time to think about it, and came up with the answer that there is no clean way to do it without resorting to a monospace font. Then I did some quick research online, and the consensus appears to be that there is no good way to do it. Sorry.

You could use an HTML table&mdash;which is a big webdesign no-no for something like this.
Or, you could use relative positioning with CSS, but it gets ugly with font variations and the horizontal positioning. Think monospace font.
Or, you could resort to <a href="http://tex.stackexchange.com/questions/8255/superscript-and-subscript-together" target="_blank">LaTeX</a>.
Finally, you could use <a href="http://www.xml-cml.org/" target="_blank">CML</a>, which, so far as I'm aware, will work for no-one.

[Edited on 3/9/12 by bfesser]

Hexavalent - 20-6-2012 at 08:04

Test some of these out...

&micro
&deg
&middot

Very nice, would it be possible to have this list next to our 'Quick Reply' box next to, e.g. the smileys?

I can't seem to get the arrow ones to work though...?


[Edited on 20-6-2012 by Hexavalent]

watson.fawkes - 20-6-2012 at 08:19

Quote: Originally posted by Hexavalent  
I can't seem to get the arrow ones to work though...?
As a rule, HTML entities (the lingo for these abbreviations) require a semicolon at the end. That is, use "&amp;micro;" rather than just "&amp;micro" for "&micro;".

The problem with these for arrows is that entities are just single characters, which have glyphs that are about the width of a single character. Proper arrows are wider than that. A BBCode tag for "rightarrow" could be implemented that puts the requisite number of characters in place, but that would require new code, and new code on a legacy codebase that's planned to be scrapped. You can, however, use "&amp;rarr;" to generate "&rarr;", which looks awful to me; the shaft is not long enough and the head is too small.

Hexavalent - 20-6-2012 at 13:49

I guess so, but for most, general purposes &rarr; should be sufficient to demonstrate that a reaction is taking place and to differentiate between reactants and products; IMO, it still looks better than ---->.

For a reaction where more detail needs to be given, e.g. you're showing an organic reaction and want to include notes about reaction temp., catalysis etc. above the arrow then it can always be made in free programs such as ChemSketch (an excellent program for organic work BTW).