# Sidebar Formatting

**URL:** <https://forum.literatureandlatte.com/t/sidebar-formatting/135108>\
**Category:** Newcomer Central\
**Tags:** compile, ebooks, usage-tips\
**Created:** [June 30, 2023, 10:14pm UTC](https://forum.literatureandlatte.com/t/sidebar-formatting/135108 "2023-06-30T22:14:34Z")\
**Posts on this page:** 1\
**Showing post:** 9

<div class="post-metadata">

**Author:** ![AmberV](https://forum.literatureandlatte.com/user_avatar/forum.literatureandlatte.com/amberv/32/13021_2.png) [@AmberV](https://forum.literatureandlatte.com/u/AmberV)\
**Post date:** [July 1, 2023, 3:51pm UTC](https://forum.literatureandlatte.com/t/sidebar-formatting/135108/9 "2023-07-01T15:51:22Z")

</div>

## Live example

Here is a functional example of the ideas above:

[margin\_note\_example.zip](https://forum.literatureandlatte.com/uploads/short-url/8Ti5rhmB1mV9kbB9FQJ7RvyqBC3.zip) (183.0 KB)

1. In the main editor, note the pink box in the sample text. This marks a margin note using the “Margin Note” paragraph style. We’ll get to why some of the text is underscored in a moment.

2. In `File ▸ Compile...`, double-click the “Ebook (with Notes)” Format to examine it.

3. In the Styles pane, locate the Margin Note style and have a look at its settings. All of these are fairly important. You need raw markup enabled so that Scrivener does not escape the raw markup we are inserting with the prefix and suffix fields.

4. Lastly, select the CSS compile format pane and scroll to the bottom of the “Custom Stylesheet” column, to see where I’ve pasted AntoniDol’s example.

5. Give that a test compile, and you’ll get a margin note in the first chapter!

A bit of setup, but easy peasy to work with in the writing area, and once you know these tricks you can do other fancy things as well.

## Alternatives & Disclaimers

- Now if the thought of writing in HTML now and then puts one off, there _are_ other ways of doing this. For example that aforementioned “Raw HTML Block” style could be used on a line above the margin note area, where one types in `<aside>`, and then the closing marker at the end using the same method. Now Scrivener is generating the paragraphs and all formatting within them. Using a similar idea to the first, one could create a “Start Margin Note” and “End Margin Note” style that exists purely to insert `<aside>` and `</aside>` respectively. I think you would want one space in such a paragraph to avoid the style being auto-cleaned on an empty paragraph. Maybe fine for a single-use case like this, but it could get out of hand if you intend to have a number of them.
- I haven’t personally broadly tested book reader support for the `<aside>` element. If this more semantically appropriate modern element is not supported in your ebook reader of choice, fall back to using `<div class="margin-note">` and adjust the CSS accordingly.

P.S. @sharonmurdock I’ve granted you upload permissions.

---

_[View the full topic](https://forum.literatureandlatte.com/t/sidebar-formatting/135108)._
