Index: doc/genmodel.py
===================================================================
--- doc/genmodel.py	(revision 61ba6233ec36e842d625c589deec77f689b2a9b6)
+++ doc/genmodel.py	(revision d138d4377bdeeb2f6748c00827e90f3421165989)
@@ -1,13 +1,12 @@
 import sys
-import os
 sys.path.insert(0,'..')
 
 # Convert ../sasmodels/models/name.py to sasmodels.models.name
 module_name = sys.argv[1][3:-3].replace('/','.').replace('\\','.')
-print module_name
+#print module_name
 module = __import__(module_name)
 for part in module_name.split('.')[1:]:
     module = getattr(module, part)
-print module
+#print module
 
 # Load the doc string from the module definition file and store it in rst
Index: doc/index.rst
===================================================================
--- doc/index.rst	(revision 61ba6233ec36e842d625c589deec77f689b2a9b6)
+++ doc/index.rst	(revision d138d4377bdeeb2f6748c00827e90f3421165989)
@@ -15,4 +15,5 @@
 
    guide/index.rst
+   developer/index.rst
    ref/index.rst
    api/index.rst
Index: sasmodels/exception.py
===================================================================
--- sasmodels/exception.py	(revision 076300996fb3c63a832e9a4b72e732f2caf60bed)
+++ sasmodels/exception.py	(revision d138d4377bdeeb2f6748c00827e90f3421165989)
@@ -15,5 +15,7 @@
     to the caller using a bare "raise" statement to reraise the annotated
     exception.
+
     Example::
+
         >>> D = {}
         >>> try:
Index: sasmodels/generate.py
===================================================================
--- sasmodels/generate.py	(revision e1ace4d12bc0e49ddee5c117d92a23547094baf4)
+++ sasmodels/generate.py	(revision d138d4377bdeeb2f6748c00827e90f3421165989)
@@ -200,5 +200,6 @@
 
 import sys
-from os.path import abspath, dirname, join as joinpath, exists, basename
+from os.path import abspath, dirname, join as joinpath, exists, basename, \
+    splitext
 import re
 
@@ -565,5 +566,5 @@
         demo_parameters = dict((p[0],p[2]) for p in parameters)
     filename = abspath(kernel_module.__file__)
-    kernel_id = basename(filename)[:-3]
+    kernel_id = splitext(basename(filename))[0]
     name = getattr(kernel_module, 'name', None)
     if name is None:
Index: sasmodels/kerneldll.py
===================================================================
--- sasmodels/kerneldll.py	(revision 5edfe12d884117a412d8437e870506cdf8c27006)
+++ sasmodels/kerneldll.py	(revision d138d4377bdeeb2f6748c00827e90f3421165989)
@@ -21,5 +21,5 @@
 free from microsoft:
 
-    `http://www.microsoft.com/en-us/download/details.aspx?id=44266`_
+    `<http://www.microsoft.com/en-us/download/details.aspx?id=44266>`_
 
 Again, this requires that the compiler is available on your path.  This is
Index: sasmodels/models/bcc.py
===================================================================
--- sasmodels/models/bcc.py	(revision cd3dba0c60af7479ce1bae901d065d3d5786c8ea)
+++ sasmodels/models/bcc.py	(revision d138d4377bdeeb2f6748c00827e90f3421165989)
@@ -7,6 +7,4 @@
 and the size of the paracrystal is infinitely large. Paracrystalline distortion
 is assumed to be isotropic and characterized by a Gaussian distribution.
-
-The returned value is scaled to units of |cm^-1|\ |sr^-1|, absolute scale.
 
 Definition
@@ -46,7 +44,8 @@
 where $g$ is a fractional distortion based on the nearest neighbor distance.
 
-The body-centered cubic lattice is
 
-.. image:: img/bcc_lattice.jpg
+.. figure:: img/bcc_lattice.jpg
+
+    Body-centered cubic lattice.
 
 For a crystal, diffraction peaks appear at reduced q-values given by
@@ -68,7 +67,7 @@
     \end{eqnarray}
 
-**NB: The calculation of $Z(q)$ is a double numerical integral that must
+**NB**: The calculation of $Z(q)$ is a double numerical integral that must
 be carried out with a high density of points to properly capture the sharp
-peaks of the paracrystalline scattering.** So be warned that the calculation
+peaks of the paracrystalline scattering. So be warned that the calculation
 is SLOW. Go get some coffee. Fitting of any experimental data must be
 resolution smeared for any meaningful fit. This makes a triple integral.
@@ -78,8 +77,7 @@
 *qmin* = 0.001 |Ang^-1|, *qmax* = 0.1 |Ang^-1| and the above default values.
 
-.. image:: img/bcc_1d.jpg
+.. figure:: img/bcc_1d.jpg
 
-*Figure. 1D plot in the linear scale using the default values
-(w/200 data point).*
+    1D plot in the linear scale using the default values (w/200 data point).
 
 The 2D (Anisotropic model) is based on the reference below where $I(q)$ is
@@ -88,11 +86,13 @@
 model computation.
 
-.. image:: img/bcc_orientation.gif
+.. figure:: img/crystal_orientation.gif
 
-.. image:: img/bcc_2d.jpg
+    Orientation of the crystal with respect to the scattering plane.
 
-*Figure. 2D plot using the default values (w/200X200 pixels).*
+.. figure:: img/bcc_2d.jpg
 
-REFERENCE
+    2D plot using the default values (w/200X200 pixels).*
+
+Reference
 ---------
 
Index: sasmodels/models/broad_peak.py
===================================================================
--- sasmodels/models/broad_peak.py	(revision 485aee225e23a0dad14b9acfc70c0c7072e650b9)
+++ sasmodels/models/broad_peak.py	(revision d138d4377bdeeb2f6748c00827e90f3421165989)
@@ -31,7 +31,7 @@
 
 
-.. image:: img/image175.jpg
+.. figure:: img/broad_peak_1d.jpg
 
-*Figure. 1D plot using the default values (w/200 data point).*
+    1D plot using the default values (w/200 data point).
 
 REFERENCE
