2 @g@chem.1 - man page for @g@chem (section 1).
4 Source file position: <groff_source_top>/contrib/chem/chem.man
5 Installed position: $prefix/share/man/man1/@g@chem.1
13 This file was written by Bernd Warken.
14 It is based on the documentation of
15 .UR http://\:cm.bell-labs.com/\:cm/\:cs/\:who/\:bwk/\:index.html
26 Copyright (C) 2006, 2007, 2008 Free Software Foundation, Inc.
34 a free software project.
36 You can redistribute it and/or modify it under the terms of the
38 .B "GNU General Public License"
42 .BR "Free Software Foundation" ,
44 either version\~2, or (at your option) any later version.
48 You should have received a copy of the \f(CRGNU General Public
51 see the files \%\f(CBCOPYING\fP and \%\f(CBLICENSE\fP in the top
59 You can also write to the
61 .B "Free Software Foundation, 51 Franklin St - Fifth Floor, Boston,"
62 .BR "MA 02110-1301, USA" .
67 .\" --------------------------------------------------------------------
68 .\" Local macro definitions
72 .\" .File_name (<path_name>)
74 .\" Display a file or directory name in CB font.
82 .\" Display a line in CB font, for example after .TP
90 .\" End of macro definitions
93 .TH @G@CHEM @MAN1EXT@ "@MDATE@" "Groff Version @VERSION@"
95 @g@chem \- groff preprocessor for producing chemical structure diagrams
99 .\" --------------------------------------------------------------------
101 .\" --------------------------------------------------------------------
104 .RI [ "\%option" \*(El]
106 .RI [ "\%filespec" \*(El]
120 .\" --------------------------------------------------------------------
122 .\" --------------------------------------------------------------------
125 There are no other options than
131 these options provoke the printing of a version or usage information,
132 respectively, and all
134 arguments are ignored.
138 argument is either a file name of an existing file or a minus
141 meaning standard input.
143 If no argument is specified then standard input is taken
147 .\" --------------------------------------------------------------------
149 .\" --------------------------------------------------------------------
152 produces chemical structure diagrams.
154 Today's version is best suited for organic chemistry (bonds, rings).
170 parts are translated into diagrams of the
178 originates from the Perl source file
182 to include a copy of the macro file
193 In a style reminiscent of
199 diagrams are written in a special language.
205 lines looks like this
219 Lines containing the keywords
223 start and end the input for
229 context, i.e., after the call of
232 input can optionally be started by the line
234 and ended by the line with the single word
240 Anything outside these initialization lines is copied through
241 without modification;
242 all data between the initialization lines is converted into
244 commands to draw the diagram.
265 groups with a bond between them.
269 To actually view this, you must run
275 .B "@g@chem [file\*(El] | groffer"
278 If you want to create just
286 for the activation of
289 .B "@g@chem [file\*(El] | groff -p \*(El"
292 .\" --------------------------------------------------------------------
294 .\" --------------------------------------------------------------------
298 input language is rather small. It provides rings of several styles
299 and a way to glue them together as desired, bonds of several styles,
306 .\" --------------------------------------------------------------------
307 .SS Setting Variables
308 .\" --------------------------------------------------------------------
310 There are some variables that can be set by commands.
312 Such commands have two possible forms, either
324 .IB "variable " = " value"
332 If more arguments are given only the last argument is taken, all other
333 arguments are ignored.
337 There are only a few variables to be set by these commands:
341 Set the height of the text to
347 Set the character width to
353 Set the bond length to
359 Scale the diagram to make it look plausible at point size
364 .\" --------------------------------------------------------------------
366 .\" --------------------------------------------------------------------
375 .IR Name | picstuff ]
380 draws a single bond in direction from nearest corner of
396 is the angle in degrees (0\~up, positive clockwise)
397 or a direction word like
403 If no direction is specified, the bond goes in the current direction
404 (usually that of the last bond).
408 Normally the bond begins at the last object placed; this
409 can be changed by naming a
413 For instance, to make a simple alkyl chain:
420 bond@(this one goes right from the CH3)
421 C@(at the right end of the bond)
422 double bond up@(from the C)
423 O@(at the end of the double bond)
431 A length in inches may be specified to override the default length.
435 commands can be tacked on to the end of a bond command, to created
436 dotted or dashed bonds or to specify a
441 .\" --------------------------------------------------------------------
443 .\" --------------------------------------------------------------------
445 There are lots of rings, but only 5 and 6-sided rings get
449 by itself is a 6-sided ring;
451 is the benzene ring with a circle inside.
453 puts a circle into any kind of ring.
457 .RB [ \%pointing\ ( up | right | left | down )]
459 .RB [ put\ Mol\ at\ \fIn\fP ]
470 The vertices of a ring are numbered 1, 2, \*(El from the
471 vertex that points in the natural compass direction.
473 So for a hexagonal ring with the point at the top, the top vertex
474 is\~1, while if the ring has a point at the east side, that is
483 R2: ring pointing right
489 The ring vertices are named
495 in the pointing direction.
511 is the rightmost vertex and
515 These vertex names are used for connecting bonds or other rings. For
521 R1: benzene pointing right
522 R2: benzene pointing right with .V6 at R1.V2
526 creates two benzene rings connected along a side.
530 Interior double bonds are specified as
531 .BI \%double\ n1 , n2\ n3 , n4\ \fR\*(El;\fP
532 each number pair adds an interior bond.
534 So the alternate form of a benzene ring is
537 .B "ring double 1,2 3,4 5,6"
541 Heterocycles (rings with something other than carbon at a vertex) are
543 .BI put\ X\ at\ V\fR,\fP
547 .B "R: ring put N at 1 put O at 2"
562 There are two 5-sided rings.
565 is pentagonal with a side that matches the 6-sided ring; it has four
570 is a 5-sided ring created by chopping one corner of a 6-sided ring so
571 that it exactly matches the 6-sided rings.
575 The description of a ring has to fit on a single line.
578 .\" --------------------------------------------------------------------
579 .SS Moieties and Strings
580 .\" --------------------------------------------------------------------
582 A moiety is a string of characters beginning with a capital letter,
585 Numbers are converted to subscripts (unless they appear to be
586 fractional values, as in N2.5H).
588 The name of a moiety is determined from the moiety after special
589 characters have been stripped out: e.g., N(C2H5)2) has the name NC2H52.
593 Moieties can be specified in two kinds.
595 Normally a moiety is placed right after the last thing mentioned,
596 separated by a semicolon surrounded by spaces, e.g.,
604 it is set after a bond.
608 As the second kind a moiety can be positioned as the first word in a
613 .B "CH3 at C + (0.5,0.5)"
618 It is placed at a position relative to
620 a moiety used earlier in the chemical structure.
624 So moiety names can be specified as
626 positions everywhere in the
630 Beneath their printing moieties are names for places.
638 It is not printed but just serves as a mark to be referred to in later
648 sets a mark at the end of the bond.
650 This can be used then for specifying a place.
656 (i.e., line crossing).
660 A string within double quotes
662 is interpreted as a part of a
666 It represents a string that should be printed (without the quotes).
668 Text within quotes \(dq\*(El\(dq is treated more or less
669 like a moiety except that no changes are made to the quoted part.
672 .\" --------------------------------------------------------------------
674 .\" --------------------------------------------------------------------
676 In the alkyl chain above, notice that the carbon atom
678 was used both to draw something and as the name for a place.
680 A moiety always defines a name for a place; you can use
681 your own names for places instead, and indeed, for rings
693 is often the name of a moiety like
695 but it need not to be.
697 Any name that begins with a capital letter and which contains
698 only letters and numbers is valid:
706 .B "bond 30 from First"
710 .\" --------------------------------------------------------------------
712 .\" --------------------------------------------------------------------
714 The specific construction
717 .BR bond\ \*(El " ; moiety"
731 Otherwise, each item has to be on a separate line (and only one line).
732 Note that there must be whitespace after the semicolon which separates
741 in the first column of a line signals a
743 command, which is copied through as-is.
747 A line whose first non-blank character is a hash character
749 is treated as a comment and thus ignored.
751 However, hash characters within a word are kept.
755 A line whose first word is
757 is copied through as-is after the word
768 scales the diagram to make it look plausible at point size\~\c
770 (default is 10\~point).
774 Anything else is assumed to be
776 code, which is copied through with a label.
784 preprocessor, it is possible to include
786 statements in the middle of a diagram to draw things not provided for
793 statements should be included in
797 as the first word of this line for clarity.
803 commands are accepted as
807 command word is needed:
811 Start the definition of
819 Start a block composite.
823 End a block composite.
827 Start a macro definition block.
831 End a macro definition block.
837 statements are stored and their call is accepted as a
842 .\" --------------------------------------------------------------------
844 .\" --------------------------------------------------------------------
847 This TODO list was collected by Brian Kernighan.
851 Error checking is minimal; errors are usually detected and reported in
852 an oblique fashion by
857 There is no library or file inclusion mechanism, and there is no
858 shorthand for repetitive structures.
862 The extension mechanism is to create
864 macros, but these are tricky to get right and don't have all the
865 properties of built-in objects.
869 There is no in-line chemistry yet (e.g., analogous to the $\*(El$
874 There is no way to control entry point for bonds on groups.
876 Normally a bond connects to the carbon atom if entering from
877 the top or bottom and otherwise to the nearest corner.
881 Bonds from substituted atoms on heterocycles do not join at the proper
882 place without adding a bit of
887 There is no decent primitive for brackets.
891 Text (quoted strings) doesn't work very well.
895 A squiggle bond is needed.
898 .\" --------------------------------------------------------------------
900 .\" --------------------------------------------------------------------
903 .FN @DATASUBDIR@/pic/chem.pic
910 .FN @MACRODIR@/pic.tmac
911 A macro file which redefines
920 .FN @DOCDIR@/examples/chem/*.chem
925 .FN @DOCDIR@/examples/chem/122/*.chem
926 Example files from the classical
932 .\" --------------------------------------------------------------------
934 .\" --------------------------------------------------------------------
937 .MT bug-groff@\:gnu.org
938 bug-groff mailing list
941 Include a complete, self-contained example that will allow the bug to
942 be reproduced, and say which version of
948 You can get both version numbers by calling
949 .BR "@g@chem --version" .
957 but you must first subscribe to this list.
959 You can do that by visiting the
960 .UR http://\:lists.gnu.org/\:mailman/\:listinfo/\:groff
961 groff mailing list web page
967 .BR \%groff (@MAN1EXT@)
968 for information on availability.
971 .\" --------------------------------------------------------------------
973 .\" --------------------------------------------------------------------
975 .BR \%groff (@MAN1EXT@),
976 .BR \%@g@pic (@MAN1EXT@),
977 .BR \%groffer (@MAN1EXT@).
981 You can still get the original
982 .UR http://\:cm.bell-labs.com/\:netlib/\:typesetting/\:chem.gz
988 file was used for this manual page.
992 The other classical document on
995 .UR http://\:cm.bell-labs.com/\:cm/\:cs/\:cstr/\:122.ps.gz
1000 .\" --------------------------------------------------------------------
1002 .\" --------------------------------------------------------------------
1006 .\" --------------------------------------------------------------------
1008 .\" --------------------------------------------------------------------
1012 .\" --------------------------------------------------------------------
1014 .\" --------------------------------------------------------------------
1016 .\" Local Variables: