Testing Sidenotes Implementation

This is a demonstration of proper sidenotes and margin notes implementation, inspired by Gwern.net.

Making use of margins

The margins of the page can be utilized for supplementary information. This allows the main content to flow uninterrupted while providing context or additional details where needed.This is a standard sidenote that appears in the right margin of the document. Sidenotes are numbered sequentially throughout the document.

Margin notes{.marginnote} Unlike sidenotes, margin notes are unnumbered and always appear in the left margin. Margin notes are best used for summarizing adjacent paragraphs or providing small ‘section headers’.

are different from sidenotes. Because it’s usually best to keep paragraphs to reasonable widths, documents with sidenotes often have large margins, and these margins can be utilized.

Code Blocks with Syntax Highlighting

Python code should be properly highlighted:

def fibonacci(n):
    """Return the nth Fibonacci number."""
    if n <= 0:
        return 0
    elif n == 1:
        return 1
    else:
        return fibonacci(n-1) + fibonacci(n-2)

# Calculate the first 10 Fibonacci numbers
for i in range(10):
    print(f"fibonacci({i}) = {fibonacci(i)}")

Multiple sidenotes in sequence

This paragraph has multiple sidenotes in sequence.[This is the first sidenote in the sequence.][This is the second sidenote in a row.] They should be distributed between the left and right columns based on your implementation.This is the third sidenote, which should appear on the right again if you’re alternating sides.

Block quotes

“If the individual lived five hundred or one thousand years, this clash (between his interests and those of society) might not exist or at least might be considerably reduced. He then might live and harvest with joy what he sowed in sorrow; the suffering of one historical period which will bear fruit in the next one could bear fruit for him too.”

Formatting in sidenotes

It’s important to test that sidenotes can contain rich text formatting.This sidenote contains italic text, bold text, a link to example.com, and inline code. All of these elements should be preserved in the sidenote.

Math expressions

Inline math E = mc2 and display math:

f(x) = ∫−∞(ξ)e2πiξxdξ

Lists with sidenotes

  • First item in an unordered list
  • Second item with a sidenoteSidenotes can be attached to list items too.

  • Third item
  1. First item in an ordered list
  2. Second item
  3. Third item with a margin note{.marginnote} Margin notes work with ordered lists as well.

Tables

Column 1 Column 2 Column 3
Cell 1,1 Cell 1,2 Cell 1,3
Cell 2,1 Cell 2,2 Cell 2,3
Cell 3,1 Cell 3,2 Cell 3,3

Regular footnotes vs. sidenotes

This is a regular footnoteThis is a regular footnote that should appear at the bottom of the page if not transformed by your sidenotes system.

which should appear at the bottom of the page rather than in the margin.