Publishing Style Sheets are the heart of CatBase. They tell the program:
Every publishing job can be broken down into paragraphs. There might be just one paragraph of information for each item (as in a simple telephone directory), or there might be a number of paragraphs (as in a catalogue). Each Publishing Style Sheet is constructed by adding Paragraphs in the order in which they will be published.
Each Paragraph contains one or more Elements.
Elements are the "building blocks" of Paragraphs.
An Element can contain:
You can add any number of Elements, in any order, to each Paragraph.
To illustrate the way Paragraphs and Elements are used, let's look at an entry from a basic telephone directory:
Joe Bloggs ..................123 1234
1234 Main St.
This entry consists of two Paragraphs.
The first paragraph consists of three database fields: the first name, last name, and telephone number. It also contains two additional elements: a space between the first and last names, and a Tab between the last name and phone number. So this paragraph contains five Elements:
Field: first name
Text: a space
Field: last name
Punctuation: a Tab
Field: telephone number.
The second paragraph contains just one Element: the address. Also, note that it's indented.
The formatting for each paragraph is determined by selecting a Paragraph Stylesheet. This determines all aspects of the formatting, such as the font, style, size, indents, tab settings, and so on.
Before proceeding with this Tutorial, you might like to review How CatBase and your Page Layout Program Work Together.
You can have any number of Publishing Stylesheets. For example, you might want to create one to produce your catalogue, another to create a price list, another to create a cross-reference index for your catalog, and perhaps one to upload your data to your website's MySql or SqlServer database.
The first thing you must decide is which table to build the Publishing Stylesheet on. It all depends on how you want the data to be sorted.
Let's start by creating a simple telephone directory like the one shown above. We will use the Telephone Directory project from our Demo Database. This project has two tables: White Pages and Yellow Pages:
A new Paragraph is created:
The Paragraph Stylesheet is essential, as this is what will determine how the contents of this Paragraph will be styled when the data is published.
You now have one Paragraph:
Now we need to choose exactly what's going in to that Paragraph We want it to look like this:
Fred Bloggs .......................123 456 7890
That's five Elements.
This is how a new Element looks:
Your Paragraph now looks like this:
Now your Paragraph should look like this:
If you've got the Elements in the wrong order, you can drag and drop them within the list to re-order them.
We just need to add the second Paragraph:
You should now have two Paragraphs:
That's it - you have created a simple Publishing Stylesheet!