ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* First try with context and mathml : not a success
@ 2002-11-06  7:17 David MARSAL
  2002-11-07  9:55 ` Tobias Burnus
  0 siblings, 1 reply; 2+ messages in thread
From: David MARSAL @ 2002-11-06  7:17 UTC (permalink / raw)


[-- Attachment #1: Type: text/plain, Size: 765 bytes --]

Good morning,

I have tried to compile the presentation "using-mathml.tex" from Tobias Burnus Eurotex 2001, which contains few mathml. 

I think I forget something in the installation procedure because the result is not
what I can see on the original pdf "http://www.ntg.nl/eurotex/burnus.pdf"

I give in attachement 
- the tex file I downloaded  : "using-mathml.tex" or "http://www.ntg.nl/eurotex/using-mathml.tex"
- the pdf I get using : "texexec -pdf using-mathml.tex" : "using-mathml.pdf"
- and the log file : "using-mathml.log"

About the font problem, I don't really care for my first try, but maybe it's linked with my problem ...
Last but not least, I am running Context under Debian GNU/Linux Unstable (updated yesterday)

Thank you very much for you help.

[-- Attachment #2: using-mathml.tex --]
[-- Type: text/x-tex, Size: 6716 bytes --]

%interface=en
% EuroTeX 2001 Kerkrade
% Using MATHML for paper and web publishing
% Tobias Burnus

\usemodule[pre-fuzzy]
\usemodule[abr-pseudocaps]
\usemodule[mathml]

\def\MATHML{MathML}



\starttext

\StartTitlePage
{\small Euro\TeX2001 Kerkrade}
\blank
Usage of \MATHML\ for paper and web publishing
\blank
\small Tobias Burnus
\StopTitlePage



\Topic{The pre-\MATHML\ situation}

\Subject{\TeX}
This is the method used by the most (all) of those sitting here.

{\bf Good:}
\startitemize
\item Easy to type in
\item Wide spread
\item Optimal quality
\item Can be easily shared as \PDF
\stopitemize

{\bf Bad:}
\startitemize
\item The \TEX\ code is not very standardised due to different packages and \LATEXTE\ vs. \CONTEXT
\item Can't be validated
\stopitemize

{\bf Ugly:}
\startitemize
\item \TEX\ to \HTML\ output using Images creates big, unreadable and not postprocessable files
\stopitemize


\Subject{Word processors and DTP programs}
{\bf Good:}
\startitemize
\item WYSIWG (well, nearly)
\item If you like clicking it is easy to create (or you have to learn yet another math language as in OpenOffice)
\stopitemize

{\bf Bad:}
\startitemize
\item You cannot pre- or postprocess it due to changing, binary and proprrietorial format
\stopitemize

{\bf Ugly:}
\startitemize
\item Frequently sub-optimal quality
\item Web output has the same problems as \TEX\ (if there exists an converter)
\stopitemize



\Topic{The brave new world}

\Subject{Promises}

The World Wide Web Consortium says that those goals are met by \MATHML\ (excerpt):
\startitemize
\item Encode mathematical material suitable for teaching and scientific communication at all levels.
\item Encode both mathematical notation and mathematical meaning.
\item Facilitate conversion to and from other mathematical formats, both presentational and semantic.
\item Be well suited to template and other mathematics editing techniques.
\item Be human legible, and simple for software to generate and process.
\stopitemize

But how does a language defined in such a way look like \dots


\page
\subject{\MATHML\ tiny sample}
Let's show how a simple formula in written in \MATHML. {\it We} \TeX{}ies write a mathematical formula as:

\startbuffer
\int_a^b f(x)\,{\rm d}x = F(b)-F(a)
\stopbuffer

\typebuffer

The mathematicians write it in these strange hieroglyphs:

\placeformula[-]
  \startformula
    \getbuffer
  \stopformula

And in \MATHML\ \dots


\page
\Subject{Presentational \MATHML}
In presentation markup of \MATHML it looks like this:

\startbuffer
<math>
  <mrow>
    <mrow>
       <msubsup><mo>&int;</mo><mi>a</mi><mi>b</mi></msubsup>
       <mrow><mi>f</mi><mo>&ApplyFunction;</mo>
          <mo>(</mo><mi>x</mi><mo>)</mo>
       </mrow>  <mo> &InvisibleTimes; </mo>
       <mrow>
         <mo>d</mo>
         <mi>x</mi>
       </mrow>
    </mrow>
    <mo>=</mo>
    <mrow>
      <mi>F</mi><mo>&ApplyFunction;</mo>
        <mrow><mo>(</mo><mi>b</mi><mo>)</mo></mrow>
      <mo>-</mo>
      <mi>F</mi><mo>&ApplyFunction;</mo>
        <mrow><mo>(</mo><mi>a</mi><mo>)</mo></mrow>
    </mrow>
  </mrow>
</math>
\stopbuffer

\typebuffer

\processXMLbuffer

In a more structured way \dots


\page
\Subject{Content \MATHML}

More beautiful the content markup:

\startbuffer
<math>
  <apply><eq/>
    <apply><int/>
      <bvar><ci>x</ci></bvar>
      <lowlimit><ci>a</ci></lowlimit>
      <uplimit><ci>b</ci></uplimit>
      <apply><fn><ci>f</ci></fn><ci>x</ci></apply>
    </apply>
    
    <apply><minus/>
      <apply><fn><ci>F</ci></fn><ci>b</ci></apply>
      <apply><fn><ci>F</ci></fn><ci>a</ci></apply>
    </apply>
  </apply>
</math>
\stopbuffer

\typebuffer

\processXMLbuffer



\Topic{Why content markup is that cool}


\Subject{Directives to change the layout}

The nice part of the encoding of meaning is that one can change the layout easily. Let's take this long fraction:

\startbuffer[sin-fraction]
<math>
<apply><approx/>
   <apply><sin/><ci>x</ci></apply>
   <apply><divide/>
       <ci>x</ci>
       <apply><divide/><cn>1</cn>
           <apply><divide/><cn>1</cn><cn>1</cn></apply>
       </apply>
   </apply>
</apply>
</math>
\stopbuffer

\typebuffer[sin-fraction]

Which looks as reasonable default:
% <?context-mathml-directive divide level 1?> (this is not 1 by default)
% <?context-mathml-directive function reduction yes?>

\processXMLbuffer[sin-fraction]

You can also display it as:

\startbuffer[directive-sin-fraction]
<?context-mathml-directive divide level 0?>
<?context-mathml-directive function reduction no?>
\stopbuffer

\processXMLbuffer[directive-sin-fraction,sin-fraction]

This is done by

\typebuffer[directive-sin-fraction]



\Topic{Usage}

\Subject{Why is presentational \MATHML\ used?}
Almost all programs which can write \MATHML\ files use presentational \MATHML.

\blank
This brings us to the question who produces \MATHML:

\startitemize
\item Mathematica. I tried 4.0 and it produces a wild \HTML+\MATHML\ mixture
   (4.01 should be better)
\item Maple 6 / Maple 7 (untried, Maple V R5.5 doesn't)
\item OpenOffice/StarOffice 6: Not very well but you guess that it will work in the final release
\item $\Omega$mega. This is the natural way to produce \MATHML\ files which then will be processed by \TeX
\stopitemize


\Subject{Other \MATHML\ renderers: Mozilla}
From the list on the \MATHML\ page at the World Wide Web Consortium you can see that there are not many programs which can render \MATHML, the number of those creating it is much higher.

\MATHML\ impressions:

\startitemize
\item For \HTML+\MATHML\ you need a special header (DOCTYPE) which is not standard conform and crashes some other \MATHML\ renderers
\item It is not enabled by default in Mozilla
\item Is has font problems: You need to have certain fonts installed
\item It has still some problems with Content \MATHML
\stopitemize



\Topic{Conclusions}

\Subject{The Good}

\startitemize
\item It is becoming a standard and \TeX\ can use it
\item Content markup allows you to setup the rendering in a consistent way
\item Presentational markup is very easy to create by a software
\item You can include literal \TeX\ using annotations
\stopitemize


\Subject{The Bad}

\startitemize
\item The documentation: It is not very clear and has some bugs in it
\item The presentation markup is frequently rather complicated and long
\item You need (and can $\Rightarrow$ good) intermix the content and presentation module
\item Viewers and editors are not widely spread
\stopitemize


\Subject{The Ugly}

\startitemize
\item The test cases on W3C are not only frequently contradictionual to the specification but also to other test cases in the same group -- That is not only ugly but also really BAD.
\stopitemize

\stoptext

[-- Attachment #3: using-mathml.pdf --]
[-- Type: application/pdf, Size: 49216 bytes --]

[-- Attachment #4: using-mathml.log --]
[-- Type: application/octet-stream, Size: 8554 bytes --]

This is pdfeTeX, Version 3.14159-1.00a-pretest-20011114-ojmw-2.1 (Web2C 7.3.7) (format=cont-en 2002.10.31)  5 NOV 2002 23:18
entering extended mode
**&cont-en using-mathml.tex
(./using-mathml.tex{/usr/share/texmf/pdftex/config/pdftex.cfg}

ConTeXt  ver: 2001.7.11  fmt: 2002.10.31  int: english  mes: english

language       : language en is active
system         : cont-new loaded
(/usr/share/texmf/tex/context/base/cont-new.tex
systems        : beware: some patches loaded from cont-new.tex!
system (E-TEX) : [line 202] \ifcsname 
)
system         : cont-old loaded
(/usr/share/texmf/tex/context/base/cont-old.tex
loading        : Context Old Macros
)
system         : cont-fil loaded
(/usr/share/texmf/tex/context/base/cont-fil.tex
loading        : Context File Synonyms
)
bodyfont       : 12pt rm is loaded
language       : patterns 2-en-2 2-uk-2 2-de-2 2-fr-2 loaded
specials       : tex,postscript,rokicki loaded
\openout2 = `using-mathml.tui'.

