The basic theory for reconstruction of two-dimensional, coherent, magnetohydrostatic structures with nonisotropic plasma pressure is developed. Three field-line invariants are found in the system. A new Poisson-like partial differential equation is obtained for this reconstruction, which can be solved as a spatial initial-value problem in a manner similar to the so-called Grad-Shafranov reconstruction, without resort to auxiliary equations. Moreover, we find that with some simple substitutions this new equation can be applied for field-aligned flow with isotropic plasma pressure. The numerical code for new reconstruction has been developed and is benchmarked with an exact analytical solution. Results show that the reconstruction works well with small errors in a rectangular region surrounding the spacecraft trajectory. Applications to in situ spacecraft measurements will be reported separately.