Structuring vs Layout Dilemma

Hi, I’m a newbie to Scrivener and coming from ConTeX (TeX/Latex flavour) and am struggling a bit to structure a book (10 Chapters, frontmatter, etc). Primary target is epub for the time being. This is what ConTeX doesn’t do. I am used to separating layout and structured content. Structuring in Scrivener is my problem. I assume a workflow: write and structure in Scrivener editor and binder, create the “look” at compile time.

Since the frontmatter and each chapter has an epigraph, I went searching for a solution. I found this post: to be helpful.

What I am not able to achieve is the required layout without creating some complex structure of folder and file levels which are unrelated to the document structure. Essentially I have split out each style requirement into a separate file or level – which doesn’t seem sensible. If anything, it makes the compile settings rather complex

To give an idea what I am trying to achieve, I have attached a PDF as sample (created with ConTeX). dummy-text.pdf (26.8 KB) There are 3 header styles: Chapter, Chapter subtitle, section title. Plus the epigraph with author. All this repeats in every chapter.

I realize Scrivener does not have paragraph styles in the sense of Word, but do I really need to use “preserve” every epigraph, possibly header, or split each header into a separate file? And if I want to change the formatting go through every piece of text again? That is way too much direct formatting.

Help is needed! How can I achieve my goal without using (too much) direct formatting and using a folder/file structure that reflects that content of the book rather than formatting requirements?

Any help is much appreciated!

My personal take on this – and it is entirely personal – is that composing is something I do in Scrivener, and layout is something I do in another program (typically Nisus Writer Pro). I find it useful to split the two tasks. (However, I could see that it might be undesirable to do that – if you have a case in which layout is in some way a fundamental part of whatever you are composing).

Someone cleverly pointed out that if one uses unique formatting for each level of heading (a font point size or colour that one uses nowhere else) you can do a find / exchange in a WP like Nisus and easily change those formattings into heading styles.


There’s no one way of doing this - you can achieve the results you are after using different structures and different Compile settings. Most of what you want to achieve is straightforward. The only part that needs a little though is the epigraph. There are a couple of ways of achieving that. One way is to use Custom Meta-Data and append it to the title using title suffixes. The only problem with that is that the title suffix can only use one formatting style, and your example has the main epigraph in italics and the attribution in non-italics. If it could all be in italics, custom meta-data would work fine for this. The other way is to just type the epigraph into the text, aligned as you want it, and then to use Format > Formatting > Preserve Formatting. This is probably the best way of achieving what you want.

I have attached a .zip file for you to download that contains three sample projects. All of them, when compiled, will produce a document that is very close to the example you provided. Some notes:

This one uses custom meta-data to add the epigraphs. Chapters are file groups.

This is probably the one you will want to go for. Chapters are folders which contain the epigraph text and the text up to the first subtitle. Note that the epigraphs have “Preserve Formatting” applied to them, and in the “Formatting” pane of Compile, under Options…, text with “Preserve Formatting” applied is set only to preserve alignment, tabs and indents. That way the font face and line spacing selected in Compile will still apply.

This one uses file groups within each folder to hold the epigraph and first chunk of text. This would be useful if you needed more than one second-level heading within each chapter.

That should hopefully get you up and running.

All the best,
Keith (164 KB)

I appreciate your personal take. I suppose its a matter of balancing strengths of one software against another to achieve the goal. Scrivener certainly has its strength for composing, i.e. juggling text around and moving through the whole project at high speed. Obviously I could move to another software to achieve a good layout, but it kind of defeats the purpose. I am reasonably good in using regular expressions in TextMate (a feature I am missing in Scrivener) so a path via HTML and Sigil to my desired target ePubs seems doable. But I am trying to avoid it. If some sort of back-end work through a word processor is needed, I would probably loose Scrivener out of the loop for this use.

Thanks for the files/samples. Yes, they are a good place to start. First tries look promising. I do want the epigraph and attribution to have different “looks”, so the meta-tags are not a good option.

Two questions I have:
The first line indent is only prevented after a title. In the solution 2, the inserted epigraph prevents that. It seems to be interpreted as plain text and therefore the first paragraph of the actual text is indented. Any way to automate that without using direct/preserved formatting?

Secondly: I am not too keen on the preserved formatting on the epigraphs as it means I have to ensure equal handling on all 10 paragraphs. Not really a big problem, even if a change of style is needed, but still, a good amount of direct formatting that I would prefer to avoid. After all, there is the promise to automate output creation. Anything that can be done?

And a final question, looking into the generated ePub with Sigil, I notice the main text is a single HTML file rather than chapter split. Am I missing something? After all, ePubs work better on (slow) readers with small files.

Thanks for suggestions once again!

I’d do this by separating the epigraph from the rest of the text, ultimately a mix of the second and third examples Keith provided, although this might go against your original comment regarding binder structure; it works for me, but that might just be how I think about things. (Epigraph for the chapter fits in the chapter folder; main text up to the first subtitle seems like it’d be an intro for the full chapter, and so could be set apart and “above” the subsections, etc.) For example, in this binder structure, the epigraph is placed as the only text in the folder, and the main text up to the first subtitle is placed in a file group inside the folder.
With this, you can format the text of the folder (the epigraph) in compile, so all you’d really need to worry about in drafting is making sure that you italicize it (since you aren’t italicizing the byline, thus that’s not formatting you’d want to apply at compile time). Formatting for the file group (text up to the first subtitle) will presumably be the same as that for the single documents, but you can leave the “title” checkbox deselected in compile formatting so that you don’t get an unwanted subtitle for that section:

This also lets you remove the first line indent for all your main text the way you’re looking to do, although you can also get that to work in Keith’s examples by changing the rule for first-line indent removal from “At the start of each new document” to “After empty lines and centered text”.

Note that I deliberately set it up like this to match the sample you provided. If you double-check the dummy-text.pdf you attached to your first post, you will note that the paragraph after the epigraph has a first line indent. I therefore assumed this was your intention, which is why I thought the second example was the best.

As Jennifer points out, to change that, just switch from “At the start of each new document” to “After empty lines and centered text” in “Option…” in the Formatting pane.

I’m not entirely sure why this is an issue. For those paragraphs all you need to do is right-align them and assign Preserve Formatting, nothing more - only alignment is set up to be preserved for Preserve Formatting blocks in Formatting > Options… in Compile; the rest of the formatting (line spacing etc) is taken from the Compile settings, so you don’t need to worry about any of that. Of course, you could always set up a formatting preset (Format menu > Formatting) entitled “Epigraph” with Preserve Formatting and right alignment set. Then all you need to do is select that preset from the format bar and apply it to each epigraph you create - a single step each time.

If those solutions don’t appeal to you, then Jennifer’s suggested structure is the way to go. I deliberately ignored adding that extra level in my own examples seeing as you wanted to avoid that, and I wanted to show how this could be done with a simple structure.

Each chapter is a separate HTML file within the .epub. An document with a page break before it or separated by a “Section/Page Break” via the Separators pane will be a separate file. You can see this for yourself by changing the extension of an .epub file to .zip and then extracting it to see the contents. If you are seeing one long HTML file then you have not set up the Separators correctly and need to add section breaks.

Hope that helps!

All the best,

The issue is separating markup from presentation. The goal, for some of us, is to be able to mark some text as epigraph, and to be able to make a global decision about how all epigraph text should be formatted. If I change my mind and decide that all epigraphs should be double-spaced bold comic-book 17.3 point, there should be one place I can go to to make that change. If I have to change it in two dozen places there’s a risk that I’ll miss one or two of them.

That’s something that LaTeX, used properly, does well. It’s also the essence of styles. I appreciate the difficulty of implementing this sort of thing in Scrivener, as well as the fact that most people don’t approach formatting this way. I’m just trying to clarify what the underlying issue is.

Yes, I understand that, but the user was saying he would like to avoid lots of direct formatting, and I was concentrating on providing a solution that will work right now. In this instance, setting up a preset with “Preserve Formatting” as part of it and applying it to these sections, and using the Compile settings as directed, would cause no more work (or need for direct formatting) than a styles-based solution. Barring that, Jennifer’s solution is the way to go, or my first example, which shows how to use custom meta-data for epigraphs (although not ideal in the user’s situation because of particular formatting needs).

Thanks for all the thorough replies! Work kept me from an earlier reply.

Let me try to address the various things, hopefully I won’t miss anything.

Apologies, yes, the dummy sample should have had a non indented paragraph. I really don’t want the paragraph after the epigraph indented. Working with the “Formatting/Options…”, as you and Jenifer pointed out, works very well! I took a closer look at them and there seems to be quite a bit of “power” in the options.

By now I also realized that each folder in Scrivener results in a separate html file in an ePub. Newbie glitch.

Thanks for the great detail of your reply! I have started doing some modification in the direction you suggested though I need to look at it in more detail what consequences come from it. When I do the split as you suggest, i.e. put the epigraph into the folder, it does help. A new problem comes up immediately: the secondary title is between Chapter heading and epigraph and therefore has the be in the chapter folder. Again creating the need for preserving formatting rather than creating it at run time. As a thought: would I need to split it (and others) out to their own level to generate the proper styling?

Here your statement

is key. I am used to working in a very different way. Possibly I should not shy away from using some kind of multilevel structure in the binder (or outliner). I am just rather clueless how to get there. From my trials so far, I can see where things might be going, but it just feels odd to me.

Here pete340’s comment

is relevant. This is what I am used to from early days of Word once they introduced styles and now in ConTeXt (a “modern” version of Latex Sure, it is not much effort to change and preserve the 10 epigraphs, but, I would much rather define the style in a single location and tag each epigraph in some way as “epigraph”. Changing the looks is a matter of changing a single definition, re-compiling and done. Changing and tweaking is easy and highly reliable. I know that I will always forget something if time pressure is on. Direct formatting for structural elements like headers, block citations, epigraphs, etc. seems unreliable regarding consistency. Just imagine a dissertation with, maybe, a hundred block-citations all needing to be changed or 50 headers. Avoiding that kind of painstaking, repetitious work is the reason computers are used.

Enough rambling on this. It may just be that I have put many hours into completely separating structure and layout and not into the Scrivener way of doing things. Though I still am keen to find out more.
Thanks to all, Bart

Working from the dummy text you provided, I’m assuming “secondary title” is the text such as “Power to all”. If this is the case, there’s no need to add this text separately to the folder; instead, use it as the folder’s title, as in my example screenshot, then include the folder titles when you compile. You can then easily tweak formatting for that as part of the compile process (just click in the “title” text in the formatting sample to format it). The “Chapter” heading can be added as a title prefix in compile (also something you can then format at that stage), so it doesn’t need to be used in the binder at all.

As I said, for me personally this still works to give me structural meaning in the binder vs. having it set up solely for how it will be formatted; the outline hierarchy moves to increasing specificity as you work down through each section. But as Keith said initially, there are certainly plenty of different ways this could be done, so as you’re going you may find some combination of ideas here works best for how you construct your documents, and there’s really not a wrong way as long as you get something you like!