system         : using-mathml.top loaded
(./using-mathml.top
specials       : tex,postscript,rokicki is reset
specials       : loading definition file tpd
(/usr/share/texmf/tex/context/base/spec-tpd.tex <unprotect 2>
specials       : loading definition file fdf
(/usr/share/texmf/tex/context/base/spec-fdf.tex <unprotect 3> <unprotect 4>
<protect 4> <protect 3>)
specials       : fdf loaded
<unprotect 3> <protect 3> <protect 2>)
specials       : fdf,tpd loaded
) (./using-mathml.tuo) (./using-mathml.tuo) (./using-mathml.tuo)
(./using-mathml.tuo) (./using-mathml.tuo) (./using-mathml.tuo)
(./using-mathml.tuo) (./using-mathml.tuo) (./using-mathml.tuo)
(./using-mathml.tuo) (./using-mathml.tuo)
\openout1 = `mpgraph.mp'.


system         : macros of module pre-green loaded
(/usr/share/texmf/tex/context/base/s-pre-02.tex
system         : macros of module pre-general loaded
(/usr/share/texmf/tex/context/base/s-pre-00.tex <unprotect 2> <protect 2>
<unprotect 2> <protect 2> <unprotect 2> <protect 2>)
(/usr/share/texmf/tex/context/base/type-pre.tex
typescript     : [serif,sans,mono,math,handwriting] [lucida] [name,special]
(/usr/share/texmf/tex/context/base/type-syn.tex)
(/usr/share/texmf/tex/context/base/type-enc.tex)
(/usr/share/texmf/tex/context/base/type-siz.tex)
(/usr/share/texmf/tex/context/base/type-map.tex)
(/usr/share/texmf/tex/context/base/type-spe.tex
(/usr/share/texmf/tex/context/base/math-lbr.tex))
(/usr/share/texmf/tex/context/base/type-exa.tex)
typescript     : [serif,sans,mono,math,handwriting] [default] [size]
(/usr/share/texmf/tex/context/base/type-syn.tex)
(/usr/share/texmf/tex/context/base/type-enc.tex)
(/usr/share/texmf/tex/context/base/type-siz.tex)
(/usr/share/texmf/tex/context/base/type-map.tex)
(/usr/share/texmf/tex/context/base/type-spe.tex)
(/usr/share/texmf/tex/context/base/type-exa.tex))
color          : rgb color space is supported
color          : cmyk color space is supported
color          : mpcmyk color space is supported
color          : system rgb is global activated
interaction    : active
system         : mark Topic defined [chapter]
system         : mark Topicnumber defined [chapternumber]
system         : mark Subject defined [section]
system         : mark Subjectnumber defined [sectionnumber]
system         : mark Nopic defined [title]
system         : mark Nopicnumber defined [titlenumber]
)
system         : macros of module abr-pseudocaps loaded
(/usr/share/texmf/tex/context/base/s-abr-01.tex
check          : logo AMSTEX replaces a macro, use CAPITALS!
check          : logo CONTEXT replaces a macro, use CAPITALS!
check          : logo ETEX replaces a macro, use CAPITALS!
check          : logo LAMSTEX replaces a macro, use CAPITALS!
check          : logo LATEX replaces a macro, use CAPITALS!
check          : logo MATHML replaces a macro, use CAPITALS!
check          : logo METAFONT replaces a macro, use CAPITALS!
check          : logo METAPOST replaces a macro, use CAPITALS!
check          : logo PDFETEX replaces a macro, use CAPITALS!
check          : logo PDFTEX replaces a macro, use CAPITALS!
check          : logo PICTEX replaces a macro, use CAPITALS!
check          : logo PPCHTEX replaces a macro, use CAPITALS!
check          : logo PRAGMA replaces a macro, use CAPITALS!
check          : logo TABLE replaces a macro, use CAPITALS!
check          : logo TEXADRES replaces a macro, use CAPITALS!
check          : logo TEXEDIT replaces a macro, use CAPITALS!
check          : logo TEXEXEC replaces a macro, use CAPITALS!
check          : logo TEXFORM replaces a macro, use CAPITALS!
check          : logo TEXSPELL replaces a macro, use CAPITALS!
check          : logo TEXUTIL replaces a macro, use CAPITALS!
check          : logo TEX replaces a macro, use CAPITALS!
check          : logo XML replaces a macro, use CAPITALS!
)
system         : macros of module mathml loaded
(/usr/share/texmf/tex/context/base/m-mathml.tex
xml            : loading module ent
xml            : loading module mml
(/usr/share/texmf/tex/context/base/xtag-mml.tex
(/usr/share/texmf/tex/context/base/xtag-map.tex
loading        : Context XML Macros (remap)
)
loading        : Context XML Macros (math ml)
)
xml            : loading module mmp
(/usr/share/texmf/tex/context/base/xtag-mmp.tex
loading        : Context XML Macros (presentational math ml)
)
xml            : loading module mmc
(/usr/share/texmf/tex/context/base/xtag-mmc.tex
loading        : Context XML Macros (content math ml)
)) (./using-mathml.tuo) (./using-mathml.tuo)
systems        : begin file using-mathml at line 14
\openout1 = `mpgraph.mp'.

Randomizer initialized to 1637089478. [MP to PDF mpgraph.1] (./mpgraph.1)
(./using-mathml.tuo)
references     : unknown reference [][Topics]
[MP to PDF mpgraph.2] (./mpgraph.2) [MP to PDF mpgraph.3] (./mpgraph.3)
[MP to PDF mpgraph.4] (./mpgraph.4)
layout         : calculating backgrounds
[MP to PDF mpgraph.5] (./mpgraph.5)
interaction    : pdftex code inserted
interaction    : aspect ratio 600.0 x 450.0 (b x h)
[1.1{/usr/share/texmf/dvips/config/pdftex.map}]
Topic          : - The pre-\MATHML \ situation
(./using-mathml.tuo) (./using-mathml.tuo) [2.1]
Subject        : - \TeX 
[3.2] [4.3]
Subject        : - Word processors and DTP programs
[5.4]
Topic          : - The brave new world
(./using-mathml.tuo) (./using-mathml.tuo) [6.5]
Subject        : - Promises
[7.6]
subject        : - \MATHML \ tiny sample
<using-mathml.tmp>
\openout4 = `using-mathml.tmp'.

 (./using-mathml.tmp) [8.7]
Subject        : - Presentational \MATHML 
<using-mathml.tmp>
\openout4 = `using-mathml.tmp'.

 [9.8] (./using-mathml.tmp) [10.9]
Subject        : - Content \MATHML 
<using-mathml.tmp>
\openout4 = `using-mathml.tmp'.

 [11.10] (./using-mathml.tmp) [12.11]
Topic          : - Why content markup is that cool
(./using-mathml.tuo) (./using-mathml.tuo) [13.12]
Subject        : - Directives to change the layout
<sin-fraction.tmp>
\openout4 = `sin-fraction.tmp'.

 (./sin-fraction.tmp [14.13]) <directive-sin-fraction.tmp>
\openout4 = `directive-sin-fraction.tmp'.


(./directive-sin-fraction.tmp) (./sin-fraction.tmp) [15.14]
Topic          : - Usage
(./using-mathml.tuo) (./using-mathml.tuo) [16.15]
Subject        : - Why is presentational \MATHML \ used?
[17.16]
Subject        : - Other \MATHML \ renderers: Mozilla
[18.17]
Topic          : - Conclusions
(./using-mathml.tuo) (./using-mathml.tuo) [19.18]
Subject        : - The Good
[20.19]
Subject        : - The Bad
[21.20]
Subject        : - The Ugly
[22.21]
systems        : end file using-mathml at line 275
[flush and process mpgraph.mp afterwards] ) 
Here is how much of TeX's memory you used:
 3760 strings out of 27923
 48972 string characters out of 330492
 392233 words of memory out of 1500001
 28666 multiletter control sequences out of 10000+40000
 35195 words of font info for 86 fonts, out of 400000 for 1000
 22 hyphenation exceptions out of 1000
 72i,26n,163p,759b,2260s stack positions out of 1500i,500n,1500p,50000b,5000s

Warning: pdfetex (file lbme.pfb): cannot open Type 1 font file for reading
{/usr/share/texmf/dvips/base/texnansi.enc}
Warning: pdfetex (file lstr.pfb): cannot open Type 1 font file for reading

Warning: pdfetex (file lbi.pfb): cannot open Type 1 font file for reading

Warning: pdfetex (file lbmo.pfb): cannot open Type 1 font file for reading

Warning: pdfetex (file lbms.pfb): cannot open Type 1 font file for reading

Warning: pdfetex (file lbd.pfb): cannot open Type 1 font file for reading

Warning: pdfetex (file lbr.pfb): cannot open Type 1 font file for reading
Output written on using-mathml.pdf (22 pages, 49216 bytes).

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: First try with context and mathml : not a success
  2002-11-06  7:17 First try with context and mathml : not a success David MARSAL
@ 2002-11-07  9:55 ` Tobias Burnus
  0 siblings, 0 replies; 2+ messages in thread
