-3
$\begingroup$

Is it so necessary that every equation is enclosed by a whole bunch of $\ce{ }$? Could we have something shorter to make posts more readable in raw format?

If we could, do you have any idea how to do it?

$\endgroup$
5
  • 3
    $\begingroup$ I find \ce{} to be pretty short and unobtrusive. It's not necessary, but it lends a uniform formatting. $\endgroup$ – ManishEarth Sep 21 '14 at 23:03
  • $\begingroup$ $A_2B_3C_4D_5E_6$ = $A_2B_3C_4D_5E_6$ and $\ce{A2B3C4D5E6}$ = $\ce{A2B3C4D5E6}$ $\endgroup$ – RE60K Sep 22 '14 at 8:34
  • 4
    $\begingroup$ You'll quickly realize that $\ce{ }$ is indeed shorthand with respect to the alternative... $\mathrm{ }$ (the latter needed for every string you want to de-italicize). $\endgroup$ – LordStryker Sep 22 '14 at 19:04
  • $\begingroup$ It could always be worse @LordStryker... $\endgroup$ – Tomáš Zato - Reinstate Monica Sep 22 '14 at 19:40
  • $\begingroup$ @LordStryker I think that's pretty much the answer if you'd like to add it. The only thing I would say is that it's part of the mhchem add-in, and I don't think there's much we can do on our end to modify it. $\endgroup$ – jonsca Sep 23 '14 at 18:06
5
$\begingroup$

The mhchem package which is implemented here on SE:Chem provides the $\ce{ }$ functionality and this command is actually the shorthand way of having text appear normally in mathmode. Consider the use of $\ce{ }$ and then consider the alternative.

Shorthand

$\ce{CH_3CH_2OH}$

$\ce{CH_3CH_2OH}$

Painful way

$\mathrm{CH}_3\mathrm{CH}_2\mathrm{OH}$

$\mathrm{CH}_3\mathrm{CH}_2\mathrm{OH}$

With one short command, ALL of the text is 'normal' in math mode whereas something like \mathrm or \textrm has to be explicitly spelled out for every string not in a series.

Other Details

The command $\ce{}$ could potentially be shortened but only by one character. The $ symbols are inherent to TeX syntax and indicates the beginning AND end of math mode. This cannot be eliminated. Most commands in TeX start with a \ and therefore cannot be eliminated. The brackets { } are needed in order to encapsulate the argument being passed to \ce. Perhaps you want normal text AND math mode text. You would only put in the brackets what normal text you wanted. Therefore, the only other available option to shorten this code is to use a single letter as opposed to two but \x type commands are usually reserved for special purposes or are already taken in TeX (or it may not even be allowed at all, I'm not sure).

$\endgroup$
5
  • $\begingroup$ I still can't see why the 7 characters are necessary here, where formulas are almost in every post. It's like having 7 character code for true type text on StackOverflow. $\endgroup$ – Tomáš Zato - Reinstate Monica Sep 23 '14 at 20:52
  • $\begingroup$ @TomášZato You ought to think about joining the mchem development team and implementing your idea. $\endgroup$ – LordStryker Sep 23 '14 at 21:07
  • $\begingroup$ Any kind of shortcut I have in mind is out of mchem or mathjax. I expected something like [[FORMULA]], where our own script would format the formulas for MathJax/mchem. It would also improve readibility of raw post. $\endgroup$ – Tomáš Zato - Reinstate Monica Sep 23 '14 at 21:09
  • 1
    $\begingroup$ @TomášZato I guess I've been using LaTeX for so long now that I don't even see the code. All I see is the fraction here, integral there, and derivative over there... $\endgroup$ – LordStryker Sep 24 '14 at 11:31
  • 1
    $\begingroup$ In \ce{...} the _ are not necessary. I personally believe that [[CH4 + Br2 <=> CH3Br + HBr]] is equally painful to type and read as the already implemented mhchem module $\ce{CH4 + Br2 <=> CH3Br + HBr}$ Apart from this, MathJax takes care of spacing and it is possible to combine math with chemical formulas. Implementing a new script would kill that functionality. I also do not understand why the raw text has to be well readable. $\endgroup$ – Martin - マーチン Sep 30 '14 at 10:35

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .