On Jun 10, 9:06 pm, Lex Trotman <[email protected]> wrote:
> Hi David,
>
> Sorry, xhtml11.conf
>
> Seehttp://www.methods.co.nz/asciidoc/userguide.html#X27
>
> Cheers
> Lex
>
> PS Please keep replies on list so others people can learn too
> (especially if you are evangelizing MathJax :-)
For users that intend to frequently produce a significant number of
pages with displayed math expression using MathJax, editing the
relevant .conf files for the backend being used may be a useful
workaround to editing the (X)HTML output file.
As an example, the .conf files on my system are located in
the /usr/local/etc/asciidoc/ folder. To find where these
files are located on your system include a -v to the
asciidoc(1) command as in:
asciidoc -v -b xhtml11 mathjax.txt
This usage will list the location of the .conf files being used
by asciidoc(1) for the backend and source text file.
Editing the [header] section of the xhtml11.conf to include
something like the following:
[header]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="{lang=en}">
<head>
<meta http-equiv="Content-Type" content="{quirks=application/xhtml+xml}
{quirks?text/html}; charset={encoding}" />
<meta name="generator" content="AsciiDoc {asciidoc-version}" />
<meta name="description" content="{description}" />
<meta name="keywords" content="{keywords}" />
<script type="text/x-mathjax-config">
MathJax.Hub.Config({tex2jax: {inlineMath: [['$','$'], ['\\(','\
\)']]}});
</script>
<script type="text/javascript"
src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-
MML_HTMLorMML">
</script>
<title>{title}</title>
...
will result in the MathJax script information being included in the
header
of the (X)HTML output file. However, it turns out that asciidoc(1)
does
not like the tex2jax: reference of the first <script> segment of code
and
returns a warning similar to:
WARNING: mathmath.txt: line 4: illegal system attribute name: tex2jax
This results in this entire line:
MathJax.Hub.Config({tex2jax: {inlineMath: [['$','$'], ['\\(','\
\)']]}});
being omitted from the head section and instead there is nothing
between the <script></script> tags for this line -- asciidoc merely
skips this line.
The second script reference of:
<script type="text/javascript"
src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-
MML_HTMLorMML">
</script>
is included without error.
So if it is necessary to include this first script reference to modify
inline-math delimiters as shown above, then it appears that until the
source of this anomaly is determined, editing the (X)HTML source
output file produced by asciidoc(1) is the best solution.
If the MathJax default delimiters are sufficient, then this is not
an issue. Simply omit this and add only:
<script type="text/javascript"
src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-
MML_HTMLorMML">
</script>
to the relevant .conf file.
If multiple backends are involved, then the .conf file for these will
have to be
edited also.
The best long-term solution to this is to include a -a mathjax
attribute for
the asciidoc(1) command that adds the MathJax script code without
resorting
to these edits. The best way in my opinion to do that is by using an
"include"
file with the MathJax script code as its contents. This file could
then be
edited by the user as required for their needs. This assumes there is
enough
interest in having this option by Asciidoc users to justify the time
and
effort to make these changes and update the documentation. It also
assumes
that the above referenced anomaly can be remedied.
In my opinion the MathJax Javascript package is superior to the
LaTexMathML Javascript file for rendering math expression
in (X)HTML files. Its adoption requires little or no changes
to the current Asciidoc LatexMathML markup using latexmath
passthroughs. The MathJax project appears to be ongoing and
supported. There is some question about the LaTeXMathML
support, as Dr. Wooley (2007) has retired and is no longer
"maintaining this program" and the latest Version 1.4.7 Dec 15, 2005
by Peter Jipsen is over 5 years old.
David
--
You received this message because you are subscribed to the Google Groups
"asciidoc" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/asciidoc?hl=en.