Index: sasmodels/models/cylinder.py
===================================================================
--- sasmodels/models/cylinder.py	(revision 3e428ec139734cd9698fc2d854c41eb3498c4c47)
+++ sasmodels/models/cylinder.py	(revision d138d4377bdeeb2f6748c00827e90f3421165989)
@@ -3,6 +3,4 @@
 r"""
 The form factor is normalized by the particle volume.
-
-For information about polarised and magnetic scattering, click here_.
 
 Definition
Index: sasmodels/models/fcc.py
===================================================================
--- sasmodels/models/fcc.py	(revision 3e428ec139734cd9698fc2d854c41eb3498c4c47)
+++ sasmodels/models/fcc.py	(revision d138d4377bdeeb2f6748c00827e90f3421165989)
@@ -9,51 +9,62 @@
 a Gaussian distribution.
 
-The returned value is scaled to units of |cm^-1|\ |sr^-1|, absolute scale.
-
 Definition
 ----------
 
-The scattering intensity *I(q)* is calculated as
+The scattering intensity $I(q)$ is calculated as
 
-.. image:: img/image158.jpg
+.. math::
 
-where *scale* is the volume fraction of spheres, *Vp* is the volume of
+    I(q) = \frac{\text{scale}}{V_p} P(q) Z(q)
+
+where *scale* is the volume fraction of spheres, $V_p$ is the volume of
 the primary particle, *V(lattice)* is a volume correction for the crystal
-structure, *P(q)* is the form factor of the sphere (normalized), and *Z(q)*
+structure, $P(q)$ is the form factor of the sphere (normalized), and $Z(q)$
 is the paracrystalline structure factor for a face-centered cubic structure.
 
-Equation (1) of the 1990 reference is used to calculate *Z(q)*, using
-equations (23)-(25) from the 1987 paper for *Z1*\ , *Z2*\ , and *Z3*\ .
+Equation (1) of the 1990 reference is used to calculate $Z(q)$, using
+equations (23)-(25) from the 1987 paper for $Z1$, $Z2$, and $Z3$.
 
 The lattice correction (the occupied volume of the lattice) for a
 face-centered cubic structure of particles of radius *R* and nearest
-neighbor separation *D* is
+neighbor separation $D$ is
 
-.. image:: img/image159.jpg
+.. math::
+
+   V_\text{lattice} = \frac{16\pi}{3}\frac{R^3}{\left(D\sqrt{2}\right)^3}
 
 The distortion factor (one standard deviation) of the paracrystal is
-included in the calculation of *Z(q)*
+included in the calculation of $Z(q)$
 
-.. image:: img/image160.jpg
+.. math::
 
-where *g* is a fractional distortion based on the nearest neighbor distance.
+    \Delta a = gD
 
-The face-centered cubic lattice is
+where $g$ is a fractional distortion based on the nearest neighbor distance.
 
-.. image:: img/image161.jpg
+.. figure:: img/fcc_lattice.jpg
+
+    Face-centered cubic lattice.
 
 For a crystal, diffraction peaks appear at reduced q-values given by
 
-.. image:: img/image162.jpg
+.. math::
 
-where for a face-centered cubic lattice *h*\ , *k*\ , *l* all odd or all
-even are allowed and reflections where *h*\ , *k*\ , *l* are mixed odd/even
+    \frac{qD}{2\pi} = \sqrt{h^2 + k^2 + l^2}
+
+where for a face-centered cubic lattice $h, k , l$ all odd or all
+even are allowed and reflections where $h, k, l$ are mixed odd/even
 are forbidden. Thus the peak positions correspond to (just the first 5)
 
-.. image:: img/image163.jpg
+.. math::
 
-**NB: The calculation of** *Z(q)* **is a double numerical integral that
-must be carried out with a high density of** **points to properly capture
-the sharp peaks of the paracrystalline scattering.** So be warned that the
+    \begin{array}{cccccc}
+    q/q_0 & 1 & \sqrt{4/3} & \sqrt{8/3} & \sqrt{11/3} & \sqrt{4} \\
+    \text{Indices} & (111)  & (200) & (220) & (311) & (222)
+    \end{array}
+
+**NB**: The calculation of $Z(q)$ is a double numerical integral that
+must be carried out with a high density of points to properly capture
+the sharp peaks of the paracrystalline scattering. So be warned that the
 calculation is SLOW. Go get some coffee. Fitting of any experimental data
 must be resolution smeared for any meaningful fit. This makes a triple
@@ -63,7 +74,7 @@
 *qmax* = 0.1 |Ang^-1| and the above default values.
 
-.. image:: img/image164.jpg
+.. figure:: img/fcc_1d.jpg
 
-*Figure. 1D plot in the linear scale using the default values (w/200 data point).*
+    1D plot in the linear scale using the default values (w/200 data point).
 
 The 2D (Anisotropic model) is based on the reference below where *I(q)* is
@@ -72,11 +83,14 @@
 2D model computation.
 
-.. image:: img/image165.gif
+.. figure:: img/crystal_orientation.gif
 
-.. image:: img/image166.jpg
+    Orientation of the crystal with respect to the scattering plane.
 
-*Figure. 2D plot using the default values (w/200X200 pixels).*
+.. figure:: img/fcc_2d.jpg
 
-REFERENCE
+    2D plot using the default values (w/200X200 pixels).
+
+Reference
+---------
 
 Hideki Matsuoka et. al. *Physical Review B*, 36 (1987) 1754-1765
Index: sasmodels/models/hollow_cylinder.py
===================================================================
--- sasmodels/models/hollow_cylinder.py	(revision 66ebdd668828275e87ada92bedafaa22888a51db)
+++ sasmodels/models/hollow_cylinder.py	(revision d138d4377bdeeb2f6748c00827e90f3421165989)
@@ -1,10 +1,12 @@
 r"""
-This model provides the form factor, *P(q)*, for a monodisperse hollow right 
+This model provides the form factor, $P(q)$, for a monodisperse hollow right
 angle circular cylinder (tube) where the form factor is normalized by the
 volume of the tube
 
-*P(q)* = *scale* \* *<F*\ :sup:`2`\ *>* / *V*\ :sub:`shell` + *background*
+.. math::
 
-where the averaging < > is applied only for the 1D calculation.
+    P(q) = \text{scale} \langle F^2 \rangle/V_\text{shell} + \text{background}
+
+where the averaging $\langle \rangle$ is applied only for the 1D calculation.
 
 The inside and outside of the hollow cylinder are assumed have the same SLD.
@@ -18,42 +20,45 @@
 
     \begin{eqnarray}
