Is there way to edit docs "in code"?

I have a document that has a few different text formats. As is normally the case when I used Scrivener, the formatting has gone totally wacky. FUBAR (google it).

Is there a way for me to edit in the code, so I can see all the formatting code? I know if I can easily do that, everything would be peachy.

Side note: the ONLY thing I dislike about Scrivener is that formatting seems to have a mind of it’s own, never to be fixed, OFTEN. I can’t count the number of times that I copy all the text, paste into a text editor, copy that, then go back to Scrivener and paste into a new text doc.

Oh, I’ve been word processing for 30+ years, so inexperience isn’t the issue.

Any answers?

The text documents in a Scrivener project are basically rtf files. I would think it would be inadvisable to try and edit them directly in a plain text editor (TextWrangler, for example) and I don’t think it should be at all necessary. (I’ve occasionally hand edited the formatting code in an rtf file, and it is not a fun thing to do. I’ve never done it with a Scrivener file, and I never would.) I’ve never had any trouble with formatting in Scrivener, and I’ve been using it off and on since 2007 or earlier. The formatting works pretty much like TextEdit (the underlying text engine is the same). I would think if you could provide some specific examples of the problems you are having, then forum members or the support team would be able to solve them for you. “Wacky” is a bit too vague to permit much solid advice :slight_smile:

Cheers, Martin.

Thanks, Martin.

I don’t care if working in code is advisable, I just want to know if it can be done and how. That’s what I know I can do.

Wacky: this is what just happened. Typing in a doc, using the Body style, I created a list. Fine. Now I want to create another list under the header and that’s where everything goes off the rail. After the header I change back to body style before creating a new list … bolding won’t go away, line height won’t apply like the previous list, and the tabbing is not like the previous list (on the same page).

Oh, and nothing was cut and pasted from another doc. That’s all my typing directly in. Wacky? I think so.

Now, how do I edit code? Thanks!

It’s probably important to know that the text engine in Scrivener (which is the Mac OS X text engine) doesn’t know anything about styles in the way that they are implemented in (for example) MS Word. If you use list formatting, then type some body text, then start another list, the OS X text engine has no way of “remembering” the way the previous list was formatted. If you select some text in the document, and then click on the formatting “preset” it will apply whatever formatting has been specified for that preset to the selected text, and only to the selected text. If the preset has settings for line height, but not font size, for example, the font size will remain whatever it was before. And if you have a variety of different font sizes, they will remain different. Bold won’t necessarily be changed because the preset may not specify regular text … and so forth.

This may be a case where experience is actually unhelpful, because it leads one to expect a previously known paradigm to be in operation when in fact it is not. If you are used to using styles in word processors, you won’t find them in Scrivener. You could try playing around with the formatting in TextEdit to get an idea of the basics – that’s the way I learned (though I’m sure there are others).

If you really, really want to know what’s inside an rtf file, create one with TextEdit, with all sorts of formatting, and open it up in TextWrangler (it’s free). You will see your text surrounded by acres of code defining paragraph settings and I don’t know what. I imagine it should be easy enough to find more information about rtf on the net – it’s not exactly a simple set of codes like html.

Good luck!
Martin.

Okay, thanks, Martin. That was helpful.

I’m afraid, even after your good advice, I’m going to be dipping into the code after I output to mobi [html]. I think there a lot of formatting issues that I’m not even aware of right now.

Much appreciation for your time and clear explanation.

Bill

You’re welcome. Working on the html will be a lot easier than trying to edit rtf by hand. I assume one can use css, which would give more subtlety of output, but I’ve never looked at mobi. Hope it works for you.

Cheers, Martin.

Also it’s worth being aware there are some glitches and genuine bugs in the MacOS text system when it comes to lists and tables. These problems are inherited by apps like Scrivener and TextEdit which use that system (but not by Word, which has its own system for text, with bugs of its own).