make \AA macro available in :math: for HTML and PDF

use the (newly redefined) \AA macro for Angstrom symbol throughout
instead of either \mathring{A} or AA
This commit is contained in:
Axel Kohlmeyer
2022-10-01 20:23:32 -04:00
parent 69ca7105ef
commit 39ea6ef30e
23 changed files with 55 additions and 47 deletions

View File

@ -26,14 +26,14 @@ as defined in :ref:`(Allinger) <mm3-allinger1989>`
.. math::
E = K (r - r_0)^2 \left[ 1 - 2.55(r-r_0) + (7/12) 2.55^2(r-r_0)^2 \right]
E = K (r - r_0)^2 \left[ 1 - 2.55(r-r_0) + \frac{7}{12} 2.55^2(r-r_0)^2 \right]
where :math:`r_0` is the equilibrium value of the bond, and :math:`K` is a
prefactor. The anharmonic prefactors have units angstrom\^(-n):
-2.55 angstrom\^(-1) and (7/12)2.55\^2 angstrom\^(-2). The code takes
prefactor. The anharmonic prefactors have units :math:`\AA^{-n}`:
:math:`-2.55 \AA^{-1}` and :math:`\frac{7}{12} 2.55^2 \AA^{-2}`. The code takes
care of the necessary unit conversion for these factors internally.
Note that the MM3 papers contains an error in Eq (1):
(7/12)2.55 should be replaced with (7/12)2.55\^2
Note that the MM3 papers contain an error in Eq (1):
:math:`\frac{7}{12} 2.55` should be replaced with :math:`\frac{7}{12} 2.55^2`
The following coefficients must be defined for each bond type via the
:doc:`bond_coeff <bond_coeff>` command as in the example above, or in

View File

@ -602,8 +602,7 @@ be used. For non-orthogonal (triclinic) simulation boxes, only the
*reduced* option may be used.
A *box* value selects standard distance units as defined by the
:doc:`units <units>` command (e.g., :math:`\mathrm{\mathring A}`
for units = *real* or *metal*).
:doc:`units <units>` command (e.g., :math:`\AA` for units = *real* or *metal*).
A *lattice* value means the distance units are in lattice spacings.
The :doc:`lattice <lattice>` command must have been previously used to
define the lattice spacing. A *reduced* value means normalized

View File

@ -95,7 +95,7 @@ something like the following commands:
refresh c_dsp delay 100
The :doc:`dump_modify thresh <dump_modify>` command will only output
atoms that have displaced more than :math:`0.6~\mathrm{\mathring A}` on each
atoms that have displaced more than :math:`0.6~\AA` on each
snapshot (assuming metal units). The dump_modify *refresh* option triggers a
call to this compute at the end of every dump.

View File

@ -97,13 +97,13 @@ by the corresponding volume. This option can be useful when dealing with
inhomogeneous systems such as those that have surfaces.
Here are typical input parameters for fcc aluminum (lattice
constant :math:`4.05~\mathrm{\mathring A}`),
constant :math:`4.05~\AA`),
.. parsed-literal::
compute 1 all entropy/atom 0.25 5.7 avg yes 3.7
and for bcc sodium (lattice constant 4.23 Angstroms),
and for bcc sodium (lattice constant :math:`4.23~\AA`),
.. parsed-literal::

View File

@ -109,8 +109,7 @@ The *mass* attribute is the total mass of the rigid body.
There are two options for outputting the coordinates of the center of
mass (COM) of the body. The *x*, *y*, *z* attributes write the COM
"unscaled", in the appropriate distance :doc:`units <units>`
(:math:`\mathrm{\mathring A}`,
sigma, etc). Use *xu*, *yu*, *zu* if you want the COM "unwrapped" by
(:math:`\AA`, :math:`\sigma`, etc). Use *xu*, *yu*, *zu* if you want the COM "unwrapped" by
the image flags for each body. Unwrapped means that if the body
COM has passed through a periodic boundary one or more times, the value
is generated what the COM coordinate would be if it had not been

View File

@ -86,7 +86,7 @@ will defined using the *c* values for the spacing along each reciprocal
lattice axis. Note that manual mapping of the reciprocal space mesh is
good for comparing diffraction results from multiple simulations; however
it can reduce the likelihood that Bragg reflections will be satisfied
unless small spacing parameters (:math:`<0.05~\mathrm{\mathring A}^-1`)
unless small spacing parameters (:math:`<0.05~\AA^-1`)
are implemented. Meshes with manual spacing do not require a periodic
boundary.

View File