-    P(q)&=&(\text{scale})V_{shell}(\Delta\rho)^2\int_0^{1}\Psi^2[q_z,
-    R_{shell}(1-x^2)^{1/2},R_{core}(1-x^2)^{1/2}][\frac{sin(qHx)}{qHx}]^2dx\\
-    \Psi[q,y,z]&=&\frac{1}{1-\gamma^2}[\Lambda(qy)-\gamma^2\Lambda(qz)]\\
-    \Lambda(a)&=&2J_1(a)/a\\
-    \gamma&=&R_{core}/R_{shell}\\
-    V_{shell}&=&\pi(R_{shell}^2-R_{core}^2)L\\
-    J_1(x)&=&\frac{(sin(x)-x\cdot cos(x))}{x^2}\\
+    P(q)           &=& (\text{scale})V_\text{shell}\Delta\rho^2
+            \int_0^{1}\Psi^2
+            \left[q_z, R_\text{shell}(1-x^2)^{1/2},
+                       R_\text{core}(1-x^2)^{1/2}\right]
+            \left[\frac{\sin(qHx)}{qHx}\right]^2 dx \\
+    \Psi[q,y,z]    &=& \frac{1}{1-\gamma^2}
+            \left[ \Lambda(qy) - \gamma^2\Lambda(qz) \right] \\
+    \Lambda(a)     &=& 2 J_1(a) / a \\
+    \gamma         &=& R_\text{core} / R_\text{shell} \\
+    V_\text{shell} &=& \pi \left(R_\text{shell}^2 - R_\text{core}^2 \right)L \\
+    J_1(x)         &=& \frac{(\sin(x)-x\cdot \cos(x))}{x^2} \\
     \end{eqnarray}
 
-where *scale* is a scale factor and *J1* is the 1st order Bessel function.
+where *scale* is a scale factor and $J_1$ is the 1st order
+Bessel function.
 
 To provide easy access to the orientation of the core-shell cylinder, we define
-the axis of the cylinder using two angles |theta| and |phi|\ . As for the case 
+the axis of the cylinder using two angles $\theta$ and $\phi$. As for the case
 of the cylinder, those angles are defined in Figure 2 of the CylinderModel.
 
-NB: The 2nd virial coefficient of the cylinder is calculated based on the radius
-and 2 length values, and used as the effective radius for *S(Q)* when 
-*P(Q)* \* *S(Q)* is applied.
+**NB**: The 2nd virial coefficient of the cylinder is calculated
+based on the radius and 2 length values, and used as the effective radius
+for $S(Q)$ when $P(Q) * S(Q)$ is applied.
 
 In the parameters, the contrast represents SLD :sub:`shell` - SLD :sub:`solvent`
-and the *radius* = *R*\ :sub:`shell` while *core_radius* = *R*\ :sub:`core`.
+and the *radius* is $R_\text{shell}$ while *core_radius* is $R_\text{core}$.
 
-.. image:: img/image074.jpg
+.. figure:: img/hollow_cylinder_1d.jpg
 
-*Figure. 1D plot using the default values (w/1000 data point).*
+    1D plot using the default values (w/1000 data point).
 
-Our model uses the form factor calculations implemented in a c-library provided
-by the NIST Center for Neutron Research (Kline, 2006).
+.. figure:: img/orientation.jpg
 
-.. image:: img/image061.jpg
+    Definition of the angles for the oriented hollow_cylinder model.
 
-*Figure. Definition of the angles for the oriented hollow_cylinder model.*
+.. figure:: img/orientation2.jpg
 
-.. image:: img/image062.jpg
+    Examples of the angles for oriented pp against the detector plane.
 
-*Figure. Examples of the angles for oriented pp against the detector plane.*
-
-REFERENCE
+Reference
+---------
 
 L A Feigin and D I Svergun, *Structure Analysis by Small-Angle X-Ray and
Index: sasmodels/models/lamellarFFHG.py
===================================================================
--- sasmodels/models/lamellarFFHG.py	(revision 22eac463f374383bfa62405dcbcad39b978f60cd)
+++ sasmodels/models/lamellarFFHG.py	(revision d138d4377bdeeb2f6748c00827e90f3421165989)
@@ -5,19 +5,27 @@
 region is taken to be different from the SLD of the tail region.
 
-*2.1.31.1. Definition*
+Definition
+----------
 
