lout-users
[Top][All Lists]
Advanced

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

[no subject]


From: Samuel Lacas
Date: Wed, 3 Oct 2001 10:11:18 +0200

Hi dear fellow louters,

please accept my apologies if the present post is too long for the list, but I
believe it to be worthy. Trying to play a little with galleys, I tried to
define macros & functions to produce a Question/Answer list in the following
form:

   @QAL
     @Q { question one }
     @A { answer to question one }
     @Q { question two }
     ...
   @EndOfList

would produce something like:

    Q-1: question one
    A-1: answer to question one
    Q-2: ...

My initial and ambitious thoughts were also to be able to have the answers
separated from the questions using the same source but with different galleys,
thus producing (I hope I'm being clear):

    Q-1: question one
    Q-2: ...

    A-1: answer to question one
    A-2: ...

Well, forgetting numbering issues and the alternative galley scheme, I spent
many hours trying to get things done the right way, and I feel like my
experience may profit to some louters here. I am absolutely not saying that
lout documentation is poor or whatever similar, it is quite the opposite I
think, but the galley flushing algorithm seems to contain severe pitfalls for
the unwary like me. To prove what I am saying, I send here the source file and
some random changes I tried to get things work. Sincerely, I am not sure that a
lot of people may be able to correctly predict the results without running lout
first (that is, some results can be understood once seen, but barely guessed I
think).

Well, no more fast-talk, here is first my source file:

   @SysInclude { doc } 

   def @EndPlace { @Galley }
   def @EndList force into { @EndPlace&&preceding }
   {}

   def @QPlace { @Galley }
   def @APlace { @Galley }

   import @BasicSetup
   export @Q @A 
   def @QAL
   {
      def @Q into { @QPlace&&preceding }
         right x
      { x }

      def @A into { @APlace&&preceding }
         right x
      { x }

      def QAList
      {
         @B{Q: } | @QPlace  # point 1
         //
         @B{A: } | @APlace 
         //
         QAList
      }

       QAList // @EndPlace
   }

   @Use { @QAL }

   @Doc @Text @Begin
   @PP
   @QAL # point 2
     @Q { Does this work this way ? }
     @A { Yes }
     @Q { Does this again work this way ? }
     @A { Yes, once more }
   @EndList
      
   @End @Text

Produces [output 1]
               Q:Does this work this way ?
               A:
               Q:
               A:Yes
               Q:Does this again work this way ?
               A:
               Q:
               A:Yes, once more

Forcing the galley on "Q", "A" or both does not change anything.

Putting a @NotRevealed on @QPlace (point 1) leads to
"no @QPlace precedes this @QPlace&&preceding" and

[output 2]
               Q:Does this again work this way ?
               A:Yes
               Q:
               A:Yes, once more

Putting a @NotRevealed on @APlace (and removing that on @QPlace) leads to

[output 3]
               Q:Does this work this way ?
               A:Yes
               Q:Does this again work this way ?
               A:Yes, once more

Changing then the order in the @Text, @Q @Q @A @A (point 2) leads to

[output 4]
               Q:Does this work this way ?
               A:Yes, once more
               Q:Does this again work this way ?
               A:Yes


Putting then @A @A @Q @Q leads to
"no @APlace precedes this @APlace&&preceding"
and

[output 5]
               Q:Does this work this way ?
               A:
               Q:Does this again work this way ?
               A:

Kepping things as they are but removing the @NotRevealed
leads to
[output 6]
               Q:
               A:Yes
               Q:
               A:Yes, once more
               Q:Does this work this way ?
               A:
               Q:Does this again work this way ?
               A:

Can someone give a hint on all these outputs, especially [output 1], as I feel
I understand [output 2] and [output 3], but I do not see why the first one does
not work. The [output 4] is also somewhat obscure to me, [output 5] is totally
strange, and I can manage an explication on [output 6].

Well, my point is to try to grasp some subtleties of the dreadful galley
flushing algorithm, as until I stumbled upon the above, I thought I had 
understood it...

Sincerely yours,

sL


reply via email to

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