3 followers Follow

How to create book and chapter headers in BookWright

Follow these steps to have both book (left page) and chapter (right page) headers for all the pages on which you want them.

There are two methods: Tedious and Simple

The Tedious method requires only knowledge of BookWright, while the Simple method requires a text editor and a little adventure.
In the descriptions, I use the "spread" layout, but both methods can also apply to a "left" or "right" layout. If you are not familiar with modifying and saving layouts, just give it a try. Open a new book or an empty one (I use one I call "test book"), drag a layout onto a page, modify it and save the layout with a name. Layouts do not save text or images, just the containers.

Tedious Method
1. Create a "spread" layout including containers for the text, perhaps based on one already in BookWright. Save it with a descriptive name (like "5x8 wide gutter margin").
2. Apply that layout to a blank page spread and add header text containers, one on each of the two pages. Save it as a similar name but add "with Headers" to the  name.
3. Open an empty or new book and use the 'Add Text File' procedure to add (drag and drop) an RTF file of your main content to the book using the first layout you saved (without the headers). You'll find the layout in "My Layouts", when prompted by the dialog box.
4. On the left side, select all the pages to which you want to add page headers (click the first one, then shift-click the last one) and then in Layouts, My Layouts, double-click your duplicate layout that has "with Headers" added to the name (the phrase is just a note to ourselves). Wait a few seconds to see the headers appear. Click on a non-selected page to de-select all the other pages.
5. On the first page with headers, click in the header on the left and either type the book title, or copy the text for the book title and paste into the book header (left page) container. You can format this container to use the font name, style (bold, italic), alignment (left, center, right), and size of text you want. Copy that formatted text.
6. In the next page below, click in the left page header container and paste the book title. Adjust if necessary. Repeat for all left pages (tedious part).
7. Copy the text for the first chapter title and paste into all the chapter header containers (right pages). Continue with the other chapters (more tediousness).