-The scattering intensity *I(q)* is
+The scattering intensity $I(q)$ is
 
 .. math::
 
-    I(Q) = 2\pi{P(Q) \over (2(|delta|\ H +|delta|\ T) Q^2)
+   I(q) = 2\pi\frac{\text{scale}}{2(\delta_H + \delta_T)}  P(q) \frac{1}{q^2}
 
-The form factor is
+The form factor $P(q)$ is
 
-.. image:: img/lamellarFFHG_.jpg
+.. math::
 
-where |delta|\ T = tail length (or *tail_length*), |delta|\ H = head thickness
-(or *h_thickness*), |drho|\ H = SLD(headgroup) - SLD(solvent),
-and |drho|\ T = SLD(tail) - SLD(solvent).
+    P(q) = \frac{4}{q^2}
+        \left\lbrace
+            \Delta \rho_H
+            \left[\sin[q(\delta_H + \delta_T)\ - \sin(q\delta_T)\right]
+            + \Delta\rho_T\sin(q\delta_T)
+        \right\rbrace^2
+
+where $\delta_T$ is *tail_length*, \delta_H is *head_length*,
+$\Delta\rho_H$ is the head contrast (*head_sld* $-$ *solvent_sld*),
+and $\Delta\rho_T$ is tail contrast (*sld* $-$ *solvent_sld*).
 
 The 2D scattering intensity is calculated in the same way as 1D, where
@@ -26,18 +34,13 @@
 .. math::
 
-    Q = \sqrt{Q_x^2 + Q_y^2}
+    q = \sqrt{q_x^2 + q_y^2}
 
-The returned value is in units of |cm^-1|, on absolute scale. In the
-parameters, *sld_tail* = SLD of the tail group, and *sld_head* = SLD
-of the head group.
 
-.. image:: img/lamellarFFHG_138.jpg
+.. figure:: img/lamellarFFHG_1d.jpg
 
-*Figure. 1D plot using the default values (w/1000 data point).*
+    1D plot using the default values (w/1000 data point).
 
-Our model uses the form factor calculations implemented in a C library
-provided by the NIST Center for Neutron Research (Kline, 2006).
-
-REFERENCE
+References
+----------
 
 F Nallet, R Laversanne, and D Roux, J. Phys. II France, 3, (1993) 487-502
@@ -51,5 +54,5 @@
 
 name = "lamellar_FFHG"
-title = "Random lamellar phase with Head Groups "
+title = "Random lamellar phase with Head Groups"
 description = """\
     [Random lamellar phase with Head Groups]
Index: sasmodels/models/lamellarPC.py
===================================================================
--- sasmodels/models/lamellarPC.py	(revision 3e428ec139734cd9698fc2d854c41eb3498c4c47)
+++ sasmodels/models/lamellarPC.py	(revision d138d4377bdeeb2f6748c00827e90f3421165989)
@@ -7,58 +7,87 @@
 can be used for large multilamellar vesicles.**
 
-*2.1.33.1. Definition*
+Definition
+----------
 
-The scattering intensity *I(q)* is calculated as
+In the equations below,
 
-.. image:: img/image145.jpg
+- *scale* is used instead of the mass per area of the bilayer $\Gamma_m$
+  (this corresponds to the volume fraction of the material in the bilayer,
+  *not* the total excluded volume of the paracrystal),
+
+- *sld* $-$ *solvent_sld* is the contrast $\Delta \rho$,
+
+- *thickness* is the layer thickness $t$,
+
+- *Nlayers* is the number of layers $N$,
+
+- *spacing* is the average distance between adjacent layers
+  $\langle D \rangle$, and
+
+- *spacing_polydisp* is the relative standard deviation of the Gaussian
+  layer distance distribution $\sigma_D / \langle D \rangle$.
+
+
+The scattering intensity $I(q)$ is calculated as
+
+.. math::
+
+    I(q) = 2\pi\Delta\rho^2\Gamma_m\frac{P_\text{bil}(q)}{q^2} Z_N(q)
 
 The form factor of the bilayer is approximated as the cross section of an
-infinite, planar bilayer of thickness *t*
+infinite, planar bilayer of thickness $t$
 
-.. image:: img/image146.jpg
+.. math::
 
-Here, the scale factor is used instead of the mass per area of the
-bilayer (*G*). The scale factor is the volume fraction of the material in
-the bilayer, *not* the total excluded volume of the paracrystal.
-*Z*\ :sub:`N`\ *(q)* describes the interference effects for aggregates
+    P_\text{bil}(q) = \left(\frac{\sin(qt/2)}{qt/2}\right)^2
+
+$Z_N(q)$ describes the interference effects for aggregates
 consisting of more than one bilayer. The equations used are (3-5)
-from the Bergstrom reference below.
+from the Bergstrom reference:
+
+.. math::
+
+
+    Z_N(q) = \frac{1 - w^2}{1 + w^2 - 2w \cos(q \langle D \rangle)}
+        + x_N S_N + (1 - x_N) S_{N+1}
+
+where
+
+.. math::
+
+    S_N(q) = \frac{a_N}{N}[1 + w^2 - 2 w \cos(q \langle D \rangle)]^2
+
+and
+
+.. math::
+
+    a_N = 4w^2 - 2(w^3 + w) \cos(q \langle D \rangle)
+        - 4w^{N+2}\cos(Nq \langle D \rangle)
+        + 2 w^{N+3}\cos[(N-1)q \langle D \rangle]
+        + 2w^{N+1}\cos[(N+1)q \langle D \rangle]
+
+for the layer spacing distribution $w = \exp(-\sigma_D^2 q^2/2)$.
 
 Non-integer numbers of stacks are calculated as a linear combination of
 the lower and higher values
 
-.. image:: img/image147.jpg
+.. math::
+
+    N_L = x_N N + (1 - x_N)(N+1)
 
 The 2D scattering intensity is the same as 1D, regardless of the orientation
-of the *q* vector which is defined as
+of the $q$ vector which is defined as
 
 .. math::
 
-    Q = \sqrt{Q_x^2 + Q_y^2}
+    q = \sqrt{q_x^2 + q_y^2}
 
-The parameters of the model are *Nlayers* = no. of layers, and
-*pd_spacing* = polydispersity of spacing.
 
-==============  ========  =============
-Parameter name  Units     Default value
-==============  ========  =============
-background      |cm^-1|   0
-scale           None      1
-Nlayers         None      20
-pd_spacing      None      0.2
-sld_layer       |Ang^-2|  1e-6
-sld_solvent     |Ang^-2|  6.34e-6
-spacing         |Ang|     250
-thickness       |Ang|     33
-==============  ========  =============
+.. figure:: img/lamellarPC_1d.jpg
 
-.. image:: img/image148.jpg
+    1D plot using the default values above (w/20000 data point).
 
-*Figure. 1D plot using the default values above (w/20000 data point).*
-
-Our model uses the form factor calculations implemented in a C library
-provided by the NIST Center for Neutron Research (Kline, 2006).
-
-REFERENCE
+Reference
+---------
 
 M Bergstrom, J S Pedersen, P Schurtenberger, S U Egelhaaf,
@@ -90,5 +119,5 @@
                "d-spacing of paracrystal stack"],
               ["spacing_polydisp", "Ang", 0.0, [0.0, inf], "",
-               "d-spacing of paracrystal stack"],
+               "d-spacing polydispersity"],
               ["sld", "1e-6/Ang^2", 1.0, [-inf, inf], "",
                "layer scattering length density"],
Index: sasmodels/models/lorentz.py
===================================================================
--- sasmodels/models/lorentz.py	(revision 66ebdd668828275e87ada92bedafaa22888a51db)
+++ sasmodels/models/lorentz.py	(revision d138d4377bdeeb2f6748c00827e90f3421165989)
@@ -12,12 +12,14 @@
 
 For 2D data: The 2D scattering intensity is calculated in the same way as 1D, 
-where the *q* vector is defined as
+where the $q$ vector is defined as
 
 .. math:: q=\sqrt{q_x^2 + q_y^2}
 
-.. image:: img/image179.jpg
+.. figure:: img/lorentz_1d.jpg
 
-*Figure. 1D plot using the default values (w/200 data point).*
-REFERENCE
+    1D plot using the default values (w/200 data point).
+
+Reference
+---------
 
 L.S. Qrnstein and F. Zernike, *Proc. Acad. Sci. Amsterdam* 17, 793 (1914), and
Index: sasmodels/models/parallelepiped.py
===================================================================
--- sasmodels/models/parallelepiped.py	(revision cd3dba0c60af7479ce1bae901d065d3d5786c8ea)
+++ sasmodels/models/parallelepiped.py	(revision d138d4377bdeeb2f6748c00827e90f3421165989)
@@ -3,6 +3,4 @@
 r"""
 The form factor is normalized by the particle volume.
-
-For information about polarised and magnetic scattering, click here_.
 
 Definition
@@ -11,6 +9,6 @@
 This model provides the form factor, *P(q)*, for a rectangular parallelepiped
 (below) where the form factor is normalized by the volume of the
-parallelepiped. If you need to apply polydispersity, see also the
-RectangularPrismModel_.
+parallelepiped. If you need to apply polydispersity, see also
+rectangular_prism_.
 
 The calculated form factor is:
Index: sasmodels/models/spherepy.py
===================================================================
--- sasmodels/models/spherepy.py	(revision 34375ead223bacad43be0353fea621241df4e0c3)
+++ sasmodels/models/spherepy.py	(revision d138d4377bdeeb2f6748c00827e90f3421165989)
@@ -36,8 +36,8 @@
 Validation of our code was done by comparing the output of the 1D model
 to the output of the software provided by the NIST (Kline, 2006).
-Figure :num:`figure #sphere-comparison` shows a comparison of the output
+Figure :num:`figure #spherepy-comparison` shows a comparison of the output
 of our model and the output of the NIST software.
 
-.. _sphere-comparison:
+.. _spherepy-comparison:
 
 .. figure:: img/sphere_comparison.jpg
Index: sasmodels/resolution.py
===================================================================
--- sasmodels/resolution.py	(revision 7f7f99fcf117177d5281d8a7c0ef25462f0d7f04)
+++ sasmodels/resolution.py	(revision d138d4377bdeeb2f6748c00827e90f3421165989)
@@ -5,4 +5,11 @@
 """
 from __future__ import division
+
+__all__ = ["Resolution", "Perfect1D", "Pinhole1D", "Slit1D",
+           "apply_resolution_matrix", "pinhole_resolution", "slit_resolution",
+           "pinhole_extend_q", "slit_extend_q", "bin_edges",
+           "interpolate", "linear_extrapolation", "geometric_extrapolation",
+           ]
+
 from scipy.special import erf
 from numpy import sqrt, log, log10
@@ -189,6 +196,5 @@
 
 
-    Algorithm
-    ---------
+    **Algorithm**
 
     We are using the mid-point integration rule to assign weights to each
@@ -429,4 +435,6 @@
 
     Substituting:
+
+    .. math::
 
         n_\text{extend} = (n-1) (\log q_\text{max} - \log q_n)
Index: sasmodels/sasview_model.py
===================================================================
--- sasmodels/sasview_model.py	(revision aa4946b68cdcd8686f2c8386cafe8a9e446f0ed2)
+++ sasmodels/sasview_model.py	(revision d138d4377bdeeb2f6748c00827e90f3421165989)
@@ -229,33 +229,30 @@
 
     def evalDistribution(self, qdist):
-        """
+        r"""
         Evaluate a distribution of q-values.
 
-        * For 1D, a numpy array is expected as input: ::
+        :param qdist: array of q or a list of arrays [qx,qy]
+
+        * For 1D, a numpy array is expected as input
+
+        ::
 
             evalDistribution(q)
 
-          where q is a numpy array.
-
-        * For 2D, a list of numpy arrays are expected: [qx,qy],
-          with 1D arrays::
+          where *q* is a numpy array.
+
+        * For 2D, a list of *[qx,qy]* is expected with 1D arrays as input
+
+        ::
 
               qx = [ qx[0], qx[1], qx[2], ....]
-
-          and::
-
               qy = [ qy[0], qy[1], qy[2], ....]
 
-        Then get ::
-
-            q = numpy.sqrt(qx^2+qy^2)
-
-        that is a qr in 1D array::
-
-            q = [q[0], q[1], q[2], ....]
-
-
-        :param qdist: ndarray of scalar q-values or list [qx,qy]
-        where qx,qy are 1D ndarrays
+        If the model is 1D only, then
+
+        .. math::
+
+            q = \sqrt{q_x^2+q_y^2}
+
         """
         if isinstance(qdist, (list, tuple)):
