On Thu, 2 Dec 1999, Andre' Poenitz wrote:
> > Yup. Even more sense in an XML world.
>
> How would a LyX file format look like in an XML world?
That would be up to us.
> Something like MathML?
That wouldn't be a bad idea, for example. Best not to reinvent the wheel.
But, AFAIK, MathML is only for the math bits. So maybe a hypothetical
LyXML would use MathML entities inside <math> sections, but other stuff
elsewhere.
> Anybody with working experience?
> Does anybody know of a .tex -> .mml translator?
Don't know of one. They're not possible, in general, of course - TeX is a
vastly more powerful format.
I was thinking of a more simple direct translation of our current format.
Consider this fragment of a real LyX file (I have deleted the blank lines
to take up less space)
---- lyx file fragment
\layout Section
Definitions and Examples
\layout Definition
A
\emph on
category
\emph default
\begin_inset Formula \( \mathcal{C} \)
\end_inset
is:
\begin_deeper
\layout Itemize
a collection of
\emph on
objects
\emph default
,
\begin_inset Formula \( \ob \mathcal{C} \)
\end_inset
\layout Itemize
a collection of
\emph on
morphisms
\emph default
,
---- end fragment
---- proto lyxml fragment
<section title="Definitions and Examples">
<theorem type="Definition">
A
<emph>category</emph>
<inset><math><mathcal>C</mathcal></math></inset>
is:
<itemize>
<item>a collection of <emph>objects</emph>,
<inset><math>\ob <mathcal>C</mathcal></inset>
</item>
<item>a collection of <emph>morphisms</emph>,
</item>
-----
Note that:
We don't need the begin_deeper cruft. Nesting is made an obvious part of
the format.
The format is slightly more concise, and (IMO) easier to read.
I don't know if backslashes are legal XML. If not, \ob (which is a
user-defined \def) needs to be escaped somehow; perhaps as <macro
name="ob"> or similar.
Jules
/----------------+-------------------------------+---------------------\
| Jelibean aka | [EMAIL PROTECTED] | 6 Evelyn Rd |
| Jules aka | [EMAIL PROTECTED] | Richmond, Surrey |
| Julian Bean | [EMAIL PROTECTED] | TW9 2TF *UK* |
+----------------+-------------------------------+---------------------+
| War doesn't demonstrate who's right... just who's left. |
| When privacy is outlawed... only the outlaws have privacy. |
\----------------------------------------------------------------------/