Simple Method
1. Perform steps 1 and 2 of the Tedious Method, listed above.
2. On your computer, go into your "Documents" folder, find the "Blurb" folder and go into its "MyLayouts" folder. There you should see all your saved layouts with the filenames you gave them and a ".layout" filename extension. These are xml files that can be edited with any text editor (Notepad on Windows, or TextEdit on Mac... see below for better recommendations).
3. Using a text editor, open your layout that has "with Headers" in the filename. If you are familiar with HTML and/or CSS code, you will feel comfortable here. If not, think of this as an adventure! Each container from BookWright is identified with the text "<container " at its beginning, and "</container>" at its end.
4. Locate the Header containers:  Each container has x= and y= values marking the upper (y) left (x) corner position on the page. Identify the two containers that have the smallest value for y=. Those are closest to the top of the page and are the Header containers. Of those two, the one with the smallest x= value is the left page header, the other is the right page header.
5. Locate the left Header's empty span container: 
(please note that the word "container" is actually the industry technical term for the items created by the angled bracketed "tags". In the XML language an "opening" tag <name > followed by a "closing" tag </name> forms a "container" called "name". So technically, we have just located BookWright's "container" containers. Now we will locate other xml containers inside those.)
  Inside the left Header container, there is a <text >...</text> container that in turn encompasses a <p >...</p> container. Inside that <p></p> container is a <span >...</span> container. These last two are the containers of interest to us.
6. Just before the angled bracket of the </span> tag, type in the text for your book title.
7. Locate the right Header's empty span container, and just before the angled bracket of the </span> tag, type in the text for the title of your chapter 1.
8. Save this file as Chapter 1 Headers:  using the File->Save As feature of the text editor, save this file into the same folder it came from with a filename that includes "Chapter 1" between the "with" and "Headers" of the phrase "with Headers" that is already in the filename.
9. Optional step: Format your Headers. Here is an example of a left header that I have modified to use my formatting.

<container width="215.9356964757168" type="text" id="bbbd1271-37dc-4a41-ac21-abfa0373fa5e" x="78.25186996649208" y="34.20872823038919" height="35.53126454140995">
<text rotate="0" valign="middle"><![CDATA[<p class="align-center line-height-qt"><span class="font-open-sans" data-ascent="16px" data-descent="5px" style="font-size:10px;color:#000000;font-style:italic;">Book Header​</span></p>]]></text>

Alignment options are performed by the <p > tag attribute "class=". Options are: align-left, align-right, align-center. My example above uses center alignment.
Font options are performed by the <span > tag attributes. The font color and size are set by the "style=" attribute. The size is set in the example above to be 10. The "px" is required after the number. That number will be displayed in the Blurb editor if you edit the header. The color is set to the html color code, in this example it is black. The font-style can be italic or bold, or don't use font-style at all.
The font name is controlled by the "class=" attribute. While the default is "font-arial", I have changed it in my example to "font-open-sans". Getting the font name spelling right is a bit of a hit-and-miss effort. Generally, spaces are not used and lower case is preferred. However, I could not find a combination of Century SchoolBook that would work, but only tried a couple of combinations. It is possible that BookWright has only provided classes for some of the fonts. If you are familiar with the CSS language, you could try using "font-family:'Century SchoolBook';" inside the "style=" attribute. I have not experimented with that.
10. If you performed step 9, save the file again with File->Save.
11. Perform steps 3 and 4 of the Tedious Method, repeated here for your convenience:
11.1 (Tedious 3.) Open a new book and use the 'Add Text File' procedure to add an RTF file of your main content to the book using the first layout (without the headers). You'll find it in "My Layouts".
11.2 (Tedious 4. updated) On the left side, select all the pages (of Chapter 1) to which you want to add page headers (click the first one, then shift-click the last one) and then in Layouts, My Layouts, double-click your layout that has "with Chapter 1 Headers" in the name. Wait a few seconds to see the headers appear. Click on a non-selected page to de-select all the other pages.
If you find a page where you do not want the header, just click on the header container and delete the text.
12. In your text editor, open the "with Chapter 1 Headers" .layout file and change the wording of the chapter title from that of chapter 1 to that of chapter 2. Using the File->Save As feature, save this version of the file as your filename but use "with Chapter 2 Headers" in the new filename.
13. Repeat step 12 for all your other chapters.
14. Repeat step 11 for all your other chapters.

Now you have both book and chapter headers for all the pages on which you want them.

A couple of things...
Page numbering:  If you plan to put page numbers at the top of the page, remember to leave room for them when you design your header container. Using the blue guides helps with the alignment and spacing issues.

If you want to add headers to just one page or one spread, such as a layout with a picture container and a text container, just select the page and either double-click or drag and drop the container onto the page. Some adjustment may be necessary to avoid overlap with the page header that should remain in place after the operation.

I have not tried these methods with only image containers, but I suspect it will work in the same way.

Good free text editors: The ones that come with the computer work, but are not as good as these...
•Notepad++ Text Editor
•Programmers File Editor (PFE)

•TextWrangler (free text editor)
•Komodo Edit (free, open source code editor)

If you want to have the text or code editor color-code your .layout file when you are editing it, find its setting for adding the .layout extention to the xml file extention types. Then it will recognize .layout files as being xml files.



Tom Berryhill

Please sign in to leave a comment.



Tedious, yes. The only other way I found to put in headers is the built-in header which is part of the background layer. It has only one value for the whole book, so it doesn't work at all for chapter headers. Also, if you want to leave it out for certain pages, such as the first page in a chapter, it still shows up.

It would be great if another solution shows up, but these two are the only ones I could devise. I have used them and they do work. Maybe put on some good music? :-)

Tom Berryhill 1 vote
Comment actions Permalink

Thanks Tom. For now the good music will have to suffice... Should another solution show up, I would love to know. 

ndindafah 0 votes
Comment actions Permalink

Community is not available in this language

Help Center