Source files | Example of usage

EQNUM

The EQNUM script provides the functions eqdef($tag) and eqref($tag) for the automatic generation and referencing of equation numbers in XHTML code, roughly in line with cross referencing in plain TeX. The input argument $tag is a text label 'tagging' the equation, leaving the actual equation numbering decoupled from the running text, thus enabling easily incorporated additions later on without the need for manually re-ordering the references. The eqdef($tag) and eqref($tag) functions provide the server-side engine for the automatic generation of all equation numbers of mathematical hypertext documents found at jonsson.eu.

Current revision

Revision 1.0, as of 20/06/2011. Copyright © Fredrik Jonsson 2011, under GPL

Source files

eqnum.php [3 kB] The entire PHP code for the eqdef($tag) and eqref($tag) functions, containing all necessary routines in one single file.
[ download | view source ]

Example of usage

(Example taken from http://jonsson.eu/research/lectures/lect1/web/)



    <?php include "eqnum.php"; ?>
    <p>
    From an all-classical point-of-view, the calculation of the
    electric polarization density of metals and plasmas, containing
    a free electron gas, can be performed using the model of free
    charges acting under the Lorenz force of an electromagnetic field,
    </p>
    <div class="center">
    <img class="center" src="lect1_eq_disp_001.png"
     alt="Some text describing the equation, e.g. TeX-code" />
    <?php eqdef("lorentz_motion"); ?>
    </div>
    <p>
    where <b>E</b>(<i>t</i>) and <b>B</b>(<i>t</i>) are all-classical
    electric and magnetic fields of the electromagnetic field of the
    light. In forming the equation <?php eqref("lorentz_motion"); ?>
    for the motion of the electron, the origin was chosen to coincide
    with the center of the nucleus.
    </p>


which produces the following:

"From an all-classical point-of-view, the calculation of the electric polarization density of metals and plasmas, containing a free electron gas, can be performed using the model of free charges acting under the Lorenz force of an electromagnetic field,

$$m_{\rm e}{{d^2{\bf r}_{\rm e}}\over{dt^2}}
=-e{\bf E}(t)-e{{d{\bf r}_{\rm e}}\over{dt}}\times{\bf B}(t),$$ (1)

where E(t) and B(t) are all-classical electric and magnetic fields of the electromagnetic field of the light. In forming the equation (1) for the motion of the electron, the origin was chosen to coincide with the center of the nucleus."

Tillbaka till föregående sida

Lämna ett meddelande

Ditt namn:

Din epost-adress: (obligatorisk)

Meddelande:

Generated by ::emailform::

Senast modifierad Saturday 25 Jun 2011
Denna sajt är XHTML 1.0 Strict