OpenStax-CNX module: m35053 1 How to edit custom layouts in Blurb * David Waldo This work is produced by OpenStax-CNX and licensed under the Creative Commons Attribution License 3.0 Abstract Blurb BookSmart software allows you to create custom books and make your own layouts. However, there are limitations to the layout editor. This module shows you how to dig into the XML code that BookSmart uses and x some of these limitations. 1 How to edit custom layouts in Blurb This module is written for Blurb BookSmart Version 2.5.1.30022. This version allows editing of Layouts but still has some limitations on its use. This module describes how to edit the XML le that contains custom Layouts for BookSmart. I take no responsibility if BookSmart quits working or if you lose data. I am supplying this information so that you will know what I did. Use this information at your own risk. 1.1 Reasons for editing the custom layouts Blurb has added the ability to edit custom layouts in its BookSmart software. However, there are a couple of things that it does not allow you to do that would make editing layouts much nicer. The rst drawback to the layout editor is it does not allow you to make a layout that works for both right and left pages. The second drawback to the layout editor is it does not allow you to have text boxes that ow text from one box to the next when you paste into them. As an example, after making a new Small Square blank book in BookSmart I will add several pages and then look at one of the built in Text Layouts. Here are two pages in the book, a left and a right page. Notice that the margin in the center is bigger than the ones on the left and right even though the same page layout is used. Also, the text ows from one text box to the other when text is pasted into the left box. * Version 1.2: Aug 9, 2010 7:47 pm -0500 http://creativecommons.org/licenses/by/3.0/
OpenStax-CNX module: m35053 2 Figure 1 Now let's make our own layout using the same built in layout. First I will make a blank right page using the Text Layout above.
OpenStax-CNX module: m35053 3 Figure 2 Now select Edit Layout. The layout editor opens with this view:
OpenStax-CNX module: m35053 4 Figure 3 Notice that the text boxes are locked. The reason is the text can ow from one to the other. If we want to edit them they must rst be unlocked.
OpenStax-CNX module: m35053 5 Figure 4 Now hit the Apply & Save to My Layouts button and the layout shows up in the new custom layouts. I will name it CustomLayout0. Now after making the same two pages with the new layout I see this.
OpenStax-CNX module: m35053 6 Figure 5 Notice that the text does not ow to the second text box and the boxes do not change position for the right page. Looking at the middle of the book you can see that the text box for the right page will be too close to the gutter. The header and footer move but the other boxes do not. These "problems" can be xed by editing the document where the custom layouts are stored. 1.2 XML Editor To edit the custom layouts you can either use a simple text editor or an XML editor. I use XML Notepad 2007 1 from Microsoft. Pick an editor that works good for you. You should be familiar with XML or other markup languages like HTML. 1.3 Custom Layouts in BookSmart When you make a custom layout in BookSmart the layout information gets added to a le with the name CustomLayouts.layout. This can be found in the library location directory in the subdirectory BookSmartData\CustomLayouts. You may have to search around for this le on your computer. Opening this le in XML Notepad shows the following. 1 http://www.microsoft.com/downloads/details.aspx?familyid=72d6aa49-787d-4118-ba5f-4f30fe913628&displaylang=en
OpenStax-CNX module: m35053 7 Figure 6 The dierent TrimSize items are the dierent book sizes. Since I made a book of the type Small Square above I will look for the layout that I made. It has the TrimSize:Square. Figure 7 Notice that there are some pagelayouts in this TrimSize. Opening up the pagelayouts shows the layout I made above.
OpenStax-CNX module: m35053 8 Figure 8 Let's look at the items in this layout. Notice the title is CustomLayout0. This is the name I gave the layout when I created it. The dimensions of the page (and other dimensions) are given in the units of points. So when you edit in the layout editor, the units of points should be used. Since the page is square, notice that the width and height of the page are the same, 495 points. BookSmart measures from the upper left corner so that the point (x,y)=(0,0) is the upper left corner of the page. Also, the true on the hasheader and hasfooter mean this page will have a header and a footer. The id is probably generated randomly, but each pagelayout needs to have a unique id. Now let's look at the containers.
OpenStax-CNX module: m35053 9 Figure 9 Remember that the page layout had three containers, two text containers and one image container. Notice that the left most text container starts at the x position 45 points. The other two containers both line up at x=237 points. 1.4 Editing Custom Layouts When you start BookSmart it loads the custom layouts for the CustomLayouts.layout le. So, if you edit the le at the same time BookSmart is open you can overwrite your edits. To make and edit custom layouts you should 1. Open BookSmart and the book you want to edit 2. Make a Left side page and select a built in layout 3. Edit the layout and save the layout in your custom layouts 4. Quit BookSmart 5. Open XML Notepad and the le CustomLayouts.layout 6. Edit the layouts and save the le 7. Quit XML Notepad 8. Open BookSmart and the book you want to edit 9. If you edited your layout correctly the changes should be in the custom layouts
OpenStax-CNX module: m35053 10 1.5 Correcting layout for Left/Right pages The two "problems" I will describe how to correct are how to make a layout work for both the left and right pages and how to get the text boxes to ow the text from one to another. In order for this to work correctly you must make a layout for the LEFT PAGE rst. Make everything line up the way you want the left page to look like and save the layout. Let's change the layout we made earlier so that it works for both the left and right pages. I made the layout using the left page. If you examine the built in layouts in BookSmart for the layout we are using you will see that for a right page the left container has x=78 points. The left container for the left page has the same container at x=45 points. Subtracting these gives 78-45=33 points. This is the amount that the containers are translated for the right page relative to the left. This will be dierent for the dierent book sizes so you will need to gure out this number for each book size. Each container in the custom layout has a property called xtranslate. This tells BookSmart how far to move containers for the right side page. This number can be negative if you wish. For this example we will just make them 33 points. In XML Notepad the edits look like this. Figure 10
OpenStax-CNX module: m35053 11 I changed the xtranslate values to 33. If I save these changes, open the book in BookSmart and apply these changes to the pages, they will look like the following. Figure 11 In order to apply the changes to the pages I have to click on another layout and then on the layout we edited. If you just click on the same layout BookSmart thinks it doesn't have to apply the layout since it is already applied to the page. See now that the containers for the right page have now moved over 33 points so that the center looks right. 1.6 Correcting Text Flow Now let's x the automatic text owing from one container to the next. There are two text containers in our layout and we will make the text ow from the left container to the right container. The text containers have two properties that we will need to change, owsorder and contenttype. I must say at this point that I do not know exactly what the values are for these properties. However, I do know how to set them to get them to work for me. Here is what I do. The owsorder property is a numbering of the containers to determine the order of the text ow. They are set to -1 now so we will number them starting from 0. The left box will be 0 and the right box will be 1. Right now the contenttype property for the text boxes is 0. I have noticed that the contenttype property for the text boxes that ow can be 1. So, I change the value of the contenttype to 1. I am not sure what this means but it seems to work. Here is what the changes look like.
OpenStax-CNX module: m35053 12 Figure 12 After applying these changes to the pages the book looks like this.
OpenStax-CNX module: m35053 13 Figure 13 1.7 Mirror Pages When making pages that are mirror images there are a few things to keep in mind. First, text still needs to ow from left to right so be careful not to make it exactly mirror image. Let's make a mirror image of a page with only one text box and one image. Suppose we want to make a version of this built in layout but with the image on the outside rather than the inside.
OpenStax-CNX module: m35053 14 Figure 14 Edit the layout for the LEFT page and swap the location of the boxes. Save the layout.
OpenStax-CNX module: m35053 15 Figure 15 Open the layout in XML Notepad. Here is the layout.
OpenStax-CNX module: m35053 16 Figure 16 When you edit the layout, look at the size of the header since we will want to line things up with the header/footer. The x location and size for the header is width=372, x=45 points. When it is moved by 33 points for the right page it will have x=78. The right side of the header will be at 78+372=450. Lets gure out the xtranslate for the ImageContainer. The width is 244. After it is translated we want the right side to be at 450. Therefore we want the left side to be at 450-244=206. Right now it is at 45. So we need it to translate 206-45=161 points. Set the xtranslate to 161. Lets gure out the xtranslate for the TextContainer. The left side is at x=301. After it is translated we want the left side to be at 78. So we need it to translate 78-301=-223 points. Set the xtranslate to -223.
OpenStax-CNX module: m35053 17 Figure 17 After applying the changes to the pages we have the layout we want.
OpenStax-CNX module: m35053 18 Figure 18