NOVELTY - In situ treatment of coal formation comprises: providing heat from at least one heat source (801) to at least one portion of the formation, allowing the heat to transfer from the heat sources to selected section of the formation, and producing a mixture from the formation. The heat sources are within at least one open wellbore in the formation.    USE - The method is used for treating a coal formation in situ. It is used for producing a mixture of hydrocarbon products, hydrogen, and other products from various coal formations. It is useful for producing synthesis gas, carbon dioxide, and ammonia (claimed). The hydrocarbons produced are used as energy resources, feedstocks, and as consumer products.    ADVANTAGE - The method economically produces high quality hydrocarbons, hydrogen, and other products from various coal formations. Sequestering fluid within the formation reduces or eliminates fluid that is released to the environment due to operation of the in situ conversion process. The method reduces energy input costs, and the oxidation reaction may be propagated slowly through a greater portion of the formation so that fewer heat sources may be required to heat such a greater portion in comparison to heating by a conventional method. The uniform permeability provides high recovery of synthesis gas as compared to synthesis gas generation in a coal formation that has not been so treated. Cooling of the formation increases the strength of the rock in the formation, thus mitigating subsidence, and increases absorptive capacity of the formation. The method reduces or eliminates high temperature pumping of liquids from the production well, which in turn decreases production costs. Heating at or through the production well prevents condensation and/or refluxing of production fluid when it is moving in the production well near the overburden, increases heat input into the formation, and/or increases formation permeability at or near the production well.    DETAILED DESCRIPTION - INDEPENDENT CLAIMS are also included for the following:    (A) forming heater wells in a coal formation, which comprises forming a first wellbore in the formation, forming a second wellbore in the formation using magnetic tracking such that the second wellbore is arranged parallel to the first wellbore, and providing at least one heating mechanism within the first wellbore and at least one heating mechanism within the second wellbore such that the heating mechanisms can provide heat to at least a portion of the formation;    (B) a system configured to heat a coal formation, which comprises a heater in an opening in the formation and configured to provide heat to at least a portion of the formation during use, an oxidizing fluid source and a conduit disposed in the opening and configured to provide an oxidizing fluid from the source to a reaction zone in the formation during use, where the oxidizing fluid is selected to oxidize at least some hydrocarbons at the reaction zone during use such that heat is generated at the reaction zone, and where the system is configured to allow heat to transfer by conduction from the reaction zone to a pyrolysis zone of the formation during use;    (C) in situ production of synthesis gas from a coal formation, which comprises heating a section of the formation to a temperature to allow synthesis gas generation, where permeability of the section is uniform and greater than a permeability of an unheated section of the formation when the temperature to allow synthesis gas generation within the formation is achieved; providing a synthesis gas generating fluid (818, 821) to the section to generate synthesis gas; and removing synthesis gas (823) from the formation;    (D) forming a spent portion of formation within a coal formation, which comprises heating a first portion (805) of the formation to pyrolyze hydrocarbons within the first portion and to establish a uniform permeability within the first portion, and cooling the first portion;    (E) sequestering carbon dioxide within a coal formation, which comprises heating a portion of the formation to increase permeability and form a uniform permeability within the portion, allowing the portion to cool, and storing carbon dioxide within the portion; and    (F) producing ammonia using a coal formation, which comprises separating air to produce an oxygen (O2) rich stream and a nitrogen (N2) rich stream; heating a selected section of the formation to a temperature to support reaction of hydrocarbon material in the formation to form synthesis gas; providing synthesis gas generating fluid and at least a portion of the O2 rich stream to the selected section; allowing the synthesis gas generating fluid and O2 in the O2 rich stream to react with at least a portion of the hydrocarbon material in the formation to generate synthesis gas; producing synthesis gas comprising H2 and carbon monoxide (CO) from the formation; providing at least a portion of the H2 in the synthesis gas to an ammonia synthesis process; providing N2 to the ammonia synthesis process; and using ammonia synthesis process to generate ammonia.    DESCRIPTION OF DRAWING(S) - The drawing is a schematic diagram of using pyrolysis water to generate synthesis gas in a formation.    Heat source (801)    Electric heater (803)    First section of the formation (805)    Produced pyrolysis fluid (807)    Aqueous stream (811)    Vapor stream (813)    Synthesis gas generating fluid (818, 821)    Synthesis gas (823)    Synthesis gas production well (825)