summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/chemmacros/chemmacros_doc_en.tex
blob: 56a2303fb326339dbdfc8b678adf5d49a43a86ec (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% --------------------------------------------------------------------------- %
% - the CHEMMACROS bundle                                                   - %
% - chemmacros_doc_en.tex                                                   - %
% - macros and commands for chemists                                        - %
% --------------------------------------------------------------------------- %
% - Clemens Niederberger                                                    - %
% - 2012/03/03                                                              - %
% --------------------------------------------------------------------------- %
% - https://bitbucket.org/cgnieder/chemmacros/                              - %
% - contact@mychemistry.eu                                                  - %
% --------------------------------------------------------------------------- %
% - If you have any ideas, questions, suggestions or bugs to report, please - %
% - feel free to contact me.                                                - %
% --------------------------------------------------------------------------- %
% - Copyright 2011-2012 Clemens Niederberger                                - %
% -                                                                         - %
% - This work may be distributed and/or modified under the                  - %
% - conditions of the LaTeX Project Public License, either version 1.3      - %
% - of this license or (at your option) any later version.                  - %
% - The latest version of this license is in                                - %
% -   http://www.latex-project.org/lppl.txt                                 - %
% - and version 1.3 or later is part of all distributions of LaTeX          - %
% - version 2005/12/01 or later.                                            - %
% -                                                                         - %
% - This work has the LPPL maintenance status `maintained'.                 - %
% -                                                                         - %
% - The Current Maintainer of this work is Clemens Niederberger.            - %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% if you want to compile this documentation:
%
% > xelatex chemmacros_doc_en (2 or 3 times)
% > biber chemmacros_doc_en
% > makeindex -sl index_en.ist chemmacros_doc_en.idx
% > xelatex chemmacros_doc_en
%
\documentclass[DIV11,idx=totoc,toc=bib]{scrartcl}
\usepackage{fontspec,xltxtra}
\usepackage{polyglossia}
  \setmainlanguage{english}
\usepackage[normalem]{ulem}
\usepackage{chemfig,chemstyle,upgreek,textgreek,multicol,makeidx,booktabs,csquotes}
\usepackage{chemmacros}
\usepackage[version=3]{mhchem}
\usepackage[para]{footmisc}

% Setup:
\setmainfont[SmallCapsFont=Linux Libertine Capitals O,SlantedFont=Linux Libertine Slanted O]{Linux Libertine O}
\setsansfont[Scale=MatchLowercase,SmallCapsFont=Linux Biolinum Capitals O,SlantedFont=Linux Biolinum Slanted O]{Linux Biolinum O}
\setmonofont[Scale=MatchLowercase]{Inconsolata}
\chemsetup[option]{synchronize}
\colorlet{chemformula}{darkgray}
\chemsetup[chemformula]{font-spec={[Color=chemformula]Latin Modern Sans}}
\reversemarginpar
\input{chemmacros-codehelper}

\begin{filecontents}{index_en.ist}
 preamble "\\begin{theindex}\n Section titles are indicated \\textbf{bold}, packages \\textsf{sans serif}, commands \\textcolor{code}{\\texttt{\\textbackslash brown}}, keys \\textcolor{key}{\\texttt{green}} and modules (only \\chemmacros) \\textcolor{module}{\\texttt{red}}.\\newline\n\n"
 heading_prefix "{\\bfseries "
 heading_suffix "\\hfil}\\nopagebreak\n"
 headings_flag  1
 delim_0 "\\dotfill "
 delim_1 "\\dotfill "
 delim_2 "\\dotfill "
 delim_r "\\textendash"
 suffix_2p "\\nohyperpage{\\,f.}"
 suffix_3p "\\nohyperpage{\\,ff.}"
\end{filecontents}

\usepackage[backend=biber,style=alphabetic,maxbibnames=20]{biblatex}
\addbibresource{\jobname.bib}
\begin{filecontents}{\jobname.bib}
@book{iupac:greenbook,
  author    = {E. Richard Cohan and Tomislav Cvita\v{s} and Jeremy G. Frey and Bertil Holmström and Kozo Kuchitsu and Roberto Marquardt and Ian Mills and Franco Pavese and Martin Quack and Jürgan Stohner and Herbert L. Strauss and Michio Takami and Anders J Thor},
  title     = {“Quantities, Symbols and Units in Physical Chemistry”, \IUPAC Green Book},
  edition   = {3rd Edition. 2nd Printing},
  year      = {2008},
  publisher = { \IUPAC \&\ RSC Publishing, Cambridge}
}
@misc{eu:ghsystem_regulation,
  author   = {{The European Parliament and The Council of the European Union}},
  title    = {Regulation (EC) No 1272/2008 of the European Parliament and of the Council},
  subtitle = {on classification, labelling and packaging of substances and mixtures, amending and repealing Directives 67/548/EEC and 1999/45/EC, and amending Regulation (EC) No 1907/2006},
  journal  = {Official Journal of the European Union},
  date     = {2008-12-16}
}
\end{filecontents}

\DeclareInstance{xfrac}{chemformula-text-frac}{text}
  {
    scale-factor        = 1 ,
    denominator-bot-sep = -.2ex ,
    denominator-format  = \scriptsize #1 ,
    numerator-top-sep   = -.2ex ,
    numerator-format    = \scriptsize #1
  }

\usepackage{hyperref}
  \hypersetup{colorlinks         = true,
              allcolors          = myblue,
              plainpages         = false,
              bookmarksopen      = true,
              bookmarksopenlevel = 1,
              bookmarksnumbered  = true,
              pdfauthor          = {Clemens Niederberger},
              pdftitle           = {chemmacros bundle - English documentation},
              pdfsubject         = {macros and commands for chemists},
              pdfkeywords        = {chemmacros,chemformula,ghsystem},
              pdfcreator         = {XeLaTeX},
              pdfstartview       = FitH
  }

\newcommand*\chemmacros{{\scshape\textcolor{myblue}{chemmacros}}\xspace}
\newcommand*\chemformula{{\scshape\textcolor{myblue}{chemformula}}\xspace}
\newcommand*\ghsystem{{\scshape\textcolor{myblue}{ghsystem}}\xspace}

\newcommand*\Chemmacros{{\fontspec[Color=myblue,Scale=1.2]{Linux Biolinum Shadow O}chemmacros}}
\newcommand*\Chemformula{{\fontspec[Color=myblue,Scale=1.2]{Linux Biolinum Shadow O}chemformula}}
\newcommand*\Ghsystem{{\fontspec[Color=myblue,Scale=1.2]{Linux Biolinum Shadow O}ghsystem}}

\newcommand*\eg{\mbox{e.\,g.}\xspace}
\newcommand*\ie{\mbox{i.\,e.}\xspace}
\newcommand*\etc{\mbox{etc.}\xspace}
\newcommand*\TIKZ{Ti\textbf{\textit{k}}Z}
\newcommand*\TikZ{\index{TikZ@\TIKZ}\mbox{\TIKZ}\xspace}

\newcommand*\pdfTeX{\textsc{pdf\kern-.2ex\TeX}}
\renewcommand*\LuaTeX{{Lua\kern-.2ex\TeX}}

\providecommand\glqq{„}
\providecommand\grqq{“}

\makeindex
\begin{document}
\GetFileInfo{chemmacros}

\begin{center}
 % title:
 \Huge the \Chemmacros\ bundle \\[.5cm]
 \fileversion \qquad \filedate \\[.5cm]
 \Large packages \Chemmacros, \Chemformula\ and \Ghsystem \\[.5cm]
 % author and contact:
 \large Clemens \textsc{Niederberger} \\[.5cm]
 \normalsize\url{https://bitbucket.org/cgnieder/chemmacros/}\\
 \href{mailto:contact@mychemistry.eu}{contact@mychemistry.eu}\\[1cm]
 % picture:
 \large\ch[font-spec={[Color=chemformula]Augie}]{ 2 "\OX{o1,\ox{0,Na}}" + "\OX{r1,\ox{0,Cl}}" {}2 -> 2 "\OX{o2,\ox{+1,Na}}" \pch{} + 2 "\OX{r2,\ox{-1,Cl}}" \mch }
 \redox(o1,o2)[red,-cf]{\small\ch[font-spec={[Color=red]Augie},math-space=.3em]{$-$ 2 e-}}
 \redox(r1,r2)[blue,-cf][-1]{\small\ch[font-spec={[Color=blue]Augie},math-space=.3em]{$+$ 2 e-}}
\end{center}
\vskip1cm
\begin{multicols}{2}
 \tableofcontents
\end{multicols}

\part{Preliminaries}\secidx{PRELIMINARIES}
\section{Licence, Requirements and README}
The \chemmacros bundle underlies the \LaTeX\ project public license (lppl) version 1.3 or later. (\url{http://www.latex-project.org/lppl.txt})

The \chemmacros bundle needs the bundles \paket{l3kernel} and \paket{l3packages}.It also needs the packages \paket{siunitx}, \paket{mathtools}, \paket{bm}, \paket{nicefrac} and \paket{environ} as well as \paket*{tikz}\footnote{CTAN: \href{http://www.ctan.org/pkg/pgf/}{pgf}} and the \TikZ libraries \texttt{calc} and \texttt{arrows}.

Package option \key{bpchem} (section \ref{sec:optionen}) needs the package \paket{bpchem}, package option \key{xspace} needs the package \paket{xspace} and package option \key{method}{mhchem} needs the package \paket{mhchem}.

With v3.0 the \chemmacros package has been bundled with the new packages \chemformula and \ghsystem. \chemformula provides an alternative to \paket{mhchem}. This leads to some internal changes in \chemmacros. On the same time the documentation has been redesigned.

You might remember that \chemmacros' options all belong to different modules, see section \ref{sec:setup} for further information. These are typeset in the left margin when the option is first mentioned. In section \ref{sec:overview} all options and the module the belong to are listed. Throughout the document options are typeset \textcolor{key}{\texttt{green}} and modules \textcolor{module}{\texttt{red}}.

The package \ghsystem needs the packages \chemmacros, \paket{tabu}, \paket{longtable}, \paket{ifpdf} and \paket{graphicx}. \ghsystem has no own package options but passes all options on to \chemmacros.

\achtung{There are some deprecated commands and options which are not explained in the manual any more but still exist to ensure backwards compatibility. These commands issue a warning. They may be dropped some time in the future.}

\section{Motivation and Background}
\chemmacros started some years ago as a growing list of custom macros that I frequently used. I cannot completely recall when and why I decided to release them as a package. Well \textendash\ here we go and you might find it useful, too, I hope.

I would guess that nearly every chemist using \LaTeXe\ is aware of the great \paket{mhchem} package by Martin Hensel. There have always been some difficulties intertwining it with \chemmacros, though. Also, some other minor points in \paket{mhchem} always bothered me, but they hardly seemed enough for a new package. They weren't even enough for a feature request to the \paket{mhchem} author. The challenge and the fun of creating a new package and the wish for a highly customizable alternative led to \chemformula after all.

\chemformula works very similar to \paket{mhchem} but is more strict as to how compounds, stoichiometric factors and arrows are input. In the same time \chemformula offers possibilities to customize the output that \paket{mhchem} does not. Since \chemformula is meant as an \emph{alternative} to \paket{mhchem} \chemmacros offers a package option allowing you to choose which one of the two is used.

As a chemist you are probably aware of the fact that the \textsc{United Nations} have developed the \enquote{\textbf{G}lobally \textbf{H}armonized \textbf{S}ystem of Classification and Labelling of Chemicals} (GHS) as a global replacement for the various different systems in different countries. While it has not been implemented by all countries yet\footnote{\url{http://www.unece.org/trans/danger/publi/ghs/implementation_e.html}}, it as only a matter of time.

The package \ghsystem now enables you to typeset all the hazard and precautionary statements and pictograms in a very easy way. The statements are taken from EU regulation 1272/2008 \cite{eu:ghsystem_regulation}.

There are four points I hope I have achieved with this bundle:
\begin{itemize}
 \item intuitive usage as far as the syntax of the commands is concerned
 \item the commands shall not only make typesetting easier and faster but also the document source more readable with respect to semantics  (\lstinline=\ortho-dichlorobenzene= is easier to read and understand than \lstinline=\textsl{o}-dichlorobenzene=)
 \item as much customizability as I could think of so every user can adapt the commands to his or her own wishes
 \item \IUPAC compliant default settings
\end{itemize}
Especially the last point needed some pushing from users\footnote{Many thanks to Dr.~Paul~King!} to get things right in many places. If you find anything not compliant with \IUPAC recommendations\footnote{This does not convern the \cmd{ox} command. The \IUPAC version is \cmd[oxa]{ox*}.} I would welcome an email very much!

\section{Installation, Loading the Bundle}\secidx{Loading the Bundle}\secidx{Installation}
The bundle comes with three style files\footnote{Those ending \texttt{sty}.}, a directory called \texttt{language/} containing the language-definition files for GHS (ending \texttt{def}), and a directory \texttt{pictures/} containing \texttt{eps}, \texttt{jpg} and \texttt{png} files (the GHS pictogramms). If you install the bundle manually \emph{please make sure to place the directories \texttt{language/} and \texttt{pictures/} in the \emph{same} directory as the style files}.

Loading \chemmacros with
\begin{beispiel}[code only]
 \usepackage{chemmacros} % `chemmacros', `chemformula' and `ghsystem' are loaded
\end{beispiel}
will also load \chemformula and \ghsystem. However, you can prevent \chemmacros from loading \ghsystem:
\begin{beispiel}[code only]
 \usepackage[ghs=false]{chemmacros} % `chemmacros' and `formula' are loaded
\end{beispiel}

Loading \chemformula or \ghsystem explicitly is possible and will also load \chemmacros if it hasn't been loaded yet, and will therefore implicitly load the other package, too.
\begin{beispiel}[code only]
 \usepackage{chemformula} % `chemmacros', `formula' and `ghs' are loaded
 or
 \usepackage[ghs=false]{chemformula} % `chemmacros' and `formula' are loaded
\end{beispiel}

However, it is recommended to simply use \lstinline=\usepackage{chemmacros}= and setup the required options with \lstinline=\chemsetup= (also see section \ref{sec:setup}).
\secidx*{Installation}\secidx*{Loading the Bundle}

\section{Package Options}\label{sec:optionen}\secidx{Package Options}
\chemmacros has several package options. They all are used as key/value pairs like
\begin{beispiel}[code only]
 \usepackage[option1 = <value1>, option2 = <value2>]{chemmacros}
\end{beispiel}
Some also can be used without value (\lstinline+\usepackage[option1]{chemmacros}+), which means that the \uline{underlined} value is used.

Both \chemformula and \ghsystem don't have package options of their own. If you load them explicitly you can give them \chemmacros' options instead and they will pass them on to \chemmacros.
\begin{description}
 \item \key[option]{bpchem}{\uline{true}/false} This option loads the package \paket{bpchem} and adjusts the layout of the \cmd{NMR} command to the \paket{bpchem} commands \lstinline+\HNMR+ and \lstinline+\CNMR+. (default = \texttt{false})
 \item \key[option]{circled}{\uline{formal}/all/none} \chemmacros uses two different kinds of charges\footnote{Thanks to Christoph Sch\"afer, who pointed out to me, that v1.1 handled the charges too sloppy!}, which indicate the usage of real ($+/-$) and formal (\fplus/\fminus) charges. The option \texttt{formal} distinguishes between them, option \texttt{none} displays them all without circle, option \texttt{all} circles all (default = \texttt{formal})
 \item \key[option]{circletype}{\uline{chem}/math} This option switches between two kinds of circled charge symbols: \cmd{fplus} \fplus\ and \lstinline+$\oplus$+ $\oplus$. (default = \texttt{chem})
 \item \key[option]{detect-bold}{\uline{true}/false} \emph{This option is deprecated!}
 \item \key[option]{EZ}{\uline{chemmacros}/cool} \emph{This option is deprecated!}
 \item \key[option]{german}{\uline{true}/false} This option changes the commands \cmd{pKa}, \cmd{sld} and \cmd{lqd} (default = \texttt{false}). This option has the alias \key[option]{ngerman}.
 \item \key[option]{ghs}{\uline{true}/false} Disable the use of the \ghsystem package. Setting \key{ghs}{false} will prevent \chemmacros from loading \ghsystem. (default = \texttt{true})
 \item \key[option]{iupac}{auto/restricted/strict} Take care of how iupac naming commands are defined, see page \pageref{key:iupac} (default = \texttt{auto})
 \item \key[option]{method}{\uline{chemformula}/mhchem} You can choose the method which \chemmacros will use for the reaction environments (see section \ref{ssec:mhchem_reaktionen}) and the typesetting of the particles (see section \ref{sec:teilchen}). (default = \texttt{chemformula}). This option can only be chosen in the preamble.
 \item \key[option]{Nu}{\uline{chemmacros}/mathspec} The package \paket{mathspec} also defines a macro \cmd{Nu}. This option chooses which definition holds, see page \pageref{Nu}. (default = \texttt{chemmacros}). This option can only be chosen in the preamble.
 \item \key[option]{strict}{\uline{true}/false} Setting \key{strict}{true} will turn all warning messages into erros messages. (default = \texttt{false})
 \item \key[option]{synchronize}{\uline{true}/false} The setting \texttt{true} will tell \chemmacros the adapt the font settings of \chemformula if that method has been chosen (default = \texttt{false}). In order to demonstrate this feature this document is set with \key{synchronize}{true} and the \chemformula setting \lstinline+\chemsetup[chemformula]{font-spec={[Color=darkgray]Latin Modern Sans}}+.
 \item \key[option]{upgreek}{none/textgreek/\uline{upgreek}} This Options determines how the letters \ch{Chemalpha} and friends are typeset. See page \pageref{key:upgreek} for more information. This option can only be chosen in the preamble. (default = \texttt{upgreek})
 \item \key[option]{version}{1/2/bundle} This option restores the old definitions of some commands, so documents set with v1.* will still compile correctly. (default = \texttt{bundle}). Actually \texttt{2} and \texttt{bundle} are only aliases. This option can only be chosen in the preamble.
 \item \key[option]{xspace}{\uline{true}/false} With this option most commands are defined with a \lstinline+\xspace+. (default = \texttt{true})
\end{description}
\secidx*{Package Options}

\section{Setup}\label{sec:setup}\secidx{Setup}
Various of \chemmacros', \chemformula's and \ghsystem's commands have key/value pairs with which they can be customized. Most times they can be used as (optional) argument of the commands themselves. They also can most times be used with the \cmd{chemsetup} command.
\begin{description}
 \item \cmd{chemsetup}[<module>]{<key> = <value>} or
 \item \cmd{chemsetup}{<module>/<key> = <value>}
\end{description}
The keys each belong to a module, which defines for which commands they are intended for. If a key is presented, you'll see the module to which it belongs in the left margin. You have two ways to use keys with the \cmd{chemsetup}, as you can see above.

The package options can also be seen as keys belonging to the module \textcolor{module}{\ttfamily option}. This means they can also be used with the \cmd{chemsetup} command (except for the option \key[option]{version}{1/2/3}).
\begin{beispiel}
 \chemsetup[option]{circled=none}\mch\ \pch\ \fmch\ \fpch\ \el\ \prt \\
 \chemsetup[option]{circled=formal}\mch\ \pch\ \fmch\ \fpch\ \el\ \prt \\
 \chemsetup[option]{circletype=math}\mch\ \pch\ \fmch\ \fpch\ \el\ \prt \\
 \chemsetup{option/circletype=chem,option/circled=all}\mch\ \pch\ \fmch\ \fpch\ \el\ \prt \\
 \chemsetup{option/circletype=math}\mch\ \pch\ \fmch\ \fpch\ \el\ \prt
\end{beispiel}
Keys \emph{not} belonging to a module \emph{cannot} be used with \cmd{chemsetup}!

All options of \chemformula belong to the module \textcolor{module}{\texttt{chemformula}} and all of \ghsystem's options belong to the module \textcolor{module}{\texttt{ghs}}.
\secidx*{Setup}
\secidx*{PRELIMINARIES}

\part{\texorpdfstring{\Chemmacros}{chemmacros}}\secidx{CHEMMACROS}
\section{Particles, Ions and Symbols}\label{sec:teilchen}\secidx{Particles, Ions and Symbols}
\subsection{Predefined}\secidx[predefined]{Particles, Ions and Symbols}
\chemmacros defines some simple macros for displaying often needed particles and symbols. Please note, that they're displayed differently depending on the package options used, see section \ref{sec:optionen}. These commands can be used in text as well as in math mode.
\begin{description}
 \item \cmd{Hpl} \Hpl (proton)
 \item \cmd{Hyd} \Hyd (hydroxide)
 \item \cmd{HtO} \HtO (oxonium ion) (\textbf{H} \textbf{t}hree \textbf{O})
 \item \cmd{water} \water
 \item \cmd{el} \el (electron)
 \item \cmd{prt} \prt (proton)
 \item \cmd{ntr} \ntr (neutron)
 \item \cmd{Nu} \Nu (nucleophile). The package \paket{mathspec} also defines a macro \cmd{Nu}. If you chose package option \key[option]{Nu}{mathspec} \chemmacros defines \cmd{Nuc} instead\label{Nu}.
 \item \cmd{El} \El (electrophile)
 \item \cmd{ba} \ba (base)
 \item \cmd{fplus} \fplus
 \item \cmd{fminus} \fminus
 \item \cmd{transitionstatesymbol} \transitionstatesymbol
 \item \cmd{standardstate} \standardstate. This symbol is only provided by \chemmacros, if the package \paket{chemstyle} is not loaded; the idea is borrowed from there\footnote{many thanks to the package author \href{http://www.texdev.net/}{Joseph Wright}.}.
 \item \cmd{Chemalpha} \Chemalpha
 \item \cmd{Chembeta} \Chembeta
 \item \cmd{Chemgamma} \Chemgamma
 \item \cmd{Chemdelta} \Chemdelta
 \item \cmd{Chemomega} \Chemomega
 \item \cmd{ChemDelta} \ChemDelta
\end{description}

\achtung{The command \cmd{Rad} has been dropped!}

The two particles \cmd{Nu} and \cmd{ba} can be modified. To do that you use the option
\begin{description}
 \item\key[particle]{elpair}{false/\uline{dots}/dash}.
\end{description}
It only has any effect, if the package \paket{chemfig} is loaded, since it uses it's command \lstinline+\Lewis+.
\begin{beispiel}
 % needs package `chemfig'
 \ba[elpair] \Nu[elpair=dash]
 
 \chemsetup[particle]{elpair}
 \ba \Nu
\end{beispiel}

\label{key:upgreek}The greek letters aren't newly defined symbols but are defined differently depending on the packages you've loaded. The default definition is the corresponding math letter. If you have loaded the \paket{textgreek} package the letters are taken from there, and if you have loaded the package \paket{upgreek} the macros of that package are used. This documentation uses \paket{upgreek} for instance. If you load both \paket{upgreek} and \paket{textgreek} the letters from \paket{upgreek} are used.

If you don't want \chemmacros to use a package automatically but want to decide for yourself, there is the option \key[option]{upgreek}. \ref{tab:upgreek_mode} shows the different styles for some of the letters.

\begin{table}[h]
 \centering
 \begin{tabular}{lccc}\toprule
                  & none     & upgreek    & textgreek \\\midrule
  \cmd{Chemalpha} & $\alpha$ & $\upalpha$ & \textalpha \\
  \cmd{Chembeta}  & $\beta$  & $\upbeta$  & \textbeta \\
  \cmd{ChemDelta} & $\Delta$ & $\Updelta$ & \textDelta \\ \bottomrule
 \end{tabular}
 \caption{The greek letters}\label{tab:upgreek_mode}
\end{table}

The reason why \chemmacros defines these macros in the first place is \IUPAC compliance. \IUPAC recommends to use upright greek letters in nomenclature.

\begin{myquote}[\IUPAC Green Book \cite[][p.\,9]{iupac:greenbook}]
 Greek letters are used in systematic organic, inorganic, macromolecular and biochemical nomenclature. These should be roman (upright), since they are not symbols for physical quantities.
\end{myquote}

\chemmacros uses these commands now to defined nomenclature commands, see page \pageref{par:greek_letters}.

\subsection{Own Particles}\secidx[own]{Particles, Ions and Symbols}
Surely sometimes it can be handy to have other particle macros defined such as \lstinline+\positron+ or \lstinline+\photon+. This can easily be done with this command:
\begin{description}
 \item \cmd{DeclareChemParticle}{<cmd>}\ma{<definition>}
 \item \cmd{RenewChemParticle}{<cmd>}\ma{<definition>}
\end{description}
Depending on the \key{method} you chose as option the \texttt{<definition>} will either be a formula defined with \paket{mhchem} or with \chemformula. The particle defined this way behaves like the predefined ones with one exception: if you chose \key{method}{mhchem} the particle \emph{will not} obey the option \key{circled}. If you want formal charges with this method you need to use \chemmacros' commands (see section \ref{sec:ladungen}) explicitly. If you chose \key{method}{chemformula} the partictle \emph{will} obey the \key{circled} option.
\begin{beispiel}
 % uses the `upgreek' package
 \DeclareChemParticle{\positron}{$\upbeta$+}
 \DeclareChemParticle{\photon}{$\upgamma$}
 \RenewChemParticle{\el}{$\upbeta$-}
 \positron\ \photon\ \el
\end{beispiel}
\cmd{DeclareChemParticle} only defines a particle if \texttt{<cmd>} is not already used by any other command. If it \emph{is} already used \chemmacros will either give a warning or an error, depending on the option \key{strict}. \cmd{RenewChemParticle} \emph{only} defines a particle if \texttt{<cmd>} \emph{is} already used and issues a warning/error otherwise.
\secidx*{Particles, Ions and Symbols}

\section{Nomenclature, Stereo Descriptors, Latin Phrases}\label{sec:stereo}
\subsection{\IUPAC Names}\secidx{IUPAC Names}
Similar to the \paket{bpchem} package \chemmacros provides a command\footnote{The idea and the implementation is shamelessly borrowed from \paket*{bpchem} by Bjørn Pedersen.} to typeset \IUPAC names. Why is that useful? \IUPAC names can get very long. So long indeed that they span over more than two lines, especially in two-column documents. This means they must be allowed to be broken more than one time. This is what the following command does.
\begin{description}
 \item\cmd{iupac}{<IUPAC name>} Inside this command use \cmd{\textbar} and \cmd{-} to indicate a breaking point or a breaking dash. Use \cmd{\textasciicircum} as a shortcut for \lstinline=\textsuperscript=\footnote{Actually \cmd{\textasciicircum} uses a \chemformula command instead.}.
\end{description}
\begin{beispiel}
 \begin{minipage}{.4\linewidth}
  \iupac{Tetra\|cyclo[2.2.2.1\^{1,4}]\-un\|decane-2\-dodecyl\-5\-(hepta\|decyl\|iso\|dodecyl\|thio\|ester)}
 \end{minipage}
\end{beispiel}
The \cmd{iupac} command is more of a semantic command. Most times you can achieve (nearly) the same thing by using \cmd{-} instead of \cmd{\textbar}, \texttt{-} instead of \cmd{-} and \lstinline=\textsuperscript= instead of \cmd{\textasciicircum}.

The command \cmd{iupac} serves another purpose, too, however. Regardless of the setting of the \key[option]{iupac} option all the commands presented in this section are always defined \emph{inside} \cmd{iupac}. Quite a number of the naming commands have very general names: \cmd{meta}, \cmd{D}, \cmd{E}, \cmd{L}, \cmd{R}, \cmd{S}, \cmd{trans} and so forth. This means they either are predefined already (\cmd{L} \L) or are easily defined by another package or class (the \paket{cool} package defines both \cmd{D} and \cmd{E}, for example). In order to give you control which commands are defined in which way, there is the package option \key[option]{iupac}\label{key:iupac}. It has three modes:
\begin{itemize}
 \item \key{iupac}{auto}: if the commands are \emph{not} defined by any package or class you're using they are available generally, otherwise only \emph{inside} \cmd{iupac}.
 \item \key{iupac}{restricted}: all naming commands are \emph{only} defined inside \cmd{iupac}. If the commands are defined by another package they of course have that meaning outside. They're not defined outside otherwise.
 \item \key{iupac}{strict}: \chemmacros overwrites any other definition and makes the commands available throughout the document. Of course the commands can be redefined (but only in the document body). They will still be available inside \cmd{iupac} then.
\end{itemize}
\ref{tab:iupac_modes} demonstrates the different modes.

\begin{table}[h]
 \centering
 \begin{tabular}{lccc}\toprule
                         & auto       & restricted & strict \\\midrule
  \lstinline=\L=         & \L         & \L         & \iupac{\L} \\
  \lstinline=\iupac{\L}= & \iupac{\L} & \iupac{\L} & \iupac{\L} \\
  \lstinline=\D=         & \D         & --         & \D \\
  \lstinline=\iupac{\D}= & \iupac{\D} & \iupac{\D} & \iupac{\D} \\\bottomrule
 \end{tabular}
 \caption{Demonstration of \protect\key{iupac}'s modes.}\label{tab:iupac_modes}
\end{table}

\subsubsection{Predefined Commands}\secidx[predefined]{IUPAC Names}\secidx{Stereo Descriptors and Nomenclature}
The macros in this section are intended to make the writing of \IUPAC names more convenient.
\paragraph{Greek Letters}\label{par:greek_letters}\secidx[greek letters]{IUPAC Names}
Greek letters in compound names are typeset upright. For this there are the packages \paket{upgreek} and \paket{textgreek}. If you have loaded one of them \chemmacros typesets the following commands upright:
\begin{description}
 \item \cmd{a} \iupac{\a}
 \item \cmd{b} \iupac{\b}
 \item \cmd{g} \iupac{\g}
 \item \cmd{d} \iupac{\d}
 \item \cmd{w} \iupac{\w}
\end{description}
\begin{beispiel}
 \iupac{5\a\-androstan\-3\b\-ol} \\
 \iupac{\a\-(tri\|chloro\|methyl)\-\w\-chloro\|poly(1,4\-phenylene\|methylene)}
\end{beispiel}

\paragraph{Hetero Atoms and added Hydrogen}\secidx[hetero atoms]{IUPAC Names}
Attachments to hetero atoms and added hydrogen atoms are indicated by italic letters \cite{iupac:greenbook}. \chemmacros defines a few shortcuts for the most common ones.
\begin{description}
 \item \cmd{H} \iupac{\H}
 \item \cmd{O} \iupac{\O}
 \item \cmd{N} \iupac{\N}
 \item \cmd{Sf} \iupac{\Sf}
 \item \cmd{P} \iupac{\P}
\end{description}
\begin{beispiel}
 \iupac{\N\-methyl\|benz\|amide} \\
 \iupac{3\H\-pyrrole} \\
 \iupac{\O\-ethyl hexanethioate}
\end{beispiel}

\paragraph{Cahn-Ingold-Prelog}\index{Cahn-Ingold-Prelog}\secidx[Cahn-Ingold-Prelog]{IUPAC Names}
\begin{description}
 \item \cmd{cip}{<conf>} \eg: \cmd{cip}{R,S} \cip{R,S}
 \item \cmd{R} \iupac{\R}
 \item \cmd{S} \iupac{\S}
\end{description}
Since the command \cmd{S} has another meaning already (\S) it is only available inside \cmd{iupac} in the default setting.

\paragraph{Fischer}\index{Fischer}\secidx[Fischer]{IUPAC Names}
\begin{description}
 \item \cmd{D} \iupac{\D}
 \item \cmd{L} \iupac{\L}
\end{description}
Since the command \cmd{L} has another meaning already (\L) it is only available inside \cmd{iupac} in the default setting.

\paragraph{cis/trans, zusammen/entgegen, syn/anti \& tert}\index{tert}\secidx[tert]{IUPAC Names}\index{cis/trans}\secidx[cis/trans]{IUPAC Names}\index{zusammen/entgegen}\secidx[zusammen/entgegen]{IUPAC Names}\secidx[syn/anti]{IUPAC Names}
\begin{description}
 \item \cmd{cis} \cis
 \item \cmd{trans} \trans
 \item \cmd{Z} \Z
 \item \cmd{E} \E
 \item \cmd{syn} \syn
 \item \cmd{anti} \anti
 \item \cmd{tert} \tert
\end{description}
The package \paket{cool} defines the commands \cmd{E} and \cmd{D}, too. If you load it, the \chemmacros version will only be available inside \cmd{iupac} in the default setting.

\paragraph{ortho/meta/para}\index{ortho/meta/para}\secidx[ortho/meta/para]{IUPAC Names}
\begin{description}
 \item \cmd{ortho} \ortho
 \item \cmd{meta} \meta
 \item \cmd{para} \para
\end{description}

\paragraph{absolute configuration}\index{absolute configuration} (uses \TikZ)
\begin{description}
 \item \cmd{Rconf}[<letter>] \cmd{Rconf}: \Rconf \quad\cmd{Rconf}[]: \Rconf[]
 \item \cmd{Sconf}[<letter>] \cmd{Sconf}: \Sconf \quad\cmd{Sconf}[]: \Sconf[]
\end{description}

Examples:
\begin{beispiel}
 \iupac{\D\-Wein\|s\"aure} = \\
 \iupac{\cip{2S,3S}\-Wein\|s\"aure} \\
 \iupac{\D\-($-$)\-Threose} = \\
 \iupac{\cip{2S,3R}\-($-$)\-2,3,4\-Tri\|hydroxy\|butanal} \\
 \iupac{\cis\-2\-Butene} = \\
 \iupac{\Z\-2\-Butene}, \\
 \iupac{\cip{2E,4Z}\-Hexa\|diene} \\
 \iupac{\meta\-Xylol} = \\
 \iupac{1,3\-Di\|methyl\|benzene}
\end{beispiel}
\secidx*{Stereo Descriptors and Nomenclature}

\subsubsection{Own Naming Commands}\secidx[own]{IUPAC Names}
If you find any commands missing you can define them using
\begin{description}
 \item \cmd{DeclareChemIUPAC}{<cmd>}\ma{<declaration>}
 \item \cmd{RenewChemIUPAC}{<cmd>}\ma{<declaration>}
\end{description}
A command defined in this way will obey the setting of the option \key[option]{iupac}. This means any existing command is only overwritten with \key{iupac}{strict}. However, \cmd{DeclareChemIUPAC} will \emph{not} change the definition of an existing \IUPAC naming command but issue a warning/an error (depending on the package option \key{strict}) if the \IUPAC naming command already exists.
\begin{beispiel}
 % uses the `upgreek' package
 \DeclareChemIUPAC\hapto{$\upeta$}
 Ferrocene = \iupac{bis(\hapto\^5\-cyclo\|penta\|dienyl)iron}
\end{beispiel}

\cmd{RenewChemIUPAC} allows you to redefine the existing iupac naming commands.
\begin{beispiel}
 \iupac{\meta\-Xylol} \\
 \RenewChemIUPAC\meta{\textit{m}}
 \iupac{\meta\-Xylol}
\end{beispiel}

\secidx*{IUPAC Names}

\subsection{Latin Phrases}\secidx{Latin Phrases}
At last there are two commands for common latin phrases.
\begin{description}
 \item \cmd{insitu} \insitu
 \item \cmd{abinitio} \abinitio
\end{description}

If the package \paket{chemstyle} has been loaded, too\footnote{\paket*{chemstyle} defines other similar commands like \etal, \invacuo.}, they are defined using \paket{chemstyle}'s \lstinline+\latin+ command. This means that then the appearance depends on \paket{chemstyle}'s option \texttt{abbremph}:
\begin{beispiel}
 \insitu, \abinitio\\
 \cstsetup{abbremph=false}
 \insitu, \abinitio
\end{beispiel}
If \paket{chemstyle} hasn't been loaded, they're always in \textit{italics}.
\secidx*{Latin Phrases}

\section{Units for the Usage With \textsf{siunitx}}\label{sec:einheiten}\secidx{Units}
In chemistry some non-SI units are very common. \paket{siunitx} provides the command \lstinline+\DeclareSIUnit{<command>}{<unit>}+ to add arbitrary units. \chemmacros uses that command to provide some units. Like all \paket{siunitx} units they're only valid inside \lstinline+\SI{<num>}{<unit>}+ and \lstinline+\si{<unit>}+.
\begin{description}
 \item \cmd{atmosphere} \si{\atmosphere}
 \item \cmd{atm} \si{\atm}
 \item \cmd{calory} \si{\calory}
 \item \cmd{cal} \si{\cal}
 \item \cmd{cmc} \si{\cmc} The units \cmd{cmc}, \cmd{molar}, and \cmd{Molar} are defined by the package \paket{chemstyle} as well. \chemmacros only defines them, if \paket{chemstyle} is not loaded.
 \item \cmd{molar} \si{\molar}
 \item \cmd{moLar} \si{\moLar}
 \item \cmd{Molar} \si{\Molar}
 \item \cmd{MolMass} \si{\MolMass}
 \item \cmd{normal} \si{\normal}
 \item \cmd{torr} \si{\torr}
\end{description}

By the way: \lstinline+\mmHg+ \si{\mmHg} already is defined by \paket{siunitx} and \paket{chemstyle}
\secidx*{Units}

\section{Acid/Base}\label{sec:saeure_base}\secidx{Acid/Base}
Easy representation of \pH, \pKa \ldots (the command \cmd{pKa} depends on the package option \key[option]{german}, see section \ref{sec:optionen}.)
\begin{description}
 \item \cmd{pH} \pH
 \item \cmd{pOH} \pOH
 \item \cmd{Ka} \Ka
 \item \cmd{Kb} \Kb
 \item \cmd{Kw} \Kw
 \item \cmd{pKa}[<num>] \cmd{pKa}: \pKa, \cmd{pKa}[1]: \pKa[1]
 \item \cmd{pKb}[<num>] \cmd{pKb}: \pKb, \cmd{pKb}[1]: \pKb[1]
 \item \cmd{p}{<anything>} \eg \cmd{p}{\cmd{Kw}} \p{\Kw}
\end{description}

\begin{beispiel}
 \Ka \Kb \pKa \pKa[1] \pKb \pKb[1]\\
 \chemsetup[option]{german=true}
 \Ka \Kb \pKa \pKa[1] \pKb \pKb[1]
\end{beispiel}

\achtung{The default appearance of the \p{}-commands has changed to follow \IUPAC recommendations.}
\begin{myquote}[\IUPAC Green Book \cite[][p.\,103]{iupac:greenbook}]
 The operator \p{} […] shall be printed in Roman type.
\end{myquote}

There is one option which changes the style the \p{} is typeset:
\begin{description}
 \item \key[acid-base]{p-style}{italics/slanted/upright} Default = \texttt{upright}
\end{description}
\begin{beispiel}
 \pH, \pKa

 \chemsetup[acid-base]{p-style=slanted} \pH, \pKa
 
 \chemsetup[acid-base]{p-style=italics} \pH, \pKa
\end{beispiel}
\secidx*{Acid/Base}

\section{Oxidation Numbers, Real and Formal Charges}\label{sec:ladungen}
\chemmacros distinguishes between real ($+$/$-$) and formal (\fplus/\fminus) charge symbols, also see section \ref{sec:optionen}. All commands using formal charge symbols start with a \texttt{f}.
\subsection{Ion Charges}\label{ssec:ionen}\secidx{Ion Charges}
Simple displaying of (real) charges:
\begin{description}
 \item \cmd{pch}[<number>] positive charge (\textbf{p}lus + \textbf{ch}arge)
 \item \cmd{mch}[<number>] negative charge (\textbf{m}inus + \textbf{ch}arge)
\end{description}

\begin{beispiel}
 \pch, Na\pch, Ca\pch[2]\\
 \mch, F\mch, S\mch[2]
\end{beispiel}

The same for formal charges:
\begin{description}
 \item \cmd{fpch}[<number>] positive charge
 \item \cmd{fmch}[<number>] negative charge
\end{description}

\begin{beispiel}
 \fpch\ \fmch\ \fpch[3] \fmch[3]
\end{beispiel}

There is a key which influences the behaviour of the charges.
\begin{description}
 \item \key[charges]{append}{\uline{true}/false} if set \texttt{true}, the charge is appended together with an empty group. 
\end{description}
This is how the key influences the behaviour:
\begin{beispiel}
 % uses package `mhchem'
 \chemsetup{charges/append=false,phases/pos=sub}
 \ce{H\pch\aq} \ce{H\aq\pch}

 \chemsetup[charges]{append=true}
 \ce{H\pch\aq} \ce{H\aq\pch}
\end{beispiel}
In most cases this behaviour will be unwanted. However, in some cases it might be useful, for example together with the \cmd{ox} command (see next section):
\begin{beispiel}
 \chemsetup{charges/append=false,phases/pos=sub}
 \ce{\ox{1,H}\pch\aq}

 \chemsetup[charges]{append=true}
 \ce{\ox{1,H}\pch\aq}
\end{beispiel}
\secidx*{Ion Charges}

\subsection{Oxidation Numbers}\label{ssec:oxidationszahlen}\secidx{Oxidation Numbers}
Typesetting oxidation numbers:
\begin{description}
 \item \cmd{ox}[<keyval>]{<number>,<atom>} places \texttt{<number>} above \texttt{<atom>}; \texttt{<number>} has to be a (rational) number!
\end{description}

\begin{beispiel}
 \ox{+1,Na}, \ox{2,Ca}, \ox{-2,S}, \ox{-1,F}
\end{beispiel}

There are a number of keys, that can be used to modify the \cmd{ox} command.
\begin{description}
 \item \key[ox]{parse}{\uline{true}/false} when \texttt{false} an arbitrary entry can be used for \texttt{<number>}. Default = \texttt{true}
 \item \key[ox]{roman}{\uline{true}/false} switches from roman to arabic numbers. Default = \texttt{true}
 \item \key[ox]{pos}{top/super/side}; \texttt{top} places \texttt{<number>} above \texttt{<atom>}, \texttt{super} to the upper right as superscript and \texttt{side} to the right and inside brackets. Default = \texttt{top}
 \item \key[ox]{explicit-sign}{\uline{true}/false} shows the $+$ for positiv numbers and the $\pm$ for $0$. Default = \texttt{false}
 \item \key[ox]{decimal-marker}{comma/point} choice for the decimal marker for formal oxidation numbers like \ox{1.2,X}. Default = \texttt{point}
\end{description}

\begin{beispiel}
 \ox[roman=false]{2,Ca} \ox{2,Ca} \\
 \ox[pos=super]{3,Fe}-Oxide \\
 \ox[pos=side]{3,Fe}-Oxide \\
 \ox[parse=false]{?,Mn}
\end{beispiel}

The \key[ox]{pos}{super} variant also can be set with the shortcut \cmd[oxa]{ox*}:
\begin{beispiel}
 \ox{3,Fe} \ox*{3,Fe}
\end{beispiel}

Using the \key[ox]{explicit-sign} key will always show the sign of the oxidation number:
\begin{beispiel}
 \chemsetup[ox]{explicit-sign = true}
 \ox{+1,Na}, \ox{2,Ca}, \ox{-2,S}, \ch{"\ox{0,F}" {}2}
\end{beispiel}

\begin{beispiel}
 Compare \ox{-1,\ch{O2^2-}} to \ch{"\ox{-1,O}" 2^2-}
\end{beispiel}

Sometimes one might want to use formal oxidation numbers like \num{.5} or $\frac{1}{3}$:
\begin{beispiel}
 \ox{.5,\ch{Br2}} \ch{"\ox{1/3,I}" 3+}
\end{beispiel}

The fraction uses the \lstinline+\sfrac+ command of the \paket{xfrac} package. For this purpose the instance \lstinline+chemmacros-ox-frac+ is defined.
\begin{beispiel}[code only]
\DeclareInstance{xfrac}{chemmacros-ox-frac}{text}
  {
    scale-factor        = 1.2 ,
    denominator-bot-sep = -.5ex ,
    numerator-top-sep   = -.3ex ,
    slash-left-kern     = -.2em ,
    slash-right-kern    = -.2em ,
    slash-symbol-font   = lmr
  }
\end{beispiel}
Of course you can redefine it so that it suits your needs as the output often strongly depends on the used font.
\secidx*{Oxidation Numbers}

\subsection{Partial Charges and Similar Stuff}\label{ssec:partialladungen}\secidx{Partial Charges}
The next ones probably are seldomly needed but nevertheless useful:
\begin{description}
 \item \cmd{delp} \delp\ (\textbf{del}ta + \textbf{p}lus)
 \item \cmd{delm} \delm\ (\textbf{del}ta + \textbf{m}inus)
 \item \cmd{fdelp} \fdelp
 \item \cmd{fdelm} \fdelm
\end{description}

These macros for example can be used with the \cmd{ox} command or with the \paket{chemfig} package:
\begin{beispiel}
 \chemsetup{
   option/circled = all,
   ox/parse       = false
 }
 \ce{\ox{\delp,H}-\ox{\delm,Cl}} \hspace*{1cm}
 \chemfig{\chemabove[3pt]{\lewis{246,Br}}{\delm}-\chemabove[3pt]{H}{\delp}}
\end{beispiel}

The following macros are useful together with \paket{chemfig}, too.
\begin{description}
 \item \cmd{scrp} \scrp\ (\textbf{scr}iptstyle + \textbf{p}lus)
 \item \cmd{scrm} \scrm\ (\textbf{scr}iptstyle + \textbf{m}inus)
 \item \cmd{fscrp} \fscrp
 \item \cmd{fscrm} \fscrm
 \item \cmd{fsscrp} \fsscrp\ (using \lstinline+\scriptscriptstyle+)
 \item \cmd{fsscrm} \fsscrm
\end{description}

\begin{beispiel}
 \setatomsep{1.8em}\chemfig{CH_3-\chemabove{C}{\scrp}(-[6]C|H_3)-\vphantom{H_3}CH_3}
 
 \chemfig{\fmch{}|O-\chemabove{N}{\fscrp}(-[1]O|\fmch)-[7]O|\fmch}
\end{beispiel}
\secidx*{Partial Charges}

\section{Reaction Mechanisms}\label{sec:mechanismen}\secidx{Reaction Mechanisms}
With the command
\begin{description}
 \item\cmd{mech}[<type>]
\end{description}
one can specify the most common reaction mechanisms. \texttt{<type>} can have one of the following values:
\begin{itemize}
 \item\cmd{mech} (empty, no opt. argument) nucleophilic substitution \mech
 \item\cmd{mech}[1] unimolecular nucleophilic substitution \mech[1]
 \item\cmd{mech}[2] bimolecular nucleophilic substitution \mech[2]
 \item\cmd{mech}[se] electrophilic substitution \mech[se]
 \item\cmd{mech}[1e] unimolecular electrophilic substitution \mech[1e]
 \item\cmd{mech}[2e] bimolecular electrophilic substitution \mech[2e]
 \item\cmd{mech}[ar] electrophilic aromatic substitution \mech[ar]
 \item\cmd{mech}[e] elimination \mech[e]
 \item\cmd{mech}[e1] unimolecular elimination \mech[e1]
 \item\cmd{mech}[e2] bimolecular elimination \mech[e2]
 \item\cmd{mech}[cb] unimolecular elimination \enquote{conjugated base}, \ie via carbanion \mech[cb]
\end{itemize}
\secidx*{Reaction Mechanisms}

\section{Redox Reactions}\label{sec:redoxreaktionen}\secidx{Redox Reactions}
\chemmacros provides two commands\footnote{Thanks to \href{http://www.mathannotated.com/}{Peter Cao} who suggested this feature.}, to visualize the transfer of electrons in redox reactions. Both commands are using \TikZ.
\begin{description}
 \item \cmd{OX}{<name>,<atom>}
 \item \cmd{redox}(<name1>,<name2>)[<tikz>][<num>]{<text>}
\end{description}

\cmd{OX} places \texttt{<atom>} into a node, which is named with \texttt{<name>}. If you have set two \cmd{OX}, they can be connected with a line using \cmd{redox}. To do so the names of the two nodes that are to be connected are written in the round braces. Since \cmd{redox} draws a tikzpicture with options \texttt{remember picture,overlay}, the document needs to be \emph{compiled at least two times}.
\begin{beispiel}[ox]
 \OX{a,Na} $\rightarrow$ \OX{b,Na}\pch\redox(a,b){oxidation}
\end{beispiel}
This line can be customized using \TikZ keys in \oa{<tikz>}:
\begin{beispiel}[ox]
 \OX{a,Na} $\rightarrow$ \OX{b,Na}\pch\redox(a,b)[->,red]{ox}
\end{beispiel}

With the argument \oa{<num>} the length of the vertical parts of the line can be adjusted. The default length is \texttt{.6em}. This length is multiplied with \texttt{<num>}. If you use a negative value the line is placed  \emph{below} the text.
\begin{beispiel}[ox]
 \OX{a,Na} $\rightarrow$ \OX{b,Na}\pch
 \redox(a,b)[->,red]{ox}
 \redox(a,b)[<-,blue][-1]{red}
\end{beispiel}
The default length of the vertical lines can be customized with the option
\begin{description}
 \item \key[redox]{dist}{<dim>} A \TeX\ dimension. Default = \texttt{.6em}
\end{description}
\begin{beispiel}[ox]
 \chemsetup{redox/dist=1em}
 \OX{a,Na} $\rightarrow$ \OX{b,Na}\pch\redox(a,b)[->,red]{ox}
\end{beispiel}

Additionally the option
\begin{description}
 \item\key[redox]{sep}{<dim>} Default = \texttt{.2em}
\end{description}
can be used to change the distance between the atom and the beginning of the line.
\begin{beispiel}[ox]
 \chemsetup{redox/sep=.5em}
 \OX{a,Na} $\rightarrow$ \OX{b,Na}\pch\redox(a,b)[->,red]{ox}
\end{beispiel}

Examples:
\begin{beispiel}[ox]
 \ch{ 2 "\OX{o1,Na}" + "\OX{r1,Cl}" {}2 -> 2 "\OX{o2,Na}" \pch{} + 2
"\OX{r2,Cl}" \mch }
 \redox(o1,o2){\small OX: $- 2\el$}
 \redox(r1,r2)[][-1]{\small RED: $+ 2\el$}
\end{beispiel}
\begin{beispiel}[ox]
 \ch{ 2 "\OX{o1,\ox{0,Na}}" + "\OX{r1,\ox{0,Cl}}" {}2 -> 2 "\OX{o2,\ox{+1,Na}}"
\pch{} + 2 "\OX{r2,\ox{-1,Cl}}" \mch }
 \redox(o1,o2){\small OX: $- 2\el$}
 \redox(r1,r2)[][-1]{\small RED: $+ 2\el$}
\end{beispiel}
\bspmidlength{ox}{15mm}
\begin{beispiel}[ox]
 \ch{ 2 "\OX{o1,\ox{0,Na}}" + "\OX{r1,\ox{0,Cl}}" {}2 -> 2 "\OX{o2,\ox{+1,Na}}"
\pch{} + 2 "\OX{r2,\ox{-1,Cl}}" \mch }
 \redox(o1,o2)[draw=red,->][3.33]{\small OX: $- 2\el$}
 \redox(r1,r2)[draw=blue,->]{\small RED: $+ 2\el$}
 \end{beispiel}
\bspmidlength{ox}{7mm}
 \begin{beispiel}[ox]
 \ch{ 2 "\OX{o1,\ox{0,Na}}" + "\OX{r1,\ox{0,Cl}}" {}2 -> 2 "\OX{o2,\ox{+1,Na}}"
\pch{} + 2 "\OX{r2,\ox{-1,Cl}}" \mch }
 \redox(o1,o2)[green,-stealth]{\small OX}
 \redox(r1,r2)[purple,-stealth][-1]{\small RED}
\end{beispiel}
\secidx*{Redox Reactions}

\section{(Standard) State, Thermodynamics}\label{sec:standardstate}\secidx{Thermodynamics}
\subsection{Thermodynamic Variables}\label{ssec:siunitx}
The following commands use \paket{siunitx}:
\begin{description}
 \item \cmd{Enthalpy}[<keyval>](<subscript>){<value>}
 \item \cmd{Entropy}[<keyval>](<subscript>){<value>}
 \item \cmd{Gibbs}[<keyval>](<subscript>){<value>}
\end{description}

Their usage is pretty much self-explaining:
\begin{beispiel}
  \Enthalpy{123} \\
  \Entropy{123} \\
  \Gibbs{123}
\end{beispiel}
The argument \da{<subscript>} adds a subscript for specification: \cmd{Enthalpy}(r){123} \Enthalpy(r){123}.

There are several keys to customize the commands.
\begin{description}
 \item \key*{exponent}{<anything>}
 \item \key*{delta}{<anything>/false}
 \item \key*{subscript}{left/right}
 \item \key*{unit}{<unit>}
\end{description}

The default values depend on the command.
\begin{beispiel}
 \Enthalpy[unit=\kilo\joule]{-285} \\
 \Gibbs[delta=false]{0} \\
 \Entropy[delta=\Delta,exponent=]{56.7}
\end{beispiel}
The unit is set corresponding to the rules of \paket{siunitx} and depends on its settings:
\begin{beispiel}
 \Enthalpy{-1234.56e3} \\
 \sisetup{per-mode=symbol,exponent-product=\cdot,output-decimal-marker={,},group-four-digits=true}
 \Enthalpy{-1234.56e3}
\end{beispiel}

\subsubsection{Create New Variables}
You can use the command
\begin{description}
 \item \cmd{DeclareChemState}[<keyval>]{<name>}\ma{<symbol>}\ma{<unit>}
\end{description}

to create new corresponding commands:
\begin{beispiel}
 \DeclareChemState{Helmholtz}{A}{\kilo\joule\per\mole}
 \DeclareChemState[subscript-left=false,exponent=]{ElPot}{E}{\volt}
 \Helmholtz{123.4} \\
 \ElPot{-1.1} \\
 \ElPot[exponent=0]($\ch{Sn}|\ch{Sn^2+}||\ch{Pb^2+}|\ch{Pb}$){0.01}
\end{beispiel}

The command has some keys with which the default behaviour of the new command can be set.
\begin{description}
 \item \key*{exponent}{<anything>}
 \item \key*{delta}{<anything>/false}
 \item \key*{subscript-left}{true/false}
 \item \key*{subscript}{<anything>}
\end{description}

\subsubsection{Redefine Variables}
With
\begin{description}
 \item \cmd{RenewChemState}[<keyval>]{<name>}\ma{<symbol>}\ma{<unit>}
\end{description}

you can redefine the already existing commands:
\begin{beispiel}
 \RenewChemState{Enthalpy}{h}{\joule}
 \Enthalpy(f){12.5}
\end{beispiel}
The command is analogous to \cmd{DeclareChemState}, \ie it has the same keys.

So \textendash\ for following thermodynamic conventions \textendash\ one could define a molar and an absolute variable:
\begin{beispiel}
 \DeclareChemState[exponent=]{enthalpy}{h}{\kilo\joule\per\mole}% molar
 \RenewChemState[exponent=]{Enthalpy}{H}{\kilo\joule}% absolute
 \enthalpy{-12.3} \Enthalpy{-12.3}
\end{beispiel}

\subsection{State}\label{ssec:state}
The commands presented in section \ref{ssec:siunitx} internally all use the command\footnote{Please note that \ma{<subscript>} is an \emph{optional} argument.}
\begin{description}
 \item \cmd{State}[<keyval>]{<symbol>}\ma{<subscript>}
\end{description}

It can be used to write the thermodynamic variables without value and unit.

Examples:
\begin{beispiel}
 \State{A}, \State{G}{f}, \State[subscript-left=false]{E}{\ch{Na}}, \State[exponent=\SI{1000}{\celsius}]{H}
\end{beispiel}

Again there are some keys to customize the command:
\begin{description}
 \item \key[state]{exponent}{<anything>}
 \item \key[state]{subscript-left}{true/false}
 \item \key[state]{delta}{<anything>/false}
\end{description}
\secidx*{Thermodynamics}

\section{Spectroscopy}\label{sec:spektroskopie}\secidx{Spectroscopy}
If substances are examined wether they are what they're supposed to, one often needs NMR spectroscopy. Measured results then are written in a way like: \NMR(400)[CDCl3] = \num{1.59}\ldots\ \chemmacros provides a command which simplifies writing this down (uses \paket{siunitx}).
\begin{description}
 \item \cmd{NMR}{<num>,<elem>}\da{<num>,<unit>}\oa{<solvent>}
 \item \cmd{NMR*}{<num>,<elem>}\da{<num>,<unit>}\oa{<solvent>}
\end{description}

\emph{All} arguments are optional! Without arguments we get\footnote{All arguments can be combined freely, the command can also be used in math mode.}:
\begin{beispiel}
 \NMR \\
 \NMR*
\end{beispiel}
With the first argument you can specify the kind of NMR:
\begin{beispiel}
 \NMR{13,C}
\end{beispiel}
With the second argument the frequency (in \si{\mega\hertz}) can be specified:
\begin{beispiel}
 \NMR(400)
\end{beispiel}
You also can change the unit:
\begin{beispiel}
 \NMR(4e8,\hertz)
\end{beispiel}
Please note that the setup of \paket{siunitx} also has an impact on this command:
\begin{beispiel}
 \sisetup{exponent-product=\cdot}\NMR(4e8,\hertz)
\end{beispiel}
And finally with the third argument the solvent can be specified:
\begin{beispiel}
 \NMR[CDCl3]
\end{beispiel}

With the keys
\begin{description}
 \item\key[nmr]{unit}{<unit>} Default = \lstinline=\mega\hertz=
 \item\key[nmr]{nucleus}{\ma{<num>,<elem>}} Default = \ma{1,H}
\end{description}
the default unit and the default nucleus can be changed.

Examples:
\begin{beispiel}
 {\chemsetup[nmr]{nucleus={13,C}}\NMR(100) \NMR*(100) } \\
 \NMR*{19,F}[CFCl3] \NMR*{19,F}(285)[CFCl3] \\
 \NMR(400)[CDCl3] = \num{1.59} (q, 1\ch{H}, \textit{J} = \SI{11.6}{\hertz}, H-4)
\end{beispiel}
\secidx*{Spectroscopy}

\section{Commands for \textsf{mhchem}}\label{sec:mhchem}\secidx{Commands for mhchem}
\paket{mhchem} isn't loaded automatically any more but only if you've specified \key[option]{method}{mhchem} in the preamble. In the default settings \chemmacros uses \chemformula instead.

\chemmacros provides only one command specifically for \paket{mhchem}\footnote{\chemformula provides its own possibility.}. It is meant to place text below of compounds.
\begin{description}
 \item \cmd{mhName}[<keyval>]{<formula>}\ma{<text>}
\end{description}

For example:
\begin{beispiel}
 \ce{4 C2H5Cl + Pb / Na -> \mhName{Pb(C2H5)4}{former antiknock additive} + NaCl}
\end{beispiel}

There are several keys to customize \cmd{mhName}.
\begin{description}
 \item \key[mhName]{align}{<alignment command>} the alignment of the text in the box it is placed in, default = \lstinline+\centering+
 \item \key[mhName]{format}{<anything>} the format of the text
 \item \key[mhName]{fontsize}{<font size command>} the fontsize of the text, default = \lstinline+\tiny+
 \item \key[mhName]{width}{<dim>/auto} the width of the box the text is placed in, default = \texttt{auto}
\end{description}
\begin{beispiel}
 \ce{4 C2H5Cl + Pb / Na -> \mhName[fontsize=\footnotesize]{Pb(C2H5)4}{former antiknock additive} + NaCl}\\
 \chemsetup[mhName]{align=\raggedright,fontsize=\small,format=\bfseries\color{red},width=3cm}
 \ce{4 C2H5Cl + Pb / Na -> \mhName{Pb(C2H5)4}{former antiknock additive} + NaCl}
\end{beispiel}
\secidx*{Commands for mhchem}

\section{Reaction Environments}\label{ssec:mhchem_reaktionen}\secidx{Reaction Environments}
\subsection{Defined by \chemmacros}
You can use these environments for numbered\ldots
\begin{description}
 \item \env{reaction}{<formula or mhchem code>}
 \item \env{reactions}{<formula or mhchem code>}
\end{description}

\ldots and their starred versions for unnumbered reactions.
\begin{description}
 \item \env{reaction*}{<formula or mhchem code>}
 \item \env{reactions*}{<formula or mhchem code>}
\end{description}

With them you can create (un)numbered reaction equations similar to mathematical equations.

The environments \texttt{reaction}/\texttt{reaction*} use the \texttt{equation}/\texttt{equation*} environments and the environments \texttt{reactions}/\texttt{reactions*} use the \texttt{align}/\texttt{align*} environments to display the reactions.

\begin{beispiel}
 Reaction with counter:
 \begin{reaction}
  A -> B
 \end{reaction}
\end{beispiel}

\begin{beispiel}
 Reaction without counter:
 \begin{reaction*}
  C -> D
 \end{reaction*}
\end{beispiel}

\begin{beispiel}
 Several aligned reactions with counter:
 \begin{reactions}
  A     &-> B + C \\
  D + E &-> F
 \end{reactions}
\end{beispiel}

\begin{beispiel}
 Several aligned reactions without counter:
 \begin{reactions*}
  G     &-> H + I \\
  J + K &-> L
 \end{reactions*}
\end{beispiel}

If you want to change the layout of the counter tags, you can use

\cmd{renewtagform}{<tagname>}\oa{<format>}\ma{<right delim>}\ma{<left delim>}\footnote{Provided by the \paket*{mathtools} package}.

\begin{beispiel}
 \renewtagform{reaction}[R \textbf]{[}{]}
 \begin{reaction}
  H2O + CO2 <<=> H2CO3
 \end{reaction}
\end{beispiel}

\subsection{Own Reactions}
You can create new types of reactions with the command:
\begin{description}
 \item \cmd{DeclareChemReaction}[<keyval>]{<name>}\ma{<math name>}
\end{description}

\texttt{<name>} will be the name of the new environment. \texttt{<math name>} is the used math environment.

The command has two keys.
\begin{description}
 \item\key*{star}{\uline{true}/false}
 \item\key*{arg}{\uline{true}/false}
\end{description}
There is \key*{star}, which will also define a starred version of the new environment, if the starred math environment exists. If it doesn't exist, this will cause an error.

Then there is \key*{arg}, which is used to define an environment with a mandatory argument. Of course this only works, if the used math environment has a mandatory argument.

The predefined environments are defined via
\begin{description}
 \item \cmd{DeclareChemReaction}[star]{reaction}\ma{equation} and
 \item \cmd{DeclareChemReaction}[star]{reactions}\ma{align}.
\end{description}

Let's suppose, you'd like to have the alignment behaviour of the \texttt{alignat} environment for \chemformula/\paket{mhchem} reactions. You could do the following:

\cmd{DeclareChemReaction}[star,arg]{reactionsat}\ma{alignat}

With this the \texttt{reactionsat} environment is defined.
\begin{beispiel}
 \DeclareChemReaction[star,arg]{reactionsat}{alignat}
 \begin{reactionsat}{3}
  A     &-> B     &&-> C     &&-> D \\
  aaaaa &-> bbbbb &&-> ccccc &&-> ddddd
 \end{reactionsat}
 \begin{reactionsat*}{2}
  A     &-> B     & C            &-> D  \\
  aaaaa &-> bbbbb &\quad{} ccccc &-> ddddd
 \end{reactionsat*}
\end{beispiel}

\subsection{List of Reactions}
\chemmacros also provides a command to display a list of the reactions created with the \lstinline+reaction+ environment.
\begin{description}
 \item\cmd{listofreactions}
\end{description}
\begin{beispiel}[below]
 \listofreactions
\end{beispiel}

The Output of this list can be modified by two options:
\begin{description}
 \item\key[reaction]{list-name}{<name of the list>} Let's you set the name of the list manually. Default = \texttt{List of reactions}
 \item\key[reaction]{list-entry}{<prefix to each entry>} Let's you set a prefix to each list entry. Default = \texttt{Reaction}
\end{description}
Both default option values recognize the package option \key[option]{german}.

Instead of using the option \key{list-name} you also could redefine \cmd{reactionlistname}.

The list lists all reactions with a number and disregards reactions without number. All reaction environments without star have an optional argument which let's you add a description (or caption) for the entry in the list.
\begin{beispiel}
 \begin{reaction}[Autoprotolyse]
  2 H2O <<=> H3O+ + OH-
 \end{reaction}
\end{beispiel}
\secidx*{Reaction Environments}

\section{Phases}\label{sec:phasen}\secidx{Phases}
\subsection{Basics}\secidx[basics]{Phases}
These commands are intended to indicate the phase of a compound.
\begin{description}
 \item \cmd{sld} \sld
 \item \cmd{lqd} \lqd
 \item \cmd{gas} \gas
 \item \cmd{aq} \aq
\end{description}

\achtung{The default behaviour of the phases commands has changed to be consistent with \IUPAC recommendations. Both \cmd{sld} and \cmd{lqd} have lost their optional argument.}

\begin{beispiel}
 \ch{C\sld{} + 2 H2O\lqd{} -> CO2\gas{} + 2 H2\gas}\\
 To make it complete: NaCl\aq.
\end{beispiel}

With the package option \key{german} (see section \ref{sec:optionen}) you get the german versions:
\begin{beispiel}
 \chemsetup[option]{german=true}
 \ch{C\sld{} + 2 H2O\lqd{} -> CO2\gas{} + 2 H2\gas}
\end{beispiel}

The \IUPAC recommendation\footnote{Thanks to Paul King for pointing this out.} to indicate the state of aggregation is to put it in parentheses after the compound \cite{iupac:greenbook}. However, you might want to put it as a subscript which is also very common.

\begin{myquote}[{\IUPAC Green Book \cite[][p.\,54]{iupac:greenbook}}]
 The [\ldots] symbols are used to represent the states of aggregation of chemical species. The letters are appended to the formula in parentheses and should be printed in Roman (upright) type without a full stop (period).
\end{myquote}

There are two options to customize the output:
\begin{description}
 \item \key[phases]{pos}{side/sub} Switch the position of the phase indicator. Default = \texttt{side}
 \item \key[phases]{space}{<dim>} Change the default spacing between compound a phase indicator if \key{pos}{side}. A \TeX\ dimension. Default = \texttt{.1333em}
\end{description}
\begin{beispiel}
 \chemsetup[phases]{pos=sub}
 \ch{C\sld{} + 2 H2O\lqd{} -> CO2\gas{} + 2 H2\gas}\\
 To make it complete: NaCl\aq.
\end{beispiel}

\subsection{Define Own Phases}\secidx[own]{Phases}
Depending on the subject of your document you might need to indicate other states of aggregation. You can easily define them.
\begin{description}
 \item \cmd{DeclareChemPhase}{<cmd>}\oa{<german>}\ma{<english>}
 \item \cmd{RenewChemPhase}{<cmd>}\oa{<german>}\ma{<english>}
 \item \cmd{phase}{<phase>} If you need a phase indicator just once or twice.
\end{description}
\cmd{DeclareChemPhase} only defines a phase if \texttt{<cmd>} is not already used by any other command. If it \emph{is} already used \chemmacros will either give a warning or an error, depending on the option \key{strict}. \cmd{RenewChemPhase} \emph{only} defines a phase if \texttt{<cmd>} \emph{is} already used and issues a warning/error otherwise.
\begin{beispiel}
 \DeclareChemPhase{\aqi}{aq,$\infty$}% aqueous solution at infinite dilution
 \DeclareChemPhase{\cd}{cd}% condensed phase
 \RenewChemPhase{\lqd}{lc}% liquid crystal
 NaOH\aqi\ \ch{H2O\cd} U\phase{cr} A\lqd \\
 \chemsetup[phases]{pos=sub}
 NaOH\aqi\ \ch{H2O\cd} U\phase{cr} A\lqd
\end{beispiel}
\secidx*{Phases}

\section{Newman Projections}\label{sec:newman}\secidx{Newman Projections}
\chemmacros provides the command
\begin{description}
 \item \cmd{newman}[<keyval>]\da{<angle>}\ma{<1>,<2>,<3>,<4>,<5>,<6>}
\end{description}
which allows you to create newman projections (uses \TikZ). With \texttt{<angle>} the back atoms are rotated counter clockwise with respect to the front atoms.
\begin{beispiel}
 \newman{} \newman(170){}
 \newman{1,2,3,4,5,6} \newman{1,2,3} \newman{,,,4,5,6}
\end{beispiel}

Several keys allow customization:
\begin{description}
 \item \key[newman]{angle}{<angle>} default angle
 \item \key[newman]{scale}{<factor>} scale the whole projection
 \item \key[newman]{ring}{<tikz>} customize the ring with \TikZ keys
 \item \key[newman]{atoms}{<tikz>} customize the nodes within which the atoms are set
 \item \key[newman]{back-atoms}{<tikz>} explicitly customize the back atoms
\end{description}

\begin{beispiel}
 \chemsetup[newman]{angle=45} \newman{}
 \newman[scale=.75,ring={draw=blue,fill=blue!20}]{}
\end{beispiel}
\begin{beispiel}
 \chemsetup[newman]{atoms={draw=red,fill=red!20,inner sep=2pt,rounded corners}}
 \newman{1,2,3,4,5,6}
\end{beispiel}
\begin{beispiel}
 \chemsetup[newman]{
   atoms = {draw=red,fill=red!20,inner sep=2pt,rounded corners},
   back-atoms = {draw=blue,fill=blue!20,inner sep=2pt,rounded corners}
 }
 \newman{1,2,3,4,5,6} \newman(170){1,2,3,4,5,6}
\end{beispiel}
\secidx*{Newman Projections}

\section{s, p, and Hybrid Orbitals}\label{sec:orbitale}\secidx{Orbitals}
\chemmacros provides the following command to create orbitals:
\begin{description}
 \item \cmd{orbital}[<keyval>]{<type}
\end{description}

There are the following types available for \texttt{<type>}:
\begin{description}
 \item \texttt{s}
 \item \texttt{p}
 \item \texttt{sp}
 \item \texttt{sp2}
 \item \texttt{sp3}
\end{description}

\begin{beispiel}
 \orbital{s} \orbital{p} \orbital{sp} \orbital{sp2} \orbital{sp3}
\end{beispiel}

Depending on the type you have different keys to modify the orbitals:
\begin{description}
 \item \key[orbital]{phase}{\uline{+}/-} changes the phase of the orbital (all types)
 \item \key[orbital]{scale}{<factor>} changes the size of the orbital (all types)
 \item \key[orbital]{color}{<color>} changes the color of the orbital (all types)
 \item \key[orbital]{angle}{<angle>} rotates the orbitals with a p contribution counter clockwise (all types except \texttt{s})
 \item \key[orbital]{half}{\uline{true}/false} displays only half an orbital (only \texttt{p})
\end{description}

\begin{beispiel}
 \orbital{s} \orbital[phase=-]{s} 
 \orbital{p} \orbital[phase=-]{p}
 \orbital{sp3} \orbital[phase=-]{sp3}
 
 \orbital[angle=0]{p} \orbital[color=red!50]{p} \orbital[angle=135,scale=1.5]{p} \orbital[half]{p}
\end{beispiel}

Additionally there are two keys, with which the \TikZ behaviour can be changed.
\begin{description}
 \item \key[orbital]{overlay}{\uline{true}/false} the orbital \enquote{doesn't need space}; it is displayed with the \TikZ option \texttt{overlay}.
 \item \key[orbital]{opacity}{<num>} the orbital becomes transparent; \texttt{<value>} can have values between \texttt{1} (fully opaque) to \texttt{0} (invisible).
\end{description}

\begin{beispiel}
 \vspace{1cm}\hspace{1cm}
 \chemsetup[orbital]{
   overlay,
   p/color = black!70
 }
 \setbondoffset{0pt}
 \chemfig{?\orbital{p}-[,1.3]{\orbital[phase=-]{p}}-[:30,1.1]\orbital{p}-[:150,.9]{\orbital[phase=-]{p}}-[4,1.3]\orbital{p}-[:-150,1.1]{\orbital[phase=-]{p}}?}
 \vspace{1cm}
\end{beispiel}
\begin{beispiel}
 \vspace{2cm}\hspace{2cm}
 \setbondoffset{0pt}
 \chemsetup[orbital]{
   overlay ,
   opacity = .75 ,
   p/scale = 1.6 ,
   s/color = blue!50 ,
   s/scale = 1.6
 }
 \chemfig{\orbital{s}-[:-20]{\orbital[scale=2]{p}}{\orbital[half,angle=0]{p}}{\orbital[angle=170,half]{p}}{\orbital[angle=-150,half]{p}}(-[:-150]\orbital{s})-\orbital{s}}
 \vspace{2cm}
\end{beispiel}
\secidx*{Orbitals}

\section{Key Overview}\label{sec:overview}\secidx{Option Overview (chemmacros)}
In the table below all keys provided by \chemmacros for customization are listed. All keys that belong to a module can be set with 
\begin{description}
 \item \cmd{chemsetup}[<module>]{<keyval>} or
 \item \cmd{chemsetup}{<module>/<keyval>}.
\end{description}
Some keys can be set without value. Then the \uline{underlined} value is used.
\small
\begin{longtable}{>{\ttfamily\color{key}\hspace{5mm}}l>{\ttfamily\color{module}}l>{\ttfamily}l>{\ttfamily}ll}
 \toprule
 \normalfont\normalcolor\bfseries key & \normalfont\normalcolor\bfseries module & \normalfont\bfseries values & \normalfont\bfseries default & \\
 \midrule
 \endhead
 \bottomrule
 \endfoot
 \multicolumn{5}{l}{package options:} \\
 bpchem              & option   & \uline{true}/false       & false                 & page \pageref{key:option_bpchem} \\
 circled             & option   & formal/\uline{all}/none  & formal                & page \pageref{key:option_circled} \\
 circletype          & option   & chem/math                & chem                  & page \pageref{key:option_circletype} \\
 german              & option   & \uline{true}/false       & false                 & page \pageref{key:option_german} \\
 ghs                 & option   & \uline{true}/false       & true                  & page \pageref{key:option_ghs} \\
 iupac               & option   & auto/restricted/strict   & auto                  & page \pageref{key:option_iupac} \\
 method              & option   & chemformula/formula      & formula               & page \pageref{key:option_method} \\
 Nu                  & option   & chemmacros/mathspec      & chemmacros            & page \pageref{key:option_Nu} \\
 strict              & option   & \uline{true}/false       & false                 & page \pageref{key:option_strict} \\
 synchronize         & option   & \uline{true}/false       & false                 & page \pageref{key:option_synchronize} \\
 upgreek             & option   & none/textgreek/\uline{upgreek} & upgreek         & page \pageref{key:option_upgreek} \\
 version             & option   & 1/2/bundle               & bundle                & page \pageref{key:option_version} \\
 xspace              & option   & \uline{true}/false       & true                  & page \pageref{key:option_xspace} \\
 \multicolumn{5}{l}{\cmd{ba}, \cmd{Nu}:} \\
 elpair              & particle & \uline{dots}/dash/false  & false                 & page \pageref{key:particle_elpair} \\
 \multicolumn{5}{l}{\cmd{pch}, \cmd{mch}, \cmd{fpch}, \cmd{fmch}:} \\
 append              & charges  & \uline{true}/false       & false                 & page \pageref{key:charges_append} \\
 \multicolumn{5}{l}{acid/base:} \\
 p-style             & acid-base & slanted/italics/upright & upright               & page \pageref{key:acid-base_p-style} \\
 \multicolumn{5}{l}{\cmd{ox}:} \\
 parse               & ox       & \uline{true}/false       & true                  & page \pageref{key:ox_parse} \\
 roman               & ox       & \uline{true}/false       & true                  & page \pageref{key:ox_roman} \\
 pos                 & ox       & top/super/side           & top                   & page \pageref{key:ox_pos} \\
 explicit-sign       & ox       & \uline{true}/false       & false                 & page \pageref{key:ox_explicit-sign} \\
 decimal-marker      & ox       & comma/point              & point                 & page \pageref{key:ox_decimal-marker} \\
 \multicolumn{5}{l}{\cmd{OX}, \cmd{redox}:} \\
 dist                & redox    & <dim>                    & .6em                  & page \pageref{key:redox_dist} \\
 sep                 & redox    & <dim>                    & .2em                  & page \pageref{key:redox_sep} \\
 \multicolumn{5}{l}{\cmd{Enthalpy}, \cmd{Entropy}, \cmd{Gibbs}:} \\
 exponent            &          & <anything>               & \cmd{standardstate}   & page \pageref{key:none_exponent} \\
 delta               &          & <anything>/false         &                       & page \pageref{key:none_delta} \\
 subscript           &          & left/right               &                       & page \pageref{key:none_subscript} \\
 unit                &          & <unit>                   &                       & page \pageref{key:none_unit} \\
 \multicolumn{5}{l}{\cmd{DeclareChemState}, \cmd{RenewChemState}:} \\
 exponent            &          & <anything>               & \cmd{standardstate}   & page \pageref{key:none_exponent} \\
 delta               &          & <anything>/false         &                       & page \pageref{key:none_delta} \\
 subscript           &          & <anything>               &                       & page \pageref{key:none_subscript} \\
 subscript-left      &          & \uline{true}/false       &                       & page \pageref{key:none_subscript-left} \\
 \multicolumn{5}{l}{\cmd{State}:} \\
 exponent            & state    & <anything>               & \cmd{standardstate}   & page \pageref{key:state_exponent} \\
 delta               & state    & <anything>/false         &                       & page \pageref{key:state_delta} \\
 subscript-left      & state    & \uline{true}/false       &                       & page \pageref{key:state_subscript-left} \\
 \multicolumn{5}{l}{\cmd{NMR}:} \\
 unit                & nmr      & <unit>                   & \cmd{mega}\cmd{hertz} & page \pageref{key:nmr_unit} \\
 nucleus             & nmr      & \{<num>,<atom symbol>\}  & \{1,H\}               & page \pageref{key:nmr_nucleus}  \\
 \multicolumn{5}{l}{\cmd{DeclareChemReaction}:} \\
 star                &          & \uline{true}/false       & false                 & page \pageref{key:none_star} \\
 arg                 &          & \uline{true}/false       & false                 & page \pageref{key:none_arg} \\
 list-name           & reaction & <anything>               & List of reactions     & page \pageref{key:reaction_list-name} \\
 list-entry          & reaction & <anything>               & Reaction              & page \pageref{key:reaction_list-entry} \\
 \multicolumn{5}{l}{\cmd{mhName}:} \\
 align               & mhName   & <alignment>              & \cmd{centering}       & page \pageref{key:mhName_align} \\
 format              & mhName   & <commands>               &                       & page \pageref{key:mhName_format} \\
 fontsize            & mhName   & <fontsize>               & \cmd{tiny}            & page \pageref{key:mhName_fontsize} \\
 width               & mhName   & <dim>                    &                       & page \pageref{key:mhName_width} \\
 \multicolumn{5}{l}{phases:} \\
 pos                 & phases   & side/sub                 & side                  & page \pageref{key:phases_pos} \\
 space               & phases   & <dim>                    & .1333em               & page \pageref{key:phases_space} \\
 \multicolumn{5}{l}{\cmd{newman}:} \\
 angle               & newman   & <angle>                  & 0                     & page \pageref{key:newman_angle} \\
 scale               & newman   & <factor>                 & 1                     & page \pageref{key:newman_scale} \\
 ring                & newman   & <tikz>                   &                       & page \pageref{key:newman_ring} \\
 atoms               & newman   & <tikz>                   &                       & page \pageref{key:newman_atoms} \\
 back-atoms          & newman   & <tikz>                   &                       & page \pageref{key:newman_back-atoms} \\
 \multicolumn{5}{l}{\cmd{orbital} \ttfamily <type> = s/p/sp/sp2/sp3:} \\
 phase               & orbital/<type>  & +/-               & +                     & page \pageref{key:orbital_phase} \\
 scale               & orbital/<type>  & <factor>          & 1                     & page \pageref{key:orbital_scale} \\
 color               & orbital/<type>  & <color>           & black                 & page \pageref{key:orbital_color} \\
 angle               & orbital/<type>  & <angle>           & 90                    & page \pageref{key:orbital_angle} \\
 half                & orbital/p       & \uline{true}/false & false                & page \pageref{key:orbital_half} \\
 overlay             & orbital  & \uline{true}/false       & false                 & page \pageref{key:orbital_overlay} \\
 opacity             & ornital  & <num>                    & 1                     & page \pageref{key:orbital_opacity}
\end{longtable}
\normalsize\secidx*{Option Overview (chemmacros)}
\secidx*{CHEMMACROS}

\part{\texorpdfstring{\Chemformula}{chemformula}}\chemsetup[chemformula]{format=}\secidx{CHEMFORMULA}
\section{Setup}
All of \chemformula's options belong to the module \textcolor{module}{\texttt{chemformula}}. This means they can be setup with
\begin{beispiel}[code only]
 \chemsetup[chemformula]{<options>} or
 \chemsetup{chemformula/<option1>,chemformula/<option2>}
\end{beispiel}

\section{The Basic Principle}
\chemformula offers one main command.
\begin{description}
 \item\cmd{ch}[<options>]{<input>}
\end{description}
The usage will seem very familiar to you if you're familiar with \paket{mhchem}:
\begin{beispiel}
 \ch{H2O} \\
 \ch{Sb2O3} \\
 \ch{H+} \\
 \ch{CrO4^2-} \\
 \ch{AgCl2-} \\
 \ch{[AgCl2]-} \\
 \ch{Y^{99}+} \\
 \ch{Y^{99+}} \\
 \ch{H2_{(aq)}} \\
 \ch{NO3-} \\
 \ch{(NH4)2S} \\
 \ch{^{227}_{90}Th+} \\
 $V_{\ch{H2O}}$ \\
 \ch{Ce^{IV}} \\
 \ch{KCr(SO4)2 * 12 H2O}
\end{beispiel}

However, there are differences. The most notable one: \chemformula distinguishes between different types of input. These different parts \emph{have} to be seperated with blanks:
\begin{description}
 \item\cmd{ch}{part1 part2 part3 part4}
\end{description}
A blank in the input \emph{never} is a blank in the output. This role of the blank strictly holds and disregarding it can have unexpected results and even lead to errors.

Another notable difference: \chemformula tries to avoid math mode whenever possible:
\begin{beispiel}
 \ch{A + B ->[a] C} \\
 \ce{A + B ->[a] C}
\end{beispiel}

This means that \cmd{ch}{2H2O} is recognized as a \emph{single} part, which in this case is recognized as a compound.
\begin{beispiel}
 \ch{2H2O} \\
 \ch{2 H2O}
\end{beispiel}
This also means, that a part cannot contain a blank since this will automatically divide it into two parts. If you need an extra blank in the output you need to use \lstinline+~+. However, since commands in most cases gobble a space after them a input like \cmd{ch}{\textbackslash command ABC} will be treated as a single part. If you want or need to divide them you need to add an empty group: \cmd{ch}{\textbackslash command\{\} ABC}. The different input types are described in the following sections.

There are some options to customize the output of the \cmd{ch} command. They can either be applied locally using the optional argument or can be set globally using the setup command. All options of \chemformula belong to the module \textcolor{module}{\texttt{chemformula}}.
\begin{description}
 \item\cmd{chemsetup}[chemformula]{<options>}
\end{description}

\section{Stoichiometric Factors}\secidx{Stoichiometric Factors}
A stoichiometric factor may only contain of numbers and the signs \lstinline+.,_/()+
\begin{beispiel}
 \ch{2} \\
 \ch{12}

 % decimals:
 \ch{3.5} \\
 \ch{5,75}

 % fractions:
 \ch{3/2} \\
 \ch{1_1/2}
\end{beispiel}

You have to be a little bit careful with the right syntax but I believe it is rather intuitive.
\begin{beispiel}[code only]
 this won't work but will result in an error: \ch{1/1_1}
\end{beispiel}

If stoichiometric factors are enclosed with parentheses the fractions are not recognized. What's inside the parenthesis is typeset as is. \begin{beispiel}
 \ch{(1/2) H2O} \ch{1/2 H2O} \ch{0.5 H2O}
\end{beispiel}
You can find many examples like the following for stoichiometric factors in parentheses in the \IUPAC Green Book \cite{iupac:greenbook}:
\begin{reaction*}
 (1/5) K "\ox*{7,Mn}" O4 + (8/5) HCl == (1/5) "\ox*{2,Mn}" Cl2 + (1/2) Cl2 + (1/5) KCl + (4/5) H2O
\end{reaction*}

There are a few possibilities to customize the output.
\begin{description}
 \item \key{decimal-marker}{<marker>} the symbol to indicate the decimal. Default = \texttt{.}
 \item \key{frac-style}{math/xfrac/nicefrac} determines how fractions are displayed. Default = \texttt{math}
 \item \key{stoich-space}{<dim>} The space that is placed after the stoichiometric factor. Default = \lstinline=.1667em=
\end{description}
\begin{beispiel}
 \ch[decimal-marker={,}]{3.5} \ch[decimal-marker={$\cdot$}]{3,5} 
\end{beispiel}

The option \key{frac-style}{xfrac} uses the \lstinline+\sfrac+ command of the \paket{xfrac} package. The output strongly depends on the font you use.\secidx[xfrac]{Stoichiometric Factors}
\begin{beispiel}
 \ch[frac-style=xfrac]{3/2} \ch[frac-style=xfrac]{1_1/2}
\end{beispiel}
\chemformula defines the instance \lstinline=formula-text-frac= which you can redefine to your needs. See the \paket{xfrac} documentation for further information. The default definition is this:
\begin{beispiel}[code only]
 \DeclareInstance{xfrac}{chemformula-text-frac}{text}
  {
    slash-left-kern  = -.15em ,
    slash-right-kern = -.15em
  }
\end{beispiel}
This document uses the font Linux Libertine and the following definition:
\begin{beispiel}[code only]
 \DeclareInstance{xfrac}{chemformula-text-frac}{text}
  {
    scale-factor        = 1 ,
    denominator-bot-sep = -.2ex ,
    denominator-format  = \scriptsize #1 ,
    numerator-top-sep   = -.2ex ,
    numerator-format    = \scriptsize #1
  }
\end{beispiel}

The option \key{frac-style}{nicefrac} uses the \lstinline+\nicefrac+ command of the \paket{nicefrac} package.\secidx[nicefrac]{Stoichiometric Factors}
\begin{beispiel}
 \ch[frac-style=nicefrac]{3/2} \ch[frac-style=nicefrac]{1_1/2}
\end{beispiel}

The option \key{stoich-space} allows you to customize the space between stoichiometric factor and the group following after it.\secidx[space]{Stoichiometric Factors}
\begin{beispiel}
 \ch{2 H2O} \\
 \ch[stoich-space=.3em]{2 H2O}
\end{beispiel}
\secidx*{Stoichiometric Factors}

\section{Compounds}\label{ssec:compounds}\secidx{Compounds}
\chemformula determines compounds as the type that \enquote{doesn't fit in anywhere else}. This point will become more clear when you know what the other types are.
\begin{beispiel}
 \ch{H2SO4} \\
 \ch{[Cu(NH3)4]^2+}
\end{beispiel}

\subsection{Adducts}\secidx[adducts]{Compounds}
\chemformula has two identifiers which will create adducts.
\begin{description}
 \item \cmd{ch}{A.B}
 \item \cmd{ch}{A*B}
\end{description}
\begin{beispiel}
 \ch{CaSO4.H2O} \\
 \ch{CaSO4*H2O}
\end{beispiel}
Since numbers in a compound always are treated as subscripts (see section \ref{ssec:subscripts}) you sometimes need to introduce stoichiometric factors for the right output:
\begin{beispiel}
 \ch{Na3PO4*12H2O} \\
 \ch{Na3PO4* 12 H2O} \\
 \ch{Na3PO4 * 12 H2O}
\end{beispiel}

\subsection{Subscripts}\label{ssec:subscripts}\secidx[subscripts]{Compounds}
\emph{All} numbers in a compound are treated as subscripts.
\begin{beispiel}
 \ch{H2SO4}
\end{beispiel}
If you want a letter to be a subscript you can use the math syntax:
\begin{beispiel}
 \ch{A_nB_m}
\end{beispiel}
The subscript recognizes groups. You can also use math inside it.
\begin{beispiel}
 \ch{A_{$n$}B_{$m$}} \\
 \ch{NaCl_{(aq)}}
\end{beispiel}

\subsection{Commands}\secidx[commands]{Compounds}
Commands are allowed in a compound:
\begin{beispiel}
 \ch{\textbf{A2}B3} \ch{A2\color{red}B3}
\end{beispiel}
However, if the commands demand numbers as argument, \eg space commands or \chemmacros' \lstinline+\ox+ command the direct use will fail. This is because the numbers are treated as subscripts \emph{before} the command expands.
\begin{beispiel}[code only]
 \ch{A\hspace{2mm}B} will raise an error because \hspace sees something like this: \hspace{$_2$mm}.
\end{beispiel}
See section \ref{ssec:text} for a way around this.

\subsection{Charges and Other Superscripts}\secidx[charges]{Compounds}\secidx[superscripts]{Compounds}
\paragraph{Basics}
If a compound \emph{ends} with a plus or minus sign it will be treated as charge sign and typeset as superscript. In other places a plus is treated as a triple bond and a dash will be used as a single bond, see section \ref{ssec:bonds}.
\begin{beispiel}
 \ch{A+B} \ch{AB+} \\
 \ch{A-B} \ch{AB-}
\end{beispiel}

For longer charge groups or other superscripts you can use the math syntax. It recognizes groups and you can use math inside them. Inside these groups neither \texttt{+} nor \texttt{-} are treated as bonds. If a dot \texttt{.} is inside a superscript it is treated as indicator for a radical. A \texttt{*} gives the excited state.
\begin{beispiel}
 \ch{A^{x-}} \\
 \ch{A^x-} \\
 \ch{A^{x}-} \\
 \ch{A^{$x-$}} \\
 \ch{RNO2^{-.}} \\
 \ch{^31H} \\
 \ch{^{14}6C} \\
 \ch{^{58}_{26}Fe} \\
 \ch{NO^*}
\end{beispiel}

Ions and ion composites with more than one charge can be typeset quite as easy:
\begin{beispiel}
 \ch{SO4^2-} \ch{Ca^2+ SO4^2-}
\end{beispiel}

\paragraph{Charge Commands}\secidx[superscripts!charge commands]{Compounds}
You don't need to use \cmd{mch} and related commands inside \cmd{ch}. Indeed, you \emph{shouldn't} use them as they might mess with the subscript and superscript alignment. The \chemmacros option \texttt{circled} is obeyed by \cmd{ch}.
\begin{beispiel}
 \chemsetup[option]{circled=all}
 \ch{H+ + OH- <=> H2O}
\end{beispiel}

\paragraph{Behaviour}\secidx[superscripts!behaviour]{Compounds}
The supercripts behave differently depending on their position in a compound, if there are super- and subscripts following each other directly.
\begin{beispiel}
 \ch{^33B} \ch{{}^33B} \ch{3^3B} \ch{B^3} \ch{B3^3} \\
 \ch{^{23}_{123}B} \ch{{}^{23}_{123}B}  \ch{_{123}^{23}B} \ch{B^{23}} \ch{B_{123}^{23}} \\
 \ch{^{123}_{23}B} \ch{{}^{123}_{23}B}  \ch{_{23}^{123}B} \ch{B^{123}} \ch{B23^{123}}
\end{beispiel}
\begin{itemize}
 \item If a compound \emph{starts} with a sub- or superscript both sub- and superscript are aligned to the \emph{right} else to the \emph{left}.
 \item If a \emph{does not start} with a sub- or superscript and there is both a sub- and a superscript, the superscript is shifted additionally by a length determined from the option \key{charge-hshift}{<dim>}, also see page \pageref{key:charge-hshift}f.
\end{itemize}
The second point follows \IUPAC's recommendations:
\begin{myquote}[{\IUPAC Green Book \cite[][p.\,51]{iupac:greenbook}}]
 In writing the formula for a complex ion, spacing for charge number can be added (staggered arrangement), as well as parentheses: \ch[charge-hshift=full]{SO4^2-}, \ch{(SO4)^2-} The staggered arrangement is now recommended.
\end{myquote}

\subsection{Bonds}\label{ssec:bonds}\secidx[bonds]{Compounds}
There are three kinds of bonds:
\begin{beispiel}
 single: \ch{CH3-CH3} \\
 double: \ch{CH2=CH2} \\
 triple: \ch{CH+CH}
\end{beispiel}

\subsection{Customization}\secidx[customization]{Compounds}
These options allow you to customize the ouptut of the compounds:
\begin{description}
 \item \key{subscript-vshift}{<dim>} Extra vertical shift of the subscripts. Default = \texttt{0pt}
 \item \key{subscript-style}{text/math} Style that is used to typeset the subscripts. Default = \texttt{text}
 \item \key{charge-hshift}{<dim>} Shift of superscripts when following a subscript. Default = \texttt{.5ex}\label{key:charge-hshift}
 \item \key{charge-vshift}{<dim>} Extra vertical shift of the superscripts. Default = \texttt{0pt}
 \item \key{charge-style}{text/math} Style that is used to typeset the superscripts. Default = \texttt{text}
 \item \key{adduct-space}{<dim>} Space to the left and the right of the adduct point. Default = \lstinline+.1333em+
 \item \key{bond-length}{<dim>} The length of the bonds. Default is the length of an endash as measured by \lstinline+\settowidth{<len>}{\textendash}+.
\end{description}
Maybe you have noticed that charges of certain ions are shifted to the right.\secidx[charges!shift]{Compounds} They are shifted if they \emph{follow} a subscript which follows \IUPAC recommendations \cite[][p.\,51]{iupac:greenbook}. The amount of the shift can be set with the option \key{charge-hshift}.
\begin{beispiel}
 \ch{SO4^2-} \ch{NH4+} \ch{Na+} \\
 \chemsetup[chemformula]{charge-hshift=.5ex}
 \ch{SO4^2-} \ch{NH4+} \ch{Na+} \\
 \chemsetup[chemformula]{charge-hshift=.5pt}
 \ch{SO4^2-} \ch{NH4+} \ch{Na+}
\end{beispiel}

Despite \IUPAC's recommendation \chemformula does not make a fully staggered arrangements in the default setting as I find it hard to read in some cases and ugly in others. Since this is a subjective decision \chemformula not only let's you define the absolute amount of the shift but also provides a possibility for full staggered arrangements. For this you have to use \key{charge-hshift}{full}.
\begin{beispiel}
 \ch[charge-hshift=0pt]{C5H11+} \ch[charge-hshift=0pt]{SO4^2-} \\
 \ch{C5H11+} \ch{SO4^2-} \\
 \ch[charge-hshift=1ex]{C5H11+} \ch[charge-hshift=1ex]{SO4^2-} \\
 \ch[charge-hshift=full]{C5H11+} \ch[charge-hshift=full]{SO4^2-}
\end{beispiel}

If you don't want the charges to be typeset in text mode you can switch to math mode:
\begin{beispiel}
 \ch{M^x+} \ch{SO4^2-} \\
 \chemsetup[chemformula]{charge-style = math}
 \ch{M^x+} \ch{SO4^2-}
\end{beispiel}

The option \key{subscript-vshift} can be used to adjust the vertical shift of the subscripts:\secidx[subscripts!shift]{Compounds}
\begin{beispiel}
 \ch{H2SO4} \ch{Na3PO4} \\
 \chemsetup[chemformula]{subscript-vshift=.5ex}
 \ch{H2SO4} \ch{Na3PO4} \\
 \chemsetup[chemformula]{subscript-vshift=-.2ex}
 \ch{H2SO4} \ch{Na3PO4}
\end{beispiel}

You can choose the mode subscripts are typeset in the same way as it is possible for the charges:
\begin{beispiel}
 \ch{A_nB_m} \ch{H2SO4} \\
 \chemsetup[chemformula]{subscript-style = math}
 \ch{A_nB_m} \ch{H2SO4}
\end{beispiel}

The option \key{adduct-space} sets the space left and right to the adduct symbol $\cdot$.
\begin{beispiel}
 \ch{Na3PO3*H2O} \\
 \chemsetup[chemformula]{adduct-space=.2em}
 \ch{Na3PO3*H2O}
\end{beispiel}

Changing the length of the bonds:\secidx[bonds!length]{Compounds}
\begin{beispiel}
 \chemsetup[chemformula]{bond-length=4mm}%
 single: \ch{CH3-CH3} \\
 double: \ch{CH2=CH2} \\
 triple: \ch{CH+CH}
\end{beispiel}
\secidx*{Compounds}

\section{Special Input Types}\secidx{Special Types}
There are some \enquote{special type} input groups. These are groups which consist of only one token, namely of the following ones:
\begin{description}
 \item \cmd{ch}{ + } \ch{+} creates the plus sign between compounds with space around it:\\
 \cmd{ch}{2 Na + Cl2} \ch{2 Na + Cl2}
 \item \cmd{ch}{ v } \ch{v} sign for precipitate: \cmd{ch}{BaSO4 v} \ch{BaSO4 v}
 \item \cmd{ch}{ \lstinline+^+ } \ch{^} sign for escaping gas\footnotemark: \cmd{ch}{\lstinline=H2 ^=} \ch{H2 ^}
\end{description}
\footnotetext{Is this the correct English term? Please correct me if it isn't.}

The space left and right of the plus sign can be set with this option:
\begin{description}
 \item \key{plus-space}{<dim>} Default = \lstinline+.3em+
\end{description}
\begin{beispiel}
 \ch{A + B}\\
 \ch[plus-space=4pt]{A + B}
\end{beispiel}
\secidx*{Special Types}

\section{Escaped Input}\secidx{Escaped Input}
In some cases it may be desirable to prevent \chemformula from parsing the input. This can be done in two ways.
\subsection{Text}\label{ssec:text}\secidx[text]{Escaped Input}
If you put something between \lstinline+" "+ or \lstinline+' '+ then the input will be treated as normal text, except that spaces are not allowed and have to be input with \lstinline+~+.
\begin{description}
 \item \cmd{ch}{ "<escaped text>" }
 \item \cmd{ch}{ '<escaped text>' }
\end{description}
\begin{beispiel}
 \ch{"\ox{2,Ca}" O} \\
 \ch{"\ldots\," Na + "\ldots\," Cl2 -> "\ldots\," NaCl} \\
 \ch{'A~->~B'}
\end{beispiel}
In many cases you won't need to escape the input. But when you get into trouble when using a command inside \cmd{ch} try hiding it.

\subsection{Math}\secidx[math]{Escaped Input}
If you espacially want to input math you just enclose it with \lstinline+$ $+. This output is different from the escaped text as it is followed by a space.
\begin{description}
 \item \cmd{ch}{ \lstinline"$<escaped math>$" }
\end{description}
\begin{beispiel}
 escaped text: \ch{"$x$" H2O} \\
 escaped math: \ch{$x$ H2O} \\
 \ch{$2n$ Na + $n$ Cl2 -> $2n$ NaCl}
\end{beispiel}

The space that is inserted after a math group can be edited:
\begin{description}
 \item \key{math-space}{<dim>} Default = \lstinline=.1667em=
\end{description}
\begin{beispiel}
 \ch{$2n$ Na + $n$ Cl2 -> $2n$ NaCl} \\
 \chemsetup[chemformula]{math-space=.2em}
 \ch{$2n$ Na + $n$ Cl2 -> $2n$ NaCl} \\
 \ch{$A->B$}
\end{beispiel}
\secidx*{Escaped Input}

\section{Arrows}\label{sec:arrows}\secidx{Arrows}
\subsection{Arrow types}\secidx[types]{Arrows}
Arrows are input in the same intuitive way they are with \paket{mhchem}. There are various different types:
\begin{description}
 \item \cmd{ch}{ -> } \ch{->} standard right arrow
 \item \cmd{ch}{ <- } \ch{<-} standard left arrow
 \item \cmd{ch}{ -/> } \ch{-/>} does not react (right)
 \item \cmd{ch}{ </- } \ch{</-} does not react (left)
 \item \cmd{ch}{ <-> } \ch{<->} resonance arrow
 \item \cmd{ch}{ <> } \ch{<>} reaction in both directions
 \item \cmd{ch}{ == } \ch{==} stoichiometric equation
 \item \cmd{ch}{ <=> } \ch{<=>} equilibrium arrow
 \item \cmd{ch}{ \lstinline+<=>>+ } \ch{<=>>} unbalanced equilibrium arrow to the right
 \item \cmd{ch}{ \lstinline+<<=>+ } \ch{<<=>} unbalanced equilibrium arrow to the left
 \item \cmd{ch}{ <o> } \ch{<o>} isolobal arrow
\end{description}
All these arrows are drawn with \TikZ.
\begin{beispiel}
 \ch{H2 + Cl2 -> 2 HCl} \\
 \ch{H2O + CO3^2- <=> OH- + HCO3-} \\
 \ch{A <- B} \\
 \ch{\{[CH2=CH-CH2]- <-> [CH2-CH=CH2]- \}} \\
 \ch{A <> B} \\
 \ch{H+ + OH- <=>> H2O} \\
 \ch{2 NO2 <<=> N2O4}
\end{beispiel}

\subsection{Labels}\secidx[labels]{Arrows}
The arrows take two optional arguments to label them.
\begin{description}
 \item\cmd{ch}{ ->[<above>][<below>] }
\end{description}
\begin{beispiel}
 \ch{A ->[a] B} \\
 \ch{A ->[a][b] B} \\
 \ch{A ->[\SI{100}{\celsius}] B}
\end{beispiel}
The label text can be parsed seperately from the arrow. The recipe is easy: leave blanks.
\begin{beispiel}
 \ch{A ->[H2O] B} \\
 \ch{A ->[ H2O ] B} \\
 \ch{A ->[ "\ox{2,Ca}" F2 ] B} \\
 \ch{A ->[$\Delta$,~ \[H+ \]] B}
\end{beispiel}
If you leave the blanks \chemformula treats the groups inside the square brackets as seperated input types. The arrow reads its arguments \emph{afterwards}. As you can see the arrows \enquote{grow} with the length of the labels. What stays constant is the part that protrudes the labels. As you also can see in the last example square brackets inside the arrow arguments should be produced using \cmd{[} and \cmd{]}. They keep their usual meaning outside \cmd{ch}. These commands are necessary since the usual grouping (\ie hiding the brackets inside curly brackets) doesn't work due to the way \cmd{ch} reads its argument.
\begin{beispiel}
 \ch{A ->[a] B} \\
 \ch{A ->[ab] B} \\
 \ch{A ->[abc] B} \\
 \ch{A ->[abc~abc] B} \\
 % needs the `chemfig' package:
 \setatomsep{15pt}
 \ch{A ->[ "\chemfig{-[:30]-[:-30]OH}" ] B} \\
 \ch{A ->[[]] B} vs. \ch{A ->[\[\]] B}
\end{beispiel}

\subsection{Customization}\secidx[customization]{Arrows}
These are the options which enable you to customize the arrows:
\begin{description}
 \item \key{arrow-offset}{<dim>} This is the length that an arrow protrudes a label on both sides. This means an empty arrow's length is two times \texttt{arrow-offset}. Default = \texttt{1.5ex}
 \item \key{arrow-yshift}{<dim>} Shifts an arrow up (positive value) or down (negative value). Default = \texttt{0pt}
 \item \key{arrow-ratio}{<factor>} The ratio of the arrow lengths of the unbalanced equilibrium. \texttt{.4} would mean that the length of the shorter arrow is $0.4\times$ the length of the longer arrow. Default = \texttt{.6}
%  \item \key{arrow-tips}{<type>} This specifies the arrow tips. In principle all of \TikZ' arrows could be used. However, this option requires \texttt{<type>} to be an arrow tip itself \emph{and} to have a \texttt{left <type>} and \texttt{right <type>} to be defined. This means if you don't define any arrow tips yourself you can only choose between \texttt{cf} and \texttt{to}. Default = \texttt{cf}
%  \item \key{arrow-style}{<tikz>} \TikZ keys for free customization of the arrows.
 \item \key{compound-sep}{<dim>} The space between compounds and the arrows. Default = \texttt{1ex}
 \item \key{label-offset}{<dim>} The space between the labels and the arrows. Default = \texttt{2pt}
 \item \key{label-style}{<font command>} The relative font size of the labels. Default = \lstinline+\footnotesize+
\end{description}

The following code shows the effect of the different options on the \lstinline+<=>>+ arrow:
\begin{beispiel}
 standard: \ch{A <=>>[x][y] B} \\
 longer: \ch[arrow-offset=12pt]{A <=>>[x][y] B} \\
 higher: \ch[arrow-yshift=2pt]{A <=>>[x][y] B} \\
 more balanced: \ch[arrow-ratio=.8]{A <=>>[x][y] B} \\
 labels further away: \ch[label-offset=4pt]{A <=>>[x][y] B} \\
 larger distance to compounds: \ch[compound-sep=2ex]{A <=>>[x][y] B} \\
 smaller labels: \ch[label-style=\tiny]{A <=>[x][y] B}
\end{beispiel}

\subsection{Modify Arrow Types}\secidx[types!modify]{Arrows}
The arrows are defined with the command
\begin{description}
 \item \cmd{DeclareChemArrow}{<tokens>}\ma{<tikz>}
\end{description}
\ma{<tokens>} is the sequence of tokens that is replaced with the actual arrow code. For example the basic arrow is defined via
\begin{beispiel}[code only]
 \DeclareChemArrow{->}{\draw[-cf] (cf_arrow_start) -- (cf_arrow_end) ;}
\end{beispiel}
In order to define arrows yourself you need to know the basics of \TikZ\footnote{Please see the \textsf{pgfmanual} for details.}. There are some predefined coordinates you can and should use:
\begin{description}
 \item[\texttt{(cf\_arrow\_start)}] The beginning of the arrow.
 \item[\texttt{(cf\_arrow\_end)}] The end of the arrow.
 \item[\texttt{(cf\_arrow\_mid)}] The mid of the arrow.
 \item[\texttt{(cf\_arrow\_mid\_start)}] The beginning of the shorter arrow in types like \lstinline+<=>>+.
 \item[\texttt{(cf\_arrow\_mid\_end)}] The end of the shorter arrow in types like \lstinline+<=>>+.
 \item[\texttt{cf}, \texttt{left cf}, \texttt{right cf}] \chemformula's own arrow heads.
\end{description}
\begin{beispiel}
 \DeclareChemArrow{.>}{\draw[-cf,dotted,red] (cf_arrow_start) -- (cf_arrow_end);}
 \DeclareChemArrow{n>}{\draw[-cf] (cf_arrow_start) .. controls ([yshift=3ex]cf_arrow_mid) .. (cf_arrow_end);}
 \ch{A .> B} \ch{A .>[a][b] B} \ch{A n> B}
\end{beispiel}
If you want to redefine an existing arrow there are two commands you can use:
\begin{description}
 \item \cmd{RenewChemArrow}{<tokens>}\ma{<tikz>}
 \item \cmd{ShowChemArrow}{<tokens>}
\end{description}
The second one gives the current definition, the first one redefines an existing arrow.
\begin{beispiel}
 \texttt{\ShowChemArrow{->}} \\
 \RenewChemArrow{->}{\draw[->,red] (cf_arrow_start) -- (cf_arrow_end) ;}
 \texttt{\ShowChemArrow{->}} \\
 \ch{A -> B}
\end{beispiel}
\secidx*{Arrows}

\section{Names}\secidx{Names}
\subsection{Syntax}\secidx[syntax]{Names}
\chemformula has a built-in syntax to write text under a compound. In a way it works very similar to the arrows.
\begin{description}
 \item\cmd{ch}{ !(<name>)( <formula> ) }
\end{description}
If an exclamation mark is followed by a pair of parentheses \chemformula will parse it this way:
\begin{beispiel}
 \ch{!(ethanol)( CH2CH2OH )}
\end{beispiel}
The same what's true for the arrows arguments holds for these arguments: if you leave blanks the different parts will be treated according to their input type before the text is set below the formula.
\begin{beispiel}
 \ch{!(water)(H2O)} \quad
 \ch{!( "\textcolor{blue}{water}" )( H2O )} \quad
 \ch{!( $2n-1$ )( H2O )} \quad
 \ch{!( H2O )( H2O )} \quad
 \ch{!(oxonium)( H3O+ )}
\end{beispiel}
If for some reason you want to insert an exclamation mark \emph{without} it creating a name you only have to make sure it isn't followed by parentheses.
\begin{beispiel}
 \ch{H2O~(!)} \\
 \ch{A!{}()}
\end{beispiel}

\subsection{Customization}\secidx[customization]{Names}
\chemformula provides two options to customize the output of the names:
\begin{description}
 \item \key{name-format}{<commands>} The format of the name. This can be arbitrary input. Default = \lstinline+\scriptsize\centering+
 \item \key{name-width}{<dim>/auto} The width of the box where the label is put into. \texttt{auto} will detect the width of the name and set the box to this width. Default = \texttt{auto}
\end{description}
\begin{beispiel}
 \ch{!(acid)( H2SO4 ) -> B} \\
 \ch[name-format=\sffamily\small]{!(acid)( H2SO4 ) -> B} \\
 \ch[name-format=\scriptsize N:~]{!(acid)( H2SO4 ) -> B} \\
 \ch[name-width=3em,name-format=\scriptsize\raggedright]{!(acid)( H2SO4 ) -> B}
\end{beispiel}
\secidx*{Names}

\section{Format and Font}\secidx{Format and Font}
In the standard setting \chemformula doesn't make any default changes to the font of the formula output. Let's take a look at a nonsense input which shows all features:
\begin{beispiel}
 \newcommand*\sample{\ch{H2C-C+C-CH=CH+ + CrO4^2- <=>[x][y] 2.5 Cl^{-.} + 3_1/2 Na*OH_{(aq)} + !(name)( A^n ) "\LaTeXe"}}
 \sample
\end{beispiel}
\newcommand*\sample{\ch{H2C-C+C-CH=CH+ + CrO4^2- <=>[x][y] 2.5 Cl^{-.} + 3_1/2 Na*OH_{(aq)} + !(name)( A^n ) "\LaTeXe"}}
Now we're going to change different aspects of the font a look what happens:
\begin{beispiel}[below]
 \sffamily Hallo \sample \\
 \ttfamily Hallo \sample \normalfont \\
 \bfseries Hallo \sample \normalfont \\
 \itshape Hallo \sample
\end{beispiel}
As you can see most features adapt to the surrounding font.

If you want to change the default format you need to use this option:
\begin{description}
 \item \key{format}{<anything>} Adds arbitrary code before the output of \cmd{ch}.
\end{description}
\begin{beispiel}
 \definecolor{newblue}{rgb}{.1,.1,.5}\chemsetup[chemformula]{format=\color{newblue}\sffamily}
 \sffamily Hallo \sample \\
 \ttfamily Hallo \sample \normalfont \\
 \bfseries Hallo \sample \normalfont \\
 \itshape Hallo \sample
\end{beispiel}

You can also specifically change the fontfamily, fontseries and fontshape of the output.
\begin{description}
 \item \key{font-family}{<family>} Changes the fontfamily of the output with \lstinline+\fontfamily{<family>}\selectfont+.
 \item \key{font-series}{<series>} Changes the fontseries of the output with \lstinline+\fontseries{<series>}\selectfont+.
 \item \key{font-shape}{<shape>} Changes the fontshape of the output with \lstinline+\fontshape{<shape>}\selectfont+.
\end{description}
\begin{beispiel}
 \chemsetup[chemformula]{font-series=bx}
 Hallo \sample \\
 \sffamily Hallo \sample \normalfont \\
 \chemsetup[chemformula]{font-family=lmr,font-series=m} Hallo \sample \normalfont \\
 \itshape Hallo \sample
\end{beispiel}

If you're using \XeLaTeX\ or \LuaLaTeX\ and have loaded \paket{fontspec} you have the possibilty to set the font with it:
\begin{description}
 \item \key{font-spec}{\{<font>\}} or with options
 \item \key{font-spec}{\{[<options>]<font>\}}
\end{description}
\begin{beispiel}
 \chemsetup[chemformula]{font-spec={Linux Biolinum O}} \sample \\
 \chemsetup[chemformula]{font-spec={[Color=darkgray]Augie}} \sample \\
 \chemsetup[chemformula]{font-spec={Tipbrush Script}} \sample \\
 \chemsetup[chemformula]{font-spec={Latin Modern Sans}} \sample \\
 \bfseries \sample \normalfont \\
 \chemsetup[chemformula]{font-spec={Feathergraphy Decoration}} \sample
\end{beispiel}
\secidx*{Format and Font}

\section{Usage In Math Equations}\secidx{Math Environments}
The \cmd{ch} command can be used inside math equations. It recognizes \lstinline+\\+ and \lstinline+&+ and passes them on. However, you can't use the optional arguments of \lstinline+\\+ inside \cmd{ch}.
\begin{beispiel}
 \begin{align}
  \ch{
    H2O & ->[a] H2SO4 \\
    Cl2 & ->[x][y] CH4
  }
 \end{align}
 \begin{align*}
 \ch{
   RNO2      &<=>[ + e- ] RNO2^{-.} \\
   RNO2^{-.} &<=>[ + e- ] RNO2^2-
 }
 \end{align*}
\end{beispiel}
\secidx*{Math Environments}

\section{Further Examples}
This section just presents some examples of a possible usage.

\begin{beispiel}
 \begin{reaction}[Synthese von Alkanen]
  !(Synthesegas)( $n$ CO + $(2n+1)$ H2 ) ->[\SI{200}{\celsius}][\[CoNi\]] C_{$n$}H_{$2n+2$} + $n$ H2O
 \end{reaction}
\end{beispiel}

\begin{beispiel}
 \begin{reactions*}
  "a)" && CH4    + Cl2 &-> CH3Cl  + HCl && "{\small Chlormethan/Methylchlorid}" \\
  "b)" && CH3Cl  + Cl2 &-> CH2Cl2 + HCl && "{\small Dichlormethan/Methylenchlorid}" \\
  "c)" && CH2Cl2 + Cl2 &-> CHCl3  + HCl && "{\small Trichlormethan/Chloroform}" \\
  "d)" && CHCl3  + Cl2 &-> CCl4   + HCl && "{\small Tetrachlormethan/Tetrachlorkohlenstoff}"
 \end{reactions*}
\end{beispiel}

\begin{beispiel}
 \chemsetup[ox]{parse=false}\ch{"\ox{\delm,C}" -{} "\ox{\delp,M}" \qquad ( <-> "\ox{\delp,C}" -{} "\ox{\delm,Br}" )} \\
 \ch[adduct-space=0pt]{X. + .Y <=> X-Y + Bindungsenergie} \\
 \ch[name-format=\normalsize]{!(\State{H}{f}\qquad)() !(\textcolor{red}{??})( CH4\gas{} ) + !(\num{0})( 2 O2\gas{} ) -> !(\num{-94.3})( CO2\gas{} ) + !(\num{-57.9})( H2O\lqd{} ) + !(\num{-192.1})( "\State{H}" )}
\end{beispiel}

\begin{beispiel}
 \begin{reactions*}
  CH3MgBr + "\ox*{1,Cu}" X &-> "\glqq" CH3 "\ox*{1,Cu}\grqq" + MgBrX "\qquad X~$=$~Br,I,CN" \\
  2 MeLi + CuI             &-> !(Dimethylcuprat~(Gilmann-Cuprat))( Me2CuLi ) + Li
 \end{reactions*}
\end{beispiel}

\begin{beispiel}
 % needs `chemfig'
 \begin{reactions*}
  H3C-CH3 + Cl2                           &->[$\Delta$][$h\nu$] H3CCH2Cl + HCl       & &"\Enthalpy{-27.1}" \\
  H3C-CH3 + "\Lewis{0.,Cl}"               &-> H3CCH2 "\Lewis{0.,\vphantom{H}}" + HCl & &"\Enthalpy{-5.0}" \\
  H3C-CH2 "\Lewis{0.,\vphantom{H}}" + Cl2 &-> H3CCH2Cl + "\Lewis{0.,Cl}"             & &"\Enthalpy{-23.0}"
 \end{reactions*}
\end{beispiel}
\secidx*{CHEMFORMULA}

\part{\texorpdfstring{\Ghsystem}{ghsystem}}\secidx{GHSYSTEM}
\section{Setup}
All of \ghsystem's options belong to the module \textcolor{module}{\texttt{ghsystem}}. This means they can be setup with
\begin{beispiel}[code only]
 \chemsetup[ghsystem]{<options>} or
 \chemsetup{ghsystem/<option1>,ghsystem/<option2>}
\end{beispiel}

\section{Get Hazard and Precautionary Statements}\secidx{Hazard and Precautionary Statements}
\subsection{Simple Statements}\secidx[get statements]{GHSYSTEM}
The general usage is simple: you use the command
\begin{description}
 \item\cmd{ghs}[<options>]{<type>}{<number>}
 \item\cmd[ghsa]{ghs*}[<options>]{<type>}{<number>}
\end{description}
There are three types available: \texttt{h}, \texttt{euh} and \texttt{p}. The \ma{<type>} argument is case insensitive, so just type them in as you like.
\begin{beispiel}
 \ghs{h}{200} \\
 \ghs{H}{224} \\
 \ghs{euh}{001} \\
 \ghs{Euh}{202} \\
 \ghs{p}{201}
\end{beispiel}

The starred version hides the identifier and only gives the statement. If you want to hide the statement itself instead you can use the option:
\begin{description}
 \item\key{hide}{\uline{true}/false}
\end{description}

There is an option to customize the output, too.
\begin{description}
 \item\key{space}{<space command>} Space between \texttt{<type>} and \texttt{<number>}.
\end{description}
\begin{beispiel}
 \ghs{h}{200} \\
 \ghs[space=\,]{h}{200} \\
 \ghs*{h}{200} \\
 \ghs[hide]{h}{200}
\end{beispiel}

\subsection{Statements with Placeholders}\secidx[statements with placeholders]{GHSYSTEM}
Some of the statements contain placeholders. They can be one of the following:
\begin{itemize}
 \item \textit{\textless state route of exposure if it is conclusively proven that no other routes of exposure cause the hazard\textgreater}
 \item \textit{\textless state specific effect if known\textgreater}
 \item \textit{\textless or state all organs affected, if known\textgreater}
 \item \textit{\textless name of sensitising substance\textgreater}
\end{itemize}

Except the last one which needs to be filled in, they are hidden per default. They can be made visible with the option
\begin{description}
 \item\key{fill-in}{\uline{true}/false} Show placeholders. Default = \texttt{false}
\end{description}
\begin{beispiel}[below]
 \ghs{h}{340} \\
 \ghs[fill-in]{h}{340} \\
 \ghs{h}{360} \\
 \ghs[fill-in]{h}{360} \\
 \ghs{h}{370} \\
 \ghs[fill-in]{h}{370} \\
 \ghs{euh}{208} \\
 \ghs[fill-in]{euh}{208}
\end{beispiel}

These placeholders can be replaced with one of these options:
\begin{description}
 \item\key{exposure}{<text>} exposure placeholder
 \item\key{effect}{<text>} effect placeholder
 \item\key{organs}{<text>} organ placeholder
 \item\key{substance}{<text>} substance placeholder
\end{description}
\begin{beispiel}
 \ghs[exposure=This is how you get exposed.]{h}{340} \\
 \ghs[effect=These are the effects.]{h}{360} \\
 \ghs[organs=to this organ]{h}{370} \\
 \ghs[substance=substance]{euh}{208}
\end{beispiel}

\subsection{Statements with Gaps}\secidx[statements with gaps]{GHSYSTEM}
Some of the statements have gaps that can be filled.
\begin{beispiel}
 \ghs{p}{301} \\
 \ghs{p}{401} \\
 \ghs{p}{411} \\
 \ghs{p}{413}
\end{beispiel}

These gaps can be filled using these options:
\begin{description}
 \item\key{text}{<text>}
 \item\key{dots}{<text>}
 \item\key{C-temperature}{<num>}
 \item\key{F-temperature}{<num>}
 \item\key{kg-mass}{<num>}
 \item\key{lbs-mass}{<num>}
\end{description}
\begin{beispiel}
 \ghs[dots=contact physician!]{p}{301} \\
 \ghs[text=here]{p}{401} \\
 \ghs[C-temperature=50, F-temperature=122]{p}{411} \\
 \ghs[kg-mass=5.0, lbs-mass=11, C-temperature=50, F-temperature=122]{p}{413}
\end{beispiel}

\subsection{Combined Statements}\secidx[combined statements]{GHSYSTEM}
There are some combinations of statements. They are input with a \texttt{+} between the numbers:
\begin{beispiel}[below]
 \ghs{p}{235+410} \\
 \ghs{p}{301+330+331}
\end{beispiel}

Note that you can only get combinations that officially exist. \emph{You can't combine freely}.
\secidx*{Hazard and Precautionary Statements}

\section{Pictograms}\secidx{Pictograms}
\subsection{The Pictures}
The GHS defines a number of pictograms:

\ghspic{explos} \ghspic{flame} \ghspic{flame-O} \ghspic{bottle} \ghspic{acid} \ghspic{skull} \ghspic{exclam} \ghspic{health} \ghspic{aqpol}

The command
\begin{description}
 \item\cmd{ghspic}[<options>]{<name>}
\end{description}
loads them. \ref{tab:ghs_pictograms} shows all available pictograms and their names. To be more precise: it shows the names to use with the \cmd{ghspic} command. The file names are \lstinline=ghsystem_<name>.<filetype>= where \texttt{<filetype>} is \texttt{eps}, \texttt{jpg} or \texttt{png}, see also section \ref{ssec:picture_type}.
\begin{beispiel}
 \ghspic{skull}
\end{beispiel}

If you don't like the default size you can change it using this option:
\begin{description}
 \item\key{scale}{<factor>} Scales the pictogram. Default = \texttt{1}
\end{description}
The pictures are actually quite large. The default setting scales them by a factor of $\frac{1}{20}$.
\begin{beispiel}
 \ghspic[scale=2]{skull}
\end{beispiel}

If you want to use some specific \lstinline=\includegraphics= options, \eg if you want to rotate the pictogram for soma reason, use this option:
\begin{description}
 \item\key{includegraphics}{\{<includegraphics keyvals>\}}
\end{description}
\begin{beispiel}
 \ghspic[includegraphics={angle=90}]{skull}
\end{beispiel}

\begin{longtable}{>{\ttfamily}ll>{\ttfamily}ll}
    \caption{All available GHS pictograms.\label{tab:ghs_pictograms}} \\
  \toprule
    \normalfont\bfseries name & \bfseries pictogram & \normalfont\bfseries name & \bfseries pictogram \\
  \midrule\endfirsthead
  \toprule
    \normalfont\bfseries name & \bfseries pictogram & \normalfont\bfseries name & \bfseries pictogram \\
  \midrule\endhead
  \bottomrule\endfoot
  explos              & \ghspic{explos}          & explos-1            & \ghspic{explos-1} \\
  explos-2            & \ghspic{explos-2}        & explos-3            & \ghspic{explos-3} \\
  explos-4            & \ghspic{explos-4}        & explos-5            & \ghspic{explos-5} \\
  explos-6            & \ghspic{explos-6}        & & \\
  flame               & \ghspic{flame}           & flame-2-white       & \ghspic{flame-2-white} \\
  flame-2-black       & \ghspic{flame-2-black}   & flame-3-white       & \ghspic{flame-3-white} \\
  flame-3-black       & \ghspic{flame-3-black}   & flame-4-1           & \ghspic{flame-4-1} \\
  flame-4-2           & \ghspic{flame-4-2}       & flame-4-3-white     & \ghspic{flame-4-3-white} \\
  flame-4-3-black     & \ghspic{flame-4-3-black} & flame-5-2-white     & \ghspic{flame-5-2-white} \\
  flame-5-2-black     & \ghspic{flame-5-2-black} & & \\
  flame-O             & \ghspic{flame-O}         & flame-O-5-1         & \ghspic{flame-O-5-1} \\
  bottle              & \ghspic{bottle}          & bottle-2-black      & \ghspic{bottle-2-white} \\
  bottle-2-white      & \ghspic{bottle-2-black}  & & \\
  acid                & \ghspic{acid}            & acid-8              & \ghspic{acid-8} \\
  skull               & \ghspic{skull}           & skull-2             & \ghspic{skull-2} \\
  skull-6             & \ghspic{skull-6}         & & \\
  exclam              & \ghspic{exclam}          & & \\
  health              & \ghspic{health}          & & \\
  aqpol               & \ghspic{aqpol}           & & \\
\end{longtable}

\subsection{Picture Type Depending on Engine}\label{ssec:picture_type}
As you probably know you can't use every picture type with every compiler engine. \pdfTeX\ in \textsc{dvi} mode \emph{needs} \texttt{eps} pictures while \pdfTeX\ in \textsc{pdf} mode, \XeTeX\ and \LuaTeX\ convert \texttt{eps} pictures into \texttt{pdf} files, given they have the rights to write in the directory the pictures are saved in.

However, the latter can include \texttt{jpg} and \texttt{png} without any problems, while \pdfTeX\ in \textsc{dvi} mode can't.

To resolve this \ghsystem tests which engine is used and if \pdfTeX\ which mode is used and then chooses either \texttt{eps} or \texttt{png} for the pictograms. You are free to choose the picture type yourself with the option
\begin{description}
 \item\key{pic-type}{eps/jpg/png}
\end{description}
\secidx*{Pictograms}

\section{Available Languages}
Right now the H and P statements are only available in English or German. The package adapts the package option \key[option]{german} but does not (yet) recognize language settings by \paket{babel} or \paket{polyglossia}.

You can also choose the language explicitly.
\begin{description}
 \item\key{language}{english/german}
\end{description}
\begin{beispiel}
 \ghs{h}{201}

 \chemsetup[ghsystem]{language=german}
 \ghs{h}{201}
\end{beispiel}

I will add other languages some time in future. This may take a while, though. If you would be willing to contribute and write the statements of another language please feel free to contact me\footnote{\href{mailto:contac@mychemistry.eu}{contact@mychemistry.eu}}. I would provide you with a template file, a \texttt{pdf} containing the official translations, and help to all your questions.

\section{List of All Statements}\secidx{List of All Statements}
If for some reason you want to list all sentences you can use
\begin{description}
 \item\cmd{ghslistall}[<options>]
\end{description}

This command has a number of options to customize the table, which is created with the \lstinline=longtable= environment of the \paket{longtable} package.
\begin{description}
 \item\key{table-head-number}{<text>} Default = \texttt{Identifier}
 \item\key{table-head-text}{<text>} Default = \texttt{Statement}
 \item\key{table-next-page}{<text>} Default = \texttt{continues on next page}
 \item\key{table-caption}{<text>} As \texttt{<text>} in \lstinline=\caption{<text>}=. Default = \texttt{All H, EUH, and P Statements.}
 \item\key{table-caption-short}{<text>} As \texttt{<short>} in \lstinline=\caption[<short>]{<text>}=.
 \item\key{table-label}{<text>} The label to refer to the table with \lstinline=\ref= and similar commands. Default = \texttt{tab:ghs-hp-statements}
 \item\key{table-row-sep}{<dim>} The separation of the table rows. A \TeX\ dimension. Default = \texttt{3pt}
 \item\key{table-rules}{\uline{default}/booktabs/none} The style of the horizontal rules in the table. \texttt{default} uses \lstinline=\hline=, \texttt{booktabs} uses \lstinline=\toprule=, \lstinline=\midrule= or \lstinline=\bottomrule=, resp. This option needs the \paket{booktabs} package which you have to load yourself then. Default = \texttt{default}
 \item\key{table-top-head-rule}{\uline{default}/booktabs/none} Change top rule explicitly. Default = \texttt{default}
 \item\key{table-head-rule}{\uline{default}/booktabs/none} Change rule below head explicitly. Default = \texttt{default}
 \item\key{table-foot-rule}{\uline{default}/booktabs/none} Change foot rule explicitly. Default = \texttt{default}
 \item\key{table-last-foot-rule}{\uline{default}/booktabs/none} Change last foot rule explicitly. Default = \texttt{default}
\end{description}

The code below shows how \ref{tab:ghs-hp-statements} was created: 
\begin{beispiel}[code only]
 \ghslistall[fill-in,table-rules=booktabs]
\end{beispiel}

\ghslistall[fill-in,table-rules=booktabs]
\secidx*{List of All Statements}\secidx*{GHSYSTEM}

\appendix
\part{Appendix}\index{APPENDIX@\textbf{APPENDIX}}
\section*{Suggestions and Bug Reports}\addcontentsline{toc}{section}{Suggestions and Bug Reports}
Feedback on \chemmacros, \chemformula and \ghsystem is highly appreciated and welcome! If you have suggestions for macros, missing features \etc, please don't hesitate to contact me. If you recognize any errors, be it chemical ones, wrong documentation and the like, I'd be grateful about a short email\footnote{\href{mailto:contact@mychemistry.eu}{contact@mychemistry.eu}}.

If you find any bugs, it would be best, if you'd send me a minimal example, with which I can reproduce the bug. You can also submit an issue on \url{https://bitbucket.org/cgnieder/chemmacros/} instead.

Many thanks to all the people, who already provided me with feedback!

\printbibliography

\printindex

% \listoftodos
\end{document}