Gerard A. Ateshian wrote:
If I export my document to LaTeX, I can see that the problem occurs because the amsbook class includes the command \numberwithin{equation}{section} in its preamble, which precedes LyX's preamble in which I have typed \numberwithin{equation}{chapter}. Within LaTeX, all I have to do is comment out \numberwithin{equation}{section} and everything works fine. However, within LyX, I don't have access to this command, so what do I do to disable it?
You can comment out textclass preamble lines in the .layout file.
Close LyX, go to the folder lyx/share/lyx/layouts and open the file amsbook.layout with an editor. Now got to the preamble section and comment out the preable line with a percent sign, save the file and restart LyX. As an alternative you can use the attached .layout file.
This way is indeed not very comfortable, but I guess that there are good reasons for this textclass preamble.
regards Uwe
#% Do not delete the line below; configure depends on this
# \DeclareLaTeXClass{book (AMS)}
# AMS-Article textclass definition file. Taken from initial LyX source code
# and from the Article textclass definition file, following the AMS sample
# paper "testmath.tex" of January, 1995
# Author : David L. Johnson <[EMAIL PROTECTED]>
# Probably broken by Jean-Marc Lasgouttes <[EMAIL PROTECTED]>
# modified and modularized by Emmanuel GUREGHIAN <[EMAIL PROTECTED]>
# General textclass parameters
# Description "book (AMS)"
Columns 1
Sides 2
PageStyle Headers
MaxCounter Counter_Chapter
ClassOptions
FontSize 8|9|10|11|12
End
# Standard style definition
Style Standard
Margin Static
LatexType Paragraph
LatexName dummy
ParIndent MM
ParSkip 0.4
Align Block
AlignPossible Block, Left, Right, Center
LabelType No_Label
End
############### Sections.
Input stdsections.inc
# Redefine some of the section styles.
Style Section
Align Center
AlignPossible Block, Center, Left
# standard font definition
Font
Series Medium
Shape Smallcaps
Size Large
EndFont
End
# Subsection-numbered style definition
Style Subsection
# standard font definition
Font
Series Bold
Size Normal
EndFont
End
# Subsubsection-numbered style definition
Style Subsubsection
# standard font definition
Font
Shape Italic
Size Normal
EndFont
End
# then define the unumbered sections, based on the numbered ones.
Input stdstarsections.inc
# Perhap's we should put this at the end of the file so it appears at the end
# of the list box ??
Preamble
\numberwithin{section}{chapter}
\theoremstyle{plain}
\newtheorem{thm}{Theorem}[section]
%\numberwithin{equation}{section} %% Comment out for sequentially-numbered
\numberwithin{figure}{section} %% Comment out for sequentially-numbered
EndPreamble
Input lyxmacros.inc
NoStyle Address
Input amsdefs.inc
Input stdlayouts.inc
NoStyle Verse # Although mathematicians tend to be poets at times,
# we don't need this.
NoStyle Abstract # there are no abstract in a book.
Input stdlists.inc
Input stdfloats.inc
Input stdcounters.inc
# End-of Chapter exercises I need a way to do this.
# Chapter Exercises style definition
Style Chapter_Exercises
Margin First_Dynamic
LatexType Item_Environment
LatexName lyxxcb
NextNoIndent 1
LeftMargin MMN
LabelSep xx
ParSkip 0.0
ItemSep 0.2
TopSep 0.7
BottomSep 0.7
ParSep 0.3
Align Block
AlignPossible Block, Left
LabelType Counter_EnumI
# standard font definition
# label font definition
LabelFont
Shape Up
Series Bold
EndFont
Preamble
\newenvironment{lyxxcb}{\begin{xcb}{Exercises}\begin{enumerate}}
{\end{enumerate}\end{xcb}}
EndPreamble
End
### Finally a few obsolete definitions for compatibility
Input obsolete.inc
