[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Groff-commit] groff/contrib/chem .cvsignore ChangeLog Makefil...
From: |
Werner LEMBERG |
Subject: |
[Groff-commit] groff/contrib/chem .cvsignore ChangeLog Makefil... |
Date: |
Thu, 26 Oct 2006 22:13:49 +0000 |
CVSROOT: /cvsroot/groff
Module name: groff
Changes by: Werner LEMBERG <wl> 06/10/26 22:13:49
Added files:
contrib/chem : .cvsignore ChangeLog Makefile.sub README.txt
chem.man chem.pl macros.pic pic.tmac
contrib/chem/examples: .cvsignore README.txt atp.chem
cholesterin.chem ethamivan.chem lsd.chem
morphine.chem penicillin.chem
reserpine.chem
contrib/chem/examples/122: README ch2a_ethyl.chem
ch2b_benzene.chem
ch2c_benzene_right.chem
ch4a_stick.chem
ch4b_methyl_acetate.chem
ch4c_colon.chem ch4d_HCl.H2O.chem
ch4e_CaSO4.2H2O.chem ch4f_C.chem
ch4g_BP.chem ch4h_methacrylate.chem
ch4i_cyclo.chem ch4j_ring4.chem
ch4k_ring3.chem ch4l_vertex.chem
ch4m_double.chem ch4n_triple.chem
ch4o_aromatic.chem
ch4p_cholestanol.chem ch4q_rings.chem
ch4r_spiro.chem ch4s_heteroatoms.chem
ch4t_polycyclic.chem
ch4u_nicotine.chem
ch4v_histidine.chem ch4w_lsd.chem
ch4x_anisole.chem ch4y_reserpine.chem
ch4z1_eqn_glutamic.chem
ch4z2_text.chem ch5a_size.chem
ch6a_pic.chem ch6b_dna.chem
chAa_polymer.chem
chAb_vinyl_chloro.chem
chAc_morphine.chem
chAd_chlorophyll.chem chAe_chair.chem
chAf_arrow.chem chAg_circle.chem
chAh_brackets.chem
chAi_poly_vinyl_chloride.chem
chBa_jump.chem chBb_bonds.chem
chBc_rings.chem
Log message:
* import of chem 0.1.0
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/groff/contrib/chem/.cvsignore?cvsroot=groff&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/groff/contrib/chem/ChangeLog?cvsroot=groff&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/groff/contrib/chem/Makefile.sub?cvsroot=groff&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/groff/contrib/chem/README.txt?cvsroot=groff&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/groff/contrib/chem/chem.man?cvsroot=groff&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/groff/contrib/chem/chem.pl?cvsroot=groff&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/groff/contrib/chem/macros.pic?cvsroot=groff&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/groff/contrib/chem/pic.tmac?cvsroot=groff&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/groff/contrib/chem/examples/.cvsignore?cvsroot=groff&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/groff/contrib/chem/examples/README.txt?cvsroot=groff&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/groff/contrib/chem/examples/atp.chem?cvsroot=groff&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/groff/contrib/chem/examples/cholesterin.chem?cvsroot=groff&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/groff/contrib/chem/examples/ethamivan.chem?cvsroot=groff&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/groff/contrib/chem/examples/lsd.chem?cvsroot=groff&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/groff/contrib/chem/examples/morphine.chem?cvsroot=groff&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/groff/contrib/chem/examples/penicillin.chem?cvsroot=groff&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/groff/contrib/chem/examples/reserpine.chem?cvsroot=groff&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/groff/contrib/chem/examples/122/README?cvsroot=groff&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/groff/contrib/chem/examples/122/ch2a_ethyl.chem?cvsroot=groff&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/groff/contrib/chem/examples/122/ch2b_benzene.chem?cvsroot=groff&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/groff/contrib/chem/examples/122/ch2c_benzene_right.chem?cvsroot=groff&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/groff/contrib/chem/examples/122/ch4a_stick.chem?cvsroot=groff&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/groff/contrib/chem/examples/122/ch4b_methyl_acetate.chem?cvsroot=groff&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/groff/contrib/chem/examples/122/ch4c_colon.chem?cvsroot=groff&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/groff/contrib/chem/examples/122/ch4d_HCl.H2O.chem?cvsroot=groff&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/groff/contrib/chem/examples/122/ch4e_CaSO4.2H2O.chem?cvsroot=groff&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/groff/contrib/chem/examples/122/ch4f_C.chem?cvsroot=groff&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/groff/contrib/chem/examples/122/ch4g_BP.chem?cvsroot=groff&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/groff/contrib/chem/examples/122/ch4h_methacrylate.chem?cvsroot=groff&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/groff/contrib/chem/examples/122/ch4i_cyclo.chem?cvsroot=groff&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/groff/contrib/chem/examples/122/ch4j_ring4.chem?cvsroot=groff&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/groff/contrib/chem/examples/122/ch4k_ring3.chem?cvsroot=groff&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/groff/contrib/chem/examples/122/ch4l_vertex.chem?cvsroot=groff&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/groff/contrib/chem/examples/122/ch4m_double.chem?cvsroot=groff&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/groff/contrib/chem/examples/122/ch4n_triple.chem?cvsroot=groff&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/groff/contrib/chem/examples/122/ch4o_aromatic.chem?cvsroot=groff&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/groff/contrib/chem/examples/122/ch4p_cholestanol.chem?cvsroot=groff&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/groff/contrib/chem/examples/122/ch4q_rings.chem?cvsroot=groff&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/groff/contrib/chem/examples/122/ch4r_spiro.chem?cvsroot=groff&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/groff/contrib/chem/examples/122/ch4s_heteroatoms.chem?cvsroot=groff&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/groff/contrib/chem/examples/122/ch4t_polycyclic.chem?cvsroot=groff&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/groff/contrib/chem/examples/122/ch4u_nicotine.chem?cvsroot=groff&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/groff/contrib/chem/examples/122/ch4v_histidine.chem?cvsroot=groff&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/groff/contrib/chem/examples/122/ch4w_lsd.chem?cvsroot=groff&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/groff/contrib/chem/examples/122/ch4x_anisole.chem?cvsroot=groff&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/groff/contrib/chem/examples/122/ch4y_reserpine.chem?cvsroot=groff&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/groff/contrib/chem/examples/122/ch4z1_eqn_glutamic.chem?cvsroot=groff&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/groff/contrib/chem/examples/122/ch4z2_text.chem?cvsroot=groff&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/groff/contrib/chem/examples/122/ch5a_size.chem?cvsroot=groff&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/groff/contrib/chem/examples/122/ch6a_pic.chem?cvsroot=groff&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/groff/contrib/chem/examples/122/ch6b_dna.chem?cvsroot=groff&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/groff/contrib/chem/examples/122/chAa_polymer.chem?cvsroot=groff&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/groff/contrib/chem/examples/122/chAb_vinyl_chloro.chem?cvsroot=groff&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/groff/contrib/chem/examples/122/chAc_morphine.chem?cvsroot=groff&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/groff/contrib/chem/examples/122/chAd_chlorophyll.chem?cvsroot=groff&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/groff/contrib/chem/examples/122/chAe_chair.chem?cvsroot=groff&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/groff/contrib/chem/examples/122/chAf_arrow.chem?cvsroot=groff&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/groff/contrib/chem/examples/122/chAg_circle.chem?cvsroot=groff&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/groff/contrib/chem/examples/122/chAh_brackets.chem?cvsroot=groff&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/groff/contrib/chem/examples/122/chAi_poly_vinyl_chloride.chem?cvsroot=groff&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/groff/contrib/chem/examples/122/chBa_jump.chem?cvsroot=groff&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/groff/contrib/chem/examples/122/chBb_bonds.chem?cvsroot=groff&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/groff/contrib/chem/examples/122/chBc_rings.chem?cvsroot=groff&rev=1.1
Patches:
Index: .cvsignore
===================================================================
RCS file: .cvsignore
diff -N .cvsignore
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ .cvsignore 26 Oct 2006 22:13:49 -0000 1.1
@@ -0,0 +1,3 @@
+chem
+chem.n
+README
Index: ChangeLog
===================================================================
RCS file: ChangeLog
diff -N ChangeLog
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ ChangeLog 26 Oct 2006 22:13:49 -0000 1.1
@@ -0,0 +1,63 @@
+2006-10-25 Bernd Warken
+ ________________________________________________________________
+ * release of chem 0.1.0
+
+ ### Extensions to the chem awk version.
+
+ * chem.pl:
+ - parameters: -h, --help, -v, --version, -- are added as options.
+ The minus character - is added as filespec for standard input, it
+ may be used several times.
+ - remove the functions `inline', `shiftfields', and `set'.
+ - Fix the handling of the initialization commands .PS, .cstart,
+ `begin chem', and `end'.
+ - Add error massages.
+ - error(): Add file name.
+ - Add concatenation of lines with final backslash `\'.
+ - Warnings and strict are active.
+
+ ### Source files of the chem Perl version
+
+ * chem.pl: Source file for the Perl version of chem.
+
+ * macros.pic: Pic macro file that is loaded by each run of chem.
+
+ * Makefile.sub: Make file for the groff system.
+
+ * ChangeLog: This file.
+
+ * chem.man: Manual page for the Perl version of chem.
+
+ * README.txt: File for information on this chem version.
+
+ * examples/*.chem: Self-constructed example files for chem.
+
+ * examples/README.txt: Information on the example files.
+
+2006-10-16 Bernd Warken
+
+ * awk version of chem
+ chem is a roff preprocessor that generates chemical structure
+ diagrams suitable for the pic preprocessor. The original version
+ of chem is an awk script written by Brian Kernighan. This project
+ is a rewrite of chem in Perl.
+
+2006-10-15 Bernd Warken
+ ________________________________________________________________
+ License
+
+ Copyright (C) 2006
+ Free Software Foundation, Inc.
+ Written by Bernd Warken
+
+ Copying and distribution of this file, with or without
+ modification, are permitted provided the copyright notice and this
+ notice are preserved.
+
+ This file is part of `chem', which is part of the `groff' project.
+
+ ####### Emacs settings
+
+ Local Variables:
+ mode: change-log
+ End:
Index: Makefile.sub
===================================================================
RCS file: Makefile.sub
diff -N Makefile.sub
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ Makefile.sub 26 Oct 2006 22:13:49 -0000 1.1
@@ -0,0 +1,107 @@
+# Makefile.sub for `chem' (integration into the `groff' source tree)
+
+# File position: <groff-source>/contrib/chem/Makefile.sub
+
+# Copyright (C) 2006 Free Software Foundation, Inc.
+# Written by Bernd Warken.
+
+# Last update: 26 Oct 2006
+
+# This file is part of `chem' which is part of `groff'.
+
+# `groff' is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# `groff' is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with `groff'; see the files COPYING and LICENSE in the top
+# directory of the `groff' source. If not, write to the Free Software
+# Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA.
+
+########################################################################
+
+MAN1=chem.n
+CLEANADD=chem chem.n README examples/README
+
+# not all make programs have $(RM) predefined.
+RM=rm -f
+
+chem_libdir=$(libdir)/groff/chem
+
+all: README examples/README chem $(MAN1)
+
+README: README.txt
+ sed -e "s|@g@|$(g)|g" $(srcdir)/README.txt >$@
+
+examples/README: examples/README.txt
+ if test -d examples; then :; else \
+ $(mkinstalldirs) examples; \
+ fi
+ sed -e "s|@g@|$(g)|g" $(srcdir)/examples/README.txt >$@
+
+chem: chem.pl $(SH_DEPS_SED_SCRIPT)
+ sed -f "$(SH_DEPS_SED_SCRIPT)" \
+ -e "s|@g@|$(g)|g" \
+ -e "s|@BINDIR@|$(DESTDIR)$(bindir)|g" \
+ -e "s|@libdir@|$(DESTDIR)$(libdir)|g" \
+ -e "s|@VERSION@|$(version)$(revision)|g" \
+ -e "$(SH_SCRIPT_SED_CMD)" \
+ $(srcdir)/chem.pl >$@
+ chmod a+x $@
+
+install_data: chem macros.pic pic.tmac $(MAN1) README \
+ examples/*.chem examples/README examples/122/*
+ address@hidden -d $(DESTDIR)$(bindir) || \
+ $(mkinstalldirs) $(DESTDIR)$(bindir)
+ address@hidden(RM) $(DESTDIR)$(bindir)/$(g)chem
+ $(INSTALL_SCRIPT) chem $(DESTDIR)$(bindir)/$(g)chem
+ address@hidden -d $(DESTDIR)$(chem_libdir) || \
+ $(mkinstalldirs) $(DESTDIR)$(chem_libdir)
+ address@hidden(RM) $(DESTDIR)$(chem_libdir)/macros.pic
+ $(INSTALL_DATA) $(srcdir)/macros.pic \
+ $(DESTDIR)$(chem_libdir)/macros.pic
+ address@hidden(RM) $(DESTDIR)$(chem_libdir)/pic.tmac
+ $(INSTALL_DATA) $(srcdir)/pic.tmac \
+ $(DESTDIR)$(chem_libdir)/pic.tmac
+ address@hidden -d $(DESTDIR)$(exampledir)/chem || \
+ $(mkinstalldirs) $(DESTDIR)$(exampledir)/chem/122
+ address@hidden -d $(DESTDIR)$(exampledir)/chem/122 || \
+ $(mkinstalldirs) $(DESTDIR)$(exampledir)/chem/122
+ address@hidden(RM) $(DESTDIR)$(exampledir)/chem/*
+ $(INSTALL_DATA) examples/README \
+ $(DESTDIR)$(exampledir)/chem/README
+ for i in examples/*.chem; do \
+ n=`echo $$i | sed 's|examples/||g'`; \
+ $(INSTALL_DATA) $(srcdir)/$$i \
+ $(DESTDIR)$(exampledir)/chem/$$n; \
+ done
+ address@hidden(RM) $(DESTDIR)$(exampledir)/chem/122/*
+ for i in examples/122/*; do \
+ n=`echo $$i | sed 's|examples/122/||g'`; \
+ $(INSTALL_DATA) $(srcdir)/$$i \
+ $(DESTDIR)$(exampledir)/chem/122/$$n; \
+ done
+
+uninstall_sub:
+ -$(RM) $(DESTDIR)$(bindir)/chem
+ -$(RM) $(DESTDIR)$(libdir)/groff/chem/macros.pic
+ -rmdir $(DESTDIR)$(libdir)/groff/chem
+ -$(RM) $(DESTDIR)$(exampledir)/chem/122/*
+ -rmdir $(DESTDIR)$(exampledir)/chem/122
+ -$(RM) $(DESTDIR)$(exampledir)/chem/*
+ -rmdir $(DESTDIR)$(exampledir)/chem
+ -rmdir $(DESTDIR)$(exampledir)
+
+########################################################################
+# Emacs settings
+########################################################################
+#
+# Local Variables:
+# mode: makefile
+# End:
Index: README.txt
===================================================================
RCS file: README.txt
diff -N README.txt
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ README.txt 26 Oct 2006 22:13:49 -0000 1.1
@@ -0,0 +1,55 @@
+`chem' is a `roff' language to generate chemical structure diagrams.
address@hidden@chem' is a `groff' preprocessor that produces output suitable for
+the address@hidden@pic' preprocessor.
+
+The original version of `chem' is an `awk' script written by Brian
+Kernighan <http://cm.bell-labs.com/cm/cs/who/bwk/index.html>. The
+source files of the `awk' version of `chem' are available at
+<http://cm.bell-labs.com/netlib/typesetting/chem.gz>.
+
+This project is a rewrite of `chem' in Perl for the GNU `roff' project
+`groff'. It was written under Perl v5.8.8, but at least Perl v5.6 is
+needed to run the Perl version of `chem'.
+
+In comparison to the original `awk' version of `chem', the Perl
+version does the following changements:
+- the options -h, --help, -v, --version to output usage and version
+information are added.
+- remove the functions `inline', `shiftfields', and `set'.
+- remove some variables that are used only once.
+
+The subdirectory `examples/' contains example files for chem. They
+are written in the `chem' language. The file names end with .p
+because `pic' code is created by chem.
+
+
+####### License
+
+Last update: 19 Oct 2006
+
+Copyright (C) 2006 Free Software Foundation, Inc.
+Written by Bernd Warken.
+
+This file is part of `chem', which is part of `groff'.
+
+`groff' is free software; you can redistribute it and/or modify it
+under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+`groff' is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with `groff'; see the files COPYING and LICENSE in the top
+directory of the `groff' source. If not, write to the Free Software
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA.
+
+
+####### Emacs settings
+
+Local Variables:
+mode: text
+End:
Index: chem.man
===================================================================
RCS file: chem.man
diff -N chem.man
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ chem.man 26 Oct 2006 22:13:49 -0000 1.1
@@ -0,0 +1,833 @@
+.TH @address@hidden @MAN1EXT@ "@MDATE@" "Groff Version @VERSION@"
+.SH NAME
address@hidden@chem \- groff preprocessor for producing chemical structure
diagrams
+.
+.SH "SYNOPSIS"
+.\" The .SH was moved to this place in order to appease `apropos'.
+.
+.mso www.tmac
+.
+.\" --------------------------------------------------------------------
+.\" Legalize
+.\" --------------------------------------------------------------------
+.
+.ig
address@hidden@chem.1 - man page for @address@hidden (section 1).
+
+Source file position: <groff_source_top>/contrib/chem/chem.man
+Installed position: $prefix/share/man/man1/@address@hidden
+
+Last update: 23 Oct 2006
+..
+.de author
+This file was written by
+.MTO "" "Bernd Warken" .
+It is based on the documentation of
+.URL http://cm.bell-labs.com/cm/cs/who/bwk/index.html "Brian Kernighan" 's
+original
+.I awk
+version of
+.IR chem .
+..
+.de copyleft
+Copyright (C) 2006 Free Software Foundation, Inc.
+.
+.P
+This file is part of
+.IR chem ,
+which is part of
+.IR \%groff ,
+a free software project.
+.
+You can redistribute it and/or modify it under the terms of the
+.nh
+.B GNU General Public License
+.hy
+as published by the
+.nh
+.BR "Free Software Foundation" ,
+.hy
+either version 2, or (at your option) any later version.
+.
+.P
+You should have received a copy of the \f[CR]GNU General Public
+License\f[] along with
+.IR groff ,
+see the files \%\f[CB]COPYING\f[] and \%\f[CB]LICENSE\f[] in the top
+directory of the
+.I groff
+source package.
+.
+Or read the
+.I man\~page
+.BR gpl (1).
+You can also write to the
+.nh
+.B Free Software Foundation, 51 Franklin St - Fifth Floor, Boston,
+.BR "MA 02110-1301, USA" .
+.hy
+..
+.
+.\" --------------------------------------------------------------------
+.\" Setup
+.\" --------------------------------------------------------------------
+.
+.if n \{\
+. mso tty-char.tmac
+. ftr CR R
+. ftr CI I
+. ftr CB B
+.\}
+.
+.if '\*[.T]'dvi' \{\
+. ftr CB CW
+.\}
+.
+.ds Ellipsis "\&.\|.\|.\""
+.
+.
+.
+.\" --------------------------------------------------------------------
+.\" Macro definitions
+.
+.\" Ignore all arguments like a comment, even after a .eo call.
+.de c
+..
+.c --------------------------------------------------------------------
+.c .CB (<text>...)
+.c
+.c Print in constant-width bold font.
+.c
+.de CB
+. ft CB
+. Text \\$*
+. ft
+..
+.c --------------------------------------------------------------------
+.c .CI (<text>...)
+.c
+.c Print in constant-width italic font.
+.c
+.de CI
+. ft CI
+. Text \\$*
+. ft
+..
+.c --------------------------------------------------------------------
+.c .CR (<text>...)
+.c
+.c Print in constant-width roman font.
+.c
+.de CR
+. ft CR
+. Text \\$*
+. ft
+..
+.c --------------------------------------------------------------------
+.c .TP+ ()
+.c
+.c Continuation line for .TP header.
+.c
+.de TP+
+. br
+. ns
+. TP \\$1
+..
+.c --------------------------------------------------------------------
+.c .File_name (<path_name>)
+.c
+.c Display a file or directory name in CB font.
+.c
+.de File_name
+. Header_CB \\$@
+..
+.c --------------------------------------------------------------------
+.c .Header_CB (<path_name>)
+.c
+.c Display a line in CB font, for example after .TP
+.c
+.de Header_CB
+. nh
+. Text \f[CB]\\$1\f[]\\$2
+. hy
+..
+.c --------------------------------------------------------------------
+.c static register for inter-macro communication in `.Synopsis'*
+.nr chem:Synopsis.level 0
+.
+.c --------------------------------------------------------------------
+.c .Synopsis ()
+.c
+.c Begin a synopsis section, to be ended by a ./Synopsis macro.
+.c
+.de Synopsis
+. if (\\n[chem:Synopsis.level] > 0) \
+. Error .\\$0: previous .Synopsis was not closed by ./Synopsis.
+. nh
+. ds @1 \\$1\"
+. nr @old_indent \\n(.i
+. ad l
+. in +\w'address@hidden'u
+. ti address@hidden
+. B address@hidden
+. rr @old_indent
+. rm @1
+. nr chem:Synopsis.level +1\" marker for ./Synopsis
+..
+.c --------------------------------------------------------------------
+.c ./Synopsis ()
+.c
+.c Close a synopsis section opened by the previous .Synopsis macro.
+.c
+.de /Synopsis
+. if (\\n[chem:Synopsis.level] <= 0) \
+. Error .\\$0: no previous call of .Synopsis
+. br
+. ad
+. in
+. hy
+. nr chem:Synopsis.level -1
+..
+.c --------------------------------------------------------------------
+.c .Text (<text>...)
+.c
+.c Treat the arguments as text, no matter how they look.
+.c
+.de Text
+. if (\\n[.$] == 0) \
+. return
+. nh
+. nop \)\\$*\)
+. hy
+..
+.\" --------------------------------------------------------------------
+.\" SH "SYNOPSIS"
+.\" --------------------------------------------------------------------
+.
+.ad l
+.Synopsis @address@hidden
+.RI [ option... ]
+[\f[CB]\-\-\fP]
+.RI [ "\%filespec" "\*[Ellipsis]]"
+./Synopsis
+.
+.Synopsis @address@hidden
+\f[CB]\-h\fP\f[CR]|\fP\f[CB]\-\-help\fP
+./Synopsis
+.
+.Synopsis @address@hidden
+\f[CB]\-v\fP\f[CR]|\fP\f[CB]\-\-version\fP
+./Synopsis
+.
+.
+.P
+The options provoke the printing of a version or usage information;
+there aren't any more options.
+.
+When one of these options is specified all
+.I filespec
+arguments are ignored.
+.
+A
+.I filespec
+argument is either a file name of an existing file or a minus
+character
+.BR \- ,
+meaning standard input.
+.
+If no argument is specified then standard input is taken
+automatically.
+.
+.
+.\" --------------------------------------------------------------------
+.SH DESCRIPTION
+.\" --------------------------------------------------------------------
+.
+The
+.B @address@hidden
+program is a
+.B groff
+preprocessor like
+.BR @address@hidden ,
+.BR @address@hidden ,
+.BR @address@hidden ,
+etc.
+.
+It produces chemical structure diagrams.
+.
+Today's version is best suited for organic chemistry (bonds, rings).
+.
+.
+.P
+The program
+.B @address@hidden
+originates from the Perl source file
+.File_name chem.pl .
+It tells
+.B @address@hidden
+to include a copy of
+.File_name chem.macros
+that is installed in the
+.B groff
+lib directory
+.BR @libdir@/groff/chem .
+.
+.
+.P
+In a style reminiscent of
+.I eqn
+and
+.IR pic ,
+diagrams are written in a special language.
+.
+A set of
+.I chem
+lines must be written between the lines
+.B .cstart
+before and
+.B .cend
+after.
+.
+Anything outside
+these is copied through intact; whatever is between
+.B .cstart
+and
+.B .cend
+is converted into
+.I pic
+commands to draw the diagram.
+.
+.
+.P
+So as a bare minimum,
+.
+.IP
+.nf
+.ft B
+\&.cstart
+CH3
+bond
+CH3
+\&.cend
+.ft
+.fi
+.
+.P
+prints two
+.B CH3
+groups with a bond between them.
+.
+.
+.P
+To actually view this, you must run
+.B @address@hidden
+followed by
+.BR groffer :
+.
+.IP
+.B @address@hidden [file...] | groffer
+.
+.P
+If you want to create just
+.B groff
+output, you must run
+.B @address@hidden
+followed by
+.B groff
+with the option
+.B -p
+for the activation of
+.BR @address@hidden :
+.IP
+.B @address@hidden [file...] | groff -p ...
+.
+.
+.\" --------------------------------------------------------------------
+.SH THE LANGUAGE
+.\" --------------------------------------------------------------------
+.
+The
+.I chem
+input language is rather small. It provides bonds of several styles,
+moieties (e.g.,
+.BR C ,
+.BR NH3 ,
+\*[Ellipsis]), rings of several styles, and a way to glue them together
+as desired.
+.
+In addition, since
+.B @address@hidden
+is a
+.B @address@hidden
+preprocessor, it's possible to include
+.I pic
+statements in the middle of a diagram to draw things not provided for
+by
+.I chem
+itself.
+.
+.
+.\" --------------------------------------------------------------------
+.SS Bonds:
+.\" --------------------------------------------------------------------
+.
+.IP
+.B bond
+.RI [ direction ]
+.RI [ "length n" ]
+.RB [ from
+.IR Name | picstuff ]
+.
+.P
+draws a single bond in direction from nearest corner of
+.IR Name .
+.B bond
+can also be
+.BR "double bond" ,
+.BR "front bond" ,
+.BR "back bond" ,
+etc.
+.
+(We'll get back to
+.I Name
+in a minute.)
+.
+.
+.P
+.I direction
+is the angle in degrees (0 up, positive clockwise)
+or a direction word like
+.BR up ,
+.BR down ,
+.B sw
+(= southwest), etc.
+.
+If no direction is specified, the bond goes in the current direction
+(usually that of the last bond).
+.
+.
+.P
+Normally the bond begins at the last object placed; this
+can be changed by naming a
+.B from
+place.
+.
+For instance, to make a simple alkyl chain:
+.RS
+.TP 10m
+.B CH3
+.TP+
+.B bond
+(this one goes right from the CH3)
+.TP+
+.B C
+(at the right end of the bond)
+.TP+
+.B double bond up
+(from the C)
+.TP+
+.B O
+(at the end of the double bond)
+.TP+
+.B bond right from C
+.TP+
+.B CH3
+.RE
+.
+.
+.P
+A length in inches may be specified to override the default length.
+.
+Other
+.I pic
+commands can be tacked on to the end of a bond command, to created
+dotted or dashed bonds or to specify a
+.B to
+place.
+.
+.
+.\" --------------------------------------------------------------------
+.SS Names:
+.\" --------------------------------------------------------------------
+.
+In the alkyl chain above, notice that the carbon atom
+.B C
+was used both to draw something and as the name for a place.
+.
+A moiety always defines a name for a place; you can use
+your own names for places instead, and indeed, for rings
+you will have to.
+.
+A name is just
+.
+.IP
+.IB Name :
+\*[Ellipsis]
+.
+.
+.P
+.I Name
+is often the name of a moiety like
+.BR CH3 ,
+but it needn't be.
+.
+Any name that begins with a capital letter and contains only letters
+and numbers is ok:
+.
+.RS
+.TP
+.B First:
+.B bond
+.TP+
+\&
+.B bond 30 from First
+.RE
+.
+.
+.\" --------------------------------------------------------------------
+.SS Moieties:
+.\" --------------------------------------------------------------------
+.
+A moiety is a string of characters beginning with a capital letter,
+such as N(C2H5)2.
+.
+Numbers are converted to subscripts (unless they appear to be
+fractional values, as in N2.5H). The moiety names itself after
+special characters have been stripped out: N(C2H5)2) has the name
+NC2H52.
+
+.B BP
+is a special
+.I branch point
+(i.e., line crossing) that doesn't print.
+.
+Normally a moiety is placed right after the last thing mentioned, but
+it may be positioned by
+.IR pic -like
+commands, e.g.,
+.
+.IP
+.B CH3 at C + (0.5,0.5)
+.
+.
+.P
+Text within quotes "\*[Ellipsis]" is treated more or less like a
+moiety except that no changes are made to the quoted part.
+.
+.
+.\" --------------------------------------------------------------------
+.SS Rings:
+.\" --------------------------------------------------------------------
+.
+There are lots of rings, but only 5 and 6-sided rings get
+much support.
+.
+.B ring
+by itself is a 6-sided ring;
+.B benzene
+is the benzene ring with a circle inside.
+.B aromatic
+puts a circle into any kind of ring.
+.
+.IP
+.B ring
+.RB [ pointing up | right | left | down ]
+.RB [ aromatic ]
+.RI "[put Mol at" n ]
+.RB [ double
+.IR i , j
+.IR k , l
+\*[Ellipsis]]
+.RI [ picstuff ]
+.
+.
+.P
+The vertices of a ring are numbered 1,2,\*[Ellipsis] from the vertex
+that points in the natural compass direction.
+.
+So for a hexagonal ring with the point at the top, the top vertex is
+1, while if the ring has a point at the east side, that is vertex 1.
+.
+This is expressed as
+.
+.IP
+.ft B
+.nf
+R1: ring pointing up
+R2: ring pointing right
+.fi
+.ft
+.
+.
+.P
+The ring vertices are named
+.B .V1
+\..
+.BI .V n\fR,
+with
+.B .V1
+in the pointing direction.
+.
+So the corners of
+.B R1
+are
+.B R1.V1
+(the
+.IR top ),
+.BR R1.V2 ,
+.BR R1.V3 ,
+.B R1.V4
+(the
+.IR bottom ),
+etc., whereas for
+.BR R2 ,
+.B R2.V1
+is the rightmost vertex and
+.B R2.V4
+the leftmost.
+.
+These vertex names are used for connecting bonds or other rings. For
+example:
+.
+.IP
+.ft B
+.nf
+R1: benzene pointing right
+R2: benzene pointing right with .V6 at R1.V2
+.fi
+.ft
+.P
+creates two benzene rings connected along a side.
+.
+.
+.P
+Interior double bonds are specified as
+.BR double n1,n2 n3,n4 \*[Ellipsis];
+each number pair adds an interior bond.
+.
+So the alternate form of a benzene ring is
+.
+.IP
+.B ring double 1,2 3,4 5,6
+.
+.
+.P
+Heterocycles (rings with something other than carbon at a vertex) are
+written as
+.BR "put X at V",
+as in
+.
+.IP
+.B R: ring put N at 1 put O at 2
+.
+.
+.P
+In this heterocycle,
+.B R.N
+and
+.B R.O
+become synonyms for
+.B R.V1 and
+.BR R.V2 .
+.
+.
+.P
+There are two 5-sided rings.
+.
+.B ring5
+is pentagonal with a side that matches the 6-sided ring; it has four
+natural directions.
+.
+A
+.B flatring
+is a 5-sided ring created by chopping one corner of a 6-sided ring so
+that it exactly matches the 6-sided rings.
+.
+.
+.P
+The description of a ring has to fit on a single line.
+.
+.
+.\" --------------------------------------------------------------------
+.SS Miscellaneous:
+.\" --------------------------------------------------------------------
+.
+The specific construction
+.RS
+.TP
+.BR bond \*[Ellipsis] "; moiety"
+(spaces matter!)
+.RE
+.P
+is equivalent to
+.IP
+.ft B
+.nf
+bond
+moiety
+.fi
+.ft
+.
+.
+.P
+Otherwise, each item has to be on a separate line (and only one line).
+.
+.
+.P
+A period
+.B .
+in column 1 signals a troff command, which is copied through as is.
+.
+.
+.P
+A line whose first non-blank character is a
+.B #
+is treated as a comment.
+.
+.
+.P
+A line whose first word is
+.B pic
+is copied through as is after the
+.B pic
+has been removed.
+.
+.
+.P
+The command
+.IP
+.B size
+.I n
+.P
+scales the diagram so it looks plausible at point size
+.I n
+(default is 10 point).
+.
+.
+.P
+Anything else is assumed to be
+.I pic
+and is copied through with a label.
+.
+.
+.\" --------------------------------------------------------------------
+.SS WISH LIST
+.\" --------------------------------------------------------------------
+.
+.P
+This TODO list was collected by Brian Kernighan.
+.
+.P
+Error checking is minimal; errors are usually detected and reported in
+an oblique fashion by
+.IR pic .
+.
+.P
+There's no library or file inclusion mechanism, and there's no
+shorthand for repetitive structures.
+.
+.P
+The extension mechanism is to create
+.I pic
+macros, but these are tricky to get right and don't have all the
+properties of built-in objects.
+.
+.P
+There's no in-line chemistry yet (e.g., analogous to the $...$
+construct of eqn).
+.
+.P
+There is no way to control entry point for bonds on groups. Normally
+a bond connects to the carbon atom if entering from the top or bottom
+and otherwise to the nearest corner.
+.
+.P
+Bonds from substituted atoms on heterocycles do not join at the proper
+place without adding a bit of
+.IR pic .
+.
+.P
+There is no decent primitive for brackets.
+.
+.P
+Text (quoted strings) doesn't work very well.
+.
+.P
+A squiggle bond is needed.
+.
+.
+.\" --------------------------------------------------------------------
+.SH "BUGS"
+.\" --------------------------------------------------------------------
+.
+Report bugs to the
+.MTO address@hidden "bug-groff mailing list" .
+.
+Include a complete, self-contained example that will allow the bug to
+be reproduced, and say which version of
+.B @address@hidden
+you are using.
+.
+.
+.P
+You can also use the
+.MTO address@hidden "groff mailing list" ,
+but you must first subscribe to this list.
+.
+You can do that by visiting the
+.URL http://\:lists.gnu.org/\:mailman/\:listinfo/\:groff \
+"groff mailing list web page" .
+.
+.
+.P
+See
+.BR \%groff (@MAN1EXT@)
+for information on availability.
+.
+.
+.\" --------------------------------------------------------------------
+.SH "SEE ALSO"
+.\" --------------------------------------------------------------------
+.
+.BR \%groff (@MAN1EXT@),
+.BR address@hidden@pic (@MAN1EXT@),
+.B \%groffer (@MAN1EXT@)
+.
+.
+.P
+You can still get the original
+.URL http://cm.bell-labs.com/netlib/typesetting/chem.gz \
+"chem awk source" .
+.
+Its
+.File_name README
+file was used for this
+.IR man\~page .
+.
+.
+.P
+The other classical document on
+.I chem
+is
+.URL http://cm.bell-labs.com/cm/cs/cstr/122.ps.gz 122.ps .
+.
+.
+.\" --------------------------------------------------------------------
+.SH "AUTHOR"
+.\" --------------------------------------------------------------------
+.author
+.
+.
+.\" --------------------------------------------------------------------
+.SH "COPYING"
+.\" --------------------------------------------------------------------
+.copyleft
+.
+.
+.\" --------------------------------------------------------------------
+.\" Emacs settings
+.\" --------------------------------------------------------------------
+.
+.\" Local Variables:
+.\" mode: nroff
+.\" End:
Index: chem.pl
===================================================================
RCS file: chem.pl
diff -N chem.pl
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ chem.pl 26 Oct 2006 22:13:49 -0000 1.1
@@ -0,0 +1,1267 @@
+#! /usr/bin/env perl
+
+# chem - a groff preprocessor for producing chemical structure diagrams
+
+# Source file position: <groff-source>/contrib/chem/chem.pl
+# Installed position: <prefix>/bin/chem
+
+# Copyright (C) 2006 Free Software Foundation, Inc.
+# Written by Bernd Warken.
+
+# This file is part of `chem', which is part of `groff'.
+
+# `groff' is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# `groff' is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with `groff'; see the files COPYING and LICENSE in the top
+# directory of the `groff' source. If not, write to the Free Software
+# Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301,
+# USA.
+
+########################################################################
+# settings
+########################################################################
+
+my $Program_Version = '0.1.0';
+my $Last_Update = '26 Oct 2006';
+
+# this setting of the groff version is only used before make is run,
+# otherwise @VERSION@ will set it.
+my $Groff_Version_Preset='1.19.3preset';
+
+# test on Perl version
+require v5.6;
+
+
+########################################################################
+# begin
+########################################################################
+
+use warnings;
+use strict;
+use Math::Trig;
+
+# for catfile()
+use File::Spec;
+
+# $Bin is the directory where this script is located
+use FindBin;
+
+my $Chem_Name;
+my $Groff_Version;
+my $File_macros_pic;
+my $File_pic_tmac;
+
+BEGIN {
+ {
+ my $before_make; # script before run of `make'
+ {
+ my $at = '@';
+ $before_make = 1 if '@VERSION@' eq "${at}VERSION${at}";
+ }
+
+ my %at_at;
+ my $chem_libdir;
+
+ if ($before_make) {
+ my $chem_dir = $FindBin::Bin;
+ $at_at{'BINDIR'} = $chem_dir;
+ $at_at{'G'} = '';
+ $at_at{'LIBDIR'} = '';
+ $chem_libdir = $chem_dir;
+ $File_macros_pic = File::Spec->catfile($chem_dir, 'macros.pic');
+ $File_pic_tmac = File::Spec->catfile($chem_dir, 'pic.tmac');
+ $Groff_Version = '';
+ $Chem_Name = 'chem';
+ } else {
+ $Groff_Version = '@VERSION@';
+ $at_at{'BINDIR'} = '@BINDIR@';
+ $at_at{'G'} = '@g@';
+ $at_at{'LIBDIR'} = '@libdir@';
+ $chem_libdir =
+ File::Spec->catdir($at_at{'LIBDIR'}, 'groff', 'chem');
+ $File_macros_pic = File::Spec->catfile($chem_libdir, 'macros.pic');
+ $File_pic_tmac = File::Spec->catfile($chem_libdir, 'pic.tmac');
+ $Chem_Name = $at_at{'G'} . 'chem';
+ }
+ }
+}
+
+
+########################################################################
+# check the parameters
+########################################################################
+
+if (@ARGV) {
+ # process any FOO=bar switches
+ # eval '$'.$1.'$2;' while $ARGV[0] =~ /^([A-Za-z_0-9]+=)(.*)/ && shift;
+ my @filespec = ();
+ my $dbl_minus;
+ my $wrong;
+ foreach (@ARGV) {
+ next unless $_;
+ if (/=/) {
+ # ignore FOO=bar switches
+ push @filespec, $_ if -f;
+ next;
+ }
+ if ($dbl_minus) {
+ if (-f $_) {
+ push @filespec, $_;
+ } else {
+ warn "chem: argument $_ is not an existing file.\n";
+ $wrong = 1;
+ }
+ next;
+ }
+ if (/^--$/) {
+ $dbl_minus = 1;
+ next;
+ }
+ if (/^-$/) {
+ push @filespec, $_;
+ next;
+ }
+ if (/^-h$/ or '--help' =~ /^$_/) {
+ &usage();
+ exit 0;
+ }
+ if (/^-v$/ or '--version' =~ /^$_/) {
+ &version();
+ exit 0;
+ }
+ if (-f $_) {
+ push @filespec, $_;
+ } else {
+ $wrong = 1;
+ if (/^-/) {
+ warn "chem: wrong option ${_}.\n";
+ } else {
+ warn "chem: argument $_ is not an existing file.\n";
+ }
+ }
+ }
+ if (@filespec) {
+ @ARGV = @filespec;
+ } else {
+ exit 0 if $wrong;
+ @ARGV = ('-');
+ }
+} else { # @ARGV is empty
+ @ARGV = ('-') unless @ARGV;
+}
+
+
+########################################################################
+# main process
+########################################################################
+
+my %dc = ( 'up' => 0, 'right' => 90, 'down' => 180, 'left' => 270,
+ 'ne' => 45, 'se' => 135, 'sw' => 225, 'nw' => 315,
+ 0 => 'n', 90 => 'e', 180 => 's', 270 => 'w',
+ 30 => 'ne', 45 => 'ne', 60 => 'ne',
+ 120 => 'se', 135 => 'se', 150 => 'se',
+ 210 => 'sw', 225 => 'sw', 240 => 'sw',
+ 300 => 'nw', 315 => 'nw', 330 => 'nw',
+ );
+my $RSTART;
+
+my $Word_Count;
+my @Words;
+
+my $Line_No;
+my $Last_Name = '';
+
+# from init()
+my $First_Time = 1;
+my $RING;
+my $MOL;
+my $BOND;
+my $OTHER;
+my $Last;
+my $Dir; # direction
+
+# from setparams()
+my $lineht;
+my $linewid;
+my $textht;
+my $db;
+my $cwid;
+my $cr;
+my $crh;
+my $crw;
+my $dav;
+my $dew;
+my $ringside;
+my $dbrack;
+
+# from ring()
+my $nput;
+my $aromatic;
+my %put;
+my %dbl;
+
+my %labtype;
+
+my $File_Name = '';
+
+&main();
+
+{
+ my $is_pic = '';
+ my $is_chem = '';
+ my $former_line = '';
+
+ ##########
+ # main()
+ #
+ sub main {
+ my $count_minus = 0;
+ my @stdin = ();
+ my $stdin = 0;
+ foreach (@ARGV) {
+ $count_minus++ if /^-$/;
+ }
+ foreach my $arg (@ARGV) {
+ &setparams(1.0);
+ next unless $arg;
+ $Line_No = 0;
+ $is_pic = '';
+ $is_chem = '';
+ # for centralizing the pic code
+ open TMAC, "<$File_pic_tmac";
+ print <TMAC>;
+ close TMAC;
+ if ($arg eq '-') {
+ $File_Name = 'standard input';
+ if ($stdin) {
+ &main_line($_) foreach @stdin;
+ } else {
+ $stdin = 1;
+ if ($count_minus <= 1) {
+ while (<STDIN>) {
+ &main_line($_);
+ }
+ } else {
+ @stdin = ();
+ while (<STDIN>) {
+ push @stdin, $_;
+ &main_line($_);
+ }
+ }
+ }
+### main()
+ } else { # $arg is not -
+ $File_Name = $arg;
+ open FILE, "<$arg";
+ &main_line($_) while <FILE>;
+ close FILE;
+ } # if $arg
+ if ($is_pic) {
+ printf ".PE\n";
+ }
+ }
+ } # main()
+
+
+ ##########
+ # main_line()
+ #
+ sub main_line {
+ my $line = $_[0];
+ my $stack;
+ $Line_No++;
+ chomp $line;
+
+ $line = $former_line . $line if $former_line;
+ if ($line =~ /^(.*)\\$/) {
+ $former_line = $1;
+ return 1;
+ } else {
+ $former_line = '';
+ }
+
+ {
+ my $s = $line;
+ $s =~ s/^\s+//;
+ $s =~ s/\s+$//;
+ return 1 unless $s;
+ @Words = split(/\s+/, $s);
+ return 1 unless @Words;
+ foreach my $i (0..$#Words) {
+ if ($Words[$i] =~ /^\s*#/) {
+ $#Words = $i - 1;
+ last;
+ }
+ }
+ return 1 unless @Words;
+ }
+
+ if ($line =~ /^([\.']\s*PS\s*)|([\.']\s*PS\s.+)$/) {
+ # .PS
+ unless ($is_pic) {
+ $is_pic = 'running';
+ print "$line\n";
+ }
+ return 1;
+ }
+### main_line()
+ if ( $line =~ /^([\.']\s*PE\s*)|([\.']\s*PE\s.+)$/ ) {
+ # .PE
+ $is_chem = '';
+ if ($is_pic) {
+ $is_pic = '';
+ print "$line\n";
+ }
+ return 1;
+ }
+ if ($line =~ /^[\.']\s*cstart\s*$/) {
+ # line: `.cstart'
+ if ($is_chem) {
+ &error("additional `.cstart'; chem is already active.");
+ return 1;
+ }
+ unless ($is_pic) {
+ &print_ps();
+ $is_pic = 'by chem';
+ }
+ $is_chem = '.cstart';
+ &init();
+ return 1;
+ }
+### main_line()
+ if ($line =~ /^\s*begin\s+chem\s*$/) {
+ # line: `begin chem'
+ if ($is_pic) {
+ if ($is_chem) {
+ &error("additional `begin chem'; chem is already active.");
+ return 1;
+ }
+ $is_chem = 'begin chem';
+ &init();
+ } else {
+ print "$line\n";
+ }
+ return 1;
+ }
+ if ($line =~ /^[\.']\s*cend\s*/) {
+ # line `.cend'
+ if ($is_chem) {
+ &error("you end chem with `.cend', but started it with `begin chem'.")
+ if $is_chem eq 'begin chem';
+ if ($is_pic eq 'by chem') {
+ &print_pe();
+ $is_pic = '';
+ }
+ $is_chem = '';
+ } else {
+ print "$line\n";
+ }
+ return 1;
+ }
+ if ($line =~ /^\s*end\s*$/) {
+ # line: `end'
+ if ($is_chem) {
+ &error("you end chem with `end', but started it with `.cstart'.")
+ if $is_chem eq '.cstart';
+ if ($is_pic eq 'by chem') {
+ &print_pe();
+ $is_pic = '';
+ }
+ $is_chem = '';
+ } else {
+ print "$line\n";
+ }
+ return 1;
+ }
+
+### main_line()
+ if (! $is_chem) {
+ print "$line\n";
+ return 1;
+ }
+ if ($line =~ /^[.']/) {
+ # groff request line
+ print "$line\n";
+ return 1;
+ }
+ if ($Words[0] eq 'pic') {
+ # pic pass-thru
+ return 1 if $#Words == 0;
+ my $s = $line;
+ $s =~ /^\s*pic\s*(.*)$/;
+ $s = $1;
+ print "$s\n" if $s;
+ return 1;
+ }
+ if ($Words[0] eq 'textht') {
+ if ($#Words == 0) {
+ &error("`textht' needs a single argument.");
+ return 0;
+ }
+ &error("only the last argument is taken for `textht', " .
+ "all others are ignored.")
+ unless $#Words <= 1 or ($#Words == 2 && $Words[1] =~ /^=/);
+ $textht = $Words[$#Words];
+ return 1;
+ }
+### main_line()
+ if ($Words[0] eq 'cwid') {
+ if ($#Words == 0) {
+ &error("`cwid' needs a single argument.");
+ return 0;
+ }
+ &error("only the last argument is taken for `cwid', " .
+ "all others are ignored.")
+ unless $#Words <= 1 or ($#Words == 2 && $Words[1] =~ /^=/);
+ $cwid = $Words[$#Words];
+ return 1;
+ }
+ if ($Words[0] eq 'db') {
+ if ($#Words == 0) {
+ &error("`db' needs a single argument.");
+ return 0;
+ }
+ &error("only the last argument is taken for `db', " .
+ "all others are ignored.")
+ unless $#Words <= 1 or ($#Words == 2 && $Words[1] =~ /^=/);
+ $db = $Words[$#Words];
+ return 1;
+ }
+ if ($Words[0] eq 'size') {
+ my $size;
+ if ($#Words == 0) {
+ &error("`size' needs a single argument.");
+ return 0;
+ }
+ &error("only the last argument is taken for `size', " .
+ "all others are ignored.")
+ unless $#Words <= 1 or ($#Words == 2 && $Words[1] =~ /^=/);
+ if ($Words[$#Words] <= 4) {
+ $size = $Words[$#Words];
+ } else {
+ $size = $Words[$#Words] / 10;
+ }
+ &setparams($size);
+ return 1;
+ }
+
+### main_line()
+ print "\n#", $line, "\n"; # debugging, etc.
+ $Last_Name = '';
+
+ if ($Words[0] =~ /^[A-Z].*:$/) {
+ # label; falls thru after shifting left
+ $Last_Name = $Words[0];
+ $Last_Name =~ s/:$//;
+ print "$Words[0]\n";
+ shift @Words;
+ }
+
+ if ($Words[0] =~ /^"/) {
+ print 'Last: ', $line, "\n";
+ $Last = $OTHER;
+ return 1;
+ }
+
+ if ($Words[0] =~ /bond/) {
+ &bond($Words[0]);
+ return 1;
+ }
+
+ if ($#Words >= 1) {
+ if ($Words[0] =~ /^(double|triple|front|back)$/ &&
+ $Words[1] eq 'bond') {
+ @Words = ($Words[0] . $Words[1], @Words[2..$#Words]);
+ &bond($Words[0]);
+ return 1;
+ }
+
+ if ($Words[0] eq 'aromatic') {
+ my $temp = $Words[0];
+ $Words[0] = $Words[1] ? $Words[1] : '';
+ $Words[1] = $temp;
+ }
+ }
+
+ if ($Words[0] =~ /ring|benz/) {
+ &ring($Words[0]);
+ return 1;
+ }
+ if ($Words[0] eq 'methyl') {
+ # left here as an example
+ $Words[0] = 'CH3';
+ }
+### main_line()
+ if ($Words[0] =~ /^[A-Z]/) {
+ &molecule();
+ return 1;
+ }
+ if ($Words[0] eq 'left') {
+ my %left; # not used
+ $left{++$stack} = &fields(1, $#Words);
+ printf (("Last: [\n"));
+ return 1;
+ }
+ if ($Words[0] eq 'right') {
+ &bracket();
+ $stack--;
+ return 1;
+ }
+ if ($Words[0] eq 'label') {
+ &label();
+ return 1;
+ }
+ if (/./) {
+ print 'Last: ', $line, "\n";
+ $Last = $OTHER;
+ }
+ 1;
+ } # main_line()
+
+}
+
+########################################################################
+# functions
+########################################################################
+
+##########
+# atom(<string>)
+#
+sub atom {
+ # convert CH3 to atom(...)
+ my ($s) = @_;
+ my ($i, $n, $nsub, $cloc, $nsubc, @s);
+ if ($s eq "\"\"") {
+ return $s;
+ }
+ $n = length($s);
+ $nsub = $nsubc = 0;
+ $cloc = index($s, 'C');
+ if (! defined($cloc) || $cloc < 0) {
+ $cloc = 0;
+ }
+ @s = split('', $s);
+ $i = 0;
+ foreach (@s) {
+ unless (/[A-Z]/) {
+ $nsub++;
+ $nsubc++ if $i < $cloc;
+ $i++;
+ }
+ }
+ $s =~ s/([0-9]+\.[0-9]+)|([0-9]+)/\\s-3\\d$&\\u\\s+3/g;
+ if ($s =~ /([^0-9]\.)|(\.[^0-9])/) { # centered dot
+ $s =~ s/\./\\v#-.3m#.\\v#.3m#/g;
+ }
+ sprintf( "atom(\"%s\", %g, %g, %g, %g, %g, %g)",
+ $s, ($n - $nsub / 2) * $cwid, $textht,
+ ($cloc - $nsubc / 2 + 0.5) * $cwid, $crh, $crw, $dav
+ );
+} # atom()
+
+
+##########
+# bond(<type>)
+#
+sub bond {
+ my ($type) = @_;
+ my ($i, $goes, $from, $leng);
+ $goes = '';
+ for ($i = 1; $i <= $#Words; $i++) {
+ if ($Words[$i] eq ';') {
+ &error("a colon `;' must be followed by a space and a single word.")
+ if $i != $#Words - 1;
+ $goes = $Words[$i + 1] if $#Words > $i;
+ $#Words = $i - 1;
+ last;
+ }
+ }
+ $leng = $db;
+ $from = '';
+ for ($Word_Count = 1; $Word_Count <= $#Words; ) {
+ if ($Words[$Word_Count] =~
+ /(\+|-)?[0-9]+|up|down|right|left|ne|se|nw|sw/) {
+ $Dir = &cvtdir($Dir);
+ } elsif ($Words[$Word_Count] =~ /^leng/) {
+ $leng = $Words[$Word_Count + 1] if $#Words > $Word_Count;
+ $Word_Count += 2;
+ } elsif ($Words[$Word_Count] eq 'to') {
+ $leng = 0;
+ $from = &fields($Word_Count, $#Words);
+ last;
+ } elsif ($Words[$Word_Count] eq 'from') {
+ $from = &dofrom();
+ last;
+ } elsif ($Words[$Word_Count] =~ /^#/) {
+ $Word_Count = $#Words + 1;
+ last;
+ } else {
+ $from = &fields($Word_Count, $#Words);
+ last;
+ }
+ }
+### bond()
+ if ($from =~ /( to )|^to/) { # said "from ... to ...", so zap length
+ $leng = 0;
+ } elsif (! $from) { # no from given at all
+ $from = 'from Last.' . &leave($Last, $Dir) . ' ' .
+ &fields($Word_Count, $#Words);
+ }
+ printf "Last: %s(%g, %g, %s)\n", $type, $leng, $Dir, $from;
+ $Last = $BOND;
+ if ($Last_Name) {
+ &labsave($Last_Name, $Last, $Dir);
+ }
+ if ($goes) {
+ @Words = ($goes);
+ &molecule();
+ }
+} # bond()
+
+
+##########
+# bracket()
+#
+sub bracket {
+ my $t;
+ printf (("]\n"));
+ if ($Words[1] && $Words[1] eq ')') {
+ $t = 'spline';
+ } else {
+ $t = 'line';
+ }
+ printf "%s from last [].sw+(%g,0) to last [].sw to last [].nw to last " .
+ "[].nw+(%g,0)\n", $t, $dbrack, $dbrack;
+ printf "%s from last [].se-(%g,0) to last [].se to last [].ne to last " .
+ "[].ne-(%g,0)\n", $t, $dbrack, $dbrack;
+ if ($Words[2] && $Words[2] eq 'sub') {
+ printf "\" %s\" ljust at last [].se\n", &fields(3, $#Words);
+ }
+} # bracket()
+
+
+##########
+# corner(<dir>)
+#
+sub corner {
+ my ($d) = @_;
+ $dc{&reduce(45 * int(($d + 22.5) / 45))};
+} # corner()
+
+
+##########
+# cvtdir(<dir>)
+#
+sub cvtdir {
+ my ($d) = @_;
+ # maps "[pointing] somewhere" to degrees
+ if ($Words[$Word_Count] eq 'pointing') {
+ $Word_Count++;
+ }
+ if ($Words[$Word_Count] =~ /^[+\\-]?[0-9]+/) {
+ return &reduce($Words[$Word_Count++]);
+ } elsif ($Words[$Word_Count] =~ /left|right|up|down|ne|nw|se|sw/) {
+ return &reduce($dc{$Words[$Word_Count++]});
+ } else {
+ $Word_Count++;
+ return $d;
+ }
+} # cvtdir()
+
+
+##########
+# dblring(<v>)
+#
+sub dblring {
+ my ($v) = @_;
+ my ($d, $v1, $v2);
+ # should canonicalize to i,i+1 mod v
+ $d = $Words[$Word_Count];
+ for ($Word_Count++; $Word_Count <= $#Words &&
+ $Words[$Word_Count] =~ /^[1-9]/; $Word_Count++) {
+ $v1 = substr($Words[$Word_Count], 0, 1);
+ $v2 = substr($Words[$Word_Count], 2, 1);
+ if ($v2 == $v1 + 1 || $v1 == $v && $v2 == 1) { # e.g., 2,3 or 5,1
+ $dbl{$v1} = $d;
+ } elsif ($v1 == $v2 + 1 || $v2 == $v && $v1 == 1) { # e.g., 3,2 or
1,5
+ $dbl{$v2} = $d;
+ } else {
+ &error(sprintf("weird %s bond in\n\t%s", $d, $_));
+ }
+ }
+} # dblring()
+
+
+##########
+# dofrom()
+#
+sub dofrom {
+ my $n;
+ $Word_Count++; # skip "from"
+ $n = $Words[$Word_Count];
+ if (defined $labtype{$n}) { # "from Thing" => "from Thing.V.s"
+ return 'from ' . $n . '.' . &leave($labtype{$n}, $Dir);
+ }
+ if ($n =~ /^\.[A-Z]/) { # "from .V" => "from Last.V.s"
+ return 'from Last' . $n . '.' . &corner($Dir);
+ }
+ if ($n =~ /^[A-Z][^.]*\.[A-Z][^.]*$/) { # "from X.V" => "from X.V.s"
+ return 'from ' . $n . '.' . &corner($Dir);
+ }
+ &fields($Word_Count - 1, $#Words);
+} # dofrom()
+
+
+##########
+# error(<string>)
+#
+sub error {
+ my ($s) = @_;
+ printf STDERR "chem: error in %s on line %d: %s\n",
+ $File_Name, $Line_No, $s;
+} # error()
+
+
+##########
+# fields(<n1>, <n2>)
+#
+sub fields {
+ my ($n1, $n2) = @_;
+ my ($i, $s);
+ if ($n1 > $n2) {
+ return '';
+ }
+ $s = '';
+ for ($i = $n1; $i <= $n2; $i++) {
+ if ($Words[$i] =~ /^#/) {
+ last;
+ }
+ $s = $s . $Words[$i] . ' ';
+ }
+ $s;
+} # fields()
+
+
+##########
+# init()
+#
+sub init {
+ if ($First_Time) {
+ printf "copy \"%s\"\n", $File_macros_pic;
+ printf "\ttextht = %g; textwid = .1; cwid = %g\n", $textht, $cwid;
+ printf "\tlineht = %g; linewid = %g\n", $lineht, $linewid;
+ $First_Time = 0;
+ }
+ printf "Last: 0,0\n";
+ $RING = 'R';
+ $MOL = 'M';
+ $BOND = 'B';
+ $OTHER = 'O'; # manifests
+ $Last = $OTHER;
+ $Dir = 90;
+} # init()
+
+
+##########
+# joinring(<type>, <dir>, <last>)
+#
+sub joinring {
+ my ($type, $d, $last) = @_;
+ # join a ring to something
+ if (substr($last, 0, 1) eq $RING) {
+ # ring to ring
+ if (substr($type, 2) eq substr($last, 2)) { # fails if not 6-sided
+ return 'with .V6 at Last.V2';
+ }
+ }
+ # if all else fails
+ sprintf('with .%s at Last.%s',
+ &leave($type, $d + 180), &leave($last, $d));
+} # joinring()
+
+
+##########
+# label()
+#
+sub label {
+ my ($i, $v);
+ if (! exists $labtype{$Words[1]} or ! $RING or
+ substr($labtype{$Words[1]}, 0, 1) ne $RING) {
+ &error(sprintf('%s is not a ring', $Words[1]));
+ } else {
+ $v = substr($labtype{$Words[1]}, 1, 1);
+ $Words[1] = '' unless $Words[1];
+ for ($i = 1; $i <= $v; $i++) {
+ printf "\"\\s-3%d\\s0\" at 0.%d<%s.C,%s.V%d>\n", $i, $v + 2,
+ $Words[1], $Words[1], $i;
+ }
+ }
+} # label()
+
+
+##########
+# labsave(<name>, <type>, <dir>)
+#
+sub labsave {
+ my ($name, $type, $d) = @_;
+ $labtype{$name} = $type;
+# $labdir{$name} = $d;
+} # labsave()
+
+
+##########
+# leave(<last>, <d>)
+#
+sub leave {
+ my ($last, $d) = @_;
+ my ($c, $c1);
+ # return vertex of last in dir d
+ if ($last eq $BOND) {
+ return 'end';
+ }
+ $d = &reduce($d);
+ if (substr($last, 0, 1) eq $RING) {
+ return &ringleave($last, $d);
+ }
+ if ($last eq $MOL) {
+ if ($d == 0 || $d == 180) {
+ $c = 'C';
+ } elsif ($d > 0 && $d < 180) {
+ $c = 'R';
+ } else {
+ $c = 'L';
+ }
+ if (defined $dc{$d}) {
+ $c1 = $dc{$d};
+ } else {
+ $c1 = &corner($d);
+ }
+ return sprintf('%s.%s', $c, $c1);
+ }
+ if ($last eq $OTHER) {
+ return &corner($d);
+ }
+ 'c';
+} # leave()
+
+
+##########
+# makering(<type>, <pt>, <v>)
+#
+sub makering {
+ my ($type, $pt, $v) = @_;
+ my ($i, $j, $a, $r, $rat, $fix, $c1, $c2);
+ if ($type =~ /flat/) {
+ $v = 6;
+ # vertices
+ ;
+ }
+ $r = $ringside / (2 * sin(pi / $v));
+ printf "\tC: 0,0\n";
+ for ($i = 0; $i <= $v + 1; $i++) {
+ $a = (($i - 1) / $v * 360 + $pt) / 57.29578; # 57. is $deg
+ printf "\tV%d: (%g,%g)\n", $i, $r * sin($a), $r * cos($a);
+ }
+ if ($type =~ /flat/) {
+ printf "\tV4: V5; V5: V6\n";
+ $v = 5;
+ }
+ # sides
+ if ($nput > 0) {
+ # hetero ...
+ for ($i = 1; $i <= $v; $i++) {
+ $c1 = $c2 = 0;
+ if ($put{$i} ne '') {
+ printf "\tV%d: ellipse invis ht %g wid %g at V%d\n",
+ $i, $crh, $crw, $i;
+ printf "\t%s at V%d\n", $put{$i}, $i;
+ $c1 = $cr;
+ }
+ $j = $i + 1;
+ if ($j > $v) {
+ $j = 1;
+ }
+### makering()
+ if ($put{$j} ne '') {
+ $c2 = $cr;
+ }
+ printf "\tline from V%d to V%d chop %g chop %g\n", $i, $j, $c1, $c2;
+ if ($dbl{$i} ne '') {
+ # should check i<j
+ if ($type =~ /flat/ && $i == 3) {
+ $rat = 0.75;
+ $fix = 5;
+ } else {
+ $rat = 0.85;
+ $fix = 1.5;
+ }
+ if ($put{$i} eq '') {
+ $c1 = 0;
+ } else {
+ $c1 = $cr / $fix;
+ }
+ if ($put{$j} eq '') {
+ $c2 = 0;
+ } else {
+ $c2 = $cr / $fix;
+ }
+ printf "\tline from %g<C,V%d> to %g<C,V%d> chop %g chop %g\n",
+ $rat, $i, $rat, $j, $c1, $c2;
+ if ($dbl{$i} eq 'triple') {
+ printf "\tline from %g<C,V%d> to %g<C,V%d> chop %g chop %g\n",
+ 2 - $rat, $i, 2 - $rat, $j, $c1, $c2;
+ }
+ }
+ }
+### makering()
+ } else {
+ # regular
+ for ($i = 1; $i <= $v; $i++) {
+ $j = $i + 1;
+ if ($j > $v) {
+ $j = 1;
+ }
+ printf "\tline from V%d to V%d\n", $i, $j;
+ if ($dbl{$i} ne '') {
+ # should check i<j
+ if ($type =~ /flat/ && $i == 3) {
+ $rat = 0.75;
+ } else {
+ $rat = 0.85;
+ }
+ printf "\tline from %g<C,V%d> to %g<C,V%d>\n",
+ $rat, $i, $rat, $j;
+ if ($dbl{$i} eq 'triple') {
+ printf "\tline from %g<C,V%d> to %g<C,V%d>\n",
+ 2 - $rat, $i, 2 - $rat, $j;
+ }
+ }
+ }
+ }
+### makering()
+ # punt on triple temporarily
+ # circle
+ if ($type =~ /benz/ || $aromatic > 0) {
+ if ($type =~ /flat/) {
+ $r *= .4;
+ } else {
+ $r *= .5;
+ }
+ printf "\tcircle rad %g at 0,0\n", $r;
+ }
+} # makering()
+
+
+##########
+# molecule()
+#
+sub molecule {
+ my ($n, $type);
+ if ($#Words >= 0) {
+ $n = $Words[0];
+ if ($n eq 'BP') {
+ $Words[0] = "\"\" ht 0 wid 0";
+ $type = $OTHER;
+ } else {
+ $Words[0] = &atom($n);
+ $type = $MOL;
+ }
+ }
+ $n =~ s/[^A-Za-z0-9]//g; # for stuff like C(OH3): zap non-alnum
+ if ($#Words < 1) {
+ printf "Last: %s: %s with .%s at Last.%s\n",
+ $n, join(' ', @Words), &leave($type, $Dir + 180), &leave($Last, $Dir);
+### molecule()
+ } else {
+ if (! $Words[1]) {
+ printf "Last: %s: %s with .%s at Last.%s\n",
+ $n, join(' ', @Words), &leave($type, $Dir + 180), &leave($Last, $Dir);
+ } elsif ($#Words >= 1 and $Words[1] eq 'below') {
+ $Words[2] = '' if ! $Words[2];
+ printf "Last: %s: %s with .n at %s.s\n", $n, $Words[0], $Words[2];
+ } elsif ($#Words >= 1 and $Words[1] eq 'above') {
+ $Words[2] = '' if ! $Words[2];
+ printf "Last: %s: %s with .s at %s.n\n", $n, $Words[0], $Words[2];
+ } elsif ($#Words >= 2 and $Words[1] eq 'left' && $Words[2] eq 'of') {
+ $Words[3] = '' if ! $Words[3];
+ printf "Last: %s: %s with .e at %s.w+(%g,0)\n",
+ $n, $Words[0], $Words[3], $dew;
+ } elsif ($#Words >= 2 and $Words[1] eq 'right' && $Words[2] eq 'of') {
+ $Words[3] = '' if ! $Words[3];
+ printf "Last: %s: %s with .w at %s.e-(%g,0)\n",
+ $n, $Words[0], $Words[3], $dew;
+ } else {
+ printf "Last: %s: %s\n", $n, join(' ', @Words);
+ }
+ }
+
+ $Last = $type;
+ if ($Last_Name) {
+ &labsave($Last_Name, $Last, $Dir);
+ }
+ &labsave($n, $Last, $Dir);
+} # molecule()
+
+
+##########
+# print_hash(<hash_or_ref>)
+#
+# print the elements of a hash or hash reference
+#
+sub print_hash {
+ my $hr;
+ my $n = scalar @_;
+ if ($n == 0) {
+ print STDERR "empty hash\n;";
+ return 1;
+ } elsif ($n == 1) {
+ if (ref($_[0]) eq 'HASH') {
+ $hr = $_[0];
+ } else {
+ warn 'print_hash(): the argument is not a hash or hash reference;';
+ return 0;
+ }
+ } else {
+ if ($n % 2) {
+ warn 'print_hash(): the arguments are not a hash;';
+ return 0;
+ } else {
+ my %h = @_;
+ $hr = \%h;
+ }
+ }
+
+### print_hash()
+ unless (%$hr) {
+ print STDERR "empty hash\n";
+ return 1;
+ }
+ print STDERR "hash (ignore the ^ characters):\n";
+ for my $k (sort keys %$hr) {
+ my $hk = $hr->{$k};
+ print STDERR " $k => ";
+ if (defined $hk) {
+ print STDERR "^$hk^";
+ } else {
+ print STDERR "undef";
+ }
+ print STDERR "\n";
+ }
+
+ 1;
+} # print_hash()
+
+
+##########
+# print_pe()
+#
+sub print_pe {
+ print ".PE\n";
+} # print_pe()
+
+
+##########
+# print_ps()
+#
+sub print_ps {
+ print ".PS\n";
+} # print_ps()
+
+##########
+# putring(<v>)
+#
+sub putring {
+ # collect "put Mol at n"
+ my ($v) = @_;
+ my ($m, $mol, $n);
+ $Word_Count++;
+ $mol = $Words[$Word_Count++];
+ if ($Words[$Word_Count] eq 'at') {
+ $Word_Count++;
+ }
+ $n = $Words[$Word_Count];
+ if ($n !~ /^\d+$/) {
+ $n =~ s/(\d)+$/$1/;
+ $n = 0 if $n !~ /^\d+$/;
+ error('use single digit as argument for "put at"');
+ }
+ if ($n >= 1 && $n <= $v) {
+ $m = $mol;
+ $m =~ s/[^A-Za-z0-9]//g;
+ $put{$n} = $m . ':' . &atom($mol);
+ } elsif ($n == 0) {
+ error('argument of "put at" must be a single digit');
+ } else {
+ error('argument of "put at" is too large');
+ }
+ $Word_Count++;
+} # putring()
+
+
+##########
+# reduce(<d>)
+#
+sub reduce {
+ my ($d) = @_;
+ # reduces d to 0 <= d < 360
+ while ($d >= 360) {
+ $d -= 360;
+ }
+ while ($d < 0) {
+ $d += 360;
+ }
+ $d;
+} # reduce()
+
+
+##########
+# ring(<type>)
+#
+sub ring {
+ my ($type) = @_;
+ my ($typeint, $pt, $verts, $i, $other, $fused, $withat);
+ $pt = 0; # points up by default
+ if ($type =~ /([1-8])$/) {
+ $verts = $1;
+ } elsif ($type =~ /flat/) {
+ $verts = 5;
+ } else {
+ $verts = 6;
+ }
+ $fused = $other = '';
+ for ($i = 1; $i <= $verts; $i++) {
+ $put{$i} = $dbl{$i} = '';
+ }
+ $nput = $aromatic = $withat = 0;
+ for ($Word_Count = 1; $Word_Count <= $#Words; ) {
+ if ($Words[$Word_Count] eq 'pointing') {
+ $pt = &cvtdir(0);
+ } elsif ($Words[$Word_Count] eq 'double' ||
+ $Words[$Word_Count] eq 'triple') {
+ &dblring($verts);
+ } elsif ($Words[$Word_Count] =~ /arom/) {
+ $aromatic++;
+ $Word_Count++; # handled later
+### ring()
+ } elsif ($Words[$Word_Count] eq 'put') {
+ &putring($verts);
+ $nput++;
+ } elsif ($Words[$Word_Count] =~ /^#/) {
+ $Word_Count = $#Words + 1;
+ last;
+ } else {
+ if ($Words[$Word_Count] eq 'with' || $Words[$Word_Count] eq 'at') {
+ $withat = 1;
+ }
+ $other = $other . ' ' . $Words[$Word_Count];
+ $Word_Count++;
+ }
+ }
+ $typeint = $RING . $verts . $pt; # RING | verts | dir
+ if ($withat == 0) {
+ $fused = &joinring($typeint, $Dir, $Last);
+ }
+ printf "Last: [\n";
+ &makering($type, $pt, $verts);
+ printf "] %s %s\n", $fused, $other;
+ $Last = $typeint;
+ if ($Last_Name) {
+ &labsave($Last_Name, $Last, $Dir);
+ }
+} # ring()
+
+
+##########
+# ringleave(<last>, <d>)
+#
+sub ringleave {
+ my ($last, $d) = @_;
+ my ($rd, $verts);
+ # return vertex of ring in dir d
+ $verts = substr($last, 1, 1);
+ $rd = substr($last, 2);
+ sprintf('V%d.%s', int(&reduce($d - $rd) / (360 / $verts)) + 1, &corner($d));
+} # ringleave()
+
+
+##########
+# setparams(<scale>)
+#
+sub setparams {
+ my ($scale) = @_;
+ $lineht = $scale * 0.2;
+ $linewid = $scale * 0.2;
+ $textht = $scale * 0.16;
+ $db = $scale * 0.2; # bond length
+ $cwid = $scale * 0.12; # character width
+ $cr = $scale * 0.08; # rad of invis circles at ring vertices
+ $crh = $scale * 0.16; # ht of invis ellipse at ring vertices
+ $crw = $scale * 0.12; # wid
+ $dav = $scale * 0.015; # vertical shift up for atoms in atom macro
+ $dew = $scale * 0.02; # east-west shift for left of/right of
+ $ringside = $scale * 0.3; # side of all rings
+ $dbrack = $scale * 0.1; # length of bottom of bracket
+} # setparams()
+
+
+##########
+# usage()
+#
+# Print usage information for --help.
+#
+sub usage {
+ print "\n";
+ &version();
+ print <<EOF;
+
+Usage: $Chem_Name [option]... [filespec]...
+
+$Chem_Name is a groff preprocessor for producing chemical structure
+diagrams. The output suits to the pic preprocessor.
+
+"filespec" is one of
+ "filename" name of a readable file
+ "-" for standard input
+
+All available options are
+
+-h --help print this usage message.
+-v --version print version information.
+
+EOF
+} # usage()
+
+
+##########
+# version()
+#
+# Get version information from version.sh and print a text with this.
+#
+sub version {
+ $Groff_Version = $Groff_Version_Preset unless $Groff_Version;
+ my $year = $Last_Update;
+ $year =~ s/^.* //;
+ print <<EOF;
+$Chem_Name $Program_Version of $Last_Update (Perl version)
+is part of groff version $Groff_Version.
+Copyright (C) $year Free Software Foundation, Inc.
+GNU groff and chem come with ABSOLUTELY NO WARRANTY.
+You may redistribute copies of groff and its subprograms
+under the terms of the GNU General Public License.
+EOF
+} # version()
+
+
+### Emacs settings
+# Local Variables:
+# mode: CPerl
+# End:
Index: macros.pic
===================================================================
RCS file: macros.pic
diff -N macros.pic
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ macros.pic 26 Oct 2006 22:13:49 -0000 1.1
@@ -0,0 +1,97 @@
+# macros for chem
+
+# Source file position: <groff-source>/contrib/chem/macros.pic
+# Installed position: <prefix>/lib/groff/chem
+
+# Copyright (C) 2006 Free Software Foundation, Inc.
+# Written by Brian Kernighan <http://cm.bell-labs.com/cm/cs/who/bwk>,
+# modified by Bernd Warken.
+
+# This file is part of `chem', which is part of `groff'.
+
+# `groff' is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# `groff' is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with `groff'; see the files COPYING and LICENSE in the top
+# directory of the `groff' source. If not, write to the Free Software
+# Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301,
+# USA.
+
+########################################################################
+
+pi = 3.141592654
+deg = 57.29578
+# cr = 0.08 # radius of invis circle at ring vertices (see cr[vh])
+# crh = 0.16; crw = 0.12 # ht & wid of invis ellipse around atoms at ring
vertices
+# dav = 0.015 # vertical shift up for atoms in atom macro
+
+# atom(text, wid, ht, carbon position, crh, crw, dav)
+define atom { [
+ T: $1 wid $2 ht $3-2*$7
+ C: ellipse invis ht $5 wid $6 at T.w + ($4,$7)
+ L: ellipse invis ht $5 wid $6 at T.w + (cwid/2,$7)
+ R: ellipse invis ht $5 wid $6 at T.e + (-cwid/2,$7)
+] }
+
+# bond(length, angle in degrees, whatever)
+define bond {
+ line $3 by ($1) * sin(($2)/deg), ($1) * cos(($2)/deg)
+}
+
+# fancy bonds: r, theta, from/at
+define doublebond {
+ line $3 invis by ($1) * sin(($2)/deg), ($1) * cos(($2)/deg)
+ V1: last line.start; V2: last line.end; dx = V2.x-V1.x; dy = V2.y-V1.y
+ norm = sqrt(dx*dx + dy*dy)
+ ny = dx * .02 / norm
+ nx = -dy * .02 / norm
+ line from V1 + (nx,ny) to V2 + (nx,ny)
+ line from V1 - (nx,ny) to V2 - (nx,ny)
+ move to V2
+}
+define triplebond {
+ line $3 invis by ($1) * sin(($2)/deg), ($1) * cos(($2)/deg)
+ V1: last line.start; V2: last line.end; dx = V2.x-V1.x; dy = V2.y-V1.y
+ norm = sqrt(dx*dx + dy*dy)
+ ny = dx * .025 / norm
+ nx = -dy * .025 / norm
+ line from V1 + (nx,ny) to V2 + (nx,ny)
+ line from V1 - (nx,ny) to V2 - (nx,ny)
+ line from V1 to V2
+ move to V2
+}
+define backbond {
+ line $3 invis by ($1) * sin(($2)/deg), ($1) * cos(($2)/deg)
+ V1: last line.start; V2: last line.end; dx = V2.x-V1.x; dy = V2.y-V1.y
+ norm = sqrt(dx*dx + dy*dy)
+ n = norm / .025
+ ny = dx * .02 / norm
+ 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)
+ }
+ move to V2
+}
+define frontbond {
+ line $3 invis by ($1) * sin(($2)/deg), ($1) * cos(($2)/deg)
+ V1: last line.start; V2: last line.end; dx = V2.x-V1.x; dy = V2.y-V1.y
+ ah = arrowht; aw = arrowwid; ahead = arrowhead
+ arrowht = sqrt(dx*dx + dy*dy)
+ arrowwid = 0.05
+ arrowhead = 7
+ line <- from V1 to V2
+ arrowht = ah; arrowwid = aw; arrowhead = ahead
+}
+### Emacs settings
+# Local Variables:
+# mode: Nroff
+# End:
Index: pic.tmac
===================================================================
RCS file: pic.tmac
diff -N pic.tmac
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ pic.tmac 26 Oct 2006 22:13:49 -0000 1.1
@@ -0,0 +1,12 @@
+.\" pic.tmac
+.\"
+.de PS
+.br
+.sp .3v
+.ne 0\\$1+1v+\n(.Vu
+.in \\n(.lu-\\n(.iu-0\\$2/2u>?0
+..
+.de PE
+.in
+.sp .3v+.5m
+..
Index: examples/.cvsignore
===================================================================
RCS file: examples/.cvsignore
diff -N examples/.cvsignore
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ examples/.cvsignore 26 Oct 2006 22:13:49 -0000 1.1
@@ -0,0 +1 @@
+README
Index: examples/README.txt
===================================================================
RCS file: examples/README.txt
diff -N examples/README.txt
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ examples/README.txt 26 Oct 2006 22:13:49 -0000 1.1
@@ -0,0 +1,54 @@
+This directory contains examples for the `chem' language.
+
+You can view the graphical display of the examples by calling
+
+ @address@hidden <file> | groffer
+
+or get a suitable `groff' output by running
+
+ @address@hidden <file> | groff -p ...
+
+On the displays, you can see rings consisting of several lines and
+bonds (lines). All points on rings and bonds that do not have a
+notation mean a C atom (carbon) filled with H atoms (hydrogen) such
+that the valence of 4 is satisfied.
+
+For example, suppose you have just a single line without any
+characters. That means a bond. It has two points, one at each end of
+the line. So each of these points stands for a C atom, the bond
+itself connects these 2 C atoms. To fulfill the valence of 4, each
+points has to carry additionally 3 H atoms. So the single empty bond
+stands for CH3-CH3, though this combination doesn't make much sense
+chemically.
+
+
+####### License
+
+Last update: 25 Oct 2006
+
+Copyright (C) 2006 Free Software Foundation, Inc.
+Written by Bernd Warken.
+
+This file is part of `chem', which is part of `groff'.
+
+`groff' is free software; you can redistribute it and/or modify it
+under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+`groff' is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with `groff'; see the files COPYING and LICENSE in the top
+directory of the `groff' source. If not, write to the Free Software
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA.
+
+
+####### Emacs settings
+
+Local Variables:
+mode: text
+End:
Index: examples/atp.chem
===================================================================
RCS file: examples/atp.chem
diff -N examples/atp.chem
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ examples/atp.chem 26 Oct 2006 22:13:49 -0000 1.1
@@ -0,0 +1,66 @@
+atp.chem:
+.cstart
+
+# Example file for `chem':
+# ATP or C10_H16_N5_O13_P3 or
+# [[[5-(6-aminopurin-9-yl)-3,4-dihydroxy-oxolan-2-yl]methoxy-hydroxy-
+# phosphoryl]oxy-hydroxy-phosphoryl]oxyphosphonic acid
+
+# Found at http://www.chemindustry.com/apps/chemicals.
+
+# Source file position: <groff-source>/contrib/chem/example/atp.chem
+# Installed position: <prefix>/share/doc/groff/example/chem/atp.chem
+
+# Copyright (C) 2006 Free Software Foundation, Inc.
+# Written by Bernd Warken.
+
+# Last update: 26 Oct 2006
+
+# This file is part of `chem', which is part of `groff'.
+
+# `groff' is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# `groff' is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with `groff'; see the files COPYING and LICENSE in the top
+# directory of the `groff' source. If not, write to the Free Software
+# Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301,
+# USA.
+
+R1: ring5 pointing left double 1,2 3,4 put N at 2 put N at 5
+B: benzene put N at 2 with .V6 at R1.V3 with .V5 at R1.V4
+ bond up ; NH2
+ backbond 170 length .7 from R1.V5
+R2: ring5 pointing down with .V2 put O at 1
+ bond down at R2.V2 ; H
+ bond down length .1 at R2.V3 ; H
+ bond up length .1 at R2.V3 ; OH
+ bond down length .1 at R2.V4 ; H
+ bond up length .1 at R2.V4 ; OH
+ frontbond 70 at R2.V5
+ bond 110 ; O
+ bond right ; P
+ doublebond up ; O
+ bond down from P ; OH
+ bond right from P ; O
+ bond right ; P
+ doublebond up ; O
+ bond down from P ; OH
+ bond right from P ; O
+ bond right ; P
+ doublebond up ; O
+ bond down from P ; OH
+ bond right from P ; OH
+
+### Emacs settings
+# Local Variables:
+# mode: Nroff
+# End:
+.cend
Index: examples/cholesterin.chem
===================================================================
RCS file: examples/cholesterin.chem
diff -N examples/cholesterin.chem
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ examples/cholesterin.chem 26 Oct 2006 22:13:49 -0000 1.1
@@ -0,0 +1,55 @@
+cholesterin.chem:
+.cstart
+
+# Example file for `chem':
+# Cholesterin or C27_H46O or
+# 10,13-dimethyl-17-(6-methylheptan-2-yl)-2,3,4,5,6,9,11,12,14,15,16,17-
+# dodecahydro-1H-cyclopenta[a]phenanthren-3-ol
+
+# Source file position: <groff-source>/contrib/chem/example/cholesterin.p
+# Installed position: <prefix>/share/doc/groff/example/chem/cholesterin.p
+
+# Copyright (C) 2006 Free Software Foundation, Inc.
+# Written by Bernd Warken.
+
+# Last update: 26 Oct 2006
+
+# This file is part of `chem', which is part of `groff'.
+
+# `groff' is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# `groff' is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with `groff'; see the files COPYING and LICENSE in the top
+# directory of the `groff' source. If not, write to the Free Software
+# Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301,
+# USA.
+
+R1: ring6
+ bond -120 ; HO
+R2: ring6 with .V5 at R1.V3 with .V6 at R1.V2 double 4,5
+ bond up at R2.V6
+R3: ring6 with .V5 at R2.V1 with .V4 at R2.V2
+R4: flatring5 pointing up with .V4 at R3.V3 with .V5 at R3.V2
+ bond up at R4.V5
+ bond up at R4.V1
+B1: bond -60
+ bond 60 at B1.start
+ bond 120
+ bond 60
+ bond 120
+B2: bond 60
+ bond down at B2.start
+
+### Emacs settings
+# Local Variables:
+# mode: Nroff
+# End:
+.cend
Index: examples/ethamivan.chem
===================================================================
RCS file: examples/ethamivan.chem
diff -N examples/ethamivan.chem
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ examples/ethamivan.chem 26 Oct 2006 22:13:49 -0000 1.1
@@ -0,0 +1,51 @@
+ethamivan.chem:
+.cstart
+
+# Example file for `chem':
+# Ethamivan or Analepticon or C12_H17_N_O3 or
+# N,N-diethyl-4-hydroxy-3-methoxy-benzamide
+
+# Source file position: <groff-source>/contrib/chem/example/ethamivan.chem
+# Installed position: <prefix>/share/doc/groff/example/chem/ethamivan.chem
+
+# Copyright (C) 2006 Free Software Foundation, Inc.
+# Written by Bernd Warken.
+
+# Last update: 26 Oct 2006
+
+# This file is part of `chem', which is part of `groff'.
+
+# `groff' is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# `groff' is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with `groff'; see the files COPYING and LICENSE in the top
+# directory of the `groff' source. If not, write to the Free Software
+# Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301,
+# USA.
+
+R: ring pointing left double 2,3 4,5 6,1
+ bond left from R.V1 ; O
+ bond left ; H
+ bond -150 from R.V6 ; O
+ bond left
+ bond 60 from R.V4
+B1: double bond up ; O
+ bond 120 from B1.start ; N
+ bond 45
+ bond right
+ bond 135 from N
+ bond right
+
+### Emacs settings
+# Local Variables:
+# mode: Nroff
+# End:
+.cend
Index: examples/lsd.chem
===================================================================
RCS file: examples/lsd.chem
diff -N examples/lsd.chem
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ examples/lsd.chem 26 Oct 2006 22:13:49 -0000 1.1
@@ -0,0 +1,54 @@
+lsd.chem:
+.cstart
+
+# Example file for `chem':
+# LSD or Lysergic acid dethylamide or C20_H25_N3O or
+# 9,10-Didehydro-N,N-diethyl-6-methyl-ergoline-8-beta-carboxamide
+
+# Source file position: <groff-source>/contrib/chem/example/lsd.p
+# Installed position: <prefix>/share/doc/groff/example/chem/lsd.p
+
+# Copyright (C) 2006 Free Software Foundation, Inc.
+# Written by Bernd Warken.
+
+# Last update: 26 Oct 2006
+
+# This file is part of `chem', which is part of `groff'.
+
+# `groff' is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# `groff' is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with `groff'; see the files COPYING and LICENSE in the top
+# directory of the `groff' source. If not, write to the Free Software
+# Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301,
+# USA.
+
+F: flatring5 pointing left put N at 5 double 3,4
+ H below F.N
+B: benzene pointing right with .V1 at F.V2
+R1: ring pointing right with .V4 at B.V6
+ front bond right from R1.V6 ; H
+R2: ring pointing right with .V2 at R1.V6 put N at 1 double 3,4
+ bond right from R2.N
+ back bond -60 from R2.V5 ; H
+ bond up from R2.V5
+B1: double bond up ; O
+ bond right from B1.start ; N
+ bond 45
+ bond right
+ bond 135 from N
+ bond right
+
+### Emacs settings
+# Local Variables:
+# mode: Nroff
+# End:
+.cend
Index: examples/morphine.chem
===================================================================
RCS file: examples/morphine.chem
diff -N examples/morphine.chem
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ examples/morphine.chem 26 Oct 2006 22:13:49 -0000 1.1
@@ -0,0 +1,58 @@
+morphine.chem:
+.cstart
+
+# Example file for `chem':
+# Morphine or C23_H31_N3O or
+# N,N-diethyl-N'-(2-methoxyacridin-9-yl)-pentane-1,4-diamine
+
+# Found at http://www.chemindustry.com/apps/chemicals.
+
+# Source file position: <groff-source>/contrib/chem/example/morphine.chem
+# Installed position: <prefix>/share/doc/groff/example/chem/morphine.chem
+
+# Copyright (C) 2006 Free Software Foundation, Inc.
+# Written by Bernd Warken.
+
+# Last update: 26 Oct 2006
+
+# This file is part of `chem', which is part of `groff'.
+
+# `groff' is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# `groff' is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with `groff'; see the files COPYING and LICENSE in the top
+# directory of the `groff' source. If not, write to the Free Software
+# Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301,
+# USA.
+
+R1: benzene
+R2: benzene with .V6 at R1.V2 with .V5 at R1.V3 put N at 4
+R3: benzene with .V6 at R2.V2 with .V5 at R2.V3
+ bond 60 at R3.V2 ; O
+ bond 120
+ bond up at R2.V1 ; N
+ bond 60 ; H
+ bond -60 at N
+B1: backbond -120
+ bond up at B1.start
+ bond -60
+ bond up
+ bond -60 ; N
+ bond up
+ bond -60
+ bond -120 at N
+ bond -60
+
+### Emacs settings
+# Local Variables:
+# mode: Nroff
+# End:
+.cend
Index: examples/penicillin.chem
===================================================================
RCS file: examples/penicillin.chem
diff -N examples/penicillin.chem
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ examples/penicillin.chem 26 Oct 2006 22:13:49 -0000 1.1
@@ -0,0 +1,59 @@
+penicillin.chem:
+.cstart
+
+# Example file for `chem':
+# Penicillin or C16_H18_N2_O4_S or
+# 3,3-dimethyl-6-oxo-7-(2-phenylacetyl)amino-2-thia-5-
+# azabicyclo[3.2.0]heptane-4-carboxylic acid
+
+# Found at http://www.chemindustry.com/apps/chemicals.
+
+# Source file position: <groff-source>/contrib/chem/example/morphine.chem
+# Installed position: <prefix>/share/doc/groff/example/chem/morphine.chem
+
+# Copyright (C) 2006 Free Software Foundation, Inc.
+# Written by Bernd Warken.
+
+# Last update: 26 Oct 2006
+
+# This file is part of `chem', which is part of `groff'.
+
+# `groff' is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# `groff' is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with `groff'; see the files COPYING and LICENSE in the top
+# directory of the `groff' source. If not, write to the Free Software
+# Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301,
+# USA.
+
+R1: flatring5 pointing up put S at 1 put N at 4
+ bond 45 at R1.V2
+ bond 135 at R1.V2
+ bond 120 at R1.V3
+D1: doublebond 45 ; O
+ bond 135 at D1.start ; OH
+ bond left at R1.N
+ doublebond -135 ; O
+ bond left at R1.V5
+B1: bond down length .3
+ bond -60 at B1.start ; N
+ bond up ; H
+ bond -120 at N
+D2: doublebond down ; O
+ bond -60 at D2.start
+ bond -120
+ benzene
+
+### Emacs settings
+# Local Variables:
+# mode: Nroff
+# End:
+.cend
Index: examples/reserpine.chem
===================================================================
RCS file: examples/reserpine.chem
diff -N examples/reserpine.chem
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ examples/reserpine.chem 26 Oct 2006 22:13:49 -0000 1.1
@@ -0,0 +1,66 @@
+reserpine.chem:
+.cstart
+
+# Example file for `chem':
+# Reserpine or C33H40N2O9
+
+# Source file position: <groff-source>/contrib/chem/example/reserpine.chem
+# Installed position: <prefix>/share/doc/groff/example/chem/reserpine.chem
+
+# Copyright (C) 2006 Free Software Foundation, Inc.
+# Written by Bernd Warken.
+
+# Last update: 26 Oct 2006
+
+# This file is part of `chem', which is part of `groff'.
+
+# `groff' is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# `groff' is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with `groff'; see the files COPYING and LICENSE in the top
+# directory of the `groff' source. If not, write to the Free Software
+# Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301,
+# USA.
+
+R1: benzene pointing up
+ bond -120 from R1.V5 ; O
+ bond left
+R2: flatring5 pointing down double 4,5 with .V2 at R1.V3 with .V3 at R1.V2
put N at 1
+ H below R2.V1
+R3: ring put N at 3 with .V5 at R2.V5
+R4: ring put N at 1 with .V1 at R3.V3
+ back bond -120 from R4.V4 ; H
+ back bond 60 from R4.V3 ; H
+R5: ring with .V1 at R4.V3
+ bond -120
+D1: double bond down ; O
+ bond left from D1.start ; O
+ bond left
+ back bond 60 from R5.V3 ; H
+ back bond down from R5.V4 ; O
+ bond down from O
+ bond 120 from R5.V3 ; O
+ bond 50 from O
+D2: double bond up ; O
+ bond right length .1 from D2.start
+B: benzene pointing right
+ bond 45 from B.V6 ; O
+ bond right
+ bond right from B.V1 ; O
+ bond right
+ bond 135 from B.V2 ; O
+ bond right
+
+### Emacs settings
+# Local Variables:
+# mode: Nroff
+# End:
+.cend
Index: examples/122/README
===================================================================
RCS file: examples/122/README
diff -N examples/122/README
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ examples/122/README 26 Oct 2006 22:13:49 -0000 1.1
@@ -0,0 +1,54 @@
+This directory contains the examples for the `chem' language written
+in the book:
+
+ Computing Science Technical Report No. 122
+ CHEM - A Program for Typesetting Chemical Diagrams: User Manual
+ by Jon L. Bentley, Lynn W. Jelinski, Brian W. Kernighan
+
+The book is available in the internet at
+<http://cm.bell-labs.com/cm/cs/cstr/122.ps.gz>.
+
+The examples are sorted by the chapter in the book. For example, the
+file `ch4c_colon.chem' means a chem example in chapter 4; according to
+`c', it is the third example in this chapter; the name `colon' is used
+to describe the context of the example.
+
+You can view the graphical display of the examples by calling
+
+ @address@hidden <file> | groffer
+
+or get a suitable `groff' output by running
+
+ @address@hidden <file> | groff -p ...
+
+
+####### License
+
+Last update: 26 Oct 2006
+
+Copyright (C) 2006 Free Software Foundation, Inc.
+Written by Bernd Warken.
+
+This file is part of `chem', which is part of `groff'.
+
+`groff' is free software; you can redistribute it and/or modify it
+under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+`groff' is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with `groff'; see the files COPYING and LICENSE in the top
+directory of the `groff' source. If not, write to the Free Software
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA.
+
+
+####### Emacs settings
+
+Local Variables:
+mode: text
+End:
Index: examples/122/ch2a_ethyl.chem
===================================================================
RCS file: examples/122/ch2a_ethyl.chem
diff -N examples/122/ch2a_ethyl.chem
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ examples/122/ch2a_ethyl.chem 26 Oct 2006 22:13:49 -0000 1.1
@@ -0,0 +1,45 @@
+ch2a_ethyl.chem:
+.cstart
+
+# Example file for `chem':
+
+# This originates from Computing Science Technical Report No. 122
+# CHEM - A Program for Typesetting Chemical Diagrams: User Manual
+# by Jon L. Bentley, Lynn W. Jelinski, Brian W. Kernighan
+# <http://cm.bell-labs.com/cm/cs/cstr/122.ps.gz>.
+
+# Copyright (C) 2006 Free Software Foundation, Inc.
+
+# Last update: 26 Oct 2006
+
+# This file is part of `chem', which is part of `groff'.
+
+# `groff' is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# `groff' is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with `groff'; see the files COPYING and LICENSE in the top
+# directory of the `groff' source. If not, write to the Free Software
+# Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301,
+# USA.
+
+########################################################################
+
+ CH3
+ bond
+ CH2
+ bond
+
+########################################################################
+### Emacs settings
+# Local Variables:
+# mode: Nroff
+# End:
+.cend
Index: examples/122/ch2b_benzene.chem
===================================================================
RCS file: examples/122/ch2b_benzene.chem
diff -N examples/122/ch2b_benzene.chem
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ examples/122/ch2b_benzene.chem 26 Oct 2006 22:13:49 -0000 1.1
@@ -0,0 +1,42 @@
+ch2b_benzene.chem:
+.cstart
+
+# Example file for `chem':
+
+# This originates from Computing Science Technical Report No. 122
+# CHEM - A Program for Typesetting Chemical Diagrams: User Manual
+# by Jon L. Bentley, Lynn W. Jelinski, Brian W. Kernighan
+# <http://cm.bell-labs.com/cm/cs/cstr/122.ps.gz>.
+
+# Copyright (C) 2006 Free Software Foundation, Inc.
+
+# Last update: 26 Oct 2006
+
+# This file is part of `chem', which is part of `groff'.
+
+# `groff' is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# `groff' is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with `groff'; see the files COPYING and LICENSE in the top
+# directory of the `groff' source. If not, write to the Free Software
+# Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301,
+# USA.
+
+########################################################################
+
+ benzene
+
+########################################################################
+### Emacs settings
+# Local Variables:
+# mode: Nroff
+# End:
+.cend
Index: examples/122/ch2c_benzene_right.chem
===================================================================
RCS file: examples/122/ch2c_benzene_right.chem
diff -N examples/122/ch2c_benzene_right.chem
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ examples/122/ch2c_benzene_right.chem 26 Oct 2006 22:13:49 -0000
1.1
@@ -0,0 +1,42 @@
+ch2c_benzene_right.chem:
+.cstart
+
+# Example file for `chem':
+
+# This originates from Computing Science Technical Report No. 122
+# CHEM - A Program for Typesetting Chemical Diagrams: User Manual
+# by Jon L. Bentley, Lynn W. Jelinski, Brian W. Kernighan
+# <http://cm.bell-labs.com/cm/cs/cstr/122.ps.gz>.
+
+# Copyright (C) 2006 Free Software Foundation, Inc.
+
+# Last update: 26 Oct 2006
+
+# This file is part of `chem', which is part of `groff'.
+
+# `groff' is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# `groff' is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with `groff'; see the files COPYING and LICENSE in the top
+# directory of the `groff' source. If not, write to the Free Software
+# Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301,
+# USA.
+
+########################################################################
+
+ benzene pointing right # a rotated benzene ring
+
+########################################################################
+### Emacs settings
+# Local Variables:
+# mode: Nroff
+# End:
+.cend
Index: examples/122/ch4a_stick.chem
===================================================================
RCS file: examples/122/ch4a_stick.chem
diff -N examples/122/ch4a_stick.chem
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ examples/122/ch4a_stick.chem 26 Oct 2006 22:13:49 -0000 1.1
@@ -0,0 +1,47 @@
+ch4a_stick.chem:
+.cstart
+
+# Example file for `chem':
+
+# This originates from Computing Science Technical Report No. 122
+# CHEM - A Program for Typesetting Chemical Diagrams: User Manual
+# by Jon L. Bentley, Lynn W. Jelinski, Brian W. Kernighan
+# <http://cm.bell-labs.com/cm/cs/cstr/122.ps.gz>.
+
+# Copyright (C) 2006 Free Software Foundation, Inc.
+
+# Last update: 26 Oct 2006
+
+# This file is part of `chem', which is part of `groff'.
+
+# `groff' is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# `groff' is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with `groff'; see the files COPYING and LICENSE in the top
+# directory of the `groff' source. If not, write to the Free Software
+# Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301,
+# USA.
+
+########################################################################
+
+ bond right
+ bond 60
+ bond 120
+ bond 60
+ bond 120
+ bond down
+
+########################################################################
+### Emacs settings
+# Local Variables:
+# mode: Nroff
+# End:
+.cend
Index: examples/122/ch4b_methyl_acetate.chem
===================================================================
RCS file: examples/122/ch4b_methyl_acetate.chem
diff -N examples/122/ch4b_methyl_acetate.chem
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ examples/122/ch4b_methyl_acetate.chem 26 Oct 2006 22:13:49 -0000
1.1
@@ -0,0 +1,51 @@
+ch4b_methyl_acetate.chem:
+.cstart
+
+# Example file for `chem':
+
+# This originates from Computing Science Technical Report No. 122
+# CHEM - A Program for Typesetting Chemical Diagrams: User Manual
+# by Jon L. Bentley, Lynn W. Jelinski, Brian W. Kernighan
+# <http://cm.bell-labs.com/cm/cs/cstr/122.ps.gz>.
+
+# Copyright (C) 2006 Free Software Foundation, Inc.
+
+# Last update: 26 Oct 2006
+
+# This file is part of `chem', which is part of `groff'.
+
+# `groff' is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# `groff' is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with `groff'; see the files COPYING and LICENSE in the top
+# directory of the `groff' source. If not, write to the Free Software
+# Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301,
+# USA.
+
+########################################################################
+
+CH3 # the 3 is automatically turned into a subscript
+bond # the implicit direction is right
+ # implicit connection is to right side of CH3
+C
+double bond 30 # by default, from the substituent C
+O
+bond 120 from C # must be "from C"; otherwise would leave from O
+O
+bond right
+CH3
+
+########################################################################
+### Emacs settings
+# Local Variables:
+# mode: Nroff
+# End:
+.cend
Index: examples/122/ch4c_colon.chem
===================================================================
RCS file: examples/122/ch4c_colon.chem
diff -N examples/122/ch4c_colon.chem
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ examples/122/ch4c_colon.chem 26 Oct 2006 22:13:49 -0000 1.1
@@ -0,0 +1,46 @@
+ch4c_colon.chem:
+.cstart
+
+# Example file for `chem':
+
+# This originates from Computing Science Technical Report No. 122
+# CHEM - A Program for Typesetting Chemical Diagrams: User Manual
+# by Jon L. Bentley, Lynn W. Jelinski, Brian W. Kernighan
+# <http://cm.bell-labs.com/cm/cs/cstr/122.ps.gz>.
+
+# Copyright (C) 2006 Free Software Foundation, Inc.
+
+# Last update: 26 Oct 2006
+
+# This file is part of `chem', which is part of `groff'.
+
+# `groff' is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# `groff' is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with `groff'; see the files COPYING and LICENSE in the top
+# directory of the `groff' source. If not, write to the Free Software
+# Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301,
+# USA.
+
+########################################################################
+
+ CH3
+ bond ; C
+ double bond 30 ; O
+ bond 120 from C ; O
+ bond right ; CH3
+
+########################################################################
+### Emacs settings
+# Local Variables:
+# mode: Nroff
+# End:
+.cend
Index: examples/122/ch4d_HCl.H2O.chem
===================================================================
RCS file: examples/122/ch4d_HCl.H2O.chem
diff -N examples/122/ch4d_HCl.H2O.chem
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ examples/122/ch4d_HCl.H2O.chem 26 Oct 2006 22:13:49 -0000 1.1
@@ -0,0 +1,42 @@
+ch4d_HCl.H2O.chem:
+.cstart
+
+# Example file for `chem':
+
+# This originates from Computing Science Technical Report No. 122
+# CHEM - A Program for Typesetting Chemical Diagrams: User Manual
+# by Jon L. Bentley, Lynn W. Jelinski, Brian W. Kernighan
+# <http://cm.bell-labs.com/cm/cs/cstr/122.ps.gz>.
+
+# Copyright (C) 2006 Free Software Foundation, Inc.
+
+# Last update: 26 Oct 2006
+
+# This file is part of `chem', which is part of `groff'.
+
+# `groff' is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# `groff' is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with `groff'; see the files COPYING and LICENSE in the top
+# directory of the `groff' source. If not, write to the Free Software
+# Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301,
+# USA.
+
+########################################################################
+
+ HCl.H2O
+
+########################################################################
+### Emacs settings
+# Local Variables:
+# mode: Nroff
+# End:
+.cend
Index: examples/122/ch4e_CaSO4.2H2O.chem
===================================================================
RCS file: examples/122/ch4e_CaSO4.2H2O.chem
diff -N examples/122/ch4e_CaSO4.2H2O.chem
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ examples/122/ch4e_CaSO4.2H2O.chem 26 Oct 2006 22:13:49 -0000 1.1
@@ -0,0 +1,42 @@
+ch4e_CaSO4.2H2O.chem:
+.cstart
+
+# Example file for `chem':
+
+# This originates from Computing Science Technical Report No. 122
+# CHEM - A Program for Typesetting Chemical Diagrams: User Manual
+# by Jon L. Bentley, Lynn W. Jelinski, Brian W. Kernighan
+# <http://cm.bell-labs.com/cm/cs/cstr/122.ps.gz>.
+
+# Copyright (C) 2006 Free Software Foundation, Inc.
+
+# Last update: 26 Oct 2006
+
+# This file is part of `chem', which is part of `groff'.
+
+# `groff' is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# `groff' is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with `groff'; see the files COPYING and LICENSE in the top
+# directory of the `groff' source. If not, write to the Free Software
+# Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301,
+# USA.
+
+########################################################################
+
+ CaSO4.2H2O
+
+########################################################################
+### Emacs settings
+# Local Variables:
+# mode: Nroff
+# End:
+.cend
Index: examples/122/ch4f_C.chem
===================================================================
RCS file: examples/122/ch4f_C.chem
diff -N examples/122/ch4f_C.chem
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ examples/122/ch4f_C.chem 26 Oct 2006 22:13:49 -0000 1.1
@@ -0,0 +1,52 @@
+ch4f_C.chem:
+.cstart
+
+# Example file for `chem':
+
+# This originates from Computing Science Technical Report No. 122
+# CHEM - A Program for Typesetting Chemical Diagrams: User Manual
+# by Jon L. Bentley, Lynn W. Jelinski, Brian W. Kernighan
+# <http://cm.bell-labs.com/cm/cs/cstr/122.ps.gz>.
+
+# Copyright (C) 2006 Free Software Foundation, Inc.
+
+# Last update: 26 Oct 2006
+
+# This file is part of `chem', which is part of `groff'.
+
+# `groff' is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# `groff' is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with `groff'; see the files COPYING and LICENSE in the top
+# directory of the `groff' source. If not, write to the Free Software
+# Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301,
+# USA.
+
+########################################################################
+
+ bond ; C # 1st definition of C
+ bond up from C
+ bond down from C
+ bond right from C ; C # 2nd definition of C
+ bond up from C
+ bond down from C
+ bond right from C ; C # 3rd definition of C
+ bond up from C
+ bond down from C
+ bond right from C
+
+
+########################################################################
+### Emacs settings
+# Local Variables:
+# mode: Nroff
+# End:
+.cend
Index: examples/122/ch4g_BP.chem
===================================================================
RCS file: examples/122/ch4g_BP.chem
diff -N examples/122/ch4g_BP.chem
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ examples/122/ch4g_BP.chem 26 Oct 2006 22:13:49 -0000 1.1
@@ -0,0 +1,52 @@
+ch4g_BP.chem:
+.cstart
+
+# Example file for `chem':
+
+# This originates from Computing Science Technical Report No. 122
+# CHEM - A Program for Typesetting Chemical Diagrams: User Manual
+# by Jon L. Bentley, Lynn W. Jelinski, Brian W. Kernighan
+# <http://cm.bell-labs.com/cm/cs/cstr/122.ps.gz>.
+
+# Copyright (C) 2006 Free Software Foundation, Inc.
+
+# Last update: 26 Oct 2006
+
+# This file is part of `chem', which is part of `groff'.
+
+# `groff' is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# `groff' is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with `groff'; see the files COPYING and LICENSE in the top
+# directory of the `groff' source. If not, write to the Free Software
+# Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301,
+# USA.
+
+########################################################################
+
+# this is the isopropyl group
+ bond 120 ; BP # BP is right end of this bond
+ bond -120 from BP
+ bond right from BP ; C
+ front bond up ; CH3
+ back bond down from C ; D
+ bond right from C ; BP
+# redefine BP to mean the center carbon of this t-butyl group
+ bond up from BP
+ bond right from BP
+ bond down from BP
+
+########################################################################
+### Emacs settings
+# Local Variables:
+# mode: Nroff
+# End:
+.cend
Index: examples/122/ch4h_methacrylate.chem
===================================================================
RCS file: examples/122/ch4h_methacrylate.chem
diff -N examples/122/ch4h_methacrylate.chem
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ examples/122/ch4h_methacrylate.chem 26 Oct 2006 22:13:49 -0000 1.1
@@ -0,0 +1,69 @@
+ch4h_methacrylate.chem:
+.cstart
+
+# Example file for `chem':
+
+# This originates from Computing Science Technical Report No. 122
+# CHEM - A Program for Typesetting Chemical Diagrams: User Manual
+# by Jon L. Bentley, Lynn W. Jelinski, Brian W. Kernighan
+# <http://cm.bell-labs.com/cm/cs/cstr/122.ps.gz>.
+
+# Copyright (C) 2006 Free Software Foundation, Inc.
+
+# Last update: 26 Oct 2006
+
+# This file is part of `chem', which is part of `groff'.
+
+# `groff' is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# `groff' is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with `groff'; see the files COPYING and LICENSE in the top
+# directory of the `groff' source. If not, write to the Free Software
+# Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301,
+# USA.
+
+########################################################################
+
+ bond dotted
+ bond right ; BP
+ bond up from BP ; C
+ double bond -60 from C ; O
+ bond 60 length .1 from C ; OCH3
+ bond down from BP ; CH3
+# begin second segment of polymer
+ bond right length .5 from BP ; BP
+ bond up length .1 from BP ; H
+ bond down length .1 from BP ; H
+# begin third segment of polymer
+ bond right length .5 from BP ; BP
+ bond up from BP ; C
+ double bond -60 from C ; O
+ bond 60 length .1 from C ; OCH3
+ bond down from BP ; CH3
+# begin fourth segment of polymer
+ bond right length .5 from BP ; BP
+ bond up length .1 from BP ; H
+ bond down length .1 from BP ; H
+# begin fifth segment of polymer
+ bond right length .5 from BP ; BP
+ bond up from BP ; C
+ double bond -60 from C ; O
+ bond 60 length .1 from C ; OCH3
+ bond down from BP ; CH3
+ bond right from BP
+ bond dotted
+
+########################################################################
+### Emacs settings
+# Local Variables:
+# mode: Nroff
+# End:
+.cend
Index: examples/122/ch4i_cyclo.chem
===================================================================
RCS file: examples/122/ch4i_cyclo.chem
diff -N examples/122/ch4i_cyclo.chem
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ examples/122/ch4i_cyclo.chem 26 Oct 2006 22:13:49 -0000 1.1
@@ -0,0 +1,49 @@
+ch4i_cyclo.chem:
+.cstart
+
+# Example file for `chem':
+
+# This originates from Computing Science Technical Report No. 122
+# CHEM - A Program for Typesetting Chemical Diagrams: User Manual
+# by Jon L. Bentley, Lynn W. Jelinski, Brian W. Kernighan
+# <http://cm.bell-labs.com/cm/cs/cstr/122.ps.gz>.
+
+# Copyright (C) 2006 Free Software Foundation, Inc.
+
+# Last update: 26 Oct 2006
+
+# This file is part of `chem', which is part of `groff'.
+
+# `groff' is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# `groff' is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with `groff'; see the files COPYING and LICENSE in the top
+# directory of the `groff' source. If not, write to the Free Software
+# Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301,
+# USA.
+
+########################################################################
+
+R3: ring3
+R4: ring4 at R3 + (.75,0)
+R5: ring5 at R4 + (.75,0)
+R6: ring6 at R5 + (.75,0)
+B: benzene at R6 + (.75,0)
+R7: ring7 at B + (.75,0)
+R8: ring8 at R7 + (.75,0)
+
+
+########################################################################
+### Emacs settings
+# Local Variables:
+# mode: Nroff
+# End:
+.cend
Index: examples/122/ch4j_ring4.chem
===================================================================
RCS file: examples/122/ch4j_ring4.chem
diff -N examples/122/ch4j_ring4.chem
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ examples/122/ch4j_ring4.chem 26 Oct 2006 22:13:49 -0000 1.1
@@ -0,0 +1,42 @@
+ch4j_ring4.chem:
+.cstart
+
+# Example file for `chem':
+
+# This originates from Computing Science Technical Report No. 122
+# CHEM - A Program for Typesetting Chemical Diagrams: User Manual
+# by Jon L. Bentley, Lynn W. Jelinski, Brian W. Kernighan
+# <http://cm.bell-labs.com/cm/cs/cstr/122.ps.gz>.
+
+# Copyright (C) 2006 Free Software Foundation, Inc.
+
+# Last update: 26 Oct 2006
+
+# This file is part of `chem', which is part of `groff'.
+
+# `groff' is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# `groff' is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with `groff'; see the files COPYING and LICENSE in the top
+# directory of the `groff' source. If not, write to the Free Software
+# Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301,
+# USA.
+
+########################################################################
+
+ ring4 pointing 45
+
+########################################################################
+### Emacs settings
+# Local Variables:
+# mode: Nroff
+# End:
+.cend
Index: examples/122/ch4k_ring3.chem
===================================================================
RCS file: examples/122/ch4k_ring3.chem
diff -N examples/122/ch4k_ring3.chem
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ examples/122/ch4k_ring3.chem 26 Oct 2006 22:13:49 -0000 1.1
@@ -0,0 +1,44 @@
+ch4k_ring3.chem:
+.cstart
+
+# Example file for `chem':
+
+# This originates from Computing Science Technical Report No. 122
+# CHEM - A Program for Typesetting Chemical Diagrams: User Manual
+# by Jon L. Bentley, Lynn W. Jelinski, Brian W. Kernighan
+# <http://cm.bell-labs.com/cm/cs/cstr/122.ps.gz>.
+
+# Copyright (C) 2006 Free Software Foundation, Inc.
+
+# Last update: 26 Oct 2006
+
+# This file is part of `chem', which is part of `groff'.
+
+# `groff' is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# `groff' is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with `groff'; see the files COPYING and LICENSE in the top
+# directory of the `groff' source. If not, write to the Free Software
+# Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301,
+# USA.
+
+########################################################################
+
+R: ring3
+ back bond 120 from R.V2 ; C2H5
+ front bond -120 from R.V3 ; HO
+
+########################################################################
+### Emacs settings
+# Local Variables:
+# mode: Nroff
+# End:
+.cend
Index: examples/122/ch4l_vertex.chem
===================================================================
RCS file: examples/122/ch4l_vertex.chem
diff -N examples/122/ch4l_vertex.chem
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ examples/122/ch4l_vertex.chem 26 Oct 2006 22:13:49 -0000 1.1
@@ -0,0 +1,49 @@
+ch4l_vertex.chem:
+.cstart
+
+# Example file for `chem':
+
+# This originates from Computing Science Technical Report No. 122
+# CHEM - A Program for Typesetting Chemical Diagrams: User Manual
+# by Jon L. Bentley, Lynn W. Jelinski, Brian W. Kernighan
+# <http://cm.bell-labs.com/cm/cs/cstr/122.ps.gz>.
+
+# Copyright (C) 2006 Free Software Foundation, Inc.
+
+# Last update: 26 Oct 2006
+
+# This file is part of `chem', which is part of `groff'.
+
+# `groff' is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# `groff' is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with `groff'; see the files COPYING and LICENSE in the top
+# directory of the `groff' source. If not, write to the Free Software
+# Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301,
+# USA.
+
+########################################################################
+
+R: benzene pointing right
+ bond left from R.V4 ; HO
+ bond -150 from R.V3 ; CH3O
+ bond right from R.V1 ; C
+ double bond up from C ; O
+ bond right from C ; N
+ bond 45 ; C2H5
+ bond 135 from N ; C2H5
+
+########################################################################
+### Emacs settings
+# Local Variables:
+# mode: Nroff
+# End:
+.cend
Index: examples/122/ch4m_double.chem
===================================================================
RCS file: examples/122/ch4m_double.chem
diff -N examples/122/ch4m_double.chem
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ examples/122/ch4m_double.chem 26 Oct 2006 22:13:49 -0000 1.1
@@ -0,0 +1,42 @@
+ch4m_double.chem:
+.cstart
+
+# Example file for `chem':
+
+# This originates from Computing Science Technical Report No. 122
+# CHEM - A Program for Typesetting Chemical Diagrams: User Manual
+# by Jon L. Bentley, Lynn W. Jelinski, Brian W. Kernighan
+# <http://cm.bell-labs.com/cm/cs/cstr/122.ps.gz>.
+
+# Copyright (C) 2006 Free Software Foundation, Inc.
+
+# Last update: 26 Oct 2006
+
+# This file is part of `chem', which is part of `groff'.
+
+# `groff' is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# `groff' is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with `groff'; see the files COPYING and LICENSE in the top
+# directory of the `groff' source. If not, write to the Free Software
+# Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301,
+# USA.
+
+########################################################################
+
+ ring double 1,2 3,4 5,6
+
+########################################################################
+### Emacs settings
+# Local Variables:
+# mode: Nroff
+# End:
+.cend
Index: examples/122/ch4n_triple.chem
===================================================================
RCS file: examples/122/ch4n_triple.chem
diff -N examples/122/ch4n_triple.chem
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ examples/122/ch4n_triple.chem 26 Oct 2006 22:13:49 -0000 1.1
@@ -0,0 +1,42 @@
+ch4n_triple.chem:
+.cstart
+
+# Example file for `chem':
+
+# This originates from Computing Science Technical Report No. 122
+# CHEM - A Program for Typesetting Chemical Diagrams: User Manual
+# by Jon L. Bentley, Lynn W. Jelinski, Brian W. Kernighan
+# <http://cm.bell-labs.com/cm/cs/cstr/122.ps.gz>.
+
+# Copyright (C) 2006 Free Software Foundation, Inc.
+
+# Last update: 26 Oct 2006
+
+# This file is part of `chem', which is part of `groff'.
+
+# `groff' is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# `groff' is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with `groff'; see the files COPYING and LICENSE in the top
+# directory of the `groff' source. If not, write to the Free Software
+# Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301,
+# USA.
+
+########################################################################
+
+ ring8 triple 3,4
+
+########################################################################
+### Emacs settings
+# Local Variables:
+# mode: Nroff
+# End:
+.cend
Index: examples/122/ch4o_aromatic.chem
===================================================================
RCS file: examples/122/ch4o_aromatic.chem
diff -N examples/122/ch4o_aromatic.chem
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ examples/122/ch4o_aromatic.chem 26 Oct 2006 22:13:49 -0000 1.1
@@ -0,0 +1,43 @@
+ch4o_aromatic.chem:
+.cstart
+
+# Example file for `chem':
+
+# This originates from Computing Science Technical Report No. 122
+# CHEM - A Program for Typesetting Chemical Diagrams: User Manual
+# by Jon L. Bentley, Lynn W. Jelinski, Brian W. Kernighan
+# <http://cm.bell-labs.com/cm/cs/cstr/122.ps.gz>.
+
+# Copyright (C) 2006 Free Software Foundation, Inc.
+
+# Last update: 26 Oct 2006
+
+# This file is part of `chem', which is part of `groff'.
+
+# `groff' is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# `groff' is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with `groff'; see the files COPYING and LICENSE in the top
+# directory of the `groff' source. If not, write to the Free Software
+# Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301,
+# USA.
+
+########################################################################
+
+R: aromatic ring7
+ "+" at R
+
+########################################################################
+### Emacs settings
+# Local Variables:
+# mode: Nroff
+# End:
+.cend
Index: examples/122/ch4p_cholestanol.chem
===================================================================
RCS file: examples/122/ch4p_cholestanol.chem
diff -N examples/122/ch4p_cholestanol.chem
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ examples/122/ch4p_cholestanol.chem 26 Oct 2006 22:13:49 -0000 1.1
@@ -0,0 +1,64 @@
+ch4p_cholestanol.chem:
+.cstart
+
+# Example file for `chem':
+
+# This originates from Computing Science Technical Report No. 122
+# CHEM - A Program for Typesetting Chemical Diagrams: User Manual
+# by Jon L. Bentley, Lynn W. Jelinski, Brian W. Kernighan
+# <http://cm.bell-labs.com/cm/cs/cstr/122.ps.gz>.
+
+# Copyright (C) 2006 Free Software Foundation, Inc.
+
+# Last update: 26 Oct 2006
+
+# This file is part of `chem', which is part of `groff'.
+
+# `groff' is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# `groff' is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with `groff'; see the files COPYING and LICENSE in the top
+# directory of the `groff' source. If not, write to the Free Software
+# Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301,
+# USA.
+
+########################################################################
+
+R1: ring6
+ "R1" at R1 # this puts a label at R1
+ front bond -120 from R1.V5 ; HO
+ # the following line says "fuse the next six-
+ # membered ring with its 6th vertex joining
+ # the second vertex of R1"
+R2: ring6 with .V6 at R1.V2
+ front bond up from R2.V6 ; CH3
+ back bond down from R2.V4 ; H
+ back bond down from R2.V1 ; H
+ front bond up from R2.V2 ; H
+R3: ring6 with .V4 at R2.V2
+R4: flatring with .V5 at R3.V2
+ front bond up from R4.V5 ; CH3
+ back bond down from R4.V4 ; H # this is the alkyl chain
+ bond up from R4.V1 ; BP
+ bond -60 from BP
+ bond 60 from BP
+ bond 120
+ bond 60
+ bond 120 ; BP
+ bond down from BP
+ bond 60 from BP
+
+########################################################################
+### Emacs settings
+# Local Variables:
+# mode: Nroff
+# End:
+.cend
Index: examples/122/ch4q_rings.chem
===================================================================
RCS file: examples/122/ch4q_rings.chem
diff -N examples/122/ch4q_rings.chem
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ examples/122/ch4q_rings.chem 26 Oct 2006 22:13:49 -0000 1.1
@@ -0,0 +1,50 @@
+ch4q_rings.chem:
+.cstart
+
+# Example file for `chem':
+
+# This originates from Computing Science Technical Report No. 122
+# CHEM - A Program for Typesetting Chemical Diagrams: User Manual
+# by Jon L. Bentley, Lynn W. Jelinski, Brian W. Kernighan
+# <http://cm.bell-labs.com/cm/cs/cstr/122.ps.gz>.
+
+# Copyright (C) 2006 Free Software Foundation, Inc.
+
+# Last update: 26 Oct 2006
+
+# This file is part of `chem', which is part of `groff'.
+
+# `groff' is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# `groff' is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with `groff'; see the files COPYING and LICENSE in the top
+# directory of the `groff' source. If not, write to the Free Software
+# Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301,
+# USA.
+
+########################################################################
+
+R3: ring3
+R4: ring4 pointing 45 with .V1 at R3.V2
+R5: ring5 pointing down with .V4 at R4.V2
+R6: ring6 pointing 54 with .V6 at R5.V5
+ # the following lines specify the labels inside the rings
+ "3" at R3
+ "4" at R4
+ "5" at R5
+ "6" at R6
+
+########################################################################
+### Emacs settings
+# Local Variables:
+# mode: Nroff
+# End:
+.cend
Index: examples/122/ch4r_spiro.chem
===================================================================
RCS file: examples/122/ch4r_spiro.chem
diff -N examples/122/ch4r_spiro.chem
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ examples/122/ch4r_spiro.chem 26 Oct 2006 22:13:49 -0000 1.1
@@ -0,0 +1,46 @@
+ch4r_spiro.chem:
+.cstart
+
+# Example file for `chem':
+
+# This originates from Computing Science Technical Report No. 122
+# CHEM - A Program for Typesetting Chemical Diagrams: User Manual
+# by Jon L. Bentley, Lynn W. Jelinski, Brian W. Kernighan
+# <http://cm.bell-labs.com/cm/cs/cstr/122.ps.gz>.
+
+# Copyright (C) 2006 Free Software Foundation, Inc.
+
+# Last update: 26 Oct 2006
+
+# This file is part of `chem', which is part of `groff'.
+
+# `groff' is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# `groff' is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with `groff'; see the files COPYING and LICENSE in the top
+# directory of the `groff' source. If not, write to the Free Software
+# Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301,
+# USA.
+
+########################################################################
+
+R1: ring6
+R2: ring6 with .V1 at R1.V4
+R3: ring5 with .V5 at R2.V3
+ back bond 60 from R3.V2 ; OH
+ front bond 150 from R3.V3 ; OH
+
+########################################################################
+### Emacs settings
+# Local Variables:
+# mode: Nroff
+# End:
+.cend
Index: examples/122/ch4s_heteroatoms.chem
===================================================================
RCS file: examples/122/ch4s_heteroatoms.chem
diff -N examples/122/ch4s_heteroatoms.chem
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ examples/122/ch4s_heteroatoms.chem 26 Oct 2006 22:13:49 -0000 1.1
@@ -0,0 +1,42 @@
+ch4s_heteroatoms.chem:
+.cstart
+
+# Example file for `chem':
+
+# This originates from Computing Science Technical Report No. 122
+# CHEM - A Program for Typesetting Chemical Diagrams: User Manual
+# by Jon L. Bentley, Lynn W. Jelinski, Brian W. Kernighan
+# <http://cm.bell-labs.com/cm/cs/cstr/122.ps.gz>.
+
+# Copyright (C) 2006 Free Software Foundation, Inc.
+
+# Last update: 26 Oct 2006
+
+# This file is part of `chem', which is part of `groff'.
+
+# `groff' is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# `groff' is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with `groff'; see the files COPYING and LICENSE in the top
+# directory of the `groff' source. If not, write to the Free Software
+# Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301,
+# USA.
+
+########################################################################
+
+ ring put N at 2 put S at 4 double 2,3 4,5 6,1
+
+########################################################################
+### Emacs settings
+# Local Variables:
+# mode: Nroff
+# End:
+.cend
Index: examples/122/ch4t_polycyclic.chem
===================================================================
RCS file: examples/122/ch4t_polycyclic.chem
diff -N examples/122/ch4t_polycyclic.chem
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ examples/122/ch4t_polycyclic.chem 26 Oct 2006 22:13:49 -0000 1.1
@@ -0,0 +1,53 @@
+ch4t_polycyclic.chem:
+.cstart
+
+# Example file for `chem':
+
+# This originates from Computing Science Technical Report No. 122
+# CHEM - A Program for Typesetting Chemical Diagrams: User Manual
+# by Jon L. Bentley, Lynn W. Jelinski, Brian W. Kernighan
+# <http://cm.bell-labs.com/cm/cs/cstr/122.ps.gz>.
+
+# Copyright (C) 2006 Free Software Foundation, Inc.
+
+# Last update: 26 Oct 2006
+
+# This file is part of `chem', which is part of `groff'.
+
+# `groff' is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# `groff' is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with `groff'; see the files COPYING and LICENSE in the top
+# directory of the `groff' source. If not, write to the Free Software
+# Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301,
+# USA.
+
+########################################################################
+
+R1: benzene pointing right
+ bond 30 from R1.V6 ; Br
+R2: benzene pointing right with .V5 at R1.V1
+R3: benzene pointing right with .V1 at R2.V3
+ bond 150 from R3.V2 ; CO2H
+R4: benzene pointing right with .V1 at R1.V3
+# next line names bond B1 so we can refer to its end
+B1: bond left from R4.V4
+ ring6 put N at 4 double 2,3 4,5 6,1 with .V3 at B1.end
+B2: bond right from R2.V1
+R5: benzene with .V5 at B2.end
+ ring6 put N at 4 double 1,2 3,4 with .V5 at R5.V3
+
+########################################################################
+### Emacs settings
+# Local Variables:
+# mode: Nroff
+# End:
+.cend
Index: examples/122/ch4u_nicotine.chem
===================================================================
RCS file: examples/122/ch4u_nicotine.chem
diff -N examples/122/ch4u_nicotine.chem
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ examples/122/ch4u_nicotine.chem 26 Oct 2006 22:13:49 -0000 1.1
@@ -0,0 +1,46 @@
+ch4u_nicotine.chem:
+.cstart
+
+# Example file for `chem':
+
+# This originates from Computing Science Technical Report No. 122
+# CHEM - A Program for Typesetting Chemical Diagrams: User Manual
+# by Jon L. Bentley, Lynn W. Jelinski, Brian W. Kernighan
+# <http://cm.bell-labs.com/cm/cs/cstr/122.ps.gz>.
+
+# Copyright (C) 2006 Free Software Foundation, Inc.
+
+# Last update: 26 Oct 2006
+
+# This file is part of `chem', which is part of `groff'.
+
+# `groff' is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# `groff' is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with `groff'; see the files COPYING and LICENSE in the top
+# directory of the `groff' source. If not, write to the Free Software
+# Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301,
+# USA.
+
+########################################################################
+
+ benzene put N at 4
+ bond right
+ ring5 pointing down put N at 1
+ bond down from .N ; CH3 # or .V1
+
+
+########################################################################
+### Emacs settings
+# Local Variables:
+# mode: Nroff
+# End:
+.cend
Index: examples/122/ch4v_histidine.chem
===================================================================
RCS file: examples/122/ch4v_histidine.chem
diff -N examples/122/ch4v_histidine.chem
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ examples/122/ch4v_histidine.chem 26 Oct 2006 22:13:49 -0000 1.1
@@ -0,0 +1,48 @@
+ch4v_histidine.chem:
+.cstart
+
+# Example file for `chem':
+
+# This originates from Computing Science Technical Report No. 122
+# CHEM - A Program for Typesetting Chemical Diagrams: User Manual
+# by Jon L. Bentley, Lynn W. Jelinski, Brian W. Kernighan
+# <http://cm.bell-labs.com/cm/cs/cstr/122.ps.gz>.
+
+# Copyright (C) 2006 Free Software Foundation, Inc.
+
+# Last update: 26 Oct 2006
+
+# This file is part of `chem', which is part of `groff'.
+
+# `groff' is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# `groff' is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with `groff'; see the files COPYING and LICENSE in the top
+# directory of the `groff' source. If not, write to the Free Software
+# Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301,
+# USA.
+
+########################################################################
+
+R1: flatring pointing down put N at 2 put N at 5 double 1,2 3,4
+ H right of R1.V5
+ bond right from R1.V4 ; CH2
+ bond right ; C
+ bond up from C ; H
+ bond down from C ; NH2
+ bond right from C ; CO2H
+
+########################################################################
+### Emacs settings
+# Local Variables:
+# mode: Nroff
+# End:
+.cend
Index: examples/122/ch4w_lsd.chem
===================================================================
RCS file: examples/122/ch4w_lsd.chem
diff -N examples/122/ch4w_lsd.chem
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ examples/122/ch4w_lsd.chem 26 Oct 2006 22:13:49 -0000 1.1
@@ -0,0 +1,54 @@
+ch4w_lsd.chem:
+.cstart
+
+# Example file for `chem':
+
+# This originates from Computing Science Technical Report No. 122
+# CHEM - A Program for Typesetting Chemical Diagrams: User Manual
+# by Jon L. Bentley, Lynn W. Jelinski, Brian W. Kernighan
+# <http://cm.bell-labs.com/cm/cs/cstr/122.ps.gz>.
+
+# Copyright (C) 2006 Free Software Foundation, Inc.
+
+# Last update: 26 Oct 2006
+
+# This file is part of `chem', which is part of `groff'.
+
+# `groff' is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# `groff' is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with `groff'; see the files COPYING and LICENSE in the top
+# directory of the `groff' source. If not, write to the Free Software
+# Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301,
+# USA.
+
+########################################################################
+
+B: benzene pointing right
+F: flatring pointing left put N at 5 double 3,4 with .V1 at B.V2
+ H below F.N
+R: ring pointing right with .V4 at B.V6
+ front bond right from R.V6 ; H
+W: ring pointing right with .V2 at R.V6 put N at 1 double 3,4
+ bond right from W.N ; CH3
+ back bond -60 from W.V5 ; H
+ bond up from W.V5 ; C
+ double bond up from C ; O
+ bond right from C ; N
+ bond 45 from N ; C2H5
+ bond 135 from N ; C2H5
+
+########################################################################
+### Emacs settings
+# Local Variables:
+# mode: Nroff
+# End:
+.cend
Index: examples/122/ch4x_anisole.chem
===================================================================
RCS file: examples/122/ch4x_anisole.chem
diff -N examples/122/ch4x_anisole.chem
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ examples/122/ch4x_anisole.chem 26 Oct 2006 22:13:49 -0000 1.1
@@ -0,0 +1,46 @@
+ch4x_anisole.chem:
+.cstart
+
+# Example file for `chem':
+
+# This originates from Computing Science Technical Report No. 122
+# CHEM - A Program for Typesetting Chemical Diagrams: User Manual
+# by Jon L. Bentley, Lynn W. Jelinski, Brian W. Kernighan
+# <http://cm.bell-labs.com/cm/cs/cstr/122.ps.gz>.
+
+# Copyright (C) 2006 Free Software Foundation, Inc.
+
+# Last update: 26 Oct 2006
+
+# This file is part of `chem', which is part of `groff'.
+
+# `groff' is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# `groff' is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with `groff'; see the files COPYING and LICENSE in the top
+# directory of the `groff' source. If not, write to the Free Software
+# Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301,
+# USA.
+
+########################################################################
+
+R1: benzene
+ bond down from R1.V4 ; OCH3
+R2: benzene at R1 + (1.5,0)
+ bond down from R2.V4 ; O
+ CH3 right of O
+
+########################################################################
+### Emacs settings
+# Local Variables:
+# mode: Nroff
+# End:
+.cend
Index: examples/122/ch4y_reserpine.chem
===================================================================
RCS file: examples/122/ch4y_reserpine.chem
diff -N examples/122/ch4y_reserpine.chem
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ examples/122/ch4y_reserpine.chem 26 Oct 2006 22:13:49 -0000 1.1
@@ -0,0 +1,66 @@
+ch4y_reserpine.chem:
+.cstart
+
+# Example file for `chem':
+
+# This originates from Computing Science Technical Report No. 122
+# CHEM - A Program for Typesetting Chemical Diagrams: User Manual
+# by Jon L. Bentley, Lynn W. Jelinski, Brian W. Kernighan
+# <http://cm.bell-labs.com/cm/cs/cstr/122.ps.gz>.
+# Some corrections were added.
+
+# Copyright (C) 2006 Free Software Foundation, Inc.
+
+# Last update: 26 Oct 2006
+
+# This file is part of `chem', which is part of `groff'.
+
+# `groff' is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# `groff' is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with `groff'; see the files COPYING and LICENSE in the top
+# directory of the `groff' source. If not, write to the Free Software
+# Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301,
+# USA.
+
+########################################################################
+
+ CH3O
+ bond 60
+R1: benzene
+R2: aromatic flatring5 pointing down put N at 1 with .V3 at R1.V2
+ H below R2.V1
+R3: ring put N at 3 with .V5 at R2.V5
+R4: ring put N at 1 with .V1 at R3.V3
+ back bond -120 from R4.V4 ; H
+ back bond 60 from R4.V3 ; H
+R5: ring with .V1 at R4.V3
+ bond -120 ; C
+ double bond down from C ; O
+ CH3O left of C
+ back bond 60 from R5.V3 ; H
+ back bond down from R5.V4 ; O
+ CH3 right of O
+ bond 120 from R5.V3 ; O
+ bond right lenght .1 from O ; C
+ double bond down ; O
+ bond right length .1 from C
+B: benzene pointing right
+ bond 30 from B.V6 ; OCH3
+ bond right from B.V1 ; OCH3
+ bond 150 from B.V2 ; OCH3
+
+########################################################################
+### Emacs settings
+# Local Variables:
+# mode: Nroff
+# End:
+.cend
Index: examples/122/ch4z1_eqn_glutamic.chem
===================================================================
RCS file: examples/122/ch4z1_eqn_glutamic.chem
diff -N examples/122/ch4z1_eqn_glutamic.chem
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ examples/122/ch4z1_eqn_glutamic.chem 26 Oct 2006 22:13:49 -0000
1.1
@@ -0,0 +1,82 @@
+ch4z1_eqn_glutamic.chem:
+.EQ
+delim $$
+.EN
+.cstart
+
+# Example file for `chem':
+
+# This originates from Computing Science Technical Report No. 122
+# CHEM - A Program for Typesetting Chemical Diagrams: User Manual
+# by Jon L. Bentley, Lynn W. Jelinski, Brian W. Kernighan
+# <http://cm.bell-labs.com/cm/cs/cstr/122.ps.gz>.
+# Some corrections were added.
+
+# Copyright (C) 2006 Free Software Foundation, Inc.
+
+# Last update: 26 Oct 2006
+
+# This file is part of `chem', which is part of `groff'.
+
+# `groff' is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# `groff' is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with `groff'; see the files COPYING and LICENSE in the top
+# directory of the `groff' source. If not, write to the Free Software
+# Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301,
+# USA.
+
+########################################################################
+
+# a left bracket
+ bond right length .1 ; BP
+ bond up length .3
+ bond right length .1
+ bond down length .3 from BP
+ bond right length .1
+# this is the mainchain amide structure
+ bond right length .1 from BP ; NH
+ bond right ; CH
+# label the CH with an alpha, intended for eqn.
+# this line says "put the north edge of the alpha at the
+# south edge of the CH"
+ "$alpha$" with .n at CH.s
+ bond right from CH ; C
+ double bond up from C ; O
+ bond right length .1 from C ; BP
+# a right bracket
+ bond up length .3
+ bond left length .1
+ bond right length .1 from BP
+ bond down length .3 from BP ; BP
+ bond left length .1
+# label the degree of polymerization
+ "$n$" with .w at BP.se
+# this is the sidechain
+ bond up from CH ; CH2
+ "$beta$" with .e at CH2.w
+ bond up from CH2 ; CH2
+ "$gamma$" with .e at CH2.w
+ bond up from CH2 ; C
+# this is the benzyl ester part
+ double bond -60 from C ; O
+ bond 60 from C ; O
+ bond right ; CH2C6H5
+
+########################################################################
+### Emacs settings
+# Local Variables:
+# mode: Nroff
+# End:
+.cend
+.EQ
+delim off
+.EN
Index: examples/122/ch4z2_text.chem
===================================================================
RCS file: examples/122/ch4z2_text.chem
diff -N examples/122/ch4z2_text.chem
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ examples/122/ch4z2_text.chem 26 Oct 2006 22:13:49 -0000 1.1
@@ -0,0 +1,57 @@
+ch4z2_text.chem:
+.cstart
+
+# Example file for `chem':
+
+# This originates from Computing Science Technical Report No. 122
+# CHEM - A Program for Typesetting Chemical Diagrams: User Manual
+# by Jon L. Bentley, Lynn W. Jelinski, Brian W. Kernighan
+# <http://cm.bell-labs.com/cm/cs/cstr/122.ps.gz>.
+
+# Copyright (C) 2006 Free Software Foundation, Inc.
+
+# Last update: 26 Oct 2006
+
+# This file is part of `chem', which is part of `groff'.
+
+# `groff' is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# `groff' is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with `groff'; see the files COPYING and LICENSE in the top
+# directory of the `groff' source. If not, write to the Free Software
+# Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301,
+# USA.
+
+########################################################################
+
+ bond 120 dotted
+ bond 120 length .3 ; BP
+ back bond -120 length .25 from BP ; H
+ front bond 120 length .25 from BP ; CH3
+ bond 60 length .5 from BP ; BP
+ bond -60 length .25 from BP ; H
+# note the pic move command to position the text
+ move left .35 ; "(ANTI)"
+ front bond 60 length .25 from BP ; H
+# another positioning of text
+ move right .35 ; "(SYN)"
+ bond 120 length .4 from BP ; BP
+ back bond -120 length .25 from BP ; H
+ front bond 120 length .25 from BP ; CH3
+ bond 60 length .5 from BP
+ bond 60 dotted
+
+########################################################################
+### Emacs settings
+# Local Variables:
+# mode: Nroff
+# End:
+.cend
Index: examples/122/ch5a_size.chem
===================================================================
RCS file: examples/122/ch5a_size.chem
diff -N examples/122/ch5a_size.chem
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ examples/122/ch5a_size.chem 26 Oct 2006 22:13:49 -0000 1.1
@@ -0,0 +1,49 @@
+ch5a_size.chem:
+.cstart
+
+# Example file for `chem':
+
+# This originates from Computing Science Technical Report No. 122
+# CHEM - A Program for Typesetting Chemical Diagrams: User Manual
+# by Jon L. Bentley, Lynn W. Jelinski, Brian W. Kernighan
+# <http://cm.bell-labs.com/cm/cs/cstr/122.ps.gz>.
+
+# Copyright (C) 2006 Free Software Foundation, Inc.
+
+# Last update: 26 Oct 2006
+
+# This file is part of `chem', which is part of `groff'.
+
+# `groff' is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# `groff' is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with `groff'; see the files COPYING and LICENSE in the top
+# directory of the `groff' source. If not, write to the Free Software
+# Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301,
+# USA.
+
+########################################################################
+
+.ps 14
+size 16
+R: ring6 put O at 1 put C at 2 put O at 3 put C at 4 put O at 5 put C at 6
+ double bond 60 from R.V2 ; NH
+ double bond down from R.V4 ; NH
+ double bond -60 from R.V6 ; HN
+size 10 # if you are doing more than one
+.ps 10
+
+########################################################################
+### Emacs settings
+# Local Variables:
+# mode: Nroff
+# End:
+.cend
Index: examples/122/ch6a_pic.chem
===================================================================
RCS file: examples/122/ch6a_pic.chem
diff -N examples/122/ch6a_pic.chem
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ examples/122/ch6a_pic.chem 26 Oct 2006 22:13:49 -0000 1.1
@@ -0,0 +1,47 @@
+ch6a_pic.chem:
+.cstart
+
+# Example file for `chem':
+
+# This originates from Computing Science Technical Report No. 122
+# CHEM - A Program for Typesetting Chemical Diagrams: User Manual
+# by Jon L. Bentley, Lynn W. Jelinski, Brian W. Kernighan
+# <http://cm.bell-labs.com/cm/cs/cstr/122.ps.gz>.
+
+# Copyright (C) 2006 Free Software Foundation, Inc.
+
+# Last update: 26 Oct 2006
+
+# This file is part of `chem', which is part of `groff'.
+
+# `groff' is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# `groff' is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with `groff'; see the files COPYING and LICENSE in the top
+# directory of the `groff' source. If not, write to the Free Software
+# Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301,
+# USA.
+
+########################################################################
+
+R: ring double 2,3
+ line from R.V6 to R.C
+ line from R.C to R.V4
+X1: 1/2 <R.V5,R.C>
+X2: 1/2 <R.C,R.V2>
+ bond from X1 to X2
+
+########################################################################
+### Emacs settings
+# Local Variables:
+# mode: Nroff
+# End:
+.cend
Index: examples/122/ch6b_dna.chem
===================================================================
RCS file: examples/122/ch6b_dna.chem
diff -N examples/122/ch6b_dna.chem
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ examples/122/ch6b_dna.chem 26 Oct 2006 22:13:49 -0000 1.1
@@ -0,0 +1,67 @@
+ch6b_dna.chem:
+the [...] construct does not work for any chem.
+.br
+.ig
+#.cstart
+
+# Example file for `chem':
+
+# This originates from Computing Science Technical Report No. 122
+# CHEM - A Program for Typesetting Chemical Diagrams: User Manual
+# by Jon L. Bentley, Lynn W. Jelinski, Brian W. Kernighan
+# <http://cm.bell-labs.com/cm/cs/cstr/122.ps.gz>.
+
+# Copyright (C) 2006 Free Software Foundation, Inc.
+
+# Last update: 26 Oct 2006
+
+# This file is part of `chem', which is part of `groff'.
+
+# `groff' is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# `groff' is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with `groff'; see the files COPYING and LICENSE in the top
+# directory of the `groff' source. If not, write to the Free Software
+# Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301,
+# USA.
+
+########################################################################
+
+P: [
+R1: flatring pointing up put N at 1 put N at 4 double 5,1
+ bond -135 from R1.V4 ; BP
+ "deoxyribose" rjust with .e at BP.w
+R2: ring6 put N at 2 put N at 4 double 1,2 3,4 5,6 with .V6 at R1.V2
+ pic Conn: R2.V2.ne #because naming is too restricted in pic
+ bond up from R2.V1 ; N
+ bond -60 from N ; H
+ bond 60 from N ; H
+]
+ # thymine
+Q: [
+R3: ring6 put N at 3 put N at 5 double 1,2
+ bond up from R3.V1 ; CH3
+ bond 120 from R3.V3 ; BP
+ "deoxyribose" ljust with .w at BP.e
+ double bond down from R3.V4 ; O
+ double bond -60 from R3.V6 ; O
+ bond -120 from R3.V5 ; H
+] with .O at P.H + (.3,.3)
+ bond from Q.O.sw to P.H.ne dotted
+ bond from Q.H.sw to P.Conn dotted
+
+########################################################################
+### Emacs settings
+# Local Variables:
+# mode: Nroff
+# End:
+.cend
+..
Index: examples/122/chAa_polymer.chem
===================================================================
RCS file: examples/122/chAa_polymer.chem
diff -N examples/122/chAa_polymer.chem
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ examples/122/chAa_polymer.chem 26 Oct 2006 22:13:49 -0000 1.1
@@ -0,0 +1,76 @@
+chAa_polymer.chem:
+.cstart
+
+# Example file for `chem':
+
+# This originates from Computing Science Technical Report No. 122
+# CHEM - A Program for Typesetting Chemical Diagrams: User Manual
+# by Jon L. Bentley, Lynn W. Jelinski, Brian W. Kernighan
+# <http://cm.bell-labs.com/cm/cs/cstr/122.ps.gz>.
+
+# Copyright (C) 2006 Free Software Foundation, Inc.
+
+# Last update: 26 Oct 2006
+
+# This file is part of `chem', which is part of `groff'.
+
+# `groff' is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# `groff' is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with `groff'; see the files COPYING and LICENSE in the top
+# directory of the `groff' source. If not, write to the Free Software
+# Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301,
+# USA.
+
+########################################################################
+
+# epoxy based on the m-phenyldiamine cured bisphenol-A
+ size 8
+ bond dotted
+ bond ; N
+ bond ; CH2
+ bond down from N
+R1: benzene
+ bond 120 length .1 from R1.V3 ; N
+ bond right length .1 from N
+ bond down length .1 from N
+# back to the CH2
+ bond right from CH2 ; CH
+ bond down from CH ; OH
+ bond right from CH ; CH2
+ bond right ; O
+ bond right
+ benzene pointing right
+ bond right ; C
+ bond up from C ; CH3
+ bond down from C ; CH3
+ bond right from C
+ benzene pointing right
+ bond right ; O
+ bond right from O ; CH2
+ bond right ; CH
+ bond down from CH ; OH
+ bond right from CH ; CH2
+ bond right ; N
+ bond right from N
+ bond dotted
+ bond down from N
+R2: benzene
+ bond 120 length .1 from R2.V3 ; N
+ bond right length .1 from N
+ bond down length .1 from N
+
+########################################################################
+### Emacs settings
+# Local Variables:
+# mode: Nroff
+# End:
+.cend
Index: examples/122/chAb_vinyl_chloro.chem
===================================================================
RCS file: examples/122/chAb_vinyl_chloro.chem
diff -N examples/122/chAb_vinyl_chloro.chem
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ examples/122/chAb_vinyl_chloro.chem 26 Oct 2006 22:13:49 -0000 1.1
@@ -0,0 +1,66 @@
+chAb_vinyl_chloro.chem:
+.cstart
+
+# Example file for `chem':
+
+# This originates from Computing Science Technical Report No. 122
+# CHEM - A Program for Typesetting Chemical Diagrams: User Manual
+# by Jon L. Bentley, Lynn W. Jelinski, Brian W. Kernighan
+# <http://cm.bell-labs.com/cm/cs/cstr/122.ps.gz>.
+
+# Copyright (C) 2006 Free Software Foundation, Inc.
+
+# Last update: 26 Oct 2006
+
+# This file is part of `chem', which is part of `groff'.
+
+# `groff' is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# `groff' is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with `groff'; see the files COPYING and LICENSE in the top
+# directory of the `groff' source. If not, write to the Free Software
+# Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301,
+# USA.
+
+########################################################################
+
+ Cl
+ bond 120 length .25 ; BP
+ bond 60 length .25 from BP ; Cl
+B1: double bond down length .3 from BP
+ bond 120 length .35 ; BP
+# now comes the ring
+R1: ring6 double 1,2 3,4 5,6 with .V6 at BP
+ bond up length .1 from R1.V1 ; H
+ bond 60 length .1 from R1.V2 ; H
+ bond 120 from R1.V3 ; O
+ bond 60 from O ; C
+ double bond up from C ; O
+ bond 120 from C
+# continue decorating the ring
+ bond down length .1 from R1.V4 ; H
+ bond -120 length .1 from R1.V5 ; H
+# now go back and do the left hand ring
+ bond -120 length .35 from B1.end ; BP
+R2: ring6 double 1,2 3,4 5,6 with .V2 at BP
+ bond up length .1 from R2.V1 ; H
+ bond -60 length .1 from R2.V6 ; H
+ bond -120 from R2.V5 ; O
+ bond -60 from O
+ bond down length .1 from R2.V4 ; H
+ bond 120 length .1 from R2.V3 ; H
+
+########################################################################
+### Emacs settings
+# Local Variables:
+# mode: Nroff
+# End:
+.cend
Index: examples/122/chAc_morphine.chem
===================================================================
RCS file: examples/122/chAc_morphine.chem
diff -N examples/122/chAc_morphine.chem
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ examples/122/chAc_morphine.chem 26 Oct 2006 22:13:49 -0000 1.1
@@ -0,0 +1,56 @@
+chAc_morphine.chem:
+.cstart
+
+# Example file for `chem':
+
+# This originates from Computing Science Technical Report No. 122
+# CHEM - A Program for Typesetting Chemical Diagrams: User Manual
+# by Jon L. Bentley, Lynn W. Jelinski, Brian W. Kernighan
+# <http://cm.bell-labs.com/cm/cs/cstr/122.ps.gz>.
+
+# Copyright (C) 2006 Free Software Foundation, Inc.
+
+# Last update: 26 Oct 2006
+
+# This file is part of `chem', which is part of `groff'.
+
+# `groff' is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# `groff' is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with `groff'; see the files COPYING and LICENSE in the top
+# directory of the `groff' source. If not, write to the Free Software
+# Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301,
+# USA.
+
+########################################################################
+
+R1: ring6 double 1,2
+ bond -60 from R1.V6 ; HO
+R2: ring6 with .V1 at R1.V3
+ bond 60 from R2.V2 ; N
+ bond right from N ; CH3
+R3: benzene with .V1 at R2.V5
+ bond -120 from R3.V5 ; HO
+# this is the furan ring
+ bond -135 length .33 from R1.V5 ; O
+ bond -45 length .33 from R3.V6
+# this is the odd ring
+ bond up length .1 from N ; BP
+B1: bond up length .33 from R1.V4
+ bond to BP
+
+
+########################################################################
+### Emacs settings
+# Local Variables:
+# mode: Nroff
+# End:
+.cend
Index: examples/122/chAd_chlorophyll.chem
===================================================================
RCS file: examples/122/chAd_chlorophyll.chem
diff -N examples/122/chAd_chlorophyll.chem
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ examples/122/chAd_chlorophyll.chem 26 Oct 2006 22:13:49 -0000 1.1
@@ -0,0 +1,73 @@
+chAd_chlorophyll.chem:
+.cstart
+
+# Example file for `chem':
+
+# This originates from Computing Science Technical Report No. 122
+# CHEM - A Program for Typesetting Chemical Diagrams: User Manual
+# by Jon L. Bentley, Lynn W. Jelinski, Brian W. Kernighan
+# <http://cm.bell-labs.com/cm/cs/cstr/122.ps.gz>.
+
+# Copyright (C) 2006 Free Software Foundation, Inc.
+
+# Last update: 26 Oct 2006
+
+# This file is part of `chem', which is part of `groff'.
+
+# `groff' is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# `groff' is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with `groff'; see the files COPYING and LICENSE in the top
+# directory of the `groff' source. If not, write to the Free Software
+# Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301,
+# USA.
+
+########################################################################
+
+ Mg
+ bond 45 ; N
+R1: ring5 pointing up put N at 4 double 1,2 4,5 with .V4 at N
+ bond up from R1.V1 ; CH3
+ bond right from R1.V2 ; CH2CH3
+ bond 135 from Mg ; N
+R2: ring5 pointing down put N at 3 double 1,2 4,5 with .V3 at N
+ bond right from R2.V5 ; CH3
+ bond 225 from Mg ; N
+R3: ring5 pointing down put N at 4 double 3,4 with .V4 at N
+ bond -45 from Mg ; N
+R4: ring5 pointing up put N at 3 double 1,5 with .V3 at N
+ bond left from R4.V5 ; H3C
+ bond up from R4.V1 ; CH
+ double bond right length .1 from CH ; CH2
+ double bond 150 length .3 from R1.V3
+ bond to R2.V4
+R5: ring5 pointing 72 with .V5 at R2.V2
+ double bond 135 from R5.V2 ; O
+ bond down from R5.V3 ; C
+ double bond left length .1 from C ; O
+ bond down from C ; O
+ CH3 left of O
+ double bond -25 from R5.V4
+ bond down from R3.V1 ; CH2
+ CH2 left of CH2
+ bond left ; C
+ double bond -45 ; O
+ bond -135 from C ; C20H39O
+ bond left from R3.V2 ; H3C
+ double bond -150 length .3 from R4.V4
+ bond to R3.V3
+
+########################################################################
+### Emacs settings
+# Local Variables:
+# mode: Nroff
+# End:
+.cend
Index: examples/122/chAe_chair.chem
===================================================================
RCS file: examples/122/chAe_chair.chem
diff -N examples/122/chAe_chair.chem
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ examples/122/chAe_chair.chem 26 Oct 2006 22:13:49 -0000 1.1
@@ -0,0 +1,53 @@
+chAe_chair.chem:
+.cstart
+
+# Example file for `chem':
+
+# This originates from Computing Science Technical Report No. 122
+# CHEM - A Program for Typesetting Chemical Diagrams: User Manual
+# by Jon L. Bentley, Lynn W. Jelinski, Brian W. Kernighan
+# <http://cm.bell-labs.com/cm/cs/cstr/122.ps.gz>.
+
+# Copyright (C) 2006 Free Software Foundation, Inc.
+
+# Last update: 26 Oct 2006
+
+# This file is part of `chem', which is part of `groff'.
+
+# `groff' is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# `groff' is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with `groff'; see the files COPYING and LICENSE in the top
+# directory of the `groff' source. If not, write to the Free Software
+# Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301,
+# USA.
+
+########################################################################
+
+pic define chair { [
+ V1: bond 120 length .25
+ V2: bond right length .35
+ V3: bond 150 length .35
+ V4: bond -60 length .25
+ V5: bond left length .35
+ V6: bond to V1.start
+pic ] }
+R1: chair
+R2: chair with .V1 at R1.V4.start
+bond 60 from R2.V4.start ; CH3
+bond down from R2.V4.start ; OH
+
+########################################################################
+### Emacs settings
+# Local Variables:
+# mode: Nroff
+# End:
+.cend
Index: examples/122/chAf_arrow.chem
===================================================================
RCS file: examples/122/chAf_arrow.chem
diff -N examples/122/chAf_arrow.chem
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ examples/122/chAf_arrow.chem 26 Oct 2006 22:13:49 -0000 1.1
@@ -0,0 +1,72 @@
+chAf_arrow.chem:
+.EQ
+delim $$
+.EN
+.cstart
+
+# Example file for `chem':
+
+# This originates from Computing Science Technical Report No. 122
+# CHEM - A Program for Typesetting Chemical Diagrams: User Manual
+# by Jon L. Bentley, Lynn W. Jelinski, Brian W. Kernighan
+# <http://cm.bell-labs.com/cm/cs/cstr/122.ps.gz>.
+
+# Copyright (C) 2006 Free Software Foundation, Inc.
+
+# Last update: 26 Oct 2006
+
+# This file is part of `chem', which is part of `groff'.
+
+# `groff' is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# `groff' is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with `groff'; see the files COPYING and LICENSE in the top
+# directory of the `groff' source. If not, write to the Free Software
+# Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301,
+# USA.
+
+########################################################################
+
+ bond length .1 ; BP
+ bond up length .5
+ bond right
+ bond down length .5 from BP
+ bond right
+ bond right from BP ; C
+ double bond up ; O
+ bond right from C
+ benzene pointing right
+ bond right ; C
+ double bond up from C ; O
+ bond right from C ; O
+ bond right ; CH2
+# this is the statement to make the arrow
+ line <- from CH2.s down
+ move down .1 ; "0.085"
+ CH2CH2CH2 right of CH2
+ bond right ; O
+ bond right length .1 ; BP
+ bond up length .5 from BP
+ bond left
+ bond right length .1 from BP
+ bond down length .5 from BP ; BP
+ bond left
+ "$n$" with .w at BP.se
+
+########################################################################
+### Emacs settings
+# Local Variables:
+# mode: Nroff
+# End:
+.cend
+.EQ
+delim off
+.EN
Index: examples/122/chAg_circle.chem
===================================================================
RCS file: examples/122/chAg_circle.chem
diff -N examples/122/chAg_circle.chem
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ examples/122/chAg_circle.chem 26 Oct 2006 22:13:49 -0000 1.1
@@ -0,0 +1,58 @@
+chAg_circle.chem:
+.cstart
+
+# Example file for `chem':
+
+# This originates from Computing Science Technical Report No. 122
+# CHEM - A Program for Typesetting Chemical Diagrams: User Manual
+# by Jon L. Bentley, Lynn W. Jelinski, Brian W. Kernighan
+# <http://cm.bell-labs.com/cm/cs/cstr/122.ps.gz>.
+
+# Copyright (C) 2006 Free Software Foundation, Inc.
+
+# Last update: 26 Oct 2006
+
+# This file is part of `chem', which is part of `groff'.
+
+# `groff' is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# `groff' is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with `groff'; see the files COPYING and LICENSE in the top
+# directory of the `groff' source. If not, write to the Free Software
+# Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301,
+# USA.
+
+########################################################################
+
+bond 120 ; C
+bond 60 ; C
+ bond up ; Cl
+double bond 120 from C ; C
+bond 60 ; C
+bond 120 ; C
+bond 60 ; C
+ bond up ; Cl
+double bond 120 from C ; C
+ circle at C rad .08
+bond 60 from C ; C
+bond 120 ; C
+bond 60 ; C
+double bond 120 ; C
+ bond down ; Cl
+bond 60 from C ; C
+bond 120
+
+########################################################################
+### Emacs settings
+# Local Variables:
+# mode: Nroff
+# End:
+.cend
Index: examples/122/chAh_brackets.chem
===================================================================
RCS file: examples/122/chAh_brackets.chem
diff -N examples/122/chAh_brackets.chem
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ examples/122/chAh_brackets.chem 26 Oct 2006 22:13:49 -0000 1.1
@@ -0,0 +1,62 @@
+chAh_brackets.chem:
+the [...] construction does not work for any chem.
+.br
+.ig
+#.cstart
+
+# Example file for `chem':
+
+# This originates from Computing Science Technical Report No. 122
+# CHEM - A Program for Typesetting Chemical Diagrams: User Manual
+# by Jon L. Bentley, Lynn W. Jelinski, Brian W. Kernighan
+# <http://cm.bell-labs.com/cm/cs/cstr/122.ps.gz>.
+
+# Copyright (C) 2006 Free Software Foundation, Inc.
+
+# Last update: 26 Oct 2006
+
+# This file is part of `chem', which is part of `groff'.
+
+# `groff' is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# `groff' is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with `groff'; see the files COPYING and LICENSE in the top
+# directory of the `groff' source. If not, write to the Free Software
+# Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301,
+# USA.
+
+########################################################################
+
+[
+ bond right ; CH2
+ bond 120 ; (CH2)
+ "$nothing sub n$"
+ bond 60 ; .CH2
+]
+# now put the arrow in
+ move right .3
+ arrow .5
+ move right .3
+# begin second structure
+[
+ bond right ; CH.
+ bond 120 ; (CH2)
+ "$nothing sub n$"
+ bond 60 ; CH3
+]
+
+########################################################################
+### Emacs settings
+# Local Variables:
+# mode: Nroff
+# End:
+.cend
+..
Index: examples/122/chAi_poly_vinyl_chloride.chem
===================================================================
RCS file: examples/122/chAi_poly_vinyl_chloride.chem
diff -N examples/122/chAi_poly_vinyl_chloride.chem
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ examples/122/chAi_poly_vinyl_chloride.chem 26 Oct 2006 22:13:49 -0000
1.1
@@ -0,0 +1,148 @@
+chAi_poly_vinyl_chloride.chem:
+the [...] construction does not work for any chem.
+.br
+.ig
+.ps 8
+#.cstart
+
+# Example file for `chem':
+
+# This originates from Computing Science Technical Report No. 122
+# CHEM - A Program for Typesetting Chemical Diagrams: User Manual
+# by Jon L. Bentley, Lynn W. Jelinski, Brian W. Kernighan
+# <http://cm.bell-labs.com/cm/cs/cstr/122.ps.gz>.
+
+# Copyright (C) 2006 Free Software Foundation, Inc.
+
+# Last update: 26 Oct 2006
+
+# This file is part of `chem', which is part of `groff'.
+
+# `groff' is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# `groff' is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with `groff'; see the files COPYING and LICENSE in the top
+# directory of the `groff' source. If not, write to the Free Software
+# Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301,
+# USA.
+
+########################################################################
+
+db = .12
+cwid = .095
+A: [
+ bond dotted
+ bond right ; CH
+ bond down ; Cl
+ bond right from CH ; CH2
+ bond ; CH
+ bond down ; Cl
+ bond right from CH ; CH2
+ bond ; C.
+ bond down ; Cl
+ bond right from C ; CH2
+ bond ; CH2
+ bond down ; Cl
+]
+" (6.13a)" ljust at A.e
+arrow down .5 from A.s
+[
+ CH2
+ double bond right ; CHCl
+] with .w at last arrow.c
+B: [
+ bond dotted
+ bond right ; CH
+ bond down ; Cl
+ bond right from CH ; CH2
+ bond ; CH
+ bond down ; Cl
+ bond right from CH ; CH2
+ bond ; C
+ bond up ; Cl
+ bond down from C ; CH2
+ bond ; CH2Cl
+ bond right from C ; CH2
+ bond ; CH
+ bond down ; Cl
+ bond right from CH
+ bond dotted
+] with .n at end of last arrow
+" (6.13b)" ljust at B.e
+C: [
+ bond dotted
+ bond right ; CH
+ bond down ; Cl
+ bond right from CH ; CH2
+ bond ; C.
+ bond down ; Cl
+ bond right from C ; CH2
+ bond ; CH
+ bond down ; Cl
+ bond right from CH ; CH2
+ bond ; CH2
+ bond down ; Cl
+] with .n at B.s - (0,.5)
+" (6.14a)" ljust at C.e
+arrow down .3 from C.s
+[
+ CH2
+ double bond right
+ CHCl
+] with .w at last arrow.s
+arrow down .3 from last arrow.s
+
+D: [
+ bond dotted
+ bond right ; CH
+ bond down ; Cl
+ bond right from CH ; CH2
+ bond ; C
+ bond up ; Cl
+ bond down from C ; CH2
+ bond ; CHCl
+ bond ; CH2
+ bond ; CH2Cl
+ bond right from C ; CH2
+ bond ; CH
+ bond down ; Cl
+ bond right from CH ; CH2
+ bond ; CH
+ bond down ; Cl
+ bond right from CH
+ bond dotted
+] with .n at last arrow.s
+" (6.14b)" ljust at D.e
+E: [
+ bond dotted
+ bond ; CH
+ bond down ; Cl
+ bond right from CH ; CH2
+ bond ; CH
+ bond down ; Cl
+ bond right from CH ; CH2
+ bond ; CH
+ bond down ; Cl
+ bond right from CH ; CH2
+ bond ; CH
+ bond down ; Cl
+] with .e at B.w - (.5,0)
+
+arrow from E.ne to A.sw
+arrow from E.se to C.nw
+
+########################################################################
+### Emacs settings
+# Local Variables:
+# mode: Nroff
+# End:
+.cend
+..
Index: examples/122/chBa_jump.chem
===================================================================
RCS file: examples/122/chBa_jump.chem
diff -N examples/122/chBa_jump.chem
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ examples/122/chBa_jump.chem 26 Oct 2006 22:13:49 -0000 1.1
@@ -0,0 +1,45 @@
+chBa_jump.chem:
+.cstart
+
+# Example file for `chem':
+
+# This originates from Computing Science Technical Report No. 122
+# CHEM - A Program for Typesetting Chemical Diagrams: User Manual
+# by Jon L. Bentley, Lynn W. Jelinski, Brian W. Kernighan
+# <http://cm.bell-labs.com/cm/cs/cstr/122.ps.gz>.
+
+# Copyright (C) 2006 Free Software Foundation, Inc.
+
+# Last update: 26 Oct 2006
+
+# This file is part of `chem', which is part of `groff'.
+
+# `groff' is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# `groff' is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with `groff'; see the files COPYING and LICENSE in the top
+# directory of the `groff' source. If not, write to the Free Software
+# Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301,
+# USA.
+
+########################################################################
+
+SiO2 # name = SiO2
+move right 1
+CH3CH2NH2.HCl # name = CH3CH2NH2HCl
+
+
+########################################################################
+### Emacs settings
+# Local Variables:
+# mode: Nroff
+# End:
+.cend
Index: examples/122/chBb_bonds.chem
===================================================================
RCS file: examples/122/chBb_bonds.chem
diff -N examples/122/chBb_bonds.chem
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ examples/122/chBb_bonds.chem 26 Oct 2006 22:13:49 -0000 1.1
@@ -0,0 +1,46 @@
+chBb_bonds.chem:
+.cstart
+
+# Example file for `chem':
+
+# This originates from Computing Science Technical Report No. 122
+# CHEM - A Program for Typesetting Chemical Diagrams: User Manual
+# by Jon L. Bentley, Lynn W. Jelinski, Brian W. Kernighan
+# <http://cm.bell-labs.com/cm/cs/cstr/122.ps.gz>.
+
+# Copyright (C) 2006 Free Software Foundation, Inc.
+
+# Last update: 26 Oct 2006
+
+# This file is part of `chem', which is part of `groff'.
+
+# `groff' is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# `groff' is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with `groff'; see the files COPYING and LICENSE in the top
+# directory of the `groff' source. If not, write to the Free Software
+# Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301,
+# USA.
+
+########################################################################
+
+C
+frontbond -170 from C ; H
+backbond 10 from C ; CO2H
+bond left length .15 from C ; H2N
+bond right from C ; CH3
+
+########################################################################
+### Emacs settings
+# Local Variables:
+# mode: Nroff
+# End:
+.cend
Index: examples/122/chBc_rings.chem
===================================================================
RCS file: examples/122/chBc_rings.chem
diff -N examples/122/chBc_rings.chem
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ examples/122/chBc_rings.chem 26 Oct 2006 22:13:49 -0000 1.1
@@ -0,0 +1,47 @@
+chBc_rings.chem:
+.cstart
+
+# Example file for `chem':
+
+# This originates from Computing Science Technical Report No. 122
+# CHEM - A Program for Typesetting Chemical Diagrams: User Manual
+# by Jon L. Bentley, Lynn W. Jelinski, Brian W. Kernighan
+# <http://cm.bell-labs.com/cm/cs/cstr/122.ps.gz>.
+
+# Copyright (C) 2006 Free Software Foundation, Inc.
+
+# Last update: 26 Oct 2006
+
+# This file is part of `chem', which is part of `groff'.
+
+# `groff' is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# `groff' is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with `groff'; see the files COPYING and LICENSE in the top
+# directory of the `groff' source. If not, write to the Free Software
+# Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301,
+# USA.
+
+########################################################################
+
+R1: benzene
+ bond -120 from R1.V5 ; CH3O
+R2: ring4 pointing 45 with .V4 at R1.V2
+R3: aromatic ring6 put N at 4 put S at 2 at R2 + (.75,0)
+R4: ring5 pointing left at R3 + (.75,0)
+ label R4
+
+########################################################################
+### Emacs settings
+# Local Variables:
+# mode: Nroff
+# End:
+.cend
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Groff-commit] groff/contrib/chem .cvsignore ChangeLog Makefil...,
Werner LEMBERG <=