Bennett Helm wrote:

Hello Bennett,

> I guess I should have checked with you first so as not to duplicate
> effort! Oh well....

Not at all. This forces me to think about my layout.

> You're certainly right about Sides and Columns -- just a silly goof on
> my part. One thing I could not get to work is switching from twoside to
> oneside from within the LyX GUI: unchecking the "Two-sided document"
> box in Document Settings does nothing, my guess is because LyX assumes
> the oneside option is the default (which is not true for memoir).
> Perhaps that should be changed in the LyX code.

AFAIK (and this works for me): with the line
Sides                  2
in the layout file, LyX adds the document option [oneside] if twoside is 
unchecked and nothing if it is checked (because [twoside] is the default).
What problems do you have exactly?

> My aim was to get memoir with the article option to work as closely as
> possible to the normal article class. I write more articles than books,
> and I sometimes find myself having reason to switch between, for
> example, the standard article documentclass and the paper
> documentclass. So I thought I should preserve the option of switching
> between these and the memoir documentclass with the article option,
> making that go as smoothly as possible. Moreover, if someone switches
> from one of the article classes to one of the book classes, the effects
> of the switch should be predictable. That is, if I go from an article
> documentclass to a book documentclass, I end up having my section
> titles go from "1 [title]" to "0.1 [title]". It would be somewhat
> jarring, I thought, to make the switch from memoir with the article
> option (which, although it's not really a separate documentclass
> nonetheless mimics the article documentclass in many ways) to memoir
> without the article option and have section titles go from "1 [title]"
> to "Chapter 1 [title]".

I see that this is a valid aim. But consider switching from "article" to book 
_inside_ the memoir class [1]. If you have memoir-article and switch to book, 
your sections will stay sections and you have to shift the whole 
chapter/section stuff down to paragraph. The other way, from memoir-book to 
memoir-article, it is even worse: LyX will give you an error that the chapter 
environment is not defined and that is will be set to standard.

[1] That's what the article option is made for I think; in LaTeX you will have 
the same problems switching from standard article to memoir pseudo-article 
(unless you use a package like "outliner" which provides the framework for 
such a switch).

> Of course, someone who really understands the memoir class may not want
> to do it this way. For such a person, it would always be possible to
> use my "book (memoir)" layout and add the article option: that's not a
> trick that would be difficult for an expert. My aim, however, was to
> make things as easy as possible for those who are not experts and do
> not have the inclination to learn how memoir actually works but just
> want to use the GUI tools to produce nice documents with a minimum of
> fuss. That's why I redefined things as I did, and that's why I provided
> two layouts.

OK, but I think we should support the layouts without too much modification.  
I understand that there might be some need for a kind of "shuttle" class 
between article and book. But this should be independent from the ordinary 
memoir class. I don't see a need for an inc file like in KOMA. KOMA is 
certainly totally different. It is a bundle with replacements for all the 
standard classes (article, report, book, letter). Memoir is basically just a 
book class which tries to trick a little bit.

However, if you want such a shuttle class, you could as well just include the 
ordinary memoir class (note the modifications):

#% Do not delete the line below; configure depends on this
- #  \DeclareLaTeXClass[article]{article (memoir)}
+ #  \DeclareLaTeXClass[memoir]{article (memoir)}
# Memoir textclass definition file for when the article class
# option is selected. (Note: This must be specifically entered
# into the Options field of the Document Settings dialog in
# LyX.)
# Author: Bennett Helm <[EMAIL PROTECTED]>
# Revision: 9/24/2003

# General text class parameters
- Input memoir.inc
+ Input memoir.layout

etc.

I think if there's need for that, it could be added as an addition to the 
ordinary memoir class.

> It is a hack (as is mine). Yours has the advantage of making the
> contents of the extra arguments visible, though I suspect it would be a
> bit more difficult for users who don't know LaTeX (which is not to say
> that mine approach would be easy). I'm not sure which is better.

I'm not shure either. Mine has probably the advantage of letting things like 
they are. I would not be surprised if e.g. epigraph gets some optional 
argument eventually (or maybe LyX gets some way to handle two parameters). 
Than you have to redifine things again.

[hangpara]
> It's hardcoded because that was the closest-to-sensible way I could
> figure out to do it. (I agree, it is not an elegant solution.)
> Nonetheless, I think it's better to have a GUI option where possible,
> again for users who don't know LaTeX and don't want to have to learn
> ERT.

I don't think so. I think there's nothing evil about ERT and some things 
always will have to be done with ERT. But I think that LyX should support 
such things eventually (when the framework is ready).

> > I am reluctant on framed and shaded either. They are both more
> > container
> > insets than environments (they can include other environments as quote
> > and
> > verse themselves), so a collapsable inset would be more appropriate.
>
> That's true. Is there a way to define such a thing in a layout file?

No.

> Assuming there's not, my inclination again was to be both inclusive and
> aim for utilizing the GUI rather than ERT as much as possible. So,
> although framed and shaded allow extra formatting of paragraphs inside
> those (LaTeX) environments, and although my making them be LyX
> environments does not allow for that easily, I thought having something
> was better than nothing.

Hmm. But frames are not paragraph environments. They should not be mixed with 
paragraph environments.

> > But again, why hardcoding a color here?
>
> That mistake is just my ignorance of LaTeX, I'm afraid. Why hardcode a
> color? Well, some value is needed, and I didn't see how else that could
> be easily incorporated into LyX. (With your solution, would the
> Preamble inserted by the layout file be after the user's additions to
> the preamble from the Document Settings dialog? If so, then it's always
> possible for the user to add LaTeX code there to define a custom color.)

Yes, you are right.

> Other than the points above, the only other thing I did was to mix the
> additional styles in with the appropriate .inc files, which I input
> explicitly rather than inputting stdclass.inc. (This is similar to the
> Koma-script layouts.) The reason for this is to ensure that the
> additional styles get added in the appropriate place in the drop-down
> list in the toolbar -- so that the epigraph style comes next to the
> title, author, date, and abstract styles, e.g. As you have it, the new
> styles all come at the end of the GUI, which can be confusing.

Agreed. I'll try and change the order of my layout file.

Thanks,
J�rgen.

> Anyway, thanks for the thoughtful comments.

> Bennett
>
> ----------
> Bennett Helm
> Department of Philosophy
> Franklin & Marshall College

Reply via email to