-----Original Message-----

From: lyx-users@lists.lyx.org [mailto:lyx-users@lists.lyx.org] On Behalf Of 
Andrew Parsloe

Sent: onsdag 16. november 2016 23.08

To: lyx-users@lists.lyx.org

Subject: Re: Numbering of Theorems, etc.







On 17/11/2016 6:02 a.m., Richard Heck wrote:

> On 11/16/2016 04:03 AM, Bernt Lie wrote:

>>

>> *From:*Richard Heck [mailto:rgh...@lyx.org]

>> *Sent:* tirsdag 15. november 2016 19.04

>> *To:* Bernt Lie <bernt....@hit.no>; LyX Users

>> <lyx-users@lists.lyx.org>

>> *Subject:* Re: Numbering of Theorems, etc.

>>

>> On 11/15/2016 09:43 AM, Bernt Lie wrote:

>>

>>     I use LyX 2.2.1 (currently) on Windows 10.

>>

>>     I have a rather long document (some 600 pages, with 9 chapters +

>>     several appendices), and want to number Exercises, Problems,

>>     Examples, Theorems, etc. **independently** and numbered **by the

>>     chapter** (or appendix) they appear in. Thus, exercises in chapter

>>     6 should be numbered Exercise 6.1, Exercise 6.2, etc., while

>>     examples in chapter 6 should be numbered Example 6.1, Example 6.2,

>>     etc.

>>

>>     Currently, this doesn’t work. My set-up is:

>>

>>     ·Document class: Book (Standard Class)

>>

>>     ·Modules: Theorems (AMS, Numbered by Type)

>>

>>     What else do I need to set?

>>

>>

>> I assume the problem is that you are not getting the "numbered by

>> chapter" bit? If so, then maybe the easiest thing to do is use the

>> internal LaTeX command \@addtoreset in the preamble, thus:

>>     \@addtoreset{theorem}{chapter}

>> Now the theorem counter gets reset whenever the chapter counter is reset.

>>

>> You'll need to do the same thing for any other counters you are

>> using, and see the theorems-ams-bytype.inc file for the names of the

>> various counters.

>>

>> See also: http://www.tex.ac.uk/FAQ-addtoreset.html.

>>

>> Richard

>>

>> --

>>

>> Richard,

>>

>> Thanks for quick reply. I’ve tested it (inserting

>> “\@addtoreset{theorem}{chapter}” in the preamble), but now get the

>> following error messages:

>>

>> OK. Let me try to be a little bit more precise. Currently, the

>> counters count independently. In other words, Definition 1,

>> Definition 2, Theorem 1, Definition 3, Theorem 2, Example 1, etc.

>>

>> However, they (i) do not contain a chapter counter, and (ii) they do

>> (obviously) not reset the chapter counter in each chapter.

>>

>

> See the attached. Sorry, I got the names of the counters wrong. (I

> mixed up the LyX counters and the LaTeX ones.) The LaTeX names are the

> same as the names of the environments as they are declared in the preamble, 
> e.g.:

>      \newtheorem{lem}{\protect\lemmaname}

> So the counter is "lem" for Lemmas.

>

> Richard

>

  Perhaps I've misunderstood, but it seems to me what is wanted is the module 
Theorems (Numbered by

  Type within Chapters) that comes with LyX.



  This allows one to number by type within chapters each of theorems, 
corollaries, lemmas, propositions,

  conjectures, facts, definitions, examples, problems, exercises, remarks and 
claims.



   Andrew

--

Thanks Andrew. Yes, that's what I also thought, but this has no effect... 
Choosing



[cid:image001.jpg@01D240B7.133551E0]



and

[cid:image002.jpg@01D240B7.133551E0]



seems to give the same result. I don’t understand why. (Is it because the first 
selection says AMS, Numbered by Type, and the second one doesn’t mention AMS?)



Anyway, depending on which choice I make first, not all choices are available. 
Example: with the latter of these choices (both Theorems (AMS, ...) and 
Theorems (Numbered by Type...)...

·         if I try to select Theorems (AMS, ...) first, option “Delete” is not 
available

·         so I have to delete the second option first, and then after that, I 
can delete “Theorems (AMS, ...)”.

Likewise, module “Theorems (Numbered by Type within Chapters)” – which is 
really what I want – can only be added if I *first* add “Theorems (AMS, 
Numbered by Type)”... and then it doesn’t give the expected effect.



Ideally, this is how I’d like it to work, without having to “hack” in the 
preamble...

--

Thanks,

Bernt

Reply via email to