Blame doc/formulas.doc

Packit 1c1d7e
/******************************************************************************
Packit 1c1d7e
 *
Packit 1c1d7e
 * 
Packit 1c1d7e
 *
Packit 1c1d7e
 * Copyright (C) 1997-2015 by Dimitri van Heesch.
Packit 1c1d7e
 *
Packit 1c1d7e
 * Permission to use, copy, modify, and distribute this software and its
Packit 1c1d7e
 * documentation under the terms of the GNU General Public License is hereby 
Packit 1c1d7e
 * granted. No representations are made about the suitability of this software 
Packit 1c1d7e
 * for any purpose. It is provided "as is" without express or implied warranty.
Packit 1c1d7e
 * See the GNU General Public License for more details.
Packit 1c1d7e
 *
Packit 1c1d7e
 * Documents produced by Doxygen are derivative works derived from the
Packit 1c1d7e
 * input used in their production; they are not affected by this license.
Packit 1c1d7e
 *
Packit 1c1d7e
 */
Packit 1c1d7e
/*! \page formulas Including formulas 
Packit 1c1d7e
Packit 1c1d7e
Doxygen allows you to put \LaTeX formulas in the
Packit 1c1d7e
output (this works only for the HTML and \LaTeX output, 
Packit 1c1d7e
not for the RTF nor for the man page output). To be able to include 
Packit 1c1d7e
formulas (as images) in the HTML documentation, you will also need to 
Packit 1c1d7e
have the following tools installed
Packit 1c1d7e
    Packit 1c1d7e
  • \c latex: the \LaTeX compiler, needed to parse the formulas.
  • Packit 1c1d7e
        To test I have used the teTeX 1.0 distribution.
    Packit 1c1d7e
  • \c dvips: a tool to convert DVI files to PostScript files
  • Packit 1c1d7e
        I have used version 5.92b from Radical Eye software for testing.
    Packit 1c1d7e
  • \c gs: the GhostScript interpreter for converting PostScript files
  • Packit 1c1d7e
        to bitmaps. I have used Aladdin GhostScript 8.0 for testing.
    Packit 1c1d7e
    Packit 1c1d7e
    For the HTML output there is also an alternative solution using
    Packit 1c1d7e
    MathJax which does not
    Packit 1c1d7e
    require the above tools. If you enable \ref cfg_use_mathjax "USE_MATHJAX" in
    Packit 1c1d7e
    the config then the latex formulas will be copied to the HTML "as is" and a
    Packit 1c1d7e
    client side javascript will parse them and turn them into (interactive) images.
    Packit 1c1d7e
    Packit 1c1d7e
    There are three ways to include formulas in the documentation.
    Packit 1c1d7e
      Packit 1c1d7e
    1. Using in-text formulas that appear in the running text.
    2. Packit 1c1d7e
          These formulas should be put between a pair of \\f\$ 
      Packit 1c1d7e
          commands, so
      Packit 1c1d7e
      \verbatim
      Packit 1c1d7e
        The distance between \f$(x_1,y_1)\f$ and \f$(x_2,y_2)\f$ is 
      Packit 1c1d7e
        \f$\sqrt{(x_2-x_1)^2+(y_2-y_1)^2}\f$.
      Packit 1c1d7e
      \endverbatim results in:
      Packit 1c1d7e
      Packit 1c1d7e
        The distance between \f$(x_1,y_1)\f$ and \f$(x_2,y_2)\f$ is 
      Packit 1c1d7e
        \f$\sqrt{(x_2-x_1)^2+(y_2-y_1)^2}\f$.
      Packit 1c1d7e

      Packit 1c1d7e
    3. Unnumbered displayed formulas that are centered on a separate line.
    4. Packit 1c1d7e
          These formulas should be put between \\f[ and \\f] commands.
      Packit 1c1d7e
          An example:
      Packit 1c1d7e
      \verbatim
      Packit 1c1d7e
        \f[
      Packit 1c1d7e
          |I_2|=\left| \int_{0}^T \psi(t) 
      Packit 1c1d7e
                   \left\{ 
      Packit 1c1d7e
                      u(a,t)-
      Packit 1c1d7e
                      \int_{\gamma(t)}^a 
      Packit 1c1d7e
                      \frac{d\theta}{k(\theta,t)}
      Packit 1c1d7e
                      \int_{a}^\theta c(\xi)u_t(\xi,t)\,d\xi
      Packit 1c1d7e
                   \right\} dt
      Packit 1c1d7e
                \right|
      Packit 1c1d7e
        \f]
      Packit 1c1d7e
      \endverbatim
      Packit 1c1d7e
        results in:
      Packit 1c1d7e
        \f[
      Packit 1c1d7e
          |I_2|=\left| \int_{0}^T \psi(t) 
      Packit 1c1d7e
                   \left\{ 
      Packit 1c1d7e
                      u(a,t)-
      Packit 1c1d7e
                      \int_{\gamma(t)}^a 
      Packit 1c1d7e
                      \frac{d\theta}{k(\theta,t)}
      Packit 1c1d7e
                      \int_{a}^\theta c(\xi)u_t(\xi,t)\,d\xi
      Packit 1c1d7e
                   \right\} dt
      Packit 1c1d7e
                \right|
      Packit 1c1d7e
        \f]
      Packit 1c1d7e
    5. Formulas or other latex elements that are not in a math
    6. Packit 1c1d7e
          environment can be specified using \\f{environment}, where
      Packit 1c1d7e
          \c environment is the name of the \LaTeX environment, 
      Packit 1c1d7e
          the corresponding end command is \\f}. Here is an example for an 
      Packit 1c1d7e
          equation array
      Packit 1c1d7e
      \verbatim
      Packit 1c1d7e
         \f{eqnarray*}{
      Packit 1c1d7e
              g &=& \frac{Gm_2}{r^2} \\ 
      Packit 1c1d7e
                &=& \frac{(6.673 \times 10^{-11}\,\mbox{m}^3\,\mbox{kg}^{-1}\,
      Packit 1c1d7e
                    \mbox{s}^{-2})(5.9736 \times 10^{24}\,\mbox{kg})}{(6371.01\,\mbox{km})^2} \\ 
      Packit 1c1d7e
                &=& 9.82066032\,\mbox{m/s}^2
      Packit 1c1d7e
         \f}
      Packit 1c1d7e
      \endverbatim
      Packit 1c1d7e
        which results in:
      Packit 1c1d7e
         \f{eqnarray*}
      Packit 1c1d7e
              g &=& \frac{Gm_2}{r^2} \\ 
      Packit 1c1d7e
                &=& \frac{(6.673 \times 10^{-11}\,\mbox{m}^3\,\mbox{kg}^{-1}\,
      Packit 1c1d7e
                    \mbox{s}^{-2})(5.9736 \times 10^{24}\,\mbox{kg})}{(6371.01\,\mbox{km})^2} \\ 
      Packit 1c1d7e
                &=& 9.82066032\,\mbox{m/s}^2
      Packit 1c1d7e
         \f}
      Packit 1c1d7e
      Packit 1c1d7e
      For the first two commands one should make sure formulas contain 
      Packit 1c1d7e
      valid commands in \LaTeX's math-mode. For the third command
      Packit 1c1d7e
      the section should contain valid command for the specific environment.
      Packit 1c1d7e
      Packit 1c1d7e
      \warning Currently, doxygen is not very fault tolerant in recovering 
      Packit 1c1d7e
      from typos in formulas. It may be necessary to remove the
      Packit 1c1d7e
      file formula.repository that is written to the html directory to 
      Packit 1c1d7e
      get rid of an incorrect formula.
      Packit 1c1d7e
      Packit 1c1d7e
      \htmlonly
      Packit 1c1d7e
      Go to the next section or return to the
      Packit 1c1d7e
       index.
      Packit 1c1d7e
      \endhtmlonly
      Packit 1c1d7e
      Packit 1c1d7e
      */