Chemfig

From Wikipedia, the free encyclopedia
Jump to navigation Jump to search
Chemfig
DeveloperChristian Tellechea
Repository
  • {{URL|example.com|optional display text}}Lua error in Module:EditAtWikidata at line 29: attempt to index field 'wikibase' (a nil value).
Written inTeX
Engine
    Lua error in Module:EditAtWikidata at line 29: attempt to index field 'wikibase' (a nil value).
    Operating systemCross-platform
    PlatformLaTeX
    TypeChemical structure drawing
    LicenseLaTeX Project Public License
    Websitewww.ctan.org/pkg/chemfig

    Chemfig is a LaTeX package used for creating graphical representations of chemical structures, molecules, reaction schemes, and structural formulas. It provides a simple and flexible syntax to define atoms, bonds, angles, rings.[1] It allows for the construction of both organic and inorganic molecules using LaTeX markup.[2][3]

    Features

    [edit | edit source]

    Syntax

    [edit | edit source]

    Package preamble:

    \input chemfig.tex
    \usepackage{chemfig}
    

    Chemfig uses a simple syntax based on TeX commands. For example:

    \chemfig{H-C(-[2]H)(-[6]H)-C(=O)-OH}
    

    Produces a structural formula for acetic acid and a structure would render as:

    Acetic acid

    There are 9 different bond types:

    \chemfig{A-B}\\
    \chemfig{A=B}\\
    \chemfig{A~B}\\
    \chemfig{A>B}\\
    \chemfig{A<B}\\
    \chemfig{A>:B}\\
    \chemfig{A<:B}\\
    \chemfig{A>{{!}}B}\\
    \chemfig{A<{{!}}B}\\
    
    methane molecule

    Molecular angles of a methane molecule:

    \chemfig{C(-[:0]H)(-[:90]H)(-[:180]H)(-[:270]H)}
    

    See also

    [edit | edit source]

    Lua error in mw.title.lua at line 392: bad argument #2 to 'title.new' (unrecognized namespace name 'Portal').

    References

    [edit | edit source]
    1. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
    2. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
    3. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
    4. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
    [edit | edit source]