|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.h2b.taglets.InlineTaglet
de.h2b.taglets.mathlets.MathTaglet
@ClassLabel(copyright="Copyright (C) 2008 Hans-Hermann Bode", ident="$Id: MathTaglet.java,v 1.10 2008/12/25 17:01:55 h2b Exp $") public class MathTaglet
An inline taglet for typesetting mathematical formulas.
The @math
tag has three variants that allow to include a formula
as a graphics or MathML file, as inline MathML or as plain HTML,
respectively.
The first variant has the general form
{@math
attributes file:path}.
The file: indicator is mandatory for this variant and must
immediately be followed by a path specification. The taglet will
produce an HTML <object/>
element to embed the given file and
commit any attributes to it. For example, to include a graphics file
you can write {@math style="vertical-align:text-bottom"
file:doc-files/example1.gif}
which yields . In the
same way you can include an XHTML file containing MathML code by
{@math height="45" file:doc-files/example1.xhtml}
resulting in
(Your browser might not be capable to show that, see below.)
The second variant has the general form
{@math
attributes <mml:...}.
The attributes have the same meaning as above and this time are
followed by a
valid MathML expression where all MathML elements have to be in the
mml namespace. As a matter of principle, both presentation math
and content math are possible, but not all browsers can handle MathML.
While some can process presentation mode natively, others may need some
plugin to work properly; regarding to content mode, I haven't seen any
browser that can do it, yet. Anyway, you will notice that for each
expression a file will be created in the apidocs directory.
For instance,
{@math height="45"
<mml:msup>
<mml:msqrt>
<mml:mrow>
<mml:mi>x</mml:mi>
<mml:mo>+</mml:mo>
<mml:mi>y</mml:mi>
</mml:mrow>
</mml:msqrt>
<mml:mn>3</mml:mn>
</mml:msup>}
produces the result
(Again, if your browser does not allow for MathML presentation mode, you will not see the result.)
The third variant has the general form
{@math
formula}.
In this case, you are using plain HTML to write down the formula,
where some substitutions take place for convenience.
{@math ln x}
results in ln x.
{@math `d y/`d x}
results in d y/d x.
{@math \forall \epsilon \gt 0}
results in
∀ ε > 0.
Notice that the italicizing behaviour here principally is intended to
affect Greek letters. If the non-italic variant is needed, the normal
HTML coding can be used (e.g., π
for π).
{@math a_{i+1}-a_i}
results in ai+1-ai.
{@math a^{i+1}-a^i}
results in
ai+1-ai.
Field Summary | |
---|---|
static java.lang.String |
PREFIX_FILE
Indicates file processing. |
static java.lang.String |
PREFIX_MATHML
Indicates MathML processing. |
static java.lang.String |
SUBDIR_MATHML
Name of subdirectory for generated MathML files. |
Constructor Summary | |
---|---|
MathTaglet()
Creates this taglet. |
Method Summary | |
---|---|
java.lang.String |
getName()
Returns the name of this custom tag. |
static void |
register(java.util.Map tagletMap)
Deprecated. Use central registration of Registration instead. |
java.lang.String |
toString(com.sun.javadoc.Tag tag)
Returns the processed text of the tag. |
Methods inherited from class de.h2b.taglets.InlineTaglet |
---|
inConstructor, inField, inMethod, inOverview, inPackage, inType, isInlineTag, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String PREFIX_FILE
public static final java.lang.String PREFIX_MATHML
public static final java.lang.String SUBDIR_MATHML
Constructor Detail |
---|
public MathTaglet()
Method Detail |
---|
@Deprecated public static void register(java.util.Map tagletMap)
Registration
instead.
tagletMap
- the map to register this tag topublic java.lang.String getName()
InlineTaglet
getName
in interface com.sun.tools.doclets.Taglet
getName
in class InlineTaglet
public java.lang.String toString(com.sun.javadoc.Tag tag)
If tag
contains the PREFIX_FILE
string, a file-based
processing will be done. Otherwise, if tag
contains the
PREFIX_MATHML
string, a MathML-based processing will be done.
If none of these conditions apply, a plain HTML-based processing
will occur. Prefixes are case-sensitive.
toString
in interface com.sun.tools.doclets.Taglet
toString
in class InlineTaglet
tag
- the tag to be processed
InlineTaglet.toString(com.sun.javadoc.Tag)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |