# Chemical Forums

## General Forums => Comments for Staff and Comments from Staff => Topic started by: Borek on May 26, 2012, 03:00:29 PM

Title: How to properly format posts at Chemical Forums
Post by: Borek on May 26, 2012, 03:00:29 PM
Chemical Forums aims at helping chemistry students. That means many of the questions posted require use of formulae - either chemical ones (like H2PO4-) or mathematical ones (like $E = E_0 + \frac {RT}{nF}\ln Q$). You may even need to use a structural formula like

To make your questions easier to understand for others, please do your best to properly format your posts, it increases your chances of getting a correct and fast answer. Entering structural formulae that are displayed as images is covered in the next post in this thread.

In general the best way to format chemical formulae is to use subscripts and superscripts. For example to enter formula of water you can enter it as H2O, mark 2 and click sub button placed in the second row of icons above the edit field. It will add [sub][/sub] tags around 2 so that it will be displayed as 2, and water formula will be displayed as H2O. Similarly you can use sup button to format charges with [sup][/sup] tags. To make things faster some of the most often used numbers are also present in the line Other symbols: above the edit field. While technically it is possible to enter chemical formulae using LaTeX, it is not recommended.

To enter some simple symbols like ° for temperature, middle dot for water of crystallization, Greek letters in the text and arrows, just click their symbols above the edit field.

