@xiamenese : I bet that is your problem… you’ve given every paragraph in your project a style (as you would in Word), with the result that when you compile they are all formatted in the paragraph style, which doesn’t include italics, so strips them out.
That latter part was the original bug that was being reported, in that what you describe shouldn’t happen. The compiler should have special exemptions for direct formatting that is placed on top of styled text, so that it doesn’t get nuked when compiling. In older builds, it was getting nuked, but we fixed that and it should now be working as intended.
In practical usage the matter goes beyond body paragraph formatting. Say you want to italicise three words in a caption? (Yes, best practices would have one create a “Proper Noun” character style that uses italics to present itself, and apply that to the text rather than just messing around with font variants directly—but not everyone writes to best practices, clearly, or this thread wouldn’t exist, so we need to anticipate that in the design.)
While I do agree that the practice of applying a body style to all text, in a program like Scrivener, is needless and makes using the software more complicated than it should be—it’s still a supported way of working, and critical capabilities like making some text italic shouldn’t be mysteriously lost.
italics_in_styles.zip (148.3 KB)
Here is a sample project that demonstrates several different combinations of settings:
- Each of the three items in this test have two test paragraphs with italics in them. One is not styled and the other is. The styles used are the most impactful possible: font family and size are changed, and character formatting as well as paragraph formatting.
- The third item’s C-03 paragraph uses a different style (same configuration). We use two different “Body” styles so that we can test whether when the compiler overwrites the style design that makes a difference.
- The “Body” style in B-03 is passed through the compiler without modification, which can be evidenced by the fact that all of the formatting around that paragraph changes, while it sticks to what we see in the editor.
- The “Body Temp” style in C-03 has a rule in the Styles compile format pane that reformats the font family and size to match the rest of the text around it. I also added a little indent to help illustrate that this text is being manipulated specially.
- All italic ranges are also highlighted for ease of referencing in the output.
- All six italic ranges are preserved in output, whether the Section Layout reformats the paragraph, or the style is exempting the paragraph from reformatting, or the style is being reformatted itself.
While that is useful for demonstrating what works, the problem is that these are only six of many different ways to set things up.