Copyright (C) 2001 by Steve Litt, All rights reserved. Material provided as-is, use at your own risk.
But...
Custom paragraph styles and custom character styles are indispensible for the book author, and unfortunately the Lyx methods to accomplish these two necessities are horrendously underdocumented. In fact, as of LyX 1.1.6fix3, LyX doesn't even support character styles. But don't worry, this document containss a very nice workaround you can use to achieve the benefits of character styles.
The toughest impediment to learning to customize LyX is confusing LyX code with LaTeX code. This will be clarified in this document.
Lyx uses paragraph styles (which are called "environments" in Lyx parlance) to govern formatting of document pieces. There are styles for different level headers, for emphasis, for peoples' names, for code snippets. And you can make your own styles, although that isn't simple.
If you use LyX, your documents will output as beautifully typeset documents with consistently professional formatting. They'll look like a book you see in the bookstore. And because LyX handles the formatting, you can spend your time and energy on what you're writing, not how it will look.
As mentioned, the LyX default styles may not format exactly how you want. In such cases you can modify styles or even make your own. This web page contains tutorials that walk you through creating your own style.
WYGIWYM has spacing ramifications. Spaces are considered nothing but word separators, and as such multiple spaces are output as a single space. Likewise, carriage returns (newlines and the like) are simply paragraph separators, and as such you cannot make a blank line by inserting an additional return. Blank lines should never be necessary. Instead, each paragraph specifies interparagraph spacing, spacing before the first of such paragraphs, and spacing after the last of such paragraphs.
This is a matter of philosophy. Do we view a book as 300 pages, each of which is a sketch or painting? Or do we view it as parts containing chapters containing various levels of headings containing paragraphs of varying types, such as normal body text, code examples, notes, tips, warnings and the like. LyX takes the latter view, and thus simply declares the formatting of various paragraph styles. Such formatting can be complex, including lines, graphics, justification, spacing, and almost anything else you can think of. The beauty of this philosophy is once you've decided the properties of each paragraph style, those decisions are applied uniformly throughout your book. If you decide to change one of those styles, every paragraph of that style is instantly updated throughout your book.
A cynic might label this as WYGIWWA - "What You Get Is What We Allow". Lyx makes the rules and unless you're knowledgeable enough to change those rules you just accept what Lyx says you get. This is one of the reasons for the paragraph and character style examples on this page -- to let you use Lyx without settling for an unsatisfactory format.
Data safety was the #1 reason I chose LyX. The books I write are vital
to my business.
===============================
Heading
Paragraph Style |
Key
Binding |
Part | |
Chapter | M-p 1 |
Section | M-p 2 |
Subsection | M-p 3 |
Subsubsection | M-p 4 |
Paragraph | M-p 5 |
Subparagraph | M-p 6 |
The preceding styles called "Paragraph" and "Subparagraph" are headings, not body text type paragraph styles. Body text is most accurately mapped to the LyX environment called "Standard" |
List
Paragraph Style |
Key
Bind |
Style Description |
Itemize | M-p b | Bulleted list |
Enumerate | M-p e | Numbered list |
Description | M-p d | 2 column list of short terms on the left, and a long definition on the right. The term on the left is bold |
List | M-p l
(lower case L) |
Similar to List, but left hand term is not bold. |
Special
Paragraph Style |
Key
Bind |
Style Description |
LyX-Code | M-p c | Use this for a source code listing. Fixed width font. Unlike other LyX styles, this one allows multiple spaces in order to accurately reflect a source file. |
Quotation | M-p Q | Used for a long quote (i.e. quoting a paragraph of the State of the Union Address). |
Quote | M-p q | Used for a short quote (i.e. "A penny saved is a penny earned".) |
Verse | M-p v | Used for poetry and prose. All lines after the first line of the paragraph are indented. |
Caption | M-p M-c | This is a mechanism to title figures and tables, and must be used in conjunction with figure floats and table floats. |
Special
Paragraph Style |
Key
Bind |
Style Description |
Title | M-p t | Title of the book |
Author | M-p A | Author of the book |
Date | M-p D | Date of the book |
Bibliography | M-p B | Bibliography |
Frustratingly, fonts like font-code are sometimes referred to as styles in the LyX world. In fact, using font-code introduces a \family typewriter into the LyX file, so it's no different from using <tt> in your HTML to represent code. There's not a one to one correspondence.
Nevertheless, it's easiest to use font-code to represent a small slice
of code within a larger paragraph. Here are some of the other fonts I use
to represent things:
font-emph | C-e | Emphasized text (italicized) |
font-code | Create in ~/.lyx/ui/default.ui. | Filenames, tiny commands and other code like things within a larger paragraph (fixed spaced text) |
font-noun | M-c c | Terminology -- words to be defined, etc. (small caps) |
Styles are supposed to map to usages, and it's obvious that the preceding fonts do not. So they're a compromise. But it works as long as you don't use italics, smallcaps or monofonts for other things. If you do not, then when LyX gains character style capabilities it will be trivial to search/replace these fonts with real styles.
But of course you will use italicized, fixed space and small cap text for other things. That's OK as long as those other usages are done with color pseudostyles.
Preamble % %%% Pseudo character styles indexed by color %%% \usepackage{ifthen} \renewcommand{\textcolor}[2]{% \ifthenelse{\equal{#1}{blue}}{{\textsl{\textsf{#2}}}}{}% Steps \ifthenelse{\equal{#1}{magenta}}{{\textsl{\textsf{#2}}}}{}% Chapters \ifthenelse{\equal{#1}{magenta}\or\equal{#1}{blue}}{}{#2}% fallthrough } EndPreamble |
The Preamble and EndPreamble keywords are LyX code. Everything between them is LaTeX code. In fact, it's safe to assume that any code between Preamble and EndPreamble is LaTeX code.
The ifthen package bestows the ability to assign according to choices -- in this case colors. the \usepackage keyword incorporates that package much the same as a Perl use or a C include.
Style Note LatexType Environment LatexName note_l LabelType Centered_Top_Environment LabelString "NOTE" AlignPossible Left LeftMargin "MMMMM" RightMargin "MMMMM" ParSkip 0.7 ParSep 0.7 TopSep 0.7 BottomSep 0.7 Font EndFont Preamble \setlength{\scratchLength}{\leftmargin} \addtolength{\scratchLength}{1cm} \newenvironment{note_l} { \begin{list}{} { \setlength{\leftmargin}{\scratchLength} \setlength{\rightmargin}{\leftmargin} \setlength{\parsep}{1cm} } \item[] \hrulefill \\[0.1cm] {\centering\large NOTE \\[0.2cm]} } { \\[0.2cm] .\hrulefill \\ \par \end{list} } EndPreamble End |
In the preceding, the style is described first in LyX code (everything except that between Preamble and EndPreamble), and a parallel description in LaTeX (everything between Preamble and EndPreamble). You'll note that I didn't bother to put the lines in the LyX version.
Note also there are plenty other ways to do this. The best way is probably to enclose the note in a minipage, but I don't know how to do that yet.
Because once you learn it, you can easily and quickly produce books, reports and other large documents that are professionally formatted and typeset. These documents can be put into Postscript or PDF format so they print correctly everywhere.
I chose LyX after getting tired of inconsistent typefaces. After getting tired of having to remember whether I made a style for things. After getting tired of trying to remember what font I made a given entity the last time.
I got tired of manually tweaking books to get the paging right. I got tired of inaccurate tables of contents. I got tired of printing inconsistencies.
I got tired of my word processor slowing me down. That same word processor that seemed so easy to learn ages ago, but now confounded me with an array of formatting choices seemingly every paragraph.
Now I can reasonably expect to write a professional looking book, and send a postscript file to the print shop of my choice.
But LyX requires a serious committment. A person who could learn MS Word or Star Office in a day could take a week or more to learn Lyx unless they approach that learning process the right way. The creation and modification of environments (styles) in LyX are inobvious to say the least. You will not successfully write books with Lyx unless you make a serious committment to learn the program and style modification. This page contains an article called The Fast Way to Learn Lyx, designed to make your committment much more achievable.
LyX suits your needs if you need its benefits and can handle its costs. The benefit is uniformly consistent formatting of your books, reports and other large documents, without your needing to oversee that consistency. The cost is learning LyX (easy) and learning to create and modify its styles (difficult, but made much easier by the tutorials on this page).
But that doesn't mean it will be easy. Changing default environment to format mappings is much more difficult with LyX than with standard word processors. See the article titled The Fast Way to Learn Lyx to minimize the LyX training period.
Here are some of the questions you'll need to answer in order to decide for or against Lyx:
Take the tutorial later in this web page. If you're successful with it you'll probably be able to commit to Lyx. If you cannot do the tutorial after many repeated attempts, Lyx is probably not for you. That is, unless you have a consultant who can modify document classes and environments. Many businesses have computer experts create macros and templates so that less technical people can produce corporate standard documents.
Run performance tests to see how Lyx works on your computer with books resembling the size and structure of yours. This page contains a C program you can use to create just such a test book. If you can't compile the program, have a programmer friend do it. If the performance is insufficient, you'll need to
LyX has two distinct aspects:
#2 is much harder than with other word processors. First, most word processors allow you to format content on the fly. LyX doesn't allow that because on-the-fly formatting leads to inconsistant and amatuerish documents. If you want professional looking documents, LyX is your product.
But changing the mapping of styles to formatting is much harder than in programs like WordPerfect, MS Word or StarOffice. It requres knowledge of LyX coding and the LaTeX markup language. Both are extensively documented, but unfortunately the documentation is a reference, not a tutorial.
So I created some tutorials to walk you through creating and formatting your first LyX style (LyX styles are actually called "environments"). Those tutorials appear on this page. These tutorials will take you one to four hours, after which you'll be ready to create custom environments to make your document look the way you want it to, consistently.
In summary, if you'd like to trim the LyX learning process down to a day or two, do the LyX tutorial, and then do the tutorial on this page.
To shorten the learning time, use tutorials. Start with the tutorial that comes with LyX (Help->Tutorial).
This tutorial and the next one are designed to condense a week of manual reading, emailing and experimentation into two 1 hour tutorials. This is the first tutorial, designed to give you the fundimentals. Read on...
Font
Size Giant
EndFont
The key distinction is that the .layout file must name an existing document class in order to be included in the Layout->Document->Document->Class dropdown list. So once we referenced existing document class article (inside the brackets), we get what we want. Almost.
There are still 2 problems:
Now copy article.layout.org back to
article.layout
with the following command:
cp -p article.layout.org article.layout Also, delete aarticle.layout. |
A couple facts for those of you trying to transpose this to a Windows-based
system:
~/.lyx means the .lyx directory (yes, it starts with
a dot) off your home directory. The tilde is UNIX shorthand for "home".
Font
Size Giant
EndFont
Create the following file, called barticle.layout, in your lyx/layouts
directory:
#% Do not delete the line below; configure depends on this # \DeclareLaTeXClass[article]{article (Whopper Enabled)} # Article textclass definition file. Taken from initial LyX source code # Author : Matthias Ettrich <ettrich@informatik.uni-tuebingen.de> # Transposed by Pascal André <andre@via.ecp.fr> # Heavily modifed and enhanced by serveral developers. # Input general definitions Input stdclass.inc # There are no chapters in an article. NoStyle Chapter NoStyle Chapter* MaxCounter Counter_Section SecNumDepth 3 TocDepth 3 Preamble \newenvironment{whopr}{\begin {Huge}}{\end{Huge}\linebreak} EndPreamble Style Whopper LatexType Environment LatexName whopr Align Left AlignPossible Left Font Size Giant EndFont End |
Next reconfigure Lyx with Edit->Reconfigure. This reads in your new barticle.layout., which implements a style called "article (Whopper Enabled)".
Create a new file called y.lyx, giving it a title, author and a couple sections.
Layout->Document->Document->Class dropdown list, and select article (Whopper Enabled).
Type a couple lines in the standard environment, then press Enter to start a new line, and select Whopper from the environment list, and type a couple lines. You'll notice that the font is very large.
Hit Enter, note that you're still in Whopper environment, and type some more.
Save the file, then View->Postscript, and note that the lines formatted as Whopper are large in the output also.
This command creates a new LaTeX (not LyX) environment. It therefore is reflected in the appearance of the Postscript or DVI output, not in the Lyx program.
The general form for this type of command is:
\newenvironment{name}[num]{before}{after}{name} is the name of the environment. [num] is optional (all LaTeX encased in square brackets is optional). {begin} contains all text and commands to be executed before printing the content typed into the environment. {after} contains all text and commands to be executed after the content typed into the environment. In this case before the content the font is changed to Huge. After the content the Huge font is removed, reverting text back to its original condition. And then a linebreak is inserted, because we want the Whopper environment to resemble a heading style.
LaTeX Font Sizes | LyX Font Sizes | |
\tiny | Tiny | |
\scriptsize | Smallest | |
\footnotesize | Smaller | |
\small | Small | |
\normalsize | Normal | |
\large | Large | |
\Large | Larger | |
\LARGE | Largest | |
\huge | Huge | |
\Huge | Giant |
\newenvironment{name}[num]{before}{after}Where {name} is the name of the new environment, [num] is optional and beyond the scope of this discussion, {before} is text and commands run before the content, and {after} is the text and commands run after the content. Typically the {after} "undoes" the effect of the {before}.
\newenvironment must be used ONLY when the environment didn't yet exist. To modify an existing environment use \renewenvironment.
\newenvironment{name}[num]{before}{after}
#define PARTSPERBOOK 2 #define CHAPTERSPERPART 4 #define SECTIONSPERCHAPTER 4 #define SUBSECTIONSPERSECTION 2 #define SUBSUBSECTIONSPERSUBSECTION 1 #define PARAGRAPHSPERSUBSUBSECTION 2 #define SUBPARAGRAPHSPERPARAGRAPH 2Because of a bug in the program you can't set any of them to zero, but you can keep them from printing.
At the bottom of the program are the print() methods for each of the Environment objects (Subparagraph, Paragraph, Subsubsection, Subsection, Section, Chapter, Part, Book). To keep one from printing, simply give it an empty print method (or comment out the existing print method code. Code in the print method must print the appropriate header, print the text under the header, and update the Stats object with what has been printed. It's fairly obvious.
Here's how you use the program:
Create a new Lyx document File/New Layout/Document/Document In the Class dropdown, select either Book, Book (AMS), or Book (Koma-Script) Click the OK button to return to the Lyx document Type in the word "placeholder". File/Save as, and save as x.lyx. Modify makelyxbook.cpp: Modify the per-parent constants Modify the various class's print() methods Compile the program to a.out Create the document
- ./a.out > temp.tmp
- vim temp.tmp x.lyx
- Yank entirety of temp.tmp
- Switch to x.lyx
- Paste just before the line saying \the_end
- Save x.lyx and quit vim
- Pull up x.lyx in lyx
// ####################################################################### // makelyxbook.cpp: Lyx test book creator, version 0.2.0 // Copyright (C) 2001 by Steve Litt (Steve Litt's email address) // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation version 2 of the License. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. // // Steve Litt, Steve Litt's email address, http://www.troubleshooters.com // ####################################################################### // ####################################################################### // ####################################################################### // ####################################################################### // HISTORY // V0.1.0 // Creates test book in lyx format // // BUGS: // The contstants controlling child environment objects must be // one or greater, even if you do not wish any child objects. // Placing a value of 0 for any of these will cause in infinite // loop. // // To implement zero child environments in the book, simply // empty the corresponding class's print() method. # // // Version 0.1.0 was a lame OOP implementation. //Steve Litt, 8/16/2001 //End of version 0.1.0 // V0.2.0 // Replaced OOP with simple loops. Fixed but where you couldn't // have PER vars with a zero value. Shortened the code. // // User modifications happen in the PER constants at the top, // and the print routines at the bottom. // // BUGS: // The contstants controlling child environment objects must be // one or greater, even if you do not wish any child objects. // Placing a value of 0 for any of these will cause in infinite // loop. // // To implement zero child environments in the book, simply // empty the corresponding class's print() method. # // // Version 0.1.0 was a lame OOP implementation. //Steve Litt, 8/17/2001 //End of version 0.2.0 //END OF HISTORY // //SOURCE CODE CONFIGURATION: // The test book output is controlled by source code changes to // two sections of this program. First are the child per parent // constants (PARTSPERBOOK, CHAPTERSPERPART, // SECTIONSPERCHAPTER, SUBSECTIONSPERSECTION, // SUBSUBSECTIONSPERSUBSECTION, // PARAGRAPHSPERSUBSUBSECTION,and // SUBPARAGRAPHSPERPARAGRAPH). These constants // are located at the top of the source file. These constants // control how many children each environment object has. For // instance, a CHAPTERSPERPART of 3 would mean each part // contains three chapters. These constants are at the top // of the program, just below these comments. // // Secondly, each environment has a print routine that // controls how it prints and how it reports that printing to // the Stats object. Here is where you control how much // standard text is printed for each environment object. // Those print routines are at the bottom of the program. // // ####################################################################### #include <iostream.h> //********************************************************** //********************************************************** // Modify the following constants to achieve the best structure // and size for your Lyx test document //********************************************************** //********************************************************** #define PARTSPERBOOK 2 #define CHAPTERSPERPART 4 #define SECTIONSPERCHAPTER 4 #define SUBSECTIONSPERSECTION 2 #define SUBSUBSECTIONSPERSUBSECTION 1 #define PARAGRAPHSPERSUBSUBSECTION 0 #define SUBPARAGRAPHSPERPARAGRAPH 0 //********************************************************** //********************************************************** // End of modifiable constants //********************************************************** //********************************************************** void printBook(int n); void printPart(int n); void printChapter(int n); void printSection(int n); void printSubsection(int n); void printSubsubsection(int n); void printParagraph(int n); void printSubparagraph(int n); //******************************************************* // Stats class //******************************************************* class Stats { long Words; long Lines; long Subparagraphs; long Paragraphs; long Subsubsections; long Subsections; long Sections; long Chapters; long Parts; public: long getWords(){return Words;}; long getLines(){return Lines;}; long getSubparagraphs(){return Subparagraphs;}; long getParagraphs(){return Paragraphs;}; long getSubsubsections(){return Subsubsections;}; long getSubsections(){return Subsections;}; long getSections(){return Sections;}; long getChapters(){return Chapters;}; long getParts(){return Parts;}; void incWords(long a){Words += a;}; void incLines(long a){Lines += a;}; void incSubparagraphs(long a){Subparagraphs += a;}; void incParagraphs(long a){ Paragraphs+=a;}; void incSubsubsections(long a){ Subsubsections+=a;}; void incSubsections(long a){ Subsections+=a;}; void incSections(long a){ Sections+=a;}; void incChapters(long a){ Chapters+=a;}; void incParts(long a){ Parts+=a;}; void setWords(long a){Words = a;}; void setLines(long a){Lines = a;}; long setSubparagraphs(long a){ Subparagraphs=a;}; long setParagraphs(long a){ Paragraphs=a;}; long setSubsubsections(long a){ Subsubsections=a;}; long setSubsections(long a){ Subsections=a;}; long setSections(long a){ Sections=a;}; long setChapters(long a){ Chapters=a;}; long setParts(long a){ Parts=a;}; void show(); }; void Stats::show() { cout << endl << endl; cout << "Words = " << getWords() << "," << endl; cout << "Lines = " << getLines() << "," << endl; cout << "Subparagraphs = " << getSubparagraphs() << "," << endl; cout << "Paragraphs = " << getParagraphs() << "," << endl; cout << "Subsubsections = " << getSubsubsections() << "," << endl; cout << "Subsections = " << getSubsections() << "," << endl; cout << "Sections = " << getSections() << "," << endl; cout << "Chapters = " << getChapters() << "," << endl; cout << "Parts = " << getParts() << endl << "." << endl; } Stats stats; long printLine(long a) { cout << "\\layout Standard" << endl << endl; for(int n=0;n<a;n++) { cout << "abcde "; if((n+1)%12 == 0) cout << endl; } cout << endl; return(a); } //******************************************************* // End of Stats class // Note declaration of stats var above. //******************************************************* void do1Subparagraph(int n) { printSubparagraph(n); } void do1Paragraph(int n) { printParagraph(n); for(int n=0; n < SUBPARAGRAPHSPERPARAGRAPH; n++) do1Subparagraph(n+1); } void do1Subsubsection(int n) { printSubsubsection(n); for(int n=0; n < PARAGRAPHSPERSUBSUBSECTION; n++) do1Paragraph(n+1); } void do1Subsection(int n) { printSubsection(n); for(int n=0; n < SUBSUBSECTIONSPERSUBSECTION; n++) do1Subsubsection(n+1); } void do1Section(int n) { printSection(n); for(int n=0; n < SUBSECTIONSPERSECTION; n++) do1Subsection(n+1); } void do1Chapter(int n) { printChapter(n); for(int n=0; n < SECTIONSPERCHAPTER; n++) do1Section(n+1); } void do1Part(int n) { printPart(n); for(int n=0; n < CHAPTERSPERPART; n++) do1Chapter(n+1); } void do1Book(int n) { printBook(n); for(int n=0; n < PARTSPERBOOK; n++) do1Part(n+1); } main(void) { do1Book(1); cout << endl; } //********************************************************** //********************************************************** // This section contains the print routines for each environment // type. By modifying these you can customize your test document. // // Note that if you don't want lower level environments like // paragraphs or subparagraphs you can simply create them with // empty print routines. // // Be sure to always change your ::stats.inc calls to accurately // reflect the totals for words and heading types. //********************************************************** //********************************************************** void printBook(int n) { cout << "\\layout Title" << endl << endl; cout << "Automatically Produced Test Lyx Book" << endl; ::stats.incWords(5); }; void printPart(int n) { cout << "\\layout Part" << endl << endl; ::stats.incParts(1); ::stats.incWords(6); cout << "This is a Part: "; cout << ::stats.getParts() << " : "; cout << n << endl; ::stats.incWords(printLine(20)); ::stats.incLines(1); ::stats.incWords(printLine(20)); ::stats.incLines(1); }; void printChapter(int n) { cout << "\\layout Chapter" << endl << endl; ::stats.incChapters(1); ::stats.incWords(6); cout << "This is a Chapter: "; cout << ::stats.getChapters() << " : "; cout << n << endl; ::stats.incWords(printLine(20)); ::stats.incLines(1); ::stats.incWords(printLine(20)); ::stats.incLines(1); }; void printSection(int n) { cout << "\\layout Section" << endl << endl; ::stats.incSections(1); ::stats.incWords(6); cout << "This is a Section: "; cout << ::stats.getSections() << " : "; cout << n << endl; ::stats.incWords(printLine(20)); ::stats.incLines(1); ::stats.incWords(printLine(20)); ::stats.incLines(1); }; void printSubsection(int n) { cout << "\\layout Subsection" << endl << endl; ::stats.incSubsections(1); ::stats.incWords(6); cout << "This is a Subsection: "; cout << ::stats.getSubsections() << " : "; cout << n << endl; ::stats.incWords(printLine(200)); ::stats.incLines(1); ::stats.incWords(printLine(200)); ::stats.incLines(1); ::stats.incWords(printLine(200)); ::stats.incLines(1); ::stats.incWords(printLine(200)); ::stats.incLines(1); ::stats.incWords(printLine(200)); ::stats.incLines(1); ::stats.incWords(printLine(320)); ::stats.incLines(1); }; void printSubsubsection(int n) { cout << "\\layout Subsubsection" << endl << endl; ::stats.incSubsubsections(1); ::stats.incWords(6); cout << "This is a Subsubsection: "; cout << ::stats.getSubsubsections() << " : "; cout << n << endl; ::stats.incWords(printLine(100)); ::stats.incLines(1); ::stats.incWords(printLine(100)); ::stats.incLines(1); ::stats.incWords(printLine(100)); ::stats.incLines(1); }; void printParagraph(int n) { cout << "\\layout Paragraph" << endl << endl; ::stats.incParagraphs(1); ::stats.incWords(6); cout << "This is a Paragraph: "; cout << ::stats.getParagraphs() << " : "; cout << n << endl; ::stats.incWords(printLine(120)); ::stats.incLines(1); ::stats.incWords(printLine(120)); ::stats.incLines(1); }; void printSubparagraph(int n) { cout << "\\layout Subparagraph" << endl << endl; ::stats.incSubparagraphs(1); ::stats.incWords(6); cout << "This is a Subparagraph: "; cout << ::stats.getSubparagraphs() << " : "; cout << n << endl; ::stats.incWords(printLine(20)); ::stats.incLines(1); ::stats.incWords(printLine(20)); ::stats.incLines(1); }; //********************************************************** //********************************************************** // End of print routines //********************************************************** //********************************************************** |
:%s/^/lyxxyl/ :%s/^lyxxyl^I^I^I^I^I^I/\\layout Subparagraph\r\r/ :%s/^lyxxyl^I^I^I^I^I/\\layout Paragraph\r\r/ :%s/^lyxxyl^I^I^I^I/\\layout Subsubsection\r\r/ :%s/^lyxxyl^I^I^I/\\layout Subsection\r\r/ :%s/^lyxxyl^I^I/\\layout Section\r\r/ :%s/^lyxxyl^I/\\layout Chapter\r\r/ :%s/^lyxxyl/\\layout Part\r\r/ |
To fix the date at the date the doc was written, do one of these two things:
ln -s /d/at/books/utp/utpbook.layout /home/slitt/.lyx/layouts/utpbook.layoutAfter doing this, you might need to run the texhash program, and you'll probably need to perform Edit->Reconfigure from the Lyx menu.
However, you might want your layout file to accompany your book document's file. Remember, your book document is worthless without the layout file that produced it, and even if you manage to recreate the layout file, any differences will cause big changes in the book.
You can
.