Dear members,

I'm using chem frequently for making tests for school.

Although it's a bit hidden in the manual but a neat feature of chem
is being able to create back and front bonds.
The front bond is formed by an arrowhead (clever solution).
The back bond is created of spaced lines.
With a slight alteration this can be converted into
a dashed triangle / wedge.
Although the several textbooks / websites I consulted use different back bonds
(some dashed and tapered, some just a single dotted bond),
the dashed wedge seems the most common.

Here's the diff:
cat << EOF > Chem.diff
--- chem.pic    2024-05-09 21:59:57.902746496 +0200
+++ /usr/share/groff/1.23.0/pic/chem.pic        2025-03-01 16:21:28.138092943 
+0100
@@ -70,7 +70,7 @@
        nx = -dy * .02 / norm
        for i = 1 to n-1 do {
                XZ: i/n <V1,V2>
-               line from XZ + (nx,ny) to XZ - (nx,ny)
+               line from XZ + (nx*i/n,ny*i/n) to XZ - (nx*i/n,ny*i/n)
        }
        move to V2
 }
EOF

A simple example (added as attachment):

cat << EOF | chem | pic | groff -Tpdf > Sample.pdf
.cstart
H
bond down
C
back bond length 0.08 down from C
F
front bond length 0.3 125 from C
Cl
front bond length 0.3 -125  from C
Br
#F
.cend
EOF

Could this to be considered as a (small but) useful alteration?

Kind regards,

Hans

Attachment: Sample.pdf
Description: Adobe PDF document

  • Slight alteration ... Hans Bezemer via GNU roff typesetting system discussion

Reply via email to