On 30.11.07, Paul A. Rubin wrote:
> Two more layout questions (to which I'm pretty sure but not positive that I 
> know the answers, and which will likely put paid to my efforts to write a 
> layout for INFORMS journals):

> 1.  Is there currently a way to specify that a Command style has multiple 
> required (not optional) arguments?  (I'm guessing there is not.)

If there is one obvious choice for this argument, you can specify it
directly in the command name, e.g. in scrlttr2.layout::

        # Start new letter
        Style NextAddress
                LatexType             Command
                LatexName             end{letter}\begin{letter}

For a limited choice of options, you can also define separate environments.

For just one compulsory arg, another option would be to define a new command
that has this as optional argument (with a sensible default) and (ab?)use the 
        OptionalArgs    1
option with the misleading menu name "short title".

A more elaborated version is to use a new macro to store the optional
argument, as e.g. in my version of the dinbrief.layout::

   # dinbrief's \phone has 2 args, area and number. We define an empty
   # command that can be set by the Area_Code style
   Preamble
        \newcommand{\areacode}{}
   EndPreamble
   
   ...
   
   # dinbrief's \phone has 2 args, area and number,
   # define both as distinct styles
   
   Style Area_Code
        CopyStyle       DinBrief
        LabelString     "Vorwahl:"
        LatexName       "renewcommand{\areacode}"
   End
   
   
   Style Telephone
        CopyStyle       DinBrief
        LabelString     "Telefon:"
        LatexName       phone
        LatexParam      {\areacode}
   End

This example should be extensible to a set of arguments.
The user must be warned, however, that the order of the corresponding
paragraphs in the document is important. 

> 2.  Is there a way to specify that a style can only be used when nested 
> inside another style?  (Again, I'm guessing not.)  To clarify by example, 
> INFORMS wants authorship and affiliation done as follows (where the LaTeX 
> commands in upper case are supplied in their class file):

> \ARTICLEAUTHORS{%
>   \AUTHOR{Joe Blow}
>   \AFF{University of Nowhere, [EMAIL PROTECTED]
>   \AUTHOR{Jane Doe, Tom Roe}
>   \AFF{Western Nowhere School of Mines, [EMAIL PROTECTED], 
> [EMAIL PROTECTED]
> }

> So \AUTHOR and \AFF should only be used inside \ARTICLEAUTHORS, and \EMAIL 
> should only be used inside \AFF.  (The required use of commas inside \AFF 
> would be another headache, but I'm pretty sure a layout for this is already 
> infeasible.  ERT, here I come!)

The problem here is, that the same macro (like \AUTHOR) is used with
different expansions inside the final command. This makes the above method
inapplicable (or tricky to implement).

My suggestion would be to 

* use an Environment style for ARTICLEAUTHORS and
  document that AUTHOR and AFFiniation must only be used nested inside
  ARTICLEAUTHORS. 
  
* define a new macro for AFF where the email is an optional argument, e.g.
    
    Preamble
        \newcommand{\ArticleAuthorAff}[2][]{#2, \EMAIL{#1}}
    EndPreamble
    
  and set
        OptionalArgs    1
  in the Style definition.
  
  Untested!

  
Guenter


Reply via email to