Научная статья на тему 'Using LaTeX for chemical formulas'

Using LaTeX for chemical formulas Текст научной статьи по специальности «Химические науки»

CC BY
320
31
i Надоели баннеры? Вы всегда можете отключить рекламу.
Ключевые слова
CHEMISTRY / FORMULAS / LATEX / PROGRAMMING

Аннотация научной статьи по химическим наукам, автор научной работы — Namiot Eugenia

In this paper, we discuss the guidelines for writing chemistry formulas, with the use of the Overleaf online LaTeX editor. As known, while preparing articles in chemistry sphere it is often required to introduce chemical formulas. The following include cycles, triple, double bonds or just unsaturated bonds, which are quite hard to perform using only standard editing tools. Of course, a manual drawing of formulas in a graphical editor is also not an appropriate option. To correct this problem, LaTeX was introduced. In this paper, we introduce some standard programmer codes for chemists to easier use LaTeX, without using any specialized programmer skills. All examples in this paper have been tested in online LaTeX editor Overleaf. Overleaf is an online collaborative writing and publishing tool that makes the whole process of writing, editing and publishing scientific documents much quicker and easier. Overleaf provides the convenience of an easy-to-use LaTeX editor and all that users need for LaTex in Overleaf is just a web browser.

i Надоели баннеры? Вы всегда можете отключить рекламу.
iНе можете найти то, что вам нужно? Попробуйте сервис подбора литературы.
i Надоели баннеры? Вы всегда можете отключить рекламу.

Текст научной работы на тему «Using LaTeX for chemical formulas»

Using LaTeX for chemical formulas

Eugenia Namiot

Abstract— In this paper, we discuss the guidelines for writing chemistry formulas, with the use of the Overleaf -online LaTeX editor. As known, while preparing articles in chemistry sphere it is often required to introduce chemical formulas. The following include cycles, triple, double bonds or just unsaturated bonds, which are quite hard to perform using only standard editing tools. Of course, a manual drawing of formulas in a graphical editor is also not an appropriate option. To correct this problem, LaTeX was introduced. In this paper, we introduce some standard programmer codes for chemists to easier use LaTeX, without using any specialized programmer skills. All examples in this paper have been tested in online LaTeX editor Overleaf. Overleaf is an online collaborative writing and publishing tool that makes the whole process of writing, editing and publishing scientific documents much quicker and easier. Overleaf provides the convenience of an easy-to-use LaTeX editor and all that users need for LaTex in Overleaf is just a web browser.

Keywords— Chemistry, Formulas, LaTeX, Programming.

I. Introduction

Currently, most chemistry articles contain a huge amount of formulas, and most of them are written with the use of overleaf, LaTeX, which is specifically designed for such tasks. LaTeX is a software system for typesetting documents. Because it is especially good for technical documents and is available for almost any computer system, LaTeX has become a lingua franca of the scientific world. Researchers, educators, and students in universities, as well as scientists in industry, use LaTeX to produce professionally formatted papers, proposals, and books [1].

In the chemical literature, there are two main types of chemical formulas. Taking advantage of terms rooted in TeX for mathematical formulas will be called lowercase and off. Line formulas are the ones for the creation of which no special characters and drawing techniques are required. Roughly speaking, they do not contain any chemical specificity. The key formulas will be called formulas requiring special "chemical" methods, symbols of drawings for their creation [2].

This article will focus on formulas used in organic chemistry, as for they are often the hardest to code and because nonorganic formulas can be written without using a specialized program just with the use of MS Word. In organic chemistry can be divided into acyclic and

Manuscript received Apr 9, 2019.

Eugenia Namiot - Sechenov First Moscow State Medical University (email: enamiot@gmail.com).

carbocyclic. Meantime, acyclic are divided into saturated and unsaturated substances and the same for carbocyclic. Acyclic saturated are the substances which contain single bond or alkanes, unsaturated contain double bond or alkenes, triple bond or alkynes, or two double bonds or alkadiens. Carbocyclic saturated substances are the ones which contain a single bond and are often called naphthenes, unsaturated contain more than a single bond and are often called aromatic hydrocarbons [3].

The following article will be divided into several sections of organic chemistry, giving examples of all common substances and, most importantly, in plain language explaining the basic programming skills in LaTeX.

In this paper, we used online LaTeX editor Overleaf [4]. overleaf is an online collaborative writing and publishing tool that makes the whole process of writing, editing and publishing scientific documents much quicker and easier. overleaf provides the convenience of an easy-to-use LaTeX editor. All users need for LaTex in Overleaf is just a web browser. There's no software to install, so you can start writing instantly. Overleaf compiles a project for writers so they can see the results right away and real-time preview in Overleaf also makes it great for learning - you can see how your final project looks as you type.

