Re: Map lyx style to latex command with many arguments?

2004-01-09 Thread Günter Milde
Nathan Weston wrote:
 Is there any way to create a custom style that maps to a latex command with 
 more than 2 arguments?
 I'm thinking of something like Description, except the first word would become 
 argument 1, the second word would become argument 2, ... the nth word would 
 become argument n, and the rest of the words would become argument n+1.

 i.e. if you formatted the paragraph
 one two three rest of the paragraph
 
 in a style Foo, it might translate to a latex command like this:
 \foo{one}{two}{three}{rest of the paragraph}
 
 Is this possible, or am I stuck using ERTs?

AFAIK, no. You can have fix leading arguments in the layout file or you
need to have different styles for the different parts, e.g. 

# 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

# Telefon: Vorwahl und Rufnummer sind in Dinbrief separate Argumente:
# \phone{Vorwahl}{Rufnummer}
# Vorwahl
Style Area_Code
  CopyStyle DinBrief
  LabelString   Vorwahl:
  LatexName renewcommand{\areacode} # LyX adds the argument in {}
End
# Rufnummer
Style Phone
  CopyStyle DinBrief
  LabelString   Telefon:
  LatexName phone{\areacode}
End


Feel free to file a bugreport/feature-wish with bugzilla.

My idea would be to translate the (otherwise not needed) TAB character to
an argument separator, i.e.
   one\ttwo\tthree\trest of the paragraph
translates to   
   \foo{one}{two}{three}{rest of the paragraph}

This would have the nice sideeffect, that description labels could contain
plain spaces, pressing TAB would start the description itself.

Günter

-- 
G.Milde at web.de


Re: Map lyx style to latex command with many arguments?

2004-01-09 Thread Günter Milde
Nathan Weston wrote:
 Is there any way to create a custom style that maps to a latex command with 
 more than 2 arguments?
 I'm thinking of something like Description, except the first word would become 
 argument 1, the second word would become argument 2, ... the nth word would 
 become argument n, and the rest of the words would become argument n+1.

 i.e. if you formatted the paragraph
 one two three rest of the paragraph
 
 in a style Foo, it might translate to a latex command like this:
 \foo{one}{two}{three}{rest of the paragraph}
 
 Is this possible, or am I stuck using ERTs?

AFAIK, no. You can have fix leading arguments in the layout file or you
need to have different styles for the different parts, e.g. 

# 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

# Telefon: Vorwahl und Rufnummer sind in Dinbrief separate Argumente:
# \phone{Vorwahl}{Rufnummer}
# Vorwahl
Style Area_Code
  CopyStyle DinBrief
  LabelString   Vorwahl:
  LatexName renewcommand{\areacode} # LyX adds the argument in {}
End
# Rufnummer
Style Phone
  CopyStyle DinBrief
  LabelString   Telefon:
  LatexName phone{\areacode}
End


Feel free to file a bugreport/feature-wish with bugzilla.

My idea would be to translate the (otherwise not needed) TAB character to
an argument separator, i.e.
   one\ttwo\tthree\trest of the paragraph
translates to   
   \foo{one}{two}{three}{rest of the paragraph}

This would have the nice sideeffect, that description labels could contain
plain spaces, pressing TAB would start the description itself.

Günter

-- 
G.Milde at web.de


Re: Map lyx style to latex command with many arguments?

2004-01-09 Thread Günter Milde
Nathan Weston wrote:
> Is there any way to create a custom style that maps to a latex command with 
> more than 2 arguments?
> I'm thinking of something like Description, except the first word would become 
> argument 1, the second word would become argument 2, ... the nth word would 
> become argument n, and the rest of the words would become argument n+1.

> i.e. if you formatted the paragraph
> one two three rest of the paragraph
> 
> in a style "Foo", it might translate to a latex command like this:
> \foo{one}{two}{three}{rest of the paragraph}
 
> Is this possible, or am I stuck using ERTs?

AFAIK, no. You can have "fix" leading arguments in the layout file or you
need to have different styles for the different parts, e.g. 

# 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

# Telefon: Vorwahl und Rufnummer sind in Dinbrief separate Argumente:
# \phone{Vorwahl}{Rufnummer}
# Vorwahl
Style Area_Code
  CopyStyle DinBrief
  LabelString   "Vorwahl:"
  LatexName "renewcommand{\areacode}" # LyX adds the argument in {}
End
# Rufnummer
Style Phone
  CopyStyle DinBrief
  LabelString   Telefon:
  LatexName phone{\areacode}
End


Feel free to file a bugreport/feature-wish with bugzilla.

My idea would be to translate the (otherwise not needed) TAB character to
an "argument separator", i.e.
   "one\ttwo\tthree\trest of the paragraph"
translates to   
   \foo{one}{two}{three}{rest of the paragraph}

This would have the nice sideeffect, that description labels could contain
plain spaces, pressing TAB would start the description itself.

Günter

-- 
G.Milde at web.de


Map lyx style to latex command with many arguments?

2004-01-08 Thread Nathan Weston
Is there any way to create a custom style that maps to a latex command with 
more than 2 arguments?
I'm thinking of something like Description, except the first word would become 
argument 1, the second word would become argument 2, ... the nth word would 
become argument n, and the rest of the words would become argument n+1.

i.e. if you formatted the paragraph
one two three rest of the paragraph

in a style Foo, it might translate to a latex command like this:
\foo{one}{two}{three}{rest of the paragraph}

Is this possible, or am I stuck using ERTs?

Nathan



Map lyx style to latex command with many arguments?

2004-01-08 Thread Nathan Weston
Is there any way to create a custom style that maps to a latex command with 
more than 2 arguments?
I'm thinking of something like Description, except the first word would become 
argument 1, the second word would become argument 2, ... the nth word would 
become argument n, and the rest of the words would become argument n+1.

i.e. if you formatted the paragraph
one two three rest of the paragraph

in a style Foo, it might translate to a latex command like this:
\foo{one}{two}{three}{rest of the paragraph}

Is this possible, or am I stuck using ERTs?

Nathan



Map lyx style to latex command with many arguments?

2004-01-08 Thread Nathan Weston
Is there any way to create a custom style that maps to a latex command with 
more than 2 arguments?
I'm thinking of something like Description, except the first word would become 
argument 1, the second word would become argument 2, ... the nth word would 
become argument n, and the rest of the words would become argument n+1.

i.e. if you formatted the paragraph
one two three rest of the paragraph

in a style "Foo", it might translate to a latex command like this:
\foo{one}{two}{three}{rest of the paragraph}

Is this possible, or am I stuck using ERTs?

Nathan