Won't compile with fully centred text - please help!

I’ve spent hours on this issue, having just upgraded to Scrivener 3.

When compiling a mobi of my book, my title page and back matter, which are centred in the file, come out with the first lines slightly to the left of where the lines in the below are. I’ve tried preserve formatting and compile ‘as is’ but every time, the compiler makes it so it isn’t all centred precisely. This is driving me insane!

This will probably require the exchange of a little configuration detail, as this works fine with very basic settings:

This depicts the results of the following actions:

  1. Created a new blank project.
  2. Enabled View/Text Editor/Show Page View for clarity.
  3. Hit the [b]Shift-Cmd-[/b] shortcut to centre text.
  4. Typed in the shown example text.
  5. Used File/Compile…, changing nothing save for the Compile for setting to “Kindle KF8/Mobi Ebook”.
  6. Opened the result in Calibre’s eBook viewer.

I’ve been struggling with odd lines jumping about as well.

I have my pages set to compile as-is, but odd lines seem to be moved over to the right slightly:

I couldn’t see any reason why they might be off-centre, I couldn’t see anything in the editor or compile settings:

I’d just given up on finding a solution to be honest and assumed it was some hidden checkbox I’d missed somewhere.

What does the CSS itself look like in the book source? To me that looks a bit like there is an indent on the lines not being centred properly. Indents adjust the middle point in the text column.

Again though, without much to go on other than descriptions and screenshots, it’s a bit hard to say. It would be easier to see what is happening with a live demonstration in a sample project.

Ah, thank you, it hadn’t occurred to me that it could be a paragraph indent.

I added a line break instead and the text is now centred:

Curiously, though it is now centred, the distance between the link and the image has now increased…

Do you think this may be a style setting? If so, do you know where I might alter it?

Many thanks,

I bet it has to do with line-height, which is being increased by the height of the image. With a line feed being used, the URL is adopting the line-height characteristics of the image line.

It might be easier to just make a style for all of this centred text that doesn’t have an indent, or use the stock “Centered Text” style. If I modify my initial example to omit step three, and insert after step for the step of selecting all of the text I typed in and applying the “Centered Text” style, I get the same result (but I might be getting that result because my default formatting does not use any form of indent or paragraph spacing, my “as-is” text is very clean).

Thank you for your help - I have been trying the styles as you suggested.

I think this may have been the problem, as there might have been some rogue styling that wasn’t showing up after I had pasted the text in ages ago (I had a problem earlier pasting from a .txt file and the text wouldn’t wrap - the lines just ran right off the page).

I have to admit I’m struggling to get my head around the new styles and Scrivener’s quirks. It doesn’t really work as I expect, and I’ll just have to take some time re-aligning my thinking (as I find happens a lot with Scrivener).

I created a style for my centred text, formatted as I wanted, and everything appears fine. But if I make a section italic, then it doesn’t appear italic when compiled. Is this the expected result? Am I supposed to create a separate ‘italic’ style for those paragraphs?

Also, are these styles the same as the Styles in the compile section, or just named the same? Shouldn’t my text styles I have created appear there too?

I’m so confused… :confused:

In fact what we were trying to accomplish here is bypassing anything the compiler might be doing to paragraph formatting. If you use a style in your editor that the compile format doesn’t specifically address (by name) then it should pass that formatting straight through—like Preserve Formatting would have done in v2.

So you could make a matching style in your compile settings and set it up the same way, but it shouldn’t be necessary.

Really even using a style shouldn’t be necessary—like I said in my initial example I don’t need a style there or any special settings at all. If I don’t do anything specifically then the document I created is compiled “as-is” by default, and any formatting in that document should be coming through as best ePub can display it. Using a style was a way of seeing if maybe there were some additional formatting you had in your compile settings that was adding the indent.

Regarding the italics, did you by chance create the style so that it stored character formatting as well? If so then that would make sense—italics are a kind of formatting.

Since you all really want the style to do is set the alignment and indents, you should create a paragraph style type.

Thanks for your reply.

Yes, I think the style I had created was overriding the editor and compile styles.

I’d prefer to avoid styles unless necessary, but I’m trying to work out how my text had originally ended up with paragraph indents, as I can’t see a way to edit or remove them in the text editor.

If I paste some text into a text file, is there a ‘good practice’ way to strip out all the formatting before I begin?

All the best,

Edit > Paste and Match Style – which will be your default text formatting if you’re pasting into an unstyled location

That. And the good old Documents/Convert/Text to Default Formatting command now has an optional checkbox to strip styles—could come in handy when importing styled documents.

Thanks for your replies, but trying both of these, each new paragraph still has a text indent, which was the problem I had before when trying to centre paragraphs and compile as-is.

Is there a way to remove the indent without having to apply a style?

Currently, if I ‘Paste and Match Style’ or convert text to default formatting I get indented paragraphs. When I select the ‘centred’ icon in the text editor, odd lines are misaligned:

If I select the text and choose the ‘Centred Text’ style, then the indentation is removed and everything aligns:

It would be nice to be able to remove all the formatting before working with ‘as-is’ text.

Or perhaps the ‘Align text to centre’ button should strip out paragraph indents as does the ‘Centred Text’ style?

You need to set your default text formatting and apply it to all your documents. In Scrivener Preferences, in the Editing tab, click on the Formatting button. Set up your default text the way you want. Close the Preferences dialog.

Now select all the texts you want to apply that formatting to, in the Binder. From the Documents menu, select Convert > Text to Default Formatting… You’ll get a pop-up like this:
Screenshot 2017-11-29 12.32.55.png
Select the options that will preserve any special formatting you’ve already applied. Given your goals, you will NOT want to check tabs and indents!

Thanks, but I don’t want to format the entire project - I was just wondering how I could remove the indents from pages I might use ‘as-is’, without resorting to styles.

I guess it might be easier in the long run to give in and use styles.

All the best,

EDIT: sorry, I’d misread your reply (it’s been a looong day/week with S3!), and see now that it can be applied to selected texts - Thanks, I’ll give it a go.

EDIT 2: Have you tried this on paragraph text? It doesn’t seem to work for me. With ‘Remove all styles’ checked, and everything else unchecked, the first line of each paragraph is still indented. Perhaps I’m missing something…

You don’t need styles to adjust the ruler, nor would you need to change your application defaults (though naturally if your default formatting has an indent then that would explain why converting your text to default formatting includes indenting it). All you need is View/Text Editing/Show Ruler, or Format/Paragraphs/Tabs and Indents… if you prefer the numerical route.