tikz.dev / chemfig Manual

chemfig

List of commands

List of commands

The commands created by chemfig are:

CommandsDescription
\chemfig[⟨settings⟩]{⟨code⟩}draws the molecule whose design is described by the ⟨code⟩
\setchemfig{⟨settings⟩}sets the parameters with the syntax ⟨key⟩\({}={}\)⟨value⟩. These ⟨key⟩ and ⟨value⟩ are listed on section 1 for \chemfig, section 1 for the \schemestart macro, and section  for the \hreac macro.
\resetchemfigReset the parameters to their default values
\printatomdisplays the atoms within the molecules. It can be redefined to customize the output. See section 2
\hflipnextthe next molecule will be horizontally flipped
\vflipnextthe next molecule will be vertically flipped
\definesubmol{⟨name⟩}⟨n⟩[⟨code1⟩]{⟨code2⟩}creates an alias !⟨name⟩ which can be put in the code of molecules to be drawn, and which will be replaced with ⟨code1⟩ or ⟨code2⟩ depending on the angle of the last bond. See section 6
\chemskipaligntells the vertical alignment mechanism to ignore the current group of atoms. See section 7.4.
\redefinesubmol{⟨name⟩}⟨n⟩[⟨code1⟩]{⟨code2⟩}replaces a preexisting alias !⟨name⟩ with the new ⟨code⟩. See section 6
\charge{[⟨parameters⟩]⟨pos⟩[⟨tikz⟩]}{⟨atom⟩}prints ⟨atome⟩ and places the charges according to their ⟨positions⟩. The charges are places out of the bounding box of the ⟨atome⟩. See section 8
\Charge{[⟨parameters⟩]⟨pos⟩[⟨tikz⟩]}{⟨atom⟩}Same behaviour as \charge, but the final bounding box takes the charges into account.
\chemmove[⟨tikz options⟩]⟨tikz code⟩Makes a tikzpicture environment, adding to it the <tikz options>. Uses the ⟨tikz code⟩ to join the nodes specified in the molecules with the help pf the “@” character. See section 14.
\chemabove[⟨dim⟩]{⟨txt1⟩}{txt2}writes ⟨txt1⟩ and places ⟨txt2⟩ above, leaving ⟨dim⟩ of vertical space. This command does not change the bounding box of ⟨txt1⟩. See section 9
\chembelow[⟨dim⟩]{⟨txt1⟩}{txt2}writes {txt1} and places ⟨txt2⟩ below, leaving ⟨dim⟩ of vertical space. This command does not change the bounding box of ⟨txt1⟩. See section 9
\Chemabove[⟨dim⟩]{⟨txt1⟩}{txt2}writes ⟨txt1⟩ and places ⟨txt2⟩ above, leaving ⟨dim⟩ of vertical space. See section 9
\Chembelow[⟨dim⟩]{⟨txt1⟩}{txt2}writes {txt1} and places ⟨txt2⟩ below, leaving ⟨dim⟩ of vertical space. See section 9
\chemname[⟨dim⟩]{⟨molecule⟩}{⟨name⟩}Places ⟨name⟩ under the ⟨molecule⟩
\chemnameinitInitializes the greatest molecule depth to ensure correct alignment of the names of the following molecules.
\schemestart…\schemestopcommands between which a reaction scheme is drawn. See section 1.
\arrowdraws an arrow in a reaction scheme (this command is only defined inside a reaction scheme). See section 2.
\+prints a \(+\) sign in a reaction scheme (this command is only defined inside a reaction scheme). See section 12.
\subscheme{⟨code⟩}draws a subscheme (this command is only defined inside a reaction scheme). See 8.
\definearrowdefines an arrow. See section 10.
\chemleft⟨car1⟩⟨stuff⟩\chemright⟨car1⟩draws expandable delimiters defined with ⟨car1⟩ and ⟨car2⟩ on the left and on the right of the ⟨stuff⟩, see section 8.
\chemup⟨car1⟩⟨stuff⟩\chemdown⟨car1⟩draws expandable delimiters defined with ⟨car1⟩ and ⟨car2⟩ above and below the ⟨stuff⟩, see section 8.
\polymerdelim[⟨settings]{<node1⟩}{node2>}draws delimiters at specified nodes, see section 12.4
\hreac...\endhreactags between which a horizontal reaction is drawn, see section Horizontal reactions
>{⟨type⟩}[⟨top label⟩][⟨bottom label⟩]draws a horizontal arrow, see section 2
+displays the \(+\) sign in the horizontal reaction
\>{⟨dimension⟩}moves the current compound horizontally, see section 5
\^{⟨dimension⟩} or \^*{⟨dimension⟩}moves the current compound vertically, see section 2
\chemname{⟨compound⟩}{⟨name⟩}typeset ⟨name⟩ under ⟨compound⟩, see section 3
\name{⟨name⟩}typeset ⟨name⟩ under the current compound, see section 3