Steve Litt <slitt <at> troubleshooters.com> writes: > > On Tue, 29 Oct 2013 16:43:02 +0000 (UTC) > Mark Horton <mark.horton001 <at> yahoo.co.uk> wrote: > > > Hi I am a beginner in Lyx and understand a bit about the principles > > of Latex. I understand the advantages of a "fixed" layout and have > > seen some code to create a simple one. However it looks like a very > > steep learning curve. > > Hi Mark, > > You're exactly right. LaTeX, and therefore layouts, have a steep > learning curve. I'd recommend you make your first one in the same > directory as your document, but test it with a tiny test document. > > > > > All I would like to do is 2 little adjustments to the standard "book" > > layout. It looks fine on A4 paper but when dropping down to A5 paper > > the space around the Chapter heading text is too big and the Chapter > > heading text is too big. > > > > I believe there are two possible routes, something about a "local" > > module to override current settings which would be best. Or if > > possible get the original source for the book layout and create my > > own local layout from it. (But I wouldn't know where to find that.. > > or if it is available) > > That's a last resort, Mark. It's best just to specify only the changes, > if possible, rather than rewriting the whole environment and modifying > it. > > Here's the idiomatic way people specify the changes: > > \let\oldmiscstyle=\miscstyle > \let\endoldmiscstyle=\endmiscstyle > \renewenvironment{miscstyle}{ > %%% Stuff to do before invoking original environment > \begin{oldmiscstyle} > %%%% Stuff to do after invoking original, but before the text > }{ > %%%% Stuff to do before ending original, but after text > \end{oldmiscstyle} > %%%% Stuff to do after original environment ends > } > > Mark, if you've been a software developer in the past, the line with > \endoldmiscstyle probably looks like Voodoo, especially given that > neither \endoldmiscstyle nor \endmiscstyle is ever mentioned again. Do > it anyway: Somehow, when an environment \whatever is made, LaTeX seems > to make a corresponding \endwhatever that gets executed upon > \whatever's completion. I've personally had situations where this idiom > didn't work unless I put in the line: > > \let\endoldmiscstyle=\endmiscstyle > > It's best not to give too much thought to such thing as it could screw > up your brain --- just do it. > > > > > So much for the principle. Any advice on where to find out about the > > practice (at beginner level) would be appreciated. > > I gave a beginners-eye view of making your own layout here: > > http://www.troubleshooters.com/lpm/200210/200210.htm#_MakingYourOwnLayout > > If I were you, I'd read the entire document, in order. > > http://www.troubleshooters.com/lpm/200210/200210.htm > > I'd estimate it would be about a day to assimilate all the information, > and you'll get back your day after writing 200 pages of LyX-authored > content, and from then on you'll benefit from the knowledge. > > WARNING WARNING WARNING WARNING > > My document was written before LyX had a great facility for placing the > layout file in the local directory. Unless you have a reason to believe > that you'll use the same layout for lots of books (I never have), then > use current directory layouts, like this: > > Document->Settings->Document_class->Local_layout_button > > WARNING: DEFINITION ALERT!!!!!!!! > > LyX now has two different definitions for "Local Layout". Definition 1: > Document->Settings->Document_class->Local_layout_button > > Definition 2: > Document->Settings->Local_layout > > Definition 1 refers to a layout file in the same directory as the > document. Definition 2 refers to putting the text you would normally > put in a layout file, into the document itself. > > I personally always do it with Definition 1 because I can use my editor > of choice (which of course is Vim), and because I don't have to deal > with the hassles of the Validate button. > > When you use a Definition 1 layout file, be sure to Tools->Reconfigure > and then restart LyX after every change to the layout file. This hassle > is one reason I recommend a small test document while building and > fine-tuning your layout. I often put everything in a shellscript that > loops. There are people on this list who know how to do a reconfigure > from the command line: Ask them how to do that --- makes it easier, but > be careful, you need to be in the right directory when you issue that > command. > > Lastly, I'd like to congratulate you. There are people in this world > who say "Oh, LyX is trivially easy, anyone can use it!". Those people > have no credibility with me, because they've obviously always used > LyX defaults and have never made layout files. In making your layout > file, you become a LyX journeyman, with its attendant credibility. > > Thanks, > > SteveT > > Steve Litt * http://www.troubleshooters.com/ > Troubleshooting Training * Human Performance > > Steve & Guenter
Steve Thanks for your long and prompt reply. It was your document on creating a layout that I looked at. It looks very well written and clear, as do several other documents of yours I have looked at. I have done a lot of programming in the past, but I think your estimate of a day to get to grips with it, is somewhat optimistic. Perhaps a week for a finger tip grip is more realistic for someone who is not even conversant with a lot of the subject of layout terminology. I appreciate your prolific enthusiasm and desire to get me more involved. I must admit you make it tempting. However the idea of writing one from scratch is too much to think about at the moment. I know enough to know there is a huge amount about layout issues that I have never considered. So my worry is that even if I wrote a basic layout, I think I could then spend years struggling with spacing issues to avoid widows, children, uncles and whatever else is out there. So the next thing I looked at was Guenters' suggestion of using a Document class of “book (KOMA-Script)”, or I assume that is what he meant. Though even with this I still haven't found a full solution yet. Guenter Thanks for that, the documentation for this is also good, and the whole lot seems to operate at a higher level. So I experimented, first I tried editing the preamble…. \usepackage{scrpage2} \usepackage{titlesec} \setkomafont{chapter}{\ttfamily \bfseries\huge} This gave me some control over the chapter font, which as a default also seems to have less space above the text than the standard Lyx, which is what I required. However the header (now lacking a page number) was almost touching the text on flowing pages, so I tried some commands to control the header. This one placed in the preamble to control the font worked... \renewcommand{\headfont}{\normalfont\sffamily\mdseries} However so far it is the only one to do so. I have also tried putting the page number back with … \ohead{\pagemark} and \ohead{\pagenumber} in the preamble and when that failed as inserted Tex code. Neither seem to be recognised in either location. Ignored on the preamble and causing an error when inserted as ERT. ( I presume "pagemark" could be anything ) So I now have a “solution” with the chapter heading, but a now a problem with the page header. Best Regards Mark H :-|