On Nov 4, 2009, at 3:35 PM, Paul A. Rubin wrote:

James C. Sutherland wrote:
On Nov 4, 2009, at 11:40 AM, <2450h...@gmail.com> <2450h...@gmail.com> wrote:
I am defining a layout where I need to have a few LaTeX definitions made. In LaTeX, these would be:

\ICSEnum{12345}
This is not displayed - it is required for the class (.cls) file I am using.

In the LyX layout file, I tried the following:

InsetLayout "ReportNumber"
   LyxType            custom
   LatexType        command
   LatexName        ICSEnum
   Category        FrontMatter
   LabelString        "Publication Number"
   Align            left
   Font
     Shape            Slanted
     Color            green
   EndFont
   LabelFont
     Color            green
     Size            Small
   EndFont
End

This does correctly define the LaTeX command I need, but it is placed in the document body, not in the frontmatter (before \begin {document}) where I need it placed.

To be more clear, I meant "preamble" and not "frontmatter"
It doesn't look like there is a way to push information into the preamble from within the LyX document, unless you do it in Document- >Settings, right?

Customization Manual section 5.3.6: you can include

Preamble
 stuff that goes into the preamble
EndPreamble

to do what you want.

/Paul


I tried this:

InsetLayout "ReportNumber"
        LyxType                 custom
        LatexType               command
        LatexName               ICSEnum
        Category                FrontMatter
        LabelString             "Publication Number"
        Align                   left
        Font
          Shape                 Slanted
          Color                 green
        EndFont
        LabelFont
          Color                 green
          Size                  Small
        EndFont
        Preamble
          \ICSEnum{ICSEnum}
        EndPreamble
End

This results in the \ICSEnum{...} being put in the preamble AND the body of the document. How can I make it go ONLY in the preamble?

Reply via email to