[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Adding a custom symbol
From: |
Valeriy E. Ushakov |
Subject: |
Re: Adding a custom symbol |
Date: |
Mon, 16 Jan 2012 15:18:32 +0400 |
User-agent: |
Mutt/1.4.2.3i |
On Mon, Jan 16, 2012 at 09:33:02 +0000, Mark Summerfield wrote:
> On Fri, 13 Jan 2012 21:55:12 +0400
> "Valeriy E. Ushakov" <address@hidden> wrote:
> [snip]
> > Ok, got around to actually test it:
> >
> > @SysInclude { doc }
> >
> > export @Monochrome
> > def @MyOptions
> > named @Monochrome { No }
> > {}
> >
> > @Use { @MyOptions }
> >
> > @Doc @Text @Begin
> > @LP Monochrome is @Monochrome
> > @End @Text
> >
> >
> > $ lout -p -s override.lt | uniq
> >
> > Monochrome is No
> >
> > $ lout -p -s --'@Monochrome{Yes}' override.lt | uniq
> >
> > Monochrome is Yes
>
> I did this and put lines like this in my document:
>
> @CD @Monochrome @Case {
> Yes @Yield @IncludeGraphic{"images/quadratic2-linux-bw.eps.gz"}
> else @Yield @IncludeGraphic{"images/quadratic2-linux.eps.gz"}
> }
>
> This gave no error messages but didn't work reliably.
>
> So I changed them to this:
>
> @CD @Monochrome @Case {
> Yes @Yield @IncludeGraphic{"images/quadratic2-linux-bw.eps.gz"}
> No @Yield @IncludeGraphic{"images/quadratic2-linux.eps.gz"}
> }
>
> This seems to work reliably but outputs some strange error messages (but
> only in the --'@Monochrome{Yes}' case:
>
> replacing unknown @Case option ?? by Yes
>
> Anyway, it works, so that you very much:-)
Only by chance. Try it with --'@Monochrome{No}' :)
Now, this is weird. Consider this:
---8<------8<------8<------8<---
@SysInclude { doc }
export @Monochrome
def @MyOptions
named @Monochrome { No }
{}
@Use { @MyOptions }
#def @WHATEVER { @Monochrome }
@Doc @Text @Begin
@LP Monochrome is @Monochrome
@LP @Monochrome @Case {
Yes @Yield { Black and White }
No @Yield { Colorful }
}
@End @Text
---8<------8<------8<------8<---
It generates "replacing unknown @Case option ?? by Yes". But if you
uncomment definition of @WHATEVER (unused!), it puts the lout on the
right track.
I thoroughly forgot most of the internals, so I guess Jeff will have
to comment on this.
-uwe