Knowledgebase
Knowledgebase
11.4 How To: TeX
Posted by Patrick Callahan on 25 March 2015 12:02 PM

The first rule of the TeX language is that ALL equations START AND END with two dollar signs ($$). If this character pair is not at the start and end of your input string, the equation will not display properly. With that out of the way, we can examine some more specific codes. The following is a list of the most frequently used equation elements and their corresponding code in TeX.  Element Input Output Any Keyboard Character or String of Characters$$AA + BAB*Ci=1$$Greek Character$$\delta\Delta\sigma\Sigma$$Superscript$$c^2n^{3/2}$$Subscript$$x_iK_{sp}$$Fraction$$\frac{A}{B}\frac{CD}{EF}$$Radical Sign$$\sqrt{Q}\sqrt[n]{ab}$$Summation Symbol$$\sum_a^bx\sum_{i=1}^N(x^2+1)$$Note: • More than one equation can be included in a single presentation. Each equation string enclosed in double dollar signs will be vertically separate from all other equations enclosed in dollar signs. • The leftmost equation string appears as the topmost, the following equation string appears below that, etc., etc. • Equations may be input as one continuous script or may be separated by the enter key; the presentation is unaffected. • With many functions, such as superscript and subscript, if you want more than one character to apply to the function, you must enclose the character string in curly brackets ( {} ). • The radical function is the only function among those listed that uses square brackets ( [] ). These are only required if the base is being raised to a power different from ½. Otherwise they may be omitted without affecting the presentation. Below is a table showing a few full equations and their corresponding TeX codes.  Equation Input Output Nernst Equation$$E=E^o-\frac{RT}{nF}ln\frac{\gamma_Bx_B}{\gamma_Ax_A}$$Standard Deviation$$\sigma=\frac{1}{N-1}\sum_{i=1}^N\sqrt{(x_i-\overline{x})^2}$$Scatchard Relation$$\frac{\Delta{A}}{X}=K\Delta\epsilon{P_o}-K\Delta{A}$$Heisenberg Uncertainty Principle$$\sigma_x\sigma_p\geq\frac{h}{4\pi}

Note:

• In most cases, curly brackets are only required in the function code if the function applies to more than one character.

• Some equation elements require brackets in their format, however.

• The only functions being discussed in which curly brackets are already part of the function code are the radical, fraction, and summation functions

• Memorizing code is not necessary. While the codes above seem complicated, remember you can have the code spat out for you by clicking the proper button in the equation builder panel. This panel contains button sets for mathematical operations, Greek letters, logical relationship symbols, special characters and character accents, arrows, and miscellaneous symbols. All equation elements not mentioned in the table above are used infrequently, at least for undergraduate Chemistry and Biology work. These elements can be conveniently added using the builder.

• Memorization will actually come to you by itself anyway so long as you use the interface often enough.

• Manipulating the code through the equation input panel is almost always necessary, at least a little bit. Even though the builder spits out code for you, you will almost always have to change the characters the code applies to. Often, you want to move code elements from one part of your string to another. Doing things like this require some fluency in the TeX language and cannot be done using the builder panel alone.

• Once you are more familiar with TeX, it will feel more convenient to do a significant portion of editing in the input panel anyway

• TeX is much easier than it first appears. Learning a new language can be intimidating, However, this language takes very little time to learn, particularly if you use the builder and preview panel to help you. Again, the author would like to emphasize that it only took 20 minutes for him to understand 90% of the necessary code protocol. Absorbing the essentials and remaining details is easily accomplished in an hour so long as you are patient, calm, and observant.

• As with any other application in LabArchives, simply click to put the equation into your page.

As a final note on the mathematical equations application, it is up to you as the instructor whether you require your students to learn TeX. You always have the option of constructing these formulae yourself, submitting the empty report forms to your students with the equations already included. This allows students to view them and use them while they write their report.

Alternatively, you can require them to input the equations themselves. This encourages students to refer to the equations and their principles while they write their discussion.

Ultimately, you must decide whether it is worth having your students endure TeX’s learning curve. Some students become easily frustrated by new online-homework interfaces (the author included). It is recommended that you spend time thinking about whether the benefit of students self-building equations outweighs their potential distaste for the learning-curve.