Re: Creating a .layout file with two command arguments

2006-02-08 Thread Mael Hilléreau

Jeremy Daily a écrit :

Mael,

Thanks for the suggestion. The logic made sense, but your suggestion did 
not work. LyX generated an extra line between the commands in the tex file.




This is now possible by using character styles (available in LyX 
1.4.0pre3). The following layout sample won't produce any extra line 
between the two commands:


CharStyle Author
  MarginStatic
  LatexType Command
  InTitle   1
  LatexName AddAuthor
End

CharStyle Affiliation
  MarginStatic
  LatexType Command
  InTitle   1
  LatexName donothing
  Preamble
\newcommand{\donothing}[1]{#1}
  EndPreamble
End

Note: I don't know if InTitle works with character styles -- you'll 
have to test it...


In order to use these character styles, make a new paragraph (Standard), 
go to InsertCharacter styleAuthor, type in the author name, put the 
cursor at the right of the author name (out of the Author character 
style) and then go to InsertCharacter styleAffiliation, and type in 
the author's affiliation. You'll then have the following displayed into 
LyX window:


 Mael IFTS
|___||_|
 AuthorAffiliation

Compile your document. That's it! LyX then actually generates the right 
LaTeX code: \AddAuthor{Mael}\donothing{IFTS}


This workaround can be used to manage LaTeX macros with any number of 
arguments. It also has the advantage of allowing the user to combine 
commands with environments, which may be useful for example in order to 
manage packages such as acronym.sty.


Regards,
Mael.

--
Mael Hilléreau



Re: Creating a .layout file with two command arguments

2006-02-08 Thread Mael Hilléreau

Jeremy Daily a écrit :

Mael,

Thanks for the suggestion. The logic made sense, but your suggestion did 
not work. LyX generated an extra line between the commands in the tex file.




This is now possible by using character styles (available in LyX 
1.4.0pre3). The following layout sample won't produce any extra line 
between the two commands:


CharStyle Author
  MarginStatic
  LatexType Command
  InTitle   1
  LatexName AddAuthor
End

CharStyle Affiliation
  MarginStatic
  LatexType Command
  InTitle   1
  LatexName donothing
  Preamble
\newcommand{\donothing}[1]{#1}
  EndPreamble
End

Note: I don't know if InTitle works with character styles -- you'll 
have to test it...


In order to use these character styles, make a new paragraph (Standard), 
go to InsertCharacter styleAuthor, type in the author name, put the 
cursor at the right of the author name (out of the Author character 
style) and then go to InsertCharacter styleAffiliation, and type in 
the author's affiliation. You'll then have the following displayed into 
LyX window:


 Mael IFTS
|___||_|
 AuthorAffiliation

Compile your document. That's it! LyX then actually generates the right 
LaTeX code: \AddAuthor{Mael}\donothing{IFTS}


This workaround can be used to manage LaTeX macros with any number of 
arguments. It also has the advantage of allowing the user to combine 
commands with environments, which may be useful for example in order to 
manage packages such as acronym.sty.


Regards,
Mael.

--
Mael Hilléreau



Re: Creating a .layout file with two command arguments

2006-02-08 Thread Mael Hilléreau

Jeremy Daily a écrit :

Mael,

Thanks for the suggestion. The logic made sense, but your suggestion did 
not work. LyX generated an extra line between the commands in the tex file.




This is now possible by using character styles (available in LyX 
1.4.0pre3). The following layout sample won't produce any extra line 
between the two commands:


CharStyle Author
  MarginStatic
  LatexType Command
  InTitle   1
  LatexName AddAuthor
End

CharStyle Affiliation
  MarginStatic
  LatexType Command
  InTitle   1
  LatexName donothing
  Preamble
\newcommand{\donothing}[1]{#1}
  EndPreamble
End

Note: I don't know if "InTitle" works with character styles -- you'll 
have to test it...


In order to use these character styles, make a new paragraph (Standard), 
go to "Insert>Character style>Author", type in the author name, put the 
cursor at the right of the author name (out of the Author character 
style) and then go to "Insert>Character style>Affiliation", and type in 
the author's affiliation. You'll then have the following displayed into 
LyX window:


 Mael IFTS
|___||_|
 AuthorAffiliation

Compile your document. That's it! LyX then actually generates the right 
LaTeX code: \AddAuthor{Mael}\donothing{IFTS}


This workaround can be used to manage LaTeX macros with any number of 
arguments. It also has the advantage of allowing the user to combine 
commands with environments, which may be useful for example in order to 
manage packages such as "acronym.sty".


Regards,
Mael.

--
Mael Hilléreau



Re: Creating a .layout file with two command arguments

2006-01-18 Thread Mael Hilléreau
Thanks for the suggestion. The logic made sense, but your suggestion did 
not work. LyX generated an extra line between the commands in the tex file.


Sorry, no more idea then... Perhaps some tex or latex trick may do the 
job (eating spaces).


How can I get the Date environment to display Copyright: 2006 in LyX? 
The final output is correct so this display is a nicety rather than a 
necessity.


Here is my attempt:

# Copyright
Style Date
 MarginStatic
 LatexTypeCommand
 InTitle1
 LatexNameSAECopyright
 ParSkip0.4
 ItemSep0
 TopSep0
 BottomSep1
 ParSep1
 Alignleft
 AlignPossible left
 LabelTypeStatic
 LabelStringCopyright: 


Just add here:

 LeftMargin

And then the result should look better...



 # standard font definition
 Font
   FamilySans
   Seriesmedium
   Sizetiny
 EndFont

End



Mael.

--
Mael Hilléreau



Re: Creating a .layout file with two command arguments

2006-01-18 Thread Mael Hilléreau
Thanks for the suggestion. The logic made sense, but your suggestion did 
not work. LyX generated an extra line between the commands in the tex file.


Sorry, no more idea then... Perhaps some tex or latex trick may do the 
job (eating spaces).


How can I get the Date environment to display Copyright: 2006 in LyX? 
The final output is correct so this display is a nicety rather than a 
necessity.


Here is my attempt:

# Copyright
Style Date
 MarginStatic
 LatexTypeCommand
 InTitle1
 LatexNameSAECopyright
 ParSkip0.4
 ItemSep0
 TopSep0
 BottomSep1
 ParSep1
 Alignleft
 AlignPossible left
 LabelTypeStatic
 LabelStringCopyright: 


Just add here:

 LeftMargin

And then the result should look better...



 # standard font definition
 Font
   FamilySans
   Seriesmedium
   Sizetiny
 EndFont

End



Mael.

--
Mael Hilléreau



Re: Creating a .layout file with two command arguments

2006-01-18 Thread Mael Hilléreau
Thanks for the suggestion. The logic made sense, but your suggestion did 
not work. LyX generated an extra line between the commands in the tex file.


Sorry, no more idea then... Perhaps some tex or latex trick may do the 
job (eating spaces).


How can I get the Date environment to display "Copyright: 2006" in LyX? 
The final output is correct so this display is a nicety rather than a 
necessity.


Here is my attempt:

# Copyright
Style Date
 MarginStatic
 LatexTypeCommand
 InTitle1
 LatexNameSAECopyright
 ParSkip0.4
 ItemSep0
 TopSep0
 BottomSep1
 ParSep1
 Alignleft
 AlignPossible left
 LabelTypeStatic
 LabelString"Copyright: "


Just add here:

 LeftMargin

And then the result should look better...



 # standard font definition
 Font
   FamilySans
   Seriesmedium
   Sizetiny
 EndFont

End



Mael.

--
Mael Hilléreau



Creating a .layout file with two command arguments

2006-01-16 Thread Jeremy Daily

Group,

I'm trying to make a .layout file for sae.cls. I have everything working 
except the authors. In the sae class, the authors are added using the 
command:


\AddAuthor{Author name}{Affiliation}

If I try:

Style Author
MarginStatic
LatexTypeCommand
InTitle1
LatexNameAddAuthor
End

in the LyX .layout file, an error is given. I cannot figure out a way to 
include two two values for one command in LyX. My alternative right now 
is to use \AddAuthor in the document preamble, which seems to work fine.


Any help is much appreciated.

Jeremy


Re: Creating a .layout file with two command arguments

2006-01-16 Thread Mael Hilléreau
in the LyX .layout file, an error is given. I cannot figure out a way to 
include two two values for one command in LyX.


This is not possible in a dynamic way (i.e. you only can specify one 
parameter into LyX window). Perhaps, a workaround could consist in using 
two layout styles as the folowing (not tested):


Style Author
MarginStatic
LatexTypeCommand
InTitle1
LatexNameAddAuthor
End

Style Affiliation
MarginStatic
LatexTypeCommand
InTitle1
LatexNamedonothing
Preamble
\newcommand{\donothing}[1]{{#1}}
EndPreamble
End

... which would generate the following LaTeX code:

\AddAuthor{Author name}\donothing{Affiliation}

Hope that this will help...

Mael.

--
Mael Hilléreau




Re: Creating a .layout file with two command arguments

2006-01-16 Thread Jeremy Daily

Mael,

Thanks for the suggestion. The logic made sense, but your suggestion did 
not work. LyX generated an extra line between the commands in the tex file.


Another question:

How can I get the Date environment to display Copyright: 2006 in LyX? 
The final output is correct so this display is a nicety rather than a 
necessity.


Here is my attempt:

# Copyright
Style Date
 MarginStatic
 LatexTypeCommand
 InTitle1
 LatexNameSAECopyright
 ParSkip0.4
 ItemSep0
 TopSep0
 BottomSep1
 ParSep1
 Alignleft
 AlignPossible left
 LabelTypeStatic
 LabelStringCopyright: 

 # standard font definition
 Font
   FamilySans
   Seriesmedium
   Sizetiny
 EndFont

End

Thanks again,

Jeremy

Mael Hilléreau wrote:

in the LyX .layout file, an error is given. I cannot figure out a way 
to include two two values for one command in LyX.



This is not possible in a dynamic way (i.e. you only can specify one 
parameter into LyX window). Perhaps, a workaround could consist in 
using two layout styles as the folowing (not tested):


Style Author
MarginStatic
LatexTypeCommand
InTitle1
LatexNameAddAuthor
End

Style Affiliation
MarginStatic
LatexTypeCommand
InTitle1
LatexNamedonothing
Preamble
\newcommand{\donothing}[1]{{#1}}
EndPreamble
End

... which would generate the following LaTeX code:

\AddAuthor{Author name}\donothing{Affiliation}

Hope that this will help...

Mael.



Creating a .layout file with two command arguments

2006-01-16 Thread Jeremy Daily

Group,

I'm trying to make a .layout file for sae.cls. I have everything working 
except the authors. In the sae class, the authors are added using the 
command:


\AddAuthor{Author name}{Affiliation}

If I try:

Style Author
MarginStatic
LatexTypeCommand
InTitle1
LatexNameAddAuthor
End

in the LyX .layout file, an error is given. I cannot figure out a way to 
include two two values for one command in LyX. My alternative right now 
is to use \AddAuthor in the document preamble, which seems to work fine.


Any help is much appreciated.

Jeremy


Re: Creating a .layout file with two command arguments

2006-01-16 Thread Mael Hilléreau
in the LyX .layout file, an error is given. I cannot figure out a way to 
include two two values for one command in LyX.


This is not possible in a dynamic way (i.e. you only can specify one 
parameter into LyX window). Perhaps, a workaround could consist in using 
two layout styles as the folowing (not tested):


Style Author
MarginStatic
LatexTypeCommand
InTitle1
LatexNameAddAuthor
End

Style Affiliation
MarginStatic
LatexTypeCommand
InTitle1
LatexNamedonothing
Preamble
\newcommand{\donothing}[1]{{#1}}
EndPreamble
End

... which would generate the following LaTeX code:

\AddAuthor{Author name}\donothing{Affiliation}

Hope that this will help...

Mael.

--
Mael Hilléreau




Re: Creating a .layout file with two command arguments

2006-01-16 Thread Jeremy Daily

Mael,

Thanks for the suggestion. The logic made sense, but your suggestion did 
not work. LyX generated an extra line between the commands in the tex file.


Another question:

How can I get the Date environment to display Copyright: 2006 in LyX? 
The final output is correct so this display is a nicety rather than a 
necessity.


Here is my attempt:

# Copyright
Style Date
 MarginStatic
 LatexTypeCommand
 InTitle1
 LatexNameSAECopyright
 ParSkip0.4
 ItemSep0
 TopSep0
 BottomSep1
 ParSep1
 Alignleft
 AlignPossible left
 LabelTypeStatic
 LabelStringCopyright: 

 # standard font definition
 Font
   FamilySans
   Seriesmedium
   Sizetiny
 EndFont

End

Thanks again,

Jeremy

Mael Hilléreau wrote:

in the LyX .layout file, an error is given. I cannot figure out a way 
to include two two values for one command in LyX.



This is not possible in a dynamic way (i.e. you only can specify one 
parameter into LyX window). Perhaps, a workaround could consist in 
using two layout styles as the folowing (not tested):


Style Author
MarginStatic
LatexTypeCommand
InTitle1
LatexNameAddAuthor
End

Style Affiliation
MarginStatic
LatexTypeCommand
InTitle1
LatexNamedonothing
Preamble
\newcommand{\donothing}[1]{{#1}}
EndPreamble
End

... which would generate the following LaTeX code:

\AddAuthor{Author name}\donothing{Affiliation}

Hope that this will help...

Mael.



Creating a .layout file with two command arguments

2006-01-16 Thread Jeremy Daily

Group,

I'm trying to make a .layout file for sae.cls. I have everything working 
except the authors. In the sae class, the authors are added using the 
command:


\AddAuthor{Author name}{Affiliation}

If I try:

Style Author
MarginStatic
LatexTypeCommand
InTitle1
LatexNameAddAuthor
End

in the LyX .layout file, an error is given. I cannot figure out a way to 
include two two values for one command in LyX. My alternative right now 
is to use \AddAuthor in the document preamble, which seems to work fine.


Any help is much appreciated.

Jeremy


Re: Creating a .layout file with two command arguments

2006-01-16 Thread Mael Hilléreau
in the LyX .layout file, an error is given. I cannot figure out a way to 
include two two values for one command in LyX.


This is not possible in a dynamic way (i.e. you only can specify one 
parameter into LyX window). Perhaps, a workaround could consist in using 
two layout styles as the folowing (not tested):


Style Author
MarginStatic
LatexTypeCommand
InTitle1
LatexNameAddAuthor
End

Style Affiliation
MarginStatic
LatexTypeCommand
InTitle1
LatexNamedonothing
Preamble
\newcommand{\donothing}[1]{{#1}}
EndPreamble
End

... which would generate the following LaTeX code:

\AddAuthor{Author name}\donothing{Affiliation}

Hope that this will help...

Mael.

--
Mael Hilléreau




Re: Creating a .layout file with two command arguments

2006-01-16 Thread Jeremy Daily

Mael,

Thanks for the suggestion. The logic made sense, but your suggestion did 
not work. LyX generated an extra line between the commands in the tex file.


Another question:

How can I get the Date environment to display "Copyright: 2006" in LyX? 
The final output is correct so this display is a nicety rather than a 
necessity.


Here is my attempt:

# Copyright
Style Date
 MarginStatic
 LatexTypeCommand
 InTitle1
 LatexNameSAECopyright
 ParSkip0.4
 ItemSep0
 TopSep0
 BottomSep1
 ParSep1
 Alignleft
 AlignPossible left
 LabelTypeStatic
 LabelString"Copyright: "

 # standard font definition
 Font
   FamilySans
   Seriesmedium
   Sizetiny
 EndFont

End

Thanks again,

Jeremy

Mael Hilléreau wrote:

in the LyX .layout file, an error is given. I cannot figure out a way 
to include two two values for one command in LyX.



This is not possible in a dynamic way (i.e. you only can specify one 
parameter into LyX window). Perhaps, a workaround could consist in 
using two layout styles as the folowing (not tested):


Style Author
MarginStatic
LatexTypeCommand
InTitle1
LatexNameAddAuthor
End

Style Affiliation
MarginStatic
LatexTypeCommand
InTitle1
LatexNamedonothing
Preamble
\newcommand{\donothing}[1]{{#1}}
EndPreamble
End

... which would generate the following LaTeX code:

\AddAuthor{Author name}\donothing{Affiliation}

Hope that this will help...

Mael.