There are several LaTeX packages to create chemistry formulas: chemfig, streetex, ochem, and xymtex. In this paper, we used the chemfig package [5]. To use this package, start by adding the following code to the preamble of your document:

\usepackage{chemfig}

The most important command for drawing molecules is

\chemfig{code}

The argument code is a set of characters describing the structure of the molecule.

II. Alcanes

Alkanes, as well as all non-cyclic chemical structures, are the easiest to perform. The structures of commands are quite simple and introduced below.

To draw the structure of ethane, you write the following simple statements in the body of your document

\chemfig{ch 3-ch 3}

\Chemfig is the command to draw the chemical structure. The symbol - is the type of bonds.

Notice that the symbol _ after CH is used for the correct placement of the following index, in our case, 3.

The result can be visualized with the use of the overleaf program. The achieved result can be seen in Figure 1.

CH3-CII3

\chemfig{ch~ch}

\Chemfig is the command to draw the chemical structure. The symbol ~ is the type of bonds.

The result can be visualized with the use of the overleaf program. The achieved result can be seen in Figure 4.

Fig. 1 Ethane, accomplished with the use of Latex and overleaf.

Ethane molecule is drawn before can be improved by showing all the bonds, not only between carbon atoms but between carbon and hydrogen atoms as well.

This feature helps to show the non-linear structure of molecules, which in most articles is more common than the easier linear version.

The command is practically the same, introducing only a bit of new features. The code is shown below:

\chemfig{H-C(-[2]H)(-[6]H)-C(-[2]H)(-[6]H)-H}

The following formula can be downloaded to Overleaf where it is improvised into a 2D structure, which is shown in Figure 2 below.

CH-CH

Fig. 4 Ethin, accomplished with the use of Latex and Overleaf.

The bonds between hydrogen and carbon can be shown with the use of the following command.

\chemfig{H-C(-[2]H)(-[6]H)=C(-[2]H)(-[6]H)-H}

C(-[2]H)(-[6]H) creates two branches of hydrogen atoms, one with a 2 units angle (90°) and another one with a 6 units angle (270°).

The following formula can be used in Overleaf where it is improvised into a 2D structure, which is shown in Figure 5 below.

H H

H- C- C- H

H H

Fig. 2. Ethane structure, produced with the use of LaTeX and Overleaf.

III. Alkene

To draw the structure of ethylene, you write the following simple statements in the body of your document

\chemfig{ch 2=ch 2}

\Chemfig is the command to draw the chemical structure. The symbol = is the type of bonds.

The result can be visualized with the use of the overleaf program. The achieved result can be seen in Figure 3.

H

H

\

I

/

/

t

\

H

H

Fig. 5. Ethylene, accomplished with the use of LaTeX and Overleaf.

V. ALKADIENS

To perform the structure of the two double bonds the following commands should be used.

\chemfig{ch 2=ch-ch=ch 2}

\Chemfig is the command to draw the chemical structure. The symbol = is the type of bonds.

The result can be visualized with the use of the overleaf program. The achieved result can be seen in Figure 6.

CI I.J— CI I

Fig. 3 Ethylene accomplished with the use of LaTeX and Overleaf.

CH2=Œ—CH= CH2

Fig. 6 Butadiene, accomplished with the use of Latex and overleaf.

IV. ALKINS

To perform the structure of the triple bond the following commands should be used.

Table 1 below shows all the symbols used to describe the type of bond in chemical substances.

Table 1. Type of bonds in chemical substances.

- Single bond

= Double bond

Two double bonds

Triple bond

At first, the first atom in benzene was chosen. Then the clockwise path was chosen and the formula with the use of bond symbols was constructed.

As can be seen in figure 8, the formula ends are not finished, as these are the atoms that are connected with our firstly chosen atom. For better understanding, Figure 8 is presented below.

VI. CARBOCYCLIC SATURATED

To perform the structure of carbocyclic unsaturated chemical substances the following commands should be used.

\chemfig{CH_2*5(-CH_2-CH_2-H_2C-H_2C-)}

\Chemfig is the command to draw the chemical structure. The symbol - is the type of bonds. Number 5 is the number of sides of the polygon.

The result can be visualized with the use of the overleaf program. The achieved result can be seen in Figure 7.

CH2

/ \ H^C CH2

\ /

H9C

Chi

H

.CL II

C1 c

