lout-users
[Top][All Lists]
Advanced

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

Quotes and quotations


From: Ludovic Courtès
Subject: Quotes and quotations
Date: Thu, 13 Jun 2002 18:24:03 +0200

Hi,

There was a thread some time ago about quotes in Lout and Thorsten Seitz
posted a small quotes package. I augmented it with a @Quotation function that
automatically outputs quotations in italics when current font face is Base, or
with the Base font face when current font face is Slope.

That would be nice if it could automatically change the style of inner
quotation marks, eg. using French quotes first, and then regular double
quotes, and so on...

Any idea?

Cheers,
Ludovic.

On Wed, May 08, 2002 at 02:36:56PM +0200, Thorsten Seitz wrote:
> Not long ago I wrote two function for quotes which are used like that:
> 
>       @Q { quoted text }
>       @SQ { single quoted text }
> 
> though I have to admit that this is a bit unwieldy compared to just
> typing "quoted text" (especially on a german keyboard where the braces
> need the AltGr modifier key... :-).
> 
> For compensation they have the following useful properties:
> 
> The functions check for English/German to select the correct quotes
> (this should be generalized).
> Furthermore there is a setting which selects french quotes (<<quoted
> text>>) instead of normal quotes.
> 
> -Thorsten
> 
> # quotes
> #
> 
> export
>       @FrenchQuotes @Q @SQ
>       
> def @QuoteSetup
>       named @FrenchQuotes { no }              # use angled quotes (Guillemets 
> >>...<<)
> instead of normal quotes
> {     
>       # quotation marks
> 
>       def @OpeningQuote
>       { 
>               @CurrLang @Case {
>                       { German Deutsch } @Yield { 
>                               @FrenchQuotes @Case {
>                                       { yes Yes } @Yield @Char guillemotright
>                                       else @Yield @Char quotedblbase
>                               }
>                       }
>                       else @Yield { 
>                               @FrenchQuotes @Case {
>                                       { yes Yes } @Yield @Char guillemotleft
>                                       else @Yield @Char quotedblleft
>                               }
>                       }
>               }
>       }       
>       
>       def @ClosingQuote
>       { 
>               @CurrLang @Case {
>                       { German Deutsch } @Yield { 
>                               @FrenchQuotes @Case {
>                                       { yes Yes } @Yield @Char guillemotleft
>                                       else @Yield @Char quotedblleft
>                               }
>                       }
>                       else @Yield { 
>                               @FrenchQuotes @Case {
>                                       { yes Yes } @Yield @Char guillemotright
>                                       else @Yield @Char quotedblright
>                               }
>                       }
>               }
>       }       
>       
>       def @SingleOpeningQuote
>       { 
>               @CurrLang @Case {
>                       { German Deutsch } @Yield { 
>                               @FrenchQuotes @Case {
>                                       { yes Yes } @Yield @Char guilsinglright
>                                       else @Yield @Char quotesinglbase
>                               }
>                       }
>                       else @Yield { 
>                               @FrenchQuotes @Case {
>                                       { yes Yes } @Yield @Char guilsinglleft
>                                       else @Yield @Char quoteleft
>                               }
>                       }
>               }
>       }       
>       
>       def @SingleClosingQuote
>       { 
>               @CurrLang @Case {
>                       { German Deutsch } @Yield { 
>                               @FrenchQuotes @Case {
>                                       { yes Yes } @Yield @Char guilsinglleft
>                                       else @Yield @Char quoteleft
>                               }
>                       }
>                       else @Yield { 
>                               @FrenchQuotes @Case {
>                                       { yes Yes } @Yield @Char guilsinglright
>                                       else @Yield @Char quoteright
>                               }
>                       }
>               }
>       }       
>       
>       def @Q
>               right x
>       {
>               @OpeningQuote{ x address@hidden
>       }
>       
>       def @SQ
>               right x
>       {
>               @SingleOpeningQuote{ x address@hidden
>       }
>       
> }
> 
> 

Attachment: quotes.lout
Description: Text document


reply via email to

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