diff --git a/atomsbonds.md b/atomsbonds.md
index 68e941a..a3a0e71 100644
--- a/atomsbonds.md
+++ b/atomsbonds.md
@@ -19,7 +19,7 @@ formal charge is currently unknown.
The CDK interface [`IAtom`](http://cdk.github.io/cdk/latest/docs/api/org/openscience/cdk/interfaces/IAtom.html) is the underlying data model of atoms. Creating
a new atom is fairly easy. For example, we can create an atom of element
-type carbon, as defined by the element’s atomic number that we pass as parameter
+type carbon, as defined by the element’s atomic number that we pass as parameter
in the constructor:
**Script 3.1** [code/CreateAtom3.groovy](code/CreateAtom3.code.md)
@@ -27,6 +27,13 @@ in the constructor:
atom = new Atom(6);
```
+For this we can also use the atomic number from the `IElement` class:
+
+**Script** [code/CreateAtom4.groovy](code/CreateAtom4.code.md)
+```groovy
+atom = new Atom(IElement.C);
+```
+
An atom can also be constructed by passing in the symbol but this is marginally
less efficient:
@@ -59,7 +66,7 @@ atomic number: 6
### IElement
-The most common property of [`IElement`](http://cdk.github.io/cdk/latest/docs/api/org/openscience/cdk/interfaces/IElement.html)s are their symbol and atomic
+The most common property of [`IElement`](http://cdk.github.io/cdk/latest/docs/api/org/openscience/cdk/interfaces/IElement.html)s are their symbol and atomic
number. Because the `IAtom` extends the `IElement`, CDK atoms also have
these properties. Therefore, we can set these properties for atoms
manually too:
@@ -88,7 +95,7 @@ Atomic number: 6
### IIsotope
-The `IIsotope` information consists of the *mass number*, *exact mass* and
+The `IIsotope` information consists of the *mass number*, *exact mass* and
*natural abundance*:
**Script 3.6** [code/IsotopeProperties.groovy](code/IsotopeProperties.code.md)
@@ -131,7 +138,7 @@ on the atom type infrastructure in the CDK library, and, for example,
details how atom types can be perceived, and how atom type information
is set for atoms.
-The `IAtomType` interface contains fields that relate to atom types. These
+The `IAtomType` interface contains fields that relate to atom types. These
properties include formal charge, neighbor count, maximum bond order
and atom type name:
@@ -145,9 +152,9 @@ atom.setFormalNeighbourCount(4)
### Coordinates
-The `IAtom` class supports three types of coordinates: 2D coordinates,
-used for diagrams, 3D coordinates for geometries, and crystal unit cell
-or notional coordinates. These properties are set with the respective
+The `IAtom` class supports three types of coordinates: 2D coordinates,
+used for diagrams, 3D coordinates for geometries, and crystal unit cell
+or notional coordinates. These properties are set with the respective
methods:
**Script 3.9** [code/AtomCoordinates.groovy](code/AtomCoordinates.code.md)
@@ -169,14 +176,14 @@ crystal structure functionality.
## Bonds
-The [`IBond`](http://cdk.github.io/cdk/latest/docs/api/org/openscience/cdk/interfaces/IBond.html) interface of the CDK is an interaction between two or more
-`IAtom`s, extending the `IElectronContainer` interface. While the most
+The [`IBond`](http://cdk.github.io/cdk/latest/docs/api/org/openscience/cdk/interfaces/IBond.html) interface of the CDK is an interaction between two or more
+`IAtom`s, extending the `IElectronContainer` interface. While the most
common application in the CDK originates from graph theory [2], it is not
restricted to that. That said, many algorithms implemented in the CDK
expect a graph theory based model, where each bond connects two, and
not more, atoms.
-For example, to create ethanol we write:
+For example, to create ethanol we write:
**Script 3.10** [code/Ethanol.groovy](code/Ethanol.code.md)
```groovy
@@ -211,7 +218,7 @@ UNSET
As you might notice, there is no `AROMATIC` bond defined. This is
deliberate and the CDK allows to define single-double bond order patterns at
the same time as aromaticity information. For example, a kekule
-structure of benzene with bonds marked as aromatic can be constructed with:
+structure of benzene with bonds marked as aromatic can be constructed with:
**Script 3.12** [code/AromaticBond.groovy](code/AromaticBond.code.md)
```groovy
@@ -240,7 +247,7 @@ bond6.setFlag(CDKConstants.ISAROMATIC, true);
Bond orders, as we have seen earlier, are commonly used in the CDK to
indicate the electronic properties of a bond. At the same time, each bond
consists of a number of atoms. For example, in a single (sigma) bond, two
-electrons are involved. In a double (pi) bond, four electrons are involved,
+electrons are involved. In a double (pi) bond, four electrons are involved,
and in a triple bond, six electrons are involved. We can report on the
electron counts for the various orders with this code:
@@ -277,7 +284,7 @@ The `IBond.setStereo()` method is discussed in Section [5.1](stereo.md#sec:stere
We already saw in the previous pieces of code how the CDK can be used to create
molecules, and while the above is, strictly speaking, enough to find all atoms in the
-molecule starting with only one of the atoms in the molecule, it often is more
+molecule starting with only one of the atoms in the molecule, it often is more
convenient to store all atoms and bonds in a container.
The CDK has one container: the [`IAtomContainer`](http://cdk.github.io/cdk/latest/docs/api/org/openscience/cdk/interfaces/IAtomContainer.html).
@@ -390,7 +397,7 @@ C 2
O 1
```
-Similarly, we can also list all connected atoms:
+Similarly, we can also list all connected atoms:
**Script 3.19** [code/ConnectedAtoms.groovy](code/ConnectedAtoms.code.md)
```groovy
@@ -412,7 +419,7 @@ C is connected to C O
O is connected to C
```
-We can do the same thing for connected bonds:
+We can do the same thing for connected bonds:
**Script 3.20** [code/ConnectedBonds.groovy](code/ConnectedBonds.code.md)
```groovy
@@ -437,7 +444,7 @@ O has bond(s) SINGLE
## Molecular Formula
-Getting the molecular formula of a molecule and returning that as a String
+Getting the molecular formula of a molecule and returning that as a String
is both done with the [`MolecularFormulaManipulator`](http://cdk.github.io/cdk/latest/docs/api/org/openscience/cdk/tools/manipulator/MolecularFormulaManipulator.html) class:
**Script 3.21** [code/MFGeneration.groovy](code/MFGeneration.code.md)
@@ -515,7 +522,7 @@ used in the data model inherit from this interface. The [`IChemObject`](http://c
interface provides a bit of basic functionality, including support
for object identifiers, properties, and flags.
-For example. identifiers are set and retrieved with the `setID()` and
+For example. identifiers are set and retrieved with the `setID()` and
`getID()` methods:
**Script 3.26** [code/ChemObjectIdentifiers.groovy](code/ChemObjectIdentifiers.code.md)
@@ -525,7 +532,7 @@ butane.setID("cdkbook000000001")
print "ID: " + butane.getID()
```
-If you have more than one identifier, or other properties you like to
+If you have more than one identifier, or other properties you like to
associate with objects, you can use the `setProperty()` and
`getProperty()` methods:
@@ -583,7 +590,7 @@ NAMES: 2-(acetyloxy)benzoic acid
```
A third characteristic of the [`IChemObject`](http://cdk.github.io/cdk/latest/docs/api/org/openscience/cdk/interfaces/IChemObject.html) interface is the concept of
-flags. Flags are used in the CDK to indicate, for example, if
+flags. Flags are used in the CDK to indicate, for example, if
an atom or bond is aromatic (see Script [3.12](#script:AromaticBond))
or if an atom is part of a ring:
diff --git a/builders.md b/builders.md
index 0a14a1a..68e9ead 100644
--- a/builders.md
+++ b/builders.md
@@ -108,12 +108,12 @@ event is when the atom was added, while the second event is caused by the
element symbol of the atom changing:
```plain
-Event: org.openscience.cdk.event.ChemObjectChangeEvent[source=AtomContainer(73...
- 4370487, #A:1, AtomRef{Atom(1091523506, S:C, AtomType(1091523506, FC:0, Isot...
- ope(1091523506, Element(1091523506, S:C, AN:6))))})]
-Event: org.openscience.cdk.event.ChemObjectChangeEvent[source=Atom(1091523506,...
- S:N, AtomType(1091523506, FC:0, Isotope(1091523506, Element(1091523506, S:N...
- , AN:7))))]
+Event: org.openscience.cdk.event.ChemObjectChangeEvent[source=AtomContainer(17...
+ 99049015, #A:1, AtomRef{Atom(992309406, S:C, AtomType(992309406, FC:0, Isoto...
+ pe(992309406, Element(992309406, S:C, AN:6))))})]
+Event: org.openscience.cdk.event.ChemObjectChangeEvent[source=Atom(992309406, ...
+ S:N, AtomType(992309406, FC:0, Isotope(992309406, Element(992309406, S:N, AN...
+ :7))))]
```
### The Debug Builder
diff --git a/chemobject.md b/chemobject.md
index c872578..4d2635b 100644
--- a/chemobject.md
+++ b/chemobject.md
@@ -69,8 +69,8 @@ which outputs:
```plain
Number of containers: 2
-container's hashcode 32777062
-container's hashcode 1187406578
+container's hashcode 606061176
+container's hashcode 1551301860
```
The other options is to use a regular for-loop:
@@ -89,8 +89,8 @@ which requires more coding, but has the advantage that it keeps track of the ind
```plain
Number of containers: 2
-container 0 has hashcode 517960153
-container 1 has hashcode 551377008
+container 0 has hashcode 820959908
+container 1 has hashcode 219286908
```
## IReactionSet and IRingSet
diff --git a/code/AtomContainersForLoopingInSet.code.md b/code/AtomContainersForLoopingInSet.code.md
index a1d18a6..6f6405e 100644
--- a/code/AtomContainersForLoopingInSet.code.md
+++ b/code/AtomContainersForLoopingInSet.code.md
@@ -20,6 +20,6 @@ for (i=0; i generators = new ArrayList();
+generators.add(new BasicSceneGenerator());
+generators.add(new BasicBondGenerator());
+generators.add(new BasicAtomGenerator());
+
+// the renderer needs to have a toolkit-specific font manager
+AtomContainerRenderer renderer =
+ new AtomContainerRenderer(generators, new AWTFontManager());
+model = renderer.getRenderer2DModel()
+model.set(
+ BasicSceneGenerator.BackgroundColor.class,
+ backgroundColor
+)
+model.set(ZoomFactor.class, (double)3.0);
+
+// the call to 'setup' only needs to be done on the first paint
+renderer.setup(triazole, drawArea);
+
+// paint the background
+Graphics2D g2 = (Graphics2D)image.getGraphics();
+g2.setColor(backgroundColor);
+g2.fillRect(0, 0, WIDTH, HEIGHT);
+
+// the paint method also needs a toolkit-specific renderer
+visitor = new AWTDrawVisitor(g2)
+visitor.setRendererModel(model)
+renderer.paint(triazole, visitor);
+
+ImageIO.write((RenderedImage)image, "PNG", new File("BackgroundColor.png"));
+```
+**Output:**
+```plain
+```
diff --git a/code/CreateAtom4.code.md b/code/CreateAtom4.code.md
new file mode 100644
index 0000000..2885e6d
--- /dev/null
+++ b/code/CreateAtom4.code.md
@@ -0,0 +1,15 @@
+# CreateAtom4.groovy
+**Source code:**
+```groovy
+@Grab(group='org.openscience.cdk', module='cdk-bundle', version='2.9')
+
+import org.openscience.cdk.Atom;
+import org.openscience.cdk.interfaces.IElement;
+
+atom = new Atom(IElement.C);
+assert atom.atomicNumber == 6;
+assert atom.symbol == "C";
+```
+**Output:**
+```plain
+```
diff --git a/code/LargerRedSelection.code.md b/code/LargerRedSelection.code.md
new file mode 100644
index 0000000..7966419
--- /dev/null
+++ b/code/LargerRedSelection.code.md
@@ -0,0 +1,90 @@
+# LargerRedSelection.groovy
+**Source code:**
+```groovy
+@Grab(group='org.openscience.cdk', module='cdk-bundle', version='2.9')
+
+import java.util.List;
+import java.awt.*;
+import java.awt.image.*;
+import javax.imageio.*;
+import org.openscience.cdk.*;
+import org.openscience.cdk.interfaces.*;
+import org.openscience.cdk.layout.*;
+import org.openscience.cdk.renderer.*;
+import org.openscience.cdk.renderer.font.*;
+import org.openscience.cdk.renderer.generators.*;
+import org.openscience.cdk.renderer.visitor.*;
+import org.openscience.cdk.templates.*;
+import org.openscience.cdk.renderer.generators.BasicSceneGenerator.Margin;
+import org.openscience.cdk.renderer.generators.BasicSceneGenerator.ZoomFactor;
+
+
+
+
+int WIDTH = 600;
+int HEIGHT = 600;
+
+// the draw area and the image should be the same size
+Rectangle drawArea = new Rectangle(WIDTH, HEIGHT);
+Image image = new BufferedImage(
+ WIDTH, HEIGHT, BufferedImage.TYPE_INT_RGB
+);
+
+IAtomContainer triazole = MoleculeFactory.make123Triazole();
+StructureDiagramGenerator sdg = new StructureDiagramGenerator();
+sdg.setMolecule(triazole);
+sdg.generateCoordinates();
+triazole = sdg.getMolecule();
+
+// generators make the image elements
+List generators = new ArrayList();
+generators.add(new BasicSceneGenerator());
+generators.add(new ExternalHighlightGenerator());
+generators.add(new BasicBondGenerator());
+generators.add(new BasicAtomGenerator());
+
+IAtomContainer selection = new AtomContainer();
+for (int i=0; i<2; i++) {
+ bond = triazole.getBond(i);
+ selection.addAtom(bond.getAtom(0));
+ selection.addAtom(bond.getAtom(1));
+ selection.addBond(bond);
+}
+
+// the renderer needs to have a toolkit-specific font manager
+AtomContainerRenderer renderer =
+ new AtomContainerRenderer(generators, new AWTFontManager());
+
+// the call to 'setup' only needs to be done on the first paint
+renderer.setup(triazole, drawArea);
+
+model = renderer.getRenderer2DModel();
+model.set(Margin.class, (double)0.1);
+model.set(ZoomFactor.class, (double)3.0);
+model.setExternalSelectedPart(selection);
+model = renderer.getRenderer2DModel();
+model.set(
+ ExternalHighlightGenerator
+ .ExternalHighlightDistance.class,
+ (double)24
+);
+model.set(
+ RendererModel.ExternalHighlightColor.class,
+ Color.red
+);
+// paint the background
+Graphics2D g2 = (Graphics2D)image.getGraphics();
+g2.setColor(Color.WHITE);
+g2.fillRect(0, 0, WIDTH, HEIGHT);
+
+// the paint method also needs a toolkit-specific renderer
+renderer.paint(triazole, new AWTDrawVisitor(g2));
+
+ImageIO.write(
+ (RenderedImage)image, "PNG",
+ new File("LargerRedSelection.png")
+);
+```
+**Output:**
+```plain
+```
diff --git a/code/ObjectListening.code.md b/code/ObjectListening.code.md
index e528f8c..59975c2 100644
--- a/code/ObjectListening.code.md
+++ b/code/ObjectListening.code.md
@@ -21,10 +21,10 @@ atom1.setSymbol("N")
```
**Output:**
```plain
-Event: org.openscience.cdk.event.ChemObjectChangeEvent[source=AtomContainer(73...
- 4370487, #A:1, AtomRef{Atom(1091523506, S:C, AtomType(1091523506, FC:0, Isot...
- ope(1091523506, Element(1091523506, S:C, AN:6))))})]
-Event: org.openscience.cdk.event.ChemObjectChangeEvent[source=Atom(1091523506,...
- S:N, AtomType(1091523506, FC:0, Isotope(1091523506, Element(1091523506, S:N...
- , AN:7))))]
+Event: org.openscience.cdk.event.ChemObjectChangeEvent[source=AtomContainer(17...
+ 99049015, #A:1, AtomRef{Atom(992309406, S:C, AtomType(992309406, FC:0, Isoto...
+ pe(992309406, Element(992309406, S:C, AN:6))))})]
+Event: org.openscience.cdk.event.ChemObjectChangeEvent[source=Atom(992309406, ...
+ S:N, AtomType(992309406, FC:0, Isotope(992309406, Element(992309406, S:N, AN...
+ :7))))]
```
diff --git a/code/RenderSelection.code.md b/code/RenderSelection.code.md
new file mode 100644
index 0000000..b8c30cf
--- /dev/null
+++ b/code/RenderSelection.code.md
@@ -0,0 +1,77 @@
+# RenderSelection.groovy
+**Source code:**
+```groovy
+@Grab(group='org.openscience.cdk', module='cdk-bundle', version='2.9')
+
+import java.util.List;
+import java.awt.*;
+import java.awt.image.*;
+import javax.imageio.*;
+import org.openscience.cdk.*;
+import org.openscience.cdk.interfaces.*;
+import org.openscience.cdk.layout.*;
+import org.openscience.cdk.renderer.*;
+import org.openscience.cdk.renderer.font.*;
+import org.openscience.cdk.renderer.generators.*;
+import org.openscience.cdk.renderer.visitor.*;
+import org.openscience.cdk.templates.*;
+import org.openscience.cdk.renderer.generators.BasicSceneGenerator.Margin;
+import org.openscience.cdk.renderer.generators.BasicSceneGenerator.ZoomFactor;
+
+
+
+
+int WIDTH = 600;
+int HEIGHT = 600;
+
+// the draw area and the image should be the same size
+Rectangle drawArea = new Rectangle(WIDTH, HEIGHT);
+Image image = new BufferedImage(
+ WIDTH, HEIGHT, BufferedImage.TYPE_INT_RGB
+);
+
+IAtomContainer triazole = MoleculeFactory.make123Triazole();
+StructureDiagramGenerator sdg = new StructureDiagramGenerator();
+sdg.setMolecule(triazole);
+sdg.generateCoordinates();
+triazole = sdg.getMolecule();
+// generators make the image elements
+List generators =
+ new ArrayList();
+generators.add(new BasicSceneGenerator());
+generators.add(new ExternalHighlightGenerator());
+generators.add(new BasicBondGenerator());
+generators.add(new BasicAtomGenerator());
+IAtomContainer selection = new AtomContainer();
+for (int i=0; i<2; i++) {
+ bond = triazole.getBond(i);
+ selection.addAtom(bond.getAtom(0));
+ selection.addAtom(bond.getAtom(1));
+ selection.addBond(bond);
+}
+// the renderer needs to have a toolkit-specific font manager
+AtomContainerRenderer renderer =
+ new AtomContainerRenderer(generators, new AWTFontManager());
+
+// the call to 'setup' only needs to be done on the first paint
+renderer.setup(triazole, drawArea);
+model = renderer.getRenderer2DModel();
+model.set(Margin.class, (double)0.1);
+model.set(ZoomFactor.class, (double)3.0);
+model.setExternalSelectedPart(selection);
+// paint the background
+Graphics2D g2 = (Graphics2D)image.getGraphics();
+g2.setColor(Color.WHITE);
+g2.fillRect(0, 0, WIDTH, HEIGHT);
+
+// the paint method also needs a toolkit-specific renderer
+renderer.paint(triazole, new AWTDrawVisitor(g2));
+
+ImageIO.write(
+ (RenderedImage)image, "PNG",
+ new File("RenderSelection.png")
+);
+```
+**Output:**
+```plain
+```
diff --git a/code/TPSACalc.code.md b/code/TPSACalc.code.md
index 039fd1c..1a7c9db 100644
--- a/code/TPSACalc.code.md
+++ b/code/TPSACalc.code.md
@@ -29,7 +29,7 @@ value = result.getValue()
```
**Output:**
```plain
-Specification: org.openscience.cdk.qsar.DescriptorSpecification@3e98b933
+Specification: org.openscience.cdk.qsar.DescriptorSpecification@134c38
Parameters names: [checkAromaticity]
Parameters values: [false]
Exception: null
diff --git a/depiction.md b/depiction.md
index 74ec771..12cb4a7 100644
--- a/depiction.md
+++ b/depiction.md
@@ -54,6 +54,32 @@ new DepictionGenerator()
This results in the image of triazole given in Figure [16.1](#fig:fig:triazole).
+## Background color
+
+Starting from the common pattern to set up a renderer used in the earlier sections,
+you can also customize the background color. This too uses a parameter, but the
+color is also passed to the `Graphics2D` object:
+
+**Script** [code/BackgroundColor.groovy](code/BackgroundColor.code.md)
+```groovy
+backgroundColor = Color.lightGray;
+model = renderer.getRenderer2DModel()
+model.set(
+ BasicSceneGenerator.BackgroundColor.class,
+ backgroundColor
+)
+// paint the background
+Graphics2D g2 = (Graphics2D)image.getGraphics();
+g2.setColor(backgroundColor);
+g2.fillRect(0, 0, WIDTH, HEIGHT);
+```
+
+The result of this code is depicted in Figure [16.2](#fig:fig:backgroundColor).
+
+
+![](images/generated/BackgroundColor.png)
+
**Figure 16.2**: Triazole depicted with a custom, grey background.
+
## References
1. Krause S, Willighagen E, Steinbeck C. JChemPaint - Using the Collaborative Forces of the Internet to Develop a Free Editor for 2D Chemical Structures. Molecules. 2000 Jan 28;5(1):93–8. doi:[10.3390/50100093](https://doi.org/10.3390/50100093) ([Scholia](https://scholia.toolforge.org/doi/10.3390/50100093))
diff --git a/descriptor.md b/descriptor.md
index 14342aa..0a976f6 100644
--- a/descriptor.md
+++ b/descriptor.md
@@ -207,7 +207,7 @@ value = result.getValue()
The output shows us that quite some metadata is preserved:
```plain
-Specification: org.openscience.cdk.qsar.DescriptorSpecification@3e98b933
+Specification: org.openscience.cdk.qsar.DescriptorSpecification@134c38
Parameters names: [checkAromaticity]
Parameters values: [false]
Exception: null
diff --git a/images/generated/CTR2.png b/images/generated/CTR2.png
index b7e2111..d543a1a 100644
Binary files a/images/generated/CTR2.png and b/images/generated/CTR2.png differ
diff --git a/images/generated/FixPyrroleBondOrders.png b/images/generated/FixPyrroleBondOrders.png
index 504a618..d880984 100644
Binary files a/images/generated/FixPyrroleBondOrders.png and b/images/generated/FixPyrroleBondOrders.png differ
diff --git a/images/generated/InChIAtomNumbers.png b/images/generated/InChIAtomNumbers.png
index be87c1b..668ab93 100644
Binary files a/images/generated/InChIAtomNumbers.png and b/images/generated/InChIAtomNumbers.png differ
diff --git a/images/generated/InChIAtomNumbersBenzene.png b/images/generated/InChIAtomNumbersBenzene.png
index 00a749f..95c2ca1 100644
Binary files a/images/generated/InChIAtomNumbersBenzene.png and b/images/generated/InChIAtomNumbersBenzene.png differ
diff --git a/images/generated/MethaneExplicit.png b/images/generated/MethaneExplicit.png
index a4db9ef..865adcd 100644
Binary files a/images/generated/MethaneExplicit.png and b/images/generated/MethaneExplicit.png differ
diff --git a/images/generated/MethaneImplicit.png b/images/generated/MethaneImplicit.png
index 390d8a8..effaaf3 100644
Binary files a/images/generated/MethaneImplicit.png and b/images/generated/MethaneImplicit.png differ
diff --git a/images/generated/RenderAdenine.png b/images/generated/RenderAdenine.png
index ca4dc42..6062db8 100644
Binary files a/images/generated/RenderAdenine.png and b/images/generated/RenderAdenine.png differ
diff --git a/images/generated/RenderAdenineWithNumbers.png b/images/generated/RenderAdenineWithNumbers.png
index ef7d0b1..70f6340 100644
Binary files a/images/generated/RenderAdenineWithNumbers.png and b/images/generated/RenderAdenineWithNumbers.png differ
diff --git a/images/generated/RenderMolecule.png b/images/generated/RenderMolecule.png
index 61db51b..35660fd 100644
Binary files a/images/generated/RenderMolecule.png and b/images/generated/RenderMolecule.png differ
diff --git a/images/generated/RenderOxazole.png b/images/generated/RenderOxazole.png
index 2e9010c..53925b5 100644
Binary files a/images/generated/RenderOxazole.png and b/images/generated/RenderOxazole.png differ
diff --git a/images/generated/StereoisomerOne.png b/images/generated/StereoisomerOne.png
index 7e38e2a..bcf981a 100644
Binary files a/images/generated/StereoisomerOne.png and b/images/generated/StereoisomerOne.png differ
diff --git a/images/generated/StereoisomerTwo.png b/images/generated/StereoisomerTwo.png
index ed27206..78381d8 100644
Binary files a/images/generated/StereoisomerTwo.png and b/images/generated/StereoisomerTwo.png differ
diff --git a/index.md b/index.md
index 2119c78..cd87af7 100644
--- a/index.md
+++ b/index.md
@@ -167,6 +167,7 @@ to Python, please [file a request here](https://github.com/egonw/chempyformatics
15.6. [Unknown Molecular Formula](missing.md#unknown-molecular-formula)
16. [Depiction](depiction.md)
16.1. [Molecules](depiction.md#molecules)
+16.2. [Background color](depiction.md#background-color)
17. [Substructure Searching](substructure.md)
17.1. [Fingerprints](substructure.md#fingerprints)
17.1.1. [MACCS Fingerprints](substructure.md#maccs-fingerprints)
diff --git a/indexList.md b/indexList.md
index 056e319..ae2effe 100644
--- a/indexList.md
+++ b/indexList.md
@@ -1,15 +1,16 @@
# Index
-2D coordinates [atomsbonds](atomsbonds.md#tp6) [missing](missing.md#tp15)
-3D coordinates [atomsbonds](atomsbonds.md#tp7)
+2D coordinates [atomsbonds](atomsbonds.md#tp7) [missing](missing.md#tp15)
+3D coordinates [atomsbonds](atomsbonds.md#tp8)
adjacency matrix [graph](graph.md#tp11)
anti-clockwise [stereo](stereo.md#tp8)
aromaticity [properties](properties.md#tp10)
ASN.1 [io](io.md#tp3)
-atomic number [missing](missing.md#tp1)
+atomic number [atomsbonds](atomsbonds.md#tp3) [missing](missing.md#tp1)
atom types [atomtype](atomtype.md#tp1)
-benzene [atomsbonds](atomsbonds.md#tp13)
+background color [depiction](depiction.md#tp5)
+benzene [atomsbonds](atomsbonds.md#tp14)
boiling points [cheminfo](cheminfo.md#tp2)
bond orders [missing](missing.md#tp11)
Cambridge Structural Database [cheminfo](cheminfo.md#tp18)
@@ -37,8 +38,8 @@ collinearity [cheminfo](cheminfo.md#tp33)
complexity [cheminfo](cheminfo.md#tp11) [cheminfo](cheminfo.md#tp24)
computer-aided structure elucidation [cheminfo](cheminfo.md#tp20)
conformations [stereo](stereo.md#tp2)
-connected atoms [atomsbonds](atomsbonds.md#tp16)
-connected bonds [atomsbonds](atomsbonds.md#tp17)
+connected atoms [atomsbonds](atomsbonds.md#tp17)
+connected bonds [atomsbonds](atomsbonds.md#tp18)
connectivity layer [inchi](inchi.md#tp5)
coordinates [missing](missing.md#tp16)
covalent radii [missing](missing.md#tp10)
@@ -53,8 +54,8 @@ databases [cheminfo](cheminfo.md#tp15)
DNA [protein](protein.md#tp2)
ECFP [substructure](substructure.md#tp2)
electronegativity [missing](missing.md#tp8)
-electrons [atomsbonds](atomsbonds.md#tp14)
-ethanol [atomsbonds](atomsbonds.md#tp12)
+electrons [atomsbonds](atomsbonds.md#tp15)
+ethanol [atomsbonds](atomsbonds.md#tp13)
exception [descriptor](descriptor.md#tp5)
explicit hydrogens [missing](missing.md#tp14)
FCFP [substructure](substructure.md#tp3)
@@ -62,7 +63,7 @@ ferrocene} [cheminfo](cheminfo.md#tp22)
Figueras algorithm [graph](graph.md#tp8)
FixedH option [inchi](inchi.md#tp9)
fixed hydrogen layer [inchi](inchi.md#tp10)
-flags [atomsbonds](atomsbonds.md#tp21)
+flags [atomsbonds](atomsbonds.md#tp22)
Floyd's algorithm [graph](graph.md#tp12)
force field [cheminfo](cheminfo.md#tp12)
GamessReader [ioclasseslist](ioclasseslist.md#tp11)
@@ -83,13 +84,13 @@ HINReader [ioclasseslist](ioclasseslist.md#tp17)
HINWriter [ioclasseslist](ioclasseslist.md#tp18)
hybridization [atomtype](atomtype.md#tp2)
IAtom [atomsbonds](atomsbonds.md#tp1) [atomsbonds](atomsbonds.md#tp2)
-IAtomType [atomsbonds](atomsbonds.md#tp5)
-IBond [atomsbonds](atomsbonds.md#tp10)
+IAtomType [atomsbonds](atomsbonds.md#tp6)
+IBond [atomsbonds](atomsbonds.md#tp11)
ICrystal [salts](salts.md#tp3)
-identifiers [atomsbonds](atomsbonds.md#tp19)
-IElectronContainer [atomsbonds](atomsbonds.md#tp11) [unpairedelectrons](unpairedelectrons.md#tp1)
-IElement [atomsbonds](atomsbonds.md#tp3)
-IIsotope [atomsbonds](atomsbonds.md#tp4)
+identifiers [atomsbonds](atomsbonds.md#tp20)
+IElectronContainer [atomsbonds](atomsbonds.md#tp12) [unpairedelectrons](unpairedelectrons.md#tp1)
+IElement [atomsbonds](atomsbonds.md#tp4)
+IIsotope [atomsbonds](atomsbonds.md#tp5)
implicit hydrogens [missing](missing.md#tp13) [properties](properties.md#tp2)
InChI atom numbers [graph](graph.md#tp17)
InChI [graph](graph.md#tp16) [inchi](inchi.md#tp1)
@@ -120,15 +121,15 @@ Mol2Reader [ioclasseslist](ioclasseslist.md#tp30)
Mol2Writer [ioclasseslist](ioclasseslist.md#tp31)
molecular descriptors [cheminfo](cheminfo.md#tp30) [descriptor](descriptor.md#tp2)
molecular fingerprints [substructure](substructure.md#tp1)
-molecular formula [atomsbonds](atomsbonds.md#tp18) [missing](missing.md#tp17)
+molecular formula [atomsbonds](atomsbonds.md#tp19) [missing](missing.md#tp17)
molecular mass [properties](properties.md#tp1)
molecular volume [properties](properties.md#tp8)
-molecule [atomsbonds](atomsbonds.md#tp15)
+molecule [atomsbonds](atomsbonds.md#tp16)
moment of inertia [descriptor](descriptor.md#tp6)
monoisotopic mass [missing](missing.md#tp9)
Morgan atom numbers [graph](graph.md#tp15)
multivariate regression [cheminfo](cheminfo.md#tp34)
-notional coordinates [atomsbonds](atomsbonds.md#tp9)
+notional coordinates [atomsbonds](atomsbonds.md#tp10)
numerical representations [cheminfo](cheminfo.md#tp29)
OpenSMILES [io](io.md#tp12)
parameters [descriptor](descriptor.md#tp4)
@@ -150,7 +151,7 @@ PMPReader [ioclasseslist](ioclasseslist.md#tp32)
PNG [depiction](depiction.md#tp4)
principal component analysis [cheminfo](cheminfo.md#tp27)
products [reaction](reaction.md#tp3)
-properties [atomsbonds](atomsbonds.md#tp20)
+properties [atomsbonds](atomsbonds.md#tp21)
protein [protein](protein.md#tp1)
PubChem [io](io.md#tp2)
QSAR [cheminfo](cheminfo.md#tp3) [descriptor](descriptor.md#tp1)
@@ -194,7 +195,7 @@ torsion [cheminfo](cheminfo.md#tp13)
Total Polar Surface Area [properties](properties.md#tp6)
TPSA [properties](properties.md#tp7)
unique identifier [inchi](inchi.md#tp7)
-unit cell [atomsbonds](atomsbonds.md#tp8)
+unit cell [atomsbonds](atomsbonds.md#tp9)
unpaired electron [unpairedelectrons](unpairedelectrons.md#tp4)
van der Waals radius [missing](missing.md#tp7)
van der waals volume [properties](properties.md#tp9)
diff --git a/introduction.md b/introduction.md
index 96b32cb..1dcbec5 100644
--- a/introduction.md
+++ b/introduction.md
@@ -12,7 +12,7 @@ cheminformatics work [Christoph Steinbeck](https://en.wikipedia.org/wiki/Christo
This book is not about those past projects, however; it is about the CDK as it is
now. It has evolved enormously over the past 10 years, and got more and more
functionality [3,4], thanx to the many contributors
-(see the [Author List](https://github.com/cdk/cdk/blob/master/AUTHORS.txt)). Moreover, by now, the CDK has shown its
+(see the [Author List](https://github.com/cdk/cdk/blob/main/AUTHORS.txt)). Moreover, by now, the CDK has shown its
role in many cheminformatics and bioinformatics fields, and you will find that
this book cites many scientific papers that use the CDK.