obregonma...@gmail.com wrote:
Hi everyone-

I've gone through the docs, wikis and examples, and I need a helping hand.

I want to have a counter (experiment) that uses roman numerals and is 
sequential throughout the chapters. I figure that a module is the right way 
about this, so I have a module with the following counter:

Counter experimentCounter
        LabelString      "\Roman{experimentCounter}"
        Within           ""   
End

Now, what I want is a section heading  that would look like:

3.2    <label expt:reading-ability> Experiment I: Effect of reading ability

and then later on:

3.6   <label expt:age-predictor> Experiment II: Age as a predictor

and then ...

4.2   <label expt:reading-aids> Experiment III: Reading aids



How can I use my "experimentCounter" in a section title, as well as assign a label to this experiment item (NOT the section number)? I imagine that it would require an ERT ... but with what LaTeX command?

Sure, this can be done with some ERT.
But if you're making a module anyway, why not implement this too in the module?

Basically, you create a new "experiment-section" that contains all the stuff from a regular "section" ( copy it out of stdsections.inc, or use "CopyStyle Section" and take it from there.) And then you add the necessary latex code, once. Instead of having to add it as ERT to
every experiment in your text.

So when you start a new experiment, you use "experiment-section" instead
of a regular section. I am not sure if you can get LyX to display the experiment counter in the edit window, as incrementing two counters at once is a bit unusual. But it should definitely work for output!

As for the actual latex code needed to increment and display the counter, I don't have time to look that up right now. Look for
examples on the net, or borrow one of the recommended latex books at
a library.

Helge Hafting

Reply via email to