TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How can I draw styrene using xymtex?


share|improve this question
Suggest you look at the package chemfig, which is built on top of the Tikz package instead of using xyfig. For the chemist, you are not required to know anything about tikz, but you do need to know chemistry to understand how to use the package. Lots of very nice examples. – R. Schumacher Nov 14 '12 at 21:12
Quite apart from the tool chosen, I'd tidy up the angles a bit! Either the phenyl group or the double bond should be angled so everything stays 'ideal'. – Joseph Wright Nov 14 '12 at 21:14
up vote 6 down vote accepted

This is my first use of the package xymtex.



share|improve this answer

This isn't a direct answer to your question (and as such, you should accept Heiko's answer), but as R. Schumacher suggested, you can also accomplish this with the newer (and more robust) chemfig package.


image of MWE output for styrene examples

share|improve this answer
You should use CH_2 instead of CH2 – Lionel MANSUY Nov 15 '12 at 12:22
Despite the fact that I also think that chemfig is the better choice: this doesn't answer the question at all... – clemens Nov 15 '12 at 16:18
LionelMANSUY: Thanks. cgnieder: True. I should have said this to begin with. – user2473 Nov 15 '12 at 20:17

To complete the answer from @cfair this code will draw "exactly" your representation of the styrene molecule, including the annotation:


There is an option to control the length of the bonds

styrene molecule

share|improve this answer

XyMTeX supports the (yl) function for nested substitution. The following examples show (1) changing font sizes, (2) changing formula sizes, (3) changing fonts, and (4) selection of basis skeletons (\bzdrv, \bzdrh, or \tetramethylenei).

The code adopts the PostScript mode of the XyMTeX system, which presumes the processing with dvips(k). The other modes commented out are possible to be applied.

%\usepackage{xymtex}%XyMTeX plain
%\usepackage{xymtexpdf}%XyMTeX for PDF ... dvipdfmx ... .pdf
\usepackage{xymtexps}%XyMTeX for PostScript ... dvips(k) ... .ps
\usepackage{txfonts}%Times Roman
\usepackage[scaled]{helvet}%Helvetica 95%
\let\substfontsize=\small%changing font size

\changeunitlength{0.07pt}%changing formula size
\bzdrv{1==\tetramethylenei[b]{1==H;4==H}{2==(yl);3==H}} \\
\let\substfont=\sf%changing font: san serif

enter image description here

share|improve this answer
the author of xymtex was persuaded to upload a copy to ctan when he had a paper in tugboat. unfortunately he never followed this up, so (a) the copy on ctan is pathetially old, and (b) the procedure for getting a current version used to change every time i looked. my advice is to use chemfig, as others have suggested. – wasteofspace Feb 4 '13 at 9:13
The latest version of XyMTeX is available from the XyMTeX homepage (xymtex.com): xymtex.com/fujitas3/xymtex/indexe.html – Fujita Feb 5 '13 at 2:12
For further information on topics discussed once in Web, please see XyMTeX-tips of the XyMTeX homepage (xymtex.com): xymtex.com/fujitas3/xymtex-tips/indexe.html The present topic has been deposited as 130204a.pdf. – Fujita Feb 6 '13 at 3:31
I believe that the selection of tools for drawing chemical structures depends on what one is aiming at now and in the future. XyMTeX is based on the XyM notation (S. Fujita and N. Tanaka, J. Chem. Inf. Comput. Sci., 39, 903-914 (1999)), which has been extended into a markup language named XyMML (XyM markup language, S. Fujita, J. Chem. Inf. Comput. Sci., 39, 915-927 (1999)). – Fujita Feb 6 '13 at 3:45

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.