@ -58,7 +58,7 @@ constant, and :math:`T` is the absolute temperature.
The *units* keyword determines the meaning of the distance units used
for coordinates (*clo*, *chi*) and velocities (*vlo*, *vhi*). A *box* value
selects standard distance units as defined by the :doc:`units <units>`
command (e.g., :math:`\mathrm{\mathring{A}}` for units = real or metal). A
command (e.g., :math:`\AA` for units = real or metal). A
*lattice* value means the distance units are in lattice spacings (i.e.,
velocity in lattice spacings per unit time). The :doc:`lattice <lattice>`
command must have been previously used to define the lattice spacing.

View File

@ -91,7 +91,7 @@ reciprocal lattice axis. Note that manual mapping of the reciprocal
space mesh is good for comparing diffraction results from multiple
simulations; however, it can reduce the likelihood that Bragg
reflections will be satisfied unless small spacing parameters
(:math:`< 0.05~\mathrm{\mathring{A}}^{-1}`) are implemented.
(:math:`< 0.05~\AA^{-1}`) are implemented.
Meshes with manual spacing do not require a periodic boundary.
The limits of the reciprocal lattice mesh are determined by range of

View File

@ -464,7 +464,7 @@ The *units* keyword determines the meaning of the distance units used
to specify the coordinates of the one particle created by the *single*
style, or the overlap distance *Doverlap* by the *overlap* keyword. A
*box* value selects standard distance units as defined by the
:doc:`units <units>` command (e.g., :math:`\mathrm{\mathring{A}}` for
:doc:`units <units>` command (e.g., :math:`\AA` for
units = *real* or *metal*\ . A *lattice* value means the distance units are in
lattice spacings.

View File

@ -104,7 +104,7 @@ atom's rotation.
Distance units for displacements and the origin point of the *rotate*
style are determined by the setting of *box* or *lattice* for the
*units* keyword. *Box* means distance units as defined by the
:doc:`units <units>` command (e.g., :math:`\mathrm{\mathring A}` for
:doc:`units <units>` command (e.g., :math:`\AA` for
*real* or *metal* units). *Lattice* means distance units are in lattice
spacings. The :doc:`lattice <lattice>` command must have been previously used
to define the lattice spacing.

View File

@ -693,7 +693,7 @@ charge.
There are several options for outputting atom coordinates. The *x*,
*y*, and *z* attributes write atom coordinates "unscaled", in the
appropriate distance :doc:`units <units>` (:math:`\mathrm{\mathring A}`,
appropriate distance :doc:`units <units>` (:math:`\AA`,
:math:`\sigma`, etc.). Use *xs*, *ys*, and *zs* if you want the
coordinates "scaled" to the box size so that each value is 0.0 to 1.0.
If the simulation box is triclinic (tilted), then all atom coords will

View File

@ -632,7 +632,7 @@ calculates the displacement of each atom from its reference position.
The "4" index is the scalar displacement; 1, 2, and 3 are the :math:`xyz`
components of the displacement. The :doc:`dump_modify thresh <dump_modify>`
command will cause only atoms that have displaced more than
:math:`0.6~\mathrm{\mathring A}` to be output on a given snapshot (assuming
:math:`0.6~\AA` to be output on a given snapshot (assuming
metal units). However, note that when an atom is output, we also need to
update the reference position for that atom to its new coordinates. So that it
will not be output in every snapshot thereafter. That reference position is
@ -675,7 +675,7 @@ value of *yes* means atom coords are written in normalized units from
0.0 to 1.0 in each box dimension. If the simulation box is triclinic
(tilted), then all atom coords will still be between 0.0 and 1.0. A
value of *no* means they are written in absolute distance units
(e.g., :math:`\mathrm{\mathring A}` or :math:`\sigma`).
(e.g., :math:`\AA` or :math:`\sigma`).
Using this keyword will reset all custom header names set with
*dump_modify colname* to their respective default values.
@ -687,7 +687,7 @@ when writing to XTC files. By default, they are initialized for
whatever :doc:`units <units>` style is being used, to write out
coordinates in nanometers and time in picoseconds. For example, for *real*
units, LAMMPS defines *sfactor* = 0.1 and *tfactor* = 0.001, since the
:math:`\mathrm{\mathring A}` and fs used by *real* units are 0.1 nm and
:math:`\AA` and fs used by *real* units are 0.1 nm and
0.001 ps, respectively. If you are using a units system with distance and time
units far from nm and ps, you may wish to write XTC files with
different units, since the compression algorithm used in XTC files is

View File

@ -71,7 +71,7 @@ potential in eV, *gamma*, the valence orbital exponent, and *bcut*, the
bond cutoff distance. Note that these 4 quantities are also in the
ReaxFF potential file, except that eta is defined here as twice the eta
value in the ReaxFF file. Note that unlike the rest of LAMMPS, the units
of this fix are hard-coded to be :math:`\mathrm{\mathring{A}}`, eV, and
of this fix are hard-coded to be :math:`\AA`, eV, and
electronic charge.
The optional *maxiter* keyword allows changing the max number
@ -111,7 +111,7 @@ LAMMPS was built with that package. See the :doc:`Build package
This fix does not correctly handle interactions involving multiple
periodic images of the same atom. Hence, it should not be used for
periodic cell dimensions less than :math:`10~\mathrm{\mathring{A}}`.
periodic cell dimensions less than :math:`10~\AA`.
This fix may be used in combination with :doc:`fix efield <fix_efield>`
and will apply the external electric field during charge equilibration,

View File

@ -79,7 +79,7 @@ measured from zhi and is set with the *extent* argument.
The *units* keyword determines the meaning of the distance units used
to define a wall position, but only when a numeric constant is used.
A *box* value selects standard distance units as defined by the
:doc:`units <units>` command (e.g., :math:`\mathrm{\mathring A}`
:doc:`units <units>` command (e.g., :math:`\AA`
for units = real or metal.
A *lattice* value means the distance units are in lattice spacings.
The :doc:`lattice <lattice>` command must have been previously used to

View File

@ -59,7 +59,7 @@ Note both the COMMA and the SPACE separating the volume's
value and its corresponding pressure correction. The volumes in the file
must be uniformly spaced. Both the volumes and the pressure corrections
should be provided in the proper units, e.g. if you are using *units real*,
the volumes should all be in cubic angstroms, and the pressure corrections
the volumes should all be in cubic Angstroms, and the pressure corrections
should all be in atmospheres. Furthermore, the table should start/end at a
volume considerably smaller/larger than you expect your system to sample
during the simulation. If the system ever reaches a volume outside of the
@ -72,8 +72,8 @@ With the *analytic* option, the arguments are as follows:
... analytic V_avg N_particles N_coeff Coeff_1 Coeff_2 ... Coeff_N
Note that *V_avg* and *Coeff_i* should all be in the proper units, e.g. if you
are using *units real*, *V_avg* should be in cubic angstroms, and the
coefficients should all be in atmospheres \* cubic angstroms.
are using *units real*, *V_avg* should be in cubic Angstroms, and the
coefficients should all be in atmospheres \* cubic Angstroms.
----------

View File

@ -88,8 +88,8 @@ to send "unwrapped" coordinates to the IMD client that undo the
wrapping back of coordinates into the principle unit cell, as done by
default in LAMMPS. The *fscale* keyword allows to apply a scaling
factor to forces transmitted by the IMD client. The IMD protocols
stipulates that forces are transferred in kcal/mol/angstrom under the
assumption that coordinates are given in angstrom. For LAMMPS runs
stipulates that forces are transferred in kcal/mol/Angstrom under the
assumption that coordinates are given in Angstrom. For LAMMPS runs
with different units or as a measure to tweak the forces generated by
the manipulation of the IMD client, this option allows to make
adjustments.

View File

@ -124,7 +124,7 @@ LAMMPS was built with that package. See the :doc:`Build package
This fix does not correctly handle interactions involving multiple
periodic images of the same atom. Hence, it should not be used for
periodic cell dimensions less than 10 angstroms.
periodic cell dimensions less than 10 Angstroms.
This fix may be used in combination with :doc:`fix efield <fix_efield>`
and will apply the external electric field during charge equilibration,

View File

@ -301,7 +301,7 @@ and for mixed periodic and non-periodic boundaries.
MSM is most competitive versus Ewald and PPPM when only relatively
low accuracy forces, about 1e-4 relative error or less accurate,
are needed. Note that use of a larger Coulombic cutoff (i.e. 15
angstroms instead of 10 angstroms) provides better MSM accuracy for
Angstroms instead of 10 Angstroms) provides better MSM accuracy for
both the real space and grid computed forces.
Currently calculation of the full pressure tensor in MSM is expensive.

View File

@ -102,7 +102,7 @@ a few fitted spline values are slightly different. For most cases the
statistical averages as the original REBO potential from which it was
derived. The :math:`E^{\text{REBO}}` term in the AIREBO potential gives the model its
reactive capabilities and only describes short-ranged C-C, C-H and H-H
interactions (:math:`r < 2` Angstroms). These interactions have strong
interactions (:math:`r < 2 \AA`). These interactions have strong
coordination-dependence through a bond order parameter, which adjusts
the attraction between the I,J atoms based on the position of other
nearby atoms and thus has 3- and 4-body dependence.
@ -116,9 +116,9 @@ interactions is determined by the *cutoff* argument to the pair_style
command which is a scale factor. For each type pair (C-C, C-H, H-H)
the cutoff is obtained by multiplying the scale factor by the sigma
value defined in the potential file for that type pair. In the
standard AIREBO potential, :math:`\sigma_{CC} = 3.4` Angstroms, so with a scale
standard AIREBO potential, :math:`\sigma_{CC} = 3.4 \AA`, so with a scale
factor of 3.0 (the argument in pair_style), the resulting :math:`E^{\text{LJ}}` cutoff
would be 10.2 Angstroms.
would be :math:`10.2 \AA`.
By default, the longer-ranged interaction is smoothly switched off
between 2.16 and 3.0 :math:`\sigma`. By specifying *cutoff_min* in addition

View File

@ -182,19 +182,19 @@ For each cations (metal):
* Potential parameter:
- If type of potential is 'second_moment' : A (eV), *p*,
:math:`\zeta^0` (eV) and *q*, :math:`r_{c1} (\mathrm{\mathring{A}})`, :math:`r_{c2}
(\mathrm{\mathring{A}})` and :math:`r_0 (\mathrm{\mathring{A}})`
- If type of potential is 'buck' : *C* (eV) and :math:`\rho (\mathrm{\mathring{A}})`
:math:`\zeta^0` (eV) and *q*, :math:`r_{c1} (\AA)`, :math:`r_{c2}
(\AA)` and :math:`r_0 (\AA)`
- If type of potential is 'buck' : *C* (eV) and :math:`\rho (\AA)`
- If type of potential is 'buckPlusAttr' : *C* (eV) and :math:`\rho
(\mathrm{\mathring{A}})` *D* (eV), *B* :math:`(\mathrm{\mathring{A}}^{-1})`, :math:`r^{OO}_1 (\mathrm{\mathring{A}})` and
:math:`r^{OO}_2 (\mathrm{\mathring{A}})`
(\AA)` *D* (eV), *B* :math:`(\AA^{-1})`, :math:`r^{OO}_1 (\AA)` and
:math:`r^{OO}_2 (\AA)`
* Divider line
4) Tables parameters:
* Cutoff radius for the Coulomb interaction (:math:`R_{coul}`)
* Starting radius (:math:`r_{min} = 1,18845 \mathrm{\mathring{A}}`) and increments
(:math:`dr = 0.001 \mathrm{\mathring{A}}`) for creating the potential table.
* Starting radius (:math:`r_{min} = 1,18845 \AA`) and increments
(:math:`dr = 0.001 \AA`) for creating the potential table.
* Divider line
5) Rick model parameter:
@ -208,7 +208,7 @@ For each cations (metal):
6) Coordination parameter:
* First (:math:`r_{1n}`) and second (:math:`r_{2n}`) neighbor distances
in angstrom
in Angstrom
* Divider line
7) Charge initialization mode:

View File

@ -73,7 +73,7 @@ be included in a pair_coeff command.
The numerical values of the exponential decay constants in the
screening function depend on the unit of distance. In the above
equation they are given for units of angstroms. LAMMPS will
equation they are given for units of Angstroms. LAMMPS will
automatically convert these values to the distance unit of the
specified LAMMPS :doc:`units <units>` setting. The values of Z should
always be given as multiples of a proton's charge, e.g. 29.0 for

View File

@ -221,7 +221,7 @@ impropers, and dihedrals can be computed on this innermost 0.5 fs
step. The outermost timestep cannot be greater than 4.0 fs without
risking energy drift. Smooth switching of forces between the levels
of the rRESPA hierarchy is also necessary to avoid drift, and a 1-2
angstrom "healing distance" (the distance between the outer and inner
Angstrom "healing distance" (the distance between the outer and inner
cutoffs) works reasonably well. We thus recommend the following
settings for use of the *respa* style without SHAKE in biomolecular
simulations:
@ -277,7 +277,7 @@ Even a LJ system can benefit from rRESPA if the interactions are
divided by the inner, middle and outer keywords. A 2-fold or more
speedup can be obtained while maintaining good energy conservation.
In real units, for a pure LJ fluid at liquid density, with a sigma of
3.0 angstroms, and epsilon of 0.1 Kcal/mol, the following settings
3.0 Angstroms, and epsilon of 0.1 Kcal/mol, the following settings
seem to work well:
.. code-block:: LAMMPS

View File

@ -159,7 +159,6 @@ pygments_style = 'default'
# If true, keep warnings as "system message" paragraphs in the built documents.
#keep_warnings = False
# -- Options for HTML output ----------------------------------------------
# The theme to use for HTML and HTML Help pages. See the documentation for
@ -266,6 +265,16 @@ else:
# use relative path for mathjax, so it is looked for in the
# html tree and the manual becomes readable when offline
mathjax_path = 'mathjax/es5/tex-mml-chtml.js'
# hack to enable use of \AA in :math:
rst_prolog = r"""
.. only:: html
:math:`\renewcommand{\AA}{\text{Å}}`
"""
# -- Options for LaTeX output ---------------------------------------------
latex_elements = {
@ -278,6 +287,7 @@ latex_elements = {
# Additional stuff for the LaTeX preamble.
'preamble': r'''
\setcounter{tocdepth}{2}
\renewcommand{\AA}{\mbox{\textrm{\r{A}}}}
'''
}