From: Tobias Burnus @ 2002-11-07  9:55 UTC (permalink / raw)


Hi,

David MARSAL wrote:
> I think I forget something in the installation procedure because the result is not
> what I can see on the original pdf "http://www.ntg.nl/eurotex/burnus.pdf"
You somehow seem to have used the presentation style "pre-green"
("pre-02", "s-pre-02.tex") whereas I have used "pre-fuzzy" (alias
pre-05, s-pre-05.tex).

Since pre-green uses Lucida Bright fonts which are not free, this causes
the font problems which are probably your problem.

Can you try to use
  \definefilesynonym [font-lbr] [font-cmr]
(which should use Computer Modern fonts instead)
or
  \usemodule[pre-05]
instead of
  \usemodule[pre-fuzzy]
(which should actually be the same; pre-fuzzy doesn't use "lbr" but
"cmr").

Tobias

PS: The file you attached is not exactly the same as on the NTG page, a
'>' crept in
after line 231 (after \Subject{Other \MATHML\ renderers: Mozilla}),
but this shouldn't cause the problems.

-- 
This above all: To thine own self be true / And it must follow as
the night the day / Thou canst not then be false to any man.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2002-11-07  9:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-11-06  7:17 First try with context and mathml : not a success David MARSAL
2002-11-07  9:55 ` Tobias Burnus

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).