-
I explained this above - copy the documents in the binder and copy into the editor to create the linked list.
-
A “section break” is what a “page break” is called for ebooks. You will need to assign a Section Layout that has its “Separator before” set to “Section Break” to the Section Type that is assigned to the relevant sections. (Note: you need to understand about how Section Types and Section Layouts work for this. If you don’t, please refer to the section on them and Compile in the v3 tutorial. Alternatively, view the videos on our Learn & Support page or see the comprehensive coverage in the [url=https://www.literatureandlatte.com/scrivener-3-update-guide]Scrivener 3 Transition Guide
[/quote]
for details on moving to the system from a Scrivener 2 mindset.
Here is what you should do in your project to get this working (I’ll describe rather than simply providing the updated version of the project so that you can follow along and see how it all works yourself):
-
First, we’ll set up your Section Types. These tell Scrivener what the parts of your project are. As far as I can see, you have a table of contents and a bunch of songs, so we will se these up according. Go to Project > Project Settings.
-
In the “Section Types” area, rename “Section” to “Song” by double-clicking into it and typing over it.
-
Click “+” beneath the Section Types list and create a new Section Type called “Contents”.
-
Click “OK”.
-
Open the Inspector.
-
Switch to the metadata pane of the Inspector (the middle one with the tag icon).
-
Click on your song documents - note how the “Section Type” is given as “Song”, which is now the default.
-
Click on the “Contents” document and change the “Section Type” in the Inspector to “Contents”.
Your project is now set up so that you can tell Compile how you want the different sections formatted. Next:
-
Open Compile.
-
Choose “Ebook” from the Formats on the left - this provides a nice look for ebooks out of the box.
-
Click on “Assign Section Layouts…”. This is where you tell scrivener how each of your sections (Section Types) should be formatted.
Note that you now see a list of Section Types on the left, including the “Song” and “Contents” ones you created. On the right is a selection of layouts - these allow you to tell Scrivener how you want each one formatting.
-
Select “Song” from the list on the left, and then, on the right, select “New Section”. This assigns the “New Section” layout to “Song”, which, as you can see, has a section break before it.
-
Now select “Contents” on the left and assign it “Table of Contents (Bordered)” on the right.
-
Click “OK”.
-
Compile and examine the ebook.
That’s it - you now have an ebook with a table of contents that works and with songs that each start on a new section so don’t run into each other. You only need to set that up all once for your project - from now on, whenever you Compile, it’s all set up and good to go.
That said, I think you could make it look nicer. The problem at the moment is that, because you’ve written the titles at the start of each document, the titles aren’t formatted very nicely in the final ebook. So, try this:
-
In the binder, give each document the name of each song. (At the moment each document has no title and is just showing the first few words of the text - hence the italics.)
-
In Project > Project Settings, under “Custom Metadata”, add a new metadata type and name it “Singer” (or “Songwriter” or whatever is most apt). Then click “OK”.
-
In the Inspector Metadata pane, go through each song and add the necessary singer to each “Singer” field (e.g. “Billie Holliday” etc). Note that you will need to expand the “Custom Metadata” area to do this.
-
Go through each document and delete the singer/songwriter line that is written at the top of the text.
Now the title is contained in the binder, the singer is stored in custom metadata, and the text of each document only contains the lyrics. Now we can make the ebook look a little nicer:
-
Go to Compile again.
-
Ctrl-click on “Ebook” in the Formats list and select “Duplicate & Edit Format…”. This allows you to create a customised copy of the format. Compile will expand to show you controls you will find familiar from Scrivener 2.
-
Next to “Format Name” at the top, give the copied format a meaningful title, such as “Songs Ebook”.
-
Under “Section Layouts”, you’ll see a whole slew of possible layouts. These are different options that users can choose for their ebook, formatting, but you don’t need them all. Delete all of them except for “Table of Contents (Bordered)” and “New Section”.
-
Rename “New Section” to “Song Lyrics”.
-
Under the “Settings” tab for “Song Lyrics”, change “CSS class name” to “song-lyrics” (optional).
-
Tick “Title” for “Song Lyrics”. The title will be represented as “Section Title” at the top of the text preview below.
-
Click into the “Section Title” text in the preview and choose “Bordered Title”.
-
Click on “Title Options” and, in “Title Suffix”, make is that there is a newline (return character) followed by " by <$custom:Singer>" (replace “Singer” with “Songwriter” or whatever you used for the custom metadata title earlier).
-
Switch to the “Formatting” tab and click into where it says “by singer”. Change the style (where it says “No Style” above) to “Subtitle”.
-
Select “Table of Contents (Bordered)”, switch to “Title Options”, and change “Title Case” to “Normal”.
-
Click “Save”.
-
Click Compile.
Take a look at the ebook. Now it looks much nicer! Two things to note, though: The contents list doesn’t look that great because you copied it from auto-titled documents. Also, because the text is set up for prose, the first line of each section is not as indented as the rest. Let’s fix that:
-
In Compile, Ctrl-click on the “Songs Ebook” format and choose “Edit Format…”.
-
Choose “CSS” on the left, and then, under “Base text formatting”, click in the preview text and then drag the first line indent indicate to the left so that all of the text is flush-left with no indents.
-
Click “Save” and then hold down the Option key so that the “Compile” button changes to “Save” and press that too to return to your project.
-
In the “Contents” document, edit each line so that it reads more nicely. For instance, change “The thrill is gone (by BB King” to “The Thrill is Gone (BB King)”. (NOTE: You can just delete the contents, type out the titles as you want them, and then select each title and drag the document that it should link to onto the selected text. This turns the selected text into a link to the relevant document).
-
I’d also recommend going through the songs and making sure that there are no extra spaces around. For instance, in “The Thrill is Gone” there are two returns after the first verse instead of one as there is elsewhere.
-
Next, let’s add that “Return to Contents” link you wanted to the bottom of each song. For this, under each song, in the text, go to Edit > Emoji & Symbols and, from “Arrows”, inset into the text a return arrow, such as “Leftwards arrow with hook” (you could equal add “Return to Contents” as text, but I think an arrow looks nicer).
-
Now, select the arrow in the text and go to Edit > Add Link… Choose “No prefix” for the link and for the text of the link, type “contents.xhtml”. This will tell the arrow to link to the contents document. (For some reason, linking it to the contents document isn’t currently working - I need to look into that. But typing the HTML name directly
-
Copy and paste the arrow with the link at the bottom of each song.
One final tweak I might make is to add a hanging indent to the table of contents, given that the titles are quite long and spill across two lines. To do this:
-
Edit the “Songs Ebook” Format in Compile again.
-
Select “CSS” on the left and then, at the bottom of the “Custom Stylesheet” on the left, paste this:
nav#toc ol { padding-left: 2em; text-indent: -2em; }
(This is a rather advanced tweak, as you may gather!)
Okay, that was quite a lot of work! Note, though, that we could have stopped after the very first few changes and had a workable ebook. Everything else here was about turning into a really-nice looking ebook. One you’ve done all this, you have a format that can be used again and again - you can use the Songs Ebook format with other projects if you have other song collections. And it was more work than it would be for setting up, say, a standard novel or book, simply because you are compiling to a format (a collection of songs) that Scrivener doesn’t know about, so what we had to do above was create our own Compile Format for this. To do so, we started with the “Ebook” format and adapted it to our needs.
I’ve attached the resulting ebook, so that you can see the result of the above steps. The above steps should only take a little while to go through, and once you’ve been through them, you should have a much better idea of how to set all of this up in the future and the sort of thing you can do.
All the best,
Keith
SongEbook.zip (8.76 KB)