lout-users
[Top][All Lists]
Advanced

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

Spellchecking Lout (Re: GUI for Lout)


From: Gordon Deane
Subject: Spellchecking Lout (Re: GUI for Lout)
Date: Wed, 7 Jun 2000 17:25:37 +1000 (EST)

Hi Steven, all;

> Another project, which will aid this one, that I will be working on in
> parallel is hacking ispell to support Lout the way it supports TeX.
> Although I haven't studied it yet, I assume making a hack for the Lout
> format will be trivial since it's already been done for TeX... :)

Er, not quite as easy as that.  I ispell-TeX relies on the fact that all TeX
symbols start with \.  (See below).  Lout commands start with '@', but their
named parameters are not necessarily so distinguished. Consider the legal 
(but slightly artificial) Lout

 @MyGraphSymbol
   caption { spellling error } # Nice to spell check thisB
   parameter { xticks }  # Can't spell check symbolic arguments
   { 
 @MyBold
   caption {gratuitous braces}  # Caption is text we want boldened
   }

'Special casing' the standard Lout packages would be a major quantity of work
and still not get it right for user definitions. A better way would be to
actually run the Lout parser over the document in some fashion. 

One trick I've used in the past is to format the document as text with no 
hyphenation, and ispell that.  It finds spelling errors quite well, but 
you have to find the relevant point in the source by hand and this might 
be difficult to automate.


For reference, I quote the ispell man-page: 


"In TeX/LaTeX mode, whenever a backslash ("\") is found, ispell will skip to
the next whitespace or TeX/LaTeX delimiter.  Certain commands contain
arguments which should not be checked, such as labels and reference keys as
are found in the \cite command, since they contain arbitrary, non-word
arguments.  Spell checking is also suppressed when in math mode.  Thus, for
example, given

     \chapter {This is a Ckapter} \cite{SCH86}

ispell will find "Ckapter" but not "SCH".  The -t option does not recognize
the TeX comment character "%", so comments are also spell-checked.  It also
assumes correct LaTeX syntax.  Arguments to infrequently used commands and
some optional arguments are sometimes checked unnecessarily. The bibliography
will not be checked if ispell was compiled with IGNOREBIB defined. 
Otherwise, the bibliography will be checked but the reference key will 
not."


I agree with you about the pain of TeX, Stephen, although there are good
points about it too.  We can learn from everything's strengths and
weaknesses.  LyX has both, and I might go into more detail about that at a
more useful time (when you have code, and I don't have a thesis due in three
weeks :-)


Good luck,

Gordon

-- 
                       Gordon Deane <address@hidden>
Sherlock Holmes cooking:
"When you have eliminated everything else in the pantry, then whatever
remains, however improbable, must become tonight's dinner."


reply via email to

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