axiom-developer
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Axiom-developer] Re: converting sexps to XML


From: Ralf Hemmecke
Subject: Re: [Axiom-developer] Re: converting sexps to XML
Date: Wed, 29 Jun 2005 13:56:28 +0200
User-agent: Mozilla Thunderbird 1.0 (X11/20041206)

I know a normal LaTeX user wouldn't do that but I am just wondering whether AsTeX correctly outputs

  ac

(no equals sign, no b, no d) if I select the align* environment from the following file.

\documentclass{article}
\usepackage{amsmath}
\catcode`\&=14% & is now a character introducing a comment like %.
\begin{document}
\begin{align*}
  a&=b\\
  c&=d\\
\end{align*}
\end{document}

TeX is a programming language. No character has a fixed meaning. One can even redefine \ (backslash). Any parser of LaTeX code that is not TeX (the program) itself will sooner or later run into trouble. The only way out would be to restrict to some subset of (La)TeX.

Ralf

address@hidden wrote:
Hello Bob,

On 28 Jun 2005 at 13:26, Bob McElrath wrote:


I think these two ideas are very distinct.  A latex document is
processed from top to bottom, once.  A change requires essentially a
re-compile of the entire document.


I don't agree with you on that point : I have devised a software (AsTeX assistant) that allows to tune parts of TeX/LateX documents by selecting small portions of the document and displaying it without compiling the whole document - for example select a formula or part of formula, or part of a table - and display only the formula, or part of the formula or table or etc.. You have just to select the portion of document in your favorite editor (Emacs, or any other editor, even Word), click on the Display button of AA, and the selected portion is displayed in the dvi viewing window. You can even use predefined commands such as \def\g{\gamma} defined outside the selected text (say, defined in a special file such as mymacros.tex), or commands defined in LaTeX packages. For illustrations, cf.

http://www.univ-orleans.fr/EXT/ASTEX/astex/doc/fr/nouv31a/html/nouv31.htm

for part of a table + included figure + colored maths, and

http://www.univ-orleans.fr/EXT/ASTEX/astex/doc/fr/assist/html/aase7.htm

for part of a formula.

Of course, if one forces incorrect commands or undefined commands inside the selected portion, the display is incorrect, in the same way as the result is incorrect if one forces an incorrect command or undefine variable in Axiom, or Maxima, or other interactive software. AA was presented at TUG2000 in Oxford, and various other places.


Syntactic validity cannot be
ensured in a sub-document of latex.  (e.g. I could insert
"\end{paragraph}" in the middle of my paragraph...causing the parser
to totally barf) On the other hand XML has the concept of a DOM, which allows me to
examine nodes individually, add/remove nodes, and modify the text
inside a node, all in a self-contained manner.


I think one ought to compare what is comparable : it seems that you consider the possibility to write an incorrect LaTeX document by omitting \end{paragraph} in a dumb editor (say notepad under Windows) ? Well, OK, but I cannot see what would prevent me from writing an incorrect XML document with the same editor ? It seems to me that, either one uses a dumb editor and run an external software to check the validity of the TeX or XML document, or one uses a specialized editor for TeX or XML that prevents most or all errors. If one uses LyX, one cannot introduce syntactic errors such as trailing \end{paragraph} (except if one does it on purpose - but one could create a version that forbids it). If one uses Emacs with AUC-TeX, or any editor + AsTeX assistant to insert TeX/LaTeX commands, or other "intelligent editors", one gets a mostly syntactically correct document with the existing softwares ("mostly" in the sense that errors would have a human origin, not because of TeX or the editor used). One could even have an always syntactically correct document with more effort (at least with AA, I had not the time to do it but the plan is there). And if there are XML constructions that do not exist in LaTeX, I suppose it could be possible to add commands in LaTeX that implement them, in the same way LaTeX builds on Plain TeX by adding \begin{} \end{}, \tableofcontents etc., and builds on PostScript via \special{} to implement color (although TeX knows only of B&W), or figures, rotations, etc. I would be very astonished if one could prove that it is impossible to implement the DOM concept, or other XML concepts, in LaTeX ?

Best address@hidden
http://www.univ-orleans.fr/EXT/ASTEX
ftp://ftp.univ-orleans.fr/pub/tex/PC/AsTeX
liste de discussion: address@hidden
Abonnement à la liste: envoyer un message de contenu
"sub astex Nom Prenom Etablissement" à address@hidden



_______________________________________________
Axiom-developer mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/axiom-developer





reply via email to

[Prev in Thread] Current Thread [Next in Thread]