Mathematical formulae should be entered using LaTeX. To enter formula that will stay in its own line surround it with [tеx][/tеx] tags, to enter formula that will stay inline surround it with [itеx][/itеx] tags. (It is also possible to use double \$ and double # delimiters you may know from the LaTeX, but once again, we don't recommend it). There are many LaTeX tutorials on the web, and many quite comprehensive documents describing LaTeX use (like this one: http://en.wikibooks.org/wiki/LaTeX/Mathematics), but the basics are very simple. For example if you enter ax^2 + bx +c = 0 (surrounded by the [tеx][/tеx] tags) it will be rendered as

$$ax^2 + bx + c = 0$$

^ is for superscript, _ is for subscript of the following character (or group of characters). In LaTeX formulae you can easily enter Greek letters (enter the name preceded by the backslash - \Delta for Δ and \delta for δ, Greek letters listed above the edit field won't work here), group symbols using curly braces, create fractions and root symbols with LaTeX codes \frac (two following symbols or symbol groups will land in the nominator and denominator) and \sqrt (again, following symbol or symbols group will land under the root symbol) and so on:

$$x_{1,2} = \frac {-b\pm\sqrt\Delta}{2a}$$

$$\frac 1 {2I} \left(\frac\hbar i\right)^2 \left[\frac 1 {\sin\theta} \frac \delta {\delta \theta} (\sin \theta \frac \delta {\delta\theta})+\frac 1 {\sin^2\theta} \frac {\delta^2}{\delta \phi ^2}\right]\Psi=E\Psi$$

$$C \iiint^{+\infty}_{-\infty}e^{-\frac \beta {2m} (p^2_x+p^2_y+p^2_z)}dp_x dp_y dp_z = 1$$

Please right-click the above equations and select Show Math As->TeX Commands to see how it was entered. \pm generates ± symbol, \hbar generates ħ and so on.

If you want to test your LaTeX expressions before posting them at chemicalforums, you can do so at the forkosh sandbox (http://www.forkosh.com/mimetextutorial.html) - just remember to add tex tags before posting your LaTeX here.

Please don't mix LaTeX and tags in a single formula, it is never necessary and never makes sense. You can mix them in a single post, but entering sulfuric acid as H$_2$SO$_4$ (LaTeX subscript in normal text) instead of H2SO4 (tagged subscript in normal text) makes it look awkward and is not guaranteed to work correctly.

Note: [B] is the opening tag used to mark bolded parts of the text. Unfortunately, exactly the same symbol is quite often used to denote concentration of a compound 'B', especially when dealing with equilibrium and kinetic equations. In effect in your post there will be no single [B] symbol present, instead, whole post from the first occurrence of [B] to the end will be bolded. There are two possible solutions. First, simple and fast one, is to enter additional space after the opening square bracket - that is, to use [ B] instead of [B]. Second it to use [nоbbc][/nоbbc] tags - whatever is between them is not treated as UBBC code, so [nоbbc][B][/nоbbc] is rendered as [B]. If you plan on using LaTeX you can be forced to use nobbc trick (outside of tex tags) as well.

And don't cry "hеlp!" in your posts. We know you need help, that's why you came here and posted. Your "hеlp!" will be replaced by "delete me*". It is an old joke built into forum many years ago.
Title: Entering structural formulae using SMILES
Post by: Borek on November 29, 2012, 05:52:35 AM
Structural formulae can be shown either as an attached image or by using SMILES and [smiles][/smiles] tags. To show a structure simply put its SMILES code in the [smiles][/smiles] tags (you can enter them using SMILES button above the editor window) and the forum system will take care of drawing the image:

[smiles]C=CC(=O)O[/smiles]

SMILES stands for Simplified molecular-input line-entry system - way of describing the chemical molecules with a simple ASCII string. SMILES are easy enough to be used directly - as the string bears a resemblance to the molecule itself (especially for simple molecules). Most (if not all) chemical drawing programs either accept or generate SMILES.

Every molecule is build as a chain (possibly branched, or closed to create cycles) of atoms. Atoms that are commonly seen in organic molecules - C, N, O, P, B, S, F, Cl, Br and I - are written just using their chemical symbols, and it is assumed they are connected to neighboring atoms and all free valences are used by implicit hydrogens. So propane is just CCC:

[smiles]CCC[/smiles]

buthyl mercaptan is CCCCS:

and ethyl methyl ether is CCOC:

Other elements require adding square brackets around the symbol. For example we will use them to display a formula of the Grignard reagent CC[Mg]Br:

It is not an error to use square brackets around the organic elements, actually sometimes it is necessary, as we can add some information about the atom properties - like charge - inside the square brackets. For example ethoxide anion is CC[O-]:

For multiple charges use +++ or +3 notation - so both [Al+++] and [Al+3] are correct.

Sometimes parts of the molecule are not that important, and we want to mark them with a generic label "R", meaning "rest of molecule". It can be done with [*:1] - that means any group (*) number 1. So the general ether formula is [*:1]O[*:2]:

Double and triple bonds are marked with = and #, so acetonitrile is CC#N:

and acrolein is C=CC=O:

These were all simple chains. Whenever the chain is branched, the branch is put in parentheses after the atom to which it is connected. So the triethylamine is CCN(CC)CC

and acetone is CC(=O)C (carbonyl sticks out of the main chain, so it is treated as a branch):

Things get tricky when we want cycles - we need to add digits to show which atoms in the chain are connected. So CCCCCC is hexane, but C1CCCC1C is methylcyclopentane - C1 is connected to C1:

For aromatic rings small letters are used - pyridine is c1ccccn1 (c1 connected to n1):

and quinoline is n1cccc2ccccc12 (several cycles - and several numbers - is where things become hard to follow, n1 is connected to c1, c2 is connected to c2, c12 means this particular carbon has two numbers; for numbers with more than one digit they would be separated by % - like c5%11%12):

These are just basics used in organic chemistry. There is a lot more to SMILES, but this is just a short introduction that should let you use it for the simple cases. If you want to learn more, please consult SMILES at Daylight site (http://www.daylight.com/dayhtml/doc/theory/theory.smiles.html) or SMILES at wikipedia (http://en.wikipedia.org/wiki/SMILES).

Unfortunately there is no control over the orientation of the rendered molecules. If you need to have a better control over the way molecule is displayed, the best approach is to draw it using some external tool (like free ChemSketch (http://www.acdlabs.com/download/)), export the image as png graphics, and attach it to the post using Additional Options... link below the edit field. Please remember to keep the width of the image below 700 pixels, otherwise they can be displayed only partially.

Images are rendered using indigo-depict (Copyright © 2009-2011 GGA Software Services LLC) used under GNU General Public License.
Title: Re: How to properly format posts at Chemical Forums
Post by: sjb on October 20, 2020, 02:02:44 AM
Just to add to this, as I didn't know until just now, you can (now) add reactions in SMILES too. See https://www.daylight.com/dayhtml_tutorials/languages/smiles/index.html for some detail.

For instance
[ SMILES]C.O=O>O=[O+]-[O-]>
O=C=O.O[/SMILES]

renders as

and

[ SMILES]CC(=[O:1])[OH:2].
CC[OH:3]>[H+]>
CC(=[O:1])[O:3]CC.
[OH2:2][/SMILES]

as