y \ y\

II C H

II

Fig. 8 Constructing the formula of benzene.

VIII. CONSTRUCTING FORMULAS

NON-LINEAR CHEMICAL

Fig. 7 Cyclopentane, accomplished with the use of LaTeX and Overleaf.

Incomplete rings can also be performed with the use of Latex and Overleaf. In that case, the command for the incomplete ring should not contain the bond symbol in the place, where the ring is supposed to be incomplete. For example,

iНе можете найти то, что вам нужно? Попробуйте сервис подбора литературы.

\chemfig{CH2*5(-CH_2-CH_2-CH_2)}

What is more, if, for example,"**4" is set instead of "*4" a circle will be drawn inside the polygonal chemical substance.

VII. CARBOCYCLIC UNSATURATED

The code that is used for drawing carbocyclic saturated chemical substances is practically the same as the one for carbocyclic saturated, except the change of the bond type. Type of bonds, that can be used in chemical substances and their symbols in LaTeX is shown in Table 1.

For example, the benzene structure formula is performed with the use of the following commands.

\chemfig{C*6((-H)-C(-H)=C(-H)-C(-H)=C(-H)-C(-H)=)}

Let's analyze the way the code was constructed.

Orientation in chemistry molecules is based on Collision theory. Collision theory states that molecules must in proper orientation at the moment of collision in order to form a chemical bond. Cis-trans isomers are stereoisomers, that is, pairs of molecules which have the same formula but whose functional groups are rotated into a different orientation in three-dimensional space. It is not to be confused with E-Z isomerism, which is an absolute stereo-chemical description. In general, stereoisomers contain double bonds that do not rotate, or they may contain ring structures, where the rotation of bonds is restricted or prevented.

To design non-linear chemical formulas, or so-called "branches", the following commands should be used.

\vspace{.5cm}

\chemfig{CH*6(-CH=C(-CH_3)-CH-CH-C(-CH_3)=)}

In that case, branches are created by adding different formulas in round brackets.

\vspace command makes a branch in your formula, while the components if this branch has to be chosen in the next command which is \chemfig.

The result can be visualized with the use of the overleaf program. The achieved result can be seen in Figure 9.

CIL

CH

OH

CH

CH

C

CH

3

Fig. 9 Branched carbocyclic molecule, performed with the use of LaTeX and Overleaf.

More complicated structures in Latex can be created by combining the features described in this article. Complicated structures can be performed with the use of their compartments or components which are illustrated above.

CH

H

CH

CH

CH

Hi

CO H

Fig. 10. Carbocyclic aldehyde, performed with the use of LaTeX and Overleaf.

Let's illustrate how latex would improve chemical formulas in different articles in chemistry sphere.

As examples, the reactions of carbanion equivalent are taken. To be more specific, the carbocyclic aldehyde, one of the reagents with allyl bromide [6]. The code for the carbocyclic aldehyde is shown below.

At first, applied. That is:

the command for making a branched ring is

\vspace(.5cm}

after, the formula itself is coded. To make a branch aldehyde functional group is put into round brackets, which, in LaTeX language, makes our molecule not-linear.

\chemfig COH)-CH 2-)}

{CH 2*6(-CH 2-CH 2-CH 2-CH(-

o

Hac

CH*

Fig. 11. Caffeine in Overleaf

As the formula is ready, it can be used in Overleaf where it is converted into a 2D figure. The result, Figure 10 is shown below.

And the following code displays Caffeine (Figure 11)

\chemfig(*6((=O)-N(-CH_3)-*5(-N=-N(-CH 3)-=)—(=O)-N(-H 3C)-)}

References

[1] [2]

[3]

[4]

[5]

[6]

Lamport, Leslie. LATEX: a document preparation system: user's

guide and reference manual. Addison-wesley, 1994.

Min'kovskij E. M. Nabor himicheskih formul v sisteme LATEX2e

tochka zrenija praktika URL:

http://www.tex.uniyar.ac.ru/doc/minkovsky.pdf Retrieved: Jul, 2019

Anslyn, Eric V., and Dennis A. Dougherty. Modern physical organic

chemistry. University science books, 2006.

Overleaf https://www.overleaf.com Retrieved: Jul, 2019

chemfig - Draw molecules with easy syntax

https://ctan.org/pkg/chemfig?lang=en Retrieved: Jul, 2019

Li, Chao-Jun, and Liang Chen. "Organic chemistry in water."

Chemical Society Reviews 35.1 (2006): 68-82.

i Надоели баннеры? Вы всегда можете отключить рекламу.